@dbx-tools/projen 0.6.175 → 0.6.177
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/src/release.ts +1 -7
- package/tasks/uniffi-release.mjs +31 -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.176";
|
|
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.177",
|
|
29
|
+
"@dbx-tools/path": "0.6.177",
|
|
30
|
+
"@dbx-tools/shared-core": "0.6.177",
|
|
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.177",
|
|
51
51
|
"types": "index.ts",
|
|
52
52
|
"type": "module",
|
|
53
53
|
"exports": {
|
package/src/release.ts
CHANGED
|
@@ -557,13 +557,7 @@ export class DBXToolsRelease extends Component {
|
|
|
557
557
|
...bindings.flatMap((binding) => {
|
|
558
558
|
const output = `dist/uniffi/facades/${binding.crate}`;
|
|
559
559
|
return [
|
|
560
|
-
`
|
|
561
|
-
'if [ "$GITHUB_EVENT_NAME" = "repository_dispatch" ]; then',
|
|
562
|
-
` NATIVE_PACKAGE="$(find dist/uniffi/native -name '${binding.crate}-linux-x64-gnu-*.tgz' -print -quit)"`,
|
|
563
|
-
' test -n "$NATIVE_PACKAGE"',
|
|
564
|
-
' NATIVE_ARG="--native-package $NATIVE_PACKAGE"',
|
|
565
|
-
"fi",
|
|
566
|
-
`node .projen/uniffi-release.mjs facade --node "${binding.node}" --node-package "${binding.nodePackage}" --node-triple "linux-x64-gnu" --version "$VERSION" --output "${output}" $NATIVE_ARG`,
|
|
560
|
+
`node .projen/uniffi-release.mjs facade --node "${binding.node}" --node-package "${binding.nodePackage}" --node-triple "linux-x64-gnu" --version "$VERSION" --output "${output}"`,
|
|
567
561
|
`for package in ${output}/npm-facade/*.tgz; do npm publish "$package" --access public $DRY_RUN; done`,
|
|
568
562
|
];
|
|
569
563
|
}),
|
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",
|