@rootnative/cli 0.0.0-alpha.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/llms.txt ADDED
@@ -0,0 +1,105 @@
1
+ # @rootnative/cli — CLI for RootNative UI
2
+
3
+ > Version: 0.0.0-alpha.0
4
+ > Binary: `rootnative`
5
+ > Requirements: Node >=18
6
+
7
+ ## CLI (`rootnative`)
8
+
9
+ ### Commands
10
+
11
+ #### `rootnative create [name]`
12
+
13
+ Create a new project with RootNative UI pre-configured. Fetches the quickstart template, applies your project name to `package.json` and `app.json`, and optionally installs dependencies.
14
+
15
+ ```bash
16
+ npx rootnative create # Interactive
17
+ npx rootnative create my-app # With name
18
+ npx rootnative create my-app -y # Non-interactive, accept defaults
19
+ ```
20
+
21
+ Options:
22
+ - `-y, --yes` — Skip prompts and use defaults
23
+ - `-t, --template <name>` — Template to use (`blank`, `with-router`)
24
+ - `--package-manager <pm>` — Package manager to use (`npm`, `yarn`, `pnpm`, `bun`)
25
+
26
+ #### `rootnative init`
27
+
28
+ Copy-paste workflow — copies component source files into your project. The theme system (`@rootnative/core`) stays as an npm dependency.
29
+
30
+ Initialize project. Detects project type (Expo/RN), package manager, and tsconfig path aliases.
31
+
32
+ ```bash
33
+ npx rootnative init # Interactive
34
+ npx rootnative init -y # Non-interactive, accept defaults
35
+ npx rootnative init -y --components-alias "~/ui" --lib-alias "~/utils"
36
+ ```
37
+
38
+ Options:
39
+ - `-y, --yes` — Skip all prompts, use detected defaults. Overwrites existing config. Auto-installs `@rootnative/core`.
40
+ - `--components-alias <alias>` — Components install path. Default: `@/components/ui` (or `~/components/ui` if `~/*` alias detected in tsconfig)
41
+ - `--lib-alias <alias>` — Utility files path. Default: `@/lib` (or `~/lib` if `~/*` alias detected)
42
+ - `--package-manager <pm>` — Package manager to use (`npm`, `yarn`, `pnpm`, `bun`)
43
+
44
+ Creates `rootnative.json`:
45
+ ```json
46
+ {
47
+ "$schema": "https://rootnative.github.io/ui/schema.json",
48
+ "aliases": { "components": "@/components/ui", "lib": "@/lib" },
49
+ "registryUrl": "https://raw.githubusercontent.com/rootnative/ui",
50
+ "registryVersion": "main"
51
+ }
52
+ ```
53
+
54
+ #### `rootnative add <components...>`
55
+
56
+ Add components to your project. Resolves dependency graph, copies files with rewritten imports, installs npm deps.
57
+
58
+ ```bash
59
+ npx rootnative add button
60
+ npx rootnative add card chip text-field
61
+ npx rootnative add appbar # auto-adds icon-button + typography
62
+ ```
63
+
64
+ Options:
65
+ - `-f, --force` — Overwrite existing components
66
+ - `-d, --dry-run` — Preview without writing files
67
+ - `--package-manager <pm>` — Package manager to use (`npm`, `yarn`, `pnpm`, `bun`)
68
+
69
+ #### `rootnative update [components...]`
70
+
71
+ Update installed components to latest registry version.
72
+
73
+ Options:
74
+ - `-a, --all` — Update all installed components
75
+ - `-d, --dry-run` — Show diff without applying
76
+
77
+ #### `rootnative upgrade`
78
+
79
+ Upgrade `@rootnative/core` to the latest published version and install any new peer dependencies.
80
+
81
+ ```bash
82
+ npx rootnative upgrade # Interactive — shows plan and prompts before installing
83
+ npx rootnative upgrade -y # Non-interactive — skip confirmation
84
+ ```
85
+
86
+ Options:
87
+ - `-y, --yes` — Skip confirmation prompt
88
+ - `--package-manager <pm>` — Package manager to use (`npm`, `yarn`, `pnpm`, `bun`)
89
+
90
+ What it does:
91
+ 1. Reads the installed `@rootnative/core` version from `node_modules`
92
+ 2. Fetches the latest version from the npm registry
93
+ 3. Compares peer dependencies between the installed and latest versions
94
+ 4. Shows a plan: version bump, new required peer deps, changed version ranges, removed deps
95
+ 5. Upgrades `@rootnative/core` and installs any new required peer dependencies in one step
96
+ 6. Reports optional peer deps that aren't installed (does not auto-install optional deps)
97
+ 7. Lists peer deps that are no longer required so you can remove them manually
98
+
99
+ #### `rootnative list`
100
+
101
+ Show available components with install status.
102
+
103
+ #### `rootnative doctor`
104
+
105
+ Check project health: config validity, core installation, RN version, file integrity, peer deps.
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "@rootnative/cli",
3
+ "version": "0.0.0-alpha.0",
4
+ "description": "CLI for adding RootNative UI components to your React Native project",
5
+ "private": false,
6
+ "bin": {
7
+ "rootnative": "dist/index.mjs"
8
+ },
9
+ "exports": "./dist/index.mjs",
10
+ "files": [
11
+ "dist",
12
+ "llms.txt"
13
+ ],
14
+ "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/rootnative/ui.git",
18
+ "directory": "packages/cli"
19
+ },
20
+ "homepage": "https://github.com/rootnative/ui",
21
+ "keywords": [
22
+ "react-native",
23
+ "material-design-3",
24
+ "ui",
25
+ "cli",
26
+ "components",
27
+ "rootnative"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "engines": {
33
+ "node": ">=18"
34
+ },
35
+ "dependencies": {
36
+ "chalk": "^5.4.1",
37
+ "commander": "^13.1.0",
38
+ "execa": "^9.5.2",
39
+ "fs-extra": "^11.3.0",
40
+ "ora": "^8.2.0",
41
+ "prompts": "^2.4.2"
42
+ },
43
+ "devDependencies": {
44
+ "@types/fs-extra": "^11.0.4",
45
+ "@types/node": "^22.0.0",
46
+ "@types/prompts": "^2.4.9",
47
+ "tsup": "^8.0.0",
48
+ "typescript": "^5.0.0",
49
+ "vitest": "^3.2.1"
50
+ },
51
+ "scripts": {
52
+ "build": "tsup",
53
+ "dev": "tsup --watch",
54
+ "typecheck": "tsc --noEmit",
55
+ "test": "vitest run",
56
+ "lint": "eslint . --max-warnings 0"
57
+ }
58
+ }