@elyx-design/cli 0.0.0-bootstrap.0 → 0.0.1-nightly.10003.fa2bb2bdc
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/LICENSE +4 -0
- package/README.md +14 -0
- package/dist/cli.js +31 -0
- package/package.json +20 -8
package/LICENSE
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @elyx-design/cli
|
|
2
|
+
|
|
3
|
+
The command-line interface for Elyx.
|
|
4
|
+
|
|
5
|
+
Install it globally and run `elyx` from your terminal:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npm install --global @elyx-design/cli
|
|
9
|
+
elyx --help
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
This package provides the JavaScript launcher. The native executable is
|
|
13
|
+
installed through an optional package selected for the current operating
|
|
14
|
+
system and architecture.
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawnSync } from 'node:child_process';
|
|
3
|
+
import { createRequire } from 'node:module';
|
|
4
|
+
import { dirname, join } from 'node:path';
|
|
5
|
+
const platformPackageName = `@elyx-design/cli-${process.platform}-${process.arch}`;
|
|
6
|
+
const executableName = process.platform === 'win32' ? 'elyx.exe' : 'elyx';
|
|
7
|
+
const require = createRequire(import.meta.url);
|
|
8
|
+
let packageJsonPath;
|
|
9
|
+
try {
|
|
10
|
+
packageJsonPath = require.resolve(`${platformPackageName}/package.json`);
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
console.error(`elyx: The platform package ${platformPackageName} is missing.\n` +
|
|
14
|
+
'This platform may not be supported, or optional dependencies may have ' +
|
|
15
|
+
'been disabled. Try reinstalling @elyx-design/cli with optional dependencies.');
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const executablePath = join(dirname(packageJsonPath), 'bin', executableName);
|
|
19
|
+
const result = spawnSync(executablePath, process.argv.slice(2), {
|
|
20
|
+
stdio: 'inherit',
|
|
21
|
+
});
|
|
22
|
+
if (result.error) {
|
|
23
|
+
console.error(`elyx: Could not start ${platformPackageName}: ${result.error.message}`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
if (result.signal) {
|
|
27
|
+
process.kill(process.pid, result.signal);
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
process.exit(result.status ?? 1);
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyx-design/cli",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
5
|
-
"license": "
|
|
3
|
+
"version": "0.0.1-nightly.10003.fa2bb2bdc",
|
|
4
|
+
"description": "Command-line tools for Elyx",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "https://github.com/elyx-design/elyx.git"
|
|
8
|
+
"url": "https://github.com/elyx-design/elyx.git",
|
|
9
|
+
"directory": "cli"
|
|
9
10
|
},
|
|
10
11
|
"publishConfig": {
|
|
11
|
-
"access": "
|
|
12
|
-
"registry": "https://registry.npmjs.org/"
|
|
13
|
-
|
|
12
|
+
"access": "restricted",
|
|
13
|
+
"registry": "https://registry.npmjs.org/"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"bin": {
|
|
17
|
+
"elyx": "dist/cli.js"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"LICENSE",
|
|
21
|
+
"README.md",
|
|
22
|
+
"dist"
|
|
23
|
+
],
|
|
24
|
+
"optionalDependencies": {
|
|
25
|
+
"@elyx-design/cli-darwin-arm64": "0.0.1-nightly.10003.fa2bb2bdc"
|
|
14
26
|
}
|
|
15
|
-
}
|
|
27
|
+
}
|