@storm-software/workspace-tools 1.269.1 → 1.270.1

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 (274) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/README.md +1 -1
  3. package/dist/chunk-CWBVTZAO.mjs +467 -0
  4. package/dist/chunk-PGUGHXXT.js +467 -0
  5. package/dist/executors.js +2 -2
  6. package/dist/executors.mjs +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/src/executors/npm-publish/executor.js +2 -2
  10. package/dist/src/executors/npm-publish/executor.mjs +1 -1
  11. package/docs/executors/rollup.md +88 -0
  12. package/executors.ts +23 -0
  13. package/generators.ts +14 -0
  14. package/index.ts +5 -0
  15. package/package.json +6 -4
  16. package/project.json +58 -0
  17. package/src/base/base-executor.ts +200 -0
  18. package/src/base/base-executor.untyped.ts +18 -0
  19. package/src/base/base-generator.ts +130 -0
  20. package/src/base/base-generator.untyped.ts +16 -0
  21. package/src/base/cargo-base-executor.untyped.ts +73 -0
  22. package/src/base/index.ts +8 -0
  23. package/src/base/typescript-build-executor.untyped.ts +153 -0
  24. package/src/base/typescript-library-generator.ts +415 -0
  25. package/src/base/typescript-library-generator.untyped.ts +106 -0
  26. package/src/executors/cargo-build/executor.spec.ts +18 -0
  27. package/src/executors/cargo-build/executor.ts +28 -0
  28. package/src/executors/cargo-build/untyped.ts +18 -0
  29. package/src/executors/cargo-check/executor.spec.ts +18 -0
  30. package/src/executors/cargo-check/executor.ts +27 -0
  31. package/src/executors/cargo-check/untyped.ts +11 -0
  32. package/src/executors/cargo-clippy/executor.spec.ts +18 -0
  33. package/src/executors/cargo-clippy/executor.ts +28 -0
  34. package/src/executors/cargo-clippy/untyped.ts +18 -0
  35. package/src/executors/cargo-doc/executor.spec.ts +18 -0
  36. package/src/executors/cargo-doc/executor.ts +39 -0
  37. package/src/executors/cargo-doc/untyped.ts +44 -0
  38. package/src/executors/cargo-format/executor.spec.ts +18 -0
  39. package/src/executors/cargo-format/executor.ts +28 -0
  40. package/src/executors/cargo-format/untyped.ts +11 -0
  41. package/src/executors/cargo-publish/executor.spec.ts +11 -0
  42. package/src/executors/cargo-publish/executor.ts +139 -0
  43. package/src/executors/cargo-publish/untyped.ts +33 -0
  44. package/src/executors/clean-package/constants.ts +99 -0
  45. package/src/executors/clean-package/executor.spec.ts +18 -0
  46. package/src/executors/clean-package/executor.ts +214 -0
  47. package/src/executors/clean-package/types.ts +6 -0
  48. package/src/executors/clean-package/untyped.ts +60 -0
  49. package/src/executors/clean-package/utils.ts +85 -0
  50. package/src/executors/esbuild/executor.spec.ts +11 -0
  51. package/src/executors/esbuild/executor.ts +67 -0
  52. package/src/executors/esbuild/untyped.ts +20 -0
  53. package/src/executors/npm-publish/executor.spec.ts +11 -0
  54. package/src/executors/npm-publish/executor.ts +680 -0
  55. package/src/executors/npm-publish/untyped.ts +56 -0
  56. package/src/executors/size-limit/executor.spec.ts +18 -0
  57. package/src/executors/size-limit/executor.ts +88 -0
  58. package/src/executors/size-limit/untyped.ts +22 -0
  59. package/src/executors/typia/executor.ts +54 -0
  60. package/src/executors/typia/untyped.ts +48 -0
  61. package/src/executors/unbuild/executor.spec.ts +11 -0
  62. package/src/executors/unbuild/executor.ts +136 -0
  63. package/src/executors/unbuild/untyped.ts +152 -0
  64. package/src/generators/browser-library/generator.spec.ts +20 -0
  65. package/src/generators/browser-library/generator.ts +109 -0
  66. package/src/generators/browser-library/untyped.ts +29 -0
  67. package/src/generators/config-schema/generator.spec.ts +20 -0
  68. package/src/generators/config-schema/generator.ts +90 -0
  69. package/src/generators/config-schema/untyped.ts +19 -0
  70. package/src/generators/init/init.ts +32 -0
  71. package/src/generators/init/untyped.ts +16 -0
  72. package/src/generators/neutral-library/generator.spec.ts +20 -0
  73. package/src/generators/neutral-library/generator.ts +81 -0
  74. package/src/generators/neutral-library/untyped.ts +29 -0
  75. package/src/generators/node-library/generator.spec.ts +20 -0
  76. package/src/generators/node-library/generator.ts +84 -0
  77. package/src/generators/node-library/untyped.ts +29 -0
  78. package/src/generators/preset/files/.all-contributorsrc.template +48 -0
  79. package/src/generators/preset/files/.editorconfig +454 -0
  80. package/src/generators/preset/files/.env.template +38 -0
  81. package/src/generators/preset/files/.gitattributes +52 -0
  82. package/src/generators/preset/files/.github/.nvmrc +1 -0
  83. package/src/generators/preset/files/.github/CODEOWNERS +3 -0
  84. package/src/generators/preset/files/.github/CODE_OF_CONDUCT.md +125 -0
  85. package/src/generators/preset/files/.github/CONTRIBUTING.md.template +15 -0
  86. package/src/generators/preset/files/.github/FUNDING.yml +3 -0
  87. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/bug-report.yml.template +102 -0
  88. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/documentation.yml.template +56 -0
  89. package/src/generators/preset/files/.github/ISSUE_TEMPLATE/feature-request.yml.template +60 -0
  90. package/src/generators/preset/files/.github/PULL_REQUEST_TEMPLATE.md.template +39 -0
  91. package/src/generators/preset/files/.github/SECURITY.md +9 -0
  92. package/src/generators/preset/files/.github/codecov.yml +29 -0
  93. package/src/generators/preset/files/.github/dependabot.yml +64 -0
  94. package/src/generators/preset/files/.github/labels.yml +84 -0
  95. package/src/generators/preset/files/.github/renovate.json +4 -0
  96. package/src/generators/preset/files/.github/renovate.json.template +63 -0
  97. package/src/generators/preset/files/.github/stale.yml +55 -0
  98. package/src/generators/preset/files/.github/workflows/build-release.yml.template +25 -0
  99. package/src/generators/preset/files/.github/workflows/code-review.yml +18 -0
  100. package/src/generators/preset/files/.github/workflows/codeql.yml +84 -0
  101. package/src/generators/preset/files/.github/workflows/dependabot-update.yml +32 -0
  102. package/src/generators/preset/files/.github/workflows/git-guardian.yml +23 -0
  103. package/src/generators/preset/files/.github/workflows/greetings.yml +31 -0
  104. package/src/generators/preset/files/.github/workflows/labels.yml +31 -0
  105. package/src/generators/preset/files/.github/workflows/lock.yml +26 -0
  106. package/src/generators/preset/files/.log4brains.yml.template +5 -0
  107. package/src/generators/preset/files/.markdownlint.json +155 -0
  108. package/src/generators/preset/files/.verdaccio/config.yml.template +40 -0
  109. package/src/generators/preset/files/.vscode/README.md +32 -0
  110. package/src/generators/preset/files/.vscode/cspell.json +3 -0
  111. package/src/generators/preset/files/.vscode/extensions.json +14 -0
  112. package/src/generators/preset/files/.vscode/launch.json +37 -0
  113. package/src/generators/preset/files/.vscode/settings.json +401 -0
  114. package/src/generators/preset/files/.vscode/tasks.json +4 -0
  115. package/src/generators/preset/files/.whitesource +14 -0
  116. package/src/generators/preset/files/assets/diagrams/.gitkeep +0 -0
  117. package/src/generators/preset/files/assets/icons/dark/.gitkeep +0 -0
  118. package/src/generators/preset/files/assets/icons/light/.gitkeep +0 -0
  119. package/src/generators/preset/files/assets/logos/.gitkeep +0 -0
  120. package/src/generators/preset/files/docs/api-reference/.gitkeep +0 -0
  121. package/src/generators/preset/generator.spec.ts +20 -0
  122. package/src/generators/preset/generator.ts +315 -0
  123. package/src/generators/preset/untyped.ts +88 -0
  124. package/src/generators/release-version/generator.spec.ts +20 -0
  125. package/src/generators/release-version/generator.ts +920 -0
  126. package/src/generators/release-version/untyped.ts +156 -0
  127. package/src/plugins/rust/cargo-toml.ts +434 -0
  128. package/src/plugins/rust/index.ts +1 -0
  129. package/src/plugins/typescript/index.ts +1 -0
  130. package/src/plugins/typescript/project-config.ts +564 -0
  131. package/src/plugins/typescript/tsup.ts +198 -0
  132. package/src/types.ts +130 -0
  133. package/src/utils/apply-workspace-tokens.ts +73 -0
  134. package/src/utils/cargo.ts +219 -0
  135. package/src/utils/create-cli-options.ts +23 -0
  136. package/src/utils/get-project-configurations.ts +27 -0
  137. package/src/utils/index.ts +12 -0
  138. package/src/utils/lock-file.ts +159 -0
  139. package/src/utils/package-helpers.ts +54 -0
  140. package/src/utils/plugin-helpers.ts +112 -0
  141. package/src/utils/pnpm-deps-update.ts +111 -0
  142. package/src/utils/project-tags.ts +162 -0
  143. package/src/utils/toml.ts +204 -0
  144. package/src/utils/typia-transform.ts +8 -0
  145. package/src/utils/versions.ts +19 -0
  146. package/tsconfig.json +30 -0
  147. package/tsup.config.ts +36 -0
  148. package/dist/chunk-FT3ZTDTT.js +0 -282
  149. package/dist/chunk-ZC6J6IDE.mjs +0 -282
  150. package/dist/src/generators/preset/files/LICENSE +0 -201
  151. package/docs/api/base/base-executor.schema.md +0 -16
  152. package/docs/api/base/base-generator.schema.md +0 -15
  153. package/docs/api/base/cargo-base-executor.schema.md +0 -90
  154. package/docs/api/base/typescript-build-executor.schema.md +0 -126
  155. package/docs/api/base/typescript-library-generator.schema.md +0 -129
  156. package/docs/api/executors/cargo-build/schema.md +0 -89
  157. package/docs/api/executors/cargo-check/schema.md +0 -90
  158. package/docs/api/executors/cargo-clippy/schema.md +0 -99
  159. package/docs/api/executors/cargo-doc/schema.md +0 -130
  160. package/docs/api/executors/cargo-format/schema.md +0 -90
  161. package/docs/api/executors/cargo-publish/schema.md +0 -117
  162. package/docs/api/executors/clean-package/schema.md +0 -65
  163. package/docs/api/executors/esbuild/schema.md +0 -126
  164. package/docs/api/executors/npm-publish/schema.md +0 -64
  165. package/docs/api/executors/size-limit/schema.md +0 -25
  166. package/docs/api/executors/typia/schema.md +0 -46
  167. package/docs/api/executors/unbuild/schema.md +0 -222
  168. package/docs/api/generators/browser-library/files/README.md +0 -58
  169. package/docs/api/generators/browser-library/schema.md +0 -129
  170. package/docs/api/generators/config-schema/schema.md +0 -25
  171. package/docs/api/generators/init/schema.md +0 -15
  172. package/docs/api/generators/neutral-library/files/README.md +0 -58
  173. package/docs/api/generators/neutral-library/schema.md +0 -129
  174. package/docs/api/generators/node-library/files/README.md +0 -63
  175. package/docs/api/generators/node-library/schema.md +0 -129
  176. package/docs/api/generators/preset/schema.md +0 -110
  177. package/docs/api/generators/release-version/schema.md +0 -160
  178. /package/{dist/src → src}/base/base-executor.schema.d.ts +0 -0
  179. /package/{dist/src → src}/base/base-executor.schema.json +0 -0
  180. /package/{dist/src → src}/base/base-executor.schema.md +0 -0
  181. /package/{dist/src → src}/base/base-generator.schema.d.ts +0 -0
  182. /package/{dist/src → src}/base/base-generator.schema.json +0 -0
  183. /package/{dist/src → src}/base/base-generator.schema.md +0 -0
  184. /package/{dist/src → src}/base/cargo-base-executor.schema.d.ts +0 -0
  185. /package/{dist/src → src}/base/cargo-base-executor.schema.json +0 -0
  186. /package/{dist/src → src}/base/cargo-base-executor.schema.md +0 -0
  187. /package/{dist/src → src}/base/typescript-build-executor.schema.d.ts +0 -0
  188. /package/{dist/src → src}/base/typescript-build-executor.schema.json +0 -0
  189. /package/{dist/src → src}/base/typescript-build-executor.schema.md +0 -0
  190. /package/{dist/src → src}/base/typescript-library-generator.schema.d.ts +0 -0
  191. /package/{dist/src → src}/base/typescript-library-generator.schema.json +0 -0
  192. /package/{dist/src → src}/base/typescript-library-generator.schema.md +0 -0
  193. /package/{dist/src → src}/executors/cargo-build/schema.d.ts +0 -0
  194. /package/{dist/src → src}/executors/cargo-build/schema.json +0 -0
  195. /package/{dist/src → src}/executors/cargo-build/schema.md +0 -0
  196. /package/{dist/src → src}/executors/cargo-check/schema.d.ts +0 -0
  197. /package/{dist/src → src}/executors/cargo-check/schema.json +0 -0
  198. /package/{dist/src → src}/executors/cargo-check/schema.md +0 -0
  199. /package/{dist/src → src}/executors/cargo-clippy/schema.d.ts +0 -0
  200. /package/{dist/src → src}/executors/cargo-clippy/schema.json +0 -0
  201. /package/{dist/src → src}/executors/cargo-clippy/schema.md +0 -0
  202. /package/{dist/src → src}/executors/cargo-doc/schema.d.ts +0 -0
  203. /package/{dist/src → src}/executors/cargo-doc/schema.json +0 -0
  204. /package/{dist/src → src}/executors/cargo-doc/schema.md +0 -0
  205. /package/{dist/src → src}/executors/cargo-format/schema.d.ts +0 -0
  206. /package/{dist/src → src}/executors/cargo-format/schema.json +0 -0
  207. /package/{dist/src → src}/executors/cargo-format/schema.md +0 -0
  208. /package/{dist/src → src}/executors/cargo-publish/schema.d.ts +0 -0
  209. /package/{dist/src → src}/executors/cargo-publish/schema.json +0 -0
  210. /package/{dist/src → src}/executors/cargo-publish/schema.md +0 -0
  211. /package/{dist/src → src}/executors/clean-package/schema.d.ts +0 -0
  212. /package/{dist/src → src}/executors/clean-package/schema.json +0 -0
  213. /package/{dist/src → src}/executors/clean-package/schema.md +0 -0
  214. /package/{dist/src → src}/executors/esbuild/schema.d.ts +0 -0
  215. /package/{dist/src → src}/executors/esbuild/schema.json +0 -0
  216. /package/{dist/src → src}/executors/esbuild/schema.md +0 -0
  217. /package/{dist/src → src}/executors/npm-publish/schema.d.ts +0 -0
  218. /package/{dist/src → src}/executors/npm-publish/schema.json +0 -0
  219. /package/{dist/src → src}/executors/npm-publish/schema.md +0 -0
  220. /package/{dist/src → src}/executors/size-limit/schema.d.ts +0 -0
  221. /package/{dist/src → src}/executors/size-limit/schema.json +0 -0
  222. /package/{dist/src → src}/executors/size-limit/schema.md +0 -0
  223. /package/{dist/src → src}/executors/typia/schema.d.ts +0 -0
  224. /package/{dist/src → src}/executors/typia/schema.json +0 -0
  225. /package/{dist/src → src}/executors/typia/schema.md +0 -0
  226. /package/{dist/src → src}/executors/unbuild/schema.d.ts +0 -0
  227. /package/{dist/src → src}/executors/unbuild/schema.json +0 -0
  228. /package/{dist/src → src}/executors/unbuild/schema.md +0 -0
  229. /package/{dist/src → src}/generators/browser-library/files/README.md +0 -0
  230. /package/{dist/src → src}/generators/browser-library/files/jest.config.ts +0 -0
  231. /package/{dist/src → src}/generators/browser-library/files/src/index.ts.template +0 -0
  232. /package/{dist/src → src}/generators/browser-library/files/tsconfig.spec.json +0 -0
  233. /package/{dist/src → src}/generators/browser-library/schema.d.ts +0 -0
  234. /package/{dist/src → src}/generators/browser-library/schema.json +0 -0
  235. /package/{dist/src → src}/generators/browser-library/schema.md +0 -0
  236. /package/{dist/src → src}/generators/config-schema/schema.d.ts +0 -0
  237. /package/{dist/src → src}/generators/config-schema/schema.json +0 -0
  238. /package/{dist/src → src}/generators/config-schema/schema.md +0 -0
  239. /package/{dist/src → src}/generators/init/schema.d.ts +0 -0
  240. /package/{dist/src → src}/generators/init/schema.json +0 -0
  241. /package/{dist/src → src}/generators/init/schema.md +0 -0
  242. /package/{dist/src → src}/generators/neutral-library/files/README.md +0 -0
  243. /package/{dist/src → src}/generators/neutral-library/files/jest.config.ts +0 -0
  244. /package/{dist/src → src}/generators/neutral-library/files/src/index.ts.template +0 -0
  245. /package/{dist/src → src}/generators/neutral-library/files/tsconfig.spec.json +0 -0
  246. /package/{dist/src → src}/generators/neutral-library/schema.d.ts +0 -0
  247. /package/{dist/src → src}/generators/neutral-library/schema.json +0 -0
  248. /package/{dist/src → src}/generators/neutral-library/schema.md +0 -0
  249. /package/{dist/src → src}/generators/node-library/files/README.md +0 -0
  250. /package/{dist/src → src}/generators/node-library/files/jest.config.ts +0 -0
  251. /package/{dist/src → src}/generators/node-library/files/src/index.ts.template +0 -0
  252. /package/{dist/src → src}/generators/node-library/files/tsconfig.spec.json +0 -0
  253. /package/{dist/src → src}/generators/node-library/schema.d.ts +0 -0
  254. /package/{dist/src → src}/generators/node-library/schema.json +0 -0
  255. /package/{dist/src → src}/generators/node-library/schema.md +0 -0
  256. /package/{LICENSE → src/generators/preset/files/LICENSE} +0 -0
  257. /package/{dist/src → src}/generators/preset/files/README.md.template +0 -0
  258. /package/{dist/src → src}/generators/preset/files/docs/readme-templates/README.footer.md.template +0 -0
  259. /package/{dist/src → src}/generators/preset/files/docs/readme-templates/README.header.md.template +0 -0
  260. /package/{dist/src → src}/generators/preset/files/eslint.config.js.template +0 -0
  261. /package/{dist/src → src}/generators/preset/files/knip.json +0 -0
  262. /package/{dist/src → src}/generators/preset/files/lefthook.json +0 -0
  263. /package/{dist/src → src}/generators/preset/files/nx.json +0 -0
  264. /package/{dist/src → src}/generators/preset/files/pnpm-workspace.yaml +0 -0
  265. /package/{dist/src → src}/generators/preset/files/socket.yaml +0 -0
  266. /package/{dist/src → src}/generators/preset/files/storm.json.template +0 -0
  267. /package/{dist/src → src}/generators/preset/files/tsconfig.base.json.template +0 -0
  268. /package/{dist/src → src}/generators/preset/schema.d.ts +0 -0
  269. /package/{dist/src → src}/generators/preset/schema.json +0 -0
  270. /package/{dist/src → src}/generators/preset/schema.md +0 -0
  271. /package/{dist/src → src}/generators/release-version/schema.d.ts +0 -0
  272. /package/{dist/src → src}/generators/release-version/schema.json +0 -0
  273. /package/{dist/src → src}/generators/release-version/schema.md +0 -0
  274. /package/{dist/src → src}/plugins/typescript/untyped-schema.ts +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,63 @@
2
2
 
3
3
  # Changelog for Storm Ops - Workspace Tools
4
4
 
5
+ ## [1.270.1](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.270.1) (2025-05-06)
6
+
7
+ ### Bug Fixes
8
+
9
+ - **workspace-tools:** Resolve issue with missing dependencies
10
+ ([e4fcafde0](https://github.com/storm-software/storm-ops/commit/e4fcafde0))
11
+
12
+ ### Miscellaneous
13
+
14
+ - **monorepo:** Regenerate README markdown files
15
+ ([6eabb3ff1](https://github.com/storm-software/storm-ops/commit/6eabb3ff1))
16
+
17
+ ### Updated Dependencies
18
+
19
+ - Updated prettier to 0.48.1
20
+ - Updated esbuild to 0.38.1
21
+ - Updated esbuild to 0.38.1
22
+ - Updated unbuild to 0.44.1
23
+ - Updated unbuild to 0.44.1
24
+
25
+ ## [1.270.0](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.270.0) (2025-05-06)
26
+
27
+ ### Features
28
+
29
+ - **workspace-tools:** Update the publish executor source code
30
+ ([527dcfe84](https://github.com/storm-software/storm-ops/commit/527dcfe84))
31
+
32
+ ### Miscellaneous
33
+
34
+ - **monorepo:** Regenerate README markdown files
35
+ ([d58a4014e](https://github.com/storm-software/storm-ops/commit/d58a4014e))
36
+
37
+ ### Updated Dependencies
38
+
39
+ - Updated prettier to 0.48.0
40
+ - Updated esbuild to 0.38.0
41
+ - Updated esbuild to 0.38.0
42
+ - Updated unbuild to 0.44.0
43
+ - Updated unbuild to 0.44.0
44
+
45
+ ## [1.269.2](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.269.2) (2025-05-05)
46
+
47
+ ### Miscellaneous
48
+
49
+ - **workspace-tools:** Skip git checks during publish
50
+ ([7fdcbfc9a](https://github.com/storm-software/storm-ops/commit/7fdcbfc9a))
51
+ - **monorepo:** Regenerate README markdown files
52
+ ([fb8ab0609](https://github.com/storm-software/storm-ops/commit/fb8ab0609))
53
+
54
+ ### Updated Dependencies
55
+
56
+ - Updated prettier to 0.47.2
57
+ - Updated esbuild to 0.37.2
58
+ - Updated esbuild to 0.37.2
59
+ - Updated unbuild to 0.43.2
60
+ - Updated unbuild to 0.43.2
61
+
5
62
  ## [1.269.1](https://github.com/storm-software/storm-ops/releases/tag/workspace-tools%401.269.1) (2025-05-05)
6
63
 
7
64
  ### Miscellaneous
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.269.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)
24
+ [![Version](https://img.shields.io/badge/version-1.269.2-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 -->
@@ -0,0 +1,467 @@
1
+ import {
2
+ pnpmCatalogUpdate
3
+ } from "./chunk-HMJTTE4A.mjs";
4
+ import {
5
+ joinPaths
6
+ } from "./chunk-U7JFVMCK.mjs";
7
+
8
+ // src/executors/npm-publish/executor.ts
9
+ import {
10
+ detectPackageManager,
11
+ readJsonFile
12
+ } from "@nx/devkit";
13
+ import * as columnify from "columnify";
14
+ import { exec, execSync } from "node:child_process";
15
+ import { existsSync } from "node:fs";
16
+ import { relative } from "node:path";
17
+ import { env as appendLocalEnv } from "npm-run-path";
18
+ var LARGE_BUFFER = 1024 * 1e6;
19
+ function processEnv(color) {
20
+ const env = {
21
+ ...process.env,
22
+ ...appendLocalEnv()
23
+ };
24
+ if (color) {
25
+ env.FORCE_COLOR = `${color}`;
26
+ }
27
+ return env;
28
+ }
29
+ async function npmPublishExecutorFn(options, context) {
30
+ const pm = detectPackageManager();
31
+ const isDryRun = process.env.NX_DRY_RUN === "true" || options.dryRun || false;
32
+ const projectConfig = context.projectsConfigurations.projects[context.projectName];
33
+ const packageRoot = joinPaths(
34
+ context.root,
35
+ options.packageRoot ?? projectConfig.root
36
+ );
37
+ const packageJsonPath = joinPaths(packageRoot, "package.json");
38
+ const packageJson = readJsonFile(packageJsonPath);
39
+ const packageName = packageJson.name;
40
+ await pnpmCatalogUpdate(packageRoot, context.root);
41
+ const packageTxt = packageName === context.projectName ? `package "${packageName}"` : `package "${packageName}" from project "${context.projectName}"`;
42
+ if (packageJson.private === true) {
43
+ console.warn(
44
+ `Skipped ${packageTxt}, because it has \`"private": true\` in ${packageJsonPath}`
45
+ );
46
+ return {
47
+ success: true
48
+ };
49
+ }
50
+ const warnFn = (message) => {
51
+ console.log(message);
52
+ };
53
+ const { registry, tag, registryConfigKey } = await parseRegistryOptions(
54
+ context.root,
55
+ {
56
+ packageRoot,
57
+ packageJson
58
+ },
59
+ {
60
+ registry: options.registry,
61
+ tag: options.tag
62
+ },
63
+ warnFn
64
+ );
65
+ const npmViewCommandSegments = [
66
+ `npm view ${packageName} versions dist-tags --json --"${registryConfigKey}=${registry}"`
67
+ ];
68
+ const npmDistTagAddCommandSegments = [
69
+ `npm dist-tag add ${packageName}@${packageJson.version} ${tag} --"${registryConfigKey}=${registry}"`
70
+ ];
71
+ if (!isDryRun && !options.firstRelease) {
72
+ const currentVersion = packageJson.version;
73
+ try {
74
+ const result = execSync(npmViewCommandSegments.join(" "), {
75
+ env: processEnv(true),
76
+ cwd: context.root,
77
+ stdio: ["ignore", "pipe", "pipe"],
78
+ windowsHide: false
79
+ });
80
+ const resultJson = JSON.parse(result.toString());
81
+ const distTags = resultJson["dist-tags"] || {};
82
+ if (distTags[tag] === currentVersion) {
83
+ console.warn(
84
+ `Skipped ${packageTxt} because v${currentVersion} already exists in ${registry} with tag "${tag}"`
85
+ );
86
+ return {
87
+ success: true
88
+ };
89
+ }
90
+ const versions = Array.isArray(resultJson.versions) ? resultJson.versions : [resultJson.versions];
91
+ if (versions.includes(currentVersion)) {
92
+ try {
93
+ if (!isDryRun) {
94
+ execSync(npmDistTagAddCommandSegments.join(" "), {
95
+ env: processEnv(true),
96
+ cwd: context.root,
97
+ stdio: "ignore",
98
+ windowsHide: false
99
+ });
100
+ console.log(
101
+ `Added the dist-tag ${tag} to v${currentVersion} for registry ${registry}.
102
+ `
103
+ );
104
+ } else {
105
+ console.log(
106
+ `Would add the dist-tag ${tag} to v${currentVersion} for registry ${registry}, but "[dry-run]" was set.
107
+ `
108
+ );
109
+ }
110
+ return {
111
+ success: true
112
+ };
113
+ } catch (err) {
114
+ try {
115
+ const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
116
+ if (!(stdoutData.error?.code?.includes("E404") && stdoutData.error?.summary?.includes("no such package available")) && !(err.stderr?.toString().includes("E404") && err.stderr?.toString().includes("no such package available"))) {
117
+ console.error("npm dist-tag add error:");
118
+ if (stdoutData.error.summary) {
119
+ console.error(stdoutData.error.summary);
120
+ }
121
+ if (stdoutData.error.detail) {
122
+ console.error(stdoutData.error.detail);
123
+ }
124
+ if (context.isVerbose) {
125
+ console.error("npm dist-tag add stdout:");
126
+ console.error(JSON.stringify(stdoutData, null, 2));
127
+ }
128
+ return {
129
+ success: false
130
+ };
131
+ }
132
+ } catch (err2) {
133
+ console.error(
134
+ "Something unexpected went wrong when processing the npm dist-tag add output\n",
135
+ err2
136
+ );
137
+ return {
138
+ success: false
139
+ };
140
+ }
141
+ }
142
+ }
143
+ } catch (err) {
144
+ const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
145
+ if (!(stdoutData.error?.code?.includes("E404") && stdoutData.error?.summary?.toLowerCase().includes("not found")) && !(err.stderr?.toString().includes("E404") && err.stderr?.toString().toLowerCase().includes("not found"))) {
146
+ console.error(
147
+ `Something unexpected went wrong when checking for existing dist-tags.
148
+ `,
149
+ err
150
+ );
151
+ return {
152
+ success: false
153
+ };
154
+ }
155
+ }
156
+ }
157
+ if (options.firstRelease && context.isVerbose) {
158
+ console.log("Skipped npm view because --first-release was set");
159
+ }
160
+ const publishCommandSegments = [
161
+ pm === "bun" ? (
162
+ // Unlike npm, bun publish does not support a custom registryConfigKey option
163
+ `bun publish --cwd="${packageRoot}" --json --registry="${registry}" --tag=${tag}`
164
+ ) : pm === "pnpm" ? (
165
+ // Unlike npm, pnpm publish does not support a custom registryConfigKey option, and will error on uncommitted changes by default if --no-git-checks is not set
166
+ `pnpm publish "${packageRoot}" --json --registry="${registry}" --tag=${tag} --no-git-checks`
167
+ ) : `npm publish "${packageRoot}" --json --"${registryConfigKey}=${registry}" --tag=${tag}`
168
+ ];
169
+ if (options.otp) {
170
+ publishCommandSegments.push(`--otp=${options.otp}`);
171
+ }
172
+ publishCommandSegments.push(`--access=public`);
173
+ if (isDryRun) {
174
+ publishCommandSegments.push(`--dry-run`);
175
+ }
176
+ try {
177
+ const output = execSync(publishCommandSegments.join(" "), {
178
+ maxBuffer: LARGE_BUFFER,
179
+ env: processEnv(true),
180
+ cwd: context.root,
181
+ stdio: ["ignore", "pipe", "pipe"],
182
+ windowsHide: false
183
+ });
184
+ const dryRunVersionPlaceholder = "X.X.X-dry-run";
185
+ const publishSummaryMessage = isDryRun ? `Would publish to ${registry} with tag "${tag}", but "[dry-run]" was set` : `Published to ${registry} with tag "${tag}"`;
186
+ if (pm === "bun") {
187
+ let outputStr = output.toString();
188
+ if (isDryRun) {
189
+ outputStr = outputStr.replace(
190
+ new RegExp(`${packageJson.name}@${packageJson.version}`, "g"),
191
+ `${packageJson.name}@${dryRunVersionPlaceholder}`
192
+ );
193
+ }
194
+ console.log(outputStr);
195
+ console.log(publishSummaryMessage);
196
+ return {
197
+ success: true
198
+ };
199
+ }
200
+ const { beforeJsonData, jsonData, afterJsonData } = extractNpmPublishJsonData(output.toString());
201
+ if (!jsonData) {
202
+ console.error(
203
+ `The ${pm} publish output data could not be extracted. Please report this issue on https://github.com/nrwl/nx`
204
+ );
205
+ return {
206
+ success: false
207
+ };
208
+ }
209
+ if (isDryRun) {
210
+ for (const [key, val] of Object.entries(jsonData)) {
211
+ if (typeof val !== "string") {
212
+ continue;
213
+ }
214
+ jsonData[key] = val.replace(
215
+ new RegExp(packageJson.version, "g"),
216
+ dryRunVersionPlaceholder
217
+ );
218
+ }
219
+ }
220
+ if (typeof beforeJsonData === "string" && beforeJsonData.trim().length > 0) {
221
+ console.log(beforeJsonData);
222
+ }
223
+ logTar(jsonData);
224
+ if (typeof afterJsonData === "string" && afterJsonData.trim().length > 0) {
225
+ console.log(afterJsonData);
226
+ }
227
+ console.log(publishSummaryMessage);
228
+ return {
229
+ success: true
230
+ };
231
+ } catch (err) {
232
+ try {
233
+ if (pm === "bun") {
234
+ console.error(`bun publish error:`);
235
+ console.error(err.stderr?.toString() || "");
236
+ console.error(err.stdout?.toString() || "");
237
+ return {
238
+ success: false
239
+ };
240
+ }
241
+ const stdoutData = JSON.parse(err.stdout?.toString() || "{}");
242
+ console.error(`${pm} publish error:`);
243
+ if (stdoutData.error?.summary) {
244
+ console.error(stdoutData.error.summary);
245
+ }
246
+ if (stdoutData.error?.detail) {
247
+ console.error(stdoutData.error.detail);
248
+ }
249
+ if (context.isVerbose) {
250
+ console.error(`${pm} publish stdout:`);
251
+ console.error(JSON.stringify(stdoutData, null, 2));
252
+ }
253
+ if (!stdoutData.error) {
254
+ throw err;
255
+ }
256
+ return {
257
+ success: false
258
+ };
259
+ } catch (err2) {
260
+ console.error(
261
+ `Something unexpected went wrong when processing the ${pm} publish output
262
+ `,
263
+ err2
264
+ );
265
+ return {
266
+ success: false
267
+ };
268
+ }
269
+ }
270
+ }
271
+ async function parseRegistryOptions(cwd, pkg, options, logWarnFn = console.warn) {
272
+ const npmRcPath = joinPaths(pkg.packageRoot, ".npmrc");
273
+ if (existsSync(npmRcPath)) {
274
+ const relativeNpmRcPath = relative(cwd, npmRcPath);
275
+ logWarnFn(
276
+ `
277
+ Ignoring .npmrc file detected in the package root: ${relativeNpmRcPath}. Nested .npmrc files are not supported by npm. Only the .npmrc file at the root of the workspace will be used. To customize the registry or tag for specific packages, see https://nx.dev/recipes/nx-release/configure-custom-registries
278
+ `
279
+ );
280
+ }
281
+ const scope = pkg.packageJson.name.startsWith("@") ? pkg.packageJson.name.split("/")[0] : "";
282
+ const registryConfigKey = scope ? `${scope}:registry` : "registry";
283
+ const publishConfigRegistry = pkg.packageJson.publishConfig?.[registryConfigKey];
284
+ if (publishConfigRegistry || pkg.packageJson.publishConfig?.registry) {
285
+ const relativePackageJsonPath = relative(
286
+ cwd,
287
+ joinPaths(pkg.packageRoot, "package.json")
288
+ );
289
+ if (options.registry) {
290
+ logWarnFn(
291
+ `
292
+ Registry detected in the 'publishConfig' of the package manifest: ${relativePackageJsonPath}. This will override your registry option set in the project configuration or passed via the --registry argument, which is why configuring the registry with 'publishConfig' is not recommended. For details, see https://nx.dev/recipes/nx-release/configure-custom-registries
293
+ `
294
+ );
295
+ } else {
296
+ logWarnFn(
297
+ `
298
+ Registry detected in the 'publishConfig' of the package manifest: ${relativePackageJsonPath}. Configuring the registry in this way is not recommended because it prevents the registry from being overridden in project configuration or via the --registry argument. To customize the registry for specific packages, see https://nx.dev/recipes/nx-release/configure-custom-registries
299
+ `
300
+ );
301
+ }
302
+ }
303
+ const registry = (
304
+ // `npm publish` will always use the publishConfig registry if it exists, even over the --registry arg
305
+ publishConfigRegistry || options.registry || await getNpmRegistry(cwd, scope)
306
+ );
307
+ const tag = options.tag || await getNpmTag(cwd);
308
+ if (!registry || !tag) {
309
+ throw new Error(
310
+ `The registry and tag options are required. Please provide them in the project configuration or via the --registry and --tag arguments.`
311
+ );
312
+ }
313
+ return { registry, tag, registryConfigKey };
314
+ }
315
+ async function getNpmRegistry(cwd, scope) {
316
+ let registry;
317
+ if (scope) {
318
+ registry = await getNpmConfigValue(`${scope}:registry`, cwd);
319
+ }
320
+ if (!registry) {
321
+ registry = await getNpmConfigValue("registry", cwd);
322
+ }
323
+ return registry;
324
+ }
325
+ async function getNpmTag(cwd) {
326
+ return getNpmConfigValue("tag", cwd);
327
+ }
328
+ async function getNpmConfigValue(key, cwd) {
329
+ try {
330
+ const result = await execAsync(`npm config get ${key}`, cwd);
331
+ return result === "undefined" ? void 0 : result;
332
+ } catch (_) {
333
+ return Promise.resolve(void 0);
334
+ }
335
+ }
336
+ async function execAsync(command, cwd) {
337
+ return new Promise((resolve, reject) => {
338
+ exec(command, { cwd, windowsHide: false }, (error, stdout, stderr) => {
339
+ if (error) {
340
+ return reject((stderr ? `${stderr}
341
+ ` : "") + error);
342
+ }
343
+ return resolve(stdout.trim());
344
+ });
345
+ });
346
+ }
347
+ var expectedNpmPublishJsonKeys = [
348
+ "id",
349
+ "name",
350
+ "version",
351
+ "size",
352
+ "filename"
353
+ ];
354
+ function extractNpmPublishJsonData(str) {
355
+ const jsonMatches = str.match(/{(?:[^{}]|{[^{}]*})*}/g);
356
+ if (jsonMatches) {
357
+ for (const match of jsonMatches) {
358
+ if (!expectedNpmPublishJsonKeys.every((key) => str.includes(key))) {
359
+ continue;
360
+ }
361
+ try {
362
+ const parsedJson = JSON.parse(match);
363
+ if (!expectedNpmPublishJsonKeys.every(
364
+ (key) => parsedJson[key] !== void 0
365
+ )) {
366
+ continue;
367
+ }
368
+ const jsonStartIndex = str.indexOf(match);
369
+ return {
370
+ beforeJsonData: str.slice(0, jsonStartIndex),
371
+ jsonData: parsedJson,
372
+ afterJsonData: str.slice(jsonStartIndex + match.length)
373
+ };
374
+ } catch {
375
+ }
376
+ }
377
+ }
378
+ return {
379
+ beforeJsonData: str,
380
+ jsonData: null,
381
+ afterJsonData: ""
382
+ };
383
+ }
384
+ var formatBytes = (bytes, space = true) => {
385
+ let spacer = "";
386
+ if (space) {
387
+ spacer = " ";
388
+ }
389
+ if (bytes < 1e3) {
390
+ return `${bytes}${spacer}B`;
391
+ }
392
+ if (bytes < 1e6) {
393
+ return `${(bytes / 1e3).toFixed(1)}${spacer}kB`;
394
+ }
395
+ if (bytes < 1e9) {
396
+ return `${(bytes / 1e6).toFixed(1)}${spacer}MB`;
397
+ }
398
+ return `${(bytes / 1e9).toFixed(1)}${spacer}GB`;
399
+ };
400
+ var logTar = (tarball, opts = {}) => {
401
+ const { unicode = true } = opts;
402
+ console.log("");
403
+ console.log(
404
+ `${unicode ? "\u{1F4E6} " : "package:"} ${tarball.name}@${tarball.version}`
405
+ );
406
+ console.log("=== Tarball Contents ===");
407
+ if (tarball.files.length) {
408
+ console.log("");
409
+ const columnData = columnify(
410
+ tarball.files.map((f) => {
411
+ const bytes = formatBytes(f.size, false);
412
+ return /^node_modules\//.test(f.path) ? null : { path: f.path, size: `${bytes}` };
413
+ }).filter((f) => f),
414
+ {
415
+ include: ["size", "path"],
416
+ showHeaders: false
417
+ }
418
+ );
419
+ columnData.split("\n").forEach((line) => {
420
+ console.log(line);
421
+ });
422
+ }
423
+ if (tarball.bundled.length) {
424
+ console.log("=== Bundled Dependencies ===");
425
+ tarball.bundled.forEach((name) => console.log("", name));
426
+ }
427
+ console.log("=== Tarball Details ===");
428
+ console.log(
429
+ columnify(
430
+ [
431
+ { name: "name:", value: tarball.name },
432
+ { name: "version:", value: tarball.version },
433
+ tarball.filename && { name: "filename:", value: tarball.filename },
434
+ { name: "package size:", value: formatBytes(tarball.size) },
435
+ { name: "unpacked size:", value: formatBytes(tarball.unpackedSize) },
436
+ { name: "shasum:", value: tarball.shasum },
437
+ {
438
+ name: "integrity:",
439
+ value: tarball.integrity.toString().slice(0, 20) + "[...]" + tarball.integrity.toString().slice(80)
440
+ },
441
+ tarball.bundled.length && {
442
+ name: "bundled deps:",
443
+ value: tarball.bundled.length
444
+ },
445
+ tarball.bundled.length && {
446
+ name: "bundled files:",
447
+ value: tarball.entryCount - tarball.files.length
448
+ },
449
+ tarball.bundled.length && {
450
+ name: "own files:",
451
+ value: tarball.files.length
452
+ },
453
+ { name: "total files:", value: tarball.entryCount }
454
+ ].filter((x) => x),
455
+ {
456
+ include: ["name", "value"],
457
+ showHeaders: false
458
+ }
459
+ )
460
+ );
461
+ console.log("", "");
462
+ };
463
+
464
+ export {
465
+ LARGE_BUFFER,
466
+ npmPublishExecutorFn
467
+ };