@dbx-tools/projen 0.6.183 → 0.6.186
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 +6 -1
- package/index.ts +1 -1
- package/package.json +4 -4
- package/src/project-rs.ts +60 -14
- package/tasks/bump.ts +1 -1
package/README.md
CHANGED
|
@@ -153,7 +153,12 @@ 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 or
|
|
157
|
+
release-enabled binary's `releaseExcludeOs` package option to omit it from
|
|
158
|
+
incompatible rows through Cargo `--exclude`. Release binary packaging and
|
|
159
|
+
artifact upload are skipped in those rows. UniFFI crates cannot use this option
|
|
160
|
+
because every configured target must produce their artifacts.
|
|
161
|
+
Rust rows prepare native npm
|
|
157
162
|
archives and Python wheels; they do not install Bun or UBRN and do not build
|
|
158
163
|
Node facades. A binary-only row therefore installs no language package tool.
|
|
159
164
|
`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.185";
|
|
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.186",
|
|
29
|
+
"@dbx-tools/path": "0.6.186",
|
|
30
|
+
"@dbx-tools/shared-core": "0.6.186",
|
|
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.186",
|
|
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 crate and any release binary artifact from 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) {
|
|
511
|
+
throw new Error(
|
|
512
|
+
`${pkg.crateName} cannot set releaseExcludeOs because UniFFI requires every configured target`,
|
|
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) =>
|
|
@@ -745,6 +764,7 @@ export class DBXToolsRustWorkspace {
|
|
|
745
764
|
.map((pkg) => ({
|
|
746
765
|
crate: pkg.crateName,
|
|
747
766
|
binary: pkg.packageOptions.binaryName ?? pkg.crateName,
|
|
767
|
+
excludedOs: pkg.packageOptions.releaseExcludeOs ?? [],
|
|
748
768
|
}));
|
|
749
769
|
const publicCrates = orderRustBindings(
|
|
750
770
|
this.packages
|
|
@@ -760,7 +780,16 @@ export class DBXToolsRustWorkspace {
|
|
|
760
780
|
).map((dependency) => dependency.crateName),
|
|
761
781
|
})),
|
|
762
782
|
).map((pkg) => pkg.crate);
|
|
763
|
-
const
|
|
783
|
+
const hasReleaseExclusions = this.packages.some(
|
|
784
|
+
(pkg) => pkg.packageOptions.releaseExcludeOs?.length,
|
|
785
|
+
);
|
|
786
|
+
const targetMatrix = targets.map((target) => {
|
|
787
|
+
const cargoExcludes = this.packages
|
|
788
|
+
.filter((pkg) => pkg.packageOptions.releaseExcludeOs?.includes(target.os))
|
|
789
|
+
.map((pkg) => `--exclude ${pkg.crateName}`)
|
|
790
|
+
.join(" ");
|
|
791
|
+
return { ...target, ...(hasReleaseExclusions ? { cargoExcludes } : {}) };
|
|
792
|
+
});
|
|
764
793
|
const hasPythonBindings = bindings.some((binding) => binding.python);
|
|
765
794
|
const usePreinstalledWindowsRust = releaseRustVersion === "stable";
|
|
766
795
|
const hasTargetOutputs =
|
|
@@ -795,18 +824,30 @@ export class DBXToolsRustWorkspace {
|
|
|
795
824
|
"--skip-build",
|
|
796
825
|
].join(" \\\n "),
|
|
797
826
|
);
|
|
798
|
-
const
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
827
|
+
const releaseBinaryCondition = (excludedOs: readonly RustReleaseOs[]) =>
|
|
828
|
+
excludedOs.length
|
|
829
|
+
? `\${{ ${excludedOs.map((os) => `matrix.os != '${os}'`).join(" && ")} }}`
|
|
830
|
+
: undefined;
|
|
831
|
+
const binaryCommands = releaseBinaries.flatMap((pkg) => {
|
|
832
|
+
const commands = [
|
|
833
|
+
`mkdir -p "dist/release/${pkg.crate}/\${{ matrix.node }}/binary/stage"`,
|
|
834
|
+
`SOURCE="target/\${{ matrix.cargo }}/release/${pkg.binary}\${{ matrix.os == 'win32' && '.exe' || '' }}"`,
|
|
835
|
+
`DESTINATION="dist/release/${pkg.crate}/\${{ matrix.node }}/binary/stage/${pkg.binary}\${{ matrix.os == 'win32' && '.exe' || '' }}"`,
|
|
836
|
+
'cp "$SOURCE" "$DESTINATION"',
|
|
837
|
+
'if [ "${{ matrix.os }}" = "win32" ]; then',
|
|
838
|
+
` 7z a "dist/release/${pkg.crate}/\${{ matrix.node }}/binary/${pkg.binary}-\${{ matrix.node }}.zip" "$DESTINATION"`,
|
|
839
|
+
"else",
|
|
840
|
+
` tar -C "dist/release/${pkg.crate}/\${{ matrix.node }}/binary/stage" -czf "dist/release/${pkg.crate}/\${{ matrix.node }}/binary/${pkg.binary}-\${{ matrix.node }}.tar.gz" "${pkg.binary}"`,
|
|
841
|
+
"fi",
|
|
842
|
+
`rm -rf "dist/release/${pkg.crate}/\${{ matrix.node }}/binary/stage"`,
|
|
843
|
+
];
|
|
844
|
+
const excludedCondition = pkg.excludedOs
|
|
845
|
+
.map((os) => `[ "\${{ matrix.os }}" != "${os}" ]`)
|
|
846
|
+
.join(" && ");
|
|
847
|
+
return excludedCondition
|
|
848
|
+
? [`if ${excludedCondition}; then`, ...commands.map((command) => ` ${command}`), "fi"]
|
|
849
|
+
: commands;
|
|
850
|
+
});
|
|
810
851
|
const artifactSteps: JobStep[] = [
|
|
811
852
|
...bindings.flatMap((binding) => [
|
|
812
853
|
...(binding.node
|
|
@@ -839,6 +880,9 @@ export class DBXToolsRustWorkspace {
|
|
|
839
880
|
...releaseBinaries.map((pkg) => ({
|
|
840
881
|
name: `Upload ${pkg.crate} release binary`,
|
|
841
882
|
uses: "actions/upload-artifact@v7",
|
|
883
|
+
...(releaseBinaryCondition(pkg.excludedOs)
|
|
884
|
+
? { if: releaseBinaryCondition(pkg.excludedOs) }
|
|
885
|
+
: {}),
|
|
842
886
|
with: {
|
|
843
887
|
name: `${pkg.crate}-\${{ matrix.node }}-binary`,
|
|
844
888
|
path: `dist/release/${pkg.crate}/\${{ matrix.node }}/binary/*`,
|
|
@@ -909,7 +953,9 @@ export class DBXToolsRustWorkspace {
|
|
|
909
953
|
},
|
|
910
954
|
run: timedBash(
|
|
911
955
|
"rust_workspace",
|
|
912
|
-
|
|
956
|
+
`cargo build --release --workspace --target "\${{ matrix.cargo }}"${
|
|
957
|
+
hasReleaseExclusions ? " ${{ matrix.cargoExcludes }}" : ""
|
|
958
|
+
}`,
|
|
913
959
|
),
|
|
914
960
|
},
|
|
915
961
|
...(bindingCommands.length
|
package/tasks/bump.ts
CHANGED
|
@@ -330,7 +330,7 @@ program
|
|
|
330
330
|
"-m",
|
|
331
331
|
"🌸 Shipped with Kanna — https://kanna.sh",
|
|
332
332
|
"-m",
|
|
333
|
-
"Co-Authored-By: Kanna <noreply@kanna.sh>\nKanna-Agent: codex/gpt",
|
|
333
|
+
"Co-Authored-By: Kanna <noreply@kanna.sh>\nKanna-Agent: codex/databricks-gpt-5-6-sol",
|
|
334
334
|
]);
|
|
335
335
|
} else {
|
|
336
336
|
logger.info("nothing to commit");
|