create-moost 0.6.9 → 0.6.10

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/dist/index.cjs CHANGED
@@ -1,4 +1,5 @@
1
- //#region rolldown:runtime
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ //#region \0rolldown/runtime.js
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;
4
5
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,12 +7,16 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
7
  var __getProtoOf = Object.getPrototypeOf;
7
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
9
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
- key = keys[i];
11
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
- get: ((k) => from[k]).bind(null, key),
13
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
- });
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
+ key = keys[i];
13
+ if (!__hasOwnProp.call(to, key) && key !== except) {
14
+ __defProp(to, key, {
15
+ get: ((k) => from[k]).bind(null, key),
16
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
+ });
18
+ }
19
+ }
15
20
  }
16
21
  return to;
17
22
  };
@@ -21,12 +26,13 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
21
26
  }) : target, mod));
22
27
 
23
28
  //#endregion
24
- const __moostjs_event_cli = __toESM(require("@moostjs/event-cli"));
25
- const __wooksjs_event_cli = __toESM(require("@wooksjs/event-cli"));
26
- const fs = __toESM(require("fs"));
27
- const prompts = __toESM(require("prompts"));
28
- const __prostojs_rewrite = __toESM(require("@prostojs/rewrite"));
29
- const path = __toESM(require("path"));
29
+ let _moostjs_event_cli = require("@moostjs/event-cli");
30
+ let _wooksjs_event_cli = require("@wooksjs/event-cli");
31
+ let fs = require("fs");
32
+ let prompts = require("prompts");
33
+ prompts = __toESM(prompts);
34
+ let _prostojs_rewrite = require("@prostojs/rewrite");
35
+ let path = require("path");
30
36
 
31
37
  //#region packages/create-moost/src/prompts.ts
32
38
  const defaultProjectName = "moost-app";
@@ -49,8 +55,7 @@ async function getPrompts(inputs) {
49
55
  name: "overwrite",
50
56
  type: () => canSkipEmptying(predefined.targetDir) || inputs.force ? null : "confirm",
51
57
  message: () => {
52
- const dirForPrompt = predefined.targetDir === "." ? "Current directory" : `Target directory "${predefined.targetDir}"`;
53
- return `${dirForPrompt} is not empty. Remove existing files and continue?`;
58
+ return `${predefined.targetDir === "." ? "Current directory" : `Target directory "${predefined.targetDir}"`} is not empty. Remove existing files and continue?`;
54
59
  }
55
60
  },
56
61
  {
@@ -63,13 +68,12 @@ async function getPrompts(inputs) {
63
68
  {
64
69
  name: "type",
65
70
  type: () => {
66
- const typeFlags = [
71
+ const selected = [
67
72
  "http",
68
73
  "cli",
69
74
  "ws",
70
75
  "ssr"
71
- ];
72
- const selected = typeFlags.filter((t) => inputs[t]);
76
+ ].filter((t) => inputs[t]);
73
77
  if (selected.length === 1) {
74
78
  predefined.type = selected[0];
75
79
  return null;
@@ -106,8 +110,7 @@ async function getPrompts(inputs) {
106
110
  {
107
111
  name: "ssr",
108
112
  type: (prev, values) => {
109
- const type = values.type || predefined.type;
110
- if (type !== "ssr") return null;
113
+ if ((values.type || predefined.type) !== "ssr") return null;
111
114
  return "toggle";
112
115
  },
113
116
  message: "Enable SSR (Server-Side Rendering)?",
@@ -118,8 +121,7 @@ async function getPrompts(inputs) {
118
121
  {
119
122
  name: "ws",
120
123
  type: (prev, values) => {
121
- const type = values.type || predefined.type;
122
- if (type !== "http" || inputs.ws) return null;
124
+ if ((values.type || predefined.type) !== "http" || inputs.ws) return null;
123
125
  return "toggle";
124
126
  },
125
127
  message: "Add WebSockets?",
@@ -176,7 +178,7 @@ function toValidPackageName(projectName) {
176
178
 
177
179
  //#endregion
178
180
  //#region packages/create-moost/src/scaffold.ts
179
- const rw = new __prostojs_rewrite.ProstoRewrite({ textPattern: [
181
+ const rw = new _prostojs_rewrite.ProstoRewrite({ textPattern: [
180
182
  "*.{js,jsx,ts,tsx,txt,json,jsonc,yml,yaml,md,ini,css,html}",
181
183
  "Dockerfile",
182
184
  "*config",
@@ -260,7 +262,7 @@ function _ts_param(paramIndex, decorator) {
260
262
  decorator(target, key, paramIndex);
261
263
  };
262
264
  }
263
- let Commands = class Commands$1 extends __moostjs_event_cli.CliApp {
265
+ let Commands = class Commands extends _moostjs_event_cli.CliApp {
264
266
  root() {
265
267
  return this.execute();
266
268
  }
@@ -268,29 +270,29 @@ let Commands = class Commands$1 extends __moostjs_event_cli.CliApp {
268
270
  return this.execute(name);
269
271
  }
270
272
  async execute(name) {
271
- if ((0, __wooksjs_event_cli.useAutoHelp)()) process.exit(0);
272
- const prompts$2 = await getPrompts({
273
+ if ((0, _wooksjs_event_cli.useAutoHelp)()) process.exit(0);
274
+ const prompts = await getPrompts({
273
275
  name,
274
- http: !!(0, __wooksjs_event_cli.useCliOption)("http"),
275
- cli: !!(0, __wooksjs_event_cli.useCliOption)("cli"),
276
- ws: !!(0, __wooksjs_event_cli.useCliOption)("ws"),
277
- wf: !!(0, __wooksjs_event_cli.useCliOption)("wf"),
278
- ssr: !!(0, __wooksjs_event_cli.useCliOption)("ssr"),
279
- oxc: !!(0, __wooksjs_event_cli.useCliOption)("oxc"),
280
- force: !!(0, __wooksjs_event_cli.useCliOption)("force")
276
+ http: !!(0, _wooksjs_event_cli.useCliOption)("http"),
277
+ cli: !!(0, _wooksjs_event_cli.useCliOption)("cli"),
278
+ ws: !!(0, _wooksjs_event_cli.useCliOption)("ws"),
279
+ wf: !!(0, _wooksjs_event_cli.useCliOption)("wf"),
280
+ ssr: !!(0, _wooksjs_event_cli.useCliOption)("ssr"),
281
+ oxc: !!(0, _wooksjs_event_cli.useCliOption)("oxc"),
282
+ force: !!(0, _wooksjs_event_cli.useCliOption)("force")
281
283
  });
282
284
  console.log("\nScaffolding a new project...");
283
- await scaffold(prompts$2);
284
- const cli = prompts$2.type === "cli";
285
- const ws = prompts$2.type === "ws";
286
- const ssr = prompts$2.type === "ssr";
285
+ await scaffold(prompts);
286
+ const cli = prompts.type === "cli";
287
+ const ws = prompts.type === "ws";
288
+ const ssr = prompts.type === "ssr";
287
289
  return `
288
- Success! Your new "${prompts$2.projectName}" project has been created successfully. 
290
+ Success! Your new "${prompts.projectName}" project has been created successfully. 
289
291
 
290
292
  Follow these next steps to start your development server:
291
293
 
292
294
  1. Navigate to your new project:
293
- cd ${prompts$2.targetDir} 
295
+ cd ${prompts.targetDir} 
294
296
 
295
297
  2. Install the dependencies:
296
298
  npm install 
@@ -310,14 +312,14 @@ API routes: http://localhost:3000/api/hello/World
310
312
  }
311
313
  };
312
314
  _ts_decorate([
313
- (0, __moostjs_event_cli.Cli)(""),
315
+ (0, _moostjs_event_cli.Cli)(""),
314
316
  _ts_metadata("design:type", Function),
315
317
  _ts_metadata("design:paramtypes", []),
316
318
  _ts_metadata("design:returntype", void 0)
317
319
  ], Commands.prototype, "root", null);
318
320
  _ts_decorate([
319
- (0, __moostjs_event_cli.Cli)(":name"),
320
- _ts_param(0, (0, __moostjs_event_cli.Param)("name")),
321
+ (0, _moostjs_event_cli.Cli)(":name"),
322
+ _ts_param(0, (0, _moostjs_event_cli.Param)("name")),
321
323
  _ts_metadata("design:type", Function),
322
324
  _ts_metadata("design:paramtypes", [String]),
323
325
  _ts_metadata("design:returntype", void 0)
package/dist/index.mjs CHANGED
@@ -26,8 +26,7 @@ async function getPrompts(inputs) {
26
26
  name: "overwrite",
27
27
  type: () => canSkipEmptying(predefined.targetDir) || inputs.force ? null : "confirm",
28
28
  message: () => {
29
- const dirForPrompt = predefined.targetDir === "." ? "Current directory" : `Target directory "${predefined.targetDir}"`;
30
- return `${dirForPrompt} is not empty. Remove existing files and continue?`;
29
+ return `${predefined.targetDir === "." ? "Current directory" : `Target directory "${predefined.targetDir}"`} is not empty. Remove existing files and continue?`;
31
30
  }
32
31
  },
33
32
  {
@@ -40,13 +39,12 @@ async function getPrompts(inputs) {
40
39
  {
41
40
  name: "type",
42
41
  type: () => {
43
- const typeFlags = [
42
+ const selected = [
44
43
  "http",
45
44
  "cli",
46
45
  "ws",
47
46
  "ssr"
48
- ];
49
- const selected = typeFlags.filter((t) => inputs[t]);
47
+ ].filter((t) => inputs[t]);
50
48
  if (selected.length === 1) {
51
49
  predefined.type = selected[0];
52
50
  return null;
@@ -83,8 +81,7 @@ async function getPrompts(inputs) {
83
81
  {
84
82
  name: "ssr",
85
83
  type: (prev, values) => {
86
- const type = values.type || predefined.type;
87
- if (type !== "ssr") return null;
84
+ if ((values.type || predefined.type) !== "ssr") return null;
88
85
  return "toggle";
89
86
  },
90
87
  message: "Enable SSR (Server-Side Rendering)?",
@@ -95,8 +92,7 @@ async function getPrompts(inputs) {
95
92
  {
96
93
  name: "ws",
97
94
  type: (prev, values) => {
98
- const type = values.type || predefined.type;
99
- if (type !== "http" || inputs.ws) return null;
95
+ if ((values.type || predefined.type) !== "http" || inputs.ws) return null;
100
96
  return "toggle";
101
97
  },
102
98
  message: "Add WebSockets?",
@@ -237,7 +233,7 @@ function _ts_param(paramIndex, decorator) {
237
233
  decorator(target, key, paramIndex);
238
234
  };
239
235
  }
240
- let Commands = class Commands$1 extends CliApp {
236
+ let Commands = class Commands extends CliApp {
241
237
  root() {
242
238
  return this.execute();
243
239
  }
@@ -246,7 +242,7 @@ let Commands = class Commands$1 extends CliApp {
246
242
  }
247
243
  async execute(name) {
248
244
  if (useAutoHelp()) process.exit(0);
249
- const prompts$1 = await getPrompts({
245
+ const prompts = await getPrompts({
250
246
  name,
251
247
  http: !!useCliOption("http"),
252
248
  cli: !!useCliOption("cli"),
@@ -257,17 +253,17 @@ let Commands = class Commands$1 extends CliApp {
257
253
  force: !!useCliOption("force")
258
254
  });
259
255
  console.log("\nScaffolding a new project...");
260
- await scaffold(prompts$1);
261
- const cli = prompts$1.type === "cli";
262
- const ws = prompts$1.type === "ws";
263
- const ssr = prompts$1.type === "ssr";
256
+ await scaffold(prompts);
257
+ const cli = prompts.type === "cli";
258
+ const ws = prompts.type === "ws";
259
+ const ssr = prompts.type === "ssr";
264
260
  return `
265
- Success! Your new "${prompts$1.projectName}" project has been created successfully. 
261
+ Success! Your new "${prompts.projectName}" project has been created successfully. 
266
262
 
267
263
  Follow these next steps to start your development server:
268
264
 
269
265
  1. Navigate to your new project:
270
- cd ${prompts$1.targetDir} 
266
+ cd ${prompts.targetDir} 
271
267
 
272
268
  2. Install the dependencies:
273
269
  npm install 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-moost",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
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.11",
47
+ "@wooksjs/event-cli": "^0.7.12",
48
48
  "prompts": "^2.4.2",
49
- "@moostjs/event-cli": "^0.6.9",
50
- "moost": "^0.6.9"
49
+ "@moostjs/event-cli": "^0.6.10",
50
+ "moost": "^0.6.10"
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.9"
56
+ "@moostjs/vite": "^0.6.10"
57
57
  },
58
58
  "scripts": {
59
59
  "pub": "pnpm publish --access public",
@@ -33,6 +33,6 @@
33
33
  "oxfmt": "^0.34.0",
34
34
  //=END IF
35
35
  "typescript": "^5.7.2",
36
- "rolldown": "1.0.0-beta.19"
36
+ "rolldown": "1.0.0-rc.5"
37
37
  }
38
38
  }
@@ -24,7 +24,7 @@
24
24
  //=END IF
25
25
  //=IF (wf)
26
26
  "@moostjs/event-wf": "^{{ version }}",
27
- "@wooksjs/http-static": "^0.7.4",
27
+ "@wooksjs/http-static": "^0.7.12",
28
28
  //=END IF
29
29
  "moost": "^{{ version }}"
30
30
  },
@@ -27,6 +27,6 @@
27
27
  "oxfmt": "^0.34.0",
28
28
  //=END IF
29
29
  "typescript": "^5.7.2",
30
- "rolldown": "1.0.0-beta.19"
30
+ "rolldown": "1.0.0-rc.5"
31
31
  }
32
32
  }