@digitaldefiance/express-suite-starter 2.1.45 → 2.1.50

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.
Files changed (59) hide show
  1. package/README.md +20 -0
  2. package/dist/scripts/albatross.d.ts +2 -2
  3. package/dist/scripts/albatross.d.ts.map +1 -1
  4. package/dist/scripts/albatross.js +81 -4
  5. package/dist/scripts/albatross.js.map +1 -1
  6. package/dist/scripts/nodeSetup.d.ts.map +1 -1
  7. package/dist/scripts/nodeSetup.js +1 -0
  8. package/dist/scripts/nodeSetup.js.map +1 -1
  9. package/dist/src/core/interfaces/command-options.interface.d.ts +1 -0
  10. package/dist/src/core/interfaces/command-options.interface.d.ts.map +1 -1
  11. package/dist/src/core/interfaces/generator-context.interface.d.ts +1 -0
  12. package/dist/src/core/interfaces/generator-context.interface.d.ts.map +1 -1
  13. package/dist/src/core/project-generator.d.ts +7 -7
  14. package/dist/src/core/project-generator.d.ts.map +1 -1
  15. package/dist/src/core/project-generator.js +14 -14
  16. package/dist/src/core/project-generator.js.map +1 -1
  17. package/dist/src/generate-monorepo.d.ts.map +1 -1
  18. package/dist/src/generate-monorepo.js +48 -46
  19. package/dist/src/generate-monorepo.js.map +1 -1
  20. package/dist/src/i18n/starter-string-key.d.ts +2 -0
  21. package/dist/src/i18n/starter-string-key.d.ts.map +1 -1
  22. package/dist/src/i18n/starter-string-key.js +3 -0
  23. package/dist/src/i18n/starter-string-key.js.map +1 -1
  24. package/dist/src/i18n/translations-all.d.ts +2 -0
  25. package/dist/src/i18n/translations-all.d.ts.map +1 -1
  26. package/dist/src/i18n/translations-de.d.ts.map +1 -1
  27. package/dist/src/i18n/translations-de.js +3 -1
  28. package/dist/src/i18n/translations-de.js.map +1 -1
  29. package/dist/src/i18n/translations-en-gb.d.ts +2 -0
  30. package/dist/src/i18n/translations-en-gb.d.ts.map +1 -1
  31. package/dist/src/i18n/translations-en-us.d.ts.map +1 -1
  32. package/dist/src/i18n/translations-en-us.js +4 -1
  33. package/dist/src/i18n/translations-en-us.js.map +1 -1
  34. package/dist/src/i18n/translations-es.d.ts.map +1 -1
  35. package/dist/src/i18n/translations-es.js +3 -1
  36. package/dist/src/i18n/translations-es.js.map +1 -1
  37. package/dist/src/i18n/translations-fr.d.ts.map +1 -1
  38. package/dist/src/i18n/translations-fr.js +3 -1
  39. package/dist/src/i18n/translations-fr.js.map +1 -1
  40. package/dist/src/i18n/translations-ja.d.ts.map +1 -1
  41. package/dist/src/i18n/translations-ja.js +3 -1
  42. package/dist/src/i18n/translations-ja.js.map +1 -1
  43. package/dist/src/i18n/translations-uk.d.ts.map +1 -1
  44. package/dist/src/i18n/translations-uk.js +3 -1
  45. package/dist/src/i18n/translations-uk.js.map +1 -1
  46. package/dist/src/i18n/translations-zh-cn.d.ts.map +1 -1
  47. package/dist/src/i18n/translations-zh-cn.js +3 -1
  48. package/dist/src/i18n/translations-zh-cn.js.map +1 -1
  49. package/dist/src/utils/shell-utils.d.ts.map +1 -1
  50. package/dist/src/utils/shell-utils.js +5 -0
  51. package/dist/src/utils/shell-utils.js.map +1 -1
  52. package/dist/src/utils/system-check.d.ts.map +1 -1
  53. package/dist/src/utils/system-check.js +9 -10
  54. package/dist/src/utils/system-check.js.map +1 -1
  55. package/dist/src/utils/template-renderer.d.ts +2 -2
  56. package/dist/src/utils/template-renderer.d.ts.map +1 -1
  57. package/dist/src/utils/template-renderer.js +36 -19
  58. package/dist/src/utils/template-renderer.js.map +1 -1
  59. package/package.json +2 -1
package/README.md CHANGED
@@ -337,6 +337,26 @@ MIT © Digital Defiance
337
337
 
338
338
  ## ChangeLog
339
339
 
340
+ ### Version 2.1.50
341
+
342
+ #### Added:
343
+
344
+ - Complete user guide and deployment documentation
345
+
346
+ - Runtime configuration support for multi-domain deployments
347
+
348
+ #### Changed:
349
+
350
+ - inituserdb now always included (breaking change)
351
+
352
+ - React app uses environment-based API URLs
353
+
354
+ #### Fixed:
355
+
356
+ - Template renderer no longer copies .mustache source files
357
+
358
+ - VerifyEmailPage wrapper usage in scaffolding
359
+
340
360
  ### Version 2.1.45
341
361
 
342
362
  - Translate UI
@@ -1,4 +1,4 @@
1
- export declare const STARTER_VERSION = "1.0.0";
2
- export declare const STARTER_DESCRIPTION = "Node Express Suite Starter generates an NX monorepo MERN stack with React app, Express API, shared libraries, @digitaldefiance/node-express-suite, and @digitaldefiance/express-suite-react-components integration.";
1
+ export declare const STARTER_VERSION: any;
3
2
  export declare function printBanner(): void;
3
+ export declare function printIntro(): void;
4
4
  //# sourceMappingURL=albatross.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"albatross.d.ts","sourceRoot":"","sources":["../../scripts/albatross.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,UAAU,CAAC;AACvC,eAAO,MAAM,mBAAmB,wNAAwN,CAAC;AAEzP,wBAAgB,WAAW,IAAI,IAAI,CA4BlC"}
1
+ {"version":3,"file":"albatross.d.ts","sourceRoot":"","sources":["../../scripts/albatross.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,KAAsB,CAAC;AAEnD,wBAAgB,WAAW,IAAI,IAAI,CA2BlC;AACD,wBAAgB,UAAU,IAAI,IAAI,CAqBjC"}
@@ -1,9 +1,52 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
2
38
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STARTER_DESCRIPTION = exports.STARTER_VERSION = void 0;
39
+ exports.STARTER_VERSION = void 0;
4
40
  exports.printBanner = printBanner;
5
- exports.STARTER_VERSION = "1.0.0";
6
- exports.STARTER_DESCRIPTION = "Node Express Suite Starter generates an NX monorepo MERN stack with React app, Express API, shared libraries, @digitaldefiance/node-express-suite, and @digitaldefiance/express-suite-react-components integration.";
41
+ exports.printIntro = printIntro;
42
+ const i18n_1 = require("../src/i18n");
43
+ const chalk_1 = __importDefault(require("chalk"));
44
+ const path = __importStar(require("path"));
45
+ const fs = __importStar(require("fs"));
46
+ // Read version from package.json
47
+ const packageJsonPath = path.resolve(__dirname, '../../package.json');
48
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
49
+ exports.STARTER_VERSION = packageJson.version;
7
50
  function printBanner() {
8
51
  console.log(`
9
52
  \u001b[48;5;116m \u001b[m
@@ -31,6 +74,40 @@ function printBanner() {
31
74
  \u001b[48;5;116m \u001b[m
32
75
  \u001b[48;5;116m \u001b[m
33
76
  `);
34
- console.log(`\nNode Express Suite Starter (v${exports.STARTER_VERSION})\n\n${exports.STARTER_DESCRIPTION}\n`);
77
+ }
78
+ function printIntro() {
79
+ const title = (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STARTER_TITLE);
80
+ const description = (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STARTER_DESCRIPTION);
81
+ const boxWidth = 79;
82
+ const contentWidth = boxWidth - 4; // Account for '║ ' and ' ║'
83
+ const titleLine = `${title} v${exports.STARTER_VERSION}`;
84
+ const titlePadding = ' '.repeat(Math.max(0, contentWidth - titleLine.length));
85
+ const wrappedLines = wrapText(description, contentWidth);
86
+ const descriptionLines = wrappedLines.map(line => chalk_1.default.bold.cyan('║ ') + chalk_1.default.gray(line) + chalk_1.default.bold.cyan(' ║')).join('\n');
87
+ console.log('\n' +
88
+ chalk_1.default.bold.cyan('╔' + '═'.repeat(boxWidth - 2) + '╗') + '\n' +
89
+ chalk_1.default.bold.cyan('║ ') + chalk_1.default.bold.white(title) + chalk_1.default.bold.yellow(` v${exports.STARTER_VERSION}`) + titlePadding + chalk_1.default.bold.cyan(' ║') + '\n' +
90
+ chalk_1.default.bold.cyan('╠' + '═'.repeat(boxWidth - 2) + '╣') + '\n' +
91
+ descriptionLines + '\n' +
92
+ chalk_1.default.bold.cyan('╚' + '═'.repeat(boxWidth - 2) + '╝') + '\n');
93
+ }
94
+ function wrapText(text, width) {
95
+ const words = text.split(' ');
96
+ const lines = [];
97
+ let currentLine = '';
98
+ for (const word of words) {
99
+ const testLine = currentLine ? `${currentLine} ${word}` : word;
100
+ if (testLine.length <= width) {
101
+ currentLine = testLine;
102
+ }
103
+ else {
104
+ if (currentLine)
105
+ lines.push(currentLine.padEnd(width));
106
+ currentLine = word;
107
+ }
108
+ }
109
+ if (currentLine)
110
+ lines.push(currentLine.padEnd(width));
111
+ return lines;
35
112
  }
36
113
  //# sourceMappingURL=albatross.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"albatross.js","sourceRoot":"","sources":["../../scripts/albatross.ts"],"names":[],"mappings":";;;AAGA,kCA4BC;AA/BY,QAAA,eAAe,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C,CAAC;IAC9B,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,WAAW,GAAG,EAAE,CAAC;IAErB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACvB,MAAM,QAAQ,GAAG,WAAW,CAAC,CAAC,CAAC,GAAG,WAAW,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;QAC/D,IAAI,QAAQ,CAAC,MAAM,IAAI,KAAK,EAAE,CAAC;YAC3B,WAAW,GAAG,QAAQ,CAAC;QAC3B,CAAC;aAAM,CAAC;YACJ,IAAI,WAAW;gBAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YACvD,WAAW,GAAG,IAAI,CAAC;QACvB,CAAC;IACL,CAAC;IACD,IAAI,WAAW;QAAE,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvD,OAAO,KAAK,CAAC;AACjB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"nodeSetup.d.ts","sourceRoot":"","sources":["../../scripts/nodeSetup.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,eAAe,SAqB9B"}
1
+ {"version":3,"file":"nodeSetup.d.ts","sourceRoot":"","sources":["../../scripts/nodeSetup.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,wBAAgB,eAAe,SAsB9B"}
@@ -28,5 +28,6 @@ function checkAndUseNode() {
28
28
  catch {
29
29
  console.warn("Failed to enable corepack or set up Yarn. Please ensure corepack and yarn are available.");
30
30
  }
31
+ console.log('');
31
32
  }
32
33
  //# sourceMappingURL=nodeSetup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodeSetup.js","sourceRoot":"","sources":["../../scripts/nodeSetup.ts"],"names":[],"mappings":";;AAKA,0CAqBC;AA1BD,qDAAmD;AAEnD;;GAEG;AACH,SAAgB,eAAe;IAC7B,MAAM,EAAE,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AAM,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,+DAA+D;IAC/D,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,CAAC;IACjE,MAAM,SAAS,GAAG,GAAG,MAAM,SAAS,CAAC;IACrC,MAAM,QAAQ,GAAG,SAAS,SAAS,aAAa,SAAS,oBAAoB,gCAAe,eAAe,gCAAe,EAAE,CAAC;IAC7H,IAAI,CAAC;QACH,QAAQ,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,gCAAgC,gCAAe,2BAA2B,CAAC,CAAC;IAC1F,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,+CAA+C,gCAAe,2BAA2B,gCAAe,wCAAwC,CAAC,CAAC;IACjK,CAAC;IACD,mCAAmC;IACnC,IAAI,CAAC;QACH,QAAQ,CAAC,iBAAiB,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAClD,QAAQ,CAAC,yCAAyC,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC1E,OAAO,CAAC,GAAG,CAAC,mCAAmC,CAAC,CAAC;IACnD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,0FAA0F,CAAC,CAAC;IAC3G,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  export interface CommandOptions {
2
2
  cwd?: string;
3
3
  silent?: boolean;
4
+ dryRun?: boolean;
4
5
  }
5
6
  //# sourceMappingURL=command-options.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/core/interfaces/command-options.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
1
+ {"version":3,"file":"command-options.interface.d.ts","sourceRoot":"","sources":["../../../../src/core/interfaces/command-options.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB"}
@@ -2,5 +2,6 @@ export interface GeneratorContext {
2
2
  config: any;
3
3
  state: Map<string, any>;
4
4
  checkpointPath: string;
5
+ dryRun: boolean;
5
6
  }
6
7
  //# sourceMappingURL=generator-context.interface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generator-context.interface.d.ts","sourceRoot":"","sources":["../../../../src/core/interfaces/generator-context.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;CACxB"}
1
+ {"version":3,"file":"generator-context.interface.d.ts","sourceRoot":"","sources":["../../../../src/core/interfaces/generator-context.interface.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,GAAG,CAAC;IACZ,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACxB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB"}
@@ -1,11 +1,11 @@
1
1
  import { ProjectConfig } from './interfaces';
2
2
  export declare class ProjectGenerator {
3
- static generateReact(config: ProjectConfig, monorepoPath: string, nx: any): void;
4
- static generateReactLib(config: ProjectConfig, monorepoPath: string, nx: any): void;
5
- static generateApi(config: ProjectConfig, monorepoPath: string, nx: any): void;
6
- static generateApiLib(config: ProjectConfig, monorepoPath: string, nx: any): void;
7
- static generateLib(config: ProjectConfig, monorepoPath: string, nx: any): void;
8
- static generateInitUserDb(config: ProjectConfig, monorepoPath: string): void;
9
- static generateTestUtils(config: ProjectConfig, monorepoPath: string, nx: any): void;
3
+ static generateReact(config: ProjectConfig, monorepoPath: string, nx: any, dryRun?: boolean): void;
4
+ static generateReactLib(config: ProjectConfig, monorepoPath: string, nx: any, dryRun?: boolean): void;
5
+ static generateApi(config: ProjectConfig, monorepoPath: string, nx: any, dryRun?: boolean): void;
6
+ static generateApiLib(config: ProjectConfig, monorepoPath: string, nx: any, dryRun?: boolean): void;
7
+ static generateLib(config: ProjectConfig, monorepoPath: string, nx: any, dryRun?: boolean): void;
8
+ static generateInitUserDb(config: ProjectConfig, monorepoPath: string, dryRun?: boolean): void;
9
+ static generateTestUtils(config: ProjectConfig, monorepoPath: string, nx: any, dryRun?: boolean): void;
10
10
  }
11
11
  //# sourceMappingURL=project-generator.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project-generator.d.ts","sourceRoot":"","sources":["../../../src/core/project-generator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,qBAAa,gBAAgB;IAC3B,MAAM,CAAC,aAAa,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI;IAOhF,MAAM,CAAC,gBAAgB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI;IAOnF,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI;IAO9E,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,GAAG,IAAI;IAOjF,MAA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iB,CAAC,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,MAAM,UAAQ,GAAG,IAAI;CAMrG"}
@@ -3,26 +3,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProjectGenerator = void 0;
4
4
  const shell_utils_1 = require("../utils/shell-utils");
5
5
  class ProjectGenerator {
6
- static generateReact(config, monorepoPath, nx) {
7
- (0, shell_utils_1.runCommand)(`npx nx g @nx/react:application ${config.name} --style=${nx.style} --routing=true --bundler=${nx.bundler} --linter=eslint --unitTestRunner=jest --e2eTestRunner=${nx.e2eTestRunner} --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath });
6
+ static generateReact(config, monorepoPath, nx, dryRun = false) {
7
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/react:application ${config.name} --style=${nx.style} --routing=true --bundler=${nx.bundler} --linter=eslint --unitTestRunner=jest --e2eTestRunner=${nx.e2eTestRunner} --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath, dryRun });
8
8
  }
9
- static generateReactLib(config, monorepoPath, nx) {
10
- (0, shell_utils_1.runCommand)(`npx nx g @nx/react:library ${config.name} --style=${nx.style} --bundler=${nx.bundler} --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath });
9
+ static generateReactLib(config, monorepoPath, nx, dryRun = false) {
10
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/react:library ${config.name} --style=${nx.style} --bundler=${nx.bundler} --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath, dryRun });
11
11
  }
12
- static generateApi(config, monorepoPath, nx) {
13
- (0, shell_utils_1.runCommand)(`npx nx g @nx/node:application ${config.name} --framework=express --linter=eslint --unitTestRunner=jest --e2eTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath });
12
+ static generateApi(config, monorepoPath, nx, dryRun = false) {
13
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/node:application ${config.name} --framework=express --linter=eslint --unitTestRunner=jest --e2eTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath, dryRun });
14
14
  }
15
- static generateApiLib(config, monorepoPath, nx) {
16
- (0, shell_utils_1.runCommand)(`npx nx g @nx/js:lib ${config.name} --bundler=none --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath });
15
+ static generateApiLib(config, monorepoPath, nx, dryRun = false) {
16
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/js:lib ${config.name} --bundler=none --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath, dryRun });
17
17
  }
18
- static generateLib(config, monorepoPath, nx) {
19
- (0, shell_utils_1.runCommand)(`npx nx g @nx/js:lib ${config.name} --bundler=none --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath });
18
+ static generateLib(config, monorepoPath, nx, dryRun = false) {
19
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/js:lib ${config.name} --bundler=none --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath, dryRun });
20
20
  }
21
- static generateInitUserDb(config, monorepoPath) {
22
- (0, shell_utils_1.runCommand)(`npx nx g @nx/node:application ${config.name} --framework=none --linter=eslint --unitTestRunner=jest --no-interactive`, { cwd: monorepoPath });
21
+ static generateInitUserDb(config, monorepoPath, dryRun = false) {
22
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/node:application ${config.name} --framework=none --linter=eslint --unitTestRunner=jest --no-interactive`, { cwd: monorepoPath, dryRun });
23
23
  }
24
- static generateTestUtils(config, monorepoPath, nx) {
25
- (0, shell_utils_1.runCommand)(`npx nx g @nx/js:lib ${config.name} --bundler=none --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath });
24
+ static generateTestUtils(config, monorepoPath, nx, dryRun = false) {
25
+ (0, shell_utils_1.runCommand)(`npx nx g @nx/js:lib ${config.name} --bundler=none --linter=eslint --unitTestRunner=jest --importPath=${config.importPath} --no-interactive`, { cwd: monorepoPath, dryRun });
26
26
  }
27
27
  }
28
28
  exports.ProjectGenerator = ProjectGenerator;
@@ -1 +1 @@
1
- {"version":3,"file":"project-generator.js","sourceRoot":"","sources":["../../../src/core/project-generator.ts"],"names":[],"mappings":";;;AAAA,sDAAkD;AAGlD,MAAa,gBAAgB;IAC3B,MAAM,CAAC,aAAa,CAAC,MAAqB,EAAE,YAAoB,EAAE,EAAO;QACvE,IAAA,wBAAU,EACR,kCAAkC,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC,KAAK,6BAA6B,EAAE,CAAC,OAAO,0DAA0D,EAAE,CAAC,aAAa,iBAAiB,MAAM,CAAC,UAAU,mBAAmB,EACvO,EAAE,GAAG,EAAE,YAAY,EAAE,CACtB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,gBAAgB,CAAC,MAAqB,EAAE,YAAoB,EAAE,EAAO;QAC1E,IAAA,wBAAU,EACR,8BAA8B,MAAM,CAAC,IAAI,YAAY,EAAE,CAAC,KAAK,cAAc,EAAE,CAAC,OAAO,uDAAuD,MAAM,CAAC,UAAU,mBAAmB,EAChL,EAAE,GAAG,EAAE,YAAY,EAAE,CACtB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,MAAqB,EAAE,YAAoB,EAAE,EAAO;QACrE,IAAA,wBAAU,EACR,iCAAiC,MAAM,CAAC,IAAI,gGAAgG,MAAM,CAAC,UAAU,mBAAmB,EAChL,EAAE,GAAG,EAAE,YAAY,EAAE,CACtB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,cAAc,CAAC,MAAqB,EAAE,YAAoB,EAAE,EAAO;QACxE,IAAA,wBAAU,EACR,uBAAuB,MAAM,CAAC,IAAI,sEAAsE,MAAM,CAAC,UAAU,mBAAmB,EAC5I,EAAE,GAAG,EAAE,YAAY,EAAE,CAC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CAAC,UAAU,mBAAmB,EAC5I,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,EAAE,CAC9B,CAAC;IACJ,CAAC;CACF;AAjDD,4CAiDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate-monorepo.d.ts","sourceRoot":"","sources":["../../src/generate-monorepo.ts"],"names":[],"mappings":"AAyBA,iBAAe,IAAI,kBA8zBlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
1
+ {"version":3,"file":"generate-monorepo.d.ts","sourceRoot":"","sources":["../../src/generate-monorepo.ts"],"names":[],"mappings":"AAyBA,iBAAe,IAAI,kBAm0BlB;AAED,OAAO,EAAE,IAAI,EAAE,CAAC"}
@@ -83,6 +83,7 @@ async function main() {
83
83
  // Set the language for the i18n engine
84
84
  const i18nEngine = (0, i18n_1.getStarterI18nEngine)();
85
85
  i18nEngine.setLanguage(selectedLanguage);
86
+ (0, albatross_1.printIntro)();
86
87
  // System check
87
88
  logger_1.Logger.header((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.SYSTEM_CHECK_HEADER));
88
89
  const systemCheck = system_check_1.SystemCheck.check();
@@ -258,6 +259,7 @@ async function main() {
258
259
  config,
259
260
  state: new Map(stateEntries),
260
261
  checkpointPath: path.join(parentDir, `.${workspaceName}.checkpoint`),
262
+ dryRun,
261
263
  };
262
264
  // Merge selected package groups
263
265
  const additionalPackages = [];
@@ -295,8 +297,8 @@ async function main() {
295
297
  executor.addStep({
296
298
  name: 'createMonorepo',
297
299
  description: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STEP_CREATE_MONOREPO),
298
- execute: () => {
299
- (0, shell_utils_1.runCommand)(`npx create-nx-workspace@latest "${workspaceName}" --package-manager=yarn --preset=apps --ci=${config.nx?.ciProvider}`, { cwd: parentDir });
300
+ execute: (context) => {
301
+ (0, shell_utils_1.runCommand)(`npx create-nx-workspace@latest "${workspaceName}" --package-manager=yarn --preset=apps --ci=${config.nx?.ciProvider}`, { cwd: parentDir, dryRun: context.dryRun });
300
302
  },
301
303
  });
302
304
  executor.addStep({
@@ -304,16 +306,16 @@ async function main() {
304
306
  description: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STEP_SETUP_GIT_ORIGIN),
305
307
  skip: () => !gitRepo,
306
308
  execute: () => {
307
- (0, shell_utils_1.runCommand)(`git remote add origin ${gitRepo}`, { cwd: monorepoPath });
309
+ (0, shell_utils_1.runCommand)(`git remote add origin ${gitRepo}`, { cwd: monorepoPath, dryRun: context.dryRun });
308
310
  },
309
311
  });
310
312
  executor.addStep({
311
313
  name: 'yarnBerrySetup',
312
314
  description: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STEP_YARN_BERRY_SETUP),
313
315
  execute: () => {
314
- (0, shell_utils_1.runCommand)('yarn set version berry', { cwd: monorepoPath });
315
- (0, shell_utils_1.runCommand)('yarn config set nodeLinker node-modules', { cwd: monorepoPath });
316
- (0, shell_utils_1.runCommand)('yarn', { cwd: monorepoPath });
316
+ (0, shell_utils_1.runCommand)('yarn set version berry', { cwd: monorepoPath, dryRun: context.dryRun });
317
+ (0, shell_utils_1.runCommand)('yarn config set nodeLinker node-modules', { cwd: monorepoPath, dryRun: context.dryRun });
318
+ (0, shell_utils_1.runCommand)('yarn', { cwd: monorepoPath, dryRun: context.dryRun });
317
319
  },
318
320
  });
319
321
  executor.addStep({
@@ -321,7 +323,7 @@ async function main() {
321
323
  description: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STEP_ADD_NX_PLUGINS),
322
324
  execute: () => {
323
325
  try {
324
- (0, shell_utils_1.runCommand)('yarn add -D @nx/react @nx/node', { cwd: monorepoPath });
326
+ (0, shell_utils_1.runCommand)('yarn add -D @nx/react @nx/node', { cwd: monorepoPath, dryRun: context.dryRun });
325
327
  }
326
328
  catch (error) {
327
329
  if (error.status === 1) {
@@ -343,10 +345,10 @@ async function main() {
343
345
  const devPkgs = config.packages?.dev || [];
344
346
  const prodPkgs = config.packages?.prod || [];
345
347
  if (devPkgs.length > 0) {
346
- (0, shell_utils_1.runCommand)(`yarn add -D ${devPkgs.join(' ')}`, { cwd: monorepoPath });
348
+ (0, shell_utils_1.runCommand)(`yarn add -D ${devPkgs.join(' ')}`, { cwd: monorepoPath, dryRun: context.dryRun });
347
349
  }
348
350
  if (prodPkgs.length > 0) {
349
- (0, shell_utils_1.runCommand)(`yarn add ${prodPkgs.join(' ')}`, { cwd: monorepoPath });
351
+ (0, shell_utils_1.runCommand)(`yarn add ${prodPkgs.join(' ')}`, { cwd: monorepoPath, dryRun: context.dryRun });
350
352
  }
351
353
  },
352
354
  });
@@ -360,22 +362,22 @@ async function main() {
360
362
  logger_1.Logger.info((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.PROJECT_GENERATING, { type: project.type, name: project.name }));
361
363
  switch (project.type) {
362
364
  case 'react':
363
- project_generator_1.ProjectGenerator.generateReact(project, monorepoPath, config.nx);
365
+ project_generator_1.ProjectGenerator.generateReact(project, monorepoPath, config.nx, context.dryRun);
364
366
  break;
365
367
  case 'react-lib':
366
- project_generator_1.ProjectGenerator.generateReactLib(project, monorepoPath, config.nx);
368
+ project_generator_1.ProjectGenerator.generateReactLib(project, monorepoPath, config.nx, context.dryRun);
367
369
  break;
368
370
  case 'api':
369
- project_generator_1.ProjectGenerator.generateApi(project, monorepoPath, config.nx);
371
+ project_generator_1.ProjectGenerator.generateApi(project, monorepoPath, config.nx, context.dryRun);
370
372
  break;
371
373
  case 'api-lib':
372
- project_generator_1.ProjectGenerator.generateApiLib(project, monorepoPath, config.nx);
374
+ project_generator_1.ProjectGenerator.generateApiLib(project, monorepoPath, config.nx, context.dryRun);
373
375
  break;
374
376
  case 'lib':
375
- project_generator_1.ProjectGenerator.generateLib(project, monorepoPath, config.nx);
377
+ project_generator_1.ProjectGenerator.generateLib(project, monorepoPath, config.nx, context.dryRun);
376
378
  break;
377
379
  case 'inituserdb':
378
- project_generator_1.ProjectGenerator.generateInitUserDb(project, monorepoPath);
380
+ project_generator_1.ProjectGenerator.generateInitUserDb(project, monorepoPath, context.dryRun);
379
381
  break;
380
382
  }
381
383
  });
@@ -462,7 +464,7 @@ async function main() {
462
464
  projectPackageJson.dependencies = projectPackageJson.dependencies || {};
463
465
  projectPackageJson.dependencies['@digitaldefiance/express-suite-react-components'] = 'latest';
464
466
  fs.writeFileSync(projectPackageJsonPath, JSON.stringify(projectPackageJson, null, 2) + '\n');
465
- (0, shell_utils_1.runCommand)('yarn install', { cwd: monorepoPath });
467
+ (0, shell_utils_1.runCommand)('yarn install', { cwd: monorepoPath, dryRun: context.dryRun });
466
468
  }
467
469
  },
468
470
  });
@@ -485,7 +487,7 @@ async function main() {
485
487
  const key = project.type === 'lib' ? 'LIB_NAME' : `${project.type.toUpperCase().replace(/-/g, '_')}_NAME`;
486
488
  variables[key] = project.name;
487
489
  });
488
- (0, template_renderer_1.renderTemplates)(context.state.get('templatesDir'), monorepoPath, variables, config.templates?.engine);
490
+ (0, template_renderer_1.renderTemplates)(context.state.get('templatesDir'), monorepoPath, variables, config.templates?.engine, context.dryRun);
489
491
  },
490
492
  });
491
493
  executor.addStep({
@@ -504,21 +506,21 @@ async function main() {
504
506
  // Copy root scaffolding
505
507
  const rootSrc = path.join(scaffoldingDir, 'root');
506
508
  if (fs.existsSync(rootSrc)) {
507
- (0, template_renderer_1.copyDir)(rootSrc, monorepoPath, scaffoldingVars);
509
+ (0, template_renderer_1.copyDir)(rootSrc, monorepoPath, scaffoldingVars, 'mustache', context.dryRun);
508
510
  }
509
511
  // Copy devcontainer configuration
510
512
  if (devcontainerChoice !== 'none') {
511
513
  const devcontainerSrc = path.join(scaffoldingDir, `devcontainer-${devcontainerChoice}`);
512
514
  if (fs.existsSync(devcontainerSrc)) {
513
515
  logger_1.Logger.info(`Copying devcontainer configuration: ${devcontainerChoice}`);
514
- (0, template_renderer_1.copyDir)(devcontainerSrc, monorepoPath, scaffoldingVars);
516
+ (0, template_renderer_1.copyDir)(devcontainerSrc, monorepoPath, scaffoldingVars, 'handlebars', context.dryRun);
515
517
  }
516
518
  }
517
519
  // Copy project-specific scaffolding
518
520
  projects.forEach(project => {
519
521
  const projectSrc = path.join(scaffoldingDir, project.type);
520
522
  if (fs.existsSync(projectSrc)) {
521
- (0, template_renderer_1.copyDir)(projectSrc, path.join(monorepoPath, project.name), scaffoldingVars);
523
+ (0, template_renderer_1.copyDir)(projectSrc, path.join(monorepoPath, project.name), scaffoldingVars, 'mustache', context.dryRun);
522
524
  }
523
525
  });
524
526
  },
@@ -587,9 +589,16 @@ async function main() {
587
589
  execute: () => {
588
590
  const apiProject = projects.find(p => p.type === 'api');
589
591
  const initUserDbProject = projects.find(p => p.type === 'inituserdb');
590
- // Build MONGO_URI with optional password
592
+ // Escape password for .env file usage
593
+ const escapeEnvValue = (value) => {
594
+ // Use single quotes - safest for passwords with special chars
595
+ // Only need to escape single quotes themselves
596
+ const escaped = value.replace(/'/g, "'\\''");
597
+ return `'${escaped}'`;
598
+ };
599
+ // Build MONGO_URI with optional password (URL-encode password for special characters)
591
600
  const buildMongoUri = (dbName) => {
592
- const auth = mongoPassword ? `root:${mongoPassword}@` : '';
601
+ const auth = mongoPassword ? `root:${encodeURIComponent(mongoPassword)}@` : '';
593
602
  const params = devcontainerChoice === 'mongodb-replicaset'
594
603
  ? '?replicaSet=rs0&directConnection=true'
595
604
  : '?directConnection=true';
@@ -617,6 +626,13 @@ async function main() {
617
626
  const mongoUri = buildMongoUri(workspaceName);
618
627
  envContent = envContent.replace(/MONGO_URI=.*/g, `MONGO_URI=${mongoUri}`);
619
628
  }
629
+ // Enable transactions for replica set
630
+ if (devcontainerChoice === 'mongodb-replicaset') {
631
+ envContent = envContent.replace(/MONGO_USE_TRANSACTIONS=.*/g, 'MONGO_USE_TRANSACTIONS=true');
632
+ }
633
+ else {
634
+ envContent = envContent.replace(/MONGO_USE_TRANSACTIONS=.*/g, 'MONGO_USE_TRANSACTIONS=false');
635
+ }
620
636
  fs.writeFileSync(envPath, envContent);
621
637
  logger_1.Logger.info(`Created ${apiProject.name}/.env with secrets`);
622
638
  }
@@ -637,30 +653,16 @@ async function main() {
637
653
  if (fs.existsSync(devcontainerEnvExamplePath)) {
638
654
  let envContent = fs.readFileSync(devcontainerEnvExamplePath, 'utf-8');
639
655
  const mongoUri = buildMongoUri(workspaceName);
640
- // Replace MongoDB configuration
641
- envContent = envContent.replace(/MONGO_INITDB_ROOT_PASSWORD=.*/g, `MONGO_INITDB_ROOT_PASSWORD=${mongoPassword}`);
656
+ // Replace MongoDB configuration for Docker Compose
657
+ envContent = envContent.replace(/MONGO_INITDB_ROOT_PASSWORD=.*/g, `MONGO_INITDB_ROOT_PASSWORD=${escapeEnvValue(mongoPassword)}`);
642
658
  envContent = envContent.replace(/MONGO_INITDB_DATABASE=.*/g, `MONGO_INITDB_DATABASE=${workspaceName}`);
643
659
  envContent = envContent.replace(/COMPOSE_PROJECT_NAME=.*/g, `COMPOSE_PROJECT_NAME=${workspaceName}_devcontainer`);
644
- // Add MONGO_PASSWORD and MONGO_URI if not present
645
- if (!envContent.includes('MONGO_PASSWORD=')) {
646
- envContent += `\nMONGO_PASSWORD=${mongoPassword}\n`;
647
- }
648
- else {
649
- envContent = envContent.replace(/MONGO_PASSWORD=.*/g, `MONGO_PASSWORD=${mongoPassword}`);
650
- }
651
- if (!envContent.includes('MONGO_URI=')) {
652
- envContent += `MONGO_URI=${mongoUri}\n`;
653
- }
654
- else {
655
- envContent = envContent.replace(/MONGO_URI=.*/g, `MONGO_URI=${mongoUri}`);
656
- }
657
660
  fs.writeFileSync(devcontainerEnvPath, envContent);
658
661
  logger_1.Logger.info((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.ENV_CREATED_DEVCONTAINER_FROM_EXAMPLE));
659
662
  }
660
663
  else {
661
664
  // Fallback to minimal .env if .env.example doesn't exist
662
- const mongoUri = buildMongoUri(workspaceName);
663
- const envContent = `MONGO_PASSWORD=${mongoPassword}\nMONGO_URI=${mongoUri}\n`;
665
+ const envContent = `MONGO_INITDB_ROOT_PASSWORD=${escapeEnvValue(mongoPassword)}\nMONGO_INITDB_DATABASE=${workspaceName}\nCOMPOSE_PROJECT_NAME=${workspaceName}_devcontainer\n`;
664
666
  fs.writeFileSync(devcontainerEnvPath, envContent);
665
667
  logger_1.Logger.warning((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.ENV_CREATED_DEVCONTAINER_MINIMAL));
666
668
  }
@@ -672,8 +674,8 @@ async function main() {
672
674
  description: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.STEP_REBUILD_NATIVE_MODULES),
673
675
  execute: () => {
674
676
  logger_1.Logger.info((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.COMMAND_REBUILDING_NATIVE));
675
- (0, shell_utils_1.runCommand)('yarn config set enableScripts true', { cwd: monorepoPath });
676
- (0, shell_utils_1.runCommand)('yarn rebuild', { cwd: monorepoPath });
677
+ (0, shell_utils_1.runCommand)('yarn config set enableScripts true', { cwd: monorepoPath, dryRun: context.dryRun });
678
+ (0, shell_utils_1.runCommand)('yarn rebuild', { cwd: monorepoPath, dryRun: context.dryRun });
677
679
  },
678
680
  });
679
681
  executor.addStep({
@@ -695,22 +697,22 @@ async function main() {
695
697
  execute: async () => {
696
698
  // Ensure git is initialized
697
699
  if (!fs.existsSync(path.join(monorepoPath, '.git'))) {
698
- (0, shell_utils_1.runCommand)('git init', { cwd: monorepoPath });
700
+ (0, shell_utils_1.runCommand)('git init', { cwd: monorepoPath, dryRun: context.dryRun });
699
701
  }
700
702
  const doCommit = await (0, confirm_1.default)({
701
703
  message: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.PROMPT_CREATE_INITIAL_COMMIT),
702
704
  default: true,
703
705
  });
704
706
  if (doCommit) {
705
- (0, shell_utils_1.runCommand)('git add -A', { cwd: monorepoPath });
706
- (0, shell_utils_1.runCommand)('git commit -m "Initial commit"', { cwd: monorepoPath });
707
+ (0, shell_utils_1.runCommand)('git add -A', { cwd: monorepoPath, dryRun: context.dryRun });
708
+ (0, shell_utils_1.runCommand)('git commit -m "Initial commit"', { cwd: monorepoPath, dryRun: context.dryRun });
707
709
  if (gitRepo) {
708
710
  const doPush = await (0, confirm_1.default)({
709
711
  message: (0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.PROMPT_PUSH_TO_REMOTE),
710
712
  default: true,
711
713
  });
712
714
  if (doPush) {
713
- (0, shell_utils_1.runCommand)('git push --set-upstream origin main', { cwd: monorepoPath });
715
+ (0, shell_utils_1.runCommand)('git push --set-upstream origin main', { cwd: monorepoPath, dryRun: context.dryRun });
714
716
  }
715
717
  }
716
718
  }
@@ -727,7 +729,7 @@ async function main() {
727
729
  });
728
730
  if (installPlaywright) {
729
731
  logger_1.Logger.info((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.COMMAND_INSTALLING_PLAYWRIGHT_BROWSERS));
730
- (0, shell_utils_1.runCommand)('yarn playwright install --with-deps', { cwd: monorepoPath });
732
+ (0, shell_utils_1.runCommand)('yarn playwright install --with-deps', { cwd: monorepoPath, dryRun: context.dryRun });
731
733
  }
732
734
  else {
733
735
  logger_1.Logger.warning((0, i18n_1.getStarterTranslation)(i18n_1.StarterStringKey.COMMAND_SKIPPED_PLAYWRIGHT));