@storm-software/workspace-tools 1.270.2 → 1.271.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 (287) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +1 -1
  3. package/dist/chunk-4QYM3VS4.mjs +282 -0
  4. package/dist/{chunk-ZP76EMBE.js → chunk-FYXWAGK3.js} +97 -27
  5. package/dist/chunk-MJMN2T4N.mjs +166 -0
  6. package/dist/chunk-RZVF4LHT.js +282 -0
  7. package/dist/executors.js +3 -3
  8. package/dist/executors.mjs +2 -2
  9. package/dist/index.d.mts +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +3 -3
  12. package/dist/index.mjs +4 -4
  13. package/dist/src/executors/npm-publish/executor.js +3 -3
  14. package/dist/src/executors/npm-publish/executor.mjs +2 -2
  15. package/dist/src/generators/preset/files/LICENSE +201 -0
  16. package/dist/src/utils/index.d.mts +1 -1
  17. package/dist/src/utils/index.d.ts +1 -1
  18. package/dist/src/utils/index.js +2 -2
  19. package/dist/src/utils/index.mjs +3 -3
  20. package/dist/src/utils/pnpm-deps-update.d.mts +3 -3
  21. package/dist/src/utils/pnpm-deps-update.d.ts +3 -3
  22. package/dist/src/utils/pnpm-deps-update.js +2 -2
  23. package/dist/src/utils/pnpm-deps-update.mjs +3 -3
  24. package/docs/api/base/base-executor.schema.md +16 -0
  25. package/docs/api/base/base-generator.schema.md +15 -0
  26. package/docs/api/base/cargo-base-executor.schema.md +90 -0
  27. package/docs/api/base/typescript-build-executor.schema.md +126 -0
  28. package/docs/api/base/typescript-library-generator.schema.md +129 -0
  29. package/docs/api/executors/cargo-build/schema.md +89 -0
  30. package/docs/api/executors/cargo-check/schema.md +90 -0
  31. package/docs/api/executors/cargo-clippy/schema.md +99 -0
  32. package/docs/api/executors/cargo-doc/schema.md +130 -0
  33. package/docs/api/executors/cargo-format/schema.md +90 -0
  34. package/docs/api/executors/cargo-publish/schema.md +117 -0
  35. package/docs/api/executors/clean-package/schema.md +65 -0
  36. package/docs/api/executors/esbuild/schema.md +126 -0
  37. package/docs/api/executors/npm-publish/schema.md +64 -0
  38. package/docs/api/executors/size-limit/schema.md +25 -0
  39. package/docs/api/executors/typia/schema.md +46 -0
  40. package/docs/api/executors/unbuild/schema.md +222 -0
  41. package/docs/api/generators/browser-library/files/README.md +58 -0
  42. package/docs/api/generators/browser-library/schema.md +129 -0
  43. package/docs/api/generators/config-schema/schema.md +25 -0
  44. package/docs/api/generators/init/schema.md +15 -0
  45. package/docs/api/generators/neutral-library/files/README.md +58 -0
  46. package/docs/api/generators/neutral-library/schema.md +129 -0
  47. package/docs/api/generators/node-library/files/README.md +63 -0
  48. package/docs/api/generators/node-library/schema.md +129 -0
  49. package/docs/api/generators/preset/schema.md +110 -0
  50. package/docs/api/generators/release-version/schema.md +160 -0
  51. package/package.json +13 -35
  52. package/dist/chunk-CMH2A42G.js +0 -467
  53. package/dist/chunk-HMJTTE4A.mjs +0 -96
  54. package/dist/chunk-I54IKCIV.mjs +0 -467
  55. package/docs/executors/rollup.md +0 -88
  56. package/executors.ts +0 -23
  57. package/generators.ts +0 -14
  58. package/index.ts +0 -5
  59. package/project.json +0 -58
  60. package/src/base/base-executor.ts +0 -200
  61. package/src/base/base-executor.untyped.ts +0 -18
  62. package/src/base/base-generator.ts +0 -130
  63. package/src/base/base-generator.untyped.ts +0 -16
  64. package/src/base/cargo-base-executor.untyped.ts +0 -73
  65. package/src/base/index.ts +0 -8
  66. package/src/base/typescript-build-executor.untyped.ts +0 -153
  67. package/src/base/typescript-library-generator.ts +0 -415
  68. package/src/base/typescript-library-generator.untyped.ts +0 -106
  69. package/src/executors/cargo-build/executor.spec.ts +0 -18
  70. package/src/executors/cargo-build/executor.ts +0 -28
  71. package/src/executors/cargo-build/untyped.ts +0 -18
  72. package/src/executors/cargo-check/executor.spec.ts +0 -18
  73. package/src/executors/cargo-check/executor.ts +0 -27
  74. package/src/executors/cargo-check/untyped.ts +0 -11
  75. package/src/executors/cargo-clippy/executor.spec.ts +0 -18
  76. package/src/executors/cargo-clippy/executor.ts +0 -28
  77. package/src/executors/cargo-clippy/untyped.ts +0 -18
  78. package/src/executors/cargo-doc/executor.spec.ts +0 -18
  79. package/src/executors/cargo-doc/executor.ts +0 -39
  80. package/src/executors/cargo-doc/untyped.ts +0 -44
  81. package/src/executors/cargo-format/executor.spec.ts +0 -18
  82. package/src/executors/cargo-format/executor.ts +0 -28
  83. package/src/executors/cargo-format/untyped.ts +0 -11
  84. package/src/executors/cargo-publish/executor.spec.ts +0 -11
  85. package/src/executors/cargo-publish/executor.ts +0 -139
  86. package/src/executors/cargo-publish/untyped.ts +0 -33
  87. package/src/executors/clean-package/constants.ts +0 -99
  88. package/src/executors/clean-package/executor.spec.ts +0 -18
  89. package/src/executors/clean-package/executor.ts +0 -214
  90. package/src/executors/clean-package/types.ts +0 -6
  91. package/src/executors/clean-package/untyped.ts +0 -60
  92. package/src/executors/clean-package/utils.ts +0 -85
  93. package/src/executors/esbuild/executor.spec.ts +0 -11
  94. package/src/executors/esbuild/executor.ts +0 -67
  95. package/src/executors/esbuild/untyped.ts +0 -20
  96. package/src/executors/npm-publish/executor.spec.ts +0 -11
  97. package/src/executors/npm-publish/executor.ts +0 -680
  98. package/src/executors/npm-publish/untyped.ts +0 -56
  99. package/src/executors/size-limit/executor.spec.ts +0 -18
  100. package/src/executors/size-limit/executor.ts +0 -88
  101. package/src/executors/size-limit/untyped.ts +0 -22
  102. package/src/executors/typia/executor.ts +0 -54
  103. package/src/executors/typia/untyped.ts +0 -48
  104. package/src/executors/unbuild/executor.spec.ts +0 -11
  105. package/src/executors/unbuild/executor.ts +0 -136
  106. package/src/executors/unbuild/untyped.ts +0 -152
  107. package/src/generators/browser-library/generator.spec.ts +0 -20
  108. package/src/generators/browser-library/generator.ts +0 -109
  109. package/src/generators/browser-library/untyped.ts +0 -29
  110. package/src/generators/config-schema/generator.spec.ts +0 -20
  111. package/src/generators/config-schema/generator.ts +0 -90
  112. package/src/generators/config-schema/untyped.ts +0 -19
  113. package/src/generators/init/init.ts +0 -32
  114. package/src/generators/init/untyped.ts +0 -16
  115. package/src/generators/neutral-library/generator.spec.ts +0 -20
  116. package/src/generators/neutral-library/generator.ts +0 -81
  117. package/src/generators/neutral-library/untyped.ts +0 -29
  118. package/src/generators/node-library/generator.spec.ts +0 -20
  119. package/src/generators/node-library/generator.ts +0 -84
  120. package/src/generators/node-library/untyped.ts +0 -29
  121. package/src/generators/preset/files/.all-contributorsrc.template +0 -48
  122. package/src/generators/preset/files/.editorconfig +0 -454
  123. package/src/generators/preset/files/.env.template +0 -38
  124. package/src/generators/preset/files/.gitattributes +0 -52
  125. package/src/generators/preset/files/.github/.nvmrc +0 -1
  126. package/src/generators/preset/files/.github/CODEOWNERS +0 -3
  127. package/src/generators/preset/files/.github/CODE_OF_CONDUCT.md +0 -125
  128. package/src/generators/preset/files/.github/CONTRIBUTING.md.template +0 -15
  129. package/src/generators/preset/files/.github/FUNDING.yml +0 -3
  130. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/bug-report.yml.template +0 -102
  131. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/documentation.yml.template +0 -56
  132. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/feature-request.yml.template +0 -60
  133. package/src/generators/preset/files/.github/PULL_REQUEST_TEMPLATE.md.template +0 -39
  134. package/src/generators/preset/files/.github/SECURITY.md +0 -9
  135. package/src/generators/preset/files/.github/codecov.yml +0 -29
  136. package/src/generators/preset/files/.github/dependabot.yml +0 -64
  137. package/src/generators/preset/files/.github/labels.yml +0 -84
  138. package/src/generators/preset/files/.github/renovate.json +0 -4
  139. package/src/generators/preset/files/.github/renovate.json.template +0 -63
  140. package/src/generators/preset/files/.github/stale.yml +0 -55
  141. package/src/generators/preset/files/.github/workflows/build-release.yml.template +0 -25
  142. package/src/generators/preset/files/.github/workflows/code-review.yml +0 -18
  143. package/src/generators/preset/files/.github/workflows/codeql.yml +0 -84
  144. package/src/generators/preset/files/.github/workflows/dependabot-update.yml +0 -32
  145. package/src/generators/preset/files/.github/workflows/git-guardian.yml +0 -23
  146. package/src/generators/preset/files/.github/workflows/greetings.yml +0 -31
  147. package/src/generators/preset/files/.github/workflows/labels.yml +0 -31
  148. package/src/generators/preset/files/.github/workflows/lock.yml +0 -26
  149. package/src/generators/preset/files/.log4brains.yml.template +0 -5
  150. package/src/generators/preset/files/.markdownlint.json +0 -155
  151. package/src/generators/preset/files/.verdaccio/config.yml.template +0 -40
  152. package/src/generators/preset/files/.vscode/README.md +0 -32
  153. package/src/generators/preset/files/.vscode/cspell.json +0 -3
  154. package/src/generators/preset/files/.vscode/extensions.json +0 -14
  155. package/src/generators/preset/files/.vscode/launch.json +0 -37
  156. package/src/generators/preset/files/.vscode/settings.json +0 -401
  157. package/src/generators/preset/files/.vscode/tasks.json +0 -4
  158. package/src/generators/preset/files/.whitesource +0 -14
  159. package/src/generators/preset/files/assets/diagrams/.gitkeep +0 -0
  160. package/src/generators/preset/files/assets/icons/dark/.gitkeep +0 -0
  161. package/src/generators/preset/files/assets/icons/light/.gitkeep +0 -0
  162. package/src/generators/preset/files/assets/logos/.gitkeep +0 -0
  163. package/src/generators/preset/files/docs/api-reference/.gitkeep +0 -0
  164. package/src/generators/preset/generator.spec.ts +0 -20
  165. package/src/generators/preset/generator.ts +0 -315
  166. package/src/generators/preset/untyped.ts +0 -88
  167. package/src/generators/release-version/generator.spec.ts +0 -20
  168. package/src/generators/release-version/generator.ts +0 -920
  169. package/src/generators/release-version/untyped.ts +0 -156
  170. package/src/plugins/rust/cargo-toml.ts +0 -434
  171. package/src/plugins/rust/index.ts +0 -1
  172. package/src/plugins/typescript/index.ts +0 -1
  173. package/src/plugins/typescript/project-config.ts +0 -564
  174. package/src/plugins/typescript/tsup.ts +0 -198
  175. package/src/types.ts +0 -130
  176. package/src/utils/apply-workspace-tokens.ts +0 -73
  177. package/src/utils/cargo.ts +0 -219
  178. package/src/utils/create-cli-options.ts +0 -23
  179. package/src/utils/get-project-configurations.ts +0 -27
  180. package/src/utils/index.ts +0 -12
  181. package/src/utils/lock-file.ts +0 -159
  182. package/src/utils/package-helpers.ts +0 -54
  183. package/src/utils/plugin-helpers.ts +0 -112
  184. package/src/utils/pnpm-deps-update.ts +0 -111
  185. package/src/utils/project-tags.ts +0 -162
  186. package/src/utils/toml.ts +0 -204
  187. package/src/utils/typia-transform.ts +0 -8
  188. package/src/utils/versions.ts +0 -19
  189. package/tsconfig.json +0 -30
  190. package/tsup.config.ts +0 -36
  191. /package/{src/generators/preset/files/LICENSE → LICENSE} +0 -0
  192. /package/{src → dist/src}/base/base-executor.schema.d.ts +0 -0
  193. /package/{src → dist/src}/base/base-executor.schema.json +0 -0
  194. /package/{src → dist/src}/base/base-executor.schema.md +0 -0
  195. /package/{src → dist/src}/base/base-generator.schema.d.ts +0 -0
  196. /package/{src → dist/src}/base/base-generator.schema.json +0 -0
  197. /package/{src → dist/src}/base/base-generator.schema.md +0 -0
  198. /package/{src → dist/src}/base/cargo-base-executor.schema.d.ts +0 -0
  199. /package/{src → dist/src}/base/cargo-base-executor.schema.json +0 -0
  200. /package/{src → dist/src}/base/cargo-base-executor.schema.md +0 -0
  201. /package/{src → dist/src}/base/typescript-build-executor.schema.d.ts +0 -0
  202. /package/{src → dist/src}/base/typescript-build-executor.schema.json +0 -0
  203. /package/{src → dist/src}/base/typescript-build-executor.schema.md +0 -0
  204. /package/{src → dist/src}/base/typescript-library-generator.schema.d.ts +0 -0
  205. /package/{src → dist/src}/base/typescript-library-generator.schema.json +0 -0
  206. /package/{src → dist/src}/base/typescript-library-generator.schema.md +0 -0
  207. /package/{src → dist/src}/executors/cargo-build/schema.d.ts +0 -0
  208. /package/{src → dist/src}/executors/cargo-build/schema.json +0 -0
  209. /package/{src → dist/src}/executors/cargo-build/schema.md +0 -0
  210. /package/{src → dist/src}/executors/cargo-check/schema.d.ts +0 -0
  211. /package/{src → dist/src}/executors/cargo-check/schema.json +0 -0
  212. /package/{src → dist/src}/executors/cargo-check/schema.md +0 -0
  213. /package/{src → dist/src}/executors/cargo-clippy/schema.d.ts +0 -0
  214. /package/{src → dist/src}/executors/cargo-clippy/schema.json +0 -0
  215. /package/{src → dist/src}/executors/cargo-clippy/schema.md +0 -0
  216. /package/{src → dist/src}/executors/cargo-doc/schema.d.ts +0 -0
  217. /package/{src → dist/src}/executors/cargo-doc/schema.json +0 -0
  218. /package/{src → dist/src}/executors/cargo-doc/schema.md +0 -0
  219. /package/{src → dist/src}/executors/cargo-format/schema.d.ts +0 -0
  220. /package/{src → dist/src}/executors/cargo-format/schema.json +0 -0
  221. /package/{src → dist/src}/executors/cargo-format/schema.md +0 -0
  222. /package/{src → dist/src}/executors/cargo-publish/schema.d.ts +0 -0
  223. /package/{src → dist/src}/executors/cargo-publish/schema.json +0 -0
  224. /package/{src → dist/src}/executors/cargo-publish/schema.md +0 -0
  225. /package/{src → dist/src}/executors/clean-package/schema.d.ts +0 -0
  226. /package/{src → dist/src}/executors/clean-package/schema.json +0 -0
  227. /package/{src → dist/src}/executors/clean-package/schema.md +0 -0
  228. /package/{src → dist/src}/executors/esbuild/schema.d.ts +0 -0
  229. /package/{src → dist/src}/executors/esbuild/schema.json +0 -0
  230. /package/{src → dist/src}/executors/esbuild/schema.md +0 -0
  231. /package/{src → dist/src}/executors/npm-publish/schema.d.ts +0 -0
  232. /package/{src → dist/src}/executors/npm-publish/schema.json +0 -0
  233. /package/{src → dist/src}/executors/npm-publish/schema.md +0 -0
  234. /package/{src → dist/src}/executors/size-limit/schema.d.ts +0 -0
  235. /package/{src → dist/src}/executors/size-limit/schema.json +0 -0
  236. /package/{src → dist/src}/executors/size-limit/schema.md +0 -0
  237. /package/{src → dist/src}/executors/typia/schema.d.ts +0 -0
  238. /package/{src → dist/src}/executors/typia/schema.json +0 -0
  239. /package/{src → dist/src}/executors/typia/schema.md +0 -0
  240. /package/{src → dist/src}/executors/unbuild/schema.d.ts +0 -0
  241. /package/{src → dist/src}/executors/unbuild/schema.json +0 -0
  242. /package/{src → dist/src}/executors/unbuild/schema.md +0 -0
  243. /package/{src → dist/src}/generators/browser-library/files/README.md +0 -0
  244. /package/{src → dist/src}/generators/browser-library/files/jest.config.ts +0 -0
  245. /package/{src → dist/src}/generators/browser-library/files/src/index.ts.template +0 -0
  246. /package/{src → dist/src}/generators/browser-library/files/tsconfig.spec.json +0 -0
  247. /package/{src → dist/src}/generators/browser-library/schema.d.ts +0 -0
  248. /package/{src → dist/src}/generators/browser-library/schema.json +0 -0
  249. /package/{src → dist/src}/generators/browser-library/schema.md +0 -0
  250. /package/{src → dist/src}/generators/config-schema/schema.d.ts +0 -0
  251. /package/{src → dist/src}/generators/config-schema/schema.json +0 -0
  252. /package/{src → dist/src}/generators/config-schema/schema.md +0 -0
  253. /package/{src → dist/src}/generators/init/schema.d.ts +0 -0
  254. /package/{src → dist/src}/generators/init/schema.json +0 -0
  255. /package/{src → dist/src}/generators/init/schema.md +0 -0
  256. /package/{src → dist/src}/generators/neutral-library/files/README.md +0 -0
  257. /package/{src → dist/src}/generators/neutral-library/files/jest.config.ts +0 -0
  258. /package/{src → dist/src}/generators/neutral-library/files/src/index.ts.template +0 -0
  259. /package/{src → dist/src}/generators/neutral-library/files/tsconfig.spec.json +0 -0
  260. /package/{src → dist/src}/generators/neutral-library/schema.d.ts +0 -0
  261. /package/{src → dist/src}/generators/neutral-library/schema.json +0 -0
  262. /package/{src → dist/src}/generators/neutral-library/schema.md +0 -0
  263. /package/{src → dist/src}/generators/node-library/files/README.md +0 -0
  264. /package/{src → dist/src}/generators/node-library/files/jest.config.ts +0 -0
  265. /package/{src → dist/src}/generators/node-library/files/src/index.ts.template +0 -0
  266. /package/{src → dist/src}/generators/node-library/files/tsconfig.spec.json +0 -0
  267. /package/{src → dist/src}/generators/node-library/schema.d.ts +0 -0
  268. /package/{src → dist/src}/generators/node-library/schema.json +0 -0
  269. /package/{src → dist/src}/generators/node-library/schema.md +0 -0
  270. /package/{src → dist/src}/generators/preset/files/README.md.template +0 -0
  271. /package/{src → dist/src}/generators/preset/files/docs/readme-templates/README.footer.md.template +0 -0
  272. /package/{src → dist/src}/generators/preset/files/docs/readme-templates/README.header.md.template +0 -0
  273. /package/{src → dist/src}/generators/preset/files/eslint.config.js.template +0 -0
  274. /package/{src → dist/src}/generators/preset/files/knip.json +0 -0
  275. /package/{src → dist/src}/generators/preset/files/lefthook.json +0 -0
  276. /package/{src → dist/src}/generators/preset/files/nx.json +0 -0
  277. /package/{src → dist/src}/generators/preset/files/pnpm-workspace.yaml +0 -0
  278. /package/{src → dist/src}/generators/preset/files/socket.yaml +0 -0
  279. /package/{src → dist/src}/generators/preset/files/storm.json.template +0 -0
  280. /package/{src → dist/src}/generators/preset/files/tsconfig.base.json.template +0 -0
  281. /package/{src → dist/src}/generators/preset/schema.d.ts +0 -0
  282. /package/{src → dist/src}/generators/preset/schema.json +0 -0
  283. /package/{src → dist/src}/generators/preset/schema.md +0 -0
  284. /package/{src → dist/src}/generators/release-version/schema.d.ts +0 -0
  285. /package/{src → dist/src}/generators/release-version/schema.json +0 -0
  286. /package/{src → dist/src}/generators/release-version/schema.md +0 -0
  287. /package/{src → dist/src}/plugins/typescript/untyped-schema.ts +0 -0
@@ -1,109 +0,0 @@
1
- import {
2
- type Tree,
3
- formatFiles,
4
- generateFiles,
5
- names,
6
- offsetFromRoot
7
- } from "@nx/devkit";
8
- import { StormWorkspaceConfig } from "@storm-software/config";
9
- import { joinPaths } from "@storm-software/config-tools/utilities/correct-paths";
10
- import { withRunGenerator } from "../../base/base-generator";
11
- import {
12
- normalizeOptions,
13
- typeScriptLibraryGeneratorFn,
14
- TypeScriptLibraryGeneratorOptions
15
- } from "../../base/typescript-library-generator";
16
- import type { BrowserLibraryGeneratorSchema } from "./schema.d";
17
-
18
- export async function browserLibraryGeneratorFn(
19
- tree: Tree,
20
- schema: BrowserLibraryGeneratorSchema,
21
- config?: StormWorkspaceConfig
22
- ) {
23
- const filesDir = joinPaths(
24
- __dirname,
25
- "src",
26
- "generators",
27
- "browser-library",
28
- "files"
29
- );
30
- const tsLibraryGeneratorOptions: TypeScriptLibraryGeneratorOptions = {
31
- buildExecutor: "@storm-software/workspace-tools:unbuild",
32
- platform: "browser",
33
- devDependencies: {
34
- "@types/react": "^18.3.6",
35
- "@types/react-dom": "^18.3.0"
36
- },
37
- peerDependencies: {
38
- react: "^18.3.0",
39
- "react-dom": "^18.3.0",
40
- "react-native": "*"
41
- },
42
- peerDependenciesMeta: {
43
- "react-dom": {
44
- optional: true
45
- },
46
- "react-native": {
47
- optional: true
48
- }
49
- },
50
- ...schema,
51
- description: schema.description!,
52
- directory: schema.directory
53
- };
54
-
55
- const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
56
- const { className, name, propertyName } = names(
57
- options.projectNames.projectFileName
58
- );
59
-
60
- generateFiles(tree, filesDir, options.projectRoot, {
61
- ...schema,
62
- dot: ".",
63
- className,
64
- name,
65
- namespace: process.env.STORM_NAMESPACE ?? "storm-software",
66
- description: schema.description ?? "",
67
- propertyName,
68
- js: !!options.js,
69
- cliCommand: "nx",
70
- strict: undefined,
71
- tmpl: "",
72
- offsetFromRoot: offsetFromRoot(options.projectRoot),
73
- buildable: options.bundler && options.bundler !== "none",
74
- hasUnitTestRunner: options.unitTestRunner !== "none",
75
- tsConfigOptions: {
76
- compilerOptions: {
77
- jsx: "react",
78
- types: [
79
- "node",
80
- "@nx/react/typings/cssmodule.d.ts",
81
- "@nx/react/typings/image.d.ts"
82
- ]
83
- }
84
- }
85
- });
86
-
87
- await typeScriptLibraryGeneratorFn(tree, tsLibraryGeneratorOptions, config);
88
- await formatFiles(tree);
89
-
90
- return null;
91
- }
92
-
93
- export default withRunGenerator<BrowserLibraryGeneratorSchema>(
94
- "TypeScript Library Creator (Browser Platform)",
95
- browserLibraryGeneratorFn,
96
- {
97
- hooks: {
98
- applyDefaultOptions: (
99
- options: BrowserLibraryGeneratorSchema
100
- ): BrowserLibraryGeneratorSchema => {
101
- options.description ??=
102
- "A library used by Storm Software to support browser applications";
103
- options.platform ??= "browser";
104
-
105
- return options;
106
- }
107
- }
108
- }
109
- );
@@ -1,29 +0,0 @@
1
- import { defineUntypedSchema } from "untyped";
2
- import typescriptLibraryGeneratorSchema from "../../base/typescript-library-generator.untyped";
3
-
4
- export default defineUntypedSchema({
5
- ...typescriptLibraryGeneratorSchema,
6
- $schema: {
7
- id: "BrowserLibraryGeneratorSchema",
8
- title: "Browser Library Generator",
9
- description: "A type definition for a browser library generator schema",
10
- required: ["directory", "name"],
11
- },
12
- buildExecutor: {
13
- $schema: {
14
- title: "Build Executor",
15
- type: "string",
16
- description: "The executor to use for building the library",
17
- },
18
- $default: "@storm-software/workspace-tools:unbuild",
19
- },
20
- platform: {
21
- $schema: {
22
- title: "Platform",
23
- type: "string",
24
- description: "The platform to target with the library",
25
- enum: ["browser", "neutral"],
26
- },
27
- $default: "browser",
28
- },
29
- });
@@ -1,20 +0,0 @@
1
- import { Tree, readProjectConfiguration } from "@nx/devkit";
2
- import { createTreeWithEmptyWorkspace } from "@nx/devkit/testing";
3
-
4
- import { configSchemaGenerator } from "./generator";
5
- import { ConfigSchemaGeneratorSchema } from "./schema.d";
6
-
7
- describe("config-schema generator", () => {
8
- let tree: Tree;
9
- const options: ConfigSchemaGeneratorSchema = { name: "test" };
10
-
11
- beforeEach(() => {
12
- tree = createTreeWithEmptyWorkspace();
13
- });
14
-
15
- it("should run successfully", async () => {
16
- await configSchemaGenerator(tree, options);
17
- const config = readProjectConfiguration(tree, "test");
18
- expect(config).toBeDefined();
19
- });
20
- });
@@ -1,90 +0,0 @@
1
- import { formatFiles, type Tree, writeJson } from "@nx/devkit";
2
- import {
3
- type StormWorkspaceConfig,
4
- stormWorkspaceConfigSchema
5
- } from "@storm-software/config";
6
- import {
7
- findWorkspaceRoot,
8
- writeInfo,
9
- writeSuccess,
10
- writeTrace
11
- } from "@storm-software/config-tools";
12
- import * as z from "zod";
13
- import { JsonSchema7Type, zodToJsonSchema } from "zod-to-json-schema";
14
- import { withRunGenerator } from "../../base/base-generator";
15
- import type { ConfigSchemaGeneratorSchema } from "./schema.d";
16
-
17
- export type ModuleSchema = {
18
- name: string;
19
- schema: z.ZodObject<any>;
20
- };
21
-
22
- export async function configSchemaGeneratorFn(
23
- tree: Tree,
24
- options: ConfigSchemaGeneratorSchema,
25
- config?: StormWorkspaceConfig
26
- ) {
27
- writeInfo(
28
- "📦 Running Storm Workspace Configuration JSON Schema generator",
29
- config
30
- );
31
-
32
- writeTrace(
33
- `Determining the Storm Workspace Configuration JSON Schema...`,
34
- config
35
- );
36
-
37
- const jsonSchema = zodToJsonSchema(stormWorkspaceConfigSchema, {
38
- name: "StormWorkspaceConfiguration"
39
- });
40
- writeTrace(jsonSchema, config);
41
-
42
- const outputPath = options
43
- .outputFile!.replaceAll("{workspaceRoot}", "")
44
- .replaceAll(
45
- config?.workspaceRoot ?? findWorkspaceRoot(),
46
- options.outputFile?.startsWith("./") ? "" : "./"
47
- );
48
-
49
- writeTrace(
50
- `📝 Writing Storm Configuration JSON Schema to "${outputPath}"`,
51
- config
52
- );
53
-
54
- writeJson<
55
- JsonSchema7Type & {
56
- $schema?: string | undefined;
57
- definitions?:
58
- | {
59
- [key: string]: JsonSchema7Type;
60
- }
61
- | undefined;
62
- }
63
- >(tree, outputPath, jsonSchema, { spaces: 2 });
64
- await formatFiles(tree);
65
-
66
- writeSuccess(
67
- "🚀 Storm Configuration JSON Schema creation has completed successfully!",
68
- config
69
- );
70
-
71
- return {
72
- success: true
73
- };
74
- }
75
-
76
- export default withRunGenerator<ConfigSchemaGeneratorSchema>(
77
- "Configuration Schema Creator",
78
- configSchemaGeneratorFn,
79
- {
80
- hooks: {
81
- applyDefaultOptions: (
82
- options: ConfigSchemaGeneratorSchema
83
- ): ConfigSchemaGeneratorSchema => {
84
- options.outputFile ??= "{workspaceRoot}/storm-workspace.schema.json";
85
-
86
- return options;
87
- }
88
- }
89
- }
90
- );
@@ -1,19 +0,0 @@
1
- import { defineUntypedSchema } from "untyped";
2
- import baseGeneratorSchema from "../../base/base-generator.untyped";
3
-
4
- export default defineUntypedSchema({
5
- ...baseGeneratorSchema,
6
- $schema: {
7
- id: "ConfigSchemaGeneratorSchema",
8
- title: "Config Schema Generator",
9
- description: "A type definition for a config schema generator schema",
10
- },
11
- outputFile: {
12
- $schema: {
13
- title: "Output File",
14
- type: "string",
15
- description: "The file to write the schema to",
16
- },
17
- $default: "{workspaceRoot}/storm-workspace.schema.json",
18
- },
19
- });
@@ -1,32 +0,0 @@
1
- import {
2
- addDependenciesToPackageJson,
3
- formatFiles,
4
- type Tree,
5
- } from "@nx/devkit";
6
- import type { InitGeneratorSchema } from "./schema.d";
7
-
8
- export async function initGenerator(tree: Tree, schema: InitGeneratorSchema) {
9
- const task = addDependenciesToPackageJson(
10
- tree,
11
- {
12
- nx: "^19.6.2",
13
- "@nx/workspace": "^19.6.2",
14
- "@nx/js": "^19.6.2",
15
- "@storm-software/eslint": "latest",
16
- "@storm-software/prettier": "latest",
17
- "@storm-software/config-tools": "latest",
18
- "@storm-software/testing-tools": "latest",
19
- "@storm-software/git-tools": "latest",
20
- "@storm-software/linting-tools": "latest",
21
- },
22
- {},
23
- );
24
-
25
- if (!schema.skipFormat) {
26
- await formatFiles(tree);
27
- }
28
-
29
- return task;
30
- }
31
-
32
- export default initGenerator;
@@ -1,16 +0,0 @@
1
- import { defineUntypedSchema } from "untyped";
2
-
3
- export default defineUntypedSchema({
4
- $schema: {
5
- id: "InitGeneratorSchema",
6
- title: "Init Generator",
7
- description: "A type definition for an init generator schema",
8
- },
9
- skipFormat: {
10
- $schema: {
11
- title: "Skip Format",
12
- type: "boolean",
13
- description: "Skip formatting the generated files",
14
- },
15
- },
16
- });
@@ -1,20 +0,0 @@
1
- import { Tree, readProjectConfiguration } from "@nx/devkit";
2
- import { createTreeWithEmptyWorkspace } from "@nx/devkit/testing";
3
-
4
- import { neutralLibraryGenerator } from "./generator";
5
- import { NeutralLibraryGeneratorSchema } from "./schema.d";
6
-
7
- describe("neutral-library generator", () => {
8
- let tree: Tree;
9
- const options: NeutralLibraryGeneratorSchema = { name: "test" };
10
-
11
- beforeEach(() => {
12
- tree = createTreeWithEmptyWorkspace();
13
- });
14
-
15
- it("should run successfully", async () => {
16
- await neutralLibraryGenerator(tree, options);
17
- const config = readProjectConfiguration(tree, "test");
18
- expect(config).toBeDefined();
19
- });
20
- });
@@ -1,81 +0,0 @@
1
- import {
2
- formatFiles,
3
- generateFiles,
4
- names,
5
- offsetFromRoot,
6
- Tree
7
- } from "@nx/devkit";
8
- import { StormWorkspaceConfig } from "@storm-software/config";
9
- import { joinPaths } from "@storm-software/config-tools/utilities/correct-paths";
10
- import { withRunGenerator } from "../../base/base-generator";
11
- import {
12
- normalizeOptions,
13
- typeScriptLibraryGeneratorFn,
14
- TypeScriptLibraryGeneratorOptions
15
- } from "../../base/typescript-library-generator";
16
- import { NeutralLibraryGeneratorSchema } from "./schema.d";
17
-
18
- export async function neutralLibraryGeneratorFn(
19
- tree: Tree,
20
- schema: NeutralLibraryGeneratorSchema,
21
- config?: StormWorkspaceConfig
22
- ) {
23
- const filesDir = joinPaths(
24
- __dirname,
25
- "src",
26
- "generators",
27
- "neutral-library",
28
- "files"
29
- );
30
- const tsLibraryGeneratorOptions = {
31
- ...schema,
32
- platform: "neutral",
33
- devDependencies: {},
34
- buildExecutor: "@storm-software/workspace-tools:unbuild"
35
- } as TypeScriptLibraryGeneratorOptions;
36
-
37
- const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
38
- const { className, name, propertyName } = names(
39
- options.projectNames.projectFileName
40
- );
41
-
42
- generateFiles(tree, filesDir, options.projectRoot, {
43
- ...schema,
44
- dot: ".",
45
- className,
46
- name,
47
- namespace: process.env.STORM_NAMESPACE ?? "storm-software",
48
- description: schema.description ?? "",
49
- propertyName,
50
- js: !!options.js,
51
- cliCommand: "nx",
52
- strict: undefined,
53
- tmpl: "",
54
- offsetFromRoot: offsetFromRoot(options.projectRoot),
55
- buildable: options.bundler && options.bundler !== "none",
56
- hasUnitTestRunner: options.unitTestRunner !== "none"
57
- });
58
-
59
- await typeScriptLibraryGeneratorFn(tree, tsLibraryGeneratorOptions, config);
60
- await formatFiles(tree);
61
-
62
- return null;
63
- }
64
-
65
- export default withRunGenerator<NeutralLibraryGeneratorSchema>(
66
- "TypeScript Library Creator (Neutral Platform)",
67
- neutralLibraryGeneratorFn,
68
- {
69
- hooks: {
70
- applyDefaultOptions: (
71
- options: NeutralLibraryGeneratorSchema
72
- ): NeutralLibraryGeneratorSchema => {
73
- options.description ??=
74
- "A library used by Storm Software to support either browser or NodeJs applications";
75
- options.platform = "neutral";
76
-
77
- return options;
78
- }
79
- }
80
- }
81
- );
@@ -1,29 +0,0 @@
1
- import { defineUntypedSchema } from "untyped";
2
- import typescriptLibraryGeneratorSchema from "../../base/typescript-library-generator.untyped";
3
-
4
- export default defineUntypedSchema({
5
- ...typescriptLibraryGeneratorSchema,
6
- $schema: {
7
- id: "NeutralLibrarySchema",
8
- title: "Neutral Library Generator",
9
- description: "A type definition for a neutral library generator schema",
10
- required: ["directory", "name"],
11
- },
12
- buildExecutor: {
13
- $schema: {
14
- title: "Build Executor",
15
- type: "string",
16
- description: "The executor to use for building the library",
17
- },
18
- $default: "@storm-software/workspace-tools:unbuild",
19
- },
20
- platform: {
21
- $schema: {
22
- title: "Platform",
23
- type: "string",
24
- description: "The platform to target with the library",
25
- enum: ["neutral"],
26
- },
27
- $default: "neutral",
28
- },
29
- });
@@ -1,20 +0,0 @@
1
- import { Tree, readProjectConfiguration } from "@nx/devkit";
2
- import { createTreeWithEmptyWorkspace } from "@nx/devkit/testing";
3
-
4
- import { nodeLibraryGenerator } from "./generator";
5
- import { NodeLibraryGeneratorSchema } from "./schema.d";
6
-
7
- describe("node-library generator", () => {
8
- let tree: Tree;
9
- const options: NodeLibraryGeneratorSchema = { name: "test" };
10
-
11
- beforeEach(() => {
12
- tree = createTreeWithEmptyWorkspace();
13
- });
14
-
15
- it("should run successfully", async () => {
16
- await nodeLibraryGenerator(tree, options);
17
- const config = readProjectConfiguration(tree, "test");
18
- expect(config).toBeDefined();
19
- });
20
- });
@@ -1,84 +0,0 @@
1
- import {
2
- formatFiles,
3
- generateFiles,
4
- names,
5
- offsetFromRoot,
6
- type Tree
7
- } from "@nx/devkit";
8
- import { StormWorkspaceConfig } from "@storm-software/config";
9
- import { joinPaths } from "@storm-software/config-tools/utilities/correct-paths";
10
- import { withRunGenerator } from "../../base/base-generator";
11
- import {
12
- normalizeOptions,
13
- typeScriptLibraryGeneratorFn,
14
- TypeScriptLibraryGeneratorOptions
15
- } from "../../base/typescript-library-generator";
16
- import { typesNodeVersion } from "../../utils/versions";
17
- import type { NodeLibraryGeneratorSchema } from "./schema.d";
18
-
19
- export async function nodeLibraryGeneratorFn(
20
- tree: Tree,
21
- schema: NodeLibraryGeneratorSchema,
22
- config?: StormWorkspaceConfig
23
- ) {
24
- const filesDir = joinPaths(
25
- __dirname,
26
- "src",
27
- "generators",
28
- "node-library",
29
- "files"
30
- );
31
- const tsLibraryGeneratorOptions: TypeScriptLibraryGeneratorOptions = {
32
- platform: "node",
33
- devDependencies: {
34
- "@types/node": typesNodeVersion
35
- },
36
- buildExecutor: "@storm-software/workspace-tools:unbuild",
37
- ...schema,
38
- directory: schema.directory,
39
- description: schema.description!
40
- };
41
-
42
- const options = await normalizeOptions(tree, tsLibraryGeneratorOptions);
43
- const { className, name, propertyName } = names(options.name);
44
-
45
- generateFiles(tree, filesDir, options.projectRoot, {
46
- ...schema,
47
- dot: ".",
48
- className,
49
- name,
50
- namespace: process.env.STORM_NAMESPACE ?? "storm-software",
51
- description: schema.description ?? "",
52
- propertyName,
53
- js: !!options.js,
54
- cliCommand: "nx",
55
- strict: undefined,
56
- tmpl: "",
57
- offsetFromRoot: offsetFromRoot(options.projectRoot),
58
- buildable: options.bundler && options.bundler !== "none",
59
- hasUnitTestRunner: options.unitTestRunner !== "none"
60
- });
61
-
62
- await typeScriptLibraryGeneratorFn(tree, tsLibraryGeneratorOptions, config);
63
- await formatFiles(tree);
64
-
65
- return null;
66
- }
67
-
68
- export default withRunGenerator<NodeLibraryGeneratorSchema>(
69
- "TypeScript Library Creator (NodeJs Platform)",
70
- nodeLibraryGeneratorFn,
71
- {
72
- hooks: {
73
- applyDefaultOptions: (
74
- options: NodeLibraryGeneratorSchema
75
- ): NodeLibraryGeneratorSchema => {
76
- options.description ??=
77
- "A library used by Storm Software to support NodeJs applications";
78
- options.platform ??= "node";
79
-
80
- return options;
81
- }
82
- }
83
- }
84
- );
@@ -1,29 +0,0 @@
1
- import { defineUntypedSchema } from "untyped";
2
- import typescriptLibraryGeneratorSchema from "../../base/typescript-library-generator.untyped";
3
-
4
- export default defineUntypedSchema({
5
- ...typescriptLibraryGeneratorSchema,
6
- $schema: {
7
- id: "NodeLibrarySchema",
8
- title: "Node Library Generator",
9
- description: "A type definition for a NodeJs library generator schema",
10
- required: ["directory", "name"],
11
- },
12
- buildExecutor: {
13
- $schema: {
14
- title: "Build Executor",
15
- type: "string",
16
- description: "The executor to use for building the library",
17
- },
18
- $default: "@storm-software/workspace-tools:unbuild",
19
- },
20
- platform: {
21
- $schema: {
22
- title: "Platform",
23
- type: "string",
24
- description: "The platform to target with the library",
25
- enum: ["node", "neutral"],
26
- },
27
- $default: "node",
28
- },
29
- });
@@ -1,48 +0,0 @@
1
- {
2
- "projectName": "<%= name %>",
3
- "projectOwner": "storm-software",
4
- "repoType": "github",
5
- "repoHost": "https://github.com",
6
- "files": [
7
- "README.md"
8
- ],
9
- "imageSize": 100,
10
- "contributorsPerLine": 5,
11
- "linkToUsage": true,
12
- "commitType": "docs",
13
- "commit": true,
14
- "commitConvention": "angular",
15
- "contributors": [
16
- {
17
- "login": "sullivanpj",
18
- "name": "Patrick Sullivan",
19
- "avatar_url": "https://avatars.githubusercontent.com/u/99053093?v=4",
20
- "profile": "http://www.sullypat.com/",
21
- "contributions": [
22
- "design",
23
- "code",
24
- "tool",
25
- "doc",
26
- "test"
27
- ]
28
- },
29
- {
30
- "login": "tbenning",
31
- "name": "Tyler Benning",
32
- "avatar_url": "https://avatars.githubusercontent.com/u/7265547?v=4",
33
- "profile": "https://tylerbenning.com/",
34
- "contributions": [
35
- "design"
36
- ]
37
- },
38
- {
39
- "login": "stormie-bot",
40
- "name": "Stormie",
41
- "avatar_url": "https://avatars.githubusercontent.com/u/149802440?v=4",
42
- "profile": "http://stormsoftware.com",
43
- "contributions": [
44
- "maintenance"
45
- ]
46
- }
47
- ]
48
- }