@storm-software/workspace-tools 1.263.1 → 1.264.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 (146) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +12 -30
  3. package/dist/{chunk-G6GGPUG7.mjs → chunk-267XQYEI.mjs} +4 -4
  4. package/dist/{chunk-2WTKQCPA.mjs → chunk-2BPV2XV2.mjs} +1 -1
  5. package/dist/{chunk-GCN3NUF6.mjs → chunk-3FTFBAIV.mjs} +1 -1
  6. package/dist/{chunk-OQ32KFGA.mjs → chunk-3PWCELL5.mjs} +2 -2
  7. package/dist/{chunk-IT3ENPW3.mjs → chunk-3RLLSZI3.mjs} +3 -3
  8. package/dist/{chunk-XEHJM6RO.mjs → chunk-5CZXBNEE.mjs} +1 -1
  9. package/dist/{chunk-VOIYJ67D.mjs → chunk-5DWBECCN.mjs} +4 -4
  10. package/dist/{chunk-GPOYI6OO.mjs → chunk-77KNPIOO.mjs} +3 -3
  11. package/dist/{chunk-4PDLEPIC.mjs → chunk-7ENGREV2.mjs} +1 -1
  12. package/dist/{chunk-IGJN2SBZ.mjs → chunk-AD4BVP7F.mjs} +2 -2
  13. package/dist/{chunk-HASYGI6W.mjs → chunk-ATIBREWM.mjs} +1 -1
  14. package/dist/{chunk-5JPH5VCU.mjs → chunk-AWKIWCLR.mjs} +2 -2
  15. package/dist/{chunk-GRU4UEE7.mjs → chunk-BMNXBEWE.mjs} +3 -3
  16. package/dist/{chunk-BV32SZPV.mjs → chunk-EVQJFIA7.mjs} +3 -3
  17. package/dist/{chunk-3I74ESKM.mjs → chunk-FIJJTQKT.mjs} +3 -3
  18. package/dist/{chunk-2PKZRCQJ.mjs → chunk-FR3YQN55.mjs} +2 -2
  19. package/dist/{chunk-U6DRC3BT.mjs → chunk-G6VTRIV6.mjs} +4 -4
  20. package/dist/{chunk-STVTZJIX.mjs → chunk-GKFEPODO.mjs} +3 -3
  21. package/dist/{chunk-6YMGUA6X.mjs → chunk-H5VTYV4U.mjs} +2 -2
  22. package/dist/{chunk-J53HKGFM.mjs → chunk-HUVBVDJ7.mjs} +1 -1
  23. package/dist/{chunk-L6CV744X.mjs → chunk-IXZ3PGBP.mjs} +3 -3
  24. package/dist/{chunk-GHJGKUBW.mjs → chunk-JIAGNEII.mjs} +1 -1
  25. package/dist/{chunk-H4RWKANW.mjs → chunk-KTJM6G4K.mjs} +1 -1
  26. package/dist/{chunk-TAJU54DW.mjs → chunk-LZ4WXOF5.mjs} +3 -3
  27. package/dist/{chunk-RGZAGFUD.mjs → chunk-MDK5L6VS.mjs} +4 -4
  28. package/dist/{chunk-3ABED6KX.mjs → chunk-NZAGHP4Q.mjs} +4 -4
  29. package/dist/{chunk-6QKCP4DS.js → chunk-PD4CDI7L.js} +296 -41
  30. package/dist/{chunk-R2BMSX6J.mjs → chunk-RLG36VMZ.mjs} +3 -3
  31. package/dist/{chunk-XIS3TY42.mjs → chunk-RMNEVFW4.mjs} +4 -4
  32. package/dist/{chunk-3XR4FSEA.mjs → chunk-V4QUJRZH.mjs} +4 -4
  33. package/dist/{chunk-AOOHLS72.mjs → chunk-VJJBBVYU.mjs} +3 -3
  34. package/dist/{chunk-EF7U4632.mjs → chunk-VYHRGNJQ.mjs} +306 -51
  35. package/dist/{chunk-OBUTMEEY.mjs → chunk-XB6ATVWM.mjs} +3 -3
  36. package/dist/{chunk-OVLYU6HE.mjs → chunk-XBRJIYCS.mjs} +2 -2
  37. package/dist/{chunk-HY43JWZ7.mjs → chunk-XDVGK64G.mjs} +2 -2
  38. package/dist/{chunk-RULS5ZOT.mjs → chunk-YBDZ7EWU.mjs} +2 -2
  39. package/dist/{chunk-BGSGM2KX.mjs → chunk-YPUNRGTW.mjs} +3 -3
  40. package/dist/{chunk-SF477J3B.mjs → chunk-YZLAY7R4.mjs} +3 -3
  41. package/dist/{chunk-WJTTZD3M.mjs → chunk-ZETTXDZO.mjs} +1 -1
  42. package/dist/{chunk-DGI7OQYG.mjs → chunk-ZPN57TH7.mjs} +4 -4
  43. package/dist/{chunk-B5OPGMAP.mjs → chunk-ZUYLHO4U.mjs} +1 -1
  44. package/dist/executors.d.mts +0 -1
  45. package/dist/executors.d.ts +0 -1
  46. package/dist/executors.js +5 -10
  47. package/dist/executors.mjs +23 -28
  48. package/dist/generators.js +5 -5
  49. package/dist/generators.mjs +20 -20
  50. package/dist/index.d.mts +0 -1
  51. package/dist/index.d.ts +0 -1
  52. package/dist/index.js +10 -15
  53. package/dist/index.mjs +45 -50
  54. package/dist/src/base/base-executor.mjs +6 -6
  55. package/dist/src/base/base-executor.untyped.mjs +1 -1
  56. package/dist/src/base/base-generator.mjs +6 -6
  57. package/dist/src/base/base-generator.untyped.mjs +1 -1
  58. package/dist/src/base/cargo-base-executor.untyped.mjs +1 -1
  59. package/dist/src/base/index.mjs +10 -10
  60. package/dist/src/base/typescript-build-executor.untyped.mjs +2 -2
  61. package/dist/src/base/typescript-library-generator.untyped.mjs +1 -1
  62. package/dist/src/executors/cargo-build/executor.mjs +8 -8
  63. package/dist/src/executors/cargo-build/untyped.mjs +1 -1
  64. package/dist/src/executors/cargo-check/executor.mjs +8 -8
  65. package/dist/src/executors/cargo-check/untyped.mjs +1 -1
  66. package/dist/src/executors/cargo-clippy/executor.mjs +8 -8
  67. package/dist/src/executors/cargo-clippy/untyped.mjs +1 -1
  68. package/dist/src/executors/cargo-doc/executor.mjs +8 -8
  69. package/dist/src/executors/cargo-doc/untyped.mjs +1 -1
  70. package/dist/src/executors/cargo-format/executor.mjs +8 -8
  71. package/dist/src/executors/cargo-format/untyped.mjs +1 -1
  72. package/dist/src/executors/cargo-publish/executor.mjs +3 -3
  73. package/dist/src/executors/cargo-publish/untyped.mjs +1 -1
  74. package/dist/src/executors/clean-package/executor.mjs +6 -6
  75. package/dist/src/executors/clean-package/untyped.mjs +1 -1
  76. package/dist/src/executors/esbuild/executor.js +2 -3
  77. package/dist/src/executors/esbuild/executor.mjs +7 -8
  78. package/dist/src/executors/esbuild/untyped.mjs +2 -2
  79. package/dist/src/executors/npm-publish/executor.mjs +4 -4
  80. package/dist/src/executors/npm-publish/untyped.mjs +1 -1
  81. package/dist/src/executors/size-limit/executor.mjs +7 -7
  82. package/dist/src/executors/size-limit/untyped.mjs +1 -1
  83. package/dist/src/executors/typia/executor.mjs +7 -7
  84. package/dist/src/executors/typia/untyped.mjs +1 -1
  85. package/dist/src/executors/unbuild/executor.mjs +7 -7
  86. package/dist/src/executors/unbuild/untyped.mjs +2 -2
  87. package/dist/src/generators/browser-library/generator.mjs +9 -9
  88. package/dist/src/generators/browser-library/untyped.mjs +1 -1
  89. package/dist/src/generators/config-schema/generator.mjs +7 -7
  90. package/dist/src/generators/config-schema/untyped.mjs +1 -1
  91. package/dist/src/generators/init/init.mjs +2 -2
  92. package/dist/src/generators/init/untyped.mjs +1 -1
  93. package/dist/src/generators/neutral-library/generator.mjs +9 -9
  94. package/dist/src/generators/neutral-library/untyped.mjs +1 -1
  95. package/dist/src/generators/node-library/generator.mjs +9 -9
  96. package/dist/src/generators/node-library/untyped.mjs +1 -1
  97. package/dist/src/generators/preset/generator.mjs +7 -7
  98. package/dist/src/generators/preset/untyped.mjs +1 -1
  99. package/dist/src/generators/release-version/generator.mjs +6 -6
  100. package/dist/src/generators/release-version/untyped.mjs +1 -1
  101. package/dist/src/plugins/rust/cargo-toml.mjs +4 -4
  102. package/dist/src/plugins/rust/index.mjs +4 -4
  103. package/dist/src/plugins/typescript/index.mjs +4 -4
  104. package/dist/src/plugins/typescript/project-config.mjs +4 -4
  105. package/dist/src/plugins/typescript/tsup.mjs +2 -2
  106. package/dist/src/plugins/typescript/untyped-schema.mjs +2 -2
  107. package/dist/src/types.mjs +1 -1
  108. package/dist/src/utils/apply-workspace-tokens.mjs +4 -4
  109. package/dist/src/utils/cargo.mjs +2 -2
  110. package/dist/src/utils/create-cli-options.mjs +2 -2
  111. package/dist/src/utils/get-project-configurations.mjs +4 -4
  112. package/dist/src/utils/index.mjs +14 -14
  113. package/dist/src/utils/lock-file.mjs +2 -2
  114. package/dist/src/utils/package-helpers.mjs +4 -4
  115. package/dist/src/utils/plugin-helpers.mjs +3 -3
  116. package/dist/src/utils/pnpm-deps-update.mjs +3 -3
  117. package/dist/src/utils/project-tags.mjs +2 -2
  118. package/dist/src/utils/toml.mjs +2 -2
  119. package/dist/src/utils/typia-transform.mjs +2 -2
  120. package/dist/src/utils/versions.mjs +1 -1
  121. package/executors.json +0 -5
  122. package/package.json +3 -6
  123. package/dist/chunk-55IQXVOQ.js +0 -308
  124. package/dist/chunk-IFSORSAN.js +0 -304
  125. package/dist/chunk-SE2XSR7P.mjs +0 -304
  126. package/dist/chunk-UFPTODUJ.mjs +0 -308
  127. package/dist/executor-BDvqiAmr.d.ts +0 -144
  128. package/dist/executor-KAQdKP88.d.mts +0 -144
  129. package/dist/src/executors/tsdown/executor.d.mts +0 -4
  130. package/dist/src/executors/tsdown/executor.d.ts +0 -4
  131. package/dist/src/executors/tsdown/executor.js +0 -15
  132. package/dist/src/executors/tsdown/executor.mjs +0 -15
  133. package/dist/src/executors/tsdown/schema.d.ts +0 -135
  134. package/dist/src/executors/tsdown/schema.json +0 -174
  135. package/dist/src/executors/tsdown/schema.md +0 -126
  136. package/dist/src/executors/tsdown/untyped.d.mts +0 -5
  137. package/dist/src/executors/tsdown/untyped.d.ts +0 -5
  138. package/dist/src/executors/tsdown/untyped.js +0 -19
  139. package/dist/src/executors/tsdown/untyped.mjs +0 -19
  140. package/dist/src/plugins/typescript/tsdown.d.mts +0 -7
  141. package/dist/src/plugins/typescript/tsdown.d.ts +0 -7
  142. package/dist/src/plugins/typescript/tsdown.js +0 -159
  143. package/dist/src/plugins/typescript/tsdown.mjs +0 -159
  144. package/docs/api/executors/tsdown/schema.md +0 -126
  145. /package/dist/{chunk-3J53KHVV.js → chunk-7VDOGZYO.js} +0 -0
  146. /package/dist/{chunk-V7YZ3666.mjs → chunk-BLX5SLPC.mjs} +0 -0
@@ -1,126 +0,0 @@
1
-
2
- <!-- Generated by @storm-software/untyped -->
3
- <!-- Do not edit this file directly -->
4
-
5
- # TSDown Executor
6
-
7
- ## `outputPath`
8
- - **Type**: `string`
9
- - **Default**: `"dist/{projectRoot}"`
10
-
11
- > Output Path
12
-
13
-
14
- The output path for the build
15
-
16
-
17
- ## `entry`
18
- - **Type**: `array`
19
- - **Default**: `["{sourceRoot}/index.ts"]`
20
-
21
- > Entry File(s)
22
-
23
-
24
- The entry file or files to build
25
-
26
-
27
- ## `tsconfig`
28
- - **Type**: `string`
29
- - **Default**: `"{projectRoot}/tsconfig.json"`
30
-
31
- > TSConfig Path
32
-
33
-
34
- The path to the tsconfig file
35
-
36
-
37
- ## `bundle`
38
- - **Type**: `boolean`
39
-
40
- > Bundle
41
-
42
-
43
- Bundle the output
44
-
45
-
46
- ## `minify`
47
- - **Type**: `boolean`
48
-
49
- > Minify
50
-
51
-
52
- Minify the output
53
-
54
-
55
- ## `debug`
56
- - **Type**: `boolean`
57
-
58
- > Debug
59
-
60
-
61
- Debug the output
62
-
63
-
64
- ## `sourcemap`
65
- - **Type**: `boolean`
66
-
67
- > Sourcemap
68
-
69
-
70
- Generate a sourcemap
71
-
72
-
73
- ## `silent`
74
- - **Type**: `boolean`
75
- - **Default**: `false`
76
-
77
- > Silent
78
-
79
-
80
- Should the build run silently - only report errors back to the user
81
-
82
-
83
- ## `target`
84
- - **Type**: `string`
85
- - **Default**: `"esnext"`
86
-
87
- > Target
88
-
89
-
90
- The target to build
91
-
92
-
93
- ## `format`
94
- - **Type**: `array`
95
- - **Default**: `["cjs","esm"]`
96
-
97
- > Format
98
-
99
-
100
- The format to build
101
-
102
-
103
- ## `platform`
104
- - **Type**: `string`
105
- - **Default**: `"neutral"`
106
-
107
- > Platform
108
-
109
-
110
- The platform to build
111
-
112
-
113
- ## `external`
114
- - **Type**: `array`
115
- - **Default**: `[]`
116
-
117
- > External
118
-
119
-
120
- The external dependencies
121
-
122
-
123
- ## `define`
124
-
125
- ## `env`
126
-
@@ -1,5 +0,0 @@
1
- import * as untyped from 'untyped';
2
-
3
- declare const _default: untyped.SchemaDefinition;
4
-
5
- export { _default as default };
@@ -1,5 +0,0 @@
1
- import * as untyped from 'untyped';
2
-
3
- declare const _default: untyped.SchemaDefinition;
4
-
5
- export { _default as default };
@@ -1,19 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkIWCQL3AQjs = require('../../../chunk-IWCQL3AQ.js');
4
- require('../../../chunk-I734UVDT.js');
5
- require('../../../chunk-3GQAWCBQ.js');
6
-
7
- // src/executors/tsdown/untyped.ts
8
- var _untyped = require('untyped');
9
- var untyped_default = _untyped.defineUntypedSchema.call(void 0, {
10
- ..._chunkIWCQL3AQjs.typescript_build_executor_untyped_default,
11
- $schema: {
12
- id: "TSDownExecutorSchema",
13
- title: "TSDown Executor",
14
- description: "A type definition for a tsdown executor schema"
15
- }
16
- });
17
-
18
-
19
- exports.default = untyped_default;
@@ -1,19 +0,0 @@
1
- import {
2
- typescript_build_executor_untyped_default
3
- } from "../../../chunk-XEHJM6RO.mjs";
4
- import "../../../chunk-DGC5L3Z7.mjs";
5
- import "../../../chunk-2WTKQCPA.mjs";
6
-
7
- // src/executors/tsdown/untyped.ts
8
- import { defineUntypedSchema } from "untyped";
9
- var untyped_default = defineUntypedSchema({
10
- ...typescript_build_executor_untyped_default,
11
- $schema: {
12
- id: "TSDownExecutorSchema",
13
- title: "TSDown Executor",
14
- description: "A type definition for a tsdown executor schema"
15
- }
16
- });
17
- export {
18
- untyped_default as default
19
- };
@@ -1,7 +0,0 @@
1
- import { CreateNodesV2 } from '@nx/devkit';
2
-
3
- declare const name = "storm-software/typescript/tsdown";
4
- type TsDownPluginOptions = object;
5
- declare const createNodesV2: CreateNodesV2<TsDownPluginOptions>;
6
-
7
- export { type TsDownPluginOptions, createNodesV2, name };
@@ -1,7 +0,0 @@
1
- import { CreateNodesV2 } from '@nx/devkit';
2
-
3
- declare const name = "storm-software/typescript/tsdown";
4
- type TsDownPluginOptions = object;
5
- declare const createNodesV2: CreateNodesV2<TsDownPluginOptions>;
6
-
7
- export { type TsDownPluginOptions, createNodesV2, name };
@@ -1,159 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
-
3
- var _chunk7YRW5HNXjs = require('../../../chunk-7YRW5HNX.js');
4
-
5
-
6
- var _chunk3GQAWCBQjs = require('../../../chunk-3GQAWCBQ.js');
7
-
8
- // src/plugins/typescript/tsdown.ts
9
- var _devkit = require('@nx/devkit');
10
- var _fs = require('fs');
11
- var _path = require('path');
12
- var _nxjsonjs = require('nx/src/config/nx-json.js');
13
- var _packagejson = require('nx/src/utils/package-json');
14
- var name = "storm-software/typescript/tsdown";
15
- var createNodesV2 = [
16
- "**/tsdown.config.ts",
17
- async (configFiles, options, context) => {
18
- return await _devkit.createNodesFromFiles.call(void 0, (configFile, options2, context2) => {
19
- try {
20
- console.log(`Processing tsdown.config.ts file: ${configFile}`);
21
- const projectRoot = createProjectRoot(configFile, context2.workspaceRoot);
22
- if (!projectRoot) {
23
- console.error(`tsdown.config.ts file must be location in the project root directory: ${configFile}`);
24
- return {};
25
- }
26
- const packageJson = _devkit.readJsonFile.call(void 0, _path.join.call(void 0, projectRoot, "package.json"));
27
- if (!packageJson) {
28
- console.error(`No package.json found in project root: ${projectRoot}`);
29
- return {};
30
- }
31
- if (!_optionalChain([packageJson, 'access', _ => _.devDependencies, 'optionalAccess', _2 => _2.tsdown]) && !_optionalChain([packageJson, 'access', _3 => _3.dependencies, 'optionalAccess', _4 => _4.tsdown])) {
32
- console.warn(`No "tsdown" dependency or devDependency found in package.json: ${configFile}
33
- Please add it to your dependencies by running "pnpm add tsdown -D --filter="${packageJson.name}"`);
34
- }
35
- const project = createProjectFromPackageJsonNextToProjectJson(_path.join.call(void 0, projectRoot, "project.json"), packageJson);
36
- const nxJson = _nxjsonjs.readNxJson.call(void 0, context2.workspaceRoot);
37
- const targets = _packagejson.readTargetsFromPackageJson.call(void 0, packageJson, nxJson);
38
- let relativeRoot = projectRoot.replaceAll("\\", "/").replace(context2.workspaceRoot.replaceAll("\\", "/"), "");
39
- if (relativeRoot.startsWith("/")) {
40
- relativeRoot = relativeRoot.slice(1);
41
- }
42
- let relativeConfig = configFile.replaceAll(relativeRoot, "");
43
- while (relativeConfig.startsWith(".")) {
44
- relativeConfig = relativeConfig.slice(1);
45
- }
46
- while (relativeConfig.startsWith("/")) {
47
- relativeConfig = relativeConfig.slice(1);
48
- }
49
- targets["build-base"] ??= {
50
- cache: true,
51
- inputs: [
52
- `{workspaceRoot}/${configFile}`,
53
- "typescript",
54
- "^production"
55
- ],
56
- outputs: [
57
- "{projectRoot}/dist"
58
- ],
59
- executor: "nx:run-commands",
60
- dependsOn: [
61
- "build-untyped",
62
- "^build"
63
- ],
64
- options: {
65
- command: `tsdown --config="${relativeConfig}"`,
66
- cwd: relativeRoot
67
- }
68
- };
69
- targets.build ??= {
70
- cache: true,
71
- inputs: [
72
- "{workspaceRoot}/LICENSE",
73
- "{projectRoot}/dist",
74
- "{projectRoot}/*.md",
75
- "{projectRoot}/package.json"
76
- ],
77
- outputs: [
78
- "{workspaceRoot}/dist/{projectRoot}"
79
- ],
80
- executor: "nx:run-commands",
81
- dependsOn: [
82
- "build-base",
83
- "build-untyped",
84
- "^build"
85
- ],
86
- options: {
87
- commands: [
88
- `pnpm copyfiles LICENSE dist/${relativeRoot}`,
89
- `pnpm copyfiles --up=2 ./${relativeRoot}/*.md ./${relativeRoot}/package.json dist/${relativeRoot}`,
90
- `pnpm copyfiles --up=3 "./${relativeRoot}/dist/**/*" dist/${relativeRoot}/dist`
91
- ]
92
- }
93
- };
94
- targets.clean = {
95
- executor: "nx:run-commands",
96
- inputs: [
97
- `{workspaceRoot}/${configFile}`,
98
- "typescript",
99
- "^production"
100
- ],
101
- options: {
102
- commands: [
103
- `pnpm exec rimraf dist/${relativeRoot}`,
104
- `pnpm exec rimraf ${relativeRoot}/dist`
105
- ]
106
- }
107
- };
108
- _chunk7YRW5HNXjs.setDefaultProjectTags.call(void 0, project, name);
109
- const result = _optionalChain([project, 'optionalAccess', _5 => _5.name]) ? {
110
- projects: {
111
- [project.name]: {
112
- ...project,
113
- root: relativeRoot,
114
- targets
115
- }
116
- }
117
- } : {};
118
- console.log(`Writing Results for ${_nullishCoalesce(_optionalChain([project, 'optionalAccess', _6 => _6.name]), () => ( "missing name"))}`);
119
- console.log(result);
120
- return result;
121
- } catch (e) {
122
- console.error(e);
123
- return {};
124
- }
125
- }, configFiles, options, context);
126
- }
127
- ];
128
- function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
129
- const { nx, name: name2 } = packageJson;
130
- const root = _path.dirname.call(void 0, projectJsonPath);
131
- const projectJson = _devkit.readJsonFile.call(void 0, projectJsonPath);
132
- return {
133
- targets: {},
134
- tags: [],
135
- name: name2,
136
- ...nx,
137
- ...projectJson,
138
- root
139
- };
140
- }
141
- _chunk3GQAWCBQjs.__name.call(void 0, createProjectFromPackageJsonNextToProjectJson, "createProjectFromPackageJsonNextToProjectJson");
142
- function createProjectRoot(configPath, workspaceRoot) {
143
- try {
144
- const root = _path.dirname.call(void 0, configPath);
145
- const projectRoot = _path.join.call(void 0, workspaceRoot, root);
146
- if (!_fs.existsSync.call(void 0, _path.join.call(void 0, projectRoot, "package.json")) && !_fs.existsSync.call(void 0, _path.join.call(void 0, projectRoot, "project.json"))) {
147
- return null;
148
- }
149
- return projectRoot;
150
- } catch (e) {
151
- console.error(e);
152
- return null;
153
- }
154
- }
155
- _chunk3GQAWCBQjs.__name.call(void 0, createProjectRoot, "createProjectRoot");
156
-
157
-
158
-
159
- exports.createNodesV2 = createNodesV2; exports.name = name;
@@ -1,159 +0,0 @@
1
- import {
2
- setDefaultProjectTags
3
- } from "../../../chunk-J53HKGFM.mjs";
4
- import {
5
- __name
6
- } from "../../../chunk-2WTKQCPA.mjs";
7
-
8
- // src/plugins/typescript/tsdown.ts
9
- import { createNodesFromFiles, readJsonFile } from "@nx/devkit";
10
- import { existsSync } from "node:fs";
11
- import { dirname, join } from "node:path";
12
- import { readNxJson } from "nx/src/config/nx-json.js";
13
- import { readTargetsFromPackageJson } from "nx/src/utils/package-json";
14
- var name = "storm-software/typescript/tsdown";
15
- var createNodesV2 = [
16
- "**/tsdown.config.ts",
17
- async (configFiles, options, context) => {
18
- return await createNodesFromFiles((configFile, options2, context2) => {
19
- try {
20
- console.log(`Processing tsdown.config.ts file: ${configFile}`);
21
- const projectRoot = createProjectRoot(configFile, context2.workspaceRoot);
22
- if (!projectRoot) {
23
- console.error(`tsdown.config.ts file must be location in the project root directory: ${configFile}`);
24
- return {};
25
- }
26
- const packageJson = readJsonFile(join(projectRoot, "package.json"));
27
- if (!packageJson) {
28
- console.error(`No package.json found in project root: ${projectRoot}`);
29
- return {};
30
- }
31
- if (!packageJson.devDependencies?.tsdown && !packageJson.dependencies?.tsdown) {
32
- console.warn(`No "tsdown" dependency or devDependency found in package.json: ${configFile}
33
- Please add it to your dependencies by running "pnpm add tsdown -D --filter="${packageJson.name}"`);
34
- }
35
- const project = createProjectFromPackageJsonNextToProjectJson(join(projectRoot, "project.json"), packageJson);
36
- const nxJson = readNxJson(context2.workspaceRoot);
37
- const targets = readTargetsFromPackageJson(packageJson, nxJson);
38
- let relativeRoot = projectRoot.replaceAll("\\", "/").replace(context2.workspaceRoot.replaceAll("\\", "/"), "");
39
- if (relativeRoot.startsWith("/")) {
40
- relativeRoot = relativeRoot.slice(1);
41
- }
42
- let relativeConfig = configFile.replaceAll(relativeRoot, "");
43
- while (relativeConfig.startsWith(".")) {
44
- relativeConfig = relativeConfig.slice(1);
45
- }
46
- while (relativeConfig.startsWith("/")) {
47
- relativeConfig = relativeConfig.slice(1);
48
- }
49
- targets["build-base"] ??= {
50
- cache: true,
51
- inputs: [
52
- `{workspaceRoot}/${configFile}`,
53
- "typescript",
54
- "^production"
55
- ],
56
- outputs: [
57
- "{projectRoot}/dist"
58
- ],
59
- executor: "nx:run-commands",
60
- dependsOn: [
61
- "build-untyped",
62
- "^build"
63
- ],
64
- options: {
65
- command: `tsdown --config="${relativeConfig}"`,
66
- cwd: relativeRoot
67
- }
68
- };
69
- targets.build ??= {
70
- cache: true,
71
- inputs: [
72
- "{workspaceRoot}/LICENSE",
73
- "{projectRoot}/dist",
74
- "{projectRoot}/*.md",
75
- "{projectRoot}/package.json"
76
- ],
77
- outputs: [
78
- "{workspaceRoot}/dist/{projectRoot}"
79
- ],
80
- executor: "nx:run-commands",
81
- dependsOn: [
82
- "build-base",
83
- "build-untyped",
84
- "^build"
85
- ],
86
- options: {
87
- commands: [
88
- `pnpm copyfiles LICENSE dist/${relativeRoot}`,
89
- `pnpm copyfiles --up=2 ./${relativeRoot}/*.md ./${relativeRoot}/package.json dist/${relativeRoot}`,
90
- `pnpm copyfiles --up=3 "./${relativeRoot}/dist/**/*" dist/${relativeRoot}/dist`
91
- ]
92
- }
93
- };
94
- targets.clean = {
95
- executor: "nx:run-commands",
96
- inputs: [
97
- `{workspaceRoot}/${configFile}`,
98
- "typescript",
99
- "^production"
100
- ],
101
- options: {
102
- commands: [
103
- `pnpm exec rimraf dist/${relativeRoot}`,
104
- `pnpm exec rimraf ${relativeRoot}/dist`
105
- ]
106
- }
107
- };
108
- setDefaultProjectTags(project, name);
109
- const result = project?.name ? {
110
- projects: {
111
- [project.name]: {
112
- ...project,
113
- root: relativeRoot,
114
- targets
115
- }
116
- }
117
- } : {};
118
- console.log(`Writing Results for ${project?.name ?? "missing name"}`);
119
- console.log(result);
120
- return result;
121
- } catch (e) {
122
- console.error(e);
123
- return {};
124
- }
125
- }, configFiles, options, context);
126
- }
127
- ];
128
- function createProjectFromPackageJsonNextToProjectJson(projectJsonPath, packageJson) {
129
- const { nx, name: name2 } = packageJson;
130
- const root = dirname(projectJsonPath);
131
- const projectJson = readJsonFile(projectJsonPath);
132
- return {
133
- targets: {},
134
- tags: [],
135
- name: name2,
136
- ...nx,
137
- ...projectJson,
138
- root
139
- };
140
- }
141
- __name(createProjectFromPackageJsonNextToProjectJson, "createProjectFromPackageJsonNextToProjectJson");
142
- function createProjectRoot(configPath, workspaceRoot) {
143
- try {
144
- const root = dirname(configPath);
145
- const projectRoot = join(workspaceRoot, root);
146
- if (!existsSync(join(projectRoot, "package.json")) && !existsSync(join(projectRoot, "project.json"))) {
147
- return null;
148
- }
149
- return projectRoot;
150
- } catch (e) {
151
- console.error(e);
152
- return null;
153
- }
154
- }
155
- __name(createProjectRoot, "createProjectRoot");
156
- export {
157
- createNodesV2,
158
- name
159
- };
@@ -1,126 +0,0 @@
1
-
2
- <!-- Generated by @storm-software/untyped -->
3
- <!-- Do not edit this file directly -->
4
-
5
- # TSDown Executor
6
-
7
- ## `outputPath`
8
- - **Type**: `string`
9
- - **Default**: `"dist/{projectRoot}"`
10
-
11
- > Output Path
12
-
13
-
14
- The output path for the build
15
-
16
-
17
- ## `entry`
18
- - **Type**: `array`
19
- - **Default**: `["{sourceRoot}/index.ts"]`
20
-
21
- > Entry File(s)
22
-
23
-
24
- The entry file or files to build
25
-
26
-
27
- ## `tsconfig`
28
- - **Type**: `string`
29
- - **Default**: `"{projectRoot}/tsconfig.json"`
30
-
31
- > TSConfig Path
32
-
33
-
34
- The path to the tsconfig file
35
-
36
-
37
- ## `bundle`
38
- - **Type**: `boolean`
39
-
40
- > Bundle
41
-
42
-
43
- Bundle the output
44
-
45
-
46
- ## `minify`
47
- - **Type**: `boolean`
48
-
49
- > Minify
50
-
51
-
52
- Minify the output
53
-
54
-
55
- ## `debug`
56
- - **Type**: `boolean`
57
-
58
- > Debug
59
-
60
-
61
- Debug the output
62
-
63
-
64
- ## `sourcemap`
65
- - **Type**: `boolean`
66
-
67
- > Sourcemap
68
-
69
-
70
- Generate a sourcemap
71
-
72
-
73
- ## `silent`
74
- - **Type**: `boolean`
75
- - **Default**: `false`
76
-
77
- > Silent
78
-
79
-
80
- Should the build run silently - only report errors back to the user
81
-
82
-
83
- ## `target`
84
- - **Type**: `string`
85
- - **Default**: `"esnext"`
86
-
87
- > Target
88
-
89
-
90
- The target to build
91
-
92
-
93
- ## `format`
94
- - **Type**: `array`
95
- - **Default**: `["cjs","esm"]`
96
-
97
- > Format
98
-
99
-
100
- The format to build
101
-
102
-
103
- ## `platform`
104
- - **Type**: `string`
105
- - **Default**: `"neutral"`
106
-
107
- > Platform
108
-
109
-
110
- The platform to build
111
-
112
-
113
- ## `external`
114
- - **Type**: `array`
115
- - **Default**: `[]`
116
-
117
- > External
118
-
119
-
120
- The external dependencies
121
-
122
-
123
- ## `define`
124
-
125
- ## `env`
126
-
File without changes
File without changes