@nanoforge-dev/cli 1.5.4-beta.f618d37 → 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/nf.js CHANGED
@@ -16,7 +16,7 @@ import { Expose, Type, plainToInstance } from "class-transformer";
16
16
  import { IsBoolean, IsEnum, IsNotEmpty, IsObject, IsOptional, IsPort, IsString, Matches, ValidateNested, validate } from "class-validator";
17
17
  import { existsSync as existsSync$1, readFileSync } from "node:fs";
18
18
  import open from "open";
19
- import { read, readUser, write, writeUser } from "rc9";
19
+ import { read, readUserConfig, write, writeUserConfig } from "rc9";
20
20
  import dotenv from "dotenv";
21
21
  //#region src/lib/tree-kill/tree-kill.ts
22
22
  const treeKill = (pid, signal) => {
@@ -961,7 +961,7 @@ const runSafe = async (fn, fallback) => {
961
961
  }
962
962
  };
963
963
  //#endregion
964
- //#region \0@oxc-project+runtime@0.133.0/helpers/esm/decorate.js
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 open = getEditorOpenInput(options, !!path);
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 (open) await this.openEditor(path);
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 openEditor(path) {
1528
- await open(`http://localhost:3000/load-project${path ? `?projectPath=${encodeURIComponent(path)}` : ""}`);
1552
+ async openBrowser(url) {
1553
+ await open(url);
1529
1554
  }
1530
1555
  };
1531
1556
  //#endregion
@@ -1585,9 +1610,11 @@ const GLOBAL_CONFIG_DEFAULTS = {};
1585
1610
  //#region src/lib/global-config/global-config-handler.ts
1586
1611
  var GlobalConfigHandler = class {
1587
1612
  static read(dir) {
1588
- const localConfig = this._readConfig(read, false, dir);
1589
- if (localConfig) return localConfig;
1590
- return this._readConfig(readUser, true);
1613
+ const dirConfig = this._readConfig(read, false, dir);
1614
+ if (dirConfig) return dirConfig;
1615
+ const cwdConfig = this._readConfig(read, false, process.cwd());
1616
+ if (cwdConfig) return cwdConfig;
1617
+ return this._readConfig(readUserConfig, true);
1591
1618
  }
1592
1619
  static write(config, local = false, dir) {
1593
1620
  const options = {
@@ -1595,7 +1622,7 @@ var GlobalConfigHandler = class {
1595
1622
  dir
1596
1623
  };
1597
1624
  if (local) write(config, options);
1598
- else writeUser(config, options);
1625
+ else writeUserConfig(config, options);
1599
1626
  }
1600
1627
  static _readConfig(func, force, dir) {
1601
1628
  const res = func({
@@ -2174,7 +2201,7 @@ var StartAction = class extends AbstractAction {
2174
2201
  const serverDir = getStringInputWithDefault(options, "serverDir", config.server.outDir);
2175
2202
  const watch = getWatchInput(options);
2176
2203
  const port = getStringInputWithDefault(options, "port", config.client.port);
2177
- const ssl = this.resolveSSL(options);
2204
+ const ssl = this.resolveSSL(options, config);
2178
2205
  const tasks = this.buildStartTasks(config, directory, {
2179
2206
  clientDir,
2180
2207
  serverDir,
@@ -2185,12 +2212,14 @@ var StartAction = class extends AbstractAction {
2185
2212
  await Promise.all(tasks);
2186
2213
  return { keepAlive: true };
2187
2214
  }
2188
- resolveSSL(options) {
2189
- const cert = getStringInput(options, "cert");
2190
- const key = getStringInput(options, "key");
2191
- if (!cert && !key) return void 0;
2192
- if (!cert) throw new CLIError("No cert entered for SSL. Please enter a cert with --cert.");
2193
- if (!key) throw new CLIError("No key entered for SSL. Please enter a key with --key.");
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.");
2194
2223
  return {
2195
2224
  cert,
2196
2225
  key
@@ -2510,7 +2539,7 @@ var CommandLoader = class {
2510
2539
  };
2511
2540
  //#endregion
2512
2541
  //#region package.json
2513
- var version = "1.5.4-beta.f618d37";
2542
+ var version = "1.6.1-alpha.upgrade-schematics.0";
2514
2543
  //#endregion
2515
2544
  //#region src/bin/nf.ts
2516
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.5.4-beta.f618d37",
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": "^21.2.13",
37
- "@angular-devkit/schematics-cli": "^21.2.13",
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.1.3",
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.0",
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.2",
57
- "@commitlint/config-conventional": "^21.0.2",
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.2",
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.9",
64
- "@types/node": "^25.9.1",
65
- "@vitest/coverage-v8": "^4.1.8",
66
- "eslint": "^10.4.1",
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.7",
69
- "prettier": "^3.8.3",
70
- "tsdown": "^0.22.1",
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.8"
72
+ "vitest": "^4.1.9"
73
73
  },
74
74
  "optionalDependencies": {
75
- "@nanoforge-dev/editor": "file:../editor"
75
+ "@nanoforge-dev/editor": "0.0.2-beta.82a2d26"
76
76
  },
77
77
  "engines": {
78
78
  "node": "25"