pstdio 0.0.1 → 0.1.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/bin/pstdio.js +18 -0
- package/bin/resolve-package.cjs +22 -0
- package/bin/resolve-package.test.ts +48 -0
- package/package.json +42 -12
- package/README.md +0 -15
- package/dist/index.js +0 -4
- package/src/index.ts +0 -1
- package/tsconfig.json +0 -29
package/bin/pstdio.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
const { resolvePackageName } = require("./resolve-package.cjs");
|
|
5
|
+
|
|
6
|
+
const pkg = resolvePackageName(process.platform, process.arch);
|
|
7
|
+
|
|
8
|
+
if (!pkg) {
|
|
9
|
+
process.stderr.write(
|
|
10
|
+
`pstdio: unsupported platform ${process.platform}-${process.arch}.\n` +
|
|
11
|
+
`Supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, linux-x64-musl, linux-arm64-musl, win-x64, win-arm64\n`,
|
|
12
|
+
);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const binPath = require(pkg);
|
|
17
|
+
const result = spawnSync(binPath, process.argv.slice(2), { stdio: "inherit" });
|
|
18
|
+
process.exit(result.status ?? 1);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function detectLinuxLibc() {
|
|
4
|
+
if (process.platform !== "linux") return null;
|
|
5
|
+
if (!process.report || typeof process.report.getReport !== "function") return "glibc";
|
|
6
|
+
const report = process.report.getReport();
|
|
7
|
+
return report.header?.glibcVersionRuntime ? "glibc" : "musl";
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
function resolvePackageName(platform, arch, libc = platform === "linux" ? detectLinuxLibc() : null) {
|
|
11
|
+
if (platform === "darwin" && arch === "arm64") return "@pstdio/cli-darwin-arm64";
|
|
12
|
+
if (platform === "darwin" && arch === "x64") return "@pstdio/cli-darwin-x64";
|
|
13
|
+
if (platform === "linux" && arch === "x64")
|
|
14
|
+
return libc === "musl" ? "@pstdio/cli-linux-x64-musl" : "@pstdio/cli-linux-x64";
|
|
15
|
+
if (platform === "linux" && arch === "arm64")
|
|
16
|
+
return libc === "musl" ? "@pstdio/cli-linux-arm64-musl" : "@pstdio/cli-linux-arm64";
|
|
17
|
+
if (platform === "win32" && arch === "x64") return "@pstdio/cli-win-x64";
|
|
18
|
+
if (platform === "win32" && arch === "arm64") return "@pstdio/cli-win-arm64";
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
module.exports = { detectLinuxLibc, resolvePackageName };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
4
|
+
const { resolvePackageName } = require("./resolve-package.cjs") as {
|
|
5
|
+
resolvePackageName: (platform: string, arch: string, libc?: "glibc" | "musl" | null) => string | null;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
describe("resolvePackageName", () => {
|
|
9
|
+
test("darwin arm64", () => {
|
|
10
|
+
expect(resolvePackageName("darwin", "arm64")).toBe("@pstdio/cli-darwin-arm64");
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
test("darwin x64", () => {
|
|
14
|
+
expect(resolvePackageName("darwin", "x64")).toBe("@pstdio/cli-darwin-x64");
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
test("linux x64", () => {
|
|
18
|
+
expect(resolvePackageName("linux", "x64", "glibc")).toBe("@pstdio/cli-linux-x64");
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
test("linux arm64", () => {
|
|
22
|
+
expect(resolvePackageName("linux", "arm64", "glibc")).toBe("@pstdio/cli-linux-arm64");
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
test("linux x64 musl", () => {
|
|
26
|
+
expect(resolvePackageName("linux", "x64", "musl")).toBe("@pstdio/cli-linux-x64-musl");
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test("linux arm64 musl", () => {
|
|
30
|
+
expect(resolvePackageName("linux", "arm64", "musl")).toBe("@pstdio/cli-linux-arm64-musl");
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test("win32 x64", () => {
|
|
34
|
+
expect(resolvePackageName("win32", "x64")).toBe("@pstdio/cli-win-x64");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
test("win32 arm64", () => {
|
|
38
|
+
expect(resolvePackageName("win32", "arm64")).toBe("@pstdio/cli-win-arm64");
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
test("returns null for unsupported platform", () => {
|
|
42
|
+
expect(resolvePackageName("freebsd", "x64")).toBeNull();
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test("returns null for unsupported arch", () => {
|
|
46
|
+
expect(resolvePackageName("darwin", "ppc64")).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
});
|
package/package.json
CHANGED
|
@@ -1,24 +1,54 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pstdio",
|
|
3
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
|
-
"
|
|
6
|
+
"pstdio": "./bin/pstdio.js"
|
|
7
7
|
},
|
|
8
|
-
"
|
|
9
|
-
"
|
|
8
|
+
"files": [
|
|
9
|
+
"bin"
|
|
10
|
+
],
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/pufflyai/prompt-studio"
|
|
10
14
|
},
|
|
11
15
|
"scripts": {
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
+
"pstdio": "bun ./src/index.ts",
|
|
17
|
+
"dev": "PSTDIO_DISABLE_EMBED_MANIFEST=1 bun --watch ./src/index.ts -- serve & VITE_API_BASE_URL= bun run --cwd ../pstdio-dashboard dev & wait",
|
|
18
|
+
"build": "bun run ../../scripts/build-compile.ts",
|
|
19
|
+
"typecheck": "tsc --noEmit",
|
|
16
20
|
"lint": "bun run typecheck && bunx @biomejs/biome lint .",
|
|
17
21
|
"format": "bunx @biomejs/biome format --write .",
|
|
18
|
-
"test": "bun test"
|
|
22
|
+
"test": "bun test --silent",
|
|
23
|
+
"test:coverage": "bun test --coverage"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@tanstack/react-db": "^0.1.74",
|
|
27
|
+
"mustache": "^4.2.0",
|
|
28
|
+
"react": "^19.2.4",
|
|
29
|
+
"yargs": "^18.0.0"
|
|
19
30
|
},
|
|
20
|
-
"
|
|
21
|
-
"
|
|
31
|
+
"optionalDependencies": {
|
|
32
|
+
"@pstdio/cli-darwin-arm64": "0.1.0",
|
|
33
|
+
"@pstdio/cli-darwin-x64": "0.1.0",
|
|
34
|
+
"@pstdio/cli-linux-x64": "0.1.0",
|
|
35
|
+
"@pstdio/cli-linux-arm64": "0.1.0",
|
|
36
|
+
"@pstdio/cli-linux-x64-musl": "0.1.0",
|
|
37
|
+
"@pstdio/cli-linux-arm64-musl": "0.1.0",
|
|
38
|
+
"@pstdio/cli-win-x64": "0.1.0",
|
|
39
|
+
"@pstdio/cli-win-arm64": "0.1.0"
|
|
22
40
|
},
|
|
23
|
-
"
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@types/bun": "latest",
|
|
43
|
+
"@types/mustache": "^4.2.6",
|
|
44
|
+
"@types/node": "^24.3.0",
|
|
45
|
+
"@types/react": "^19.2.14",
|
|
46
|
+
"@types/yargs": "^17.0.35",
|
|
47
|
+
"pstdio-agents": "workspace:*",
|
|
48
|
+
"pstdio-api": "workspace:*",
|
|
49
|
+
"pstdio-dashboard": "workspace:*",
|
|
50
|
+
"pstdio-db": "workspace:*",
|
|
51
|
+
"pstdio-wt": "workspace:*",
|
|
52
|
+
"typescript": "~5.9.3"
|
|
53
|
+
}
|
|
24
54
|
}
|
package/README.md
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
# temp_package
|
|
2
|
-
|
|
3
|
-
To install dependencies:
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
bun install
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
To run:
|
|
10
|
-
|
|
11
|
-
```bash
|
|
12
|
-
bun run index.ts
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
This project was created using `bun init` in bun v1.3.3. [Bun](https://bun.com) is a fast all-in-one JavaScript runtime.
|
package/dist/index.js
DELETED
package/src/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
console.log("Hello via Bun!");
|
package/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
"noImplicitOverride": true,
|
|
23
|
-
|
|
24
|
-
// Some stricter flags (disabled by default)
|
|
25
|
-
"noUnusedLocals": false,
|
|
26
|
-
"noUnusedParameters": false,
|
|
27
|
-
"noPropertyAccessFromIndexSignature": false
|
|
28
|
-
}
|
|
29
|
-
}
|