create-moost 0.6.25 → 0.6.26
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 +30 -12
- package/dist/index.cjs +7 -2
- package/dist/index.mjs +7 -2
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -7,30 +7,48 @@
|
|
|
7
7
|
</a>
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
|
-
`create-moost` is an npm initializer
|
|
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
|
-
|
|
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
|
-
|
|
16
|
+
```bash
|
|
17
|
+
npm create moost
|
|
18
|
+
```
|
|
17
19
|
|
|
18
|
-
|
|
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
|
-
|
|
28
|
+
### Flags
|
|
25
29
|
|
|
26
|
-
|
|
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
|
-
|
|
40
|
+
### Prompts
|
|
29
41
|
|
|
30
|
-
|
|
31
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
"version": "0.6.26",
|
|
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.
|
|
47
|
+
"@wooksjs/event-cli": "^0.7.19",
|
|
48
48
|
"prompts": "^2.4.2",
|
|
49
|
-
"@moostjs/event-cli": "^0.6.
|
|
50
|
-
"moost": "^0.6.
|
|
49
|
+
"@moostjs/event-cli": "^0.6.26",
|
|
50
|
+
"moost": "^0.6.26"
|
|
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.
|
|
56
|
+
"@moostjs/vite": "^0.6.26"
|
|
57
57
|
},
|
|
58
58
|
"scripts": {
|
|
59
59
|
"pub": "pnpm publish --access public",
|