@marcellejs/cli v0.0.5
Marcelle CLI
A command line interface for Marcelle applications
Installation
The CLI is an npm package that must be installed globally:
npm install -g @marcellejs/cliOnce installed, the marcelle command should be available:
marcelle --versionUsage
Generating an Application
To generate a new project:
mkdir myproject
cd myproject
marcelle generate appSeveral options are available to customize the project. If you don't know what to chose, just hit enter to select the defaults.
This will scaffold a new Marcelle project with the following structure (it might vary according to the build tool, this example is for vite):
.
├── README.md
├── index.html # The main HTML page for your application
├── package.json
├── src
│ ├── index.js # Main application script
│ └── modules # Directory containing local modules bundled with your application
│ └── index.js
└── vite.config.js # Build tool configuration fileTo run the application in development mode (with HMR), run:
npm run dev # or yarn devGenerating a Module
It is possible to use the generator to create new custom modules for an application or a marcelle package.
marcelle generate moduleJust enter your module's name (e.g. my-module) and the generator will create a template module that you can your in your script:
import { myModule } from "./modules";
const m = myModule(opts);Modules are stored in the src/modules directory and provide a Svelte view by default:
.
├── src
│ └── modules
│ ├── my-module
│ │ ├── my-module.module.js # Module definition file
│ │ ├── my-module.svelte # Svelte component defining the module's view
│ │ └── index.js # function wrapper
│ └── index.jsGenerating a Backend
It is possible to use the generator to add server-side data storage (backend).
marcelle generate backendTwo options are available for the backend:
- The type of database: NeDB and MongoDB are currently supported.
- Whether or not it should use authentication.
To run the server:
npm run backendThe backend configuration files are stored in backend/configuration.
About
Marcelle CLI's generators are provided by generator-marcelle.
✍️ Authors
🎉 Acknowledgements
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago