@powerlines/nx 0.9.5 → 0.10.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.
- package/CHANGELOG.md +7 -0
- package/README.md +34 -32
- package/dist/{chunk-RLV2BDHW.mjs → chunk-3E654WM2.mjs} +1 -1
- package/dist/{chunk-JMPM6JPD.js → chunk-5BPEG52U.js} +2 -2
- package/dist/chunk-67ALH5AX.js +327 -0
- package/dist/{chunk-Y2I6ZDWH.js → chunk-DODH7R3U.js} +2 -2
- package/dist/{chunk-SV7QXBCB.mjs → chunk-DVGRVHRD.mjs} +51 -52
- package/dist/{chunk-EVC3CWDX.mjs → chunk-H4ROBXJM.mjs} +1 -1
- package/dist/{chunk-P5UNWOB6.js → chunk-IS2MEDGI.js} +2 -2
- package/dist/chunk-KBRKYARM.mjs +320 -0
- package/dist/{chunk-IXFAMU7J.js → chunk-MI5C7LYS.js} +2 -2
- package/dist/{chunk-TEBG7V3S.mjs → chunk-MSR5HSGP.mjs} +513 -481
- package/dist/{chunk-GW5UQFFS.js → chunk-NFAKPYKX.js} +2 -2
- package/dist/{chunk-HTYRXIRM.mjs → chunk-QEHHWZYD.mjs} +1 -1
- package/dist/{chunk-F3XVH3HG.mjs → chunk-QY2HEZSZ.mjs} +1 -1
- package/dist/{chunk-OVUCSGTD.mjs → chunk-RPI3PNLJ.mjs} +1 -1
- package/dist/{chunk-JTW7QFIT.js → chunk-SXA7B3TE.js} +533 -502
- package/dist/{chunk-4UWZOCEA.js → chunk-UOTRU26N.js} +51 -52
- package/dist/executors.js +12 -12
- package/dist/executors.mjs +7 -7
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +15 -15
- package/dist/index.mjs +8 -8
- package/dist/src/base/base-executor.js +3 -3
- package/dist/src/base/base-executor.mjs +2 -2
- package/dist/src/executors/build/executor.js +5 -5
- package/dist/src/executors/build/executor.mjs +3 -3
- package/dist/src/executors/clean/executor.js +5 -5
- package/dist/src/executors/clean/executor.mjs +3 -3
- package/dist/src/executors/docs/executor.js +5 -5
- package/dist/src/executors/docs/executor.mjs +3 -3
- package/dist/src/executors/lint/executor.js +5 -5
- package/dist/src/executors/lint/executor.mjs +3 -3
- package/dist/src/executors/prepare/executor.js +5 -5
- package/dist/src/executors/prepare/executor.mjs +3 -3
- package/dist/src/plugin/index.d.mts +173 -11
- package/dist/src/plugin/index.d.ts +173 -11
- package/dist/src/plugin/index.js +4 -4
- package/dist/src/plugin/index.mjs +2 -2
- package/package.json +18 -18
- package/dist/chunk-FFBOHADM.mjs +0 -286
- package/dist/chunk-IFMXBBI7.js +0 -293
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Powerlines - Nx
|
|
4
4
|
|
|
5
|
+
## [0.9.5](https://github.com/storm-software/powerlines/releases/tag/nx%400.9.5) (2025-10-28)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **monorepo:** Update workspace package links
|
|
10
|
+
([321d621](https://github.com/storm-software/powerlines/commit/321d621))
|
|
11
|
+
|
|
5
12
|
## [0.9.4](https://github.com/storm-software/powerlines/releases/tag/nx%400.9.4) (2025-10-27)
|
|
6
13
|
|
|
7
14
|
### Miscellaneous
|
package/README.md
CHANGED
|
@@ -45,35 +45,37 @@ A package containing tools for managing a Storm workspace. It includes various
|
|
|
45
45
|
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
|
|
46
46
|
## Table of Contents
|
|
47
47
|
|
|
48
|
-
- [
|
|
49
|
-
- [
|
|
50
|
-
- [
|
|
51
|
-
- [
|
|
52
|
-
- [
|
|
53
|
-
- [
|
|
54
|
-
|
|
55
|
-
- [
|
|
56
|
-
- [
|
|
57
|
-
|
|
58
|
-
- [
|
|
59
|
-
- [
|
|
60
|
-
|
|
61
|
-
- [
|
|
62
|
-
- [
|
|
63
|
-
|
|
64
|
-
- [
|
|
65
|
-
- [
|
|
66
|
-
- [
|
|
67
|
-
- [
|
|
68
|
-
- [
|
|
69
|
-
- [
|
|
70
|
-
- [
|
|
71
|
-
- [
|
|
72
|
-
- [
|
|
73
|
-
- [
|
|
74
|
-
- [
|
|
75
|
-
- [
|
|
76
|
-
- [
|
|
48
|
+
- [Powerlines - Nx Plugin](#powerlines---nx-plugin)
|
|
49
|
+
- [Table of Contents](#table-of-contents)
|
|
50
|
+
- [Installing](#installing)
|
|
51
|
+
- [Executors](#executors)
|
|
52
|
+
- [Powerlines Clean Executor](#powerlines-clean-executor)
|
|
53
|
+
- [Example](#example)
|
|
54
|
+
- [Options](#options)
|
|
55
|
+
- [Powerlines Prepare Executor](#powerlines-prepare-executor)
|
|
56
|
+
- [Example](#example-1)
|
|
57
|
+
- [Options](#options-1)
|
|
58
|
+
- [Powerlines Lint Executor](#powerlines-lint-executor)
|
|
59
|
+
- [Example](#example-2)
|
|
60
|
+
- [Options](#options-2)
|
|
61
|
+
- [Powerlines Build Executor](#powerlines-build-executor)
|
|
62
|
+
- [Example](#example-3)
|
|
63
|
+
- [Options](#options-3)
|
|
64
|
+
- [Powerlines Docs Executor](#powerlines-docs-executor)
|
|
65
|
+
- [Example](#example-4)
|
|
66
|
+
- [Options](#options-4)
|
|
67
|
+
- [Generators](#generators)
|
|
68
|
+
- [Powerlines Sync Generator](#powerlines-sync-generator)
|
|
69
|
+
- [Options](#options-5)
|
|
70
|
+
- [Building](#building)
|
|
71
|
+
- [Running unit tests](#running-unit-tests)
|
|
72
|
+
- [Storm Workspaces](#storm-workspaces)
|
|
73
|
+
- [Roadmap](#roadmap)
|
|
74
|
+
- [Support](#support)
|
|
75
|
+
- [License](#license)
|
|
76
|
+
- [Changelog](#changelog)
|
|
77
|
+
- [Contributing](#contributing)
|
|
78
|
+
- [Contributors](#contributors)
|
|
77
79
|
|
|
78
80
|
<!-- END doctoc -->
|
|
79
81
|
|
|
@@ -86,14 +88,14 @@ This library was generated with [Nx](https://nx.dev).
|
|
|
86
88
|
Using [pnpm](http://pnpm.io):
|
|
87
89
|
|
|
88
90
|
```bash
|
|
89
|
-
pnpm add -D @powerlines/
|
|
91
|
+
pnpm add -D @powerlines/nx
|
|
90
92
|
```
|
|
91
93
|
|
|
92
94
|
<details>
|
|
93
95
|
<summary>Using npm</summary>
|
|
94
96
|
|
|
95
97
|
```bash
|
|
96
|
-
npm install -D @powerlines/
|
|
98
|
+
npm install -D @powerlines/nx
|
|
97
99
|
```
|
|
98
100
|
|
|
99
101
|
</details>
|
|
@@ -102,7 +104,7 @@ npm install -D @powerlines/devkit-nx
|
|
|
102
104
|
<summary>Using yarn</summary>
|
|
103
105
|
|
|
104
106
|
```bash
|
|
105
|
-
yarn add -D @powerlines/
|
|
107
|
+
yarn add -D @powerlines/nx
|
|
106
108
|
```
|
|
107
109
|
|
|
108
110
|
</details>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSXA7B3TE_js = require('./chunk-SXA7B3TE.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
|
|
6
6
|
// src/executors/docs/executor.ts
|
|
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
14
|
-
var executor =
|
|
14
|
+
var executor = chunkSXA7B3TE_js.withExecutor("docs", executorFn);
|
|
15
15
|
var executor_default = executor;
|
|
16
16
|
|
|
17
17
|
exports.executorFn = executorFn;
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunkUOTRU26N_js = require('./chunk-UOTRU26N.js');
|
|
4
|
+
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
|
+
var devkit = require('@nx/devkit');
|
|
6
|
+
var nxJson = require('@storm-software/workspace-tools/utils/nx-json');
|
|
7
|
+
var pluginHelpers = require('@storm-software/workspace-tools/utils/plugin-helpers');
|
|
8
|
+
var projectTags = require('@storm-software/workspace-tools/utils/project-tags');
|
|
9
|
+
var getEnvPaths = require('@stryke/env/get-env-paths');
|
|
10
|
+
var exists = require('@stryke/fs/exists');
|
|
11
|
+
var json = require('@stryke/fs/json');
|
|
12
|
+
var murmurhash = require('@stryke/hash/murmurhash');
|
|
13
|
+
var joinPaths = require('@stryke/path/join-paths');
|
|
14
|
+
var kebabCase = require('@stryke/string-format/kebab-case');
|
|
15
|
+
var isError = require('@stryke/type-checks/is-error');
|
|
16
|
+
var defu = require('defu');
|
|
17
|
+
var jiti = require('jiti');
|
|
18
|
+
var nxJson_js = require('nx/src/config/nx-json.js');
|
|
19
|
+
var packageJson_js = require('nx/src/utils/package-json.js');
|
|
20
|
+
|
|
21
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
|
+
|
|
23
|
+
var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
24
|
+
|
|
25
|
+
// src/helpers/constants.ts
|
|
26
|
+
var CONFIG_INPUTS = [
|
|
27
|
+
"{projectRoot}/package.json",
|
|
28
|
+
"{projectRoot}/{framework}.json",
|
|
29
|
+
"{projectRoot}/{framework}.*.json",
|
|
30
|
+
"{projectRoot}/{framework}.jsonc",
|
|
31
|
+
"{projectRoot}/{framework}.*.jsonc",
|
|
32
|
+
"{projectRoot}/{framework}.json5",
|
|
33
|
+
"{projectRoot}/{framework}.*.json5",
|
|
34
|
+
"{projectRoot}/{framework}.yaml",
|
|
35
|
+
"{projectRoot}/{framework}.*.yaml",
|
|
36
|
+
"{projectRoot}/{framework}.yml",
|
|
37
|
+
"{projectRoot}/{framework}.*.yml",
|
|
38
|
+
"{projectRoot}/{framework}.toml",
|
|
39
|
+
"{projectRoot}/{framework}.*.toml",
|
|
40
|
+
"{projectRoot}/{framework}.js",
|
|
41
|
+
"{projectRoot}/{framework}.*.js",
|
|
42
|
+
"{projectRoot}/{framework}.cjs",
|
|
43
|
+
"{projectRoot}/{framework}.*.cjs",
|
|
44
|
+
"{projectRoot}/{framework}.mjs",
|
|
45
|
+
"{projectRoot}/{framework}.*.mjs",
|
|
46
|
+
"{projectRoot}/{framework}.ts",
|
|
47
|
+
"{projectRoot}/{framework}.*.ts",
|
|
48
|
+
"{projectRoot}/{framework}.cts",
|
|
49
|
+
"{projectRoot}/{framework}.*.cts",
|
|
50
|
+
"{projectRoot}/{framework}.mts",
|
|
51
|
+
"{projectRoot}/{framework}.*.mts"
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
// src/helpers/plugin-utilities.ts
|
|
55
|
+
function getNxTargetInputs(framework) {
|
|
56
|
+
return CONFIG_INPUTS.map((input) => input.replace("{framework}", framework));
|
|
57
|
+
}
|
|
58
|
+
chunkSHUYVCID_js.__name(getNxTargetInputs, "getNxTargetInputs");
|
|
59
|
+
function getNxPluginInputs(framework) {
|
|
60
|
+
return `**/${getNxTargetInputs(framework).map((input) => input.replace("{projectRoot}/", "")).join(",")}`;
|
|
61
|
+
}
|
|
62
|
+
chunkSHUYVCID_js.__name(getNxPluginInputs, "getNxPluginInputs");
|
|
63
|
+
function createNxPlugin(opts) {
|
|
64
|
+
const framework = opts?.framework || "powerlines";
|
|
65
|
+
const name2 = opts?.name || `${framework}/plugin/nx`;
|
|
66
|
+
const artifactsFolder = opts?.artifactsFolder || `{projectRoot}/.${framework}`;
|
|
67
|
+
const targetInputs = getNxTargetInputs(framework);
|
|
68
|
+
const pluginInputs = getNxPluginInputs(framework);
|
|
69
|
+
return [
|
|
70
|
+
pluginInputs,
|
|
71
|
+
async (configFiles, options, contextV2) => {
|
|
72
|
+
const envPaths = getEnvPaths.getEnvPaths({
|
|
73
|
+
orgId: "storm-software",
|
|
74
|
+
appId: framework,
|
|
75
|
+
workspaceRoot: contextV2.workspaceRoot
|
|
76
|
+
});
|
|
77
|
+
if (!envPaths.cache) {
|
|
78
|
+
throw new Error("The cache directory could not be determined.");
|
|
79
|
+
}
|
|
80
|
+
const nxJson$1 = nxJson_js.readNxJson(contextV2.workspaceRoot);
|
|
81
|
+
return devkit.createNodesFromFiles(async (configFile, _, context) => {
|
|
82
|
+
try {
|
|
83
|
+
const projectRoot = pluginHelpers.getProjectRoot(configFile, contextV2.workspaceRoot);
|
|
84
|
+
if (!projectRoot) {
|
|
85
|
+
console.error(`[${name2}]: package.json and ${framework} configuration files (i.e. ${framework}.config.ts) must be located in the project root directory: ${configFile}`);
|
|
86
|
+
return {};
|
|
87
|
+
}
|
|
88
|
+
const root = pluginHelpers.getRoot(projectRoot, context);
|
|
89
|
+
const cacheDir = joinPaths.joinPaths(envPaths.cache, "projects", murmurhash.murmurhash(joinPaths.joinPaths(contextV2.workspaceRoot, projectRoot), {
|
|
90
|
+
maxLength: chunkUOTRU26N_js.PROJECT_ROOT_HASH_LENGTH
|
|
91
|
+
}));
|
|
92
|
+
const jiti$1 = jiti.createJiti(joinPaths.joinPaths(contextV2.workspaceRoot, projectRoot), {
|
|
93
|
+
interopDefault: true,
|
|
94
|
+
fsCache: joinPaths.joinPaths(cacheDir, "jiti"),
|
|
95
|
+
moduleCache: true
|
|
96
|
+
});
|
|
97
|
+
const userConfig = await chunkUOTRU26N_js.loadUserConfigFile(projectRoot, jiti$1, "build", "development", configFile, framework);
|
|
98
|
+
const packageJson = json.readJsonFileSync(joinPaths.joinPaths(projectRoot, "package.json"));
|
|
99
|
+
if (!userConfig.configFile && !packageJson.storm) {
|
|
100
|
+
console.debug(`[${name2}]: Skipping ${projectRoot} - no ${framework} configuration found for project in root directory.`);
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
const projectConfig = pluginHelpers.getProjectConfigFromProjectRoot(projectRoot, packageJson);
|
|
104
|
+
if (!projectConfig) {
|
|
105
|
+
console.warn(`[${name2}]: No project configuration found for project in root directory ${projectRoot}`);
|
|
106
|
+
return {};
|
|
107
|
+
}
|
|
108
|
+
const tsconfig = userConfig?.tsconfig || (exists.existsSync(joinPaths.joinPaths(projectRoot, "tsconfig.json")) ? joinPaths.joinPaths(projectRoot, "tsconfig.json") : void 0);
|
|
109
|
+
const targets = packageJson_js.readTargetsFromPackageJson(packageJson, nxJson$1, projectRoot, context.workspaceRoot);
|
|
110
|
+
if (options?.clean !== false && !targets[options?.clean?.targetName || "clean"]) {
|
|
111
|
+
targets[options?.clean?.targetName || "clean"] = {
|
|
112
|
+
inputs: Array.isArray(options?.clean?.inputs) ? options.clean.inputs : nxJson.withNamedInputs(targetInputs, [
|
|
113
|
+
options?.clean?.inputs || "typescript"
|
|
114
|
+
]),
|
|
115
|
+
outputs: options?.clean?.outputs,
|
|
116
|
+
executor: options?.clean?.executor || `@${framework}/nx:${options?.clean?.targetName || "clean"}`,
|
|
117
|
+
dependsOn: [
|
|
118
|
+
`^${options?.clean?.targetName || "clean"}`
|
|
119
|
+
],
|
|
120
|
+
defaultConfiguration: options?.clean?.defaultConfiguration || "production",
|
|
121
|
+
options: {
|
|
122
|
+
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
123
|
+
projectType: projectConfig.projectType || userConfig.type,
|
|
124
|
+
skipInstalls: userConfig.skipInstalls
|
|
125
|
+
},
|
|
126
|
+
configurations: {
|
|
127
|
+
production: {
|
|
128
|
+
mode: "production"
|
|
129
|
+
},
|
|
130
|
+
test: {
|
|
131
|
+
mode: "test"
|
|
132
|
+
},
|
|
133
|
+
development: {
|
|
134
|
+
mode: "development",
|
|
135
|
+
skipCache: true
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
if (options?.prepare !== false && !targets[options?.prepare?.targetName || "prepare"]) {
|
|
141
|
+
targets[options?.prepare?.targetName || "prepare"] = {
|
|
142
|
+
cache: true,
|
|
143
|
+
inputs: Array.isArray(options?.prepare?.inputs) ? options.prepare.inputs : nxJson.withNamedInputs(targetInputs, [
|
|
144
|
+
options?.prepare?.inputs || "typescript"
|
|
145
|
+
]),
|
|
146
|
+
outputs: options?.prepare?.outputs ?? [
|
|
147
|
+
artifactsFolder
|
|
148
|
+
],
|
|
149
|
+
executor: options?.prepare?.executor || `@${framework}/nx:${options?.prepare?.targetName || "prepare"}`,
|
|
150
|
+
dependsOn: [
|
|
151
|
+
`^${options?.prepare?.targetName || "prepare"}`,
|
|
152
|
+
"clean"
|
|
153
|
+
],
|
|
154
|
+
defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
|
|
155
|
+
options: {
|
|
156
|
+
entry: userConfig.entry || "{sourceRoot}/index.ts",
|
|
157
|
+
projectType: projectConfig.projectType || userConfig.type,
|
|
158
|
+
tsconfig,
|
|
159
|
+
skipInstalls: userConfig.skipInstalls,
|
|
160
|
+
skipCache: userConfig.skipCache
|
|
161
|
+
},
|
|
162
|
+
configurations: {
|
|
163
|
+
production: {
|
|
164
|
+
mode: "production"
|
|
165
|
+
},
|
|
166
|
+
test: {
|
|
167
|
+
mode: "test"
|
|
168
|
+
},
|
|
169
|
+
development: {
|
|
170
|
+
mode: "development",
|
|
171
|
+
skipCache: true
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
if (options?.build !== false && !targets[options?.build?.targetName || "build"]) {
|
|
177
|
+
targets[options?.build?.targetName || "build"] = {
|
|
178
|
+
inputs: Array.isArray(options?.build?.inputs) ? options.build.inputs : nxJson.withNamedInputs(targetInputs, [
|
|
179
|
+
options?.build?.inputs || "typescript"
|
|
180
|
+
]),
|
|
181
|
+
outputs: options?.build?.outputs ?? [
|
|
182
|
+
"{options.outputPath}"
|
|
183
|
+
],
|
|
184
|
+
executor: options?.build?.executor || `@${framework}/nx:${options?.build?.targetName || "build"}`,
|
|
185
|
+
dependsOn: [
|
|
186
|
+
`^${options?.build?.targetName || "build"}`,
|
|
187
|
+
"prepare"
|
|
188
|
+
],
|
|
189
|
+
defaultConfiguration: options?.build?.defaultConfiguration || "production",
|
|
190
|
+
options: {
|
|
191
|
+
entry: userConfig.entry || "{sourceRoot}/index.ts",
|
|
192
|
+
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
193
|
+
projectType: projectConfig.projectType || userConfig.type,
|
|
194
|
+
tsconfig,
|
|
195
|
+
skipInstalls: userConfig.skipInstalls,
|
|
196
|
+
skipCache: userConfig.skipCache
|
|
197
|
+
},
|
|
198
|
+
configurations: {
|
|
199
|
+
production: {
|
|
200
|
+
mode: "production"
|
|
201
|
+
},
|
|
202
|
+
test: {
|
|
203
|
+
mode: "test"
|
|
204
|
+
},
|
|
205
|
+
development: {
|
|
206
|
+
mode: "development",
|
|
207
|
+
skipCache: true
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
if (options?.lint !== false && !targets[options?.lint?.targetName || "lint"]) {
|
|
213
|
+
targets[options?.lint?.targetName || "lint"] = {
|
|
214
|
+
inputs: Array.isArray(options?.lint?.inputs) ? options.lint.inputs : nxJson.withNamedInputs([
|
|
215
|
+
...targetInputs,
|
|
216
|
+
artifactsFolder
|
|
217
|
+
], options?.lint?.inputs ? [
|
|
218
|
+
options.lint.inputs
|
|
219
|
+
] : [
|
|
220
|
+
"linting",
|
|
221
|
+
"typescript"
|
|
222
|
+
]),
|
|
223
|
+
outputs: options?.lint?.outputs ?? [
|
|
224
|
+
"{options.outputPath}"
|
|
225
|
+
],
|
|
226
|
+
executor: options?.lint?.executor || `@${framework}/nx:${options?.lint?.targetName || "lint"}`,
|
|
227
|
+
dependsOn: [
|
|
228
|
+
`^${options?.lint?.targetName || "lint"}`,
|
|
229
|
+
"prepare"
|
|
230
|
+
],
|
|
231
|
+
defaultConfiguration: options?.lint?.defaultConfiguration || "production",
|
|
232
|
+
options: {
|
|
233
|
+
entry: userConfig.entry || "{sourceRoot}/index.ts",
|
|
234
|
+
projectType: projectConfig.projectType || userConfig.type,
|
|
235
|
+
tsconfig,
|
|
236
|
+
skipInstalls: userConfig.skipInstalls,
|
|
237
|
+
skipCache: userConfig.skipCache
|
|
238
|
+
},
|
|
239
|
+
configurations: {
|
|
240
|
+
production: {
|
|
241
|
+
mode: "production"
|
|
242
|
+
},
|
|
243
|
+
test: {
|
|
244
|
+
mode: "test"
|
|
245
|
+
},
|
|
246
|
+
development: {
|
|
247
|
+
mode: "development",
|
|
248
|
+
skipCache: true
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
if (options?.docs !== false && !targets[options?.docs?.targetName || "docs"]) {
|
|
254
|
+
targets[options?.docs?.targetName || "docs"] = {
|
|
255
|
+
inputs: Array.isArray(options?.docs?.inputs) ? options.docs.inputs : nxJson.withNamedInputs([
|
|
256
|
+
...targetInputs,
|
|
257
|
+
artifactsFolder
|
|
258
|
+
], options?.docs?.inputs ? [
|
|
259
|
+
options.docs.inputs
|
|
260
|
+
] : [
|
|
261
|
+
"documentation",
|
|
262
|
+
"typescript"
|
|
263
|
+
]),
|
|
264
|
+
outputs: options?.docs?.outputs ?? [
|
|
265
|
+
"{options.outputPath}"
|
|
266
|
+
],
|
|
267
|
+
executor: options?.docs?.executor || `@${framework}/nx:${options?.docs?.targetName || "docs"}`,
|
|
268
|
+
dependsOn: [
|
|
269
|
+
`^${options?.docs?.targetName || "docs"}`,
|
|
270
|
+
"build"
|
|
271
|
+
],
|
|
272
|
+
defaultConfiguration: options?.docs?.defaultConfiguration || "production",
|
|
273
|
+
options: {
|
|
274
|
+
entry: userConfig.entry || "{sourceRoot}/index.ts",
|
|
275
|
+
projectType: projectConfig.projectType || userConfig.type,
|
|
276
|
+
tsconfig,
|
|
277
|
+
skipInstalls: userConfig.skipInstalls,
|
|
278
|
+
skipCache: userConfig.skipCache
|
|
279
|
+
},
|
|
280
|
+
configurations: {
|
|
281
|
+
production: {
|
|
282
|
+
mode: "production"
|
|
283
|
+
},
|
|
284
|
+
test: {
|
|
285
|
+
mode: "test"
|
|
286
|
+
},
|
|
287
|
+
development: {
|
|
288
|
+
mode: "development",
|
|
289
|
+
skipCache: true
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
projectTags.setDefaultProjectTags(projectConfig, name2);
|
|
295
|
+
projectTags.addProjectTag(projectConfig, framework, projectConfig.projectType || userConfig.type || "library", {
|
|
296
|
+
overwrite: true
|
|
297
|
+
});
|
|
298
|
+
return {
|
|
299
|
+
projects: {
|
|
300
|
+
[root]: defu__default.default(projectConfig, {
|
|
301
|
+
name: kebabCase.kebabCase(userConfig.name),
|
|
302
|
+
projectType: userConfig.type || "library",
|
|
303
|
+
root,
|
|
304
|
+
sourceRoot: joinPaths.joinPaths(root, "src"),
|
|
305
|
+
targets
|
|
306
|
+
})
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
} catch (error) {
|
|
310
|
+
console.error(`[${name2}]: ${isError.isError(error) ? error.message : "Unknown fatal error"}`);
|
|
311
|
+
return {};
|
|
312
|
+
}
|
|
313
|
+
}, configFiles, options, contextV2);
|
|
314
|
+
}
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
chunkSHUYVCID_js.__name(createNxPlugin, "createNxPlugin");
|
|
318
|
+
|
|
319
|
+
// src/plugin/index.ts
|
|
320
|
+
var name = "powerlines/nx/plugin";
|
|
321
|
+
var createNodesV2 = createNxPlugin({
|
|
322
|
+
name,
|
|
323
|
+
framework: "powerlines"
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
exports.createNodesV2 = createNodesV2;
|
|
327
|
+
exports.name = name;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSXA7B3TE_js = require('./chunk-SXA7B3TE.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
var defu = require('defu');
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@ async function executorFn(context, api) {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
22
|
-
var executor =
|
|
22
|
+
var executor = chunkSXA7B3TE_js.withExecutor("build", executorFn);
|
|
23
23
|
var executor_default = executor;
|
|
24
24
|
|
|
25
25
|
exports.executorFn = executorFn;
|
|
@@ -1,62 +1,20 @@
|
|
|
1
1
|
import { __name } from './chunk-O6YSETKJ.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { getWorkspaceConfig } from '@storm-software/config-tools/get-config';
|
|
3
3
|
import { existsSync } from '@stryke/fs/exists';
|
|
4
|
+
import { joinPaths } from '@stryke/path/join-paths';
|
|
5
|
+
import { isFunction } from '@stryke/type-checks/is-function';
|
|
6
|
+
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
7
|
+
import { loadConfig } from 'c12';
|
|
8
|
+
import defu from 'defu';
|
|
9
|
+
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
4
10
|
import '@stryke/fs/json';
|
|
5
11
|
import '@stryke/fs/list-files';
|
|
6
12
|
import '@stryke/fs/remove-file';
|
|
7
13
|
import { hashDirectory } from '@stryke/hash/hash-files';
|
|
8
14
|
import '@stryke/helpers/get-unique';
|
|
9
15
|
import '@stryke/path/file-path-fns';
|
|
10
|
-
import { joinPaths } from '@stryke/path/join-paths';
|
|
11
16
|
import { kebabCase } from '@stryke/string-format/kebab-case';
|
|
12
|
-
import { getWorkspaceConfig } from '@storm-software/config-tools/get-config';
|
|
13
|
-
import { isFunction } from '@stryke/type-checks/is-function';
|
|
14
|
-
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
15
|
-
import { loadConfig } from 'c12';
|
|
16
|
-
import defu from 'defu';
|
|
17
|
-
|
|
18
|
-
// ../powerlines/src/types/vfs.ts
|
|
19
|
-
var __VFS_INIT__ = "__VFS_INIT__";
|
|
20
|
-
var __VFS_REVERT__ = "__VFS_REVERT__";
|
|
21
|
-
var __VFS_CACHE__ = "__VFS_CACHE__";
|
|
22
|
-
var __VFS_RESOLVER__ = "__VFS_RESOLVER__";
|
|
23
|
-
var __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
24
|
-
var __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
25
17
|
|
|
26
|
-
// ../powerlines/src/lib/utilities/meta.ts
|
|
27
|
-
var PROJECT_ROOT_HASH_LENGTH = 45;
|
|
28
|
-
var CACHE_HASH_LENGTH = 62;
|
|
29
|
-
function getPrefixedProjectRootHash(name, projectRootHash) {
|
|
30
|
-
const combined = `${kebabCase(name)}_${projectRootHash}`;
|
|
31
|
-
return combined.length > PROJECT_ROOT_HASH_LENGTH ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH) : combined;
|
|
32
|
-
}
|
|
33
|
-
__name(getPrefixedProjectRootHash, "getPrefixedProjectRootHash");
|
|
34
|
-
async function getChecksum(path) {
|
|
35
|
-
return hashDirectory(path, {
|
|
36
|
-
ignore: [
|
|
37
|
-
"node_modules",
|
|
38
|
-
".git",
|
|
39
|
-
".nx",
|
|
40
|
-
".cache",
|
|
41
|
-
".storm",
|
|
42
|
-
"tmp",
|
|
43
|
-
"dist"
|
|
44
|
-
]
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
__name(getChecksum, "getChecksum");
|
|
48
|
-
async function writeMetaFile(context) {
|
|
49
|
-
const metaFilePath = joinPaths(context.dataPath, "meta.json");
|
|
50
|
-
context.log(LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
|
|
51
|
-
await context.fs.writeFile(metaFilePath, JSON.stringify({
|
|
52
|
-
...context.meta,
|
|
53
|
-
virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath),
|
|
54
|
-
virtualFilesMeta: context.fs.getPartialMeta()
|
|
55
|
-
}, null, 2), {
|
|
56
|
-
mode: "fs"
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
__name(writeMetaFile, "writeMetaFile");
|
|
60
18
|
async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
61
19
|
return defu({
|
|
62
20
|
workspaceRoot
|
|
@@ -67,9 +25,9 @@ async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
|
67
25
|
}));
|
|
68
26
|
}
|
|
69
27
|
__name(loadWorkspaceConfig, "loadWorkspaceConfig");
|
|
70
|
-
async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile) {
|
|
28
|
+
async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile, framework = "powerlines") {
|
|
71
29
|
let resolvedUserConfig = {};
|
|
72
|
-
const resolvedUserConfigFile = configFile && existsSync(configFile) ? configFile : configFile && existsSync(joinPaths(projectRoot, configFile)) ? joinPaths(projectRoot, configFile) : existsSync(joinPaths(projectRoot,
|
|
30
|
+
const resolvedUserConfigFile = configFile && existsSync(configFile) ? configFile : configFile && existsSync(joinPaths(projectRoot, configFile)) ? joinPaths(projectRoot, configFile) : existsSync(joinPaths(projectRoot, `${framework}.config.ts`)) ? joinPaths(projectRoot, `${framework}.config.ts`) : existsSync(joinPaths(projectRoot, `${framework}.config.js`)) ? joinPaths(projectRoot, `${framework}.config.js`) : existsSync(joinPaths(projectRoot, `${framework}.config.mts`)) ? joinPaths(projectRoot, `${framework}.config.mts`) : existsSync(joinPaths(projectRoot, `${framework}.config.mjs`)) ? joinPaths(projectRoot, `${framework}.config.mjs`) : void 0;
|
|
73
31
|
if (resolvedUserConfigFile) {
|
|
74
32
|
const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
|
|
75
33
|
if (resolved) {
|
|
@@ -93,7 +51,7 @@ async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile)
|
|
|
93
51
|
}
|
|
94
52
|
const result = await loadConfig({
|
|
95
53
|
cwd: projectRoot,
|
|
96
|
-
name:
|
|
54
|
+
name: framework,
|
|
97
55
|
envName: mode,
|
|
98
56
|
globalRc: true,
|
|
99
57
|
packageJson: true,
|
|
@@ -107,4 +65,45 @@ async function loadUserConfigFile(projectRoot, jiti, command, mode, configFile)
|
|
|
107
65
|
}
|
|
108
66
|
__name(loadUserConfigFile, "loadUserConfigFile");
|
|
109
67
|
|
|
68
|
+
// ../powerlines/src/types/vfs.ts
|
|
69
|
+
var __VFS_INIT__ = "__VFS_INIT__";
|
|
70
|
+
var __VFS_REVERT__ = "__VFS_REVERT__";
|
|
71
|
+
var __VFS_CACHE__ = "__VFS_CACHE__";
|
|
72
|
+
var __VFS_RESOLVER__ = "__VFS_RESOLVER__";
|
|
73
|
+
var __VFS_VIRTUAL__ = "__VFS_VIRTUAL__";
|
|
74
|
+
var __VFS_UNIFIED__ = "__VFS_UNIFIED__";
|
|
75
|
+
var PROJECT_ROOT_HASH_LENGTH = 45;
|
|
76
|
+
var CACHE_HASH_LENGTH = 62;
|
|
77
|
+
function getPrefixedProjectRootHash(name, projectRootHash) {
|
|
78
|
+
const combined = `${kebabCase(name)}_${projectRootHash}`;
|
|
79
|
+
return combined.length > PROJECT_ROOT_HASH_LENGTH ? combined.slice(0, PROJECT_ROOT_HASH_LENGTH) : combined;
|
|
80
|
+
}
|
|
81
|
+
__name(getPrefixedProjectRootHash, "getPrefixedProjectRootHash");
|
|
82
|
+
async function getChecksum(path) {
|
|
83
|
+
return hashDirectory(path, {
|
|
84
|
+
ignore: [
|
|
85
|
+
"node_modules",
|
|
86
|
+
".git",
|
|
87
|
+
".nx",
|
|
88
|
+
".cache",
|
|
89
|
+
".storm",
|
|
90
|
+
"tmp",
|
|
91
|
+
"dist"
|
|
92
|
+
]
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
__name(getChecksum, "getChecksum");
|
|
96
|
+
async function writeMetaFile(context) {
|
|
97
|
+
const metaFilePath = joinPaths(context.dataPath, "meta.json");
|
|
98
|
+
context.log(LogLevelLabel.DEBUG, `Writing runtime metadata to ${metaFilePath}`);
|
|
99
|
+
await context.fs.writeFile(metaFilePath, JSON.stringify({
|
|
100
|
+
...context.meta,
|
|
101
|
+
virtualFiles: context.fs[__VFS_VIRTUAL__].toJSON(context.artifactsPath),
|
|
102
|
+
virtualFilesMeta: context.fs.getPartialMeta()
|
|
103
|
+
}, null, 2), {
|
|
104
|
+
mode: "fs"
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
__name(writeMetaFile, "writeMetaFile");
|
|
108
|
+
|
|
110
109
|
export { CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, __VFS_CACHE__, __VFS_INIT__, __VFS_RESOLVER__, __VFS_REVERT__, __VFS_UNIFIED__, __VFS_VIRTUAL__, getChecksum, getPrefixedProjectRootHash, loadUserConfigFile, loadWorkspaceConfig, writeMetaFile };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSXA7B3TE_js = require('./chunk-SXA7B3TE.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
|
|
6
6
|
// src/executors/clean/executor.ts
|
|
@@ -11,7 +11,7 @@ async function executorFn(context, api) {
|
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
13
|
chunkSHUYVCID_js.__name(executorFn, "executorFn");
|
|
14
|
-
var executor =
|
|
14
|
+
var executor = chunkSXA7B3TE_js.withExecutor("clean", executorFn);
|
|
15
15
|
var executor_default = executor;
|
|
16
16
|
|
|
17
17
|
exports.executorFn = executorFn;
|