create-moost 0.5.21 → 0.5.23
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/LICENSE +21 -0
- package/dist/index.cjs +271 -282
- package/dist/index.mjs +248 -281
- package/package.json +22 -9
- package/templates/cli/bin.js +1 -1
- package/templates/cli/package.jsonc +33 -0
- package/templates/cli/rolldown.config.ts +14 -0
- package/templates/cli/src/main.ts +21 -25
- package/templates/common/tsconfig.json +1 -1
- package/templates/{common → http}/package.jsonc +2 -5
- package/templates/{common → http}/vite.config.ts +1 -1
- package/templates/cli/src/controllers/app.controller.ts +0 -10
- /package/{bin.js → bin.cjs} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1,310 +1,277 @@
|
|
|
1
|
-
import { Cli,
|
|
2
|
-
import { useAutoHelp, useCliOption } from
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import { join } from 'path';
|
|
1
|
+
import { Cli, CliApp, Param } from "@moostjs/event-cli";
|
|
2
|
+
import { useAutoHelp, useCliOption } from "@wooksjs/event-cli";
|
|
3
|
+
import { existsSync, lstatSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync } from "fs";
|
|
4
|
+
import prompts from "prompts";
|
|
5
|
+
import { ProstoRewrite } from "@prostojs/rewrite";
|
|
6
|
+
import { join } from "path";
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
13
|
-
purpose with or without fee is hereby granted.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
16
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
17
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
18
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
19
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
20
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
21
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
22
|
-
***************************************************************************** */
|
|
23
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function __decorate(decorators, target, key, desc) {
|
|
27
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
28
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
29
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
30
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function __param(paramIndex, decorator) {
|
|
34
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function __metadata(metadataKey, metadataValue) {
|
|
38
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
42
|
-
var e = new Error(message);
|
|
43
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const defaultProjectName = 'moost-app';
|
|
8
|
+
//#region packages/create-moost/src/prompts.ts
|
|
9
|
+
const defaultProjectName = "moost-app";
|
|
47
10
|
async function getPrompts(inputs) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
catch (error) {
|
|
135
|
-
console.log(error.message);
|
|
136
|
-
process.exit(1);
|
|
137
|
-
}
|
|
11
|
+
const predefined = {
|
|
12
|
+
targetDir: inputs.name || "",
|
|
13
|
+
projectName: inputs.name || "",
|
|
14
|
+
packageName: inputs.name || ""
|
|
15
|
+
};
|
|
16
|
+
try {
|
|
17
|
+
const results = await prompts([
|
|
18
|
+
{
|
|
19
|
+
name: "projectName",
|
|
20
|
+
type: predefined.targetDir ? null : "text",
|
|
21
|
+
message: "Project name:",
|
|
22
|
+
initial: defaultProjectName,
|
|
23
|
+
onState: (state) => predefined.targetDir = String(state.value).trim() || defaultProjectName
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "overwrite",
|
|
27
|
+
type: () => canSkipEmptying(predefined.targetDir) || inputs.force ? null : "confirm",
|
|
28
|
+
message: () => {
|
|
29
|
+
const dirForPrompt = predefined.targetDir === "." ? "Current directory" : `Target directory "${predefined.targetDir}"`;
|
|
30
|
+
return `${dirForPrompt} is not empty. Remove existing files and continue?`;
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "overwriteChecker",
|
|
35
|
+
type: (prev, values) => {
|
|
36
|
+
if (values.overwrite === false) throw new Error("Operation cancelled");
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: "type",
|
|
42
|
+
type: () => {
|
|
43
|
+
if (inputs.cli && !inputs.http) {
|
|
44
|
+
predefined.type = "cli";
|
|
45
|
+
return null;
|
|
46
|
+
}
|
|
47
|
+
if (!inputs.cli && inputs.http) {
|
|
48
|
+
predefined.type = "http";
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return "select";
|
|
52
|
+
},
|
|
53
|
+
message: "Moost Adapter:",
|
|
54
|
+
choices: [{
|
|
55
|
+
title: "HTTP (Web) Application",
|
|
56
|
+
value: "http"
|
|
57
|
+
}, {
|
|
58
|
+
title: "CLI Application",
|
|
59
|
+
value: "cli"
|
|
60
|
+
}]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: "packageName",
|
|
64
|
+
type: () => isValidPackageName(predefined.targetDir) ? null : "text",
|
|
65
|
+
message: "Package name:",
|
|
66
|
+
initial: () => toValidPackageName(predefined.targetDir),
|
|
67
|
+
validate: (dir) => isValidPackageName(dir) || "Invalid package.json name"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: "wf",
|
|
71
|
+
type: (prev, values) => inputs.wf || values.type === "cli" || inputs.cli ? null : "toggle",
|
|
72
|
+
message: "Add Moost Workflows Example?",
|
|
73
|
+
initial: false,
|
|
74
|
+
active: "Yes",
|
|
75
|
+
inactive: "No"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
name: "domelint",
|
|
79
|
+
type: () => inputs.domelint ? null : "toggle",
|
|
80
|
+
message: "Add do-me-lint (smart eslint installer)?",
|
|
81
|
+
initial: false,
|
|
82
|
+
active: "Yes",
|
|
83
|
+
inactive: "No"
|
|
84
|
+
}
|
|
85
|
+
], { onCancel: () => {
|
|
86
|
+
throw new Error("Operation cancelled");
|
|
87
|
+
} });
|
|
88
|
+
return {
|
|
89
|
+
...predefined,
|
|
90
|
+
...results,
|
|
91
|
+
packageName: results.packageName || results.targetDir || predefined.targetDir
|
|
92
|
+
};
|
|
93
|
+
} catch (error) {
|
|
94
|
+
console.log(error.message);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
}
|
|
138
97
|
}
|
|
139
98
|
function canSkipEmptying(dir) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
return true;
|
|
146
|
-
}
|
|
147
|
-
if (files.length === 1 && files[0] === '.git') {
|
|
148
|
-
return true;
|
|
149
|
-
}
|
|
150
|
-
return false;
|
|
99
|
+
if (!existsSync(dir)) return true;
|
|
100
|
+
const files = readdirSync(dir);
|
|
101
|
+
if (files.length === 0) return true;
|
|
102
|
+
if (files.length === 1 && files[0] === ".git") return true;
|
|
103
|
+
return false;
|
|
151
104
|
}
|
|
152
105
|
function isValidPackageName(projectName) {
|
|
153
|
-
|
|
106
|
+
return /^(?:@[\d*a-z~-][\d*._a-z~-]*\/)?[\da-z~-][\d._a-z~-]*$/.test(projectName);
|
|
154
107
|
}
|
|
155
108
|
function toValidPackageName(projectName) {
|
|
156
|
-
|
|
157
|
-
.trim()
|
|
158
|
-
.toLowerCase()
|
|
159
|
-
.replace(/\s+/g, '-')
|
|
160
|
-
.replace(/^[._]/, '')
|
|
161
|
-
.replace(/[^\da-z~-]+/g, '-');
|
|
109
|
+
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^\da-z~-]+/g, "-");
|
|
162
110
|
}
|
|
163
111
|
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
});
|
|
112
|
+
//#endregion
|
|
113
|
+
//#region packages/create-moost/src/scaffold.ts
|
|
114
|
+
const rw = new ProstoRewrite({ textPattern: [
|
|
115
|
+
"*.{js,jsx,ts,tsx,txt,json,jsonc,yml,yaml,md,ini,css,html}",
|
|
116
|
+
"Dockerfile",
|
|
117
|
+
"*config",
|
|
118
|
+
".gitignore",
|
|
119
|
+
".eslintrc.json",
|
|
120
|
+
".prettierignore",
|
|
121
|
+
".prettierrc"
|
|
122
|
+
] });
|
|
175
123
|
const root = process.cwd();
|
|
176
|
-
const { version } = JSON.parse(readFileSync(join(__dirname,
|
|
124
|
+
const { version } = JSON.parse(readFileSync(join(__dirname, "../package.json")).toString());
|
|
177
125
|
async function scaffold(data) {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
126
|
+
const projectDir = join(root, data.targetDir);
|
|
127
|
+
if (existsSync(projectDir)) {
|
|
128
|
+
if (data.overwrite) emptyDirectorySync(projectDir);
|
|
129
|
+
} else mkdirSync(projectDir);
|
|
130
|
+
const templatePath = join(__dirname, "../templates", data.type);
|
|
131
|
+
const commonPath = join(__dirname, "../templates/common");
|
|
132
|
+
const wfPath = join(__dirname, "../templates/wf");
|
|
133
|
+
const context = {
|
|
134
|
+
...data,
|
|
135
|
+
version
|
|
136
|
+
};
|
|
137
|
+
const excludeCommon = [];
|
|
138
|
+
if (!data.domelint) excludeCommon.push(".domelintrc.yml");
|
|
139
|
+
await rw.rewriteDir({
|
|
140
|
+
baseDir: templatePath,
|
|
141
|
+
output: projectDir,
|
|
142
|
+
renameFile(filename) {
|
|
143
|
+
if (filename.endsWith(".jsonc")) return filename.replace(/c$/, "");
|
|
144
|
+
return filename;
|
|
145
|
+
}
|
|
146
|
+
}, context);
|
|
147
|
+
await rw.rewriteDir({
|
|
148
|
+
baseDir: commonPath,
|
|
149
|
+
output: projectDir,
|
|
150
|
+
exclude: excludeCommon,
|
|
151
|
+
renameFile(filename) {
|
|
152
|
+
if (filename.endsWith(".jsonc")) return filename.replace(/c$/, "");
|
|
153
|
+
return filename;
|
|
154
|
+
}
|
|
155
|
+
}, context);
|
|
156
|
+
if (data.wf) await rw.rewriteDir({
|
|
157
|
+
baseDir: wfPath,
|
|
158
|
+
output: projectDir,
|
|
159
|
+
renameFile(filename) {
|
|
160
|
+
if (filename.endsWith(".jsonc")) return filename.replace(/c$/, "");
|
|
161
|
+
return filename;
|
|
162
|
+
}
|
|
163
|
+
}, context);
|
|
216
164
|
}
|
|
217
165
|
function emptyDirectorySync(directory) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
else {
|
|
226
|
-
unlinkSync(currentPath);
|
|
227
|
-
}
|
|
228
|
-
});
|
|
229
|
-
}
|
|
166
|
+
if (existsSync(directory)) readdirSync(directory).forEach((file) => {
|
|
167
|
+
const currentPath = join(directory, file);
|
|
168
|
+
if (lstatSync(currentPath).isDirectory()) {
|
|
169
|
+
emptyDirectorySync(currentPath);
|
|
170
|
+
rmdirSync(currentPath);
|
|
171
|
+
} else unlinkSync(currentPath);
|
|
172
|
+
});
|
|
230
173
|
}
|
|
231
174
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region packages/create-moost/src/index.ts
|
|
177
|
+
function _ts_decorate(decorators, target, key, desc) {
|
|
178
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
179
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
180
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
181
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
182
|
+
}
|
|
183
|
+
function _ts_metadata(k, v) {
|
|
184
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
185
|
+
}
|
|
186
|
+
function _ts_param(paramIndex, decorator) {
|
|
187
|
+
return function(target, key) {
|
|
188
|
+
decorator(target, key, paramIndex);
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
let Commands = class Commands$1 extends CliApp {
|
|
192
|
+
root() {
|
|
193
|
+
return this.execute();
|
|
194
|
+
}
|
|
195
|
+
withName(name) {
|
|
196
|
+
return this.execute(name);
|
|
197
|
+
}
|
|
198
|
+
async execute(name) {
|
|
199
|
+
useAutoHelp() && process.exit(0);
|
|
200
|
+
const prompts$1 = await getPrompts({
|
|
201
|
+
name,
|
|
202
|
+
http: !!useCliOption("http"),
|
|
203
|
+
cli: !!useCliOption("cli"),
|
|
204
|
+
wf: !!useCliOption("wf"),
|
|
205
|
+
domelint: !!useCliOption("domelint"),
|
|
206
|
+
force: !!useCliOption("force")
|
|
207
|
+
});
|
|
208
|
+
console.log("\nScaffolding a new project...");
|
|
209
|
+
await scaffold(prompts$1);
|
|
210
|
+
const cli = prompts$1.type === "cli";
|
|
211
|
+
return `
|
|
212
|
+
${"\x1B[97m\x1B[1m"}Success! ${"\x1B[22m"}Your new "${prompts$1.projectName}" project has been created successfully. ${"\x1B[39m"}
|
|
254
213
|
|
|
255
214
|
Follow these next steps to start your development server:
|
|
256
215
|
|
|
257
216
|
1. Navigate to your new project:
|
|
258
|
-
${
|
|
217
|
+
${"\x1B[36m"}cd ${prompts$1.targetDir} ${"\x1B[39m"}
|
|
259
218
|
|
|
260
219
|
2. Install the dependencies:
|
|
261
|
-
${
|
|
262
|
-
${cli
|
|
263
|
-
? `
|
|
220
|
+
${"\x1B[36m"}npm install ${"\x1B[39m"}
|
|
221
|
+
${cli ? `
|
|
264
222
|
3. Make bin.js executable:
|
|
265
|
-
${
|
|
266
|
-
`
|
|
267
|
-
|
|
268
|
-
${cli ?
|
|
269
|
-
${'[36m'}npm run dev${cli ? ' -- hello World' : ''}${'[39m'}
|
|
223
|
+
${"\x1B[36m"}chmod +x ./bin.js ${"\x1B[39m"}
|
|
224
|
+
` : ""}
|
|
225
|
+
${cli ? "4" : "3"}. Start the development server:
|
|
226
|
+
${"\x1B[36m"}npm run dev${cli ? " -- hello World" : ""}${"\x1B[39m"}
|
|
270
227
|
|
|
271
|
-
${
|
|
272
|
-
Enjoy coding, and build something amazing!${
|
|
228
|
+
${"\x1B[32m"}You're all set! The development server will help you in building your application.
|
|
229
|
+
Enjoy coding, and build something amazing!${"\x1B[39m"}
|
|
273
230
|
`;
|
|
274
|
-
|
|
231
|
+
}
|
|
275
232
|
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
],
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
],
|
|
289
|
-
CliController = __decorate([
|
|
290
|
-
Controller()
|
|
291
|
-
], CliController);
|
|
233
|
+
_ts_decorate([
|
|
234
|
+
Cli(""),
|
|
235
|
+
_ts_metadata("design:type", Function),
|
|
236
|
+
_ts_metadata("design:paramtypes", []),
|
|
237
|
+
_ts_metadata("design:returntype", void 0)
|
|
238
|
+
], Commands.prototype, "root", null);
|
|
239
|
+
_ts_decorate([
|
|
240
|
+
Cli(":name"),
|
|
241
|
+
_ts_param(0, Param("name")),
|
|
242
|
+
_ts_metadata("design:type", Function),
|
|
243
|
+
_ts_metadata("design:paramtypes", [String]),
|
|
244
|
+
_ts_metadata("design:returntype", void 0)
|
|
245
|
+
], Commands.prototype, "withName", null);
|
|
292
246
|
function run() {
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
247
|
+
new Commands().useOptions([
|
|
248
|
+
{
|
|
249
|
+
keys: ["http"],
|
|
250
|
+
description: "Use Moost HTTP",
|
|
251
|
+
type: Boolean
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
keys: ["cli"],
|
|
255
|
+
description: "Use Moost CLI",
|
|
256
|
+
type: Boolean
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
keys: ["wf"],
|
|
260
|
+
description: "Add Workflow Adapter",
|
|
261
|
+
type: Boolean
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
keys: ["domelint"],
|
|
265
|
+
description: "Add do-me-lint (smart eslint installer)",
|
|
266
|
+
type: Boolean
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
keys: ["force"],
|
|
270
|
+
description: "Force Overwrite",
|
|
271
|
+
type: Boolean
|
|
272
|
+
}
|
|
273
|
+
]).start();
|
|
308
274
|
}
|
|
309
275
|
|
|
310
|
-
|
|
276
|
+
//#endregion
|
|
277
|
+
export { run };
|
package/package.json
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-moost",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.23",
|
|
4
4
|
"description": "create-moost",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"sideEffects": false,
|
|
9
|
+
"type": "module",
|
|
9
10
|
"exports": {
|
|
10
11
|
"./package.json": "./package.json",
|
|
11
12
|
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
12
14
|
"import": "./dist/index.mjs",
|
|
13
|
-
"require": "./dist/index.cjs"
|
|
14
|
-
"types": "./dist/index.d.ts"
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
15
16
|
}
|
|
16
17
|
},
|
|
17
18
|
"bin": {
|
|
18
|
-
"create-moost": "./bin.
|
|
19
|
+
"create-moost": "./bin.cjs"
|
|
19
20
|
},
|
|
20
21
|
"files": [
|
|
21
22
|
"dist",
|
|
@@ -42,10 +43,22 @@
|
|
|
42
43
|
},
|
|
43
44
|
"homepage": "https://github.com/moostjs/moostjs/tree/main/packages/create-moost#readme",
|
|
44
45
|
"dependencies": {
|
|
45
|
-
"@moostjs/event-cli": "0.5.21",
|
|
46
|
-
"@wooksjs/event-cli": "^0.5.20",
|
|
47
46
|
"@prostojs/rewrite": "^0.1.1",
|
|
48
|
-
"
|
|
49
|
-
"prompts": "^2.4.2"
|
|
47
|
+
"@wooksjs/event-cli": "^0.5.25",
|
|
48
|
+
"prompts": "^2.4.2",
|
|
49
|
+
"@moostjs/event-cli": "^0.5.23",
|
|
50
|
+
"moost": "^0.5.23"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@moostjs/vite": "^0.5.21",
|
|
54
|
+
"@types/prompts": "^2.4.9",
|
|
55
|
+
"rolldown": "1.0.0-beta.3",
|
|
56
|
+
"unplugin-swc": "^1.5.1",
|
|
57
|
+
"vite": "^6.1.0",
|
|
58
|
+
"vitest": "^3.0.5"
|
|
59
|
+
},
|
|
60
|
+
"scripts": {
|
|
61
|
+
"pub": "pnpm publish --access public",
|
|
62
|
+
"test": "vitest"
|
|
50
63
|
}
|
|
51
|
-
}
|
|
64
|
+
}
|
package/templates/cli/bin.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
2
|
+
import('./dist/main.js');
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "{{ packageName }}",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/main.js",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"{{ packageName }}": "./bin.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"bin.js"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
//=IF (domelint)
|
|
16
|
+
"postinstall": "npx do-me-lint",
|
|
17
|
+
//=END IF
|
|
18
|
+
"dev": "pnpm build && node ./dist/main.js",
|
|
19
|
+
"build": "rolldown build -c rolldown.config.ts",
|
|
20
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
|
+
},
|
|
22
|
+
"keywords": [],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@moostjs/event-cli": "^{{ version }}"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"typescript": "^5.7.2",
|
|
30
|
+
"unplugin-swc": "^1.5.1",
|
|
31
|
+
"rolldown": "1.0.0-beta.3"
|
|
32
|
+
}
|
|
33
|
+
}
|