@aws/nx-plugin 1.0.11 → 1.0.12
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/LICENSE-THIRD-PARTY +14 -41
- package/migrations.json +12 -12
- package/package.json +3 -3
- package/src/migrations/v1.0.10/0001-pin-strands-mcp-client-peer/migration.js.map +1 -0
- package/src/migrations/v1.0.9/0001-py-dynamodb-bind-base-model-meta/migration.js.map +1 -0
- package/src/py/agent/__snapshots__/generator.constructs.spec.ts.snap +6 -6
- package/src/py/agent/__snapshots__/generator.frameworks.spec.ts.snap +7 -7
- package/src/py/agent/__snapshots__/generator.protocols.spec.ts.snap +1 -1
- package/src/py/mcp-server/__snapshots__/generator.spec.ts.snap +3 -3
- package/src/py/rdb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/smithy/project/__snapshots__/generator.spec.ts.snap +14 -14
- package/src/smithy/ts/api/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/agent/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/mcp-server/__snapshots__/generator.spec.ts.snap +1 -1
- package/src/ts/rdb/__snapshots__/generator.spec.ts.snap +2 -2
- package/src/ts/react-website/app/__snapshots__/generator.spec.ts.snap +12 -12
- package/src/ts/react-website/cognito-auth/__snapshots__/generator.terraform.spec.ts.snap +1 -1
- package/src/utils/docker.d.ts +1 -1
- package/src/utils/version-lockstep/exact-dependency.d.ts +28 -0
- package/src/utils/version-lockstep/exact-dependency.js +78 -1
- package/src/utils/version-lockstep/exact-dependency.js.map +1 -1
- package/src/utils/version-lockstep/report.d.ts +44 -0
- package/src/utils/version-lockstep/report.js +108 -0
- package/src/utils/version-lockstep/report.js.map +1 -0
- package/src/utils/versions.d.ts +56 -56
- package/src/utils/versions.js +56 -56
- package/src/utils/versions.js.map +1 -1
- package/src/migrations/latest/pin-strands-mcp-client-peer/migration.js.map +0 -1
- package/src/migrations/latest/py-dynamodb-bind-base-model-meta/migration.js.map +0 -1
- /package/src/migrations/{latest/pin-strands-mcp-client-peer → v1.0.10/0001-pin-strands-mcp-client-peer}/metadata.json +0 -0
- /package/src/migrations/{latest/pin-strands-mcp-client-peer → v1.0.10/0001-pin-strands-mcp-client-peer}/migration.d.ts +0 -0
- /package/src/migrations/{latest/pin-strands-mcp-client-peer → v1.0.10/0001-pin-strands-mcp-client-peer}/migration.js +0 -0
- /package/src/migrations/{latest/py-dynamodb-bind-base-model-meta → v1.0.9/0001-py-dynamodb-bind-base-model-meta}/metadata.json +0 -0
- /package/src/migrations/{latest/py-dynamodb-bind-base-model-meta → v1.0.9/0001-py-dynamodb-bind-base-model-meta}/migration.d.ts +0 -0
- /package/src/migrations/{latest/py-dynamodb-bind-base-model-meta → v1.0.9/0001-py-dynamodb-bind-base-model-meta}/migration.js +0 -0
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
-
*/ import {
|
|
4
|
+
*/ import { readJson, writeJson } from "@nx/devkit";
|
|
5
|
+
import { coerce, satisfies, valid } from "semver";
|
|
5
6
|
/** The bare version in a pin, whatever range syntax it was written with. */ const bare = (version)=>coerce(version, {
|
|
6
7
|
includePrerelease: true
|
|
7
8
|
})?.version;
|
|
@@ -132,5 +133,81 @@ const message = (error)=>error instanceof Error ? error.message : String(error);
|
|
|
132
133
|
}
|
|
133
134
|
return notes;
|
|
134
135
|
};
|
|
136
|
+
/** Reads each release's field once; a failed read fails the same way when repeated. */ export const memoizeLookup = (lookup)=>{
|
|
137
|
+
const cache = new Map();
|
|
138
|
+
return async (name, version, field)=>{
|
|
139
|
+
const key = `${name}@${version} ${field}`;
|
|
140
|
+
let cached = cache.get(key);
|
|
141
|
+
if (!cached) {
|
|
142
|
+
cached = lookup(name, version, field);
|
|
143
|
+
cache.set(key, cached);
|
|
144
|
+
}
|
|
145
|
+
return {
|
|
146
|
+
...await cached
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
/** Where the update records what each rule's source release depends on. */ export const EXACT_DEPENDENCY_SOURCES_PATH = 'packages/nx-plugin/exact-dependency-sources.json';
|
|
151
|
+
/**
|
|
152
|
+
* What each rule's source, at the version being written, depends on for its
|
|
153
|
+
* followers. Reuses `recorded` for a source that did not move and reads the
|
|
154
|
+
* registry otherwise. Throws when a follower being written is not that version,
|
|
155
|
+
* or when the source's dependencies can't be read or omit a follower.
|
|
156
|
+
*/ export const verifyExactDependencies = async (rules, versions, recorded, lookup)=>{
|
|
157
|
+
const sources = {};
|
|
158
|
+
const written = (name)=>{
|
|
159
|
+
const version = versions[name];
|
|
160
|
+
return version === undefined ? undefined : bare(version);
|
|
161
|
+
};
|
|
162
|
+
for (const { source, followers, reason } of rules){
|
|
163
|
+
const sourceVersion = written(source);
|
|
164
|
+
if (sourceVersion === undefined) continue;
|
|
165
|
+
let dependencies;
|
|
166
|
+
if (recorded[source]?.version === sourceVersion) {
|
|
167
|
+
dependencies = recorded[source].dependencies;
|
|
168
|
+
} else {
|
|
169
|
+
try {
|
|
170
|
+
dependencies = await lookup(source, sourceVersion, 'dependencies');
|
|
171
|
+
} catch (error) {
|
|
172
|
+
throw new Error(`could not read the dependencies of ${source} ${sourceVersion} (${message(error)})`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const missing = followers.filter((name)=>!dependencies[name]);
|
|
176
|
+
if (missing.length > 0) {
|
|
177
|
+
throw new Error(`${source} ${sourceVersion} does not depend on ${missing.join(', ')}`);
|
|
178
|
+
}
|
|
179
|
+
const expected = Object.fromEntries(followers.map((name)=>{
|
|
180
|
+
const declared = dependencies[name];
|
|
181
|
+
return [
|
|
182
|
+
name,
|
|
183
|
+
valid(declared) ?? bare(declared) ?? declared
|
|
184
|
+
];
|
|
185
|
+
}));
|
|
186
|
+
const differing = followers.filter((name)=>written(name) !== expected[name]);
|
|
187
|
+
if (differing.length > 0) {
|
|
188
|
+
throw new Error(`${differing.map((name)=>`${name} ${written(name)}`).join(', ')} but ${source} ${sourceVersion} depends on ${differing.map((name)=>`${name} ${expected[name]}`).join(', ')}: ${reason}`);
|
|
189
|
+
}
|
|
190
|
+
sources[source] = {
|
|
191
|
+
version: sourceVersion,
|
|
192
|
+
dependencies: expected
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return sources;
|
|
196
|
+
};
|
|
197
|
+
/**
|
|
198
|
+
* Record in `EXACT_DEPENDENCY_SOURCES_PATH` what the sources being written depend
|
|
199
|
+
* on, which `versions.spec.ts` checks the pins against. Throws as
|
|
200
|
+
* `verifyExactDependencies` does, before anything is written.
|
|
201
|
+
* @returns paths written, for the update report
|
|
202
|
+
*/ export const writeExactDependencySources = async (tree, rules, versions, lookup)=>{
|
|
203
|
+
const path = EXACT_DEPENDENCY_SOURCES_PATH;
|
|
204
|
+
const recorded = tree.exists(path) ? readJson(tree, path) : {};
|
|
205
|
+
const sources = await verifyExactDependencies(rules, versions, recorded, lookup);
|
|
206
|
+
if (JSON.stringify(sources) === JSON.stringify(recorded)) return [];
|
|
207
|
+
writeJson(tree, path, sources);
|
|
208
|
+
return [
|
|
209
|
+
path
|
|
210
|
+
];
|
|
211
|
+
};
|
|
135
212
|
|
|
136
213
|
//# sourceMappingURL=exact-dependency.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/utils/version-lockstep/exact-dependency.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { coerce, satisfies, valid } from 'semver';\nimport type {\n IVersionedDep,\n LockstepNote,\n ProposedVersions,\n} from './lockstep.js';\n\n/**\n * Pins that must equal the exact `dependencies` a published release of another\n * pin declares, for packages that don't share a version line.\n */\nexport interface ExactDependencyPin {\n /** The pin whose published `dependencies` the followers take. */\n source: IVersionedDep;\n /** Pins set to exactly the version `source` depends on. */\n followers: readonly [IVersionedDep, ...IVersionedDep[]];\n /** Pins whose published `peerDependencies` must accept the followers. */\n peers: readonly IVersionedDep[];\n /** Why the followers must match, for the update's PR. */\n reason: string;\n}\n\n/** The manifest fields the rule reads. */\nexport type ManifestField = 'dependencies' | 'peerDependencies';\n\n/**\n * Reads one field of a published release's manifest, for example from\n * `https://registry.npmjs.org/<name>/<version>`. Resolves to `{}` when the\n * release has no such field, and rejects when the release can't be read.\n */\nexport type DependencyLookup = (\n name: string,\n version: string,\n field: ManifestField,\n) => Promise<Record<string, string>>;\n\n/** Groups of pins held at one version, as in `LOCKSTEP_GROUPS`. */\ntype Groups = readonly (readonly string[])[];\n\n/** The version each pin must take, or why there isn't one. */\ntype Targets = Map<IVersionedDep, string> | { held: string };\n\n/** The bare version in a pin, whatever range syntax it was written with. */\nconst bare = (version: string): string | undefined =>\n coerce(version, { includePrerelease: true })?.version;\n\nconst message = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n\n/**\n * The versions the source's `dependencies` give its followers, and the version\n * of the follower each group mate is grouped with, so the group stays in step.\n */\nconst targetsFrom = (\n { source, followers }: ExactDependencyPin,\n sourceVersion: string,\n dependencies: Record<string, string>,\n groups: Groups,\n current: Readonly<ProposedVersions>,\n): Targets => {\n const missing = followers.filter((name) => !dependencies[name]);\n if (missing.length > 0) {\n return {\n held: `${source} ${sourceVersion} does not depend on ${missing.join(', ')}`,\n };\n }\n\n // Releases so far declare exact versions. If one declares a range, take its\n // bare version: our pins are exact, and a single copy needs that version.\n const targets = new Map<IVersionedDep, string>(\n followers.map((name) => {\n const declared = dependencies[name];\n return [name, valid(declared) ?? bare(declared) ?? declared];\n }),\n );\n\n for (const group of groups) {\n const inGroup = followers.filter((name) => group.includes(name));\n if (inGroup.length === 0) continue;\n const version = targets.get(inGroup[0]) as string;\n const disagreeing = inGroup.find((name) => targets.get(name) !== version);\n if (disagreeing) {\n return {\n held: `${source} ${sourceVersion} depends on ${inGroup[0]} ${version} but ${disagreeing} ${targets.get(disagreeing)}, which must move in step`,\n };\n }\n for (const name of group as readonly IVersionedDep[]) {\n if (!targets.has(name) && current[name] !== undefined) {\n targets.set(name, version);\n }\n }\n }\n\n return targets;\n};\n\n/** Why the peers being written would reject the targets, if they would. */\nconst unmetPeers = async (\n { source, peers }: ExactDependencyPin,\n sourceVersion: string,\n targets: Map<IVersionedDep, string>,\n written: (name: IVersionedDep) => string | undefined,\n lookup: DependencyLookup,\n): Promise<string | undefined> => {\n const unmet: string[] = [];\n for (const peer of peers) {\n const peerVersion = written(peer);\n if (peerVersion === undefined) continue;\n let ranges: Record<string, string>;\n try {\n ranges = await lookup(peer, peerVersion, 'peerDependencies');\n } catch (error) {\n return `could not read the peerDependencies of ${peer} ${peerVersion} (${message(error)})`;\n }\n for (const [name, version] of targets) {\n const range = ranges[name];\n if (range && !satisfies(version, range, { includePrerelease: true })) {\n unmet.push(\n `${peer} ${peerVersion} requires ${name} ${range}, but ${source} ${sourceVersion} needs ${version}`,\n );\n }\n }\n }\n return unmet.length > 0 ? unmet.join('; ') : undefined;\n};\n\n/**\n * Set each rule's followers, and their lockstep group mates, to the exact\n * versions the source being written depends on. Runs after the lockstep, which\n * can only hold a group back and so can't move one up to what the source needs.\n *\n * Mutates `proposed`, which holds versions not yet written anywhere. When a peer\n * would reject the result, or a manifest can't be read, every pin the rule covers\n * is put back to `current` for this run instead. Returns a note for each pin set\n * and each rule held, so the reason reaches the update's PR.\n */\nexport const pinToExactDependencies = async (\n rules: readonly ExactDependencyPin[],\n groups: Groups,\n current: Readonly<ProposedVersions>,\n proposed: ProposedVersions,\n lookup: DependencyLookup,\n): Promise<LockstepNote[]> => {\n const notes: LockstepNote[] = [];\n const written = (name: IVersionedDep): string | undefined => {\n const version = proposed[name] ?? current[name];\n return version === undefined ? undefined : bare(version);\n };\n\n for (const rule of rules) {\n const { source, followers, peers, reason } = rule;\n const mates = groups\n .filter((group) => followers.some((name) => group.includes(name)))\n .flat() as IVersionedDep[];\n const covered = [\n ...new Set([source, ...followers, ...mates, ...peers]),\n ].filter((name) => current[name] !== undefined);\n\n // Every pin the rule covers goes back to its current version, so nothing\n // the rule could not check is written.\n const hold = (why: string) => {\n const notTaken = covered.filter(\n (name) =>\n proposed[name] !== undefined && proposed[name] !== current[name],\n );\n notes.push({\n name: source,\n note:\n `${source} held at ${current[source]}, with ${covered\n .filter((name) => name !== source)\n .join(', ')} at their current versions` +\n (notTaken.length > 0\n ? ` (not taken: ${notTaken\n .map((name) => `${name} ${proposed[name]}`)\n .join(', ')})`\n : '') +\n `: ${why}`,\n });\n for (const name of covered) proposed[name] = current[name];\n };\n\n const sourceVersion = written(source);\n if (sourceVersion === undefined) continue;\n\n let dependencies: Record<string, string>;\n try {\n dependencies = await lookup(source, sourceVersion, 'dependencies');\n } catch (error) {\n hold(\n `could not read the dependencies of ${source} ${sourceVersion} (${message(error)})`,\n );\n continue;\n }\n\n const targets = targetsFrom(\n rule,\n sourceVersion,\n dependencies,\n groups,\n current,\n );\n if (!(targets instanceof Map)) {\n hold(targets.held);\n continue;\n }\n\n const unmet = await unmetPeers(\n rule,\n sourceVersion,\n targets,\n written,\n lookup,\n );\n if (unmet) {\n hold(unmet);\n continue;\n }\n\n for (const [name, version] of targets) {\n const before = proposed[name] ?? current[name];\n if (before === version) continue;\n proposed[name] = version;\n notes.push({\n name,\n note: `${name} set to ${version} (${before} proposed) to match the exact dependencies of ${source} ${sourceVersion}: ${reason}`,\n });\n }\n }\n\n return notes;\n};\n"],"names":["coerce","satisfies","valid","bare","version","includePrerelease","message","error","Error","String","targetsFrom","source","followers","sourceVersion","dependencies","groups","current","missing","filter","name","length","held","join","targets","Map","map","declared","group","inGroup","includes","get","disagreeing","find","has","undefined","set","unmetPeers","peers","written","lookup","unmet","peer","peerVersion","ranges","range","push","pinToExactDependencies","rules","proposed","notes","rule","reason","mates","some","flat","covered","Set","hold","why","notTaken","note","before"],"mappings":"AAAA;;;CAGC,GACD,SAASA,MAAM,EAAEC,SAAS,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ACFA,eAAe,MAAMyB,OAAO5B,QAAQE,eAAe;QACrD,EAAE,OAAON,OAAO;YACdkD,KACE,CAAC,mCAAmC,EAAE9C,OAAO,CAAC,EAAEE,cAAc,EAAE,EAAEP,QAAQC,OAAO,CAAC,CAAC;YAErF;QACF;QAEA,MAAMgB,UAAUb,YACdwC,MACArC,eACAC,cACAC,QACAC;QAEF,IAAI,CAAEO,CAAAA,mBAAmBC,GAAE,GAAI;YAC7BiC,KAAKlC,QAAQF,IAAI;YACjB;QACF;QAEA,MAAMmB,QAAQ,MAAMJ,WAClBc,MACArC,eACAU,SACAe,SACAC;QAEF,IAAIC,OAAO;YACTiB,KAAKjB;YACL;QACF;QAEA,KAAK,MAAM,CAACrB,MAAMf,QAAQ,IAAImB,QAAS;YACrC,MAAMsC,SAASb,QAAQ,CAAC7B,KAAK,IAAIH,OAAO,CAACG,KAAK;YAC9C,IAAI0C,WAAWzD,SAAS;YACxB4C,QAAQ,CAAC7B,KAAK,GAAGf;YACjB6C,MAAMJ,IAAI,CAAC;gBACT1B;gBACAyC,MAAM,GAAGzC,KAAK,QAAQ,EAAEf,QAAQ,EAAE,EAAEyD,OAAO,8CAA8C,EAAElD,OAAO,CAAC,EAAEE,cAAc,EAAE,EAAEsC,QAAQ;YACjI;QACF;IACF;IAEA,OAAOF;AACT,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/utils/version-lockstep/exact-dependency.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { readJson, type Tree, writeJson } from '@nx/devkit';\nimport { coerce, satisfies, valid } from 'semver';\nimport type {\n IVersionedDep,\n LockstepNote,\n ProposedVersions,\n} from './lockstep.js';\n\n/**\n * Pins that must equal the exact `dependencies` a published release of another\n * pin declares, for packages that don't share a version line.\n */\nexport interface ExactDependencyPin {\n /** The pin whose published `dependencies` the followers take. */\n source: IVersionedDep;\n /** Pins set to exactly the version `source` depends on. */\n followers: readonly [IVersionedDep, ...IVersionedDep[]];\n /** Pins whose published `peerDependencies` must accept the followers. */\n peers: readonly IVersionedDep[];\n /** Why the followers must match, for the update's PR. */\n reason: string;\n}\n\n/** The manifest fields the rule reads. */\nexport type ManifestField = 'dependencies' | 'peerDependencies';\n\n/**\n * Reads one field of a published release's manifest, for example from\n * `https://registry.npmjs.org/<name>/<version>`. Resolves to `{}` when the\n * release has no such field, and rejects when the release can't be read.\n */\nexport type DependencyLookup = (\n name: string,\n version: string,\n field: ManifestField,\n) => Promise<Record<string, string>>;\n\n/** Groups of pins held at one version, as in `LOCKSTEP_GROUPS`. */\ntype Groups = readonly (readonly string[])[];\n\n/** The version each pin must take, or why there isn't one. */\ntype Targets = Map<IVersionedDep, string> | { held: string };\n\n/** The bare version in a pin, whatever range syntax it was written with. */\nconst bare = (version: string): string | undefined =>\n coerce(version, { includePrerelease: true })?.version;\n\nconst message = (error: unknown): string =>\n error instanceof Error ? error.message : String(error);\n\n/**\n * The versions the source's `dependencies` give its followers, and the version\n * of the follower each group mate is grouped with, so the group stays in step.\n */\nconst targetsFrom = (\n { source, followers }: ExactDependencyPin,\n sourceVersion: string,\n dependencies: Record<string, string>,\n groups: Groups,\n current: Readonly<ProposedVersions>,\n): Targets => {\n const missing = followers.filter((name) => !dependencies[name]);\n if (missing.length > 0) {\n return {\n held: `${source} ${sourceVersion} does not depend on ${missing.join(', ')}`,\n };\n }\n\n // Releases so far declare exact versions. If one declares a range, take its\n // bare version: our pins are exact, and a single copy needs that version.\n const targets = new Map<IVersionedDep, string>(\n followers.map((name) => {\n const declared = dependencies[name];\n return [name, valid(declared) ?? bare(declared) ?? declared];\n }),\n );\n\n for (const group of groups) {\n const inGroup = followers.filter((name) => group.includes(name));\n if (inGroup.length === 0) continue;\n const version = targets.get(inGroup[0]) as string;\n const disagreeing = inGroup.find((name) => targets.get(name) !== version);\n if (disagreeing) {\n return {\n held: `${source} ${sourceVersion} depends on ${inGroup[0]} ${version} but ${disagreeing} ${targets.get(disagreeing)}, which must move in step`,\n };\n }\n for (const name of group as readonly IVersionedDep[]) {\n if (!targets.has(name) && current[name] !== undefined) {\n targets.set(name, version);\n }\n }\n }\n\n return targets;\n};\n\n/** Why the peers being written would reject the targets, if they would. */\nconst unmetPeers = async (\n { source, peers }: ExactDependencyPin,\n sourceVersion: string,\n targets: Map<IVersionedDep, string>,\n written: (name: IVersionedDep) => string | undefined,\n lookup: DependencyLookup,\n): Promise<string | undefined> => {\n const unmet: string[] = [];\n for (const peer of peers) {\n const peerVersion = written(peer);\n if (peerVersion === undefined) continue;\n let ranges: Record<string, string>;\n try {\n ranges = await lookup(peer, peerVersion, 'peerDependencies');\n } catch (error) {\n return `could not read the peerDependencies of ${peer} ${peerVersion} (${message(error)})`;\n }\n for (const [name, version] of targets) {\n const range = ranges[name];\n if (range && !satisfies(version, range, { includePrerelease: true })) {\n unmet.push(\n `${peer} ${peerVersion} requires ${name} ${range}, but ${source} ${sourceVersion} needs ${version}`,\n );\n }\n }\n }\n return unmet.length > 0 ? unmet.join('; ') : undefined;\n};\n\n/**\n * Set each rule's followers, and their lockstep group mates, to the exact\n * versions the source being written depends on. Runs after the lockstep, which\n * can only hold a group back and so can't move one up to what the source needs.\n *\n * Mutates `proposed`, which holds versions not yet written anywhere. When a peer\n * would reject the result, or a manifest can't be read, every pin the rule covers\n * is put back to `current` for this run instead. Returns a note for each pin set\n * and each rule held, so the reason reaches the update's PR.\n */\nexport const pinToExactDependencies = async (\n rules: readonly ExactDependencyPin[],\n groups: Groups,\n current: Readonly<ProposedVersions>,\n proposed: ProposedVersions,\n lookup: DependencyLookup,\n): Promise<LockstepNote[]> => {\n const notes: LockstepNote[] = [];\n const written = (name: IVersionedDep): string | undefined => {\n const version = proposed[name] ?? current[name];\n return version === undefined ? undefined : bare(version);\n };\n\n for (const rule of rules) {\n const { source, followers, peers, reason } = rule;\n const mates = groups\n .filter((group) => followers.some((name) => group.includes(name)))\n .flat() as IVersionedDep[];\n const covered = [\n ...new Set([source, ...followers, ...mates, ...peers]),\n ].filter((name) => current[name] !== undefined);\n\n // Every pin the rule covers goes back to its current version, so nothing\n // the rule could not check is written.\n const hold = (why: string) => {\n const notTaken = covered.filter(\n (name) =>\n proposed[name] !== undefined && proposed[name] !== current[name],\n );\n notes.push({\n name: source,\n note:\n `${source} held at ${current[source]}, with ${covered\n .filter((name) => name !== source)\n .join(', ')} at their current versions` +\n (notTaken.length > 0\n ? ` (not taken: ${notTaken\n .map((name) => `${name} ${proposed[name]}`)\n .join(', ')})`\n : '') +\n `: ${why}`,\n });\n for (const name of covered) proposed[name] = current[name];\n };\n\n const sourceVersion = written(source);\n if (sourceVersion === undefined) continue;\n\n let dependencies: Record<string, string>;\n try {\n dependencies = await lookup(source, sourceVersion, 'dependencies');\n } catch (error) {\n hold(\n `could not read the dependencies of ${source} ${sourceVersion} (${message(error)})`,\n );\n continue;\n }\n\n const targets = targetsFrom(\n rule,\n sourceVersion,\n dependencies,\n groups,\n current,\n );\n if (!(targets instanceof Map)) {\n hold(targets.held);\n continue;\n }\n\n const unmet = await unmetPeers(\n rule,\n sourceVersion,\n targets,\n written,\n lookup,\n );\n if (unmet) {\n hold(unmet);\n continue;\n }\n\n for (const [name, version] of targets) {\n const before = proposed[name] ?? current[name];\n if (before === version) continue;\n proposed[name] = version;\n notes.push({\n name,\n note: `${name} set to ${version} (${before} proposed) to match the exact dependencies of ${source} ${sourceVersion}: ${reason}`,\n });\n }\n }\n\n return notes;\n};\n\n/** Reads each release's field once; a failed read fails the same way when repeated. */\nexport const memoizeLookup = (lookup: DependencyLookup): DependencyLookup => {\n const cache = new Map<string, Promise<Record<string, string>>>();\n return async (name, version, field) => {\n const key = `${name}@${version} ${field}`;\n let cached = cache.get(key);\n if (!cached) {\n cached = lookup(name, version, field);\n cache.set(key, cached);\n }\n return { ...(await cached) };\n };\n};\n\n/** Where the update records what each rule's source release depends on. */\nexport const EXACT_DEPENDENCY_SOURCES_PATH =\n 'packages/nx-plugin/exact-dependency-sources.json';\n\n/** Per rule source: the version pinned and the exact versions it depends on for its followers. */\nexport type ExactDependencySources = Record<\n string,\n { version: string; dependencies: Record<string, string> }\n>;\n\n/**\n * What each rule's source, at the version being written, depends on for its\n * followers. Reuses `recorded` for a source that did not move and reads the\n * registry otherwise. Throws when a follower being written is not that version,\n * or when the source's dependencies can't be read or omit a follower.\n */\nexport const verifyExactDependencies = async (\n rules: readonly ExactDependencyPin[],\n versions: Readonly<ProposedVersions>,\n recorded: Readonly<ExactDependencySources>,\n lookup: DependencyLookup,\n): Promise<ExactDependencySources> => {\n const sources: ExactDependencySources = {};\n const written = (name: IVersionedDep): string | undefined => {\n const version = versions[name];\n return version === undefined ? undefined : bare(version);\n };\n\n for (const { source, followers, reason } of rules) {\n const sourceVersion = written(source);\n if (sourceVersion === undefined) continue;\n\n let dependencies: Record<string, string>;\n if (recorded[source]?.version === sourceVersion) {\n dependencies = recorded[source].dependencies;\n } else {\n try {\n dependencies = await lookup(source, sourceVersion, 'dependencies');\n } catch (error) {\n throw new Error(\n `could not read the dependencies of ${source} ${sourceVersion} (${message(error)})`,\n );\n }\n }\n\n const missing = followers.filter((name) => !dependencies[name]);\n if (missing.length > 0) {\n throw new Error(\n `${source} ${sourceVersion} does not depend on ${missing.join(', ')}`,\n );\n }\n\n const expected = Object.fromEntries(\n followers.map((name) => {\n const declared = dependencies[name];\n return [name, valid(declared) ?? bare(declared) ?? declared];\n }),\n );\n const differing = followers.filter(\n (name) => written(name) !== expected[name],\n );\n if (differing.length > 0) {\n throw new Error(\n `${differing.map((name) => `${name} ${written(name)}`).join(', ')} but ${source} ${sourceVersion} depends on ${differing.map((name) => `${name} ${expected[name]}`).join(', ')}: ${reason}`,\n );\n }\n\n sources[source] = { version: sourceVersion, dependencies: expected };\n }\n\n return sources;\n};\n\n/**\n * Record in `EXACT_DEPENDENCY_SOURCES_PATH` what the sources being written depend\n * on, which `versions.spec.ts` checks the pins against. Throws as\n * `verifyExactDependencies` does, before anything is written.\n * @returns paths written, for the update report\n */\nexport const writeExactDependencySources = async (\n tree: Tree,\n rules: readonly ExactDependencyPin[],\n versions: Readonly<ProposedVersions>,\n lookup: DependencyLookup,\n): Promise<string[]> => {\n const path = EXACT_DEPENDENCY_SOURCES_PATH;\n const recorded: ExactDependencySources = tree.exists(path)\n ? readJson(tree, path)\n : {};\n const sources = await verifyExactDependencies(\n rules,\n versions,\n recorded,\n lookup,\n );\n if (JSON.stringify(sources) === JSON.stringify(recorded)) return [];\n writeJson(tree, path, sources);\n return [path];\n};\n"],"names":["readJson","writeJson","coerce","satisfies","valid","bare","version","includePrerelease","message","error","Error","String","targetsFrom","source","followers","sourceVersion","dependencies","groups","current","missing","filter","name","length","held","join","targets","Map","map","declared","group","inGroup","includes","get","disagreeing","find","has","undefined","set","unmetPeers","peers","written","lookup","unmet","peer","peerVersion","ranges","range","push","pinToExactDependencies","rules","proposed","notes","rule","reason","mates","some","flat","covered","Set","hold","why","notTaken","note","before","memoizeLookup","cache","field","key","cached","EXACT_DEPENDENCY_SOURCES_PATH","verifyExactDependencies","versions","recorded","sources","expected","Object","fromEntries","differing","writeExactDependencySources","tree","path","exists","JSON","stringify"],"mappings":"AAAA;;;CAGC,GACD,SAASA,QAAQ,EAAaC,SAAS,QAAQ,aAAa;AAC5D,SAASC,MAAM,EAAEC,SAAS,EAAEC,KAAK,QAAQ,SAAS;AA0ClD,0EAA0E,GAC1E,MAAMC,OAAO,CAACC,UACZJ,OAAOI,SAAS;QAAEC,mBAAmB;IAAK,IAAID;AAEhD,MAAME,UAAU,CAACC,QACfA,iBAAiBC,QAAQD,MAAMD,OAAO,GAAGG,OAAOF;AAElD;;;CAGC,GACD,MAAMG,cAAc,CAClB,EAAEC,MAAM,EAAEC,SAAS,EAAsB,EACzCC,eACAC,cACAC,QACAC;IAEA,MAAMC,UAAUL,UAAUM,MAAM,CAAC,CAACC,OAAS,CAACL,YAAY,CAACK,KAAK;IAC9D,IAAIF,QAAQG,MAAM,GAAG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GAAG;YAAEP,SAASS;YAAeC,cAAc0D;QAAS;IACrE;IAEA,OAAOD;AACT,EAAE;AAEF;;;;;CAKC,GACD,OAAO,MAAMK,8BAA8B,OACzCC,MACA9B,OACAsB,UACA9B;IAEA,MAAMuC,OAAOX;IACb,MAAMG,WAAmCO,KAAKE,MAAM,CAACD,QACjDhF,SAAS+E,MAAMC,QACf,CAAC;IACL,MAAMP,UAAU,MAAMH,wBACpBrB,OACAsB,UACAC,UACA/B;IAEF,IAAIyC,KAAKC,SAAS,CAACV,aAAaS,KAAKC,SAAS,CAACX,WAAW,OAAO,EAAE;IACnEvE,UAAU8E,MAAMC,MAAMP;IACtB,OAAO;QAACO;KAAK;AACf,EAAE"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/
|
|
5
|
+
/** A pin the run moves from one version to another. */
|
|
6
|
+
export interface VersionChange {
|
|
7
|
+
name: string;
|
|
8
|
+
oldVersion: string;
|
|
9
|
+
newVersion: string;
|
|
10
|
+
}
|
|
11
|
+
/** A file the run rewrites. */
|
|
12
|
+
export interface TemplateChange {
|
|
13
|
+
path: string;
|
|
14
|
+
}
|
|
15
|
+
/** Something the run could not do, reported so it reaches the PR body. */
|
|
16
|
+
export interface ReportNote {
|
|
17
|
+
note: string;
|
|
18
|
+
}
|
|
19
|
+
export type ReportChange = VersionChange | TemplateChange | ReportNote;
|
|
20
|
+
/** A titled section of the report. */
|
|
21
|
+
export interface ChangeGroup {
|
|
22
|
+
title: string;
|
|
23
|
+
changes: ReportChange[];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The longest line commitlint accepts in a commit body or footer, from rule sets
|
|
27
|
+
* such as `@commitlint/config-conventional`'s rules followed by the repo's
|
|
28
|
+
* overrides. Later rule sets override earlier ones.
|
|
29
|
+
*/
|
|
30
|
+
export declare const commitMessageLineLimit: (...ruleSets: readonly Readonly<Record<string, unknown>>[]) => number;
|
|
31
|
+
/**
|
|
32
|
+
* Splits a line longer than `limit` at spaces into lines of at most `limit`.
|
|
33
|
+
* A list item continues indented under its text, so Markdown keeps it one item,
|
|
34
|
+
* and no continuation starts with a word that would start a Markdown block. A
|
|
35
|
+
* word longer than `limit`, such as a URL, stays whole on its own line.
|
|
36
|
+
*/
|
|
37
|
+
export declare const wrapReportLine: (line: string, limit: number) => string[];
|
|
38
|
+
/** Wraps each line of `text` with {@link wrapReportLine}. */
|
|
39
|
+
export declare const wrapReport: (text: string, limit: number) => string;
|
|
40
|
+
/**
|
|
41
|
+
* The version update report: each group with changes as a titled list, with
|
|
42
|
+
* lines wrapped to `limit`.
|
|
43
|
+
*/
|
|
44
|
+
export declare const formatReport: (changeGroups: readonly ChangeGroup[], limit: number) => string;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
|
3
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
*/ /** A pin the run moves from one version to another. */ /**
|
|
5
|
+
* The longest line commitlint accepts in a commit body or footer, from rule sets
|
|
6
|
+
* such as `@commitlint/config-conventional`'s rules followed by the repo's
|
|
7
|
+
* overrides. Later rule sets override earlier ones.
|
|
8
|
+
*/ export const commitMessageLineLimit = (...ruleSets)=>{
|
|
9
|
+
const limitOf = (rule)=>{
|
|
10
|
+
const value = ruleSets.map((rules)=>rules[rule]).filter((setting)=>setting !== undefined).at(-1);
|
|
11
|
+
const limit = Array.isArray(value) ? value[2] : undefined;
|
|
12
|
+
if (typeof limit !== 'number') {
|
|
13
|
+
throw new Error(`commitlint rule ${rule} sets no line limit`);
|
|
14
|
+
}
|
|
15
|
+
return limit;
|
|
16
|
+
};
|
|
17
|
+
// commitlint can parse a wrapped line as the start of the footer.
|
|
18
|
+
return Math.min(limitOf('body-max-line-length'), limitOf('footer-max-line-length'));
|
|
19
|
+
};
|
|
20
|
+
/** A list item marker and the spaces after it. */ const LIST_MARKER = /^(\s*)([-+*]|\d{1,9}[.)])( +)/;
|
|
21
|
+
/** A word that would start a Markdown block at the start of a continuation. */ const BLOCK_START = /^(?:[-+*]|\d{1,9}[.)]|#{1,6}|[<>`~].*|[-=*_]{3,})$/;
|
|
22
|
+
/**
|
|
23
|
+
* Splits a line longer than `limit` at spaces into lines of at most `limit`.
|
|
24
|
+
* A list item continues indented under its text, so Markdown keeps it one item,
|
|
25
|
+
* and no continuation starts with a word that would start a Markdown block. A
|
|
26
|
+
* word longer than `limit`, such as a URL, stays whole on its own line.
|
|
27
|
+
*/ export const wrapReportLine = (line, limit)=>{
|
|
28
|
+
if (line.length <= limit) return [
|
|
29
|
+
line
|
|
30
|
+
];
|
|
31
|
+
const marker = LIST_MARKER.exec(line)?.[0];
|
|
32
|
+
const first = marker ?? /^\s*/.exec(line)?.[0] ?? '';
|
|
33
|
+
const indent = marker ? ' '.repeat(marker.length) : first;
|
|
34
|
+
const fits = (prefix, words)=>prefix.length + words.join(' ').length <= limit;
|
|
35
|
+
const lines = [
|
|
36
|
+
{
|
|
37
|
+
prefix: first,
|
|
38
|
+
words: []
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
for (const word of line.slice(first.length).split(/\s+/).filter(Boolean)){
|
|
42
|
+
const current = lines[lines.length - 1];
|
|
43
|
+
if (current.words.length === 0 || fits(current.prefix, [
|
|
44
|
+
...current.words,
|
|
45
|
+
word
|
|
46
|
+
])) {
|
|
47
|
+
current.words.push(word);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
const last = current.words[current.words.length - 1];
|
|
51
|
+
if (BLOCK_START.test(word) && current.words.length > 1 && !BLOCK_START.test(last) && fits(indent, [
|
|
52
|
+
last,
|
|
53
|
+
word
|
|
54
|
+
])) {
|
|
55
|
+
current.words.pop();
|
|
56
|
+
lines.push({
|
|
57
|
+
prefix: indent,
|
|
58
|
+
words: [
|
|
59
|
+
last,
|
|
60
|
+
word
|
|
61
|
+
]
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
lines.push({
|
|
65
|
+
prefix: indent,
|
|
66
|
+
words: [
|
|
67
|
+
word
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return lines.map(({ prefix, words })=>prefix + words.join(' '));
|
|
73
|
+
};
|
|
74
|
+
/** Wraps each line of `text` with {@link wrapReportLine}. */ export const wrapReport = (text, limit)=>text.split('\n').flatMap((line)=>wrapReportLine(line, limit)).join('\n');
|
|
75
|
+
/**
|
|
76
|
+
* The version update report: each group with changes as a titled list, with
|
|
77
|
+
* lines wrapped to `limit`.
|
|
78
|
+
*/ export const formatReport = (changeGroups, limit)=>{
|
|
79
|
+
let reportContent = '';
|
|
80
|
+
// Process each change group
|
|
81
|
+
changeGroups.forEach((group, index)=>{
|
|
82
|
+
if (group.changes.length > 0) {
|
|
83
|
+
// Add separator between groups
|
|
84
|
+
if (index > 0) {
|
|
85
|
+
reportContent += '\n';
|
|
86
|
+
}
|
|
87
|
+
reportContent += `${group.title}\n`;
|
|
88
|
+
group.changes.forEach((change)=>{
|
|
89
|
+
if ('oldVersion' in change) {
|
|
90
|
+
reportContent += `- ${change.name} ${change.oldVersion} -> ${change.newVersion}\n`;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if ('note' in change) {
|
|
94
|
+
reportContent += `- ${change.note}\n`;
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
reportContent += `- ${change.path}\n`;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
// If no changes at all
|
|
102
|
+
if (reportContent.length === 0) {
|
|
103
|
+
reportContent = 'No version updates required.\n';
|
|
104
|
+
}
|
|
105
|
+
return wrapReport(reportContent, limit);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../packages/nx-plugin/src/utils/version-lockstep/report.ts"],"sourcesContent":["/**\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/** A pin the run moves from one version to another. */\nexport interface VersionChange {\n name: string;\n oldVersion: string;\n newVersion: string;\n}\n\n/** A file the run rewrites. */\nexport interface TemplateChange {\n path: string;\n}\n\n/** Something the run could not do, reported so it reaches the PR body. */\nexport interface ReportNote {\n note: string;\n}\n\nexport type ReportChange = VersionChange | TemplateChange | ReportNote;\n\n/** A titled section of the report. */\nexport interface ChangeGroup {\n title: string;\n changes: ReportChange[];\n}\n\n/**\n * The longest line commitlint accepts in a commit body or footer, from rule sets\n * such as `@commitlint/config-conventional`'s rules followed by the repo's\n * overrides. Later rule sets override earlier ones.\n */\nexport const commitMessageLineLimit = (\n ...ruleSets: readonly Readonly<Record<string, unknown>>[]\n): number => {\n const limitOf = (rule: string): number => {\n const value = ruleSets\n .map((rules) => rules[rule])\n .filter((setting) => setting !== undefined)\n .at(-1);\n const limit = Array.isArray(value) ? value[2] : undefined;\n if (typeof limit !== 'number') {\n throw new Error(`commitlint rule ${rule} sets no line limit`);\n }\n return limit;\n };\n // commitlint can parse a wrapped line as the start of the footer.\n return Math.min(\n limitOf('body-max-line-length'),\n limitOf('footer-max-line-length'),\n );\n};\n\n/** A list item marker and the spaces after it. */\nconst LIST_MARKER = /^(\\s*)([-+*]|\\d{1,9}[.)])( +)/;\n\n/** A word that would start a Markdown block at the start of a continuation. */\nconst BLOCK_START = /^(?:[-+*]|\\d{1,9}[.)]|#{1,6}|[<>`~].*|[-=*_]{3,})$/;\n\n/**\n * Splits a line longer than `limit` at spaces into lines of at most `limit`.\n * A list item continues indented under its text, so Markdown keeps it one item,\n * and no continuation starts with a word that would start a Markdown block. A\n * word longer than `limit`, such as a URL, stays whole on its own line.\n */\nexport const wrapReportLine = (line: string, limit: number): string[] => {\n if (line.length <= limit) return [line];\n\n const marker = LIST_MARKER.exec(line)?.[0];\n const first = marker ?? /^\\s*/.exec(line)?.[0] ?? '';\n const indent = marker ? ' '.repeat(marker.length) : first;\n const fits = (prefix: string, words: string[]) =>\n prefix.length + words.join(' ').length <= limit;\n\n const lines: { prefix: string; words: string[] }[] = [\n { prefix: first, words: [] },\n ];\n for (const word of line.slice(first.length).split(/\\s+/).filter(Boolean)) {\n const current = lines[lines.length - 1];\n if (\n current.words.length === 0 ||\n fits(current.prefix, [...current.words, word])\n ) {\n current.words.push(word);\n continue;\n }\n const last = current.words[current.words.length - 1];\n if (\n BLOCK_START.test(word) &&\n current.words.length > 1 &&\n !BLOCK_START.test(last) &&\n fits(indent, [last, word])\n ) {\n current.words.pop();\n lines.push({ prefix: indent, words: [last, word] });\n } else {\n lines.push({ prefix: indent, words: [word] });\n }\n }\n\n return lines.map(({ prefix, words }) => prefix + words.join(' '));\n};\n\n/** Wraps each line of `text` with {@link wrapReportLine}. */\nexport const wrapReport = (text: string, limit: number): string =>\n text\n .split('\\n')\n .flatMap((line) => wrapReportLine(line, limit))\n .join('\\n');\n\n/**\n * The version update report: each group with changes as a titled list, with\n * lines wrapped to `limit`.\n */\nexport const formatReport = (\n changeGroups: readonly ChangeGroup[],\n limit: number,\n): string => {\n let reportContent = '';\n\n // Process each change group\n changeGroups.forEach((group, index) => {\n if (group.changes.length > 0) {\n // Add separator between groups\n if (index > 0) {\n reportContent += '\\n';\n }\n\n reportContent += `${group.title}\\n`;\n group.changes.forEach((change) => {\n if ('oldVersion' in change) {\n reportContent += `- ${change.name} ${change.oldVersion} -> ${change.newVersion}\\n`;\n return;\n }\n if ('note' in change) {\n reportContent += `- ${change.note}\\n`;\n return;\n }\n reportContent += `- ${change.path}\\n`;\n });\n }\n });\n\n // If no changes at all\n if (reportContent.length === 0) {\n reportContent = 'No version updates required.\\n';\n }\n\n return wrapReport(reportContent, limit);\n};\n"],"names":["commitMessageLineLimit","ruleSets","limitOf","rule","value","map","rules","filter","setting","undefined","at","limit","Array","isArray","Error","Math","min","LIST_MARKER","BLOCK_START","wrapReportLine","line","length","marker","exec","first","indent","repeat","fits","prefix","words","join","lines","word","slice","split","Boolean","current","push","last","test","pop","wrapReport","text","flatMap","formatReport","changeGroups","reportContent","forEach","group","index","changes","title","change","name","oldVersion","newVersion","note","path"],"mappings":"AAAA;;;CAGC,GAED,qDAAqD,GAyBrD;;;;CAIC,GACD,OAAO,MAAMA,yBAAyB,CACpC,GAAGC;IAEH,MAAMC,UAAU,CAACC;QACf,MAAMC,QAAQH,SACXI,GAAG,CAAC,CAACC,QAAUA,KAAK,CAACH,KAAK,EAC1BI,MAAM,CAAC,CAACC,UAAYA,YAAYC,WAChCC,EAAE,CAAC,CAAC;QACP,MAAMC,QAAQC,MAAMC,OAAO,CAACT,SAASA,KAAK,CAAC,EAAE,GAAGK;QAChD,IAAI,OAAOE,UAAU,UAAU;YAC7B,MAAM,IAAIG,MAAM,CAAC,gBAAgB,EAAEX,KAAK,mBAAmB,CAAC;QAC9D;QACA,OAAOQ;IACT;IACA,kEAAkE;IAClE,OAAOI,KAAKC,GAAG,CACbd,QAAQ,yBACRA,QAAQ;AAEZ,EAAE;AAEF,gDAAgD,GAChD,MAAMe,cAAc;AAEpB,6EAA6E,GAC7E,MAAMC,cAAc;AAEpB;;;;;CAKC,GACD,OAAO,MAAMC,iBAAiB,CAACC,MAAcT;IAC3C,IAAIS,KAAKC,MAAM,IAAIV,OAAO,OAAO;QAACS;KAAK;IAEvC,MAAME,SAASL,YAAYM,IAAI,CAACH,OAAO,CAAC,EAAE;IAC1C,MAAMI,QAAQF,UAAU,OAAOC,IAAI,CAACH,OAAO,CAAC,EAAE,IAAI;IAClD,MAAMK,SAASH,SAAS,IAAII,MAAM,CAACJ,OAAOD,MAAM,IAAIG;IACpD,MAAMG,OAAO,CAACC,QAAgBC,QAC5BD,OAAOP,MAAM,GAAGQ,MAAMC,IAAI,CAAC,KAAKT,MAAM,IAAIV;IAE5C,MAA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,CAACC,OAAOC;QAC3B,IAAID,MAAME,OAAO,CAAC7B,MAAM,GAAG,GAAG;YAC5B,+BAA+B;YAC/B,IAAI4B,QAAQ,GAAG;gBACbH,iBAAiB;YACnB;YAEAA,iBAAiB,GAAGE,MAAMG,KAAK,CAAC,EAAE,CAAC;YACnCH,MAAME,OAAO,CAACH,OAAO,CAAC,CAACK;gBACrB,IAAI,gBAAgBA,QAAQ;oBAC1BN,iBAAiB,CAAC,EAAE,EAAEM,OAAOC,IAAI,CAAC,CAAC,EAAED,OAAOE,UAAU,CAAC,IAAI,EAAEF,OAAOG,UAAU,CAAC,EAAE,CAAC;oBAClF;gBACF;gBACA,IAAI,UAAUH,QAAQ;oBACpBN,iBAAiB,CAAC,EAAE,EAAEM,OAAOI,IAAI,CAAC,EAAE,CAAC;oBACrC;gBACF;gBACAV,iBAAiB,CAAC,EAAE,EAAEM,OAAOK,IAAI,CAAC,EAAE,CAAC;YACvC;QACF;IACF;IAEA,uBAAuB;IACvB,IAAIX,cAAczB,MAAM,KAAK,GAAG;QAC9ByB,gBAAgB;IAClB;IAEA,OAAOL,WAAWK,eAAenC;AACnC,EAAE"}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -13,18 +13,18 @@ export declare const TS_VERSIONS: {
|
|
|
13
13
|
readonly minimatch: "10.2.6";
|
|
14
14
|
readonly 'deepmerge-ts': "8.0.2";
|
|
15
15
|
readonly mysql2: "3.24.6";
|
|
16
|
-
readonly '@aws-sdk/client-dynamodb': "3.
|
|
17
|
-
readonly '@aws-sdk/client-api-gateway': "3.
|
|
18
|
-
readonly '@aws-sdk/client-iam': "3.
|
|
19
|
-
readonly '@aws-sdk/client-bedrock-agentcore': "3.
|
|
20
|
-
readonly '@aws-sdk/client-bedrock-runtime': "3.
|
|
21
|
-
readonly '@aws-sdk/client-s3': "3.
|
|
22
|
-
readonly '@aws-sdk/client-sts': "3.
|
|
23
|
-
readonly '@aws-sdk/client-cognito-identity-provider': "3.
|
|
24
|
-
readonly '@aws-sdk/credential-providers': "3.
|
|
16
|
+
readonly '@aws-sdk/client-dynamodb': "3.1152.0";
|
|
17
|
+
readonly '@aws-sdk/client-api-gateway': "3.1152.0";
|
|
18
|
+
readonly '@aws-sdk/client-iam': "3.1152.0";
|
|
19
|
+
readonly '@aws-sdk/client-bedrock-agentcore': "3.1152.0";
|
|
20
|
+
readonly '@aws-sdk/client-bedrock-runtime': "3.1152.0";
|
|
21
|
+
readonly '@aws-sdk/client-s3': "3.1152.0";
|
|
22
|
+
readonly '@aws-sdk/client-sts': "3.1152.0";
|
|
23
|
+
readonly '@aws-sdk/client-cognito-identity-provider': "3.1152.0";
|
|
24
|
+
readonly '@aws-sdk/credential-providers': "3.1152.0";
|
|
25
25
|
readonly '@aws-sdk/credential-provider-cognito-identity': "3.972.73";
|
|
26
|
-
readonly '@aws-sdk/client-secrets-manager': "3.
|
|
27
|
-
readonly '@aws-sdk/rds-signer': "3.
|
|
26
|
+
readonly '@aws-sdk/client-secrets-manager': "3.1152.0";
|
|
27
|
+
readonly '@aws-sdk/rds-signer': "3.1152.0";
|
|
28
28
|
readonly '@smithy/server-apigateway': "0.3.4";
|
|
29
29
|
readonly '@smithy/server-node': "0.3.4";
|
|
30
30
|
readonly '@aws-lambda-powertools/logger': "2.36.0";
|
|
@@ -32,7 +32,7 @@ export declare const TS_VERSIONS: {
|
|
|
32
32
|
readonly '@aws-lambda-powertools/parameters': "2.36.0";
|
|
33
33
|
readonly '@aws-lambda-powertools/tracer': "2.36.0";
|
|
34
34
|
readonly '@aws-lambda-powertools/parser': "2.36.0";
|
|
35
|
-
readonly '@aws-sdk/client-appconfigdata': "3.
|
|
35
|
+
readonly '@aws-sdk/client-appconfigdata': "3.1152.0";
|
|
36
36
|
readonly '@middy/core': "7.9.2";
|
|
37
37
|
readonly '@nxlv/python': "23.2.1";
|
|
38
38
|
readonly '@nx-extend/terraform': "10.4.1";
|
|
@@ -48,27 +48,27 @@ export declare const TS_VERSIONS: {
|
|
|
48
48
|
readonly '@swc/core': "1.16.18";
|
|
49
49
|
readonly '@modelcontextprotocol/sdk': "1.32.1";
|
|
50
50
|
readonly '@modelcontextprotocol/client': "2.3.1";
|
|
51
|
-
readonly '@modelcontextprotocol/inspector': "2.
|
|
51
|
+
readonly '@modelcontextprotocol/inspector': "2.11.0";
|
|
52
52
|
readonly '@ag-ui/a2ui-toolkit': "0.0.5";
|
|
53
53
|
readonly '@ag-ui/aws-strands': "1.0.0";
|
|
54
54
|
readonly '@ag-ui/client': "1.0.2";
|
|
55
55
|
readonly '@ag-ui/core': "1.0.2";
|
|
56
56
|
readonly '@ag-ui/encoder': "1.0.2";
|
|
57
57
|
readonly 'agent-chat-cli': "0.3.0";
|
|
58
|
-
readonly '@copilotkit/react-core': "1.79.
|
|
58
|
+
readonly '@copilotkit/react-core': "1.79.1";
|
|
59
59
|
readonly rxjs: "7.8.2";
|
|
60
|
-
readonly '@strands-agents/sdk': "1.
|
|
61
|
-
readonly '@tanstack/react-router': "1.170.
|
|
62
|
-
readonly '@tanstack/router-plugin': "1.168.
|
|
63
|
-
readonly '@tanstack/router-generator': "1.167.
|
|
60
|
+
readonly '@strands-agents/sdk': "1.21.0";
|
|
61
|
+
readonly '@tanstack/react-router': "1.170.45";
|
|
62
|
+
readonly '@tanstack/router-plugin': "1.168.47";
|
|
63
|
+
readonly '@tanstack/router-generator': "1.167.45";
|
|
64
64
|
readonly '@tanstack/virtual-file-routes': "1.162.0";
|
|
65
|
-
readonly '@tanstack/router-utils': "1.162.
|
|
65
|
+
readonly '@tanstack/router-utils': "1.162.4";
|
|
66
66
|
readonly '@cloudscape-design/board-components': "3.0.238";
|
|
67
67
|
readonly '@cloudscape-design/chat-components': "1.0.179";
|
|
68
|
-
readonly '@cloudscape-design/components': "3.0.
|
|
68
|
+
readonly '@cloudscape-design/components': "3.0.1401";
|
|
69
69
|
readonly '@cloudscape-design/global-styles': "1.0.71";
|
|
70
|
-
readonly '@tanstack/react-query': "5.104.
|
|
71
|
-
readonly '@tanstack/react-query-devtools': "5.104.
|
|
70
|
+
readonly '@tanstack/react-query': "5.104.4";
|
|
71
|
+
readonly '@tanstack/react-query-devtools': "5.104.4";
|
|
72
72
|
readonly '@trpc/tanstack-react-query': "11.19.0";
|
|
73
73
|
readonly '@trpc/client': "11.19.0";
|
|
74
74
|
readonly '@trpc/server': "11.19.0";
|
|
@@ -82,11 +82,11 @@ export declare const TS_VERSIONS: {
|
|
|
82
82
|
readonly '@smithy/node-config-provider': "4.6.2";
|
|
83
83
|
readonly '@smithy/node-http-handler': "4.12.1";
|
|
84
84
|
readonly '@smithy/types': "4.19.0";
|
|
85
|
-
readonly '@vitest/coverage-v8': "4.1.
|
|
86
|
-
readonly '@vitest/ui': "4.1.
|
|
85
|
+
readonly '@vitest/coverage-v8': "4.1.12";
|
|
86
|
+
readonly '@vitest/ui': "4.1.12";
|
|
87
87
|
readonly '@astrojs/react': "6.0.6";
|
|
88
88
|
readonly '@astrojs/starlight': "0.42.6";
|
|
89
|
-
readonly astro: "7.
|
|
89
|
+
readonly astro: "7.4.0";
|
|
90
90
|
readonly cookie: "2.0.1";
|
|
91
91
|
readonly aws4fetch: "1.0.20";
|
|
92
92
|
readonly 'aws-cdk': "2.1145.0";
|
|
@@ -96,16 +96,16 @@ export declare const TS_VERSIONS: {
|
|
|
96
96
|
readonly cors: "2.8.6";
|
|
97
97
|
readonly chalk: "6.0.1";
|
|
98
98
|
readonly 'class-variance-authority': "0.7.1";
|
|
99
|
-
readonly cn: "0.
|
|
99
|
+
readonly cn: "0.5.0";
|
|
100
100
|
readonly commander: "15.0.0";
|
|
101
101
|
readonly electrodb: "3.9.3";
|
|
102
102
|
readonly esbuild: "0.28.2";
|
|
103
103
|
readonly 'event-source-polyfill': "1.0.31";
|
|
104
104
|
readonly '@types/event-source-polyfill': "1.0.5";
|
|
105
105
|
readonly '@biomejs/biome': "2.5.15";
|
|
106
|
-
readonly '@prisma/adapter-mariadb': "7.10.
|
|
107
|
-
readonly '@prisma/adapter-pg': "7.10.
|
|
108
|
-
readonly '@prisma/client': "7.10.
|
|
106
|
+
readonly '@prisma/adapter-mariadb': "7.10.1";
|
|
107
|
+
readonly '@prisma/adapter-pg': "7.10.1";
|
|
108
|
+
readonly '@prisma/client': "7.10.1";
|
|
109
109
|
readonly ejs: "6.0.1";
|
|
110
110
|
readonly '@types/ejs': "3.1.5";
|
|
111
111
|
readonly express: "5.3.0";
|
|
@@ -114,31 +114,31 @@ export declare const TS_VERSIONS: {
|
|
|
114
114
|
readonly 'fs-extra': "11.4.1";
|
|
115
115
|
readonly '@types/fs-extra': "11.0.4";
|
|
116
116
|
readonly mariadb: "3.5.4";
|
|
117
|
-
readonly mise: "2026.10.
|
|
118
|
-
readonly npm: "12.2.
|
|
117
|
+
readonly mise: "2026.10.14";
|
|
118
|
+
readonly npm: "12.2.1";
|
|
119
119
|
readonly 'npm-check-updates': "23.1.1";
|
|
120
120
|
readonly 'oidc-client-ts': "3.5.0";
|
|
121
121
|
readonly pg: "8.23.1";
|
|
122
|
-
readonly prisma: "7.10.
|
|
122
|
+
readonly prisma: "7.10.1";
|
|
123
123
|
readonly 'react-oidc-context': "3.3.1";
|
|
124
|
-
readonly react: "19.3.
|
|
125
|
-
readonly 'react-dom': "19.3.
|
|
126
|
-
readonly rolldown: "1.2.
|
|
124
|
+
readonly react: "19.3.1";
|
|
125
|
+
readonly 'react-dom': "19.3.1";
|
|
126
|
+
readonly rolldown: "1.2.14";
|
|
127
127
|
readonly 'rolldown-plugin-dts': "0.28.8";
|
|
128
128
|
readonly shx: "0.4.0";
|
|
129
129
|
readonly 'simple-git': "4.0.2";
|
|
130
130
|
readonly 'source-map-support': "0.5.21";
|
|
131
|
-
readonly 'starlight-blog': "0.30.
|
|
131
|
+
readonly 'starlight-blog': "0.30.2";
|
|
132
132
|
readonly tailwindcss: "4.3.3";
|
|
133
133
|
readonly '@tailwindcss/vite': "4.3.3";
|
|
134
134
|
readonly tsx: "4.23.15";
|
|
135
|
-
readonly 'lucide-react': "1.
|
|
135
|
+
readonly 'lucide-react': "1.59.0";
|
|
136
136
|
readonly 'radix-ui': "1.8.1";
|
|
137
|
-
readonly shadcn: "4.
|
|
137
|
+
readonly shadcn: "4.22.1";
|
|
138
138
|
readonly 'tw-animate-css': "1.4.0";
|
|
139
139
|
readonly vite: "8.3.4";
|
|
140
140
|
readonly typescript: "6.0.3";
|
|
141
|
-
readonly vitest: "4.1.
|
|
141
|
+
readonly vitest: "4.1.12";
|
|
142
142
|
readonly jsdom: "29.1.1";
|
|
143
143
|
readonly zod: "4.6.7";
|
|
144
144
|
readonly ws: "8.22.0";
|
|
@@ -196,29 +196,29 @@ export declare const PY_VERSIONS: {
|
|
|
196
196
|
readonly 'ag-ui-protocol': "==0.1.22";
|
|
197
197
|
readonly 'ag-ui-strands': "==0.4.1";
|
|
198
198
|
readonly aiosqlite: "==0.22.1";
|
|
199
|
-
readonly 'aws-lambda-powertools': "==3.
|
|
200
|
-
readonly 'aws-lambda-powertools[tracer]': "==3.
|
|
201
|
-
readonly 'aws-lambda-powertools[parser]': "==3.
|
|
199
|
+
readonly 'aws-lambda-powertools': "==3.36.0";
|
|
200
|
+
readonly 'aws-lambda-powertools[tracer]': "==3.36.0";
|
|
201
|
+
readonly 'aws-lambda-powertools[parser]': "==3.36.0";
|
|
202
202
|
readonly 'aws-opentelemetry-distro': "==0.21.0";
|
|
203
|
-
readonly 'bedrock-agentcore': "==1.24.
|
|
204
|
-
readonly boto3: "==1.43.
|
|
203
|
+
readonly 'bedrock-agentcore': "==1.24.2";
|
|
204
|
+
readonly boto3: "==1.43.115";
|
|
205
205
|
readonly checkov: "==3.3.29";
|
|
206
|
-
readonly fastapi: "==0.
|
|
207
|
-
readonly 'fastapi[standard]': "==0.
|
|
206
|
+
readonly fastapi: "==0.150.0";
|
|
207
|
+
readonly 'fastapi[standard]': "==0.150.0";
|
|
208
208
|
readonly httpx: "==0.28.1";
|
|
209
209
|
readonly langchain: "==1.4.6";
|
|
210
|
-
readonly 'langchain-aws': "==1.
|
|
210
|
+
readonly 'langchain-aws': "==1.9.0";
|
|
211
211
|
readonly 'langchain-mcp-adapters': "==0.3.2";
|
|
212
|
-
readonly langgraph: "==1.2.
|
|
212
|
+
readonly langgraph: "==1.2.16";
|
|
213
213
|
readonly 'langgraph-checkpoint-aws': "==1.2.5";
|
|
214
214
|
readonly 'langgraph-checkpoint-sqlite': "==3.1.2";
|
|
215
215
|
readonly mcp: "==1.28.1";
|
|
216
216
|
readonly 'pip-check-updates': "==0.29.0";
|
|
217
217
|
readonly 'pip-licenses': "==5.5.5";
|
|
218
218
|
readonly pydantic: "==2.14.1";
|
|
219
|
-
readonly ruff: "==0.17.
|
|
220
|
-
readonly 'strands-agents': "==1.
|
|
221
|
-
readonly 'strands-agents[a2a]': "==1.
|
|
219
|
+
readonly ruff: "==0.17.1";
|
|
220
|
+
readonly 'strands-agents': "==1.61.1";
|
|
221
|
+
readonly 'strands-agents[a2a]': "==1.61.1";
|
|
222
222
|
readonly 'strands-agents-tools': "==0.8.9";
|
|
223
223
|
readonly ty: "==0.0.87";
|
|
224
224
|
readonly pynamodb: "==6.1.0";
|
|
@@ -247,10 +247,10 @@ export declare const VENDORED_VERSIONS: {
|
|
|
247
247
|
* `<group>:<artifact>:<version>` where a generator writes it.
|
|
248
248
|
*/
|
|
249
249
|
export declare const JAVA_VERSIONS: {
|
|
250
|
-
readonly 'software.amazon.smithy:smithy-model': "1.74.
|
|
251
|
-
readonly 'software.amazon.smithy:smithy-aws-traits': "1.74.
|
|
252
|
-
readonly 'software.amazon.smithy:smithy-validation-model': "1.74.
|
|
253
|
-
readonly 'software.amazon.smithy:smithy-openapi': "1.74.
|
|
250
|
+
readonly 'software.amazon.smithy:smithy-model': "1.74.1";
|
|
251
|
+
readonly 'software.amazon.smithy:smithy-aws-traits': "1.74.1";
|
|
252
|
+
readonly 'software.amazon.smithy:smithy-validation-model': "1.74.1";
|
|
253
|
+
readonly 'software.amazon.smithy:smithy-openapi': "1.74.1";
|
|
254
254
|
readonly 'software.amazon.smithy.typescript:smithy-aws-typescript-codegen': "0.54.0";
|
|
255
255
|
};
|
|
256
256
|
export type IJavaVersion = keyof typeof JAVA_VERSIONS;
|
|
@@ -266,7 +266,7 @@ export declare const javaMavenDependency: (artifact: IJavaVersion) => string;
|
|
|
266
266
|
* command, which is what the version sync reaches to move it forward.
|
|
267
267
|
*/
|
|
268
268
|
export declare const MISE_VERSIONS: {
|
|
269
|
-
readonly smithy: "1.74.
|
|
269
|
+
readonly smithy: "1.74.1";
|
|
270
270
|
};
|
|
271
271
|
export type IMiseVersion = keyof typeof MISE_VERSIONS;
|
|
272
272
|
/** The tools the version update resolves through mise, in declaration order. */
|