create-moost 0.6.25 → 0.6.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -7,30 +7,48 @@
7
7
  </a>
8
8
  </p>
9
9
 
10
- `create-moost` is an npm initializer module that allows you to quickly set up new Moost applications. It provides a simple command-line interface to create Moost applications, either as a HTTP app or a CLI app.
10
+ `create-moost` is an npm initializer that scaffolds new Moost applications. It supports four project types: HTTP (Web) application, Vue + Moost (SSR/SPA), WebSocket application, and CLI application.
11
11
 
12
12
  ## Getting Started
13
13
 
14
- To use `create-moost`, make sure you have Node.js (version 14 or above) and npm (Node Package Manager) installed on your machine. Then, follow the steps below to create your Moost application.
14
+ Make sure you have Node.js 20.19+ (or 22.12+) installed — the scaffolded projects rely on Vite/Rolldown, which require it. Then run:
15
15
 
16
- ### Creating a HTTP App
16
+ ```bash
17
+ npm create moost
18
+ ```
17
19
 
18
- To create a Moost HTTP app, use the following command in your terminal:
20
+ Without flags the CLI runs in interactive mode: it prompts for the project name, the Moost adapter (HTTP, Vue + Moost SSR/SPA, WebSocket, or CLI), and the type-specific options below.
21
+
22
+ You can pass a project name and a type flag to skip the corresponding prompts:
19
23
 
20
24
  ```bash
21
- npm create moost -- --http
25
+ npm create moost my-app -- --http
22
26
  ```
23
27
 
24
- This command will initiate the creation of a new Moost HTTP app. It will prompt you to configure the project name, whether to include a Moost Workflows example, and whether to add do-me-lint (smart eslint installer).
28
+ ### Flags
25
29
 
26
- ### Creating a CLI App
30
+ | Flag | Effect |
31
+ | --------- | ----------------------------------------------------------------- |
32
+ | `--http` | Scaffold an HTTP (Web) application |
33
+ | `--ssr` | Scaffold a Vue + Moost (SSR/SPA) application |
34
+ | `--ws` | Scaffold a WebSocket application (with `--http`: add WebSockets to the HTTP app) |
35
+ | `--cli` | Scaffold a CLI application |
36
+ | `--wf` | Include the Moost Workflows example (applied to HTTP projects) |
37
+ | `--oxc` | Add OXC lint and formatter (oxlint + oxfmt) |
38
+ | `--force` | Overwrite a non-empty target directory without asking |
27
39
 
28
- To create a Moost CLI app, use the following command in your terminal:
40
+ ### Prompts
29
41
 
30
- ```bash
31
- npm create moost -- --cli
32
- ```
42
+ Depending on the chosen project type, the CLI asks:
43
+
44
+ - **Project name** and **package name** — skipped when a valid name is passed as an argument
45
+ - **Enable SSR (Server-Side Rendering)?** — `ssr` projects only (answering No produces an SPA-only setup); skipped when `--ssr` is passed
46
+ - **Add WebSockets?** — `http` projects only; skipped when `--ws` is passed
47
+ - **Add Moost Workflows Example?** — skipped for `cli` and `ws` projects, and when `--wf` is passed
48
+ - **Add OXC lint and formatter (oxlint + oxfmt)?** — asked for every project type unless `--oxc` is passed
49
+
50
+ Each flag pre-selects its answer and skips the matching prompt, so passing all relevant flags scaffolds fully non-interactively, e.g. `npm create moost my-app -- --http --ws --wf --oxc --force`.
33
51
 
34
- This command will start the creation process for a new Moost CLI app. It will prompt you to configure the project name and whether to add do-me-lint (smart eslint installer).
52
+ After scaffolding, the CLI prints the next steps (install dependencies and start the dev server).
35
53
 
36
54
  ## [Official Documentation](https://moost.org/)
package/dist/index.cjs CHANGED
@@ -42,6 +42,11 @@ async function getPrompts(inputs) {
42
42
  projectName: inputs.name || "",
43
43
  packageName: inputs.name || ""
44
44
  };
45
+ if (inputs.ws) predefined.ws = true;
46
+ if (inputs.wf) predefined.wf = true;
47
+ if (inputs.ssr) predefined.ssr = true;
48
+ if (inputs.oxc) predefined.oxc = true;
49
+ if (inputs.force) predefined.overwrite = true;
45
50
  try {
46
51
  const results = await (0, prompts.default)([
47
52
  {
@@ -73,7 +78,7 @@ async function getPrompts(inputs) {
73
78
  "cli",
74
79
  "ws",
75
80
  "ssr"
76
- ].filter((t) => inputs[t]);
81
+ ].filter((t) => inputs[t] && !(t === "ws" && inputs.http));
77
82
  if (selected.length === 1) {
78
83
  predefined.type = selected[0];
79
84
  return null;
@@ -110,7 +115,7 @@ async function getPrompts(inputs) {
110
115
  {
111
116
  name: "ssr",
112
117
  type: (prev, values) => {
113
- if ((values.type || predefined.type) !== "ssr") return null;
118
+ if ((values.type || predefined.type) !== "ssr" || inputs.ssr) return null;
114
119
  return "toggle";
115
120
  },
116
121
  message: "Enable SSR (Server-Side Rendering)?",
package/dist/index.mjs CHANGED
@@ -13,6 +13,11 @@ async function getPrompts(inputs) {
13
13
  projectName: inputs.name || "",
14
14
  packageName: inputs.name || ""
15
15
  };
16
+ if (inputs.ws) predefined.ws = true;
17
+ if (inputs.wf) predefined.wf = true;
18
+ if (inputs.ssr) predefined.ssr = true;
19
+ if (inputs.oxc) predefined.oxc = true;
20
+ if (inputs.force) predefined.overwrite = true;
16
21
  try {
17
22
  const results = await prompts([
18
23
  {
@@ -44,7 +49,7 @@ async function getPrompts(inputs) {
44
49
  "cli",
45
50
  "ws",
46
51
  "ssr"
47
- ].filter((t) => inputs[t]);
52
+ ].filter((t) => inputs[t] && !(t === "ws" && inputs.http));
48
53
  if (selected.length === 1) {
49
54
  predefined.type = selected[0];
50
55
  return null;
@@ -81,7 +86,7 @@ async function getPrompts(inputs) {
81
86
  {
82
87
  name: "ssr",
83
88
  type: (prev, values) => {
84
- if ((values.type || predefined.type) !== "ssr") return null;
89
+ if ((values.type || predefined.type) !== "ssr" || inputs.ssr) return null;
85
90
  return "toggle";
86
91
  },
87
92
  message: "Enable SSR (Server-Side Rendering)?",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-moost",
3
- "version": "0.6.25",
3
+ "version": "0.6.27",
4
4
  "description": "create-moost",
5
5
  "keywords": [
6
6
  "composables",
@@ -44,16 +44,16 @@
44
44
  },
45
45
  "dependencies": {
46
46
  "@prostojs/rewrite": "^0.2.3",
47
- "@wooksjs/event-cli": "^0.7.17",
47
+ "@wooksjs/event-cli": "^0.7.19",
48
48
  "prompts": "^2.4.2",
49
- "@moostjs/event-cli": "^0.6.25",
50
- "moost": "^0.6.25"
49
+ "@moostjs/event-cli": "^0.6.27",
50
+ "moost": "^0.6.27"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@types/prompts": "^2.4.9",
54
54
  "vite": "^8.0.10",
55
55
  "vitest": "3.2.4",
56
- "@moostjs/vite": "^0.6.25"
56
+ "@moostjs/vite": "^0.6.27"
57
57
  },
58
58
  "scripts": {
59
59
  "pub": "pnpm publish --access public",