@dbx-tools/projen 0.6.222 → 0.6.224
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 +41 -7
- package/index.ts +4 -2
- package/package.json +5 -5
- package/src/barrels.ts +10 -4
- package/src/bun-workflow.ts +36 -17
- package/src/clean.ts +3 -3
- package/src/codegen.ts +16 -8
- package/src/packages.ts +14 -13
- package/src/project-js.ts +316 -147
- package/src/project-py.ts +8 -25
- package/src/project-rs.ts +98 -71
- package/src/release-github.ts +37 -0
- package/src/release.ts +25 -36
- package/src/tsconfig.ts +17 -17
- package/tasks/local-publish.ts +3 -3
- package/tasks/publish-npm.ts +75 -4
- package/tasks/publish-python.ts +13 -29
- package/tasks/publish-uniffi-local.ts +12 -9
- package/tasks/publish.ts +2 -2
- package/tasks/release-pr.ts +27 -10
- package/tasks/uniffi-python.d.ts +56 -0
- package/tasks/uniffi-python.js +160 -0
- package/tasks/uniffi-release.mjs +25 -49
- package/tasks/uniffi.ts +11 -45
package/tasks/uniffi.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { tmpdir } from "node:os";
|
|
|
15
15
|
import { basename, dirname, join, resolve } from "node:path";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
17
17
|
import { parseArgs } from "node:util";
|
|
18
|
+
import { installPythonBindings } from "./uniffi-python.js";
|
|
18
19
|
import { makeReadonly, makeWritable, stampGenerated } from "../src/generated.ts";
|
|
19
20
|
import type { RustWorkspaceMapping } from "../src/project-rs.ts";
|
|
20
21
|
import {
|
|
@@ -110,22 +111,6 @@ const replaceGenerated = (source: string, destination: string): void => {
|
|
|
110
111
|
}
|
|
111
112
|
};
|
|
112
113
|
|
|
113
|
-
const stampGeneratedPython = (file: string): void => {
|
|
114
|
-
makeWritable(file);
|
|
115
|
-
const body = readFileSync(file, "utf8");
|
|
116
|
-
writeFileSync(
|
|
117
|
-
file,
|
|
118
|
-
[
|
|
119
|
-
"# GENERATED by UniFFI binding generation - DO NOT EDIT.",
|
|
120
|
-
`# Regenerated from the ${crate} Rust exports.`,
|
|
121
|
-
"# Hand edits are overwritten on the next watch; this file is read-only.",
|
|
122
|
-
"",
|
|
123
|
-
body,
|
|
124
|
-
].join("\n"),
|
|
125
|
-
);
|
|
126
|
-
makeReadonly(file);
|
|
127
|
-
};
|
|
128
|
-
|
|
129
114
|
if (!values["skip-build"]) {
|
|
130
115
|
run("cargo", [
|
|
131
116
|
"build",
|
|
@@ -265,33 +250,14 @@ if (values.python) {
|
|
|
265
250
|
if (!values["python-module"]) {
|
|
266
251
|
throw new Error("Expected --python-module with --python");
|
|
267
252
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
"--out-dir",
|
|
279
|
-
pythonOutput,
|
|
280
|
-
library,
|
|
281
|
-
],
|
|
282
|
-
);
|
|
283
|
-
const generated = join(pythonOutput, `${libraryName}.py`);
|
|
284
|
-
const pythonBindings = join(pythonPackage, "bindings.py");
|
|
285
|
-
replaceGenerated(generated, pythonBindings);
|
|
286
|
-
stampGeneratedPython(pythonBindings);
|
|
287
|
-
const pythonInit = join(pythonPackage, "__init__.py");
|
|
288
|
-
makeWritable(pythonInit);
|
|
289
|
-
writeFileSync(pythonInit, "");
|
|
290
|
-
makeReadonly(pythonInit);
|
|
291
|
-
const pythonLibrary = join(pythonPackage, basename(library));
|
|
292
|
-
makeWritable(pythonLibrary);
|
|
293
|
-
cpSync(library, pythonLibrary);
|
|
294
|
-
makeReadonly(pythonLibrary);
|
|
295
|
-
rmSync(join(pythonPackage, "_generated"), { recursive: true, force: true });
|
|
296
|
-
rmSync(pythonOutput, { recursive: true, force: true });
|
|
253
|
+
installPythonBindings({
|
|
254
|
+
crate,
|
|
255
|
+
library,
|
|
256
|
+
module: values["python-module"],
|
|
257
|
+
packageRoot: resolve(root, values.python),
|
|
258
|
+
platform: process.platform,
|
|
259
|
+
readonly: true,
|
|
260
|
+
run,
|
|
261
|
+
targetDirectory,
|
|
262
|
+
});
|
|
297
263
|
}
|