@leonmw/agw 0.0.0-init → 0.0.0-stage
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 +3 -0
- package/package.json +4 -22
- package/bin/agw.js +0 -51
package/README.md
ADDED
package/package.json
CHANGED
|
@@ -1,24 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leonmw/agw",
|
|
3
|
-
"version": "0.0.0-
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
"agw": "bin/agw.js",
|
|
8
|
-
"agy-wrap": "bin/agw.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"bin/"
|
|
12
|
-
],
|
|
13
|
-
"optionalDependencies": {
|
|
14
|
-
"@leonmw/agw-linux-x64": "0.0.0-development",
|
|
15
|
-
"@leonmw/agw-darwin-arm64": "0.0.0-development",
|
|
16
|
-
"@leonmw/agw-win32-x64": "0.0.0-development"
|
|
17
|
-
},
|
|
18
|
-
"engines": {
|
|
19
|
-
"node": ">=18"
|
|
20
|
-
},
|
|
21
|
-
"publishConfig": {
|
|
22
|
-
"access": "public"
|
|
23
|
-
}
|
|
24
|
-
}
|
|
3
|
+
"version": "0.0.0-stage",
|
|
4
|
+
"stub": true,
|
|
5
|
+
"description": "Temporary package placeholder for staged publishing"
|
|
6
|
+
}
|
package/bin/agw.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
const { spawnSync } = require("node:child_process");
|
|
4
|
-
|
|
5
|
-
const platformPackageMap = {
|
|
6
|
-
"linux-x64": { packageName: "@leonmw/agw-linux-x64", binaryPath: "bin/agw" },
|
|
7
|
-
"darwin-arm64": { packageName: "@leonmw/agw-darwin-arm64", binaryPath: "bin/agw" },
|
|
8
|
-
"win32-x64": { packageName: "@leonmw/agw-win32-x64", binaryPath: "bin/agw.exe" }
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
function getPackageForHost() {
|
|
12
|
-
const key = `${process.platform}-${process.arch}`;
|
|
13
|
-
return platformPackageMap[key] ?? null;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function resolveHostBinaryPath() {
|
|
17
|
-
const match = getPackageForHost();
|
|
18
|
-
if (!match) {
|
|
19
|
-
const supported = Object.keys(platformPackageMap).join(", ");
|
|
20
|
-
throw new Error(`Unsupported platform '${process.platform}-${process.arch}'. Supported: ${supported}.`);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
return require.resolve(`${match.packageName}/${match.binaryPath}`);
|
|
25
|
-
} catch {
|
|
26
|
-
throw new Error(
|
|
27
|
-
`Missing platform binary package '${match.packageName}'. Reinstall with 'npm i -g @leonmw/agw'.`
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
function run() {
|
|
33
|
-
const binaryPath = resolveHostBinaryPath();
|
|
34
|
-
const result = spawnSync(binaryPath, process.argv.slice(2), {
|
|
35
|
-
stdio: "inherit"
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
if (result.error) {
|
|
39
|
-
throw result.error;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
process.exit(result.status ?? 1);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
run();
|
|
47
|
-
} catch (error) {
|
|
48
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
-
console.error(`agw launcher error: ${message}`);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|