@nx/js 24.1.0-beta.1 → 24.1.0-beta.3
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/dist/internal.d.ts +2 -1
- package/dist/internal.js +8 -5
- package/dist/src/executors/copy-workspace-modules/copy-workspace-modules.js +40 -32
- package/dist/src/executors/prune-lockfile/prune-lockfile.js +105 -8
- package/dist/src/executors/release-publish/release-publish.impl.js +6 -1
- package/dist/src/migrations/update-23-2-0/add-pnpm-deploy-output-cache-inputs.d.ts +1 -6
- package/dist/src/migrations/update-23-2-0/add-pnpm-deploy-output-cache-inputs.js +4 -224
- package/dist/src/migrations/update-23-2-0/add-pnpm-prune-lockfile-cache-config.js +18 -297
- package/dist/src/migrations/update-24-1-0/add-bun-deploy-output-cache-inputs.d.ts +8 -0
- package/dist/src/migrations/update-24-1-0/add-bun-deploy-output-cache-inputs.js +21 -0
- package/dist/src/migrations/update-24-1-0/add-bun-deploy-output-cache-inputs.md +49 -0
- package/dist/src/migrations/update-24-1-0/add-bun-prune-lockfile-cache-config.d.ts +2 -0
- package/dist/src/migrations/update-24-1-0/add-bun-prune-lockfile-cache-config.js +28 -0
- package/dist/src/migrations/update-24-1-0/add-bun-prune-lockfile-cache-config.md +44 -0
- package/dist/src/plugins/typescript/plugin.js +58 -5
- package/dist/src/plugins/typescript/typecheck-target.d.ts +6 -0
- package/dist/src/plugins/typescript/typecheck-target.js +7 -5
- package/dist/src/release/version-actions.js +6 -0
- package/dist/src/utils/bun-install-settings-inputs.d.ts +20 -0
- package/dist/src/utils/bun-install-settings-inputs.js +31 -0
- package/dist/src/utils/deploy-output-cache-inputs.d.ts +35 -0
- package/dist/src/utils/deploy-output-cache-inputs.js +400 -0
- package/dist/src/utils/pnpm-install-settings-inputs.d.ts +0 -6
- package/dist/src/utils/pnpm-install-settings-inputs.js +0 -6
- package/dist/src/utils/prune-lockfile-cache-config.d.ts +18 -0
- package/dist/src/utils/prune-lockfile-cache-config.js +288 -0
- package/dist/src/utils/target-defaults-matching.d.ts +3 -0
- package/dist/src/utils/target-defaults-matching.js +7 -0
- package/dist/src/utils/workspace-module-sections.d.ts +10 -5
- package/dist/src/utils/workspace-module-sections.js +15 -6
- package/migrations.json +14 -2
- package/package.json +20 -12
- package/dist/src/utils/pnpm-deploy-output-cache-inputs.d.ts +0 -29
- package/dist/src/utils/pnpm-deploy-output-cache-inputs.js +0 -177
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addPruneLockfileCacheConfig = addPruneLockfileCacheConfig;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const target_defaults_matching_1 = require("./target-defaults-matching");
|
|
7
|
+
const PRUNE_LOCKFILE_EXECUTOR = '@nx/js:prune-lockfile';
|
|
8
|
+
/**
|
|
9
|
+
* Adds `artifacts` to the `outputs` of `@nx/js:prune-lockfile` targets that
|
|
10
|
+
* declare `lockFile`, and `rootInputs` to their `inputs`, on whichever layer
|
|
11
|
+
* (the target or a `targetDefaults` entry) the runtime reads each from.
|
|
12
|
+
*/
|
|
13
|
+
function addPruneLockfileCacheConfig(tree, config) {
|
|
14
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
15
|
+
const targetDefaults = nxJson?.targetDefaults;
|
|
16
|
+
const pruneTargets = [];
|
|
17
|
+
const projects = new Map();
|
|
18
|
+
const changedProjects = new Set();
|
|
19
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree)) {
|
|
20
|
+
projects.set(projectName, project);
|
|
21
|
+
const projectNode = {
|
|
22
|
+
name: projectName,
|
|
23
|
+
type: 'lib',
|
|
24
|
+
data: { root: project.root, tags: project.tags },
|
|
25
|
+
};
|
|
26
|
+
for (const [targetName, target] of Object.entries(project.targets ?? {})) {
|
|
27
|
+
// The executor may come from a matching targetDefaults entry rather
|
|
28
|
+
// than the target itself. A `command` target resolves to nx:run-commands
|
|
29
|
+
// before defaults apply, so a default can never make it a prune target.
|
|
30
|
+
const executor = target.executor ??
|
|
31
|
+
(target.command
|
|
32
|
+
? 'nx:run-commands'
|
|
33
|
+
: (0, target_defaults_matching_1.resolveDefaultsExecutor)(targetName, projectName, projectNode, targetDefaults, PRUNE_LOCKFILE_EXECUTOR));
|
|
34
|
+
if (executor !== PRUNE_LOCKFILE_EXECUTOR) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
pruneTargets.push({
|
|
38
|
+
targetName,
|
|
39
|
+
projectName,
|
|
40
|
+
projectNode,
|
|
41
|
+
matcherExecutor: target.executor,
|
|
42
|
+
target,
|
|
43
|
+
});
|
|
44
|
+
if (appendPruneOutputs(target, config)) {
|
|
45
|
+
changedProjects.add(projectName);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
let defaultsChanged = false;
|
|
50
|
+
// runtime applies only the first key that resolves for a target (executor,
|
|
51
|
+
// exact name, then longest glob), so anchor each prune target to its
|
|
52
|
+
// selected key
|
|
53
|
+
const keyedPruneTargets = pruneTargets.map((ref) => ({
|
|
54
|
+
ref,
|
|
55
|
+
selectedKey: targetDefaults
|
|
56
|
+
? (0, target_defaults_matching_1.selectDefaultsKey)(ref, targetDefaults, PRUNE_LOCKFILE_EXECUTOR)
|
|
57
|
+
: null,
|
|
58
|
+
}));
|
|
59
|
+
if (targetDefaults) {
|
|
60
|
+
for (const [key, value] of Object.entries(targetDefaults)) {
|
|
61
|
+
// a value may be the plain object form or the filtered array form
|
|
62
|
+
for (const entry of Array.isArray(value) ? value : [value]) {
|
|
63
|
+
if (!appliesToPruneLockfileTargets(key, entry, keyedPruneTargets)) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
defaultsChanged = appendPruneOutputs(entry, config) || defaultsChanged;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
// `inputs` is decided separately from `outputs`, because the two can be
|
|
71
|
+
// authored on different layers and a target's own `inputs` replaces the
|
|
72
|
+
// defaults' array rather than merging with it. The sources are only ever
|
|
73
|
+
// appended to an array that already exists, or written with nx's default as
|
|
74
|
+
// the base when no layer declares one. The migration never authors a `'...'`
|
|
75
|
+
// of its own: whether the entry it would expand against survives depends on
|
|
76
|
+
// the document-order identity resets in nx's own merge, and a spread that
|
|
77
|
+
// ends up with nothing to expand narrows the target to the root sources.
|
|
78
|
+
for (const { ref, selectedKey } of keyedPruneTargets) {
|
|
79
|
+
const entries = (0, target_defaults_matching_1.compatibleDefaultsEntries)(ref, selectedKey, targetDefaults);
|
|
80
|
+
const defaults = entries.length
|
|
81
|
+
? (0, internal_1.readTargetDefaultsForTarget)(ref.targetName, { [selectedKey]: entries }, ref.matcherExecutor, { projectName: ref.projectName, projectNode: ref.projectNode })
|
|
82
|
+
: null;
|
|
83
|
+
// The effective outputs, not the target's own array: a target inheriting
|
|
84
|
+
// its lockfile entry, or spreading the defaults' outputs into its own, is
|
|
85
|
+
// still this package manager's prune target.
|
|
86
|
+
const effective = (0, internal_1.mergeTargetConfigurations)(ref.target, defaults ?? {});
|
|
87
|
+
if (!declaresLockfile(effective.outputs, config.lockFile)) {
|
|
88
|
+
continue;
|
|
89
|
+
}
|
|
90
|
+
if (ref.target.inputs !== undefined) {
|
|
91
|
+
// A target's own array wins outright, so nothing else can carry them.
|
|
92
|
+
if (addRootSettingsInputs(ref.target, config.rootInputs, effective.inputs)) {
|
|
93
|
+
changedProjects.add(ref.projectName);
|
|
94
|
+
}
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
// Otherwise they belong to the entry supplying the array the target
|
|
98
|
+
// inherits, which is the last matching one declaring `inputs`.
|
|
99
|
+
const supplier = (0, target_defaults_matching_1.lastMatchingInputsSupplier)(ref, selectedKey, entries);
|
|
100
|
+
if (supplier) {
|
|
101
|
+
defaultsChanged =
|
|
102
|
+
addRootSettingsInputs(supplier, config.rootInputs, effective.inputs) ||
|
|
103
|
+
defaultsChanged;
|
|
104
|
+
}
|
|
105
|
+
else if (addRootSettingsInputs(ref.target, config.rootInputs, effective.inputs)) {
|
|
106
|
+
changedProjects.add(ref.projectName);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
// A workspace configuring its prune targets purely through `targetDefaults`
|
|
110
|
+
// has no concrete target to carry the decision above.
|
|
111
|
+
if (targetDefaults && pruneTargets.length === 0) {
|
|
112
|
+
for (const [key, value] of Object.entries(targetDefaults)) {
|
|
113
|
+
const entries = Array.isArray(value) ? value : [value];
|
|
114
|
+
// The key qualifies only when it locates the executor without a
|
|
115
|
+
// concrete target to resolve against: the key itself, an entry pinning
|
|
116
|
+
// it, or an entry filtering on it. Every identity-compatible sibling
|
|
117
|
+
// still merges for such a target, an identity-neutral one included.
|
|
118
|
+
const compatible = entries.filter(entryIdentityCompatible);
|
|
119
|
+
const locatesExecutor = key === PRUNE_LOCKFILE_EXECUTOR ||
|
|
120
|
+
compatible.some((entry) => entry.executor === PRUNE_LOCKFILE_EXECUTOR ||
|
|
121
|
+
entry.filter?.executor === PRUNE_LOCKFILE_EXECUTOR);
|
|
122
|
+
if (!locatesExecutor ||
|
|
123
|
+
!compatible.some((entry) => declaresLockfile(entry.outputs, config.lockFile))) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
// Every compatible entry declaring `inputs` can be the array a future
|
|
127
|
+
// target inherits (a later filtered one replaces it for its projects),
|
|
128
|
+
// so each carries the sources itself; a sibling's array covers nothing
|
|
129
|
+
// unless a `'...'` spread pulls it in, in which case only the strictly
|
|
130
|
+
// filter-less earlier entries are the base it expands against: a
|
|
131
|
+
// filtered one supplies nothing to the targets its filter excludes,
|
|
132
|
+
// an executor filter failing for a target whose executor a sibling
|
|
133
|
+
// supplies (earlier entries are updated first, so the base is checked
|
|
134
|
+
// with the sources already added).
|
|
135
|
+
const suppliers = compatible.filter((entry) => entry.inputs !== undefined);
|
|
136
|
+
for (const [index, entry] of compatible.entries()) {
|
|
137
|
+
if (entry.inputs === undefined) {
|
|
138
|
+
continue;
|
|
139
|
+
}
|
|
140
|
+
const reference = entry.inputs.includes('...')
|
|
141
|
+
? [
|
|
142
|
+
...entry.inputs,
|
|
143
|
+
...compatible
|
|
144
|
+
.slice(0, index)
|
|
145
|
+
.filter((earlier) => !earlier.filter)
|
|
146
|
+
.flatMap((earlier) => earlier.inputs ?? []),
|
|
147
|
+
]
|
|
148
|
+
: entry.inputs;
|
|
149
|
+
defaultsChanged =
|
|
150
|
+
addRootSettingsInputs(entry, config.rootInputs, reference) ||
|
|
151
|
+
defaultsChanged;
|
|
152
|
+
}
|
|
153
|
+
// Targets no filtered supplier matches fall back to nx's own default
|
|
154
|
+
// when no filter-less entry declares an array, so the spelled-out
|
|
155
|
+
// default is prepended as its own entry: prepending keeps it from
|
|
156
|
+
// replacing a later supplier's array. A prepended carrier must match
|
|
157
|
+
// only targets an existing entry already matched, or the key starts
|
|
158
|
+
// winning selection for targets that previously fell through to their
|
|
159
|
+
// name or glob defaults. That holds under an executor key with a
|
|
160
|
+
// filter-less entry (a neutral carrier), and under a name or glob key
|
|
161
|
+
// with a filter-less pin (a pinned carrier, which a same-name target of
|
|
162
|
+
// another executor cannot inherit). An all-filtered array gets no
|
|
163
|
+
// fallback: any carrier would widen the key. The object form has no
|
|
164
|
+
// room to prepend; its single filter-less entry carries it instead.
|
|
165
|
+
if (!suppliers.some((supplier) => !supplier.filter)) {
|
|
166
|
+
const canCarry = key === PRUNE_LOCKFILE_EXECUTOR
|
|
167
|
+
? compatible.some((entry) => !entry.filter)
|
|
168
|
+
: compatible.some((entry) => !entry.filter && entry.executor === PRUNE_LOCKFILE_EXECUTOR);
|
|
169
|
+
if (canCarry) {
|
|
170
|
+
if (Array.isArray(value)) {
|
|
171
|
+
const fallback = key === PRUNE_LOCKFILE_EXECUTOR
|
|
172
|
+
? {}
|
|
173
|
+
: { executor: PRUNE_LOCKFILE_EXECUTOR };
|
|
174
|
+
addRootSettingsInputs(fallback, config.rootInputs, []);
|
|
175
|
+
value.unshift(fallback);
|
|
176
|
+
defaultsChanged = true;
|
|
177
|
+
}
|
|
178
|
+
else {
|
|
179
|
+
defaultsChanged =
|
|
180
|
+
addRootSettingsInputs(value, config.rootInputs, []) ||
|
|
181
|
+
defaultsChanged;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
for (const projectName of changedProjects) {
|
|
188
|
+
(0, devkit_1.updateProjectConfiguration)(tree, projectName, projects.get(projectName));
|
|
189
|
+
}
|
|
190
|
+
if (defaultsChanged) {
|
|
191
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
function declaresLockfile(outputs, lockFile) {
|
|
195
|
+
return lockfileEntry(outputs, lockFile) !== undefined;
|
|
196
|
+
}
|
|
197
|
+
function lockfileEntry(outputs, lockFile) {
|
|
198
|
+
return outputs?.find((output) => typeof output === 'string' &&
|
|
199
|
+
!output.startsWith('!') &&
|
|
200
|
+
(output === lockFile || output.endsWith(`/${lockFile}`)));
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Adds the workspace root sources the artifacts are built from, skipping any
|
|
204
|
+
* the target already hashes: a `'...'` in the owner's array can carry one in
|
|
205
|
+
* from the layer below, where a check against the owner's own entries cannot
|
|
206
|
+
* see it. An absent `inputs` means nx's own default, so that is spelled out
|
|
207
|
+
* before adding to it rather than narrowing the configuration to the root
|
|
208
|
+
* sources alone.
|
|
209
|
+
*/
|
|
210
|
+
function addRootSettingsInputs(config, rootInputs, referenceInputs = []) {
|
|
211
|
+
const alreadyHashed = (0, target_defaults_matching_1.namedFilesets)(referenceInputs);
|
|
212
|
+
const missing = rootInputs.filter((input) => typeof input === 'string'
|
|
213
|
+
? !alreadyHashed.has(input) && !config.inputs?.includes(input)
|
|
214
|
+
: !(0, target_defaults_matching_1.hasRuntimeInput)(referenceInputs, input) &&
|
|
215
|
+
!(0, target_defaults_matching_1.hasRuntimeInput)(config.inputs, input));
|
|
216
|
+
if (missing.length === 0) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
config.inputs = [...(config.inputs ?? target_defaults_matching_1.DEFAULT_INPUTS), ...missing];
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Whether a `targetDefaults` entry applies to `@nx/js:prune-lockfile` targets,
|
|
224
|
+
* mirroring nx's runtime matching: the entry's `filter` and merge-time
|
|
225
|
+
* payload compatibility are evaluated first, then the entry must sit under a
|
|
226
|
+
* prune target's selected key and match its context. Entries locating the
|
|
227
|
+
* executor (key, `executor` field, or `filter.executor`) match without a
|
|
228
|
+
* concrete target so a defaults-only workspace still gets the update. The
|
|
229
|
+
* in-key merge accumulation (identity replacement, outputs replacement, `...`
|
|
230
|
+
* spreads) is deliberately not replicated: an entry the merge ends up
|
|
231
|
+
* discarding for the prune target may still get the artifacts appended, which
|
|
232
|
+
* is additive-only for the target's own replay.
|
|
233
|
+
*/
|
|
234
|
+
function appliesToPruneLockfileTargets(key, config, pruneTargets) {
|
|
235
|
+
if (!entryIdentityCompatible(config)) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
const filter = config.filter;
|
|
239
|
+
if (pruneTargets.length === 0) {
|
|
240
|
+
const locatesExecutor = key === PRUNE_LOCKFILE_EXECUTOR ||
|
|
241
|
+
config.executor === PRUNE_LOCKFILE_EXECUTOR ||
|
|
242
|
+
filter?.executor === PRUNE_LOCKFILE_EXECUTOR;
|
|
243
|
+
return locatesExecutor && !filter?.projects;
|
|
244
|
+
}
|
|
245
|
+
return pruneTargets.some(({ ref, selectedKey }) => selectedKey === key &&
|
|
246
|
+
(0, internal_1.readTargetDefaultsForTarget)(ref.targetName, { [key]: [config] }, ref.matcherExecutor, { projectName: ref.projectName, projectNode: ref.projectNode }) !== null);
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Whether a `targetDefaults` entry can merge into an `@nx/js:prune-lockfile`
|
|
250
|
+
* target at all: a filter or payload pinning another executor or a command
|
|
251
|
+
* identity never does (isCompatibleTarget), and prune-lockfile targets are
|
|
252
|
+
* always explicitly configured, never inferred, so a plugin-filtered entry
|
|
253
|
+
* never applies either.
|
|
254
|
+
*/
|
|
255
|
+
function entryIdentityCompatible(config) {
|
|
256
|
+
const filter = config.filter;
|
|
257
|
+
if (filter?.executor && filter.executor !== PRUNE_LOCKFILE_EXECUTOR) {
|
|
258
|
+
return false;
|
|
259
|
+
}
|
|
260
|
+
if (filter?.plugin) {
|
|
261
|
+
return false;
|
|
262
|
+
}
|
|
263
|
+
return !((config.executor && config.executor !== PRUNE_LOCKFILE_EXECUTOR) ||
|
|
264
|
+
config.command);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Appends the artifacts next to an existing lockfile entry, reusing that
|
|
268
|
+
* entry's own path spelling. Configurations with no `outputs` or no entry for
|
|
269
|
+
* the lockfile are left alone: the lockfile entry is what identifies the
|
|
270
|
+
* target as this package manager's, and one without `outputs` caches nothing
|
|
271
|
+
* to begin with.
|
|
272
|
+
*/
|
|
273
|
+
function appendPruneOutputs(target, config) {
|
|
274
|
+
const entry = lockfileEntry(target.outputs, config.lockFile);
|
|
275
|
+
if (!entry) {
|
|
276
|
+
return false;
|
|
277
|
+
}
|
|
278
|
+
const prefix = entry.slice(0, -config.lockFile.length);
|
|
279
|
+
let changed = false;
|
|
280
|
+
for (const artifact of config.artifacts) {
|
|
281
|
+
const output = `${prefix}${artifact}`;
|
|
282
|
+
if (!target.outputs.includes(output)) {
|
|
283
|
+
target.outputs.push(output);
|
|
284
|
+
changed = true;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return changed;
|
|
288
|
+
}
|
|
@@ -38,6 +38,9 @@ export declare function compatibleDefaultsEntries(ref: MatchedTargetRef, selecte
|
|
|
38
38
|
export declare function lastMatchingInputsSupplier(ref: MatchedTargetRef, selectedKey: string, entries: TargetDefaultArrayEntry[]): TargetDefaultArrayEntry | undefined;
|
|
39
39
|
/** The plain filesets an inputs array names, for a containment check. */
|
|
40
40
|
export declare function namedFilesets(inputs: TargetConfiguration['inputs']): ReadonlySet<string>;
|
|
41
|
+
export declare function hasRuntimeInput(inputs: TargetConfiguration['inputs'], input: {
|
|
42
|
+
runtime: string;
|
|
43
|
+
}): boolean;
|
|
41
44
|
/**
|
|
42
45
|
* The executor an executor-less target ends up with after its selected
|
|
43
46
|
* defaults key applies. Each matching entry's identity is resolved like the
|
|
@@ -4,6 +4,7 @@ exports.DEFAULT_INPUTS = void 0;
|
|
|
4
4
|
exports.compatibleDefaultsEntries = compatibleDefaultsEntries;
|
|
5
5
|
exports.lastMatchingInputsSupplier = lastMatchingInputsSupplier;
|
|
6
6
|
exports.namedFilesets = namedFilesets;
|
|
7
|
+
exports.hasRuntimeInput = hasRuntimeInput;
|
|
7
8
|
exports.resolveDefaultsExecutor = resolveDefaultsExecutor;
|
|
8
9
|
exports.selectDefaultsKey = selectDefaultsKey;
|
|
9
10
|
const internal_1 = require("@nx/devkit/internal");
|
|
@@ -51,6 +52,12 @@ function lastMatchingInputsSupplier(ref, selectedKey, entries) {
|
|
|
51
52
|
function namedFilesets(inputs) {
|
|
52
53
|
return new Set((inputs ?? []).filter((input) => typeof input === 'string'));
|
|
53
54
|
}
|
|
55
|
+
function hasRuntimeInput(inputs, input) {
|
|
56
|
+
return (inputs ?? []).some((existing) => typeof existing === 'object' &&
|
|
57
|
+
existing !== null &&
|
|
58
|
+
'runtime' in existing &&
|
|
59
|
+
existing.runtime === input.runtime);
|
|
60
|
+
}
|
|
54
61
|
/**
|
|
55
62
|
* The executor an executor-less target ends up with after its selected
|
|
56
63
|
* defaults key applies. Each matching entry's identity is resolved like the
|
|
@@ -7,10 +7,15 @@
|
|
|
7
7
|
* because pnpm rejects a `file:` spec under peerDependencies (a peer-declared
|
|
8
8
|
* workspace module is installed as a regular dependency instead). A
|
|
9
9
|
* `workspace:*` spec left in any of them fails `pnpm install --frozen-lockfile`
|
|
10
|
-
* (#35425). Transitive copies recurse over
|
|
11
|
-
*
|
|
12
|
-
* since pnpm installs a transitive dependency's optional and auto-installed peer
|
|
13
|
-
* deps but never its devDependencies; a transitive workspace-module peer is
|
|
14
|
-
* moved into dependencies the same way.
|
|
10
|
+
* (#35425). Transitive copies recurse over TRANSITIVE_INSTALL_SECTIONS; a
|
|
11
|
+
* transitive workspace-module peer is moved into dependencies the same way.
|
|
15
12
|
*/
|
|
16
13
|
export declare const WORKSPACE_MODULE_INSTALL_SECTIONS: readonly ["dependencies", "optionalDependencies", "devDependencies", "peerDependencies"];
|
|
14
|
+
/**
|
|
15
|
+
* Sections of a copied module's own manifest whose workspace-module deps are
|
|
16
|
+
* copied too. pnpm installs a transitive dependency's regular, optional, and
|
|
17
|
+
* auto-installed peer deps (a workspace peer is linked and recorded under the
|
|
18
|
+
* depending importer's dependencies in the lockfile), but never its
|
|
19
|
+
* devDependencies.
|
|
20
|
+
*/
|
|
21
|
+
export declare const TRANSITIVE_INSTALL_SECTIONS: readonly ["dependencies", "optionalDependencies", "peerDependencies"];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.WORKSPACE_MODULE_INSTALL_SECTIONS = void 0;
|
|
3
|
+
exports.TRANSITIVE_INSTALL_SECTIONS = exports.WORKSPACE_MODULE_INSTALL_SECTIONS = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* App-level dependency sections that can declare a workspace module the pruned
|
|
6
6
|
* standalone output must install. copy-workspace-modules copies the module from
|
|
@@ -10,11 +10,8 @@ exports.WORKSPACE_MODULE_INSTALL_SECTIONS = void 0;
|
|
|
10
10
|
* because pnpm rejects a `file:` spec under peerDependencies (a peer-declared
|
|
11
11
|
* workspace module is installed as a regular dependency instead). A
|
|
12
12
|
* `workspace:*` spec left in any of them fails `pnpm install --frozen-lockfile`
|
|
13
|
-
* (#35425). Transitive copies recurse over
|
|
14
|
-
*
|
|
15
|
-
* since pnpm installs a transitive dependency's optional and auto-installed peer
|
|
16
|
-
* deps but never its devDependencies; a transitive workspace-module peer is
|
|
17
|
-
* moved into dependencies the same way.
|
|
13
|
+
* (#35425). Transitive copies recurse over TRANSITIVE_INSTALL_SECTIONS; a
|
|
14
|
+
* transitive workspace-module peer is moved into dependencies the same way.
|
|
18
15
|
*/
|
|
19
16
|
exports.WORKSPACE_MODULE_INSTALL_SECTIONS = [
|
|
20
17
|
'dependencies',
|
|
@@ -22,3 +19,15 @@ exports.WORKSPACE_MODULE_INSTALL_SECTIONS = [
|
|
|
22
19
|
'devDependencies',
|
|
23
20
|
'peerDependencies',
|
|
24
21
|
];
|
|
22
|
+
/**
|
|
23
|
+
* Sections of a copied module's own manifest whose workspace-module deps are
|
|
24
|
+
* copied too. pnpm installs a transitive dependency's regular, optional, and
|
|
25
|
+
* auto-installed peer deps (a workspace peer is linked and recorded under the
|
|
26
|
+
* depending importer's dependencies in the lockfile), but never its
|
|
27
|
+
* devDependencies.
|
|
28
|
+
*/
|
|
29
|
+
exports.TRANSITIVE_INSTALL_SECTIONS = [
|
|
30
|
+
'dependencies',
|
|
31
|
+
'optionalDependencies',
|
|
32
|
+
'peerDependencies',
|
|
33
|
+
];
|
package/migrations.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"version": "23.1.0-beta.8",
|
|
34
34
|
"description": "Adds `\"ignoreDeprecations\": \"6.0\"` to tsconfig files whose compilerOptions (or ts-node.compilerOptions) carry a TypeScript 6 deprecated option value, set directly or inherited through `extends` including from a base this migration does not edit (e.g. moduleResolution node/node10/classic, baseUrl, target es5, esModuleInterop false, outFile, module amd/umd/system/none, alwaysStrict false, allowSyntheticDefaultImports false, downlevelIteration set). Also pins `\"strict\": false`, `\"noUncheckedSideEffectImports\": false`, `\"types\": [\"*\"]`, and `\"esModuleInterop\": false` in chain-root tsconfigs (no \"extends\") that lack each key, preserving pre-TS6 behavior where these defaults changed; `esModuleInterop` false is itself deprecated (removed in TS7) so it also receives `ignoreDeprecations`, deferring the interop change to the TS7 migration. Also adds `ignoreDeprecations` to every `tsconfig.json` (the exact name jest/ts-node auto-resolve when compiling a config file; ts-node injects a deprecated default `target: es5` there, so the load can hit a TS6 error even on a clean config), even one with no deprecated value of its own; a stale local `ignoreDeprecations` (e.g. `5.0`) that would otherwise override the inherited flag is upgraded.",
|
|
35
35
|
"requires": {
|
|
36
|
-
"typescript": "
|
|
36
|
+
"typescript": "^6.0.0"
|
|
37
37
|
},
|
|
38
38
|
"factory": "./dist/src/migrations/update-23-1-0/add-ignore-deprecations-for-ts6",
|
|
39
39
|
"documentation": "./dist/src/migrations/update-23-1-0/add-ignore-deprecations-for-ts6.md"
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"version": "23.1.0-rc.2",
|
|
43
43
|
"description": "Sets an explicit `rootDir` on project `tsconfig*.json` files that lack one, pinned to the source directory TypeScript 5 inferred implicitly, so programs keep compiling and emitting the same layout under TypeScript 6, which otherwise hard-fails with TS5011 or TS6059 (for example a spec tsconfig importing another project's source through a `paths` alias). The pin is written even when the inferred directory already equals the tsconfig directory, because tools like ts-jest with `isolatedModules` compile a program per file and re-infer a deeper directory from that subset. The value is computed by the compiler, so emit layout is unchanged. Each config is written on its own; the migration never writes to a shared `extends` base, so a config never inherits a value computed for a sibling. Composite projects are pinned to their own directory: `rootDir` already defaults there under `tsc` so it is a no-op for a real composite build, but ts-jest strips `composite` for its per-file transpile and the explicit value is needed to avoid TS5011 there.",
|
|
44
44
|
"requires": {
|
|
45
|
-
"typescript": "
|
|
45
|
+
"typescript": "^6.0.0"
|
|
46
46
|
},
|
|
47
47
|
"factory": "./dist/src/migrations/update-23-1-0/set-tsconfig-root-dir-for-ts6",
|
|
48
48
|
"documentation": "./dist/src/migrations/update-23-1-0/set-tsconfig-root-dir-for-ts6.md"
|
|
@@ -70,6 +70,18 @@
|
|
|
70
70
|
"description": "Enables JWT API tokens in Verdaccio config files used by `@nx/js:verdaccio` targets, so Verdaccio 7+ accepts the placeholder npm auth token that Nx sets for the local registry.",
|
|
71
71
|
"implementation": "./dist/src/migrations/update-24-1-0/add-verdaccio-jwt-security",
|
|
72
72
|
"documentation": "./dist/src/migrations/update-24-1-0/add-verdaccio-jwt-security.md"
|
|
73
|
+
},
|
|
74
|
+
"update-24-1-0-add-bun-prune-lockfile-cache-config": {
|
|
75
|
+
"version": "24.1.0-beta.2",
|
|
76
|
+
"description": "Add the patches and local_path_modules paths to the outputs of @nx/js:prune-lockfile targets that declare a bun.lock or bun.lockb output (adding bun.lock next to a bun.lockb one), and the workspace root package.json to their inputs, so a cache replay restores the bun patch files and vendored local-path dependencies the executor now emits, and a change to the root trustedDependencies does not replay a stale output.",
|
|
77
|
+
"implementation": "./dist/src/migrations/update-24-1-0/add-bun-prune-lockfile-cache-config",
|
|
78
|
+
"documentation": "./dist/src/migrations/update-24-1-0/add-bun-prune-lockfile-cache-config.md"
|
|
79
|
+
},
|
|
80
|
+
"update-24-1-0-add-bun-deploy-output-cache-inputs": {
|
|
81
|
+
"version": "24.1.0-beta.2",
|
|
82
|
+
"description": "Add the trustedDependencies and patchedDependencies fields of the root package.json to the inputs of build targets that emit the pruned Bun deploy output (esbuild with generatePackageJson, tsc and swc with generateLockfile, and project or targetDefaults entries replacing the inputs of inferred webpack and rspack builds) in workspaces on bun.lock or the binary bun.lockb, so removing a package from trustedDependencies does not replay a cached output that still trusts it.",
|
|
83
|
+
"implementation": "./dist/src/migrations/update-24-1-0/add-bun-deploy-output-cache-inputs",
|
|
84
|
+
"documentation": "./dist/src/migrations/update-24-1-0/add-bun-deploy-output-cache-inputs.md"
|
|
73
85
|
}
|
|
74
86
|
},
|
|
75
87
|
"packageJsonUpdates": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/js",
|
|
3
|
-
"version": "24.1.0-beta.
|
|
3
|
+
"version": "24.1.0-beta.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"files": [
|
|
@@ -162,8 +162,8 @@
|
|
|
162
162
|
"@babel/preset-env": "^7.23.2",
|
|
163
163
|
"@babel/preset-typescript": "^7.22.5",
|
|
164
164
|
"@babel/runtime": "^7.22.6",
|
|
165
|
-
"@nx/devkit": "24.1.0-beta.
|
|
166
|
-
"@nx/workspace": "24.1.0-beta.
|
|
165
|
+
"@nx/devkit": "24.1.0-beta.3",
|
|
166
|
+
"@nx/workspace": "24.1.0-beta.3",
|
|
167
167
|
"@zkochan/js-yaml": "0.0.7",
|
|
168
168
|
"babel-plugin-const-enum": "^1.0.1",
|
|
169
169
|
"babel-plugin-macros": "^3.1.0",
|
|
@@ -183,18 +183,20 @@
|
|
|
183
183
|
"tslib": "^2.3.0"
|
|
184
184
|
},
|
|
185
185
|
"devDependencies": {
|
|
186
|
-
"@nx/esbuild": "24.1.0-beta.
|
|
187
|
-
"@nx/eslint": "24.1.0-beta.
|
|
188
|
-
"@nx/jest": "24.1.0-beta.
|
|
189
|
-
"@nx/oxlint": "24.1.0-beta.
|
|
190
|
-
"@nx/rollup": "24.1.0-beta.
|
|
191
|
-
"@nx/vite": "24.1.0-beta.
|
|
192
|
-
"@nx/vitest": "24.1.0-beta.
|
|
193
|
-
"nx": "24.1.0-beta.
|
|
186
|
+
"@nx/esbuild": "24.1.0-beta.3",
|
|
187
|
+
"@nx/eslint": "24.1.0-beta.3",
|
|
188
|
+
"@nx/jest": "24.1.0-beta.3",
|
|
189
|
+
"@nx/oxlint": "24.1.0-beta.3",
|
|
190
|
+
"@nx/rollup": "24.1.0-beta.3",
|
|
191
|
+
"@nx/vite": "24.1.0-beta.3",
|
|
192
|
+
"@nx/vitest": "24.1.0-beta.3",
|
|
193
|
+
"nx": "24.1.0-beta.3"
|
|
194
194
|
},
|
|
195
195
|
"peerDependencies": {
|
|
196
196
|
"@swc/cli": ">=0.6.0 <0.9.0",
|
|
197
|
-
"verdaccio": "^6.0.5 || ^7.0.0"
|
|
197
|
+
"verdaccio": "^6.0.5 || ^7.0.0",
|
|
198
|
+
"nx": "24.1.0-beta.3",
|
|
199
|
+
"typescript": "^5.8.0 || ^6.0.0"
|
|
198
200
|
},
|
|
199
201
|
"peerDependenciesMeta": {
|
|
200
202
|
"@swc/cli": {
|
|
@@ -202,6 +204,12 @@
|
|
|
202
204
|
},
|
|
203
205
|
"verdaccio": {
|
|
204
206
|
"optional": true
|
|
207
|
+
},
|
|
208
|
+
"nx": {
|
|
209
|
+
"optional": true
|
|
210
|
+
},
|
|
211
|
+
"typescript": {
|
|
212
|
+
"optional": true
|
|
205
213
|
}
|
|
206
214
|
},
|
|
207
215
|
"publishConfig": {
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import type { TargetDefaults } from '@nx/devkit';
|
|
2
|
-
import { type MatchedTargetRef } from './target-defaults-matching';
|
|
3
|
-
/**
|
|
4
|
-
* Adds the missing `PNPM_INSTALL_SETTINGS_INPUTS` to the layer whose `inputs`
|
|
5
|
-
* array the runtime actually uses for this target: the target's own `inputs`
|
|
6
|
-
* when it declares them (its array replaces the defaults' rather than merging
|
|
7
|
-
* with it), otherwise the matching `targetDefaults` entry supplying the array
|
|
8
|
-
* it inherits, and otherwise the target itself with nx's own default spelled
|
|
9
|
-
* out first, so nothing that was hashed stops being hashed. Sources the
|
|
10
|
-
* effective inputs already hash, including via a whole-file root package.json
|
|
11
|
-
* fileset or a `json` input covering the settings fields, are left alone; no
|
|
12
|
-
* `'...'` is ever authored. Returns which layer was mutated, or null when
|
|
13
|
-
* nothing was missing.
|
|
14
|
-
*/
|
|
15
|
-
export declare function addPnpmDeployOutputCacheInputs(ref: MatchedTargetRef, targetDefaults: TargetDefaults | undefined, executor: string): 'target' | 'defaults' | null;
|
|
16
|
-
/**
|
|
17
|
-
* Variant for a plugin-inferred target, whose generated `inputs` already carry
|
|
18
|
-
* the settings sources (the runtime probe only while the root manifest has no
|
|
19
|
-
* valid pnpm pin): a repair is only needed when an overlay (a project-level
|
|
20
|
-
* target entry, exact or glob key, or a matching `targetDefaults` entry)
|
|
21
|
-
* supplies a replacing `inputs` array that discards them. The repair appends
|
|
22
|
-
* the full set, probe included, because it runs once and the pin can be
|
|
23
|
-
* removed later. The inferred layer is modeled as an array of exactly the
|
|
24
|
-
* settings inputs: enough for the missing check, and it makes an overlay-less
|
|
25
|
-
* target come back as nothing missing, so the fallback that would narrow the
|
|
26
|
-
* plugin's richer array to `DEFAULT_INPUTS` can never be reached: with no
|
|
27
|
-
* replacing supplier there is nothing to mutate.
|
|
28
|
-
*/
|
|
29
|
-
export declare function addPnpmDeployOutputCacheInputsToInferredTargetOverlay(ref: MatchedTargetRef, targetDefaults: TargetDefaults | undefined): 'target' | 'defaults' | null;
|