@pubm/darwin-x64 0.4.0
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/build.ts +52 -0
- package/package.json +27 -0
- package/turbo.json +9 -0
package/build.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { mkdirSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import pubmPackageJson from "../../package.json" with { type: "json" };
|
|
4
|
+
|
|
5
|
+
const ROOT = import.meta.dir;
|
|
6
|
+
const CLI_ENTRY = join(ROOT, "..", "..", "src", "cli.ts");
|
|
7
|
+
const TSCONFIG = join(ROOT, "..", "..", "tsconfig.build.json");
|
|
8
|
+
const BIN_DIR = join(ROOT, "bin");
|
|
9
|
+
const OUT_FILE = join(BIN_DIR, "pubm");
|
|
10
|
+
const define = {
|
|
11
|
+
__PUBM_VERSION__: JSON.stringify(pubmPackageJson.version),
|
|
12
|
+
__PUBM_NODE_ENGINE__: JSON.stringify(pubmPackageJson.engines?.node ?? ">=18"),
|
|
13
|
+
__PUBM_GIT_ENGINE__: JSON.stringify(
|
|
14
|
+
pubmPackageJson.engines?.git ?? ">=2.11.0",
|
|
15
|
+
),
|
|
16
|
+
// @ts-expect-error
|
|
17
|
+
__PUBM_NPM_ENGINE__: JSON.stringify(pubmPackageJson.engines?.npm ?? "*"),
|
|
18
|
+
// @ts-expect-error
|
|
19
|
+
__PUBM_PNPM_ENGINE__: JSON.stringify(pubmPackageJson.engines?.pnpm ?? "*"),
|
|
20
|
+
// @ts-expect-error
|
|
21
|
+
__PUBM_YARN_ENGINE__: JSON.stringify(pubmPackageJson.engines?.yarn ?? "*"),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
mkdirSync(BIN_DIR, { recursive: true });
|
|
25
|
+
|
|
26
|
+
console.log("[@pubm/darwin-x64] Compiling...");
|
|
27
|
+
|
|
28
|
+
const result = await Bun.build({
|
|
29
|
+
tsconfig: TSCONFIG,
|
|
30
|
+
entrypoints: [CLI_ENTRY],
|
|
31
|
+
minify: true,
|
|
32
|
+
sourcemap: "external",
|
|
33
|
+
compile: {
|
|
34
|
+
autoloadBunfig: false,
|
|
35
|
+
autoloadDotenv: false,
|
|
36
|
+
autoloadTsconfig: false,
|
|
37
|
+
autoloadPackageJson: true,
|
|
38
|
+
target: "bun-darwin-x64",
|
|
39
|
+
outfile: OUT_FILE,
|
|
40
|
+
},
|
|
41
|
+
define,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (!result.success) {
|
|
45
|
+
for (const log of result.logs) {
|
|
46
|
+
console.error(log);
|
|
47
|
+
}
|
|
48
|
+
console.error("[@pubm/darwin-x64] Build failed");
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
console.log(`[@pubm/darwin-x64] Done → ${OUT_FILE}`);
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pubm/darwin-x64",
|
|
3
|
+
"version": "0.4.0",
|
|
4
|
+
"description": "pubm binary for darwin-x64",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"author": "Yein Sung",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/syi0808/pubm.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/syi0808/pubm#readme",
|
|
12
|
+
"os": [
|
|
13
|
+
"darwin"
|
|
14
|
+
],
|
|
15
|
+
"cpu": [
|
|
16
|
+
"x64"
|
|
17
|
+
],
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "bun run build.ts"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@pubm/core": "workspace:*"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
}
|
|
27
|
+
}
|