celq 0.1.1-alpha.6
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/.yarnrc.yml +1 -0
- package/package.json +50 -0
- package/src/index.ts +40 -0
- package/tsconfig.json +12 -0
package/.yarnrc.yml
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nodeLinker: node-modules
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "celq",
|
|
3
|
+
"version": "0.1.1-alpha.6",
|
|
4
|
+
"bin": "lib/index.js",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"typecheck": "tsc --noEmit",
|
|
7
|
+
"lint": "eslint .",
|
|
8
|
+
"lint:fix": "eslint . --fix",
|
|
9
|
+
"build": "tsc",
|
|
10
|
+
"dev": "yarn build && node lib/index.js"
|
|
11
|
+
},
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/IvanIsCoding/celq"
|
|
15
|
+
},
|
|
16
|
+
"author": "Ivan Carvalho <ivancarvalho@gatech.edu>",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/IvanIsCoding/celq/issues"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/IvanIsCoding/celq#readme",
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"@types/node": "^25.0.3",
|
|
23
|
+
"@typescript-eslint/eslint-plugin": "^8.52.0",
|
|
24
|
+
"@typescript-eslint/parser": "^8.52.0",
|
|
25
|
+
"eslint": "^9.39.2",
|
|
26
|
+
"typescript": "^5.9.3"
|
|
27
|
+
},
|
|
28
|
+
"optionalDependencies": {
|
|
29
|
+
"@ivaniscoding/celq-darwin-arm64": "0.1.1-alpha.6",
|
|
30
|
+
"@ivaniscoding/celq-darwin-x64": "0.1.1-alpha.6",
|
|
31
|
+
"@ivaniscoding/celq-linux-arm64": "0.1.1-alpha.6",
|
|
32
|
+
"@ivaniscoding/celq-linux-x64": "0.1.1-alpha.6",
|
|
33
|
+
"@ivaniscoding/celq-windows-arm64": "0.1.1-alpha.6",
|
|
34
|
+
"@ivaniscoding/celq-windows-x64": "0.1.1-alpha.6"
|
|
35
|
+
},
|
|
36
|
+
"eslintConfig": {
|
|
37
|
+
"extends": [
|
|
38
|
+
"eslint:recommended",
|
|
39
|
+
"plugin:@typescript-eslint/recommended"
|
|
40
|
+
],
|
|
41
|
+
"parser": "@typescript-eslint/parser",
|
|
42
|
+
"plugins": [
|
|
43
|
+
"@typescript-eslint"
|
|
44
|
+
],
|
|
45
|
+
"ignorePatterns": [
|
|
46
|
+
"lib/*"
|
|
47
|
+
],
|
|
48
|
+
"root": true
|
|
49
|
+
}
|
|
50
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawnSync } from "child_process";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Returns the executable path which is located inside `node_modules`
|
|
7
|
+
* The naming convention is @ivaniscoding/celq-${os}-${arch}
|
|
8
|
+
* If the platform is `win32` or `cygwin`, executable will include a `.exe` extension.
|
|
9
|
+
* @see https://nodejs.org/api/os.html#osarch
|
|
10
|
+
* @see https://nodejs.org/api/os.html#osplatform
|
|
11
|
+
*/
|
|
12
|
+
function getExePath() {
|
|
13
|
+
const arch = process.arch;
|
|
14
|
+
let os = process.platform as string;
|
|
15
|
+
let extension = "";
|
|
16
|
+
if (["win32", "cygwin"].includes(process.platform)) {
|
|
17
|
+
os = "windows";
|
|
18
|
+
extension = ".exe";
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
// Since the binary will be located inside `node_modules`, we can simply call `require.resolve`
|
|
23
|
+
return require.resolve(`@ivaniscoding/celq-${os}-${arch}/bin/celq${extension}`);
|
|
24
|
+
} catch (e) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
`Couldn't find application binary inside node_modules for ${os}-${arch}`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Runs the application with args using nodejs spawn
|
|
33
|
+
*/
|
|
34
|
+
function run() {
|
|
35
|
+
const args = process.argv.slice(2);
|
|
36
|
+
const processResult = spawnSync(getExePath(), args, { stdio: "inherit" });
|
|
37
|
+
process.exit(processResult.status ?? 0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
run();
|
package/tsconfig.json
ADDED