@storm-software/workspace-tools 1.263.2 → 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 (42) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +12 -30
  3. package/dist/{chunk-OAQP7HGX.js → chunk-PD4CDI7L.js} +295 -41
  4. package/dist/{chunk-NZBJ5BJT.mjs → chunk-VYHRGNJQ.mjs} +301 -47
  5. package/dist/executors.d.mts +0 -1
  6. package/dist/executors.d.ts +0 -1
  7. package/dist/executors.js +5 -10
  8. package/dist/executors.mjs +5 -10
  9. package/dist/generators.js +3 -3
  10. package/dist/generators.mjs +3 -3
  11. package/dist/index.d.mts +0 -1
  12. package/dist/index.d.ts +0 -1
  13. package/dist/index.js +8 -13
  14. package/dist/index.mjs +8 -13
  15. package/dist/src/executors/esbuild/executor.js +2 -3
  16. package/dist/src/executors/esbuild/executor.mjs +1 -2
  17. package/executors.json +0 -5
  18. package/package.json +3 -6
  19. package/dist/chunk-55IQXVOQ.js +0 -308
  20. package/dist/chunk-7W5P2GIE.mjs +0 -308
  21. package/dist/chunk-IFSORSAN.js +0 -304
  22. package/dist/chunk-TLRZHFVN.mjs +0 -304
  23. package/dist/executor-BDvqiAmr.d.ts +0 -144
  24. package/dist/executor-KAQdKP88.d.mts +0 -144
  25. package/dist/src/executors/tsdown/executor.d.mts +0 -4
  26. package/dist/src/executors/tsdown/executor.d.ts +0 -4
  27. package/dist/src/executors/tsdown/executor.js +0 -15
  28. package/dist/src/executors/tsdown/executor.mjs +0 -15
  29. package/dist/src/executors/tsdown/schema.d.ts +0 -135
  30. package/dist/src/executors/tsdown/schema.json +0 -174
  31. package/dist/src/executors/tsdown/schema.md +0 -126
  32. package/dist/src/executors/tsdown/untyped.d.mts +0 -5
  33. package/dist/src/executors/tsdown/untyped.d.ts +0 -5
  34. package/dist/src/executors/tsdown/untyped.js +0 -19
  35. package/dist/src/executors/tsdown/untyped.mjs +0 -19
  36. package/dist/src/plugins/typescript/tsdown.d.mts +0 -7
  37. package/dist/src/plugins/typescript/tsdown.d.ts +0 -7
  38. package/dist/src/plugins/typescript/tsdown.js +0 -159
  39. package/dist/src/plugins/typescript/tsdown.mjs +0 -159
  40. package/docs/api/executors/tsdown/schema.md +0 -126
  41. /package/dist/{chunk-3J53KHVV.js → chunk-7VDOGZYO.js} +0 -0
  42. /package/dist/{chunk-V7YZ3666.mjs → chunk-BLX5SLPC.mjs} +0 -0
@@ -1,159 +0,0 @@
1
- import {
2
- setDefaultProjectTags
3
- } from "../../../chunk-HUVBVDJ7.mjs";
4
- import {
5
- __name
6
- } from "../../../chunk-2BPV2XV2.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