@featurevisor/cli 0.53.2 → 0.53.4
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/.eslintcache +1 -1
- package/CHANGELOG.md +16 -0
- package/lib/index.js +145 -55
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +25 -13
package/.eslintcache
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"/home/runner/work/featurevisor/featurevisor/packages/cli/bin.js":"1","/home/runner/work/featurevisor/featurevisor/packages/cli/src/index.ts":"2"},{"size":45,"mtime":
|
|
1
|
+
[{"/home/runner/work/featurevisor/featurevisor/packages/cli/bin.js":"1","/home/runner/work/featurevisor/featurevisor/packages/cli/src/index.ts":"2"},{"size":45,"mtime":1697562075731,"results":"3","hashOfConfig":"4"},{"size":5421,"mtime":1697562075731,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","suppressedMessages":"8","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"pxfieg",{"filePath":"9","messages":"10","suppressedMessages":"11","errorCount":0,"fatalErrorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/home/runner/work/featurevisor/featurevisor/packages/cli/bin.js",[],[],"/home/runner/work/featurevisor/featurevisor/packages/cli/src/index.ts",[],[]]
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [0.53.4](https://github.com/featurevisor/featurevisor/compare/v0.53.3...v0.53.4) (2023-10-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @featurevisor/cli
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [0.53.3](https://github.com/featurevisor/featurevisor/compare/v0.53.2...v0.53.3) (2023-10-17)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @featurevisor/cli
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
## [0.53.2](https://github.com/featurevisor/featurevisor/compare/v0.53.1...v0.53.2) (2023-10-15)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @featurevisor/cli
|
package/lib/index.js
CHANGED
|
@@ -63,7 +63,7 @@ function main() {
|
|
|
63
63
|
yargs(process.argv.slice(2))
|
|
64
64
|
.usage("Usage: <command> [options]")
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Init
|
|
67
67
|
*/
|
|
68
68
|
.command({
|
|
69
69
|
command: "init",
|
|
@@ -86,6 +86,9 @@ function main() {
|
|
|
86
86
|
})
|
|
87
87
|
.example("$0 init", "scaffold a new project")
|
|
88
88
|
.example("$0 init --example=exampleName", "scaffold a new project from known example")
|
|
89
|
+
/**
|
|
90
|
+
* Lint
|
|
91
|
+
*/
|
|
89
92
|
.command({
|
|
90
93
|
command: "lint",
|
|
91
94
|
handler: function () {
|
|
@@ -108,42 +111,90 @@ function main() {
|
|
|
108
111
|
},
|
|
109
112
|
})
|
|
110
113
|
.example("$0 lint", "lint all YAML file content")
|
|
114
|
+
/**
|
|
115
|
+
* Build
|
|
116
|
+
*/
|
|
111
117
|
.command({
|
|
112
118
|
command: "build",
|
|
113
119
|
handler: function (options) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
121
|
+
var projectConfig, e_1;
|
|
122
|
+
return __generator(this, function (_a) {
|
|
123
|
+
switch (_a.label) {
|
|
124
|
+
case 0:
|
|
125
|
+
projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
126
|
+
_a.label = 1;
|
|
127
|
+
case 1:
|
|
128
|
+
_a.trys.push([1, 3, , 4]);
|
|
129
|
+
return [4 /*yield*/, (0, core_1.buildProject)(rootDirectoryPath, projectConfig, options)];
|
|
130
|
+
case 2:
|
|
131
|
+
_a.sent();
|
|
132
|
+
return [3 /*break*/, 4];
|
|
133
|
+
case 3:
|
|
134
|
+
e_1 = _a.sent();
|
|
135
|
+
console.error(e_1);
|
|
136
|
+
process.exit(1);
|
|
137
|
+
return [3 /*break*/, 4];
|
|
138
|
+
case 4: return [2 /*return*/];
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
});
|
|
122
142
|
},
|
|
123
143
|
})
|
|
124
144
|
.example("$0 build", "build datafiles")
|
|
145
|
+
/**
|
|
146
|
+
* Restore
|
|
147
|
+
*/
|
|
125
148
|
.command({
|
|
126
149
|
command: "restore",
|
|
127
150
|
handler: function () {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
151
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
+
var projectConfig, e_2;
|
|
153
|
+
return __generator(this, function (_a) {
|
|
154
|
+
switch (_a.label) {
|
|
155
|
+
case 0:
|
|
156
|
+
projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
157
|
+
_a.label = 1;
|
|
158
|
+
case 1:
|
|
159
|
+
_a.trys.push([1, 3, , 4]);
|
|
160
|
+
return [4 /*yield*/, (0, core_1.restoreProject)(rootDirectoryPath, projectConfig)];
|
|
161
|
+
case 2:
|
|
162
|
+
_a.sent();
|
|
163
|
+
return [3 /*break*/, 4];
|
|
164
|
+
case 3:
|
|
165
|
+
e_2 = _a.sent();
|
|
166
|
+
console.error(e_2.message);
|
|
167
|
+
process.exit(1);
|
|
168
|
+
return [3 /*break*/, 4];
|
|
169
|
+
case 4: return [2 /*return*/];
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
});
|
|
136
173
|
},
|
|
137
174
|
})
|
|
138
175
|
.example("$0 restore", "restore state files")
|
|
176
|
+
/**
|
|
177
|
+
* Test
|
|
178
|
+
*/
|
|
139
179
|
.command({
|
|
140
180
|
command: "test",
|
|
141
181
|
handler: function () {
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
182
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
+
var projectConfig, hasError;
|
|
184
|
+
return __generator(this, function (_a) {
|
|
185
|
+
switch (_a.label) {
|
|
186
|
+
case 0:
|
|
187
|
+
projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
188
|
+
return [4 /*yield*/, (0, core_1.testProject)(rootDirectoryPath, projectConfig)];
|
|
189
|
+
case 1:
|
|
190
|
+
hasError = _a.sent();
|
|
191
|
+
if (hasError) {
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
return [2 /*return*/];
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
147
198
|
},
|
|
148
199
|
})
|
|
149
200
|
.example("$0 test", "test features")
|
|
@@ -153,23 +204,34 @@ function main() {
|
|
|
153
204
|
.command({
|
|
154
205
|
command: "site [subcommand]",
|
|
155
206
|
handler: function (options) {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
207
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
208
|
+
var projectConfig, allowedSubcommands, hasError;
|
|
209
|
+
return __generator(this, function (_a) {
|
|
210
|
+
switch (_a.label) {
|
|
211
|
+
case 0:
|
|
212
|
+
projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
213
|
+
allowedSubcommands = ["export", "serve"];
|
|
214
|
+
if (!allowedSubcommands.includes(options.subcommand)) {
|
|
215
|
+
console.log("Please specify a subcommand: `export` or `serve`");
|
|
216
|
+
return [2 /*return*/];
|
|
217
|
+
}
|
|
218
|
+
if (!(options.subcommand === "export")) return [3 /*break*/, 2];
|
|
219
|
+
return [4 /*yield*/, (0, core_1.exportSite)(rootDirectoryPath, projectConfig)];
|
|
220
|
+
case 1:
|
|
221
|
+
hasError = _a.sent();
|
|
222
|
+
if (hasError) {
|
|
223
|
+
process.exit(1);
|
|
224
|
+
}
|
|
225
|
+
_a.label = 2;
|
|
226
|
+
case 2:
|
|
227
|
+
// serve
|
|
228
|
+
if (options.subcommand === "serve") {
|
|
229
|
+
(0, core_1.serveSite)(rootDirectoryPath, projectConfig);
|
|
230
|
+
}
|
|
231
|
+
return [2 /*return*/];
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
});
|
|
173
235
|
},
|
|
174
236
|
})
|
|
175
237
|
.example("$0 site export", "generate static site with project data")
|
|
@@ -181,14 +243,28 @@ function main() {
|
|
|
181
243
|
.command({
|
|
182
244
|
command: "generate-code",
|
|
183
245
|
handler: function (options) {
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
246
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
247
|
+
var projectConfig, e_3;
|
|
248
|
+
return __generator(this, function (_a) {
|
|
249
|
+
switch (_a.label) {
|
|
250
|
+
case 0:
|
|
251
|
+
projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
252
|
+
_a.label = 1;
|
|
253
|
+
case 1:
|
|
254
|
+
_a.trys.push([1, 3, , 4]);
|
|
255
|
+
return [4 /*yield*/, (0, core_1.generateCodeForProject)(rootDirectoryPath, projectConfig, options)];
|
|
256
|
+
case 2:
|
|
257
|
+
_a.sent();
|
|
258
|
+
return [3 /*break*/, 4];
|
|
259
|
+
case 3:
|
|
260
|
+
e_3 = _a.sent();
|
|
261
|
+
console.error(e_3.message);
|
|
262
|
+
process.exit(1);
|
|
263
|
+
return [3 /*break*/, 4];
|
|
264
|
+
case 4: return [2 /*return*/];
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
});
|
|
192
268
|
},
|
|
193
269
|
})
|
|
194
270
|
.example("$0 generate-code", "generate code from YAMLs")
|
|
@@ -199,14 +275,28 @@ function main() {
|
|
|
199
275
|
.command({
|
|
200
276
|
command: "find-duplicate-segments",
|
|
201
277
|
handler: function () {
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
(
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
278
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
279
|
+
var projectConfig, e_4;
|
|
280
|
+
return __generator(this, function (_a) {
|
|
281
|
+
switch (_a.label) {
|
|
282
|
+
case 0:
|
|
283
|
+
projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
284
|
+
_a.label = 1;
|
|
285
|
+
case 1:
|
|
286
|
+
_a.trys.push([1, 3, , 4]);
|
|
287
|
+
return [4 /*yield*/, (0, core_1.findDuplicateSegmentsInProject)(rootDirectoryPath, projectConfig)];
|
|
288
|
+
case 2:
|
|
289
|
+
_a.sent();
|
|
290
|
+
return [3 /*break*/, 4];
|
|
291
|
+
case 3:
|
|
292
|
+
e_4 = _a.sent();
|
|
293
|
+
console.error(e_4.message);
|
|
294
|
+
process.exit(1);
|
|
295
|
+
return [3 /*break*/, 4];
|
|
296
|
+
case 4: return [2 /*return*/];
|
|
297
|
+
}
|
|
298
|
+
});
|
|
299
|
+
});
|
|
210
300
|
},
|
|
211
301
|
})
|
|
212
302
|
.example("$0 generate-code", "generate code from YAMLs")
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uBAAyB;AACzB,2B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AAE,CAAC;gBACnB,CAAC;aACF,CAAC,CAAC,IAAI,CAAC;YAEV,sBAAO;;;CACR;AAED,IAAI,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@featurevisor/cli",
|
|
3
|
-
"version": "0.53.
|
|
3
|
+
"version": "0.53.4",
|
|
4
4
|
"description": "CLI package of Featurevisor",
|
|
5
5
|
"main": "bin.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -47,11 +47,11 @@
|
|
|
47
47
|
},
|
|
48
48
|
"license": "MIT",
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@featurevisor/core": "^0.53.
|
|
50
|
+
"@featurevisor/core": "^0.53.4",
|
|
51
51
|
"yargs": "^17.6.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@types/yargs": "^17.0.22"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "57755aee07c023437db2ecba63f07fce6a9c127c"
|
|
57
57
|
}
|
package/src/index.ts
CHANGED
|
@@ -47,7 +47,7 @@ async function main() {
|
|
|
47
47
|
.usage("Usage: <command> [options]")
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
|
-
*
|
|
50
|
+
* Init
|
|
51
51
|
*/
|
|
52
52
|
.command({
|
|
53
53
|
command: "init",
|
|
@@ -62,6 +62,9 @@ async function main() {
|
|
|
62
62
|
.example("$0 init", "scaffold a new project")
|
|
63
63
|
.example("$0 init --example=exampleName", "scaffold a new project from known example")
|
|
64
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Lint
|
|
67
|
+
*/
|
|
65
68
|
.command({
|
|
66
69
|
command: "lint",
|
|
67
70
|
handler: async function () {
|
|
@@ -76,13 +79,16 @@ async function main() {
|
|
|
76
79
|
})
|
|
77
80
|
.example("$0 lint", "lint all YAML file content")
|
|
78
81
|
|
|
82
|
+
/**
|
|
83
|
+
* Build
|
|
84
|
+
*/
|
|
79
85
|
.command({
|
|
80
86
|
command: "build",
|
|
81
|
-
handler: function (options) {
|
|
87
|
+
handler: async function (options) {
|
|
82
88
|
const projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
83
89
|
|
|
84
90
|
try {
|
|
85
|
-
buildProject(rootDirectoryPath, projectConfig, options as BuildCLIOptions);
|
|
91
|
+
await buildProject(rootDirectoryPath, projectConfig, options as BuildCLIOptions);
|
|
86
92
|
} catch (e) {
|
|
87
93
|
console.error(e);
|
|
88
94
|
process.exit(1);
|
|
@@ -91,13 +97,16 @@ async function main() {
|
|
|
91
97
|
})
|
|
92
98
|
.example("$0 build", "build datafiles")
|
|
93
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Restore
|
|
102
|
+
*/
|
|
94
103
|
.command({
|
|
95
104
|
command: "restore",
|
|
96
|
-
handler: function () {
|
|
105
|
+
handler: async function () {
|
|
97
106
|
const projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
98
107
|
|
|
99
108
|
try {
|
|
100
|
-
restoreProject(rootDirectoryPath, projectConfig);
|
|
109
|
+
await restoreProject(rootDirectoryPath, projectConfig);
|
|
101
110
|
} catch (e) {
|
|
102
111
|
console.error(e.message);
|
|
103
112
|
process.exit(1);
|
|
@@ -106,12 +115,15 @@ async function main() {
|
|
|
106
115
|
})
|
|
107
116
|
.example("$0 restore", "restore state files")
|
|
108
117
|
|
|
118
|
+
/**
|
|
119
|
+
* Test
|
|
120
|
+
*/
|
|
109
121
|
.command({
|
|
110
122
|
command: "test",
|
|
111
|
-
handler: function () {
|
|
123
|
+
handler: async function () {
|
|
112
124
|
const projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
113
125
|
|
|
114
|
-
const hasError = testProject(rootDirectoryPath, projectConfig);
|
|
126
|
+
const hasError = await testProject(rootDirectoryPath, projectConfig);
|
|
115
127
|
|
|
116
128
|
if (hasError) {
|
|
117
129
|
process.exit(1);
|
|
@@ -125,7 +137,7 @@ async function main() {
|
|
|
125
137
|
*/
|
|
126
138
|
.command({
|
|
127
139
|
command: "site [subcommand]",
|
|
128
|
-
handler: function (options) {
|
|
140
|
+
handler: async function (options) {
|
|
129
141
|
const projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
130
142
|
|
|
131
143
|
const allowedSubcommands = ["export", "serve"];
|
|
@@ -137,7 +149,7 @@ async function main() {
|
|
|
137
149
|
|
|
138
150
|
// export
|
|
139
151
|
if (options.subcommand === "export") {
|
|
140
|
-
const hasError = exportSite(rootDirectoryPath, projectConfig);
|
|
152
|
+
const hasError = await exportSite(rootDirectoryPath, projectConfig);
|
|
141
153
|
|
|
142
154
|
if (hasError) {
|
|
143
155
|
process.exit(1);
|
|
@@ -159,11 +171,11 @@ async function main() {
|
|
|
159
171
|
*/
|
|
160
172
|
.command({
|
|
161
173
|
command: "generate-code",
|
|
162
|
-
handler: function (options) {
|
|
174
|
+
handler: async function (options) {
|
|
163
175
|
const projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
164
176
|
|
|
165
177
|
try {
|
|
166
|
-
generateCodeForProject(
|
|
178
|
+
await generateCodeForProject(
|
|
167
179
|
rootDirectoryPath,
|
|
168
180
|
projectConfig,
|
|
169
181
|
options as unknown as GenerateCodeCLIOptions,
|
|
@@ -182,11 +194,11 @@ async function main() {
|
|
|
182
194
|
*/
|
|
183
195
|
.command({
|
|
184
196
|
command: "find-duplicate-segments",
|
|
185
|
-
handler: function () {
|
|
197
|
+
handler: async function () {
|
|
186
198
|
const projectConfig = requireAndGetProjectConfig(rootDirectoryPath);
|
|
187
199
|
|
|
188
200
|
try {
|
|
189
|
-
findDuplicateSegmentsInProject(rootDirectoryPath, projectConfig);
|
|
201
|
+
await findDuplicateSegmentsInProject(rootDirectoryPath, projectConfig);
|
|
190
202
|
} catch (e) {
|
|
191
203
|
console.error(e.message);
|
|
192
204
|
process.exit(1);
|