@dbx-tools/projen 0.9.19 → 0.9.28
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/README.md +83 -229
- package/index.ts +11 -18
- package/package.json +9 -5
- package/src/_task-command.ts +75 -0
- package/src/barrels.ts +1 -74
- package/src/module-exports.ts +175 -1
- package/src/openapi.ts +5 -72
- package/src/packages.ts +45 -0
- package/src/project-js.ts +5 -48
- package/src/project-predicate.ts +1 -2
- package/src/project-py.ts +87 -199
- package/src/project.ts +2 -2
- package/src/python-node-bindings.ts +138 -0
- package/src/python-node-bundle.ts +92 -0
- package/src/release-catalog.ts +40 -208
- package/src/{release-dispatch.ts → release-context.ts} +0 -11
- package/src/release.ts +74 -778
- package/src/scaffold.ts +2 -6
- package/src/workspace-version.ts +9 -121
- package/tasks/bump.ts +17 -34
- package/tasks/databricks-cli-assets.ts +129 -0
- package/tasks/local-publish.ts +61 -138
- package/tasks/publish-npm.ts +71 -30
- package/tasks/publish-python.ts +61 -148
- package/tasks/publish.ts +32 -182
- package/tasks/python-node-bindings-watch.ts +47 -0
- package/tasks/python-node-bindings.ts +1017 -0
- package/tasks/python-registry.ts +2 -9
- package/tasks/python-release.ts +74 -0
- package/tasks/release-version.ts +23 -2
- package/tasks/release.ts +99 -0
- package/tasks/sync.ts +13 -18
- package/tasks/version-check.ts +13 -72
- package/src/_rust-project.ts +0 -429
- package/src/_rust-release-workflow.ts +0 -698
- package/src/project-rs.ts +0 -1127
- package/src/release-plan.ts +0 -269
- package/src/release-please.ts +0 -242
- package/src/uniffi.ts +0 -65
- package/tasks/publish-uniffi-local.ts +0 -314
- package/tasks/release-assets.ts +0 -476
- package/tasks/release-bootstrap.ts +0 -59
- package/tasks/release-candidate.ts +0 -383
- package/tasks/release-manifest.ts +0 -273
- package/tasks/release-plan.ts +0 -89
- package/tasks/release-please.ts +0 -162
- package/tasks/release-pr.ts +0 -563
- package/tasks/release-request.ts +0 -166
- package/tasks/release-summary-units.ts +0 -75
- package/tasks/release-summary.ts +0 -381
- package/tasks/rust.ts +0 -178
- package/tasks/stamp-python.ts +0 -13
- package/tasks/uniffi-python.d.ts +0 -61
- package/tasks/uniffi-python.js +0 -191
- package/tasks/uniffi-release.mjs +0 -573
- package/tasks/uniffi.ts +0 -271
package/tasks/python-registry.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { homedir } from "node:os";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
|
-
import * as exec from "@dbx-tools/core/exec";
|
|
5
4
|
import { net } from "@dbx-tools/shared-core";
|
|
5
|
+
import { captureTaskCommand } from "../src/_task-command.ts";
|
|
6
6
|
|
|
7
7
|
export interface LocalPythonRegistry {
|
|
8
8
|
readonly indexUrl: string;
|
|
@@ -126,14 +126,7 @@ function splitIndexList(value: string | undefined): string[] {
|
|
|
126
126
|
|
|
127
127
|
/** Read a `pip config get <key>`, treating pip's literal "undefined" as unset. */
|
|
128
128
|
function pipConfig(key: string): string | undefined {
|
|
129
|
-
const
|
|
130
|
-
cwd: process.cwd(),
|
|
131
|
-
stdout: "capture",
|
|
132
|
-
stderr: "ignore",
|
|
133
|
-
stdin: "ignore",
|
|
134
|
-
check: false,
|
|
135
|
-
});
|
|
136
|
-
const out = res.stdout?.trim();
|
|
129
|
+
const out = captureTaskCommand(process.cwd(), "python", ["-m", "pip", "config", "get", key]);
|
|
137
130
|
return out && out !== "undefined" ? out : undefined;
|
|
138
131
|
}
|
|
139
132
|
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/** Shared Python release manifest parsing and dependency projection. */
|
|
2
|
+
|
|
3
|
+
const projectTable = (document: unknown): Record<string, unknown> => {
|
|
4
|
+
const project = (document as { project?: unknown })?.project;
|
|
5
|
+
if (!project || typeof project !== "object" || Array.isArray(project)) {
|
|
6
|
+
throw new Error("Missing Python project metadata");
|
|
7
|
+
}
|
|
8
|
+
return project as Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const directSibling = (
|
|
12
|
+
dependency: string,
|
|
13
|
+
sibling: { readonly directory: string; readonly name: string },
|
|
14
|
+
): boolean => {
|
|
15
|
+
const prefix = `${sibling.name} @ git+`;
|
|
16
|
+
if (!dependency.startsWith(prefix)) return false;
|
|
17
|
+
const marker = "#subdirectory=";
|
|
18
|
+
const markerIndex = dependency.indexOf(marker, prefix.length);
|
|
19
|
+
if (markerIndex < 0) return false;
|
|
20
|
+
const directory = dependency.slice(markerIndex + marker.length);
|
|
21
|
+
return directory === sibling.directory || directory.endsWith(`/${sibling.directory}`);
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export function pythonProjectInfo(
|
|
25
|
+
source: string,
|
|
26
|
+
toml: { parse(source: string): unknown },
|
|
27
|
+
): { name: string; version: string; private: boolean } {
|
|
28
|
+
const document = toml.parse(source) as { tool?: { "dbx-tools"?: { private?: boolean } } };
|
|
29
|
+
const project = projectTable(document);
|
|
30
|
+
if (typeof project.name !== "string" || !project.name) {
|
|
31
|
+
throw new Error("Missing Python project name");
|
|
32
|
+
}
|
|
33
|
+
if (typeof project.version !== "string" || !project.version) {
|
|
34
|
+
throw new Error("Missing Python project version");
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
name: project.name,
|
|
38
|
+
version: project.version,
|
|
39
|
+
private: document.tool?.["dbx-tools"]?.private === true,
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function preparePythonProjectForPublication(
|
|
44
|
+
source: string,
|
|
45
|
+
options: {
|
|
46
|
+
readonly packages: readonly { readonly directory: string; readonly name: string }[];
|
|
47
|
+
readonly toml: { parse(source: string): unknown; stringify(document: unknown): string };
|
|
48
|
+
readonly version: string;
|
|
49
|
+
},
|
|
50
|
+
): string {
|
|
51
|
+
const marker = source.startsWith("# ") ? source.slice(0, source.indexOf("\n")) : undefined;
|
|
52
|
+
const document = options.toml.parse(source);
|
|
53
|
+
const project = projectTable(document);
|
|
54
|
+
if (project.version !== options.version) {
|
|
55
|
+
throw new Error(
|
|
56
|
+
`Python project version ${String(project.version)} does not match release ${options.version}`,
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
const dependencies = project.dependencies;
|
|
60
|
+
if (dependencies !== undefined && !Array.isArray(dependencies)) {
|
|
61
|
+
throw new Error("Python project dependencies must be an array");
|
|
62
|
+
}
|
|
63
|
+
if (dependencies) {
|
|
64
|
+
project.dependencies = dependencies.map((dependency) => {
|
|
65
|
+
if (typeof dependency !== "string") {
|
|
66
|
+
throw new Error("Python project dependencies must be strings");
|
|
67
|
+
}
|
|
68
|
+
const sibling = options.packages.find((candidate) => directSibling(dependency, candidate));
|
|
69
|
+
return sibling ? `${sibling.name}==${options.version}` : dependency;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const body = options.toml.stringify(document).trimEnd();
|
|
73
|
+
return `${marker ? `${marker}\n\n` : ""}${body}\n`;
|
|
74
|
+
}
|
package/tasks/release-version.ts
CHANGED
|
@@ -3,7 +3,28 @@
|
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { parseArgs } from "node:util";
|
|
5
5
|
import * as projectUtils from "@dbx-tools/core/project-utils";
|
|
6
|
-
import {
|
|
6
|
+
import { captureGitTaskCommand } from "../src/_task-command.ts";
|
|
7
|
+
import { compareSemver, parseSemver, type Semver } from "../src/workspace-version.ts";
|
|
8
|
+
|
|
9
|
+
function publishedVersion(root: string, prefixes: readonly string[]): string | undefined {
|
|
10
|
+
let best: Semver | undefined;
|
|
11
|
+
for (const prefix of prefixes) {
|
|
12
|
+
const tags = captureGitTaskCommand(root, [
|
|
13
|
+
"-c",
|
|
14
|
+
"versionsort.suffix=-",
|
|
15
|
+
"tag",
|
|
16
|
+
"--sort=-version:refname",
|
|
17
|
+
"--list",
|
|
18
|
+
`${prefix}*`,
|
|
19
|
+
]);
|
|
20
|
+
for (const tag of tags.split("\n")) {
|
|
21
|
+
if (!tag.startsWith(prefix)) continue;
|
|
22
|
+
const version = parseSemver(tag.slice(prefix.length));
|
|
23
|
+
if (version && (!best || compareSemver(version, best) > 0)) best = version;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return best?.join(".");
|
|
27
|
+
}
|
|
7
28
|
|
|
8
29
|
export function assertReleaseVersion(
|
|
9
30
|
version: string,
|
|
@@ -18,7 +39,7 @@ export function assertReleaseVersion(
|
|
|
18
39
|
if (!options.assertNext) return;
|
|
19
40
|
const root = resolve(options.root ?? projectUtils.root() ?? process.cwd());
|
|
20
41
|
const prefixes = options.prefixes?.length ? options.prefixes : ["v"];
|
|
21
|
-
const current =
|
|
42
|
+
const current = publishedVersion(root, prefixes);
|
|
22
43
|
const currentParsed = current ? parseSemver(current) : undefined;
|
|
23
44
|
if (currentParsed && compareSemver(parsed, currentParsed) <= 0) {
|
|
24
45
|
throw new Error(`release version ${version} must be greater than published ${current}`);
|
package/tasks/release.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
#!/usr/bin/env -S bun
|
|
2
|
+
/** Run the configured release transaction. */
|
|
3
|
+
import * as projectUtils from "@dbx-tools/core/project-utils";
|
|
4
|
+
import { log } from "@dbx-tools/shared-core";
|
|
5
|
+
import { Command } from "commander";
|
|
6
|
+
import {
|
|
7
|
+
captureGitTaskCommand,
|
|
8
|
+
gitTaskCommandSucceeds,
|
|
9
|
+
runGitTaskCommand,
|
|
10
|
+
runTaskCommand,
|
|
11
|
+
} from "../src/_task-command.ts";
|
|
12
|
+
import { assertReleaseVersion } from "./release-version.ts";
|
|
13
|
+
import { readWorkspaceVersion } from "../src/workspace-version.ts";
|
|
14
|
+
|
|
15
|
+
const logger = log.logger("projen:release");
|
|
16
|
+
|
|
17
|
+
export function runRelease(options: {
|
|
18
|
+
readonly root: string;
|
|
19
|
+
readonly branch: string;
|
|
20
|
+
readonly bump?: boolean;
|
|
21
|
+
readonly prefix: string;
|
|
22
|
+
readonly remote: string;
|
|
23
|
+
}): string {
|
|
24
|
+
const { branch, prefix, remote, root } = options;
|
|
25
|
+
const currentBranch = captureGitTaskCommand(root, ["branch", "--show-current"], { check: true });
|
|
26
|
+
if (currentBranch !== branch) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
`release must run on ${branch}, current branch is ${currentBranch || "detached"}`,
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
if (options.bump ?? true) {
|
|
33
|
+
const status = captureGitTaskCommand(
|
|
34
|
+
root,
|
|
35
|
+
["status", "--porcelain=v1", "--untracked-files=all"],
|
|
36
|
+
{ check: true },
|
|
37
|
+
);
|
|
38
|
+
if (status) {
|
|
39
|
+
throw new Error("release with automatic bump requires a clean working tree");
|
|
40
|
+
}
|
|
41
|
+
runTaskCommand(root, "bun", ["run", "bump"]);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const version = readWorkspaceVersion(root);
|
|
45
|
+
const tag = `${prefix}${version}`;
|
|
46
|
+
runGitTaskCommand(root, ["fetch", remote, branch, "--tags"]);
|
|
47
|
+
assertReleaseVersion(version, { root, prefixes: [prefix], assertNext: true });
|
|
48
|
+
|
|
49
|
+
if (gitTaskCommandSucceeds(root, ["rev-parse", "--verify", `refs/tags/${tag}`])) {
|
|
50
|
+
throw new Error(`release tag ${tag} already exists`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
runTaskCommand(root, "bun", ["run", "version:check"]);
|
|
54
|
+
const status = captureGitTaskCommand(
|
|
55
|
+
root,
|
|
56
|
+
["status", "--porcelain=v1", "--untracked-files=all"],
|
|
57
|
+
{ check: true },
|
|
58
|
+
);
|
|
59
|
+
if (status) {
|
|
60
|
+
if (gitTaskCommandSucceeds(root, ["diff", "--quiet", "HEAD", "--", "VERSION"])) {
|
|
61
|
+
throw new Error("release changes must include the local VERSION bump");
|
|
62
|
+
}
|
|
63
|
+
runGitTaskCommand(root, ["add", "--all"]);
|
|
64
|
+
runGitTaskCommand(root, ["commit", "-m", `chore(release): ${version}`]);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const remoteHead = captureGitTaskCommand(root, ["rev-parse", `${remote}/${branch}`], {
|
|
68
|
+
check: true,
|
|
69
|
+
});
|
|
70
|
+
const head = captureGitTaskCommand(root, ["rev-parse", "HEAD"], { check: true });
|
|
71
|
+
if (!gitTaskCommandSucceeds(root, ["merge-base", "--is-ancestor", remoteHead, head])) {
|
|
72
|
+
throw new Error(`${branch} must contain ${remote}/${branch} before release`);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
runGitTaskCommand(root, ["push", remote, `HEAD:${branch}`]);
|
|
76
|
+
runGitTaskCommand(root, ["tag", "--annotate", tag, "--message", tag]);
|
|
77
|
+
runGitTaskCommand(root, ["push", remote, `refs/tags/${tag}`]);
|
|
78
|
+
logger.success(`released ${tag}`, { sha: head });
|
|
79
|
+
return tag;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
if (import.meta.main) {
|
|
83
|
+
new Command()
|
|
84
|
+
.option("--root <path>", "repository root")
|
|
85
|
+
.option("--branch <name>", "release branch", "main")
|
|
86
|
+
.option("--prefix <prefix>", "release tag prefix", "v")
|
|
87
|
+
.option("--remote <name>", "git remote", "origin")
|
|
88
|
+
.option("--no-bump", "use an existing synchronized local version bump")
|
|
89
|
+
.action((options: { root?: string; branch: string; bump: boolean; prefix: string; remote: string }) => {
|
|
90
|
+
runRelease({
|
|
91
|
+
root: options.root ?? projectUtils.root() ?? process.cwd(),
|
|
92
|
+
branch: options.branch,
|
|
93
|
+
bump: options.bump,
|
|
94
|
+
prefix: options.prefix,
|
|
95
|
+
remote: options.remote,
|
|
96
|
+
});
|
|
97
|
+
})
|
|
98
|
+
.parse();
|
|
99
|
+
}
|
package/tasks/sync.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
import { log } from "@dbx-tools/shared-core";
|
|
4
4
|
import concurrently from "concurrently";
|
|
5
|
-
import {
|
|
5
|
+
import { pythonNodeBindingProjects, repoRoot } from "../src/packages.ts";
|
|
6
6
|
import { runSynth } from "../src/scaffold.ts";
|
|
7
7
|
import { withWorkspaceMutationLock } from "../src/workspace-lock.ts";
|
|
8
8
|
|
|
@@ -26,14 +26,13 @@ function taskPath(script: string): string {
|
|
|
26
26
|
return fileURLToPath(new URL(`./${script}`, import.meta.url));
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
/**
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
);
|
|
29
|
+
/** One restartable focused watcher managed by the sync supervisor. */
|
|
30
|
+
function watcher(script: string, name: string, prefixColor: string, ...args: string[]) {
|
|
31
|
+
return {
|
|
32
|
+
command: ["bun", JSON.stringify(taskPath(script)), ...args].join(" "),
|
|
33
|
+
name,
|
|
34
|
+
prefixColor,
|
|
35
|
+
};
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
if (!process.argv.includes("--watch")) {
|
|
@@ -65,16 +64,12 @@ if (!process.argv.includes("--watch")) {
|
|
|
65
64
|
}
|
|
66
65
|
|
|
67
66
|
const watchers = [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
67
|
+
watcher("projenrc.ts", "projenrc", "magenta"),
|
|
68
|
+
watcher("barrels.ts", "barrels", "cyan", "--watch"),
|
|
69
|
+
watcher("openapi.ts", "openapi", "green", "--watch"),
|
|
71
70
|
];
|
|
72
|
-
if (
|
|
73
|
-
watchers.push(
|
|
74
|
-
command: `bun "${taskPath("rust.ts")}" --watch`,
|
|
75
|
-
name: "rust",
|
|
76
|
-
prefixColor: "yellow",
|
|
77
|
-
});
|
|
71
|
+
if (pythonNodeBindingProjects(repoRoot).length > 0) {
|
|
72
|
+
watchers.push(watcher("python-node-bindings-watch.ts", "node-bindings", "blue"));
|
|
78
73
|
}
|
|
79
74
|
const { result } = concurrently(watchers, {
|
|
80
75
|
prefix: "name",
|
package/tasks/version-check.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env -S bun
|
|
2
|
-
/** Verify that every committed package version matches
|
|
2
|
+
/** Verify that every committed package version matches the root VERSION file. */
|
|
3
3
|
import { existsSync, readFileSync } from "node:fs";
|
|
4
|
-
import {
|
|
5
|
-
import * as exec from "@dbx-tools/core/exec";
|
|
4
|
+
import { join } from "node:path";
|
|
6
5
|
import * as projectUtils from "@dbx-tools/core/project-utils";
|
|
7
6
|
import { find } from "@dbx-tools/path";
|
|
8
|
-
import { json, log
|
|
7
|
+
import { json, log } from "@dbx-tools/shared-core";
|
|
9
8
|
import { parse } from "smol-toml";
|
|
10
|
-
import { recordedPackages
|
|
11
|
-
import type { ReleaseUnitGraph } from "../src/release-catalog.ts";
|
|
9
|
+
import { recordedPackages } from "../src/packages.ts";
|
|
12
10
|
import { readWorkspaceVersion } from "../src/workspace-version.ts";
|
|
13
11
|
|
|
14
12
|
const logger = log.logger("projen:version-check");
|
|
@@ -25,90 +23,33 @@ function pythonVersion(path: string): string | undefined {
|
|
|
25
23
|
return typeof manifest.project?.version === "string" ? manifest.project.version : undefined;
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
function cargoVersions(root: string): Array<{ name: string; version: string; path: string }> {
|
|
29
|
-
if (!existsSync(join(root, "Cargo.toml"))) return [];
|
|
30
|
-
const locked = existsSync(join(root, "Cargo.lock"));
|
|
31
|
-
const result = exec.spawnSync(
|
|
32
|
-
"cargo",
|
|
33
|
-
["metadata", ...(locked ? ["--locked"] : []), "--format-version", "1", "--no-deps"],
|
|
34
|
-
{
|
|
35
|
-
cwd: root,
|
|
36
|
-
stdout: "capture",
|
|
37
|
-
stderr: "inherit",
|
|
38
|
-
stdin: "ignore",
|
|
39
|
-
check: true,
|
|
40
|
-
},
|
|
41
|
-
);
|
|
42
|
-
const metadata = json.parseRecord(result.stdout ?? "");
|
|
43
|
-
if (!Array.isArray(metadata?.packages)) return [];
|
|
44
|
-
return metadata.packages.flatMap((candidate) => {
|
|
45
|
-
if (
|
|
46
|
-
!object.isRecord(candidate) ||
|
|
47
|
-
typeof candidate.name !== "string" ||
|
|
48
|
-
typeof candidate.version !== "string" ||
|
|
49
|
-
typeof candidate.manifest_path !== "string"
|
|
50
|
-
) {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
return [
|
|
54
|
-
{
|
|
55
|
-
name: candidate.name,
|
|
56
|
-
version: candidate.version,
|
|
57
|
-
path: toPosix(relative(root, dirname(candidate.manifest_path))) || ".",
|
|
58
|
-
},
|
|
59
|
-
];
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
|
|
63
26
|
function main(): void {
|
|
64
27
|
const root = projectUtils.root() ?? process.cwd();
|
|
65
|
-
const
|
|
66
|
-
const graphPath = join(root, ".projen/release-units.json");
|
|
67
|
-
const graph = existsSync(graphPath)
|
|
68
|
-
? (JSON.parse(readFileSync(graphPath, "utf8")) as ReleaseUnitGraph)
|
|
69
|
-
: undefined;
|
|
70
|
-
const units = new Map(graph?.units.map((unit) => [unit.id, unit.version]) ?? []);
|
|
71
|
-
const projects = new Map(graph?.projects.map((entry) => [entry.path, entry]) ?? []);
|
|
28
|
+
const version = readWorkspaceVersion(root);
|
|
72
29
|
const mismatches: string[] = [];
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
if (releaseProject?.unit) return units.get(releaseProject.unit);
|
|
76
|
-
return graph?.mode === "independent" ? undefined : fixedVersion;
|
|
77
|
-
};
|
|
78
|
-
const check = (name: string, path: string, actual: string | undefined): void => {
|
|
79
|
-
const version = expected(path);
|
|
80
|
-
if (version !== undefined && actual !== version) {
|
|
81
|
-
mismatches.push(`${name}: ${actual ?? "missing"} != ${version}`);
|
|
82
|
-
}
|
|
30
|
+
const check = (name: string, actual: string | undefined): void => {
|
|
31
|
+
if (actual !== version) mismatches.push(`${name}: ${actual ?? "missing"} != ${version}`);
|
|
83
32
|
};
|
|
84
33
|
|
|
85
|
-
check("package.json",
|
|
34
|
+
check("package.json", manifestVersion(join(root, "package.json")));
|
|
86
35
|
for (const pkg of recordedPackages(root)) {
|
|
87
|
-
check(`${pkg.path}/package.json`,
|
|
36
|
+
check(`${pkg.path}/package.json`, manifestVersion(join(pkg.dir, "package.json")));
|
|
88
37
|
const barrel = join(pkg.dir, "index.ts");
|
|
89
38
|
if (existsSync(barrel)) {
|
|
90
39
|
const actual = /export const PACKAGE_VERSION = "([^"]+)";/.exec(
|
|
91
40
|
readFileSync(barrel, "utf8"),
|
|
92
41
|
)?.[1];
|
|
93
|
-
check(`${pkg.path}/index.ts`,
|
|
42
|
+
check(`${pkg.path}/index.ts`, actual);
|
|
94
43
|
}
|
|
95
44
|
}
|
|
96
45
|
|
|
97
46
|
for (const path of find.findFiles("**/pyproject.toml", { cwd: root })) {
|
|
98
|
-
check(path,
|
|
99
|
-
}
|
|
100
|
-
for (const pkg of cargoVersions(root)) {
|
|
101
|
-
check(`Cargo package ${pkg.name}`, pkg.path, pkg.version);
|
|
47
|
+
check(path, pythonVersion(join(root, path)));
|
|
102
48
|
}
|
|
103
|
-
|
|
104
49
|
if (mismatches.length > 0) {
|
|
105
|
-
throw new Error(`
|
|
50
|
+
throw new Error(`Workspace version mismatch:\n${mismatches.join("\n")}`);
|
|
106
51
|
}
|
|
107
|
-
logger.success(
|
|
108
|
-
graph
|
|
109
|
-
? `all package versions match ${graph.units.length} release units`
|
|
110
|
-
: `all workspace versions match ${fixedVersion}`,
|
|
111
|
-
);
|
|
52
|
+
logger.success(`all workspace package versions match ${version}`);
|
|
112
53
|
}
|
|
113
54
|
|
|
114
55
|
main();
|