@solidrt/cli 0.0.13 → 0.0.16

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.13",
3
+ "version": "0.0.16",
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",
19
- "babel-preset-solid": "2.0.0-beta.14",
17
+ "@babel/core": "^8.0.1",
18
+ "@babel/plugin-syntax-jsx": "^8.0.1",
19
+ "@babel/preset-typescript": "^8.0.1",
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.13",
25
- "@solidrt/linux-x64-gnu": "0.0.13",
26
- "@solidrt/win32-x64-msvc": "0.0.13"
25
+ "@solidrt/darwin-arm64": "0.0.0",
26
+ "@solidrt/linux-x64-gnu": "0.0.0",
27
+ "@solidrt/win32-x64-msvc": "0.0.0"
27
28
  },
28
29
  "peerDependencies": {
29
- "@solidrt/core": "0.0.13",
30
+ "@solidrt/core": "0.0.0",
30
31
  "typescript": "^6"
31
32
  },
32
33
  "devDependencies": {
@@ -5,23 +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). Primitives come from
19
- @solidjs/signals; no hooks, no virtual DOM, the component body runs once.
20
- createEffect has the 2.0 two-function shape - a TRACKED compute that reads
21
- signals and returns a value, then an UNTRACKED effect that receives it:
22
- createEffect(() => count(), (c) => console.log(c))
23
- The Solid 1.x single-callback form, createEffect(() => console.log(count())),
24
- 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.
25
27
  2. Host elements are lowercase intrinsics: window, view, text, rect, oval, path,
26
28
  texture, audio (+ d- variants). No div/span/img/button.
27
29
  3. render(() => <App/>) once, top level. The root MUST be <window> or it throws.
@@ -32,12 +34,30 @@ Authoritative references ship inside the installed packages - read them:
32
34
  6. No onClick/onPress. A button is a <view>/<rect> with onPointerDown.
33
35
  7. d- prefix = detached from layout: a plain element is laid out by Taffy, a
34
36
  d-element you position with x/y (omit to fill the parent = how backgrounds
35
- work).
36
- 8. Per-frame work: onFrame((tick, frame) => {}), or the standard
37
- requestAnimationFrame(t => {}) for animations. Also onResize, onLayout.
38
- 9. Device/GPU via subpath imports: @solidrt/core/camera, /microphone, /gpu.
39
- 10. tsconfig needs jsx:"preserve" + jsxImportSource:"@solidrt/core". Solid peer
37
+ work). A detached node cannot have attached (regular, Taffy-laid-out)
38
+ children - everything under a d-element must itself be detached. Nesting a
39
+ plain <view>/<text> inside a d-element is an error.
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
40
50
  deps are pinned betas - do not bump them casually.
51
+ 12. Use ASCII characters whenever possible in code and text - for example, no
52
+ em-dashes (use a hyphen), no smart/curly quotes, no unicode symbols.
53
+ 13. Mind the safe area. safeArea() from @solidrt/core is a reactive accessor
54
+ returning { top, left, right, bottom } insets (like CSS
55
+ env(safe-area-inset-*)). It is fine to place content outside the safe-area
56
+ zone (e.g. full-bleed backgrounds), just be aware it may not be visible and
57
+ cannot be interacted with (touch gestures). Keep interactive or essential
58
+ content inside the safe area by padding the edges.
59
+ 14. Prefer let over const. Use const only for real constants - a single fixed
60
+ string or number value - and name those in ALL_CAPS.
41
61
 
42
62
  ## Run / verify
43
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
  })