@solidrt/cli 0.0.14 → 0.0.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidrt/cli",
3
- "version": "0.0.14",
3
+ "version": "0.0.17",
4
4
  "license": "MIT",
5
5
  "author": "Antoine van Wel",
6
6
  "type": "module",
@@ -14,19 +14,20 @@
14
14
  "AGENTS.md"
15
15
  ],
16
16
  "dependencies": {
17
- "@babel/core": "^7.28.5",
18
- "@babel/preset-typescript": "^7.28.5",
17
+ "@babel/core": "^8.0.1",
18
+ "@babel/plugin-syntax-jsx": "^8.0.1",
19
+ "@babel/preset-typescript": "^8.0.1",
19
20
  "babel-preset-solid": "2.0.0-beta.15",
20
21
  "bonjour-service": "^1.4.0",
21
22
  "qrcode-generator": "^2.0.4"
22
23
  },
23
24
  "optionalDependencies": {
24
- "@solidrt/darwin-arm64": "0.0.0",
25
- "@solidrt/linux-x64-gnu": "0.0.0",
26
- "@solidrt/win32-x64-msvc": "0.0.0"
25
+ "@solidrt/darwin-arm64": "0.0.17",
26
+ "@solidrt/linux-x64-gnu": "0.0.17",
27
+ "@solidrt/win32-x64-msvc": "0.0.17"
27
28
  },
28
29
  "peerDependencies": {
29
- "@solidrt/core": "0.0.0",
30
+ "@solidrt/core": "0.0.17",
30
31
  "typescript": "^6"
31
32
  },
32
33
  "devDependencies": {
@@ -5,29 +5,25 @@ runtime. No DOM, no HTML, no CSS cascade. If you are an AI assistant, read this
5
5
  before writing or editing code here.
6
6
 
7
7
  Authoritative references ship inside the installed packages - read them:
8
+ - node_modules/solid-js/CHEATSHEET.md - SolidJS 2.0 reactivity/control-flow model
8
9
  - node_modules/@solidrt/core/AGENTS.md - element/prop/reactivity model
10
+ - node_modules/@solidrt/core/examples/ - single-concept usage patterns to copy (see its README.md index)
9
11
  - node_modules/@solidrt/cli/AGENTS.md - running, bundling, headless verify
10
12
  - node_modules/@solidrt/core/src/types.d.ts and jsx-runtime.d.ts - source of truth
11
13
 
12
14
  <!-- Claude Code auto-imports these; other tools read the paths above. -->
15
+ @./node_modules/solid-js/CHEATSHEET.md
13
16
  @./node_modules/@solidrt/core/AGENTS.md
14
17
  @./node_modules/@solidrt/cli/AGENTS.md
15
18
 
16
19
  ## The things assistants get wrong (this is not React/DOM)
17
20
 
18
- 1. SolidJS 2.0, not React (and not Solid 1.x). Import the whole authoring
19
- surface from @solidrt/core - it re-exports the substrate so you do not have to
20
- know which package a symbol lives in: render plus the window/paint/event APIs,
21
- the reactive primitives (createSignal, createMemo, createEffect, createStore,
22
- reconcile, mapArray, untrack, onCleanup), and the control-flow components (For,
23
- Show, Switch/Match, Repeat, Loading, Errored). No hooks, no virtual DOM, the
24
- component body runs once. Render lists with <For each={...}>{item => ...}</For>,
25
- never array.map. createEffect has the 2.0 two-function shape - a TRACKED
26
- compute that reads signals and returns a value, then an UNTRACKED effect that
27
- receives it:
28
- createEffect(() => count(), (c) => console.log(c))
29
- The Solid 1.x single-callback form, createEffect(() => console.log(count())),
30
- does NOT track in 2.0.
21
+ 1. This is SolidJS 2.0 (see CHEATSHEET.md for the reactivity/control-flow
22
+ model), rendering through a custom Rust runtime instead of the DOM. Import
23
+ the whole authoring surface from @solidrt/core - it re-exports the
24
+ substrate so you do not have to know which package a symbol lives in:
25
+ render plus the window/paint/event APIs alongside the standard reactive
26
+ primitives and control-flow components.
31
27
  2. Host elements are lowercase intrinsics: window, view, text, rect, oval, path,
32
28
  texture, audio (+ d- variants). No div/span/img/button.
33
29
  3. render(() => <App/>) once, top level. The root MUST be <window> or it throws.
@@ -41,26 +37,27 @@ Authoritative references ship inside the installed packages - read them:
41
37
  work). A detached node cannot have attached (regular, Taffy-laid-out)
42
38
  children - everything under a d-element must itself be detached. Nesting a
43
39
  plain <view>/<text> inside a d-element is an error.
44
- 8. Per-frame work: onFrame((tick, frame) => {}), or the standard
45
- requestAnimationFrame(t => {}) for animations. Also onResize, onLayout.
46
- 9. Device/GPU via subpath imports: @solidrt/core/camera, /microphone, /gpu.
47
- 10. tsconfig needs jsx:"preserve" + jsxImportSource:"@solidrt/core". Solid peer
40
+ 8. Per-frame animation: onFrame((tick, frame) => {}) is the native hook
41
+ (runtime-paced, auto-cleans). requestAnimationFrame(t => {}) exists as a
42
+ web-standard one-shot but is not the preferred animation driver.
43
+ 9. Reactive window state: prefer the accessors windowSize(), safeArea(),
44
+ displayScale(), windowFocused(), keyboardHeight() from @solidrt/core over the
45
+ onResize / onLayout callbacks for reading layout and window state.
46
+ 10. Device/GPU via subpath imports: @solidrt/core/camera, /microphone, /gpu.
47
+ Images: createImage(src) from @solidrt/core (reactive load -> texture id);
48
+ raw decodeImage + createTexture (from /gpu) are the primitives underneath.
49
+ 11. tsconfig needs jsx:"preserve" + jsxImportSource:"@solidrt/core". Solid peer
48
50
  deps are pinned betas - do not bump them casually.
49
- 11. Use ASCII characters whenever possible in code and text - for example, no
51
+ 12. Use ASCII characters whenever possible in code and text - for example, no
50
52
  em-dashes (use a hyphen), no smart/curly quotes, no unicode symbols.
51
- 12. Mind the safe area. safeArea() from @solidrt/core is a reactive accessor
53
+ 13. Mind the safe area. safeArea() from @solidrt/core is a reactive accessor
52
54
  returning { top, left, right, bottom } insets (like CSS
53
55
  env(safe-area-inset-*)). It is fine to place content outside the safe-area
54
56
  zone (e.g. full-bleed backgrounds), just be aware it may not be visible and
55
57
  cannot be interacted with (touch gestures). Keep interactive or essential
56
58
  content inside the safe area by padding the edges.
57
- 13. Prefer let over const. Use const only for real constants - a single fixed
59
+ 14. Prefer let over const. Use const only for real constants - a single fixed
58
60
  string or number value - and name those in ALL_CAPS.
59
- 14. SolidJS/SolidRT is a reactive framework: strongly prefer reactive primitives
60
- (signals, memos, effects, the control-flow components) over imperative code.
61
- Derive state with createMemo, react with createEffect, render conditionally
62
- with <Show>/<Switch> and lists with <For> - do not hand-roll imperative
63
- updates, manual subscriptions, or DOM-style mutation.
64
61
 
65
62
  ## Run / verify
66
63
 
package/src/bundler.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { transformAsync } from "@babel/core"
2
+ import jsx from "@babel/plugin-syntax-jsx"
2
3
  import ts from "@babel/preset-typescript"
3
4
  import solid from "babel-preset-solid"
4
5
  import { type BunPlugin } from "bun"
@@ -17,6 +18,7 @@ function solidPlugin(): BunPlugin {
17
18
  let transforms = await transformAsync(code, {
18
19
  filename: args.path,
19
20
  presets: [[solid, { moduleName: "@solidrt/core", generate: "universal" }], [ts]],
21
+ plugins: [jsx],
20
22
  })
21
23
  return { contents: transforms?.code ?? "", loader: "js" }
22
24
  })