@dbx-tools/projen 0.6.174 → 0.6.176
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/tasks/uniffi-release.mjs +42 -1
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.175";
|
|
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.176",
|
|
29
|
+
"@dbx-tools/path": "0.6.176",
|
|
30
|
+
"@dbx-tools/shared-core": "0.6.176",
|
|
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.176",
|
|
51
51
|
"types": "index.ts",
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
package/tasks/uniffi-release.mjs
CHANGED
|
@@ -64,6 +64,26 @@ const run = (command, args, cwd = root) => {
|
|
|
64
64
|
if (result.status !== 0) throw new Error(`${invocation.command} exited with ${result.status}`);
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
+
const runWithRetry = (command, args, cwd = root, attempts = 6) => {
|
|
68
|
+
const signal = new Int32Array(new SharedArrayBuffer(4));
|
|
69
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
70
|
+
const invocation = commandInvocation(command, args);
|
|
71
|
+
const result = spawnSync(invocation.command, invocation.args, { cwd, stdio: "inherit" });
|
|
72
|
+
if (result.error) {
|
|
73
|
+
throw new Error(`${invocation.command} failed: ${result.error.message}`, {
|
|
74
|
+
cause: result.error,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (result.status === 0) return;
|
|
78
|
+
if (attempt === attempts) {
|
|
79
|
+
throw new Error(
|
|
80
|
+
`${invocation.command} exited with ${result.status} after ${attempts} attempts`,
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
Atomics.wait(signal, 0, 0, 10_000);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
|
|
67
87
|
const singlePackage = (directory) => {
|
|
68
88
|
const packages = readdirSync(directory)
|
|
69
89
|
.filter((file) => file.endsWith(".tgz"))
|
|
@@ -131,6 +151,16 @@ const testNodeFacade = ({
|
|
|
131
151
|
if (!workspaceVersion) return [];
|
|
132
152
|
const binding = bindings.find((binding) => binding.nodePackage === name);
|
|
133
153
|
if (binding) {
|
|
154
|
+
const stagedFacade = resolve(root, "dist/uniffi/facades", binding.crate, "npm-facade");
|
|
155
|
+
const stagedNative = resolve(root, "dist/uniffi/native");
|
|
156
|
+
const nativeName = existsSync(stagedNative)
|
|
157
|
+
? readdirSync(stagedNative).find((file) =>
|
|
158
|
+
file.startsWith(`${binding.crate}-${required("node-triple")}-`),
|
|
159
|
+
)
|
|
160
|
+
: undefined;
|
|
161
|
+
if (existsSync(stagedFacade) && nativeName) {
|
|
162
|
+
return [singlePackage(stagedFacade), join(stagedNative, nativeName)];
|
|
163
|
+
}
|
|
134
164
|
const output = resolve(root, "dist/release", binding.crate, required("node-triple"));
|
|
135
165
|
if (existsSync(join(output, "npm-facade")) && existsSync(join(output, "npm"))) {
|
|
136
166
|
return [singlePackage(join(output, "npm-facade")), singlePackage(join(output, "npm"))];
|
|
@@ -164,7 +194,7 @@ const testNodeFacade = ({
|
|
|
164
194
|
join(installDirectory, "package.json"),
|
|
165
195
|
`${JSON.stringify({ private: true, type: "module" })}\n`,
|
|
166
196
|
);
|
|
167
|
-
|
|
197
|
+
runWithRetry(
|
|
168
198
|
"npm",
|
|
169
199
|
[
|
|
170
200
|
"install",
|
|
@@ -277,6 +307,17 @@ const packageNodeFacade = ({ output, nodeDirectory, nodePackage, version, native
|
|
|
277
307
|
rmSync(join(facadeDirectory, "src", file), { force: true });
|
|
278
308
|
}
|
|
279
309
|
}
|
|
310
|
+
const ffiBindings = join(facadeDirectory, "src", "_bindings-ffi.ts");
|
|
311
|
+
writable(ffiBindings);
|
|
312
|
+
const ffiSource = readFileSync(ffiBindings, "utf8");
|
|
313
|
+
const packageSource = ffiSource.replace(
|
|
314
|
+
/(\s+callerUrl: import\.meta\.url,\n)(\s+\}\);)/,
|
|
315
|
+
`$1 npmPackageBase: ${JSON.stringify(`${nodePackage}-`)},\n tripleStyle: "node",\n$2`,
|
|
316
|
+
);
|
|
317
|
+
if (packageSource === ffiSource) {
|
|
318
|
+
throw new Error(`Could not configure native package lookup in ${ffiBindings}`);
|
|
319
|
+
}
|
|
320
|
+
writeFileSync(ffiBindings, packageSource);
|
|
280
321
|
const manifestPath = join(facadeDirectory, "package.json");
|
|
281
322
|
writable(manifestPath);
|
|
282
323
|
const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
|