`Wick.Script` class

Open
#215 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Active
Domain
backend

Research direction

Start by tracing how scripts are currently stored on Tickables, how existing script methods work, and how Clips are exported as .wickobj files. Use the proposed Wick.Script declaration and the three modes as the scope, with completion requiring backward compatibility and support for tickable, call, and autorun scripts.

Written by the indexing model from the issue text.

Description

enhancement

Is your feature request related to a problem? Please describe.
The current way script storage is handled inside Candlestick can cause problems with the plan to make a human-friendly wick file format.

Scripts currently exist as properties of Tickables. They should be separated.

Describe the solution you'd like
A Wick.Script class would be created. It should roughly fit this TypeScript declaration:

declare class Wick.Script extends Wick.Base {
  text: string;
  arguments: string[];
  name: string;
  type: "tickable" | "call" | "autorun";

  run({}: Partial<{tickable: Wick.Tickable, globalContext: object, callee: Wick.Tickable}>);
  rewriteScript(newText: string);
}

Scripts can have three modes:

  • 'Tickable': This just copies how it currently works;
  • 'Call': Adds the script text as a function with arguments;
  • 'Autorun': Automatically runs script before the rest of the project.

For backwards compatibility, Clips with self-contained scripts will be ported to the new system, the old system will still be partially used for the exporting of clips as .wickobj files, and the old script methods will redirect to the Script class.

Dominant language
JavaScript
Stars
51
Forks
20
Avg merge
14d 12h
Merged PRs (30d)
3

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Candlestickers/Candlestick

All issues in Candlestickers/Candlestick

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.