@dbx-tools/projen 0.6.182 → 0.6.183
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/index.ts +1 -1
- package/package.json +4 -4
- package/src/project-rs.ts +45 -29
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.182";
|
|
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.183",
|
|
29
|
+
"@dbx-tools/path": "0.6.183",
|
|
30
|
+
"@dbx-tools/shared-core": "0.6.183",
|
|
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.183",
|
|
51
51
|
"types": "index.ts",
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
package/src/project-rs.ts
CHANGED
|
@@ -444,6 +444,34 @@ export class DBXToolsRustProject extends Project implements DBXToolsProject {
|
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
|
|
447
|
+
function rustPackageDependencies(
|
|
448
|
+
packages: readonly DBXToolsRustProject[],
|
|
449
|
+
pkg: DBXToolsRustProject,
|
|
450
|
+
root: string,
|
|
451
|
+
workspaceDependencies: Readonly<Record<string, CargoDependency>> | undefined,
|
|
452
|
+
): DBXToolsRustProject[] {
|
|
453
|
+
return packages.filter(
|
|
454
|
+
(dependency) =>
|
|
455
|
+
dependency !== pkg &&
|
|
456
|
+
Object.entries(pkg.packageOptions.dependencies ?? {}).some(([name, value]) => {
|
|
457
|
+
const resolved =
|
|
458
|
+
typeof value === "object" && value.workspace
|
|
459
|
+
? (workspaceDependencies?.[name] ?? value)
|
|
460
|
+
: value;
|
|
461
|
+
return (
|
|
462
|
+
name === dependency.crateName ||
|
|
463
|
+
(typeof resolved === "object" &&
|
|
464
|
+
(resolved.package === dependency.crateName ||
|
|
465
|
+
(resolved.path !== undefined &&
|
|
466
|
+
resolve(
|
|
467
|
+
typeof value === "object" && value.workspace ? root : pkg.outdir,
|
|
468
|
+
resolved.path,
|
|
469
|
+
) === dependency.outdir)))
|
|
470
|
+
);
|
|
471
|
+
}),
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
|
|
447
475
|
/** Generated Rust workspace plus convention-derived UniFFI facade packages. */
|
|
448
476
|
export class DBXToolsRustWorkspace {
|
|
449
477
|
readonly packages: readonly DBXToolsRustProject[];
|
|
@@ -473,27 +501,13 @@ export class DBXToolsRustWorkspace {
|
|
|
473
501
|
);
|
|
474
502
|
|
|
475
503
|
const bindings = this.packages.filter((pkg) => pkg.uniffi);
|
|
504
|
+
const packageDependencies = (pkg: DBXToolsRustProject) =>
|
|
505
|
+
rustPackageDependencies(this.packages, pkg, project.outdir, options.workspaceDependencies);
|
|
476
506
|
const bindingDependencies = (pkg: DBXToolsRustProject, language: "node" | "python") =>
|
|
477
507
|
bindings.filter(
|
|
478
508
|
(dependency) =>
|
|
479
|
-
dependency !== pkg &&
|
|
480
509
|
(dependency.packageOptions.bindings ?? ["node", "python"]).includes(language) &&
|
|
481
|
-
|
|
482
|
-
const resolved =
|
|
483
|
-
typeof value === "object" && value.workspace
|
|
484
|
-
? (options.workspaceDependencies?.[name] ?? value)
|
|
485
|
-
: value;
|
|
486
|
-
return (
|
|
487
|
-
name === dependency.crateName ||
|
|
488
|
-
(typeof resolved === "object" &&
|
|
489
|
-
(resolved.package === dependency.crateName ||
|
|
490
|
-
(resolved.path !== undefined &&
|
|
491
|
-
resolve(
|
|
492
|
-
typeof value === "object" && value.workspace ? project.outdir : pkg.outdir,
|
|
493
|
-
resolved.path,
|
|
494
|
-
) === dependency.outdir)))
|
|
495
|
-
);
|
|
496
|
-
}),
|
|
510
|
+
packageDependencies(pkg).includes(dependency),
|
|
497
511
|
);
|
|
498
512
|
this.bindingMappings = orderRustBindings(
|
|
499
513
|
bindings.map((pkg) => {
|
|
@@ -732,18 +746,20 @@ export class DBXToolsRustWorkspace {
|
|
|
732
746
|
crate: pkg.crateName,
|
|
733
747
|
binary: pkg.packageOptions.binaryName ?? pkg.crateName,
|
|
734
748
|
}));
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
749
|
+
const publicCrates = orderRustBindings(
|
|
750
|
+
this.packages
|
|
751
|
+
.filter((pkg) => !pkg.packageOptions.private)
|
|
752
|
+
.map((pkg) => ({
|
|
753
|
+
crate: pkg.crateName,
|
|
754
|
+
rust: pkg.outdir,
|
|
755
|
+
dependencies: rustPackageDependencies(
|
|
756
|
+
this.packages,
|
|
757
|
+
pkg,
|
|
758
|
+
project.outdir,
|
|
759
|
+
options.workspaceDependencies,
|
|
760
|
+
).map((dependency) => dependency.crateName),
|
|
761
|
+
})),
|
|
762
|
+
).map((pkg) => pkg.crate);
|
|
747
763
|
const targetMatrix = targets.map((target) => ({ ...target }));
|
|
748
764
|
const hasPythonBindings = bindings.some((binding) => binding.python);
|
|
749
765
|
const usePreinstalledWindowsRust = releaseRustVersion === "stable";
|