primitiv-ui 0.0.1 → 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.
@@ -0,0 +1,51 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'child_process';
3
+ import { createRequire } from 'module';
4
+ import { dirname, join } from 'path';
5
+ import { existsSync } from 'fs';
6
+
7
+ const require = createRequire(import.meta.url);
8
+
9
+ const PLATFORM_PACKAGES = {
10
+ 'darwin:arm64': '@primitiv-ui/cli-darwin-arm64',
11
+ 'darwin:x64': '@primitiv-ui/cli-darwin-x64',
12
+ 'linux:x64': '@primitiv-ui/cli-linux-x64-gnu',
13
+ 'linux:arm64': '@primitiv-ui/cli-linux-arm64-gnu',
14
+ 'win32:x64': '@primitiv-ui/cli-win32-x64',
15
+ };
16
+
17
+ const key = `${process.platform}:${process.arch}`;
18
+ const pkg = PLATFORM_PACKAGES[key];
19
+
20
+ if (!pkg) {
21
+ process.stderr.write(
22
+ `primitiv: unsupported platform (${process.platform}/${process.arch}).\n` +
23
+ `Install from source: cargo install primitiv-cli\n`
24
+ );
25
+ process.exit(1);
26
+ }
27
+
28
+ let binaryPath;
29
+ try {
30
+ const pkgDir = dirname(require.resolve(`${pkg}/package.json`));
31
+ const binary = process.platform === 'win32' ? 'primitiv.exe' : 'primitiv';
32
+ binaryPath = join(pkgDir, binary);
33
+ } catch {
34
+ process.stderr.write(
35
+ `primitiv: the ${pkg} platform package could not be found.\n` +
36
+ `Try reinstalling: pnpm add -D primitiv-ui\n` +
37
+ `Or install from source: cargo install primitiv-cli\n`
38
+ );
39
+ process.exit(1);
40
+ }
41
+
42
+ if (!existsSync(binaryPath)) {
43
+ process.stderr.write(
44
+ `primitiv: binary not found at ${binaryPath}.\n` +
45
+ `Try: cargo install primitiv-cli\n`
46
+ );
47
+ process.exit(1);
48
+ }
49
+
50
+ const { status } = spawnSync(binaryPath, process.argv.slice(2), { stdio: 'inherit' });
51
+ process.exit(status ?? 1);
package/package.json CHANGED
@@ -1,20 +1,25 @@
1
1
  {
2
2
  "name": "primitiv-ui",
3
- "version": "0.0.1",
4
- "description": "Primitiv design system CLI (placeholder; in development). Headless components ship as @primitiv-ui/react, /icons, /tokens.",
3
+ "version": "0.1.0",
4
+ "description": "Primitiv UI — the design system CLI. Run `primitiv add button` in any Vite or Next.js project.",
5
+ "keywords": ["primitiv", "design-system", "cli", "react", "tailwind"],
5
6
  "bin": {
6
- "primitiv": "bin/primitiv.js"
7
+ "primitiv": "./bin/primitiv.mjs"
7
8
  },
8
- "files": [
9
- "bin"
10
- ],
11
- "keywords": [
12
- "primitiv",
13
- "primitiv-ui",
14
- "design-system",
15
- "cli"
16
- ],
17
- "publishConfig": {
18
- "access": "public"
19
- }
9
+ "files": ["bin"],
10
+ "engines": { "node": ">=18" },
11
+ "optionalDependencies": {
12
+ "@primitiv-ui/cli-darwin-arm64": "0.1.0",
13
+ "@primitiv-ui/cli-darwin-x64": "0.1.0",
14
+ "@primitiv-ui/cli-linux-x64-gnu": "0.1.0",
15
+ "@primitiv-ui/cli-linux-arm64-gnu": "0.1.0",
16
+ "@primitiv-ui/cli-win32-x64": "0.1.0"
17
+ },
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/primitiv-ui/primitiv.git",
21
+ "directory": "npm/cli-wrapper"
22
+ },
23
+ "license": "MIT",
24
+ "publishConfig": { "access": "public" }
20
25
  }
package/README.md DELETED
@@ -1,9 +0,0 @@
1
- # primitiv-ui (placeholder)
2
-
3
- Reserves the unscoped npm name **`primitiv-ui`** — the package that will ship the
4
- Primitiv design system CLI (command: `primitiv`). See
5
- [`docs/rfcs/0005-primitiv-cli.md`](../../docs/rfcs/0005-primitiv-cli.md).
6
-
7
- This is a placeholder that prints a "coming soon" notice. It will be replaced by
8
- the real CLI build at a higher version. Publishing instructions live in
9
- [`../README.md`](../README.md).
package/bin/primitiv.js DELETED
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env node
2
- // Placeholder for the Primitiv design system CLI (command: `primitiv`).
3
- // The real CLI is in development — see docs/rfcs/0005-primitiv-cli.md.
4
- console.log(
5
- [
6
- "primitiv-ui — coming soon.",
7
- "The Primitiv design system CLI is in development.",
8
- "Headless components are published as @primitiv-ui/react (and /icons, /tokens).",
9
- ].join("\n")
10
- );