@dbx-tools/projen 0.9.4 → 0.9.6

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 (47) hide show
  1. package/README.md +64 -16
  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 +901 -0
  6. package/src/_rust-release.ts +605 -0
  7. package/src/_task-command.ts +89 -0
  8. package/src/barrels.ts +9 -7
  9. package/src/engine-root.ts +5 -5
  10. package/src/openapi.ts +1 -1
  11. package/src/packages.ts +9 -9
  12. package/src/pnpm-workspace.ts +1 -1
  13. package/src/project-js.ts +19 -25
  14. package/src/project-py.ts +6 -6
  15. package/src/project-rs.ts +100 -1098
  16. package/src/projen-version.ts +9 -0
  17. package/src/publish.ts +3 -4
  18. package/src/release-catalog.ts +1 -1
  19. package/src/release.ts +11 -12
  20. package/src/scaffold.ts +1 -1
  21. package/src/uniffi.ts +7 -0
  22. package/src/watch.ts +2 -2
  23. package/src/workspace-version.ts +20 -15
  24. package/tasks/barrels.ts +4 -4
  25. package/tasks/build-rust-release.ts +68 -0
  26. package/tasks/bump.ts +3 -2
  27. package/tasks/clean.ts +3 -3
  28. package/tasks/local-publish.ts +21 -3
  29. package/tasks/openapi.ts +2 -2
  30. package/tasks/publish-npm.ts +12 -6
  31. package/tasks/publish-python.ts +2 -2
  32. package/tasks/publish-uniffi-local.ts +11 -15
  33. package/tasks/publish.ts +88 -88
  34. package/tasks/python-registry.ts +1 -1
  35. package/tasks/release-bootstrap.ts +2 -2
  36. package/tasks/release-plan.ts +1 -1
  37. package/tasks/release-please.ts +1 -1
  38. package/tasks/release-pr.ts +60 -115
  39. package/tasks/release-request.ts +8 -29
  40. package/tasks/release-summary-units.ts +2 -9
  41. package/tasks/release-summary.ts +35 -24
  42. package/tasks/release-version.ts +44 -0
  43. package/tasks/rust-release.d.ts +41 -0
  44. package/tasks/rust-release.mjs +1717 -0
  45. package/tasks/uniffi-python.js +1 -1
  46. package/tasks/uniffi.ts +7 -1
  47. package/tasks/version-check.ts +6 -5
@@ -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);