@powerlines/nx 0.11.216 → 0.11.218
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 +12 -0
- package/dist/{chunk-Q6ARGUEG.js → chunk-2VN57DMC.js} +2 -2
- package/dist/chunk-3BI2YVJ3.js +156 -0
- package/dist/{chunk-LQ6NEJBJ.js → chunk-3TZVQPPH.js} +2 -2
- package/dist/chunk-4OMPO3GC.mjs +154 -0
- package/dist/{chunk-QZQ42FLG.mjs → chunk-5NHMBXXZ.mjs} +1 -1
- package/dist/{chunk-NJFLBZ5O.mjs → chunk-CINC3R52.mjs} +1 -1
- package/dist/{chunk-HXG555M5.mjs → chunk-EFG2AWKX.mjs} +220 -388
- package/dist/{chunk-TWOXCXFE.js → chunk-EQMUIUSF.js} +16 -16
- package/dist/{chunk-DPLLKEJ7.mjs → chunk-ETYR57U3.mjs} +2 -2
- package/dist/chunk-FSGRYCTL.js +281 -0
- package/dist/{chunk-2YJP4HRC.mjs → chunk-GCIPEE4T.mjs} +7 -7
- package/dist/{chunk-ELBUYWVF.mjs → chunk-GKRW32W2.mjs} +1 -1
- package/dist/{chunk-D4FP3KIU.mjs → chunk-H7FXL53F.mjs} +1 -1
- package/dist/{chunk-VSMLSWBT.js → chunk-IOBDAGVL.js} +8 -8
- package/dist/{chunk-POEOITLM.js → chunk-JCB2SUGI.js} +2 -2
- package/dist/{chunk-2W2T5G3F.js → chunk-JFLVE4R6.js} +2 -2
- package/dist/chunk-JL4HQ7ZD.mjs +260 -0
- package/dist/{chunk-WJP3FWAH.js → chunk-MDVQOPYK.js} +2 -2
- package/dist/{chunk-ZYOL33SX.mjs → chunk-RQR4JLRG.mjs} +15 -15
- package/dist/{chunk-ELR7ZJ3T.js → chunk-VNEJ2D4E.js} +3 -3
- package/dist/{chunk-T36V4JK7.mjs → chunk-XX6ZLY4D.mjs} +1 -1
- package/dist/{chunk-MV4TOX46.js → chunk-ZVVHO24E.js} +244 -412
- package/dist/{executor-Bb8vGV8C.d.ts → executor-AQVlPFta.d.ts} +90 -19
- package/dist/{executor-CQzw0-So.d.mts → executor-BNmIhtpF.d.mts} +90 -19
- package/dist/{executor-DwTFXSVb.d.mts → executor-C0A5mFLO.d.mts} +74 -19
- package/dist/{executor-u-vw0Uzf.d.mts → executor-Cep8-Y3A.d.mts} +90 -19
- package/dist/{executor-DY7vA66P.d.ts → executor-CkyahICv.d.ts} +74 -19
- package/dist/{executor-C2WSCUOW.d.ts → executor-DOsxw-Ih.d.ts} +90 -19
- package/dist/{executor-C5rCem7d.d.ts → executor-DUQbjUVt.d.ts} +90 -19
- package/dist/{executor-C9MI57kJ.d.ts → executor-O3MDQSFT.d.ts} +90 -19
- package/dist/{executor-fccJAIjg.d.mts → executor-U4mVkhQK.d.mts} +90 -19
- package/dist/{executor-DXaEo8YG.d.mts → executor-Xt5qNzC5.d.mts} +90 -19
- package/dist/executors.d.mts +5 -6
- package/dist/executors.d.ts +5 -6
- package/dist/executors.js +12 -12
- package/dist/executors.mjs +7 -7
- package/dist/index.d.mts +5 -6
- package/dist/index.d.ts +5 -6
- package/dist/index.js +15 -15
- package/dist/index.mjs +9 -9
- package/dist/src/base/base-executor.d.mts +1 -2
- package/dist/src/base/base-executor.d.ts +1 -2
- package/dist/src/base/base-executor.js +3 -3
- package/dist/src/base/base-executor.mjs +2 -2
- package/dist/src/base/base-executor.schema.d.d.mts +74 -19
- package/dist/src/base/base-executor.schema.d.d.ts +74 -19
- package/dist/src/base/base-executor.schema.d.ts +74 -19
- package/dist/src/base/base-executor.schema.json +108 -26
- package/dist/src/base/base-executor.untyped.js +2 -2
- package/dist/src/base/base-executor.untyped.mjs +1 -1
- package/dist/src/executors/build/executor.d.mts +1 -2
- package/dist/src/executors/build/executor.d.ts +1 -2
- package/dist/src/executors/build/executor.js +5 -5
- package/dist/src/executors/build/executor.mjs +3 -3
- package/dist/src/executors/build/schema.d.ts +90 -19
- package/dist/src/executors/build/schema.json +119 -25
- package/dist/src/executors/build/untyped.js +3 -3
- package/dist/src/executors/build/untyped.mjs +2 -2
- package/dist/src/executors/clean/executor.d.mts +1 -2
- package/dist/src/executors/clean/executor.d.ts +1 -2
- package/dist/src/executors/clean/executor.js +5 -5
- package/dist/src/executors/clean/executor.mjs +3 -3
- package/dist/src/executors/clean/schema.d.ts +74 -19
- package/dist/src/executors/clean/schema.json +108 -26
- package/dist/src/executors/clean/untyped.js +2 -2
- package/dist/src/executors/clean/untyped.mjs +1 -1
- package/dist/src/executors/docs/executor.d.mts +1 -2
- package/dist/src/executors/docs/executor.d.ts +1 -2
- package/dist/src/executors/docs/executor.js +5 -5
- package/dist/src/executors/docs/executor.mjs +3 -3
- package/dist/src/executors/docs/schema.d.ts +90 -19
- package/dist/src/executors/docs/schema.json +120 -26
- package/dist/src/executors/docs/untyped.js +3 -3
- package/dist/src/executors/docs/untyped.mjs +2 -2
- package/dist/src/executors/lint/executor.d.mts +1 -2
- package/dist/src/executors/lint/executor.d.ts +1 -2
- package/dist/src/executors/lint/executor.js +5 -5
- package/dist/src/executors/lint/executor.mjs +3 -3
- package/dist/src/executors/lint/schema.d.ts +90 -19
- package/dist/src/executors/lint/schema.json +120 -26
- package/dist/src/executors/lint/untyped.js +3 -3
- package/dist/src/executors/lint/untyped.mjs +2 -2
- package/dist/src/executors/prepare/executor.d.mts +1 -2
- package/dist/src/executors/prepare/executor.d.ts +1 -2
- package/dist/src/executors/prepare/executor.js +5 -5
- package/dist/src/executors/prepare/executor.mjs +3 -3
- package/dist/src/executors/prepare/schema.d.ts +90 -19
- package/dist/src/executors/prepare/schema.json +120 -26
- package/dist/src/executors/prepare/untyped.js +3 -3
- package/dist/src/executors/prepare/untyped.mjs +2 -2
- package/dist/src/helpers/plugin-utilities.js +5 -5
- package/dist/src/helpers/plugin-utilities.mjs +2 -2
- package/dist/src/plugin/index.js +4 -4
- package/dist/src/plugin/index.mjs +3 -3
- package/docs/api/base-executor.schema.md +71 -19
- package/docs/api/build/schema.md +89 -19
- package/docs/api/clean/schema.md +71 -19
- package/docs/api/docs/schema.md +89 -19
- package/docs/api/lint/schema.md +89 -19
- package/docs/api/prepare/schema.md +89 -19
- package/package.json +11 -11
- package/dist/chunk-AGZ4P3AS.mjs +0 -87
- package/dist/chunk-IR6TAW72.js +0 -81
- package/dist/chunk-NU3VTAH5.js +0 -98
- package/dist/chunk-XXWF7X5C.mjs +0 -75
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
import { __name } from './chunk-O6YSETKJ.mjs';
|
|
2
|
+
import { parseTypeDefinition } from '@stryke/convert/parse-type-definition';
|
|
3
|
+
import { toArray } from '@stryke/convert/to-array';
|
|
4
|
+
import { murmurhash } from '@stryke/hash/murmurhash';
|
|
5
|
+
import { getUniqueBy } from '@stryke/helpers/get-unique';
|
|
6
|
+
import { appendPath } from '@stryke/path/append';
|
|
7
|
+
import { isAbsolutePath } from '@stryke/path/is-type';
|
|
8
|
+
import { joinPaths as joinPaths$1 } from '@stryke/path/join-paths';
|
|
9
|
+
import { replacePath, replaceExtension } from '@stryke/path/replace';
|
|
10
|
+
import { isObject } from '@stryke/type-checks/is-object';
|
|
11
|
+
import { isRegExp } from '@stryke/type-checks/is-regexp';
|
|
12
|
+
import { isSetString } from '@stryke/type-checks/is-set-string';
|
|
13
|
+
import { isString } from '@stryke/type-checks/is-string';
|
|
14
|
+
import { joinPaths } from '@stryke/path/join';
|
|
15
|
+
import { getLogFn, getLogLevel } from '@storm-software/config-tools/logger';
|
|
16
|
+
import { LogLevelLabel } from '@storm-software/config-tools/types';
|
|
17
|
+
import { getColor } from '@storm-software/config-tools/utilities/colors';
|
|
18
|
+
import { noop } from '@stryke/helpers/noop';
|
|
19
|
+
import { kebabCase } from '@stryke/string-format/kebab-case';
|
|
20
|
+
import { titleCase } from '@stryke/string-format/title-case';
|
|
21
|
+
import chalk from 'chalk';
|
|
22
|
+
import { listFiles } from '@stryke/fs/list-files';
|
|
23
|
+
import { isParentPath } from '@stryke/path/is-parent-path';
|
|
24
|
+
import { resolveConfig, format as format$1 } from 'prettier';
|
|
25
|
+
import '@stryke/fs/read-file';
|
|
26
|
+
import { isSetObject } from '@stryke/type-checks/is-set-object';
|
|
27
|
+
import 'magic-string';
|
|
28
|
+
import Diff from 'diff-match-patch';
|
|
29
|
+
import '@stryke/fs/write-file';
|
|
30
|
+
import { getWorkspaceConfig } from '@storm-software/config-tools/get-config';
|
|
31
|
+
import { existsSync } from '@stryke/fs/exists';
|
|
32
|
+
import { isFunction } from '@stryke/type-checks/is-function';
|
|
33
|
+
import { loadConfig } from 'c12';
|
|
34
|
+
import defu from 'defu';
|
|
35
|
+
|
|
36
|
+
// ../core/src/lib/constants/meta.ts
|
|
37
|
+
var ROOT_HASH_LENGTH = 45;
|
|
38
|
+
var CACHE_HASH_LENGTH = 62;
|
|
39
|
+
|
|
40
|
+
// ../core/src/lib/constants/environments.ts
|
|
41
|
+
var DEFAULT_ENVIRONMENT = "default";
|
|
42
|
+
var GLOBAL_ENVIRONMENT = "__global__";
|
|
43
|
+
function replacePathTokens(context, path) {
|
|
44
|
+
if (!path) {
|
|
45
|
+
return path;
|
|
46
|
+
}
|
|
47
|
+
return path.replaceAll("{workspaceRoot}", context.workspaceConfig.workspaceRoot).replaceAll("{root}", context.config.root).replaceAll("{projectRoot}", context.config.root).replaceAll("{sourceRoot}", joinPaths(context.config.root, "src")).replaceAll("{powerlinesPath}", context.powerlinesPath).replaceAll("{cachePath}", context.cachePath).replaceAll("{dataPath}", context.dataPath).replaceAll("{logPath}", context.envPaths.log).replaceAll("{tempPath}", context.envPaths.temp).replaceAll("{configPath}", context.envPaths.config).replaceAll("{outputPath}", context.config.output.outputPath).replaceAll("{buildPath}", context.config.output.buildPath).replaceAll("{artifactsPath}", replacePath(context.artifactsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{builtinPath}", replacePath(context.builtinsPath, context.workspaceConfig.workspaceRoot)).replaceAll("{entryPath}", replacePath(context.entryPath, context.workspaceConfig.workspaceRoot));
|
|
48
|
+
}
|
|
49
|
+
__name(replacePathTokens, "replacePathTokens");
|
|
50
|
+
|
|
51
|
+
// ../core/src/lib/entry.ts
|
|
52
|
+
function resolveEntryOutput(context, typeDefinition) {
|
|
53
|
+
return replaceExtension(replacePath(replacePath(replacePath(replacePath(replacePath(typeDefinition.file, joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.root, "src")), joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.root)), joinPaths$1(context.config.root, "src")), context.config.root), "src"));
|
|
54
|
+
}
|
|
55
|
+
__name(resolveEntryOutput, "resolveEntryOutput");
|
|
56
|
+
function resolveEntry(context, typeDefinition, input, output) {
|
|
57
|
+
return {
|
|
58
|
+
...typeDefinition,
|
|
59
|
+
input: isSetString(input) || isRegExp(input) ? {
|
|
60
|
+
file: String(input)
|
|
61
|
+
} : typeDefinition,
|
|
62
|
+
output: output || resolveEntryOutput(context, typeDefinition)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
__name(resolveEntry, "resolveEntry");
|
|
66
|
+
function isTypeDefinition(entry) {
|
|
67
|
+
return !isString(entry) && entry.file !== void 0;
|
|
68
|
+
}
|
|
69
|
+
__name(isTypeDefinition, "isTypeDefinition");
|
|
70
|
+
function isResolvedEntryTypeDefinition(entry) {
|
|
71
|
+
return !isRegExp(entry) && isTypeDefinition(entry) && entry.output !== void 0;
|
|
72
|
+
}
|
|
73
|
+
__name(isResolvedEntryTypeDefinition, "isResolvedEntryTypeDefinition");
|
|
74
|
+
function resolveEntriesSync(context, typeDefinitions) {
|
|
75
|
+
return (isObject(typeDefinitions) ? Object.values(typeDefinitions).flat() : toArray(typeDefinitions)).map((entry) => {
|
|
76
|
+
if (isResolvedEntryTypeDefinition(entry)) {
|
|
77
|
+
return {
|
|
78
|
+
...entry,
|
|
79
|
+
output: entry.output ? replacePathTokens(context, entry.output) : void 0,
|
|
80
|
+
file: replacePathTokens(context, entry.file)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
let typeDefinition;
|
|
84
|
+
if (isString(entry)) {
|
|
85
|
+
typeDefinition = parseTypeDefinition(replacePathTokens(context, entry));
|
|
86
|
+
} else if (isRegExp(entry)) {
|
|
87
|
+
typeDefinition = {
|
|
88
|
+
file: replacePathTokens(context, entry.source)
|
|
89
|
+
};
|
|
90
|
+
} else {
|
|
91
|
+
typeDefinition = entry;
|
|
92
|
+
typeDefinition.file = replacePathTokens(context, typeDefinition.file);
|
|
93
|
+
}
|
|
94
|
+
const filePath = isAbsolutePath(typeDefinition.file) ? typeDefinition.file : appendPath(typeDefinition.file, context.config.root);
|
|
95
|
+
if (context.fs.isFileSync(filePath)) {
|
|
96
|
+
return resolveEntry(context, {
|
|
97
|
+
file: appendPath(filePath, context.workspaceConfig.workspaceRoot),
|
|
98
|
+
name: typeDefinition.name
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
return context.fs.globSync(appendPath(filePath, context.workspaceConfig.workspaceRoot)).map((file) => resolveEntry(context, {
|
|
102
|
+
file,
|
|
103
|
+
name: typeDefinition.name
|
|
104
|
+
}));
|
|
105
|
+
}).flat().filter(Boolean);
|
|
106
|
+
}
|
|
107
|
+
__name(resolveEntriesSync, "resolveEntriesSync");
|
|
108
|
+
function getUniqueInputs(inputs = []) {
|
|
109
|
+
return isObject(inputs) ? inputs : getUniqueBy(toArray(inputs), (item) => isSetString(item) ? item : murmurhash(item ?? {}, {
|
|
110
|
+
maxLength: 24
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
__name(getUniqueInputs, "getUniqueInputs");
|
|
114
|
+
var createLog = /* @__PURE__ */ __name((name, options = {}) => {
|
|
115
|
+
const logLevel = options.logLevel === null ? LogLevelLabel.SILENT : options.logLevel || LogLevelLabel.INFO;
|
|
116
|
+
if (logLevel === LogLevelLabel.SILENT) {
|
|
117
|
+
return noop;
|
|
118
|
+
}
|
|
119
|
+
if (options.customLogger) {
|
|
120
|
+
return options.customLogger;
|
|
121
|
+
}
|
|
122
|
+
return (type, ...args) => getLogFn(getLogLevel(type), {
|
|
123
|
+
...options,
|
|
124
|
+
logLevel
|
|
125
|
+
})(`${chalk.bold.hex(getColor("brand", options))(`${name ? kebabCase(name) : ""}${options.name ? `${name ? chalk.gray(" > ") : ""}${kebabCase(options.name)}` : ""}${chalk.gray(" > ")}`)}${args.join(" ")} `.trim());
|
|
126
|
+
}, "createLog");
|
|
127
|
+
var BADGE_COLORS = [
|
|
128
|
+
"#00A0DD",
|
|
129
|
+
"#6FCE4E",
|
|
130
|
+
"#FBBF24",
|
|
131
|
+
"#F43F5E",
|
|
132
|
+
"#3B82F6",
|
|
133
|
+
"#A855F7",
|
|
134
|
+
"#469592",
|
|
135
|
+
"#288EDF",
|
|
136
|
+
"#D8B4FE",
|
|
137
|
+
"#10B981",
|
|
138
|
+
"#EF4444",
|
|
139
|
+
"#F0EC56",
|
|
140
|
+
"#F472B6",
|
|
141
|
+
"#22D3EE",
|
|
142
|
+
"#EAB308",
|
|
143
|
+
"#84CC16",
|
|
144
|
+
"#F87171",
|
|
145
|
+
"#0EA5E9",
|
|
146
|
+
"#D946EF",
|
|
147
|
+
"#FACC15",
|
|
148
|
+
"#34D399",
|
|
149
|
+
"#8B5CF6"
|
|
150
|
+
];
|
|
151
|
+
var extendLog = /* @__PURE__ */ __name((logFn, name) => {
|
|
152
|
+
return (type, ...args) => logFn(type, ` ${chalk.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${titleCase(name)} `)} ${args.join(" ")} `);
|
|
153
|
+
}, "extendLog");
|
|
154
|
+
function getBaseFileHeader(context) {
|
|
155
|
+
return `
|
|
156
|
+
// Generated with ${titleCase(context.config.framework)}
|
|
157
|
+
// Note: Do not edit this file manually - it will be overwritten automatically
|
|
158
|
+
`;
|
|
159
|
+
}
|
|
160
|
+
__name(getBaseFileHeader, "getBaseFileHeader");
|
|
161
|
+
function getFileHeader(context, options = {}) {
|
|
162
|
+
const { directive = null, prettierIgnore = false } = options;
|
|
163
|
+
return `/* eslint-disable */
|
|
164
|
+
// biome-ignore lint: disable
|
|
165
|
+
${prettierIgnore ? `// prettier-ignore` : ""}${directive ? `
|
|
166
|
+
|
|
167
|
+
${directive}
|
|
168
|
+
` : "\n"}
|
|
169
|
+
${getBaseFileHeader(context)}
|
|
170
|
+
|
|
171
|
+
`;
|
|
172
|
+
}
|
|
173
|
+
__name(getFileHeader, "getFileHeader");
|
|
174
|
+
async function format(context, path, data, force = false) {
|
|
175
|
+
if (!force && (isParentPath(path, appendPath(context.config.output.outputPath, context.workspaceConfig.workspaceRoot)) || isParentPath(path, appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot)))) {
|
|
176
|
+
return data;
|
|
177
|
+
}
|
|
178
|
+
let code = data;
|
|
179
|
+
const resolvedConfig = await resolveConfig(path);
|
|
180
|
+
if (resolvedConfig) {
|
|
181
|
+
code = await format$1(data, {
|
|
182
|
+
absolutePath: path,
|
|
183
|
+
...resolvedConfig
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return code;
|
|
187
|
+
}
|
|
188
|
+
__name(format, "format");
|
|
189
|
+
async function formatFolder(context, path) {
|
|
190
|
+
if (!isParentPath(path, appendPath(context.config.output.outputPath, context.workspaceConfig.workspaceRoot)) && !isParentPath(path, appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot))) {
|
|
191
|
+
await Promise.allSettled((await listFiles(path)).map(async (file) => {
|
|
192
|
+
if (!isParentPath(file, appendPath(context.config.output.outputPath, context.workspaceConfig.workspaceRoot)) && !isParentPath(file, appendPath(context.config.output.buildPath, context.workspaceConfig.workspaceRoot))) {
|
|
193
|
+
const data = await context.fs.read(file);
|
|
194
|
+
if (data) {
|
|
195
|
+
const formatted = await format(context, file, data);
|
|
196
|
+
return context.fs.write(file, formatted);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}));
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
__name(formatFolder, "formatFolder");
|
|
203
|
+
new Diff();
|
|
204
|
+
async function loadWorkspaceConfig(workspaceRoot, cwd) {
|
|
205
|
+
return defu({
|
|
206
|
+
workspaceRoot
|
|
207
|
+
}, await getWorkspaceConfig(true, {
|
|
208
|
+
cwd,
|
|
209
|
+
workspaceRoot,
|
|
210
|
+
useDefault: true
|
|
211
|
+
}));
|
|
212
|
+
}
|
|
213
|
+
__name(loadWorkspaceConfig, "loadWorkspaceConfig");
|
|
214
|
+
async function loadUserConfigFile(projectRoot, workspaceRoot, jiti, command, mode = "production", configFile, framework = "powerlines") {
|
|
215
|
+
let resolvedUserConfig = {};
|
|
216
|
+
let resolvedUserConfigFile;
|
|
217
|
+
if (configFile) {
|
|
218
|
+
resolvedUserConfigFile = existsSync(replacePath(configFile, projectRoot)) ? replacePath(configFile, projectRoot) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), replacePath(configFile, projectRoot))) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), replacePath(configFile, projectRoot)) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), configFile)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), configFile) : void 0;
|
|
219
|
+
}
|
|
220
|
+
if (!resolvedUserConfigFile) {
|
|
221
|
+
resolvedUserConfigFile = existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.ts`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.ts`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.js`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.js`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mts`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mts`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mjs`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.${mode}.config.mjs`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.ts`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.ts`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.js`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.js`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.mts`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.mts`) : existsSync(joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.mjs`)) ? joinPaths$1(appendPath(projectRoot, workspaceRoot), `${framework}.config.mjs`) : void 0;
|
|
222
|
+
}
|
|
223
|
+
if (resolvedUserConfigFile) {
|
|
224
|
+
const resolved = await jiti.import(jiti.esmResolve(resolvedUserConfigFile));
|
|
225
|
+
if (resolved) {
|
|
226
|
+
let config = {};
|
|
227
|
+
if (isFunction(resolved)) {
|
|
228
|
+
config = await Promise.resolve(resolved({
|
|
229
|
+
command,
|
|
230
|
+
mode,
|
|
231
|
+
isSsrBuild: false,
|
|
232
|
+
isPreview: false
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
if (isSetObject(config)) {
|
|
236
|
+
resolvedUserConfig = {
|
|
237
|
+
...config,
|
|
238
|
+
config,
|
|
239
|
+
configFile: resolvedUserConfigFile
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
const result = await loadConfig({
|
|
245
|
+
cwd: projectRoot,
|
|
246
|
+
name: framework,
|
|
247
|
+
envName: mode,
|
|
248
|
+
globalRc: true,
|
|
249
|
+
packageJson: true,
|
|
250
|
+
dotenv: true,
|
|
251
|
+
jiti
|
|
252
|
+
});
|
|
253
|
+
return defu(resolvedUserConfig, isSetObject(result?.config) ? {
|
|
254
|
+
...result.config,
|
|
255
|
+
...result
|
|
256
|
+
} : {});
|
|
257
|
+
}
|
|
258
|
+
__name(loadUserConfigFile, "loadUserConfigFile");
|
|
259
|
+
|
|
260
|
+
export { CACHE_HASH_LENGTH, DEFAULT_ENVIRONMENT, GLOBAL_ENVIRONMENT, ROOT_HASH_LENGTH, createLog, extendLog, format, formatFolder, getFileHeader, getUniqueInputs, loadUserConfigFile, loadWorkspaceConfig, replacePathTokens, resolveEntriesSync };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEQMUIUSF_js = require('./chunk-EQMUIUSF.js');
|
|
4
4
|
|
|
5
5
|
// src/plugin/index.ts
|
|
6
|
-
var createNodesV2 =
|
|
6
|
+
var createNodesV2 = chunkEQMUIUSF_js.createNxPlugin({
|
|
7
7
|
framework: "powerlines"
|
|
8
8
|
});
|
|
9
9
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ROOT_HASH_LENGTH, loadUserConfigFile } from './chunk-JL4HQ7ZD.mjs';
|
|
2
2
|
import { CONFIG_INPUTS } from './chunk-IC47MFKB.mjs';
|
|
3
3
|
import { __name } from './chunk-O6YSETKJ.mjs';
|
|
4
4
|
import { createNodesFromFiles } from '@nx/devkit';
|
|
@@ -52,7 +52,7 @@ function createNxPlugin(opts) {
|
|
|
52
52
|
debug: !!options?.debug,
|
|
53
53
|
interopDefault: true,
|
|
54
54
|
fsCache: joinPaths(envPaths.cache, "nx-plugin", murmurhash(contextV2.workspaceRoot, {
|
|
55
|
-
maxLength:
|
|
55
|
+
maxLength: ROOT_HASH_LENGTH
|
|
56
56
|
}), "jiti"),
|
|
57
57
|
moduleCache: true
|
|
58
58
|
});
|
|
@@ -113,7 +113,7 @@ function createNxPlugin(opts) {
|
|
|
113
113
|
defaultConfiguration: options?.clean?.defaultConfiguration || "production",
|
|
114
114
|
options: {
|
|
115
115
|
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
116
|
-
projectType: projectConfig.projectType || userConfig.
|
|
116
|
+
projectType: projectConfig.projectType || userConfig.projectType,
|
|
117
117
|
autoInstall: userConfig.autoInstall
|
|
118
118
|
},
|
|
119
119
|
configurations: {
|
|
@@ -146,8 +146,8 @@ function createNxPlugin(opts) {
|
|
|
146
146
|
].filter(Boolean),
|
|
147
147
|
defaultConfiguration: options?.prepare?.defaultConfiguration || "production",
|
|
148
148
|
options: {
|
|
149
|
-
|
|
150
|
-
projectType: projectConfig.projectType || userConfig.
|
|
149
|
+
input: userConfig.input,
|
|
150
|
+
projectType: projectConfig.projectType || userConfig.projectType,
|
|
151
151
|
autoInstall: userConfig.autoInstall,
|
|
152
152
|
skipCache: userConfig.skipCache
|
|
153
153
|
},
|
|
@@ -181,9 +181,9 @@ function createNxPlugin(opts) {
|
|
|
181
181
|
].filter(Boolean),
|
|
182
182
|
defaultConfiguration: options?.build?.defaultConfiguration || "production",
|
|
183
183
|
options: {
|
|
184
|
-
|
|
184
|
+
input: userConfig.input,
|
|
185
185
|
outputPath: userConfig.output?.outputPath || "dist/{projectRoot}",
|
|
186
|
-
projectType: projectConfig.projectType || userConfig.
|
|
186
|
+
projectType: projectConfig.projectType || userConfig.projectType,
|
|
187
187
|
autoInstall: userConfig.autoInstall,
|
|
188
188
|
skipCache: userConfig.skipCache
|
|
189
189
|
},
|
|
@@ -223,8 +223,8 @@ function createNxPlugin(opts) {
|
|
|
223
223
|
].filter(Boolean),
|
|
224
224
|
defaultConfiguration: options?.lint?.defaultConfiguration || "production",
|
|
225
225
|
options: {
|
|
226
|
-
|
|
227
|
-
projectType: projectConfig.projectType || userConfig.
|
|
226
|
+
input: userConfig.input,
|
|
227
|
+
projectType: projectConfig.projectType || userConfig.projectType,
|
|
228
228
|
autoInstall: userConfig.autoInstall,
|
|
229
229
|
skipCache: userConfig.skipCache
|
|
230
230
|
},
|
|
@@ -265,8 +265,8 @@ function createNxPlugin(opts) {
|
|
|
265
265
|
].filter(Boolean),
|
|
266
266
|
defaultConfiguration: options?.docs?.defaultConfiguration || "production",
|
|
267
267
|
options: {
|
|
268
|
-
|
|
269
|
-
projectType: projectConfig.projectType || userConfig.
|
|
268
|
+
input: userConfig.input,
|
|
269
|
+
projectType: projectConfig.projectType || userConfig.projectType,
|
|
270
270
|
autoInstall: userConfig.autoInstall,
|
|
271
271
|
skipCache: userConfig.skipCache
|
|
272
272
|
},
|
|
@@ -306,8 +306,8 @@ function createNxPlugin(opts) {
|
|
|
306
306
|
].filter(Boolean),
|
|
307
307
|
defaultConfiguration: options?.deploy?.defaultConfiguration || "production",
|
|
308
308
|
options: {
|
|
309
|
-
|
|
310
|
-
projectType: projectConfig.projectType || userConfig.
|
|
309
|
+
input: userConfig.input,
|
|
310
|
+
projectType: projectConfig.projectType || userConfig.projectType,
|
|
311
311
|
autoInstall: userConfig.autoInstall,
|
|
312
312
|
skipCache: userConfig.skipCache
|
|
313
313
|
},
|
|
@@ -326,7 +326,7 @@ function createNxPlugin(opts) {
|
|
|
326
326
|
};
|
|
327
327
|
}
|
|
328
328
|
setDefaultProjectTags(projectConfig, name);
|
|
329
|
-
addProjectTag(projectConfig, framework, projectConfig.projectType || userConfig.
|
|
329
|
+
addProjectTag(projectConfig, framework, projectConfig.projectType || userConfig.projectType || "library", {
|
|
330
330
|
overwrite: true
|
|
331
331
|
});
|
|
332
332
|
if (opts?.verbose) {
|
|
@@ -336,7 +336,7 @@ function createNxPlugin(opts) {
|
|
|
336
336
|
projects: {
|
|
337
337
|
[root]: defu(projectConfig, {
|
|
338
338
|
name: kebabCase(userConfig.name),
|
|
339
|
-
projectType: userConfig.
|
|
339
|
+
projectType: userConfig.projectType || "library",
|
|
340
340
|
root,
|
|
341
341
|
sourceRoot: joinPaths(root, "src"),
|
|
342
342
|
targets
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkZVVHO24E_js = require('./chunk-ZVVHO24E.js');
|
|
4
4
|
var chunkSHUYVCID_js = require('./chunk-SHUYVCID.js');
|
|
5
5
|
var defu = require('defu');
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ var defu__default = /*#__PURE__*/_interopDefault(defu);
|
|
|
10
10
|
|
|
11
11
|
async function executorFn(context, api) {
|
|
12
12
|
await api.build(defu__default.default({
|
|
13
|
-
|
|
13
|
+
input: context.options.input,
|
|
14
14
|
skipCache: context.options.skipCache,
|
|
15
15
|
mode: context.options.mode
|
|
16
16
|
}, context.inlineConfig));
|
|
@@ -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 = chunkZVVHO24E_js.withExecutor("build", executorFn);
|
|
23
23
|
var executor_default = executor;
|
|
24
24
|
|
|
25
25
|
exports.executorFn = executorFn;
|