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