warpack 0.0.1-dev.ab8ac45 → 0.0.1-dev.ba543de
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/dist/cli.d.ts +2 -0
- package/dist/cli.js +20 -0
- package/dist/get-exe-path.d.ts +9 -0
- package/dist/get-exe-path.js +37 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +18 -0
- package/package.json +25 -35
- package/package.json.tmpl +0 -27
- package/src/cli.ts +0 -12
- package/src/get-exe-path.ts +0 -33
- package/src/index.ts +0 -12
- package/tsconfig.json +0 -12
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
import { runWarpack } from "./index.js";
|
|
12
|
+
function run() {
|
|
13
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
14
|
+
var _a;
|
|
15
|
+
const args = process.argv.slice(2);
|
|
16
|
+
const processResult = yield runWarpack(args);
|
|
17
|
+
process.exit((_a = processResult.exitCode) !== null && _a !== void 0 ? _a : 0);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
void run();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the executable path for warpack located inside node_modules
|
|
3
|
+
* The naming convention is warpack-${os}-${arch}
|
|
4
|
+
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension
|
|
5
|
+
* @see https://nodejs.org/api/os.html#osarch
|
|
6
|
+
* @see https://nodejs.org/api/os.html#osplatform
|
|
7
|
+
* @example "x/xx/node_modules/warpack-darwin-arm64"
|
|
8
|
+
*/
|
|
9
|
+
export declare function getExePath(): Promise<string>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { arch as getArch, platform as getPlatform } from "os";
|
|
11
|
+
/**
|
|
12
|
+
* Returns the executable path for warpack located inside node_modules
|
|
13
|
+
* The naming convention is warpack-${os}-${arch}
|
|
14
|
+
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension
|
|
15
|
+
* @see https://nodejs.org/api/os.html#osarch
|
|
16
|
+
* @see https://nodejs.org/api/os.html#osplatform
|
|
17
|
+
* @example "x/xx/node_modules/warpack-darwin-arm64"
|
|
18
|
+
*/
|
|
19
|
+
export function getExePath() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const platform = getPlatform();
|
|
22
|
+
const arch = getArch();
|
|
23
|
+
let os = platform;
|
|
24
|
+
let extension = "";
|
|
25
|
+
if (platform === "win32" || platform === "cygwin") {
|
|
26
|
+
os = "windows";
|
|
27
|
+
extension = ".exe";
|
|
28
|
+
}
|
|
29
|
+
try {
|
|
30
|
+
// Since the bin will be located inside `node_modules`, we can simply call import.meta.resolve
|
|
31
|
+
return import.meta.resolve(`@warpack/${os}-${arch}/bin/warpack${extension}`);
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
throw new Error(`Couldn't find warpack binary inside node_modules for ${os}-${arch} (${e})`);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { execa } from "execa";
|
|
11
|
+
import { fileURLToPath } from "node:url";
|
|
12
|
+
import { getExePath } from "./get-exe-path.js";
|
|
13
|
+
export function runWarpack(args, execaOptions) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
const exePath = yield getExePath();
|
|
16
|
+
return execa(fileURLToPath(exePath), args, Object.assign({ stdio: "inherit" }, execaOptions));
|
|
17
|
+
});
|
|
18
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "warpack",
|
|
4
|
-
"version": "0.0.1-dev.ab8ac45",
|
|
5
4
|
"description": "A build system for Warcraft III maps.",
|
|
6
5
|
"keywords": [
|
|
7
6
|
"warcraft",
|
|
@@ -10,57 +9,48 @@
|
|
|
10
9
|
],
|
|
11
10
|
"license": "MIT",
|
|
12
11
|
"author": "rhazarian",
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"types": "./lib/esm/index.d.ts",
|
|
21
|
-
"default": "./lib/esm/index.js"
|
|
22
|
-
},
|
|
23
|
-
"require": {
|
|
24
|
-
"types": "./lib/cjs/index.d.cts",
|
|
25
|
-
"default": "./lib/cjs/index.cjs"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
12
|
+
"files": [
|
|
13
|
+
"dist/**/*.js",
|
|
14
|
+
"dist/**/*.d.ts"
|
|
15
|
+
],
|
|
16
|
+
"main": "dist/index.js",
|
|
17
|
+
"bin": {
|
|
18
|
+
"warpack": "dist/cli.js"
|
|
28
19
|
},
|
|
29
|
-
"bin": "lib/cli/cli.js",
|
|
30
20
|
"type": "module",
|
|
31
|
-
"types": "
|
|
21
|
+
"types": "dist/index.d.ts",
|
|
32
22
|
"repository": {
|
|
33
23
|
"type": "git",
|
|
34
|
-
"url": "https://github.com/rhazarian/warpack"
|
|
24
|
+
"url": "git+https://github.com/rhazarian/warpack.git"
|
|
35
25
|
},
|
|
36
26
|
"scripts": {
|
|
37
|
-
"typecheck": "tsc",
|
|
38
27
|
"lint": "eslint .",
|
|
39
28
|
"lint:fix": "eslint . --fix",
|
|
40
|
-
"build": "
|
|
29
|
+
"build": "tsc"
|
|
41
30
|
},
|
|
42
31
|
"dependencies": {
|
|
43
|
-
"execa": "^
|
|
32
|
+
"execa": "^9.5.1",
|
|
33
|
+
"warpack-types": "0.0.3"
|
|
44
34
|
},
|
|
45
35
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^
|
|
47
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
48
|
-
"@typescript-eslint/parser": "^
|
|
49
|
-
"eslint": "^
|
|
50
|
-
"tsup": "^8.
|
|
51
|
-
"typescript": "^5.
|
|
36
|
+
"@types/node": "^22.9.0",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
38
|
+
"@typescript-eslint/parser": "^8.13.0",
|
|
39
|
+
"eslint": "^9.14.0",
|
|
40
|
+
"tsup": "^8.3.5",
|
|
41
|
+
"typescript": "^5.6.3"
|
|
52
42
|
},
|
|
53
43
|
"optionalDependencies": {
|
|
54
|
-
"@warpack/darwin-arm64": "0.0.1",
|
|
55
|
-
"@warpack/darwin-x64": "0.0.1",
|
|
56
|
-
"@warpack/linux-arm64": "0.0.1",
|
|
57
|
-
"@warpack/linux-x64": "0.0.1",
|
|
58
|
-
"@warpack/windows-arm64": "0.0.1",
|
|
59
|
-
"@warpack/windows-x64": "0.0.1"
|
|
44
|
+
"@warpack/darwin-arm64": "0.0.1-dev.ba543de",
|
|
45
|
+
"@warpack/darwin-x64": "0.0.1-dev.ba543de",
|
|
46
|
+
"@warpack/linux-arm64": "0.0.1-dev.ba543de",
|
|
47
|
+
"@warpack/linux-x64": "0.0.1-dev.ba543de",
|
|
48
|
+
"@warpack/windows-arm64": "0.0.1-dev.ba543de",
|
|
49
|
+
"@warpack/windows-x64": "0.0.1-dev.ba543de"
|
|
60
50
|
},
|
|
61
51
|
"publishConfig": {
|
|
62
52
|
"access": "public",
|
|
63
53
|
"registry": "https://registry.npmjs.org/"
|
|
64
54
|
},
|
|
65
|
-
"
|
|
55
|
+
"version": "0.0.1-dev.ba543de"
|
|
66
56
|
}
|
package/package.json.tmpl
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json.schemastore.org/package",
|
|
3
|
-
"name": "@warpack/${node_pkg}",
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"description": "A build system for Warcraft III maps.",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"warcraft",
|
|
8
|
-
"warpack",
|
|
9
|
-
"warscript"
|
|
10
|
-
],
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"author": "rhazarian",
|
|
13
|
-
"repository": {
|
|
14
|
-
"type": "git",
|
|
15
|
-
"url": "https://github.com/rhazarian/warpack"
|
|
16
|
-
},
|
|
17
|
-
"os": [
|
|
18
|
-
"${node_os}"
|
|
19
|
-
],
|
|
20
|
-
"cpu": [
|
|
21
|
-
"${node_arch}"
|
|
22
|
-
],
|
|
23
|
-
"publishConfig": {
|
|
24
|
-
"access": "public",
|
|
25
|
-
"registry": "https://registry.npmjs.org/"
|
|
26
|
-
}
|
|
27
|
-
}
|
package/src/cli.ts
DELETED
package/src/get-exe-path.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { arch as getArch, platform as getPlatform } from "os";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Returns the executable path for warpack located inside node_modules
|
|
5
|
-
* The naming convention is warpack-${os}-${arch}
|
|
6
|
-
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension
|
|
7
|
-
* @see https://nodejs.org/api/os.html#osarch
|
|
8
|
-
* @see https://nodejs.org/api/os.html#osplatform
|
|
9
|
-
* @example "x/xx/node_modules/warpack-darwin-arm64"
|
|
10
|
-
*/
|
|
11
|
-
export async function getExePath() {
|
|
12
|
-
const platform = getPlatform();
|
|
13
|
-
const arch = getArch();
|
|
14
|
-
|
|
15
|
-
let os = platform as string;
|
|
16
|
-
let extension = "";
|
|
17
|
-
|
|
18
|
-
if (platform === "win32" || platform === "cygwin") {
|
|
19
|
-
os = "windows";
|
|
20
|
-
extension = ".exe";
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
try {
|
|
24
|
-
// Since the bin will be located inside `node_modules`, we can simply call import.meta.resolve
|
|
25
|
-
return import.meta.resolve(
|
|
26
|
-
`warpack-${os}-${arch}/bin/warpack${extension}`,
|
|
27
|
-
);
|
|
28
|
-
} catch (e) {
|
|
29
|
-
throw new Error(
|
|
30
|
-
`Couldn't find warpack binary inside node_modules for ${os}-${arch} (${e})`,
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
}
|
package/src/index.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { execa, type Options as ExecaOptions, type ExecaReturnValue, } from "execa";
|
|
2
|
-
import { fileURLToPath } from "node:url";
|
|
3
|
-
import { getExePath } from "./get-exe-path.js";
|
|
4
|
-
|
|
5
|
-
export async function runWarpack(args: string[], execaOptions?: ExecaOptions): Promise<ExecaReturnValue> {
|
|
6
|
-
const exePath = await getExePath();
|
|
7
|
-
|
|
8
|
-
return execa(fileURLToPath(exePath), args, {
|
|
9
|
-
stdio: "inherit",
|
|
10
|
-
...execaOptions,
|
|
11
|
-
});
|
|
12
|
-
}
|
package/tsconfig.json
DELETED