@swirls/cli 0.0.23 → 0.1.0
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/launcher/cli.js +41 -0
- package/launcher/platforms.js +10 -0
- package/package.json +15 -12
- package/dist/cli-shim.js +0 -2
- package/dist/cli.js +0 -410
package/launcher/cli.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { execFileSync } from 'node:child_process'
|
|
4
|
+
import { createRequire } from 'node:module'
|
|
5
|
+
import { dirname, join } from 'node:path'
|
|
6
|
+
import { Table } from 'console-table-printer'
|
|
7
|
+
import { platforms } from './platforms.js'
|
|
8
|
+
|
|
9
|
+
const require = createRequire(import.meta.url)
|
|
10
|
+
|
|
11
|
+
const key = `${process.platform}-${process.arch}`
|
|
12
|
+
const pkg = platforms[key]
|
|
13
|
+
|
|
14
|
+
// handle unsupported platform
|
|
15
|
+
if (!pkg) {
|
|
16
|
+
console.warn(`\n⚠️ Your platform is not currently supported: ${key}\n`)
|
|
17
|
+
|
|
18
|
+
// list supported platforms
|
|
19
|
+
const table = new Table({
|
|
20
|
+
columns: [
|
|
21
|
+
{ name: 'Platform', alignment: 'left' },
|
|
22
|
+
{ name: 'Package', alignment: 'left' },
|
|
23
|
+
],
|
|
24
|
+
rows: Object.entries(platforms).map(([platform, pkg]) => ({
|
|
25
|
+
Platform: platform,
|
|
26
|
+
Package: pkg,
|
|
27
|
+
})),
|
|
28
|
+
})
|
|
29
|
+
table.printTable()
|
|
30
|
+
|
|
31
|
+
console.info(
|
|
32
|
+
'\nTo request support for your platform, send us an email at help@swirls.ai\n',
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
process.exit(1)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const pkgDir = dirname(require.resolve(`${pkg}/package.json`))
|
|
39
|
+
const binary = join(pkgDir, 'swirls')
|
|
40
|
+
|
|
41
|
+
execFileSync(binary, process.argv.slice(2), { stdio: 'inherit' })
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// Generated during build from `platforms.ts`. Do not edit manually.
|
|
2
|
+
//
|
|
3
|
+
// biome-ignore-all format: generated file
|
|
4
|
+
|
|
5
|
+
export const platforms = {
|
|
6
|
+
"darwin-arm64": "@swirls/cli-darwin-arm64",
|
|
7
|
+
"darwin-x64": "@swirls/cli-darwin-x64",
|
|
8
|
+
"linux-arm64": "@swirls/cli-linux-arm64",
|
|
9
|
+
"linux-x64": "@swirls/cli-linux-x64",
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swirls/cli",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Swirls command line application",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Swirls",
|
|
@@ -8,20 +8,17 @@
|
|
|
8
8
|
},
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bin": {
|
|
11
|
-
"cli": "./
|
|
12
|
-
"swirls": "./
|
|
11
|
+
"cli": "./launcher/cli.js",
|
|
12
|
+
"swirls": "./launcher/cli.js"
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
15
|
-
"
|
|
15
|
+
"launcher"
|
|
16
16
|
],
|
|
17
17
|
"scripts": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"pkg:publish": "bun publish",
|
|
23
|
-
"pkg:publish:dry": "bun publish --dry-run",
|
|
24
|
-
"prepublishOnly": "SWIRLS_ENV=production bun run build"
|
|
18
|
+
"build": "bun run ci/build.ts",
|
|
19
|
+
"dev": "bun run --watch src/bin/cli.ts",
|
|
20
|
+
"pkg:publish": "SWIRLS_ENV=production bun run build && bun run cd/publish.ts",
|
|
21
|
+
"pkg:publish:dry": "SWIRLS_ENV=production bun run build && bun run cd/publish.ts --dry-run"
|
|
25
22
|
},
|
|
26
23
|
"devDependencies": {
|
|
27
24
|
"@byteslice/result": "0.3.0",
|
|
@@ -33,15 +30,21 @@
|
|
|
33
30
|
"@stricli/core": "1.2.4",
|
|
34
31
|
"@swirls/core": "0.0.1",
|
|
35
32
|
"@swirls/sdk": "0.0.13",
|
|
33
|
+
"@types/bun": "1.3.9",
|
|
36
34
|
"@types/node": "24.10.0",
|
|
37
35
|
"console-table-printer": "2.15.0",
|
|
38
36
|
"dotenv": "16.4.7",
|
|
39
37
|
"open": "10.2.0",
|
|
40
38
|
"sucrase": "3.35.1",
|
|
41
|
-
"tsup": "8.5.1",
|
|
42
39
|
"typescript": "5.9.3",
|
|
43
40
|
"zod": "4.3.5"
|
|
44
41
|
},
|
|
42
|
+
"optionalDependencies": {
|
|
43
|
+
"@swirls/cli-darwin-arm64": "0.1.0",
|
|
44
|
+
"@swirls/cli-darwin-x64": "0.1.0",
|
|
45
|
+
"@swirls/cli-linux-arm64": "0.1.0",
|
|
46
|
+
"@swirls/cli-linux-x64": "0.1.0"
|
|
47
|
+
},
|
|
45
48
|
"engines": {
|
|
46
49
|
"node": ">=22"
|
|
47
50
|
},
|
package/dist/cli-shim.js
DELETED