@dbx-tools/projen 0.6.183 → 0.6.185
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 +5 -1
- package/index.ts +1 -1
- package/package.json +4 -4
- package/src/project-rs.ts +32 -2
package/README.md
CHANGED
|
@@ -153,7 +153,11 @@ skips matching files and fails when an existing filename has different content.
|
|
|
153
153
|
|
|
154
154
|
The Rust matrix has one row per target. Each row installs native dependencies,
|
|
155
155
|
restores Cargo and sccache once, builds the Cargo workspace once, then packages
|
|
156
|
-
every discovered output from that shared build.
|
|
156
|
+
every discovered output from that shared build. Set a source-only crate's
|
|
157
|
+
`releaseExcludeOs` package option to omit it from incompatible rows through
|
|
158
|
+
Cargo `--exclude`; crates that produce UniFFI or release-binary artifacts cannot
|
|
159
|
+
use this option because every configured target must produce their artifacts.
|
|
160
|
+
Rust rows prepare native npm
|
|
157
161
|
archives and Python wheels; they do not install Bun or UBRN and do not build
|
|
158
162
|
Node facades. A binary-only row therefore installs no language package tool.
|
|
159
163
|
`rustVersion` remains the MSRV recorded in package manifests, while
|
package/index.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Hand edits are overwritten on the next watch; this file is read-only.
|
|
4
4
|
|
|
5
5
|
export const PACKAGE_IDENTIFIER = "@dbx-tools/projen";
|
|
6
|
-
export const PACKAGE_VERSION = "0.6.
|
|
6
|
+
export const PACKAGE_VERSION = "0.6.184";
|
|
7
7
|
export * as barrels from "./src/barrels.ts";
|
|
8
8
|
export * as bunApp from "./src/bun-app.ts";
|
|
9
9
|
export * as bunWorkflow from "./src/bun-workflow.ts";
|
package/package.json
CHANGED
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@clack/prompts": "^1.7.0",
|
|
28
|
-
"@dbx-tools/core": "0.6.
|
|
29
|
-
"@dbx-tools/path": "0.6.
|
|
30
|
-
"@dbx-tools/shared-core": "0.6.
|
|
28
|
+
"@dbx-tools/core": "0.6.185",
|
|
29
|
+
"@dbx-tools/path": "0.6.185",
|
|
30
|
+
"@dbx-tools/shared-core": "0.6.185",
|
|
31
31
|
"commander": "^15.0.0",
|
|
32
32
|
"concurrently": "^10.0.3",
|
|
33
33
|
"constructs": "^10.6.0",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"main": "index.ts",
|
|
49
49
|
"license": "Apache-2.0",
|
|
50
|
-
"version": "0.6.
|
|
50
|
+
"version": "0.6.185",
|
|
51
51
|
"types": "index.ts",
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
package/src/project-rs.ts
CHANGED
|
@@ -46,6 +46,8 @@ export interface RustPackageOptions {
|
|
|
46
46
|
readonly private?: boolean;
|
|
47
47
|
/** Build this crate's binary for each target and attach it to the GitHub release. */
|
|
48
48
|
readonly release?: boolean;
|
|
49
|
+
/** Omit this source-only crate from release workspace builds on these operating systems. */
|
|
50
|
+
readonly releaseExcludeOs?: readonly RustReleaseOs[];
|
|
49
51
|
readonly dependencies?: Readonly<Record<string, CargoDependency>>;
|
|
50
52
|
readonly devDependencies?: Readonly<Record<string, CargoDependency>>;
|
|
51
53
|
readonly features?: Readonly<Record<string, readonly string[]>>;
|
|
@@ -503,6 +505,23 @@ export class DBXToolsRustWorkspace {
|
|
|
503
505
|
const bindings = this.packages.filter((pkg) => pkg.uniffi);
|
|
504
506
|
const packageDependencies = (pkg: DBXToolsRustProject) =>
|
|
505
507
|
rustPackageDependencies(this.packages, pkg, project.outdir, options.workspaceDependencies);
|
|
508
|
+
for (const pkg of this.packages) {
|
|
509
|
+
const excludedOs = new Set(pkg.packageOptions.releaseExcludeOs ?? []);
|
|
510
|
+
if (excludedOs.size && (pkg.uniffi || pkg.packageOptions.release)) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
`${pkg.crateName} cannot set releaseExcludeOs because it produces target-specific release artifacts`,
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
for (const dependency of packageDependencies(pkg)) {
|
|
516
|
+
for (const os of dependency.packageOptions.releaseExcludeOs ?? []) {
|
|
517
|
+
if (!excludedOs.has(os)) {
|
|
518
|
+
throw new Error(
|
|
519
|
+
`${pkg.crateName} must exclude ${os} release builds because it depends on ${dependency.crateName}`,
|
|
520
|
+
);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
506
525
|
const bindingDependencies = (pkg: DBXToolsRustProject, language: "node" | "python") =>
|
|
507
526
|
bindings.filter(
|
|
508
527
|
(dependency) =>
|
|
@@ -760,7 +779,16 @@ export class DBXToolsRustWorkspace {
|
|
|
760
779
|
).map((dependency) => dependency.crateName),
|
|
761
780
|
})),
|
|
762
781
|
).map((pkg) => pkg.crate);
|
|
763
|
-
const
|
|
782
|
+
const hasReleaseExclusions = this.packages.some(
|
|
783
|
+
(pkg) => pkg.packageOptions.releaseExcludeOs?.length,
|
|
784
|
+
);
|
|
785
|
+
const targetMatrix = targets.map((target) => {
|
|
786
|
+
const cargoExcludes = this.packages
|
|
787
|
+
.filter((pkg) => pkg.packageOptions.releaseExcludeOs?.includes(target.os))
|
|
788
|
+
.map((pkg) => `--exclude ${pkg.crateName}`)
|
|
789
|
+
.join(" ");
|
|
790
|
+
return { ...target, ...(hasReleaseExclusions ? { cargoExcludes } : {}) };
|
|
791
|
+
});
|
|
764
792
|
const hasPythonBindings = bindings.some((binding) => binding.python);
|
|
765
793
|
const usePreinstalledWindowsRust = releaseRustVersion === "stable";
|
|
766
794
|
const hasTargetOutputs =
|
|
@@ -909,7 +937,9 @@ export class DBXToolsRustWorkspace {
|
|
|
909
937
|
},
|
|
910
938
|
run: timedBash(
|
|
911
939
|
"rust_workspace",
|
|
912
|
-
|
|
940
|
+
`cargo build --release --workspace --target "\${{ matrix.cargo }}"${
|
|
941
|
+
hasReleaseExclusions ? " ${{ matrix.cargoExcludes }}" : ""
|
|
942
|
+
}`,
|
|
913
943
|
),
|
|
914
944
|
},
|
|
915
945
|
...(bindingCommands.length
|