@nitra/sqa 0.0.1
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 +1 -0
- package/package.json +33 -0
- package/src/cli.mjs +35 -0
- package/types/cli.d.mts +2 -0
package/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
#
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nitra/sqa",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Nitra CI tooling: sync GraphQL schema to a docs npm package (and more to come).",
|
|
5
|
+
"homepage": "https://github.com/nitra/sqa",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/nitra/sqa/issues"
|
|
8
|
+
},
|
|
9
|
+
"license": "ISC",
|
|
10
|
+
"author": "v@nitra.ai",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/nitra/sqa.git"
|
|
14
|
+
},
|
|
15
|
+
"bin": {
|
|
16
|
+
"sqa": "src/cli.mjs"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"src",
|
|
20
|
+
"types",
|
|
21
|
+
"CHANGELOG.md"
|
|
22
|
+
],
|
|
23
|
+
"type": "module",
|
|
24
|
+
"types": "./types/cli.d.mts",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"access": "public"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {},
|
|
29
|
+
"engines": {
|
|
30
|
+
"bun": ">=1.3",
|
|
31
|
+
"node": ">=24"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/src/cli.mjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* `@nitra/sqa` — CLI-диспатчер.
|
|
4
|
+
*
|
|
5
|
+
* Запуск: `npx -y @nitra/sqa <subcommand> [args...]`
|
|
6
|
+
*
|
|
7
|
+
* Доступні subcommands:
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const SUBCOMMANDS = {
|
|
11
|
+
test1: () => import('./test1.mjs').then(m => m.cli),
|
|
12
|
+
test2: () => import('./test2.mjs').then(m => m.cli)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const [subcommand, ...rest] = process.argv.slice(2)
|
|
16
|
+
|
|
17
|
+
if (!subcommand || subcommand === '--help' || subcommand === '-h') {
|
|
18
|
+
console.log(`Usage: sqa <subcommand> [args...]
|
|
19
|
+
|
|
20
|
+
Subcommands:
|
|
21
|
+
${Object.keys(SUBCOMMANDS).join('\n ')}
|
|
22
|
+
|
|
23
|
+
Run \`sqa <subcommand> --help\` for subcommand-specific options.`)
|
|
24
|
+
process.exitCode = subcommand ? 0 : 2
|
|
25
|
+
} else {
|
|
26
|
+
const loader = SUBCOMMANDS[subcommand]
|
|
27
|
+
if (loader) {
|
|
28
|
+
const run = await loader()
|
|
29
|
+
await run(rest)
|
|
30
|
+
} else {
|
|
31
|
+
console.error(`Unknown subcommand: ${subcommand}`)
|
|
32
|
+
console.error(`Available: ${Object.keys(SUBCOMMANDS).join(', ')}`)
|
|
33
|
+
process.exitCode = 2
|
|
34
|
+
}
|
|
35
|
+
}
|
package/types/cli.d.mts
ADDED