@chillicream/nitro 16.0.0-p.7.68 → 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 CHANGED
@@ -1,5 +1,52 @@
1
1
  # @chillicream/nitro
2
2
 
3
- A CLI to interact with [Nitro](https://chillicream.com/products/nitro).
3
+ The official CLI for ChilliCream's [Nitro](https://chillicream.com/products/nitro).
4
4
 
5
- For a full list of commands either run `npx @chillicream/nitro --help` or see the [documentation](https://chillicream.com/docs/nitro/cli-commands/api-key).
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.7.68",
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": "git+chttps://github.com/ChilliCream/graphql-platform.git",
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
- "bin": "cli.js",
30
+ "engines": {
31
+ "node": ">=22.0.0"
32
+ },
33
+ "bin": "./dist/cli.js",
31
34
  "files": [
32
- "cli.js",
33
- "linux-x64/",
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
- "packageManager": "yarn@4.9.4",
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
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/linux-arm64/nitro
3
- size: 46093928 bytes
4
- sha256: ab30e8b32ed58eb3eb2dd15c11273726df9861f9fb94bebef81e97b6f6571a01
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/linux-musl-x64/nitro
3
- size: 45360552 bytes
4
- sha256: c9bc319f1ef9480b930ddb53d688b22731188f8d76dfe6747f937e816a233329
package/linux-x64/nitro DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/linux-x64/nitro
3
- size: 45352360 bytes
4
- sha256: ce781506f54211342a7854048f6c4ccc167e9c3ad187958fcaab0fb18857d835
package/osx-arm64/nitro DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/osx-arm64/nitro
3
- size: 44498784 bytes
4
- sha256: 3e7990aa6e42040a6c2881467edd4e31495cc0ef7f35a85f873fa1c8d81d105d
package/osx-x64/nitro DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/osx-x64/nitro
3
- size: 45633104 bytes
4
- sha256: 81e4c4beef3313e8c11de63478ae5fbf4b060fc54235e5843ad6331d818e4e11
package/win-x64/nitro.exe DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/win-x64/nitro.exe
3
- size: 48594904 bytes
4
- sha256: 3f89917041b0028bd1350d60362263553c8b0e4d7be9bdf214db202bacb635fc
package/win-x86/nitro.exe DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/win-x86/nitro.exe
3
- size: 43130840 bytes
4
- sha256: 2fd19c040a1aae876a7ed9763c09849f534e76f6cd8e938029d4927867ab71ec