@storm-software/projen 0.9.76 → 0.9.78

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.
@@ -1,13 +1,15 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
- var _chunkPHMFOUDCjs = require('../../chunk-PHMFOUDC.js');
3
+ var _chunkNNSWWAGPjs = require('../../chunk-NNSWWAGP.js');
4
4
 
5
5
 
6
-
7
- var _chunkLTKRUM5Pjs = require('../../chunk-LTKRUM5P.js');
6
+ var _chunkBG73ZJERjs = require('../../chunk-BG73ZJER.js');
8
7
 
9
8
  // src/components/nx-workspace.ts
10
- _chunkLTKRUM5Pjs.init_cjs_shims.call(void 0, );
9
+ _chunkBG73ZJERjs.init_cjs_shims.call(void 0, );
10
+
11
+
12
+
11
13
  var _nxworkspace = require('@aws/pdk/monorepo/components/nx-workspace');
12
14
  var _utils = require('@aws/pdk/monorepo/utils');
13
15
  var _common = require('@aws/pdk/monorepo/utils/common');
@@ -18,35 +20,34 @@ var NX_DEFAULT_BUILD_OUTPUTS = [
18
20
  "{workspaceRoot}/dist/{projectRoot}"
19
21
  ];
20
22
  var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
21
- static {
22
- _chunkLTKRUM5Pjs.__name.call(void 0, this, "StormNxWorkspace");
23
- }
24
23
  /**
25
- * Retrieves the singleton instance associated with project root.
26
- *
27
- * @param scope project instance.
28
- */
24
+ * Retrieves the singleton instance associated with project root.
25
+ *
26
+ * @param scope project instance.
27
+ */
29
28
  static of(scope) {
30
- return scope.root.components.find((c) => _utils.ProjectUtils.isNamedInstanceOf(c, _nxworkspace.NxWorkspace));
29
+ return scope.root.components.find(
30
+ (c) => _utils.ProjectUtils.isNamedInstanceOf(c, _nxworkspace.NxWorkspace)
31
+ );
31
32
  }
32
33
  /**
33
- * Raw nx.json file to support overrides that aren't handled
34
- * directly.
35
- *
36
- * **Attention:** any overrides applied here will not be visible
37
- * in the properties and only included in final synthesized output,
38
- * and likely to override native handling.
39
- * @advanced
40
- */
34
+ * Raw nx.json file to support overrides that aren't handled
35
+ * directly.
36
+ *
37
+ * **Attention:** any overrides applied here will not be visible
38
+ * in the properties and only included in final synthesized output,
39
+ * and likely to override native handling.
40
+ * @advanced
41
+ */
41
42
 
42
43
  /**
43
- * Automatically infer NxProject targets based on project type.
44
- * @experimental
45
- */
44
+ * Automatically infer NxProject targets based on project type.
45
+ * @experimental
46
+ */
46
47
  __init() {this.autoInferProjectTargets = true}
47
48
  /**
48
- * List of cacheable operations.
49
- */
49
+ * List of cacheable operations.
50
+ */
50
51
  __init2() {this.cacheableOperations = [
51
52
  "lint-sherif",
52
53
  "lint-knip",
@@ -65,22 +66,20 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
65
66
  "nx-release-publish"
66
67
  ]}
67
68
  /**
68
- * Some presets use the extends property to hide some default options in a separate json file.
69
- * The json file specified in the extends property is located in your node_modules folder.
70
- * The Nx preset files are specified in the nx package.
71
- *
72
- * @default "@storm-software/workspace-tools/config/base.json"
73
- */
69
+ * Some presets use the extends property to hide some default options in a separate json file.
70
+ * The json file specified in the extends property is located in your node_modules folder.
71
+ * The Nx preset files are specified in the nx package.
72
+ *
73
+ * @default "@storm-software/workspace-tools/config/base.json"
74
+ */
74
75
  __init3() {this.extends = "@storm-software/workspace-tools/config/base.json"}
75
76
  /**
76
- * Plugins for extending the project graph
77
- */
77
+ * Plugins for extending the project graph
78
+ */
78
79
  __init4() {this.nxPlugins = [
79
80
  {
80
81
  plugin: "@nx/eslint/plugin",
81
- exclude: [
82
- "packages/**/__fixtures__/**/*"
83
- ],
82
+ exclude: ["packages/**/__fixtures__/**/*"],
84
83
  options: {
85
84
  targetName: "lint",
86
85
  useFlatConfig: true
@@ -91,15 +90,15 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
91
90
  "@storm-software/workspace-tools/plugins/typescript/tsup"
92
91
  ]}
93
92
  /**
94
- * Default options for `nx affected`
95
- */
93
+ * Default options for `nx affected`
94
+ */
96
95
  __init5() {this.affected = {
97
96
  defaultBase: "main"
98
97
  }}
99
98
  /**
100
- * Named inputs
101
- * @see https://nx.dev/reference/nx-json#inputs-&-namedinputs
102
- */
99
+ * Named inputs
100
+ * @see https://nx.dev/reference/nx-json#inputs-&-namedinputs
101
+ */
103
102
  __init6() {this.namedInputs = {
104
103
  // https://nx.dev/more-concepts/customizing-inputs#defaults
105
104
  sharedGlobals: [
@@ -140,10 +139,7 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
140
139
  "{workspaceRoot}/.env",
141
140
  "{workspaceRoot}/.env.local"
142
141
  ],
143
- default: [
144
- "sharedGlobals",
145
- "{projectRoot}/**/*"
146
- ],
142
+ default: ["sharedGlobals", "{projectRoot}/**/*"],
147
143
  production: [
148
144
  "{projectRoot}/**/*",
149
145
  "!{projectRoot}/tools/**/*",
@@ -378,23 +374,15 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
378
374
  ]
379
375
  }}
380
376
  /**
381
- * Dependencies between different target names across all projects
382
- *
383
- * @see https://nx.dev/reference/nx-json#target-defaults
384
- */
377
+ * Dependencies between different target names across all projects
378
+ *
379
+ * @see https://nx.dev/reference/nx-json#target-defaults
380
+ */
385
381
  __init7() {this.targetDefaults = {
386
382
  "lint-ls": {
387
- outputs: [
388
- "{projectRoot}/**/*"
389
- ],
390
- inputs: [
391
- "linting",
392
- "default",
393
- "^production"
394
- ],
395
- dependsOn: [
396
- "^lint-ls"
397
- ],
383
+ outputs: ["{projectRoot}/**/*"],
384
+ inputs: ["linting", "default", "^production"],
385
+ dependsOn: ["^lint-ls"],
398
386
  executor: "nx:run-commands",
399
387
  options: {
400
388
  command: 'pnpm exec ls-lint --config="./node_modules/@storm-software/linting-tools/ls-lint/.ls-lint.yml" ',
@@ -402,61 +390,33 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
402
390
  }
403
391
  },
404
392
  "lint-sherif": {
405
- outputs: [
406
- "{projectRoot}/package.json"
407
- ],
408
- inputs: [
409
- "{workspaceRoot}/package.json",
410
- "{projectRoot}/package.json"
411
- ],
393
+ outputs: ["{projectRoot}/package.json"],
394
+ inputs: ["{workspaceRoot}/package.json", "{projectRoot}/package.json"],
412
395
  executor: "nx:run-commands",
413
396
  options: {
414
397
  command: "pnpm exec sherif -i react -i react-dom -i typescript"
415
398
  }
416
399
  },
417
400
  "lint-knip": {
418
- inputs: [
419
- "linting",
420
- "default",
421
- "^production"
422
- ],
401
+ inputs: ["linting", "default", "^production"],
423
402
  executor: "nx:run-commands",
424
403
  options: {
425
404
  command: "pnpm exec knip"
426
405
  }
427
406
  },
428
407
  lint: {
429
- outputs: [
430
- "{projectRoot}"
431
- ],
432
- inputs: [
433
- "linting",
434
- "default",
435
- "^production"
436
- ],
437
- dependsOn: [
438
- "lint-ls",
439
- "lint-sherif",
440
- "lint-knip",
441
- "lint-docs",
442
- "^lint"
443
- ],
408
+ outputs: ["{projectRoot}"],
409
+ inputs: ["linting", "default", "^production"],
410
+ dependsOn: ["lint-ls", "lint-sherif", "lint-knip", "lint-docs", "^lint"],
444
411
  executor: "nx:run-commands",
445
412
  options: {
446
413
  command: 'echo Linted the project files in "{projectRoot}" '
447
414
  }
448
415
  },
449
416
  "format-toml": {
450
- inputs: [
451
- "linting",
452
- "{projectRoot}/**/*.toml"
453
- ],
454
- outputs: [
455
- "{projectRoot}/**/*.toml"
456
- ],
457
- dependsOn: [
458
- "^format-toml"
459
- ],
417
+ inputs: ["linting", "{projectRoot}/**/*.toml"],
418
+ outputs: ["{projectRoot}/**/*.toml"],
419
+ dependsOn: ["^format-toml"],
460
420
  executor: "nx:run-commands",
461
421
  options: {
462
422
  command: 'pnpm exec taplo format --colors="always" --config="./node_modules/@storm-software/linting-tools/taplo/config.toml" --cache-path="./tmp/taplo/{projectRoot}"',
@@ -471,12 +431,8 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
471
431
  "default",
472
432
  "^production"
473
433
  ],
474
- outputs: [
475
- "{projectRoot}/README.md"
476
- ],
477
- dependsOn: [
478
- "^format-readme"
479
- ],
434
+ outputs: ["{projectRoot}/README.md"],
435
+ dependsOn: ["^format-readme"],
480
436
  executor: "nx:run-commands",
481
437
  options: {
482
438
  command: 'pnpm exec storm-git readme-gen --templates="./tools/readme-templates" --project="{projectName}"',
@@ -484,14 +440,8 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
484
440
  }
485
441
  },
486
442
  "format-prettier": {
487
- inputs: [
488
- "linting",
489
- "default",
490
- "^production"
491
- ],
492
- dependsOn: [
493
- "^format-prettier"
494
- ],
443
+ inputs: ["linting", "default", "^production"],
444
+ dependsOn: ["^format-prettier"],
495
445
  executor: "nx:run-commands",
496
446
  options: {
497
447
  command: 'pnpm exec prettier "{projectRoot}/**/*" --write --ignore-unknown --no-error-on-unmatched-pattern --config="./node_modules/@storm-software/prettier/config.json" --ignore-path="./node_modules/@storm-software/prettier/.prettierignore" --cache --cache-location="./tmp/prettier/{projectRoot}" ',
@@ -499,34 +449,18 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
499
449
  }
500
450
  },
501
451
  format: {
502
- inputs: [
503
- "linting",
504
- "default",
505
- "^production"
506
- ],
507
- outputs: [
508
- "{projectRoot}"
509
- ],
510
- dependsOn: [
511
- "format-toml",
512
- "format-readme",
513
- "format-prettier",
514
- "^format"
515
- ],
452
+ inputs: ["linting", "default", "^production"],
453
+ outputs: ["{projectRoot}"],
454
+ dependsOn: ["format-toml", "format-readme", "format-prettier", "^format"],
516
455
  executor: "nx:run-commands",
517
456
  options: {
518
457
  command: 'echo Formatted the project files in "{projectRoot}" '
519
458
  }
520
459
  },
521
460
  clean: {
522
- inputs: [
523
- "default",
524
- "^production"
525
- ],
461
+ inputs: ["default", "^production"],
526
462
  outputs: NX_DEFAULT_BUILD_OUTPUTS,
527
- dependsOn: [
528
- "^clean"
529
- ],
463
+ dependsOn: ["^clean"],
530
464
  executor: "nx:run-commands",
531
465
  options: {
532
466
  commands: [
@@ -536,49 +470,24 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
536
470
  }
537
471
  },
538
472
  "build-untyped": {
539
- dependsOn: [
540
- "^build"
541
- ]
473
+ dependsOn: ["^build"]
542
474
  },
543
475
  "build-base": {
544
- dependsOn: [
545
- "build-untyped",
546
- "^build"
547
- ]
476
+ dependsOn: ["build-untyped", "^build"]
548
477
  },
549
478
  "build-local": {
550
- inputs: [
551
- "default",
552
- "^production"
553
- ],
554
- dependsOn: [
555
- "build-base",
556
- "build-untyped",
557
- "^build"
558
- ]
479
+ inputs: ["default", "^production"],
480
+ dependsOn: ["build-base", "build-untyped", "^build"]
559
481
  },
560
482
  build: {
561
- inputs: [
562
- "default",
563
- "^production"
564
- ],
483
+ inputs: ["default", "^production"],
565
484
  outputs: NX_DEFAULT_BUILD_OUTPUTS,
566
- dependsOn: [
567
- "build-base",
568
- "build-untyped",
569
- "^build"
570
- ]
485
+ dependsOn: ["build-base", "build-untyped", "^build"]
571
486
  },
572
487
  rebuild: {
573
- inputs: [
574
- "default",
575
- "^production"
576
- ],
488
+ inputs: ["default", "^production"],
577
489
  executor: "nx:run-commands",
578
- dependsOn: [
579
- "clean",
580
- "^build"
581
- ],
490
+ dependsOn: ["clean", "^build"],
582
491
  options: {
583
492
  command: "pnpm exec nx run {projectName}:build",
584
493
  color: true,
@@ -586,92 +495,63 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
586
495
  }
587
496
  },
588
497
  docs: {
589
- outputs: [
590
- "{options.outputPath}"
591
- ],
592
- inputs: [
593
- "linting",
594
- "documentation",
595
- "default",
596
- "^production"
597
- ],
598
- dependsOn: [
599
- "build",
600
- "format-readme",
601
- "lint-docs",
602
- "^docs"
603
- ]
498
+ outputs: ["{options.outputPath}"],
499
+ inputs: ["linting", "documentation", "default", "^production"],
500
+ dependsOn: ["build", "format-readme", "lint-docs", "^docs"]
604
501
  },
605
502
  test: {
606
- inputs: [
607
- "testing",
608
- "default",
609
- "^production"
610
- ],
611
- dependsOn: [
612
- "build",
613
- "^test"
614
- ]
503
+ inputs: ["testing", "default", "^production"],
504
+ dependsOn: ["build", "^test"]
615
505
  },
616
506
  e2e: {
617
- inputs: [
618
- "testing",
619
- "default",
620
- "^production"
621
- ],
622
- dependsOn: [
623
- "test",
624
- "^e2e"
625
- ]
507
+ inputs: ["testing", "default", "^production"],
508
+ dependsOn: ["test", "^e2e"]
626
509
  },
627
510
  "nx-release-publish": {
628
- inputs: [
629
- "default",
630
- "^production"
631
- ],
632
- dependsOn: [
633
- "build",
634
- "^nx-release-publish"
635
- ]
511
+ inputs: ["default", "^production"],
512
+ dependsOn: ["build", "^nx-release-publish"]
636
513
  }
637
514
  }}
638
515
  /**
639
- * Configuration for Nx releases
640
- */
516
+ * Configuration for Nx releases
517
+ */
641
518
  __init8() {this.release = {}}
642
519
  /**
643
- * The number of parallel tasks to run.
644
- *
645
- * @defaultValue 5
646
- */
520
+ * The number of parallel tasks to run.
521
+ *
522
+ * @defaultValue 5
523
+ */
647
524
  __init9() {this.parallel = 5}
648
525
  /**
649
- * Should the daemon be used to run tasks?
650
- *
651
- * @defaultValue true
652
- */
526
+ * Should the daemon be used to run tasks?
527
+ *
528
+ * @defaultValue true
529
+ */
653
530
  __init10() {this.useDaemonProcess = true}
654
531
  /**
655
- * Set this to false to disable adding inference plugins when generating new projects
656
- *
657
- * @defaultValue true
658
- */
532
+ * Set this to false to disable adding inference plugins when generating new projects
533
+ *
534
+ * @defaultValue true
535
+ */
659
536
  __init11() {this.useInferencePlugins = true}
660
537
  /**
661
- * The default base branch for new projects.
662
- *
663
- * @defaultValue "main"
664
- */
538
+ * The default base branch for new projects.
539
+ *
540
+ * @defaultValue "main"
541
+ */
665
542
  __init12() {this.defaultBase = "main"}
666
543
  /**
667
- * The CLI configuration for the workspace.
668
- */
544
+ * The CLI configuration for the workspace.
545
+ */
669
546
 
670
547
  constructor(project) {
671
548
  super(project);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);_class.prototype.__init11.call(this);_class.prototype.__init12.call(this);;
672
549
  let StormWorkspaceConfig;
673
550
  if (project.root.outdir) {
674
- const StormWorkspaceConfigJson = _fs.readFileSync.call(void 0, _chunkPHMFOUDCjs.joinPaths.call(void 0, project.root.outdir, "storm-workspace.json"), "utf8");
551
+ const StormWorkspaceConfigJson = _fs.readFileSync.call(void 0,
552
+ _chunkNNSWWAGPjs.joinPaths.call(void 0, project.root.outdir, "storm-workspace.json"),
553
+ "utf8"
554
+ );
675
555
  StormWorkspaceConfig = JSON.parse(StormWorkspaceConfigJson);
676
556
  }
677
557
  if (_optionalChain([StormWorkspaceConfig, 'optionalAccess', _ => _.namespace])) {
@@ -690,30 +570,30 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
690
570
  }
691
571
  this.nxJson = new (0, _projen.JsonFile)(project, "nx.json", {
692
572
  obj: {
693
- extends: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => this.extends, "extends"),
694
- npmScope: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => this.npmScope, "npmScope"),
695
- affected: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.affected), "affected"),
696
- workspaceLayout: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.workspaceLayout), "workspaceLayout"),
697
- plugins: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.nxPlugins), "plugins"),
698
- namedInputs: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.namedInputs), "namedInputs"),
699
- targetDefaults: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.targetDefaults), "targetDefaults"),
700
- tasksRunnerOptions: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.tasksRunnerOptions), "tasksRunnerOptions"),
701
- parallel: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => this.parallel, "parallel"),
702
- useDaemonProcess: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => this.useDaemonProcess, "useDaemonProcess"),
703
- useInferencePlugins: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => this.useInferencePlugins, "useInferencePlugins"),
704
- release: /* @__PURE__ */ _chunkLTKRUM5Pjs.__name.call(void 0, () => _common.asUndefinedIfEmpty.call(void 0, this.release), "release")
573
+ extends: () => this.extends,
574
+ npmScope: () => this.npmScope,
575
+ affected: () => _common.asUndefinedIfEmpty.call(void 0, this.affected),
576
+ workspaceLayout: () => _common.asUndefinedIfEmpty.call(void 0, this.workspaceLayout),
577
+ plugins: () => _common.asUndefinedIfEmpty.call(void 0, this.nxPlugins),
578
+ namedInputs: () => _common.asUndefinedIfEmpty.call(void 0, this.namedInputs),
579
+ targetDefaults: () => _common.asUndefinedIfEmpty.call(void 0, this.targetDefaults),
580
+ tasksRunnerOptions: () => _common.asUndefinedIfEmpty.call(void 0, this.tasksRunnerOptions),
581
+ parallel: () => this.parallel,
582
+ useDaemonProcess: () => this.useDaemonProcess,
583
+ useInferencePlugins: () => this.useInferencePlugins,
584
+ release: () => _common.asUndefinedIfEmpty.call(void 0, this.release)
705
585
  }
706
586
  });
707
587
  }
708
588
  /**
709
- * Adds a release group to the workspace.
710
- *
711
- * @param name The name of the release group
712
- * @param projects The projects in the release group
713
- * @param projectsRelationship The relationship between the projects
714
- * @param releaseTagPattern The release tag pattern
715
- * @param groupPreVersionCommand The command to run before versioning
716
- */
589
+ * Adds a release group to the workspace.
590
+ *
591
+ * @param name The name of the release group
592
+ * @param projects The projects in the release group
593
+ * @param projectsRelationship The relationship between the projects
594
+ * @param releaseTagPattern The release tag pattern
595
+ * @param groupPreVersionCommand The command to run before versioning
596
+ */
717
597
  addReleaseGroup(name, projects, projectsRelationship = "independent", releaseTagPattern = "{projectName}@{version}", groupPreVersionCommand = "pnpm build") {
718
598
  this.release ??= {
719
599
  groups: {},