@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 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.67",
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: 46027032 bytes
4
- sha256: c779218fa205eab6f66b37d9288216cde41c05ab29e304149dbca849fa9cba55
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/linux-musl-x64/nitro
3
- size: 45297736 bytes
4
- sha256: 2721802664bf4d3ee1dff785bee8694c0962623adf9e802b39cd31ad782576a2
package/linux-x64/nitro DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/linux-x64/nitro
3
- size: 45289544 bytes
4
- sha256: d3227db3a113815f517fe315b07693ac52585d548d58319fd368d934607a110c
package/osx-arm64/nitro DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/osx-arm64/nitro
3
- size: 44415968 bytes
4
- sha256: a11bf58c18aad0e14f5b197da5bfa26ea4ef79ff941e5d5ae459324f414d0a80
package/osx-x64/nitro DELETED
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/osx-x64/nitro
3
- size: 45566752 bytes
4
- sha256: 531a36d309e14863289ff8186f4f6a36829c37ccddc1825058aa2471b64db718
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: 48521176 bytes
4
- sha256: 02b21c583938c8841f7b4965c4f4854f9afff87e8c79ba4af0c856981bb526b8
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: 43068376 bytes
4
- sha256: 6fd14f94a6cd092fab73f4e12965b4f33f1650d16f620e24f74863af5b5aee82