@dbx-tools/projen 0.6.203 → 0.6.204

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 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.203";
6
+ export const PACKAGE_VERSION = "0.6.204";
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.203",
29
- "@dbx-tools/path": "0.6.203",
30
- "@dbx-tools/shared-core": "0.6.203",
28
+ "@dbx-tools/core": "0.6.204",
29
+ "@dbx-tools/path": "0.6.204",
30
+ "@dbx-tools/shared-core": "0.6.204",
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.203",
50
+ "version": "0.6.204",
51
51
  "types": "index.ts",
52
52
  "type": "module",
53
53
  "exports": {
package/src/project-rs.ts CHANGED
@@ -180,14 +180,6 @@ const RUST_CACHE_ENV = {
180
180
  CARGO_TERM_COLOR: "always",
181
181
  } as const;
182
182
 
183
- function cargoCacheKeyStep(): Record<string, unknown> {
184
- return {
185
- name: "Resolve Cargo dependency cache key",
186
- id: "cargo_cache_key",
187
- run: "node .projen/cargo-cache-key.mjs",
188
- };
189
- }
190
-
191
183
  function rustCacheSteps(sharedKey: string): readonly Record<string, unknown>[] {
192
184
  return [
193
185
  {
@@ -198,8 +190,7 @@ function rustCacheSteps(sharedKey: string): readonly Record<string, unknown>[] {
198
190
  "cache-targets": true,
199
191
  "cache-workspace-crates": false,
200
192
  "add-job-id-key": false,
201
- "add-rust-environment-hash-key": false,
202
- key: "${{ steps.cargo_cache_key.outputs.key }}",
193
+ "add-rust-environment-hash-key": true,
203
194
  "shared-key": sharedKey,
204
195
  "save-if": "${{ github.event_name == 'push' }}",
205
196
  },
@@ -277,66 +268,6 @@ function uniffiReleaseTaskSource(): string {
277
268
  return readFileSync(source, "utf8");
278
269
  }
279
270
 
280
- function cargoCacheKeySource(): string {
281
- return `#!/usr/bin/env node
282
- import { createHash } from "node:crypto";
283
- import { appendFileSync, existsSync, readFileSync } from "node:fs";
284
- import { spawnSync } from "node:child_process";
285
-
286
- function command(command, args) {
287
- const result = spawnSync(command, args, { encoding: "utf8" });
288
- if (result.error) throw result.error;
289
- if (result.status !== 0) throw new Error(\`\${command} exited with \${result.status}\`);
290
- return result.stdout;
291
- }
292
-
293
- const hasLock = existsSync("Cargo.lock");
294
- const metadata = JSON.parse(
295
- command("cargo", [
296
- "metadata",
297
- ...(hasLock ? ["--locked"] : []),
298
- "--format-version",
299
- "1",
300
- "--no-deps",
301
- ]),
302
- );
303
- const workspaceNames = new Set(metadata.packages.map((pkg) => pkg.name));
304
- const dependencyLock = hasLock
305
- ? readFileSync("Cargo.lock", "utf8")
306
- .split("[[package]]")
307
- .slice(1)
308
- .filter((block) => {
309
- const name = /^\\s*name = "([^"]+)"/m.exec(block)?.[1];
310
- return name && !workspaceNames.has(name);
311
- })
312
- .map((block) => \`[[package]]\${block}\`)
313
- .join("")
314
- : "";
315
- const manifests = [
316
- metadata.workspace_root + "/Cargo.toml",
317
- ...metadata.packages.map((pkg) => pkg.manifest_path),
318
- ]
319
- .map((path) =>
320
- readFileSync(path, "utf8").replace(/^version = "[0-9]+\\.[0-9]+\\.[0-9]+"\\s*$/gm, ""),
321
- )
322
- .join("\\n");
323
- const config = existsSync(".cargo/config.toml")
324
- ? readFileSync(".cargo/config.toml", "utf8")
325
- : "";
326
- const key = createHash("sha256")
327
- .update(dependencyLock)
328
- .update(manifests)
329
- .update(config)
330
- .update(command("rustc", ["-vV"]))
331
- .digest("hex");
332
- if (process.env.GITHUB_OUTPUT) {
333
- appendFileSync(process.env.GITHUB_OUTPUT, \`key=\${key}\\n\`);
334
- } else {
335
- process.stdout.write(\`\${key}\\n\`);
336
- }
337
- `;
338
- }
339
-
340
271
  /** Keep tracked workspace package versions in Cargo.lock aligned with VERSION. */
341
272
  class RustWorkspaceVersionLock extends Component {
342
273
  public override postSynthesize(): void {
@@ -917,9 +848,6 @@ export class DBXToolsRustWorkspace {
917
848
  });
918
849
  project.removeTask("rs:bindings:demo");
919
850
  if (releaseEnabled) {
920
- new TextFile(project, ".projen/cargo-cache-key.mjs", {
921
- lines: cargoCacheKeySource().trimEnd().split("\n"),
922
- });
923
851
  this.addReleaseWorkflow(project, options, nativeTargets);
924
852
  }
925
853
  }
@@ -1118,7 +1046,6 @@ export class DBXToolsRustWorkspace {
1118
1046
  },
1119
1047
  ]
1120
1048
  : []),
1121
- cargoCacheKeyStep(),
1122
1049
  ...rustCacheSteps(`release-\${{ matrix.cargo }}-rust-${releaseRustVersion}`),
1123
1050
  {
1124
1051
  name: "Install Linux native dependencies",