@nanoforge-dev/cli 1.6.0 ā 1.6.1-alpha.upgrade-schematics.0
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/command.loader.js +41 -14
- package/dist/command.loader.js.map +1 -1
- package/dist/nf.js +42 -15
- package/package.json +17 -17
package/dist/nf.js
CHANGED
|
@@ -961,7 +961,7 @@ const runSafe = async (fn, fallback) => {
|
|
|
961
961
|
}
|
|
962
962
|
};
|
|
963
963
|
//#endregion
|
|
964
|
-
//#region \0@oxc-project+runtime@0.
|
|
964
|
+
//#region \0@oxc-project+runtime@0.137.0/helpers/esm/decorate.js
|
|
965
965
|
function __decorate(decorators, target, key, desc) {
|
|
966
966
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
967
967
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -1070,12 +1070,21 @@ __decorate([
|
|
|
1070
1070
|
Type(() => DirsConfig),
|
|
1071
1071
|
ValidateNested()
|
|
1072
1072
|
], ServerConfig.prototype, "dirs", void 0);
|
|
1073
|
+
var SslConfig = class {
|
|
1074
|
+
enable;
|
|
1075
|
+
cert;
|
|
1076
|
+
key;
|
|
1077
|
+
};
|
|
1078
|
+
__decorate([Expose(), IsBoolean()], SslConfig.prototype, "enable", void 0);
|
|
1079
|
+
__decorate([Expose(), IsString()], SslConfig.prototype, "cert", void 0);
|
|
1080
|
+
__decorate([Expose(), IsString()], SslConfig.prototype, "key", void 0);
|
|
1073
1081
|
var Config = class {
|
|
1074
1082
|
name;
|
|
1075
1083
|
language;
|
|
1076
1084
|
initFunctions;
|
|
1077
1085
|
client;
|
|
1078
1086
|
server;
|
|
1087
|
+
ssl;
|
|
1079
1088
|
};
|
|
1080
1089
|
__decorate([
|
|
1081
1090
|
Expose(),
|
|
@@ -1094,6 +1103,11 @@ __decorate([
|
|
|
1094
1103
|
Type(() => ServerConfig),
|
|
1095
1104
|
ValidateNested()
|
|
1096
1105
|
], Config.prototype, "server", void 0);
|
|
1106
|
+
__decorate([
|
|
1107
|
+
Expose(),
|
|
1108
|
+
Type(() => SslConfig),
|
|
1109
|
+
ValidateNested()
|
|
1110
|
+
], Config.prototype, "ssl", void 0);
|
|
1097
1111
|
//#endregion
|
|
1098
1112
|
//#region src/lib/constants.ts
|
|
1099
1113
|
const CONFIG_FILE_NAME = "nanoforge.config.json";
|
|
@@ -1120,6 +1134,11 @@ const CONFIG_DEFAULTS = {
|
|
|
1120
1134
|
name: "nanoforge-app",
|
|
1121
1135
|
language: "ts",
|
|
1122
1136
|
initFunctions: true,
|
|
1137
|
+
ssl: {
|
|
1138
|
+
enable: false,
|
|
1139
|
+
cert: "",
|
|
1140
|
+
key: ""
|
|
1141
|
+
},
|
|
1123
1142
|
client: {
|
|
1124
1143
|
enable: true,
|
|
1125
1144
|
port: "3000",
|
|
@@ -1306,10 +1325,14 @@ var AbstractCollection = class {
|
|
|
1306
1325
|
onFail
|
|
1307
1326
|
});
|
|
1308
1327
|
}
|
|
1309
|
-
buildCommandLine(name, options, flags = [
|
|
1328
|
+
buildCommandLine(name, options, flags = [
|
|
1329
|
+
"--no-dry-run",
|
|
1330
|
+
"--allow-private",
|
|
1331
|
+
"--no-debug"
|
|
1332
|
+
]) {
|
|
1310
1333
|
return [
|
|
1311
|
-
`${this.collection}:${name}`,
|
|
1312
1334
|
...flags,
|
|
1335
|
+
`'${getModulePath(this.collection + "/collection.json")}:${name}'`,
|
|
1313
1336
|
...this.serializeOptions(options)
|
|
1314
1337
|
];
|
|
1315
1338
|
}
|
|
@@ -1513,9 +1536,11 @@ var EditorAction = class extends AbstractAction {
|
|
|
1513
1536
|
async handle(args, options) {
|
|
1514
1537
|
const directory = getDirectoryInput(options);
|
|
1515
1538
|
const path = getPathInput(args);
|
|
1516
|
-
const
|
|
1539
|
+
const shouldOpen = getEditorOpenInput(options, !!path);
|
|
1540
|
+
const url = `http://localhost:3000/load-project${path ? `?projectPath=${encodeURIComponent(path)}` : ""}`;
|
|
1541
|
+
console.log(`\nš Editor running! Open it in your browser: \x1b[36m${url}\x1b[0m\n`);
|
|
1517
1542
|
this.startEditor(directory);
|
|
1518
|
-
if (
|
|
1543
|
+
if (shouldOpen) await this.openBrowser(url);
|
|
1519
1544
|
return { keepAlive: true };
|
|
1520
1545
|
}
|
|
1521
1546
|
async startEditor(directory) {
|
|
@@ -1524,8 +1549,8 @@ var EditorAction = class extends AbstractAction {
|
|
|
1524
1549
|
await PackageManagerFactory.create("local_bun").run("Editor", directory, editorPath, [], {}, [], true);
|
|
1525
1550
|
});
|
|
1526
1551
|
}
|
|
1527
|
-
async
|
|
1528
|
-
await open(
|
|
1552
|
+
async openBrowser(url) {
|
|
1553
|
+
await open(url);
|
|
1529
1554
|
}
|
|
1530
1555
|
};
|
|
1531
1556
|
//#endregion
|
|
@@ -2176,7 +2201,7 @@ var StartAction = class extends AbstractAction {
|
|
|
2176
2201
|
const serverDir = getStringInputWithDefault(options, "serverDir", config.server.outDir);
|
|
2177
2202
|
const watch = getWatchInput(options);
|
|
2178
2203
|
const port = getStringInputWithDefault(options, "port", config.client.port);
|
|
2179
|
-
const ssl = this.resolveSSL(options);
|
|
2204
|
+
const ssl = this.resolveSSL(options, config);
|
|
2180
2205
|
const tasks = this.buildStartTasks(config, directory, {
|
|
2181
2206
|
clientDir,
|
|
2182
2207
|
serverDir,
|
|
@@ -2187,12 +2212,14 @@ var StartAction = class extends AbstractAction {
|
|
|
2187
2212
|
await Promise.all(tasks);
|
|
2188
2213
|
return { keepAlive: true };
|
|
2189
2214
|
}
|
|
2190
|
-
resolveSSL(options) {
|
|
2191
|
-
const
|
|
2192
|
-
const
|
|
2193
|
-
if (!
|
|
2194
|
-
|
|
2195
|
-
|
|
2215
|
+
resolveSSL(options, config) {
|
|
2216
|
+
const cliCert = getStringInput(options, "cert");
|
|
2217
|
+
const cliKey = getStringInput(options, "key");
|
|
2218
|
+
if (!Boolean(cliCert || cliKey || config.ssl?.enable)) return void 0;
|
|
2219
|
+
const cert = cliCert ? cliCert : config.ssl?.cert;
|
|
2220
|
+
const key = cliKey ? cliKey : config.ssl?.key;
|
|
2221
|
+
if (!cert) throw new CLIError("No certificate found for SSL.", "Please provide a certificate path with --cert or configure 'ssl.cert' in your nanoforge.config.json.");
|
|
2222
|
+
if (!key) throw new CLIError("No key found for SSL.", "Please provide a key path with --key or configure 'ssl.key' in your nanoforge.config.json.");
|
|
2196
2223
|
return {
|
|
2197
2224
|
cert,
|
|
2198
2225
|
key
|
|
@@ -2512,7 +2539,7 @@ var CommandLoader = class {
|
|
|
2512
2539
|
};
|
|
2513
2540
|
//#endregion
|
|
2514
2541
|
//#region package.json
|
|
2515
|
-
var version = "1.6.0";
|
|
2542
|
+
var version = "1.6.1-alpha.upgrade-schematics.0";
|
|
2516
2543
|
//#endregion
|
|
2517
2544
|
//#region src/bin/nf.ts
|
|
2518
2545
|
const bootstrap = async () => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@nanoforge-dev/cli",
|
|
4
|
-
"version": "1.6.0",
|
|
4
|
+
"version": "1.6.1-alpha.upgrade-schematics.0",
|
|
5
5
|
"description": "NanoForge CLI",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"nanoforge",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
},
|
|
34
34
|
"funding": "",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@angular-devkit/schematics": "^
|
|
37
|
-
"@angular-devkit/schematics-cli": "^
|
|
36
|
+
"@angular-devkit/schematics": "^22.0.4",
|
|
37
|
+
"@angular-devkit/schematics-cli": "^22.0.4",
|
|
38
38
|
"@inquirer/prompts": "^8.5.2",
|
|
39
39
|
"@nanoforge-dev/loader-client": "^1.3.0",
|
|
40
40
|
"@nanoforge-dev/loader-server": "^1.2.0",
|
|
41
|
-
"@nanoforge-dev/schematics": "^2.
|
|
41
|
+
"@nanoforge-dev/schematics": "^2.2.0",
|
|
42
42
|
"ansis": "^4.3.1",
|
|
43
43
|
"bun": "^1.3.14",
|
|
44
44
|
"chokidar": "^5.0.0",
|
|
@@ -48,31 +48,31 @@
|
|
|
48
48
|
"dotenv": "^17.4.2",
|
|
49
49
|
"node-emoji": "^2.2.0",
|
|
50
50
|
"open": "^11.0.0",
|
|
51
|
-
"ora": "^9.4.
|
|
51
|
+
"ora": "^9.4.1",
|
|
52
52
|
"rc9": "^3.0.1",
|
|
53
53
|
"reflect-metadata": "^0.2.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@commitlint/cli": "^21.0
|
|
57
|
-
"@commitlint/config-conventional": "^21.0
|
|
56
|
+
"@commitlint/cli": "^21.1.0",
|
|
57
|
+
"@commitlint/config-conventional": "^21.1.0",
|
|
58
58
|
"@favware/cliff-jumper": "^6.1.0",
|
|
59
|
-
"@nanoforge-dev/actions": "^2.1.
|
|
59
|
+
"@nanoforge-dev/actions": "^2.1.5",
|
|
60
60
|
"@nanoforge-dev/utils-eslint-config": "^1.0.2",
|
|
61
61
|
"@nanoforge-dev/utils-prettier-config": "^1.0.2",
|
|
62
62
|
"@trivago/prettier-plugin-sort-imports": "^6.0.2",
|
|
63
|
-
"@types/inquirer": "^9.0.
|
|
64
|
-
"@types/node": "^
|
|
65
|
-
"@vitest/coverage-v8": "^4.1.
|
|
66
|
-
"eslint": "^10.
|
|
63
|
+
"@types/inquirer": "^9.0.10",
|
|
64
|
+
"@types/node": "^26.0.1",
|
|
65
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
66
|
+
"eslint": "^10.6.0",
|
|
67
67
|
"husky": "^9.1.7",
|
|
68
|
-
"lint-staged": "^17.0.
|
|
69
|
-
"prettier": "^3.
|
|
70
|
-
"tsdown": "^0.22.
|
|
68
|
+
"lint-staged": "^17.0.8",
|
|
69
|
+
"prettier": "^3.9.3",
|
|
70
|
+
"tsdown": "^0.22.3",
|
|
71
71
|
"typescript": "^6.0.3",
|
|
72
|
-
"vitest": "^4.1.
|
|
72
|
+
"vitest": "^4.1.9"
|
|
73
73
|
},
|
|
74
74
|
"optionalDependencies": {
|
|
75
|
-
"@nanoforge-dev/editor": "
|
|
75
|
+
"@nanoforge-dev/editor": "0.0.2-beta.82a2d26"
|
|
76
76
|
},
|
|
77
77
|
"engines": {
|
|
78
78
|
"node": "25"
|