Wicklets / wick-editor

A free and open-source tool for creating games, animations and everything in-between!
https://www.wickeditor.com
GNU General Public License v3.0
643 stars 110 forks source link

Publish runtime to NPM #345

Open ghost opened 2 years ago

ghost commented 2 years ago

Is your feature request related to a problem? Please describe. No.

Describe the solution you'd like Integrate Wick Editor runtime with NPM projects which are bundled for the browser using tools like Webpack, Rollup, Parcel etc.. The goal of using the runtime is for loading multiple .wick files from a HTML project, without using timeline code.

It'd be interesting for it to work both at Web Browser and Node.js (for back-end streamed projects). For this I recommend using the "browser" property in NPM package.json (which is handled by the bundlers like Webpack, Parcel etc.):

{
  ...
  "browser": {
    "./src/code4nodejs.js": "./src/code4browser.js"
  }
  ...
}

Or provide a package for each (in case a HTML reference or Node.JS API reference exists into the runtime):

(They could share the same .wick parser.)

Additionally, TypeScript typings:

{
  ...
  "types": "./src/typings.d.ts",
  "typings": "./src/typings.d.ts"
  ...
}

Describe alternatives you've considered Currently it is possible to get the Wick Editor JavaScript runtime by exporting a dummy project from the editor to a compressed archive and then retrieving the runtime JS, but this should be much easier.

Additional context Nothing