@chillicream/nitro 16.0.0-p.7.67 → 16.0.0-p.8
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 +49 -2
- package/dist/cli.js +73 -0
- package/package.json +26 -14
- package/cli.js +0 -58
- package/linux-arm64/nitro +0 -4
- package/linux-musl-x64/nitro +0 -4
- package/linux-x64/nitro +0 -4
- package/osx-arm64/nitro +0 -4
- package/osx-x64/nitro +0 -4
- package/win-x64/nitro.exe +0 -4
- package/win-x86/nitro.exe +0 -4
package/README.md
CHANGED
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
# @chillicream/nitro
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
The official CLI for ChilliCream's [Nitro](https://chillicream.com/products/nitro).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
Run the CLI directly with your package manager of choice:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
# npm
|
|
11
|
+
npx @chillicream/nitro@latest --help
|
|
12
|
+
|
|
13
|
+
# yarn
|
|
14
|
+
yarn dlx @chillicream/nitro@latest --help
|
|
15
|
+
|
|
16
|
+
# pnpm
|
|
17
|
+
pnpm dlx @chillicream/nitro@latest --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## GitHub Actions
|
|
21
|
+
|
|
22
|
+
If you want to invoke the CLI from a GitHub Actions workflow, use our official actions instead of installing the CLI manually:
|
|
23
|
+
|
|
24
|
+
### Schema
|
|
25
|
+
|
|
26
|
+
- [Nitro Schema Publish](https://github.com/marketplace/actions/nitro-schema-publish)
|
|
27
|
+
- [Nitro Schema Upload](https://github.com/marketplace/actions/nitro-schema-upload)
|
|
28
|
+
- [Nitro Schema Validate](https://github.com/marketplace/actions/nitro-schema-validate)
|
|
29
|
+
|
|
30
|
+
### Client
|
|
31
|
+
|
|
32
|
+
- [Nitro Client Publish](https://github.com/marketplace/actions/nitro-client-publish)
|
|
33
|
+
- [Nitro Client Upload](https://github.com/marketplace/actions/nitro-client-upload)
|
|
34
|
+
- [Nitro Client Validate](https://github.com/marketplace/actions/nitro-client-validate)
|
|
35
|
+
|
|
36
|
+
### Fusion
|
|
37
|
+
|
|
38
|
+
- [Nitro Fusion Publish](https://github.com/marketplace/actions/nitro-fusion-publish)
|
|
39
|
+
- [Nitro Fusion Upload](https://github.com/marketplace/actions/nitro-fusion-upload)
|
|
40
|
+
- [Nitro Fusion Validate](https://github.com/marketplace/actions/nitro-fusion-validate)
|
|
41
|
+
|
|
42
|
+
### MCP
|
|
43
|
+
|
|
44
|
+
- [Nitro MCP Publish](https://github.com/marketplace/actions/nitro-mcp-publish)
|
|
45
|
+
- [Nitro MCP Upload](https://github.com/marketplace/actions/nitro-mcp-upload)
|
|
46
|
+
- [Nitro MCP Validate](https://github.com/marketplace/actions/nitro-mcp-validate)
|
|
47
|
+
|
|
48
|
+
### OpenAPI
|
|
49
|
+
|
|
50
|
+
- [Nitro OpenAPI Publish](https://github.com/marketplace/actions/nitro-openapi-publish)
|
|
51
|
+
- [Nitro OpenAPI Upload](https://github.com/marketplace/actions/nitro-openapi-upload)
|
|
52
|
+
- [Nitro OpenAPI Validate](https://github.com/marketplace/actions/nitro-openapi-validate)
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { familySync, GLIBC, MUSL } from "detect-libc";
|
|
6
|
+
function resolveCandidates() {
|
|
7
|
+
const { platform, arch } = process;
|
|
8
|
+
if (platform === "linux" && arch === "x64") {
|
|
9
|
+
const libc = familySync();
|
|
10
|
+
if (libc === MUSL) {
|
|
11
|
+
return ["@chillicream/nitro-linux-musl-x64"];
|
|
12
|
+
}
|
|
13
|
+
if (libc === GLIBC) {
|
|
14
|
+
return ["@chillicream/nitro-linux-x64"];
|
|
15
|
+
}
|
|
16
|
+
return [
|
|
17
|
+
"@chillicream/nitro-linux-x64",
|
|
18
|
+
"@chillicream/nitro-linux-musl-x64",
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
const map = {
|
|
22
|
+
"darwin-arm64": "@chillicream/nitro-osx-arm64",
|
|
23
|
+
"darwin-x64": "@chillicream/nitro-osx-x64",
|
|
24
|
+
"linux-arm64": "@chillicream/nitro-linux-arm64",
|
|
25
|
+
"win32-ia32": "@chillicream/nitro-win-x86",
|
|
26
|
+
"win32-x64": "@chillicream/nitro-win-x64",
|
|
27
|
+
};
|
|
28
|
+
const pkg = map[`${platform}-${arch}`];
|
|
29
|
+
return pkg ? [pkg] : [];
|
|
30
|
+
}
|
|
31
|
+
function resolveBinary() {
|
|
32
|
+
const binaryName = process.platform === "win32" ? "nitro.exe" : "nitro";
|
|
33
|
+
for (const pkg of resolveCandidates()) {
|
|
34
|
+
try {
|
|
35
|
+
const pkgJson = fileURLToPath(import.meta.resolve(`${pkg}/package.json`));
|
|
36
|
+
return join(dirname(pkgJson), binaryName);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// try next candidate
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
function describePlatform() {
|
|
45
|
+
const { platform, arch } = process;
|
|
46
|
+
if (platform === "linux") {
|
|
47
|
+
const libc = familySync();
|
|
48
|
+
return libc ? `linux-${arch} (${libc})` : `linux-${arch}`;
|
|
49
|
+
}
|
|
50
|
+
return `${platform}-${arch}`;
|
|
51
|
+
}
|
|
52
|
+
const bin = resolveBinary();
|
|
53
|
+
if (bin === null) {
|
|
54
|
+
console.error(`Platform "${describePlatform()}" is not supported by @chillicream/nitro.`);
|
|
55
|
+
process.exit(1);
|
|
56
|
+
}
|
|
57
|
+
const child = spawn(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
58
|
+
child.on("error", (error) => {
|
|
59
|
+
console.error(`Failed to start @chillicream/nitro binary "${bin}": ${error.message}`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
});
|
|
62
|
+
child.on("exit", (code, signal) => {
|
|
63
|
+
if (signal !== null) {
|
|
64
|
+
try {
|
|
65
|
+
process.kill(process.pid, signal);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
process.exit(code ?? 1);
|
|
73
|
+
});
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chillicream/nitro",
|
|
3
|
-
"version": "16.0.0-p.
|
|
3
|
+
"version": "16.0.0-p.8",
|
|
4
4
|
"description": "Nitro CLI",
|
|
5
5
|
"homepage": "https://chillicream.com",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
|
-
"url": "
|
|
9
|
-
"directory": "src/Nitro/CommandLine/src/chillicream-nitro"
|
|
8
|
+
"url": "https://github.com/ChilliCream/graphql-platform",
|
|
9
|
+
"directory": "src/Nitro/CommandLine/src/npm/chillicream-nitro"
|
|
10
10
|
},
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChilliCream/graphql-platform/issues"
|
|
@@ -27,20 +27,32 @@
|
|
|
27
27
|
"url": "https://opencollective.com/chillicream"
|
|
28
28
|
},
|
|
29
29
|
"type": "module",
|
|
30
|
-
"
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=22.0.0"
|
|
32
|
+
},
|
|
33
|
+
"bin": "./dist/cli.js",
|
|
31
34
|
"files": [
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"linux-musl-x64/",
|
|
35
|
-
"linux-arm64/",
|
|
36
|
-
"osx-x64/",
|
|
37
|
-
"osx-arm64/",
|
|
38
|
-
"win-x64/",
|
|
39
|
-
"win-x86/",
|
|
40
|
-
"win-arm64/"
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
41
37
|
],
|
|
42
|
-
"
|
|
38
|
+
"scripts": {
|
|
39
|
+
"build": "tsc"
|
|
40
|
+
},
|
|
41
|
+
"packageManager": "yarn@4.18.0",
|
|
43
42
|
"dependencies": {
|
|
44
43
|
"detect-libc": "^2.0.4"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/node": "^22.0.0",
|
|
47
|
+
"typescript": "^7.0.2"
|
|
48
|
+
},
|
|
49
|
+
"optionalDependencies": {
|
|
50
|
+
"@chillicream/nitro-linux-arm64": "16.0.0-p.8",
|
|
51
|
+
"@chillicream/nitro-linux-musl-x64": "16.0.0-p.8",
|
|
52
|
+
"@chillicream/nitro-linux-x64": "16.0.0-p.8",
|
|
53
|
+
"@chillicream/nitro-osx-arm64": "16.0.0-p.8",
|
|
54
|
+
"@chillicream/nitro-osx-x64": "16.0.0-p.8",
|
|
55
|
+
"@chillicream/nitro-win-x64": "16.0.0-p.8",
|
|
56
|
+
"@chillicream/nitro-win-x86": "16.0.0-p.8"
|
|
45
57
|
}
|
|
46
58
|
}
|
package/cli.js
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
"use strict";
|
|
3
|
-
|
|
4
|
-
import { join, dirname } from "path";
|
|
5
|
-
import { fileURLToPath } from "url";
|
|
6
|
-
import { spawn } from "child_process";
|
|
7
|
-
import { family, GLIBC, MUSL } from "detect-libc";
|
|
8
|
-
|
|
9
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
10
|
-
|
|
11
|
-
async function resolveBinary() {
|
|
12
|
-
const { platform, arch } = process;
|
|
13
|
-
|
|
14
|
-
const binaries = {
|
|
15
|
-
darwin: {
|
|
16
|
-
x64: "osx-x64/nitro",
|
|
17
|
-
arm64: "osx-arm64/nitro",
|
|
18
|
-
},
|
|
19
|
-
win32: {
|
|
20
|
-
x64: "win-x64/nitro.exe",
|
|
21
|
-
ia32: "win-x86/nitro.exe",
|
|
22
|
-
arm64: "win-arm64/nitro.exe",
|
|
23
|
-
},
|
|
24
|
-
linux: {
|
|
25
|
-
x64: async () => {
|
|
26
|
-
const libc = await family();
|
|
27
|
-
|
|
28
|
-
if (libc === GLIBC) {
|
|
29
|
-
return "linux-x64/nitro";
|
|
30
|
-
} else if (libc === MUSL) {
|
|
31
|
-
return "linux-musl-x64/nitro";
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return null;
|
|
35
|
-
},
|
|
36
|
-
arm64: "linux-arm64/nitro",
|
|
37
|
-
},
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const binary = binaries[platform]?.[arch];
|
|
41
|
-
if (!binary) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const binaryPath = typeof binary === "function" ? await binary() : binary;
|
|
46
|
-
return binaryPath ? join(__dirname, binaryPath) : null;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const bin = await resolveBinary();
|
|
50
|
-
const input = process.argv.slice(2);
|
|
51
|
-
|
|
52
|
-
if (bin !== null) {
|
|
53
|
-
spawn(bin, input, { stdio: "inherit" }).on("exit", process.exit);
|
|
54
|
-
} else {
|
|
55
|
-
throw new Error(
|
|
56
|
-
`Platform "${process.platform} (${process.arch})" not supported.`
|
|
57
|
-
);
|
|
58
|
-
}
|
package/linux-arm64/nitro
DELETED
package/linux-musl-x64/nitro
DELETED
package/linux-x64/nitro
DELETED
package/osx-arm64/nitro
DELETED
package/osx-x64/nitro
DELETED
package/win-x64/nitro.exe
DELETED
package/win-x86/nitro.exe
DELETED