dh-remixer-sdk 0.0.44 → 0.0.45-d202e64
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/package.json +1 -1
- package/scripts/publish-internal.mjs +41 -0
package/package.json
CHANGED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { spawnSync } from "node:child_process";
|
|
3
|
+
|
|
4
|
+
const [version, distTag] = process.argv.slice(2);
|
|
5
|
+
|
|
6
|
+
if (!version || !distTag) {
|
|
7
|
+
console.error("Usage: node publish-internal.mjs <version> <dist-tag>");
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const pkgPath = new URL("../package.json", import.meta.url);
|
|
12
|
+
const originalContents = readFileSync(pkgPath, "utf8");
|
|
13
|
+
const pkg = JSON.parse(originalContents);
|
|
14
|
+
|
|
15
|
+
const registry = `${process.env.CI_API_V4_URL}/projects/${process.env.CI_PROJECT_ID}/packages/npm/`;
|
|
16
|
+
|
|
17
|
+
const scopedPkg = {
|
|
18
|
+
...pkg,
|
|
19
|
+
name: "@dreamhost/remixer-sdk",
|
|
20
|
+
version,
|
|
21
|
+
license: "UNLICENSED",
|
|
22
|
+
publishConfig: {
|
|
23
|
+
registry,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
try {
|
|
28
|
+
writeFileSync(pkgPath, `${JSON.stringify(scopedPkg, null, 2)}\n`);
|
|
29
|
+
|
|
30
|
+
const result = spawnSync(
|
|
31
|
+
"npm",
|
|
32
|
+
["publish", "--registry", registry, "--tag", distTag],
|
|
33
|
+
{ stdio: "inherit" },
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
if (result.status !== 0) {
|
|
37
|
+
process.exit(result.status ?? 1);
|
|
38
|
+
}
|
|
39
|
+
} finally {
|
|
40
|
+
writeFileSync(pkgPath, originalContents);
|
|
41
|
+
}
|