You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An import pattern should be added to the lexer, rules should be written for parser and generator, and the necessary runtime (if needed) should be created.
Add import pattern in core/patterns.js
Add from pattern in core/patterns.js
Add parser rules in core/clio.beef
Add generator rules in core/generator.js
Add required builtins and runtime in core/internals
We need to know how where the compile modules should be stored and how they should be compiled. There are several approaches to this:
Modules are compiled on publish: This will simplify requiring them in compiled code, but it'll make it impossible to import modules from git or other places (not published to Clio package repository).
Modules are fetched and compiled on install:
Modules are fetched, compiled, and stored in a clio_modules directory. The clio_modules directory will be published to npm (If the user wants to publish their project to npm). This makes the project size huge. require function should be patched to make this work.
Modules are fetched, compiled, and stored in node_modules/clio_modules. This method does not need patching require function, however, if user publishes the package to npm, since the node_modules directory isn't published it will break the module.
Fetch and compile Clio dependencies on npm install. We can put Clio dependencies in clioDependencies field of package.json and write a postinstall hook for the package. This way all compiled packages will depend on Clio cli and tools.
The text was updated successfully, but these errors were encountered:
An
import
pattern should be added to the lexer, rules should be written for parser and generator, and the necessary runtime (if needed) should be created.import
pattern incore/patterns.js
from
pattern incore/patterns.js
core/clio.beef
core/generator.js
core/internals
Import statement should work with below patterns:
For beef files, there's a vscode addon hosted here:
https://github.com/pouya-eghbali/bean/tree/master/vscode-beef
Discussion:
We need to know how where the compile modules should be stored and how they should be compiled. There are several approaches to this:
Modules are compiled on publish: This will simplify requiring them in compiled code, but it'll make it impossible to import modules from git or other places (not published to Clio package repository).
Modules are fetched and compiled on install:
Modules are fetched, compiled, and stored in a
clio_modules
directory. Theclio_modules
directory will be published to npm (If the user wants to publish their project to npm). This makes the project size huge.require
function should be patched to make this work.Modules are fetched, compiled, and stored in
node_modules/clio_modules
. This method does not need patchingrequire
function, however, if user publishes the package to npm, since thenode_modules
directory isn't published it will break the module.Fetch and compile Clio dependencies on
npm install
. We can put Clio dependencies inclioDependencies
field ofpackage.json
and write apostinstall
hook for the package. This way all compiled packages will depend on Clio cli and tools.The text was updated successfully, but these errors were encountered: