Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add create package for simpler project init #228

Closed
chrispcampbell opened this issue Sep 6, 2022 · 1 comment · Fixed by #235 or #233
Closed

Add create package for simpler project init #228

chrispcampbell opened this issue Sep 6, 2022 · 1 comment · Fixed by #235 or #233
Assignees
Labels

Comments

@chrispcampbell
Copy link
Contributor

Currently it is not as easy as it could be to get started with SDE. With the new build and plugin system, we have most of the foundation in place, and there is a hello-world project that can be used as a kind of template, but it would be better if the user could just type the following:

# Assume that my-dir contains a Vensim model
cd my-dir
npm create @sdeverywhere
npm start

Ideally that one create command would create files such as package.json, sde.config.js, a "core" library (that wraps the generated wasm model), and a simple app template to get the user started.

The start command would then start the local dev builder, which runs the generated app and opens the model-check report.

@chrispcampbell
Copy link
Contributor Author

I modeled the implementation on Astro's create-astro package, which I thought was nicely done and makes good use of the ora and prompts packages for a nice CLI experience.

Here's a screenshot of what the new create command looks like:

Screen Shot 2022-09-21 at 10 25 25 PM

It automates the following steps that would normally be manual and tedious:

  • create project structure (from one of the two templates)
  • set up the sde.config.js file to point to the new config + mdl files
  • generate a sample model-check ({mdl}.check.yaml) test file
  • configure a graph in graphs.csv (optional)
  • configure a few sliders in inputs.csv (optional)
  • install the Emscripten SDK (optional)
  • install npm/yarn/pnpm dependencies (optional)
  • initialize a git repo (optional)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant