@sublime-ui/devkit 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/LICENSE +21 -0
- package/README.md +84 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +1438 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Aaron Mkandawire and Sublime UI contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# @sublime-ui/devkit
|
|
2
|
+
|
|
3
|
+
The [Sublime UI](https://sublime-ui.github.io/sublime-ui/) developer CLI —
|
|
4
|
+
code generators, the navigation compiler, desktop tooling, and **standalone
|
|
5
|
+
Android APK builds fully offline** (no EAS / cloud build). Bin names: `sublime`
|
|
6
|
+
(alias `sui`).
|
|
7
|
+
|
|
8
|
+
## What "offline" means
|
|
9
|
+
|
|
10
|
+
- **No cloud build service** — everything runs on your machine via Gradle.
|
|
11
|
+
- **Offline runtime** — the default `assembleRelease` build embeds the JS bundle
|
|
12
|
+
and signs with the auto-generated debug keystore, so the APK runs with **no
|
|
13
|
+
Metro server**.
|
|
14
|
+
- Not air-gapped: the *first* Gradle build still downloads Maven/AGP artifacts.
|
|
15
|
+
|
|
16
|
+
## Commands
|
|
17
|
+
|
|
18
|
+
| Command | What it does |
|
|
19
|
+
|---|---|
|
|
20
|
+
| `sublime doctor` | Prints a ✓/✗ table for Node, JDK 17, `ANDROID_HOME`, cmdline-tools, platform-tools, NDK 27.1.12297006, CMake 3.22.1. Exits non-zero if a required piece is missing. |
|
|
21
|
+
| `sublime setup` | Windows: installs a **portable Temurin JDK 17** into `~/.sublime/` (no admin; your system Java is untouched). macOS/Linux: prints guided steps. |
|
|
22
|
+
| `sublime build [--release\|--debug] [--aab] [--project <path>]` | Runs `expo prebuild` if `android/` is absent, writes `local.properties`, then runs Gradle with a **scoped JDK 17** and self-heals missing NDK/CMake. Default = `assembleRelease`. Note: `--debug` produces a Metro-dependent APK (not offline); `--release` is the offline default. `--aab` produces a Play Store App Bundle (`.aab`, via bundleRelease). |
|
|
23
|
+
| `sublime run [--device <id>] [--project <path>]` | `adb install -r` the APK and launches it. |
|
|
24
|
+
|
|
25
|
+
## Code generators
|
|
26
|
+
|
|
27
|
+
Scaffold code matching the Sublime UI framework/library conventions. Paths come
|
|
28
|
+
from `sublime.config.json` (defaults: `src/models`, `src/components`, `src/theme`).
|
|
29
|
+
|
|
30
|
+
| Command | Generates |
|
|
31
|
+
|---|---|
|
|
32
|
+
| `sublime make:model <Name> [--fields "a:string,b:number"] [--resource /path] [--force]` | `models/<Name>.ts` (Model + `declare` fields + `registerModel`) + barrel. No `--fields` → interactive prompts. |
|
|
33
|
+
| `sublime make:component <Name> [--mobile-only] [--force]` | `components/<Name>/` quartet (`types`/`tsx`/`native.tsx`/`index`) + barrel. `--mobile-only` → web null stub. |
|
|
34
|
+
| `sublime theme:init [--force]` | `theme/tokens.json` (= library defaults) + a typed `theme/tokens.ts` wrapper. |
|
|
35
|
+
|
|
36
|
+
Generators never overwrite without `--force`; barrel updates are idempotent.
|
|
37
|
+
|
|
38
|
+
## Navigation compiler
|
|
39
|
+
|
|
40
|
+
| Command | What it does |
|
|
41
|
+
|---|---|
|
|
42
|
+
| `sublime build:nav [--watch] [--force] [--project <path>]` | Compiles per-platform storybooks (`storybook.web.ts` / `storybook.native.ts`) into `navigation.web.tsx` (react-router), `navigation.native.tsx` (React Navigation), a typed route map (`routes.d.ts`), and an index barrel. `--watch` rebuilds on change. |
|
|
43
|
+
|
|
44
|
+
## Desktop (Electron Forge)
|
|
45
|
+
|
|
46
|
+
| Command | What it does |
|
|
47
|
+
|---|---|
|
|
48
|
+
| `sublime desktop:dev [--project <path>]` | Runs the Electron desktop shell in development (`electron-forge start`). |
|
|
49
|
+
| `sublime desktop:build [--project <path>]` | Builds distributable desktop artifacts (`electron-forge make`). |
|
|
50
|
+
|
|
51
|
+
## Robustness (lessons baked in)
|
|
52
|
+
|
|
53
|
+
- **Self-healing SDK installs.** On `Failed to install … ndk;X / cmake;Y`, the id
|
|
54
|
+
is parsed, installed via `sdkmanager`, and the build retried (max 4 attempts).
|
|
55
|
+
- **Corrupt-NDK detection.** An NDK dir missing `source.properties` / `ndk-build`
|
|
56
|
+
/ clang is removed and reinstalled.
|
|
57
|
+
- **Modern cmdline-tools `sdkmanager` on JDK 17** avoids the legacy
|
|
58
|
+
`NoClassDefFoundError: javax/xml/bind` (JAXB removed after Java 8) crash.
|
|
59
|
+
- **Scoped JDK.** Build children get `JAVA_HOME` → JDK 17 for that call only; the
|
|
60
|
+
system default Java is never modified.
|
|
61
|
+
|
|
62
|
+
## Troubleshooting
|
|
63
|
+
|
|
64
|
+
| Symptom | Fix |
|
|
65
|
+
|---|---|
|
|
66
|
+
| `doctor` shows JDK 17 ✗ | `sublime setup` (Windows) or install Temurin 17 + set `JAVA_HOME`. |
|
|
67
|
+
| Build fails on `ndk;…`/`cmake;…` | Usually auto-healed; if it persists, check `ANDROID_HOME` is writable. |
|
|
68
|
+
| `NoClassDefFoundError javax/xml/bind` | You're invoking the legacy `tools/bin/sdkmanager` on JDK 17 — use cmdline-tools `latest`. |
|
|
69
|
+
| `run` finds no device | Start an emulator or plug in a phone with USB debugging; `adb devices`. |
|
|
70
|
+
|
|
71
|
+
## Scope
|
|
72
|
+
|
|
73
|
+
Offline Android builds are Android only (iOS needs macOS). macOS/Linux:
|
|
74
|
+
`doctor`/`build`/`run` work; `setup` prints guided steps instead of
|
|
75
|
+
auto-installing. Generators, `build:nav`, and the desktop commands are
|
|
76
|
+
cross-platform.
|
|
77
|
+
|
|
78
|
+
## Documentation
|
|
79
|
+
|
|
80
|
+
Full CLI reference: **https://sublime-ui.github.io/sublime-ui/docs/devkit**
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
package/dist/cli.d.ts
ADDED