@dbx-tools/projen 0.9.5 → 0.9.7

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.
Files changed (50) hide show
  1. package/README.md +69 -17
  2. package/index.ts +7 -5
  3. package/package.json +9 -6
  4. package/src/_rust-project.ts +356 -0
  5. package/src/_rust-release-workflow.ts +954 -0
  6. package/src/_rust-release.ts +605 -0
  7. package/src/_task-command.ts +89 -0
  8. package/src/barrels.ts +12 -11
  9. package/src/bun-app.ts +96 -85
  10. package/src/bun-workflow.ts +60 -52
  11. package/src/engine-root.ts +5 -5
  12. package/src/openapi.ts +16 -9
  13. package/src/packages.ts +9 -9
  14. package/src/pnpm-workspace.ts +1 -1
  15. package/src/project-js.ts +19 -25
  16. package/src/project-py.ts +28 -23
  17. package/src/project-rs.ts +100 -1098
  18. package/src/projen-version.ts +9 -0
  19. package/src/publish.ts +3 -4
  20. package/src/release-catalog.ts +1 -1
  21. package/src/release.ts +212 -177
  22. package/src/scaffold.ts +1 -1
  23. package/src/uniffi.ts +7 -0
  24. package/src/watch.ts +2 -2
  25. package/src/workspace-version.ts +20 -15
  26. package/tasks/barrels.ts +4 -4
  27. package/tasks/build-rust-release.ts +68 -0
  28. package/tasks/bump.ts +3 -2
  29. package/tasks/clean.ts +3 -3
  30. package/tasks/local-publish.ts +21 -3
  31. package/tasks/openapi.ts +2 -2
  32. package/tasks/publish-npm.ts +12 -6
  33. package/tasks/publish-python.ts +2 -2
  34. package/tasks/publish-uniffi-local.ts +11 -15
  35. package/tasks/publish.ts +88 -88
  36. package/tasks/python-registry.ts +1 -1
  37. package/tasks/release-bootstrap.ts +2 -2
  38. package/tasks/release-plan.ts +1 -1
  39. package/tasks/release-please.ts +1 -1
  40. package/tasks/release-pr.ts +60 -115
  41. package/tasks/release-request.ts +8 -29
  42. package/tasks/release-summary-units.ts +2 -9
  43. package/tasks/release-summary.ts +35 -24
  44. package/tasks/release-version.ts +44 -0
  45. package/tasks/rust-release.d.ts +41 -0
  46. package/tasks/rust-release.mjs +1717 -0
  47. package/tasks/sync.ts +3 -3
  48. package/tasks/uniffi-python.js +1 -1
  49. package/tasks/uniffi.ts +7 -1
  50. package/tasks/version-check.ts +6 -5
package/tasks/sync.ts CHANGED
@@ -95,9 +95,9 @@ if (!process.argv.includes("--watch")) {
95
95
  * re-emitting it is how we say "stop" in a language the supervisor understands.
96
96
  *
97
97
  * Killing is asynchronous (concurrently shells out to `ps` to walk each process tree)
98
- * and can outlive `result`, which is how a plain SIGTERM used to leave orphaned
99
- * watchers behind. The timer holds the process open until the kills land, and doubles
100
- * as the backstop that leaves anyway if one of them wedges.
98
+ * and can outlive `result`. The timer keeps the process open until the kills
99
+ * land, which prevents orphaned watchers after SIGTERM. It also stops waiting
100
+ * if one of them wedges.
101
101
  */
102
102
  function stop(): void {
103
103
  if (stopping) return;
@@ -160,7 +160,7 @@ export const installPythonBindings = ({
160
160
 
161
161
  const init = join(packageDirectory, "__init__.py");
162
162
  setWritable(init);
163
- writeFileSync(init, "");
163
+ writeFileSync(init, `${generatedHeader(crate)}from .bindings import *\n`);
164
164
 
165
165
  const nativeLibrary = join(packageDirectory, basename(library));
166
166
  setWritable(nativeLibrary);
package/tasks/uniffi.ts CHANGED
@@ -22,6 +22,7 @@ import {
22
22
  addExplicitInterfaceReexports,
23
23
  addTypeScriptExtensionsToBindingImports,
24
24
  makeDefaultedInterfaceParametersOptional,
25
+ removeObsoleteInterfaceAliases,
25
26
  } from "../src/uniffi.ts";
26
27
 
27
28
  const { values } = parseArgs({
@@ -204,7 +205,12 @@ if (values.node) {
204
205
  ),
205
206
  );
206
207
  for (const file of generatedFiles) {
207
- writeFileSync(file, makeDefaultedInterfaceParametersOptional(readFileSync(file, "utf8")));
208
+ writeFileSync(
209
+ file,
210
+ removeObsoleteInterfaceAliases(
211
+ makeDefaultedInterfaceParametersOptional(readFileSync(file, "utf8")),
212
+ ),
213
+ );
208
214
  }
209
215
  writeFileSync(
210
216
  nodeBindings,
@@ -2,11 +2,12 @@
2
2
  /** Verify that every committed package version matches its owning release unit. */
3
3
  import { existsSync, readFileSync } from "node:fs";
4
4
  import { dirname, join, relative } from "node:path";
5
- import { exec, project } from "@dbx-tools/core";
5
+ import * as exec from "@dbx-tools/core/exec";
6
+ import * as projectUtils from "@dbx-tools/core/project-utils";
6
7
  import { find } from "@dbx-tools/path";
7
8
  import { json, log, object } from "@dbx-tools/shared-core";
8
9
  import { parse } from "smol-toml";
9
- import { recordedPackages } from "../src/packages.ts";
10
+ import { recordedPackages, toPosix } from "../src/packages.ts";
10
11
  import type { ReleaseUnitGraph } from "../src/release-catalog.ts";
11
12
  import { readWorkspaceVersion } from "../src/workspace-version.ts";
12
13
 
@@ -53,14 +54,14 @@ function cargoVersions(root: string): Array<{ name: string; version: string; pat
53
54
  {
54
55
  name: candidate.name,
55
56
  version: candidate.version,
56
- path: relative(root, dirname(candidate.manifest_path)).replaceAll("\\", "/") || ".",
57
+ path: toPosix(relative(root, dirname(candidate.manifest_path))) || ".",
57
58
  },
58
59
  ];
59
60
  });
60
61
  }
61
62
 
62
63
  function main(): void {
63
- const root = project.root() ?? process.cwd();
64
+ const root = projectUtils.root() ?? process.cwd();
64
65
  const fixedVersion = readWorkspaceVersion(root);
65
66
  const graphPath = join(root, ".projen/release-units.json");
66
67
  const graph = existsSync(graphPath)
@@ -94,7 +95,7 @@ function main(): void {
94
95
  }
95
96
 
96
97
  for (const path of find.findFiles("**/pyproject.toml", { cwd: root })) {
97
- check(path, dirname(path).replaceAll("\\", "/"), pythonVersion(join(root, path)));
98
+ check(path, toPosix(dirname(path)), pythonVersion(join(root, path)));
98
99
  }
99
100
  for (const pkg of cargoVersions(root)) {
100
101
  check(`Cargo package ${pkg.name}`, pkg.path, pkg.version);