@storm-software/workspace-tools 1.240.4 → 1.242.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.
Files changed (131) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-EFPBJWHS.js → chunk-2OI6IGCD.js} +3 -3
  4. package/dist/chunk-7O34DHUG.js +127 -0
  5. package/dist/chunk-7TLYMNLD.mjs +127 -0
  6. package/dist/{chunk-U4K5KWKS.mjs → chunk-AZGF6LFT.mjs} +1 -1
  7. package/dist/{chunk-5AQJQ72E.mjs → chunk-C2REXPET.mjs} +54 -49
  8. package/dist/{chunk-3SP4ZXOA.mjs → chunk-DR65MBFB.mjs} +1 -1
  9. package/dist/{chunk-RTFFYOEY.js → chunk-P4NR5KOJ.js} +3 -3
  10. package/dist/{chunk-JOJ3CZQC.js → chunk-PVAQKHBQ.js} +3 -3
  11. package/dist/{chunk-XHH2IY66.js → chunk-RAVLTWJV.js} +54 -49
  12. package/dist/{chunk-LNDWWYO3.mjs → chunk-Y4FVIDJI.mjs} +1 -1
  13. package/dist/{executor-CIGyZdrv.d.ts → executor-B1mTS_M5.d.ts} +1 -1
  14. package/dist/{executor-C_QU1lUw.d.mts → executor-B2I8lRie.d.mts} +1 -1
  15. package/dist/{executor-Bk4ug-RW.d.mts → executor-B3LJ1461.d.mts} +1 -1
  16. package/dist/{executor-D2o23AZj.d.mts → executor-CnnrgXKr.d.mts} +1 -1
  17. package/dist/{executor-BHwhDrL-.d.ts → executor-Ct74DTAr.d.ts} +1 -1
  18. package/dist/{executor-ozBp5rj1.d.mts → executor-D5C-erVR.d.mts} +1 -1
  19. package/dist/{executor-DOFe9F7c.d.ts → executor-DZ-0sX_w.d.ts} +1 -1
  20. package/dist/{executor-DL3jAzFW.d.mts → executor-De29T5QB.d.mts} +1 -1
  21. package/dist/{executor-BW_5lER2.d.ts → executor-Dfot53CG.d.ts} +1 -1
  22. package/dist/{executor-hDJ0Fk_g.d.ts → executor-SU5oGftF.d.ts} +1 -1
  23. package/dist/executors.d.mts +6 -6
  24. package/dist/executors.d.ts +6 -6
  25. package/dist/generator-AFivysTp.d.ts +130 -0
  26. package/dist/generator-BAbOohf7.d.mts +130 -0
  27. package/dist/{generator-CiNaIUED.d.ts → generator-BCkqWM1d.d.ts} +1 -1
  28. package/dist/generator-B_HN13az.d.mts +130 -0
  29. package/dist/{generator-BNM0qnMp.d.mts → generator-CRiDjsPp.d.mts} +1 -1
  30. package/dist/generator-CrR9QK6B.d.mts +130 -0
  31. package/dist/{generator-c8PBxLhH.d.mts → generator-DATsTV1E.d.mts} +2 -2
  32. package/dist/{generator-QTX2Ix9P.d.ts → generator-DBa9-HbU.d.ts} +1 -1
  33. package/dist/generator-DNdirMec.d.ts +130 -0
  34. package/dist/{generator-BPXY7sqO.d.mts → generator-DpXgF55u.d.mts} +1 -1
  35. package/dist/generator-F6EuzmJD.d.ts +130 -0
  36. package/dist/{generator-ymaJQAJP.d.ts → generator-rf62OraH.d.ts} +2 -2
  37. package/dist/generators.d.mts +8 -8
  38. package/dist/generators.d.ts +8 -8
  39. package/dist/generators.js +6 -6
  40. package/dist/generators.mjs +7 -7
  41. package/dist/index.d.mts +14 -14
  42. package/dist/index.d.ts +14 -14
  43. package/dist/index.js +7 -7
  44. package/dist/index.mjs +8 -8
  45. package/dist/src/base/base-executor.d.mts +2 -2
  46. package/dist/src/base/base-executor.d.ts +2 -2
  47. package/dist/src/base/base-generator.d.mts +2 -2
  48. package/dist/src/base/base-generator.d.ts +2 -2
  49. package/dist/src/base/index.d.mts +24 -208
  50. package/dist/src/base/index.d.ts +24 -208
  51. package/dist/src/base/index.js +3 -3
  52. package/dist/src/base/index.mjs +2 -2
  53. package/dist/src/base/typescript-library-generator.schema.d.ts +8 -200
  54. package/dist/src/base/typescript-library-generator.schema.json +18 -162
  55. package/dist/src/base/typescript-library-generator.schema.md +9 -177
  56. package/dist/src/base/typescript-library-generator.untyped.js +2 -2
  57. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  58. package/dist/src/executors/clean-package/executor.d.mts +1 -1
  59. package/dist/src/executors/clean-package/executor.d.ts +1 -1
  60. package/dist/src/executors/esbuild/executor.d.mts +2 -2
  61. package/dist/src/executors/esbuild/executor.d.ts +2 -2
  62. package/dist/src/executors/size-limit/executor.d.mts +2 -2
  63. package/dist/src/executors/size-limit/executor.d.ts +2 -2
  64. package/dist/src/executors/tsdown/executor.d.mts +2 -2
  65. package/dist/src/executors/tsdown/executor.d.ts +2 -2
  66. package/dist/src/executors/typia/executor.d.mts +2 -2
  67. package/dist/src/executors/typia/executor.d.ts +2 -2
  68. package/dist/src/executors/unbuild/executor.d.mts +2 -2
  69. package/dist/src/executors/unbuild/executor.d.ts +2 -2
  70. package/dist/src/generators/browser-library/generator.d.mts +3 -3
  71. package/dist/src/generators/browser-library/generator.d.ts +3 -3
  72. package/dist/src/generators/browser-library/generator.js +3 -3
  73. package/dist/src/generators/browser-library/generator.mjs +2 -2
  74. package/dist/src/generators/browser-library/schema.d.ts +7 -199
  75. package/dist/src/generators/browser-library/schema.json +17 -162
  76. package/dist/src/generators/browser-library/schema.md +9 -177
  77. package/dist/src/generators/browser-library/untyped.js +2 -2
  78. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  79. package/dist/src/generators/config-schema/generator.d.mts +3 -3
  80. package/dist/src/generators/config-schema/generator.d.ts +3 -3
  81. package/dist/src/generators/neutral-library/generator.d.mts +3 -3
  82. package/dist/src/generators/neutral-library/generator.d.ts +3 -3
  83. package/dist/src/generators/neutral-library/generator.js +3 -3
  84. package/dist/src/generators/neutral-library/generator.mjs +2 -2
  85. package/dist/src/generators/neutral-library/schema.d.ts +7 -199
  86. package/dist/src/generators/neutral-library/schema.json +17 -162
  87. package/dist/src/generators/neutral-library/schema.md +9 -177
  88. package/dist/src/generators/neutral-library/untyped.js +2 -2
  89. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  90. package/dist/src/generators/node-library/generator.d.mts +3 -3
  91. package/dist/src/generators/node-library/generator.d.ts +3 -3
  92. package/dist/src/generators/node-library/generator.js +3 -3
  93. package/dist/src/generators/node-library/generator.mjs +2 -2
  94. package/dist/src/generators/node-library/schema.d.ts +7 -199
  95. package/dist/src/generators/node-library/schema.json +17 -162
  96. package/dist/src/generators/node-library/schema.md +9 -177
  97. package/dist/src/generators/node-library/untyped.js +2 -2
  98. package/dist/src/generators/node-library/untyped.mjs +1 -1
  99. package/dist/src/generators/preset/generator.d.mts +3 -3
  100. package/dist/src/generators/preset/generator.d.ts +3 -3
  101. package/dist/src/generators/release-version/generator.d.mts +2 -2
  102. package/dist/src/generators/release-version/generator.d.ts +2 -2
  103. package/dist/src/plugins/typescript/tsdown.js +11 -4
  104. package/dist/src/plugins/typescript/tsdown.mjs +11 -4
  105. package/dist/src/plugins/typescript/tsup.js +11 -3
  106. package/dist/src/plugins/typescript/tsup.mjs +11 -3
  107. package/dist/src/types.d.mts +2 -2
  108. package/dist/src/types.d.ts +2 -2
  109. package/dist/src/utils/apply-workspace-tokens.d.mts +1 -1
  110. package/dist/src/utils/apply-workspace-tokens.d.ts +1 -1
  111. package/dist/src/utils/index.d.mts +2 -2
  112. package/dist/src/utils/index.d.ts +2 -2
  113. package/dist/src/utils/project-tags.d.mts +2 -2
  114. package/dist/src/utils/project-tags.d.ts +2 -2
  115. package/dist/{types-CYi2oThM.d.mts → types-44XkV3HO.d.mts} +1 -1
  116. package/dist/{types-zrlItIRw.d.mts → types-B5IG4iSJ.d.mts} +2 -2
  117. package/dist/{types-zrlItIRw.d.ts → types-B5IG4iSJ.d.ts} +2 -2
  118. package/dist/{types-Bd83s-qg.d.ts → types-DpaECebR.d.ts} +1 -1
  119. package/docs/api/base/typescript-library-generator.schema.md +9 -177
  120. package/docs/api/generators/browser-library/schema.md +9 -177
  121. package/docs/api/generators/neutral-library/schema.md +9 -177
  122. package/docs/api/generators/node-library/schema.md +9 -177
  123. package/package.json +1 -1
  124. package/dist/chunk-RPECQQG4.mjs +0 -288
  125. package/dist/chunk-ZFIZ5Q46.js +0 -288
  126. package/dist/generator-BS6uKMIL.d.mts +0 -322
  127. package/dist/generator-BsxAYGR_.d.mts +0 -322
  128. package/dist/generator-CFxhJoNw.d.ts +0 -322
  129. package/dist/generator-CiDljAEY.d.ts +0 -322
  130. package/dist/generator-DDW7kns9.d.ts +0 -322
  131. package/dist/generator-DatrLGpK.d.mts +0 -322
package/CHANGELOG.md CHANGED
@@ -1,3 +1,20 @@
1
+ ## 1.242.0 (2025-01-23)
2
+
3
+ ### Features
4
+
5
+ - **workspace-tools:** Improved caching in the `tsup` and `tsdown` plugins ([84e80cf2](https://github.com/storm-software/storm-ops/commit/84e80cf2))
6
+ - **config:** Update package to use modern tooling ([8ac7afa3](https://github.com/storm-software/storm-ops/commit/8ac7afa3))
7
+
8
+ ## 1.241.0 (2025-01-23)
9
+
10
+ ### Features
11
+
12
+ - **workspace-tools:** Enhanced the plugin `platform` detection logic ([c87c73ad](https://github.com/storm-software/storm-ops/commit/c87c73ad))
13
+
14
+ ### Miscellaneous
15
+
16
+ - **monorepo:** Regenerate README markdown files ([eb629846](https://github.com/storm-software/storm-ops/commit/eb629846))
17
+
1
18
  ## 1.240.4 (2025-01-23)
2
19
 
3
20
  ### Bug Fixes
package/README.md CHANGED
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
21
21
 
22
22
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
23
23
 
24
- [![Version](https://img.shields.io/badge/version-1.240.3-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
24
+ [![Version](https://img.shields.io/badge/version-1.241.0-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://prettier.io/)&nbsp;[![Nx](https://img.shields.io/badge/Nx-17.0.2-lightgrey?style=for-the-badge&logo=nx&logoWidth=20&&color=1fb2a6)](http://nx.dev/)&nbsp;[![NextJs](https://img.shields.io/badge/Next.js-14.0.2-lightgrey?style=for-the-badge&logo=nextdotjs&logoWidth=20&color=1fb2a6)](https://nextjs.org/)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;[![documented with Fumadocs](https://img.shields.io/badge/documented_with-fumadocs-success.svg?style=for-the-badge&logo=readthedocs&color=1fb2a6)](https://fumadocs.vercel.app/)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/storm-ops/cr.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
25
25
 
26
26
  <!-- prettier-ignore-start -->
27
27
  <!-- markdownlint-disable -->
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkXHH2IY66js = require('./chunk-XHH2IY66.js');
4
+ var _chunkRAVLTWJVjs = require('./chunk-RAVLTWJV.js');
5
5
 
6
6
 
7
7
  var _chunkHI4G4OOGjs = require('./chunk-HI4G4OOG.js');
@@ -26,7 +26,7 @@ async function nodeLibraryGeneratorFn(tree, schema, config) {
26
26
  directory: schema.directory,
27
27
  description: schema.description
28
28
  };
29
- const options = await _chunkXHH2IY66js.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
29
+ const options = await _chunkRAVLTWJVjs.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
30
30
  const { className, name, propertyName } = _devkit.names.call(void 0, options.name);
31
31
  _devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
32
32
  ...schema,
@@ -44,7 +44,7 @@ async function nodeLibraryGeneratorFn(tree, schema, config) {
44
44
  buildable: options.bundler && options.bundler !== "none",
45
45
  hasUnitTestRunner: options.unitTestRunner !== "none"
46
46
  });
47
- await _chunkXHH2IY66js.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
47
+ await _chunkRAVLTWJVjs.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
48
48
  await _devkit.formatFiles.call(void 0, tree);
49
49
  return null;
50
50
  }
@@ -0,0 +1,127 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunk7CJRMBX3js = require('./chunk-7CJRMBX3.js');
4
+
5
+ // src/base/typescript-library-generator.untyped.ts
6
+ var _untyped = require('untyped');
7
+ var typescript_library_generator_untyped_default = _untyped.defineUntypedSchema.call(void 0, {
8
+ ..._chunk7CJRMBX3js.base_generator_untyped_default,
9
+ $schema: {
10
+ id: "TypeScriptLibraryGeneratorSchema",
11
+ title: "TypeScript Library Generator",
12
+ description: "A type definition for the base TypeScript Library Generator schema",
13
+ required: [
14
+ "directory",
15
+ "name"
16
+ ]
17
+ },
18
+ name: {
19
+ $schema: {
20
+ title: "Name",
21
+ type: "string",
22
+ description: "The name of the library"
23
+ }
24
+ },
25
+ description: {
26
+ $schema: {
27
+ title: "Description",
28
+ type: "string",
29
+ description: "The description of the library"
30
+ }
31
+ },
32
+ buildExecutor: {
33
+ $schema: {
34
+ title: "Build Executor",
35
+ type: "string",
36
+ description: "The executor to use for building the library"
37
+ },
38
+ $default: "@storm-software/workspace-tools:unbuild"
39
+ },
40
+ platform: {
41
+ $schema: {
42
+ title: "Platform",
43
+ type: "string",
44
+ description: "The platform to target with the library",
45
+ enum: [
46
+ "neutral",
47
+ "node",
48
+ "worker",
49
+ "browser"
50
+ ]
51
+ },
52
+ $default: "neutral"
53
+ },
54
+ importPath: {
55
+ $schema: {
56
+ title: "Import Path",
57
+ type: "string",
58
+ description: "The import path for the library"
59
+ }
60
+ },
61
+ tags: {
62
+ $schema: {
63
+ title: "Tags",
64
+ type: "string",
65
+ description: "The tags for the library"
66
+ }
67
+ },
68
+ unitTestRunner: {
69
+ $schema: {
70
+ title: "Unit Test Runner",
71
+ type: "string",
72
+ enum: [
73
+ "jest",
74
+ "vitest",
75
+ "none"
76
+ ],
77
+ description: "The unit test runner to use"
78
+ }
79
+ },
80
+ testEnvironment: {
81
+ $schema: {
82
+ title: "Test Environment",
83
+ type: "string",
84
+ enum: [
85
+ "jsdom",
86
+ "node"
87
+ ],
88
+ description: "The test environment to use"
89
+ }
90
+ },
91
+ pascalCaseFiles: {
92
+ $schema: {
93
+ title: "Pascal Case Files",
94
+ type: "boolean",
95
+ description: "Use PascalCase for file names"
96
+ },
97
+ $default: false
98
+ },
99
+ strict: {
100
+ $schema: {
101
+ title: "Strict",
102
+ type: "boolean",
103
+ description: "Enable strict mode"
104
+ },
105
+ $default: true
106
+ },
107
+ publishable: {
108
+ $schema: {
109
+ title: "Publishable",
110
+ type: "boolean",
111
+ description: "Make the library publishable"
112
+ },
113
+ $default: false
114
+ },
115
+ buildable: {
116
+ $schema: {
117
+ title: "Buildable",
118
+ type: "boolean",
119
+ description: "Make the library buildable"
120
+ },
121
+ $default: true
122
+ }
123
+ });
124
+
125
+
126
+
127
+ exports.typescript_library_generator_untyped_default = typescript_library_generator_untyped_default;
@@ -0,0 +1,127 @@
1
+ import {
2
+ base_generator_untyped_default
3
+ } from "./chunk-34LSWMWV.mjs";
4
+
5
+ // src/base/typescript-library-generator.untyped.ts
6
+ import { defineUntypedSchema } from "untyped";
7
+ var typescript_library_generator_untyped_default = defineUntypedSchema({
8
+ ...base_generator_untyped_default,
9
+ $schema: {
10
+ id: "TypeScriptLibraryGeneratorSchema",
11
+ title: "TypeScript Library Generator",
12
+ description: "A type definition for the base TypeScript Library Generator schema",
13
+ required: [
14
+ "directory",
15
+ "name"
16
+ ]
17
+ },
18
+ name: {
19
+ $schema: {
20
+ title: "Name",
21
+ type: "string",
22
+ description: "The name of the library"
23
+ }
24
+ },
25
+ description: {
26
+ $schema: {
27
+ title: "Description",
28
+ type: "string",
29
+ description: "The description of the library"
30
+ }
31
+ },
32
+ buildExecutor: {
33
+ $schema: {
34
+ title: "Build Executor",
35
+ type: "string",
36
+ description: "The executor to use for building the library"
37
+ },
38
+ $default: "@storm-software/workspace-tools:unbuild"
39
+ },
40
+ platform: {
41
+ $schema: {
42
+ title: "Platform",
43
+ type: "string",
44
+ description: "The platform to target with the library",
45
+ enum: [
46
+ "neutral",
47
+ "node",
48
+ "worker",
49
+ "browser"
50
+ ]
51
+ },
52
+ $default: "neutral"
53
+ },
54
+ importPath: {
55
+ $schema: {
56
+ title: "Import Path",
57
+ type: "string",
58
+ description: "The import path for the library"
59
+ }
60
+ },
61
+ tags: {
62
+ $schema: {
63
+ title: "Tags",
64
+ type: "string",
65
+ description: "The tags for the library"
66
+ }
67
+ },
68
+ unitTestRunner: {
69
+ $schema: {
70
+ title: "Unit Test Runner",
71
+ type: "string",
72
+ enum: [
73
+ "jest",
74
+ "vitest",
75
+ "none"
76
+ ],
77
+ description: "The unit test runner to use"
78
+ }
79
+ },
80
+ testEnvironment: {
81
+ $schema: {
82
+ title: "Test Environment",
83
+ type: "string",
84
+ enum: [
85
+ "jsdom",
86
+ "node"
87
+ ],
88
+ description: "The test environment to use"
89
+ }
90
+ },
91
+ pascalCaseFiles: {
92
+ $schema: {
93
+ title: "Pascal Case Files",
94
+ type: "boolean",
95
+ description: "Use PascalCase for file names"
96
+ },
97
+ $default: false
98
+ },
99
+ strict: {
100
+ $schema: {
101
+ title: "Strict",
102
+ type: "boolean",
103
+ description: "Enable strict mode"
104
+ },
105
+ $default: true
106
+ },
107
+ publishable: {
108
+ $schema: {
109
+ title: "Publishable",
110
+ type: "boolean",
111
+ description: "Make the library publishable"
112
+ },
113
+ $default: false
114
+ },
115
+ buildable: {
116
+ $schema: {
117
+ title: "Buildable",
118
+ type: "boolean",
119
+ description: "Make the library buildable"
120
+ },
121
+ $default: true
122
+ }
123
+ });
124
+
125
+ export {
126
+ typescript_library_generator_untyped_default
127
+ };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeOptions,
3
3
  typeScriptLibraryGeneratorFn
4
- } from "./chunk-5AQJQ72E.mjs";
4
+ } from "./chunk-C2REXPET.mjs";
5
5
  import {
6
6
  typesNodeVersion
7
7
  } from "./chunk-EK75QNMS.mjs";
@@ -18,48 +18,48 @@ import { determineProjectNameAndRootOptions } from "@nx/devkit/src/generators/pr
18
18
  import { addTsConfigPath, getRelativePathToRootTsConfig, tsConfigBaseOptions } from "@nx/js";
19
19
  import jsInitGenerator from "@nx/js/src/generators/init/init";
20
20
  import setupVerdaccio from "@nx/js/src/generators/setup-verdaccio/generator";
21
- async function typeScriptLibraryGeneratorFn(tree, schema, config) {
22
- const options = await normalizeOptions(tree, {
23
- ...schema
21
+ async function typeScriptLibraryGeneratorFn(tree, options, config) {
22
+ const normalized = await normalizeOptions(tree, {
23
+ ...options
24
24
  });
25
25
  const tasks = [];
26
26
  tasks.push(await jsInitGenerator(tree, {
27
- ...options,
28
- tsConfigName: options.rootProject ? "tsconfig.json" : "tsconfig.base.json"
27
+ ...normalized,
28
+ tsConfigName: normalized.rootProject ? "tsconfig.json" : "tsconfig.base.json"
29
29
  }));
30
30
  tasks.push(addDependenciesToPackageJson(tree, {}, {
31
31
  "@storm-software/workspace-tools": "latest",
32
32
  "@storm-software/testing-tools": "latest",
33
- ...schema.devDependencies ?? {}
33
+ ...options.devDependencies ?? {}
34
34
  }));
35
- if (options.publishable) {
35
+ if (normalized.publishable) {
36
36
  tasks.push(await setupVerdaccio(tree, {
37
- ...options,
37
+ ...normalized,
38
38
  skipFormat: true
39
39
  }));
40
40
  }
41
41
  const projectConfig = {
42
- root: options.directory,
42
+ root: normalized.directory,
43
43
  projectType: "library",
44
- sourceRoot: joinPaths(options.directory ?? "", "src"),
44
+ sourceRoot: joinPaths(normalized.directory ?? "", "src"),
45
45
  targets: {
46
46
  build: {
47
- executor: schema.buildExecutor,
47
+ executor: options.buildExecutor,
48
48
  outputs: [
49
49
  "{options.outputPath}"
50
50
  ],
51
51
  options: {
52
52
  entry: [
53
- joinPaths(options.projectRoot, "src", "index.ts")
53
+ joinPaths(normalized.projectRoot, "src", "index.ts")
54
54
  ],
55
- outputPath: getOutputPath(options),
56
- tsconfig: joinPaths(options.projectRoot, "tsconfig.json"),
57
- project: joinPaths(options.projectRoot, "package.json"),
55
+ outputPath: getOutputPath(normalized),
56
+ tsconfig: joinPaths(normalized.projectRoot, "tsconfig.json"),
57
+ project: joinPaths(normalized.projectRoot, "package.json"),
58
58
  defaultConfiguration: "production",
59
59
  platform: "neutral",
60
60
  assets: [
61
61
  {
62
- input: options.projectRoot,
62
+ input: normalized.projectRoot,
63
63
  glob: "*.md",
64
64
  output: "/"
65
65
  },
@@ -83,19 +83,19 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
83
83
  }
84
84
  }
85
85
  };
86
- if (schema.platform) {
87
- projectConfig.targets.build.options.platform = schema.platform === "worker" ? "node" : schema.platform;
86
+ if (options.platform) {
87
+ projectConfig.targets.build.options.platform = options.platform === "worker" ? "node" : options.platform;
88
88
  }
89
- addProjectTag(projectConfig, ProjectTagConstants.Platform.TAG_ID, schema.platform === "node" ? ProjectTagConstants.Platform.NODE : schema.platform === "worker" ? ProjectTagConstants.Platform.WORKER : schema.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL, {
89
+ addProjectTag(projectConfig, ProjectTagConstants.Platform.TAG_ID, options.platform === "node" ? ProjectTagConstants.Platform.NODE : options.platform === "worker" ? ProjectTagConstants.Platform.WORKER : options.platform === "browser" ? ProjectTagConstants.Platform.BROWSER : ProjectTagConstants.Platform.NEUTRAL, {
90
90
  overwrite: false
91
91
  });
92
- createProjectTsConfigJson(tree, options);
93
- addProjectConfiguration(tree, options.name, projectConfig);
92
+ createProjectTsConfigJson(tree, normalized);
93
+ addProjectConfiguration(tree, normalized.name, projectConfig);
94
94
  let repository = {
95
95
  type: "github",
96
96
  url: config?.repository || `https://github.com/${config?.organization || "storm-software"}/${config?.namespace || config?.name || "repository"}.git`
97
97
  };
98
- let description = schema.description || "A package developed by Storm Software used to create modern, scalable web applications.";
98
+ let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
99
99
  if (tree.exists("package.json")) {
100
100
  const packageJson = readJson(tree, "package.json");
101
101
  if (packageJson?.repository) {
@@ -105,18 +105,18 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
105
105
  description = packageJson.description;
106
106
  }
107
107
  }
108
- if (!options.importPath) {
109
- options.importPath = options.name;
108
+ if (!normalized.importPath) {
109
+ normalized.importPath = normalized.name;
110
110
  }
111
- const packageJsonPath = joinPaths(options.projectRoot, "package.json");
111
+ const packageJsonPath = joinPaths(normalized.projectRoot, "package.json");
112
112
  if (tree.exists(packageJsonPath)) {
113
113
  updateJson(tree, packageJsonPath, (json) => {
114
- if (!options.importPath) {
115
- options.importPath = options.name;
114
+ if (!normalized.importPath) {
115
+ normalized.importPath = normalized.name;
116
116
  }
117
- json.name = options.importPath;
117
+ json.name = normalized.importPath;
118
118
  json.version = "0.0.1";
119
- if (json.private && (options.publishable || options.rootProject)) {
119
+ if (json.private && (normalized.publishable || normalized.rootProject)) {
120
120
  json.private = void 0;
121
121
  }
122
122
  return {
@@ -125,7 +125,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
125
125
  description,
126
126
  repository: {
127
127
  ...repository,
128
- directory: options.projectRoot
128
+ directory: normalized.projectRoot
129
129
  },
130
130
  type: "module",
131
131
  dependencies: {
@@ -138,37 +138,37 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
138
138
  });
139
139
  } else {
140
140
  writeJson(tree, packageJsonPath, {
141
- name: options.importPath,
141
+ name: normalized.importPath,
142
142
  version: "0.0.1",
143
143
  description,
144
144
  repository: {
145
145
  ...repository,
146
- directory: options.projectRoot
146
+ directory: normalized.projectRoot
147
147
  },
148
- private: !options.publishable || options.rootProject,
148
+ private: !normalized.publishable || normalized.rootProject,
149
149
  type: "module",
150
150
  publishConfig: {
151
151
  access: "public"
152
152
  }
153
153
  });
154
154
  }
155
- if (tree.exists("package.json") && options.importPath) {
155
+ if (tree.exists("package.json") && normalized.importPath) {
156
156
  updateJson(tree, "package.json", (json) => ({
157
157
  ...json,
158
158
  pnpm: {
159
159
  ...json?.pnpm,
160
160
  overrides: {
161
161
  ...json?.pnpm?.overrides,
162
- [options.importPath ?? ""]: "workspace:*"
162
+ [normalized.importPath ?? ""]: "workspace:*"
163
163
  }
164
164
  }
165
165
  }));
166
166
  }
167
- addTsConfigPath(tree, options.importPath, [
168
- joinPaths(options.projectRoot, "./src", `index.${options.js ? "js" : "ts"}`)
167
+ addTsConfigPath(tree, normalized.importPath, [
168
+ joinPaths(normalized.projectRoot, "./src", `index.${normalized.js ? "js" : "ts"}`)
169
169
  ]);
170
- addTsConfigPath(tree, joinPaths(options.importPath, "/*"), [
171
- joinPaths(options.projectRoot, "./src", "/*")
170
+ addTsConfigPath(tree, joinPaths(normalized.importPath, "/*"), [
171
+ joinPaths(normalized.projectRoot, "./src", "/*")
172
172
  ]);
173
173
  if (tree.exists("package.json")) {
174
174
  const packageJson = readJson(tree, "package.json");
@@ -179,7 +179,7 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
179
179
  description = packageJson.description;
180
180
  }
181
181
  }
182
- const tsconfigPath = joinPaths(options.projectRoot, "tsconfig.json");
182
+ const tsconfigPath = joinPaths(normalized.projectRoot, "tsconfig.json");
183
183
  if (tree.exists(tsconfigPath)) {
184
184
  updateJson(tree, tsconfigPath, (json) => {
185
185
  json.composite ??= true;
@@ -187,10 +187,10 @@ async function typeScriptLibraryGeneratorFn(tree, schema, config) {
187
187
  });
188
188
  } else {
189
189
  writeJson(tree, tsconfigPath, {
190
- extends: `${offsetFromRoot(options.projectRoot)}tsconfig.base.json`,
190
+ extends: `${offsetFromRoot(normalized.projectRoot)}tsconfig.base.json`,
191
191
  composite: true,
192
192
  compilerOptions: {
193
- outDir: `${offsetFromRoot(options.projectRoot)}dist/out-tsc`
193
+ outDir: `${offsetFromRoot(normalized.projectRoot)}dist/out-tsc`
194
194
  },
195
195
  files: [],
196
196
  include: [
@@ -249,9 +249,13 @@ function createProjectTsConfigJson(tree, options) {
249
249
  writeJson(tree, joinPaths(options.projectRoot, "tsconfig.json"), tsconfig);
250
250
  }
251
251
  __name(createProjectTsConfigJson, "createProjectTsConfigJson");
252
- async function normalizeOptions(tree, options) {
252
+ async function normalizeOptions(tree, options, config) {
253
+ let importPath = options.importPath;
254
+ if (!importPath && config?.namespace) {
255
+ importPath = `@${config?.namespace}/${options.name}`;
256
+ }
253
257
  if (options.publishable) {
254
- if (!options.importPath) {
258
+ if (!importPath) {
255
259
  throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
256
260
  }
257
261
  }
@@ -260,14 +264,14 @@ async function normalizeOptions(tree, options) {
260
264
  bundler = "none";
261
265
  }
262
266
  const { Linter } = ensurePackage("@nx/eslint", nxVersion);
263
- const { projectName, names: projectNames, projectRoot, importPath } = await determineProjectNameAndRootOptions(tree, {
267
+ const rootProject = false;
268
+ const { projectName, names: projectNames, projectRoot, importPath: normalizedImportPath } = await determineProjectNameAndRootOptions(tree, {
264
269
  name: options.name,
265
270
  projectType: "library",
266
271
  directory: options.directory,
267
- importPath: options.importPath,
268
- rootProject: options.rootProject
272
+ importPath,
273
+ rootProject
269
274
  });
270
- options.rootProject = projectRoot === ".";
271
275
  const normalized = names(projectNames.projectFileName);
272
276
  const fileName = normalized.fileName;
273
277
  return {
@@ -293,7 +297,8 @@ async function normalizeOptions(tree, options) {
293
297
  projectNames,
294
298
  projectRoot,
295
299
  parsedTags: options.tags ? options.tags.split(",").map((s) => s.trim()) : [],
296
- importPath
300
+ importPath: normalizedImportPath,
301
+ rootProject
297
302
  };
298
303
  }
299
304
  __name(normalizeOptions, "normalizeOptions");
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  normalizeOptions,
3
3
  typeScriptLibraryGeneratorFn
4
- } from "./chunk-5AQJQ72E.mjs";
4
+ } from "./chunk-C2REXPET.mjs";
5
5
  import {
6
6
  withRunGenerator
7
7
  } from "./chunk-SNFZL5BN.mjs";
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkXHH2IY66js = require('./chunk-XHH2IY66.js');
4
+ var _chunkRAVLTWJVjs = require('./chunk-RAVLTWJV.js');
5
5
 
6
6
 
7
7
  var _chunkKLHTXAIUjs = require('./chunk-KLHTXAIU.js');
@@ -19,7 +19,7 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
19
19
  devDependencies: {},
20
20
  buildExecutor: "@storm-software/workspace-tools:unbuild"
21
21
  };
22
- const options = await _chunkXHH2IY66js.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
22
+ const options = await _chunkRAVLTWJVjs.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
23
23
  const { className, name, propertyName } = _devkit.names.call(void 0, options.projectNames.projectFileName);
24
24
  _devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
25
25
  ...schema,
@@ -37,7 +37,7 @@ async function neutralLibraryGeneratorFn(tree, schema, config) {
37
37
  buildable: options.bundler && options.bundler !== "none",
38
38
  hasUnitTestRunner: options.unitTestRunner !== "none"
39
39
  });
40
- await _chunkXHH2IY66js.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
40
+ await _chunkRAVLTWJVjs.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
41
41
  await _devkit.formatFiles.call(void 0, tree);
42
42
  return null;
43
43
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
2
 
3
3
 
4
- var _chunkXHH2IY66js = require('./chunk-XHH2IY66.js');
4
+ var _chunkRAVLTWJVjs = require('./chunk-RAVLTWJV.js');
5
5
 
6
6
 
7
7
  var _chunkKLHTXAIUjs = require('./chunk-KLHTXAIU.js');
@@ -37,7 +37,7 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
37
37
  description: schema.description,
38
38
  directory: schema.directory
39
39
  };
40
- const options = await _chunkXHH2IY66js.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
40
+ const options = await _chunkRAVLTWJVjs.normalizeOptions.call(void 0, tree, tsLibraryGeneratorOptions);
41
41
  const { className, name, propertyName } = _devkit.names.call(void 0, options.projectNames.projectFileName);
42
42
  _devkit.generateFiles.call(void 0, tree, filesDir, options.projectRoot, {
43
43
  ...schema,
@@ -65,7 +65,7 @@ async function browserLibraryGeneratorFn(tree, schema, config) {
65
65
  }
66
66
  }
67
67
  });
68
- await _chunkXHH2IY66js.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
68
+ await _chunkRAVLTWJVjs.typeScriptLibraryGeneratorFn.call(void 0, tree, tsLibraryGeneratorOptions, config);
69
69
  await _devkit.formatFiles.call(void 0, tree);
70
70
  return null;
71
71
  }