orvyn-lang 0.2.0 → 0.3.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.
Files changed (55) hide show
  1. package/GUIDE.md +149 -0
  2. package/LANGUAGE.md +744 -27
  3. package/README.md +211 -250
  4. package/brand/orvyn-sunset-animated.svg +15 -0
  5. package/package.json +3 -1
  6. package/src/cli/orvyn.js +186 -10
  7. package/src/core/signal.js +104 -6
  8. package/src/devtools/runtime.js +25 -1
  9. package/src/lang/a11y.js +102 -0
  10. package/src/lang/auth.js +239 -0
  11. package/src/lang/bundle-native.js +10 -6
  12. package/src/lang/codegen.js +428 -57
  13. package/src/lang/device.js +41 -0
  14. package/src/lang/doctor.js +60 -0
  15. package/src/lang/env.js +27 -0
  16. package/src/lang/errors.js +513 -0
  17. package/src/lang/form.js +69 -8
  18. package/src/lang/index.js +2 -1
  19. package/src/lang/lexer.js +2 -0
  20. package/src/lang/list.js +44 -0
  21. package/src/lang/native/android/MainActivity.kt +43 -4
  22. package/src/lang/native/android/OrvynDevice.kt +163 -0
  23. package/src/lang/native/android/OrvynEngine.kt +154 -7
  24. package/src/lang/native/android/OrvynRenderer.kt +518 -44
  25. package/src/lang/native/android.js +74 -11
  26. package/src/lang/native/build.js +130 -60
  27. package/src/lang/native/config.js +108 -0
  28. package/src/lang/native/ios/OrvynApp.swift +6 -0
  29. package/src/lang/native/ios/OrvynEngine.swift +266 -4
  30. package/src/lang/native/ios/OrvynViews.swift +429 -34
  31. package/src/lang/native/ios.js +75 -2
  32. package/src/lang/native-runtime.js +406 -56
  33. package/src/lang/page.js +52 -0
  34. package/src/lang/parser.js +243 -15
  35. package/src/lang/prerender.js +300 -0
  36. package/src/lang/read-import.js +11 -0
  37. package/src/lang/router.js +266 -0
  38. package/src/lang/runtime-shared.js +792 -10
  39. package/src/lang/runtime.js +362 -52
  40. package/src/lang/select.js +13 -0
  41. package/src/lang/server-code.js +233 -0
  42. package/src/lang/server-export.js +78 -0
  43. package/src/lang/server-libs.js +53 -0
  44. package/src/lang/server.js +409 -0
  45. package/src/lang/test-runner.js +134 -0
  46. package/src/lang/types.js +312 -0
  47. package/src/lang/vite-plugin.js +82 -3
  48. package/src/lang/web-overlay.js +578 -0
  49. package/src/lang/widgets.js +94 -0
  50. package/src/lang/words.js +38 -0
  51. package/src/runtime/mount.js +116 -27
  52. package/src/runtime/patch.js +90 -11
  53. package/src/runtime/style.js +11 -1
  54. package/src/styling/fluid.js +91 -4
  55. package/src/styling/spec.js +306 -0
package/README.md CHANGED
@@ -1,317 +1,278 @@
1
+ <p align="center"><img src="brand/orvyn-sunset-animated.svg" width="120" alt="Orvyn logo"></p>
2
+
1
3
  # Orvyn
2
4
 
3
- **One language for web, iPhone and Android.** Write `.orv` files once and get a
4
- website, a native iPhone app (SwiftUI) and a native Android app.
5
+ **One language for web, iPhone and Android.** Write `.orv` files once and get a website, a native iPhone app and a native Android app.
5
6
 
6
7
  ```bash
7
- npm install -g orvyn-lang
8
+ npm install -g orvyn-lang # once: installs the `orvyn` command
8
9
  orvyn new my-app
9
10
  cd my-app
10
- orvyn dev # web, live reload
11
- orvyn ios # iPhone simulator, live reload (needs Xcode)
11
+ orvyn dev # web
12
+ orvyn ios # iPhone (live reload)
13
+ orvyn doctor # what is missing to build and publish
14
+ orvyn test # run your app's tests
12
15
  ```
13
16
 
14
- ```orv
15
- state count = 0
16
-
17
- screen Home {
18
- Column gap: 16, padding: 24 {
19
- Text "Count: {count}", size: 32
20
- Button "Add", bg: black, color: white, onTap: count += 1
21
- }
22
- }
23
- ```
17
+ New here? Build [your first app in 10 minutes](GUIDE.md). [LANGUAGE.md](LANGUAGE.md) is the full reference.
24
18
 
19
+ ## Use a JavaScript library
25
20
 
26
- ## Declarations (top level)
21
+ Install a package in **your app folder**, then import it with `use`:
27
22
 
28
- | Syntax | Meaning |
29
- |---|---|
30
- | `state name = value` | A value that changes. The screen updates when it changes. |
31
- | `saved state name = value` | Like `state`, but kept after a reload or app restart (cart, settings, login). |
32
- | `let name = value` | A value that never changes. |
33
- | `fn name(a, b) { ... }` | A function. |
34
- | `screen Name { ... }` | A screen of your app. `App` (or the first screen) is shown first. |
35
- | `component Name(param) { ... }` | A reusable piece of UI. |
36
- | `start { ... }` | Runs once when the app opens (load data here). |
37
- | `use Card, Badge from "./ui"` | Use components, functions, values, or state from another `.orv` file. |
38
-
39
- ### Share state between files
40
-
41
- Every top-level declaration is exported automatically. Import state with `use`
42
- and read or change it with the same syntax as local state:
43
-
44
- ```orv
45
- // store.orv
46
- state count = 0
23
+ ```bash
24
+ cd my-app
25
+ npm install dayjs
47
26
  ```
48
27
 
49
- ```orv
50
- // app.orv
51
- use count from "./store"
28
+ ```orvyn
29
+ use dayjs from "dayjs"
52
30
 
53
31
  screen Home {
54
- Column gap: 16 {
55
- Text "Count: {count}"
56
- Button "Add", onTap: count += 1
57
- }
32
+ Text dayjs("2026-11-29").format("DD/MM/YYYY")
58
33
  }
59
34
  ```
60
35
 
61
- Imported state stays reactive. Assigning to an imported fixed value or function
62
- reports a runtime error explaining that the declaration must use `state`.
63
-
64
- ## Statements (inside `fn` and handlers)
65
-
66
- ```orv
67
- let total = price * 2 // local variable
68
- total += 1 // also -=, *=, /=
69
- count = 0 // update state
70
- if count > 10 { ... } else { ... }
71
- for item in items { ... }
72
- return total
73
- print("hello") // logs to the console
74
- ```
36
+ Run `orvyn dev` for the web, `orvyn ios` for the iPhone simulator, or
37
+ `orvyn android` for an Android emulator or connected phone. Native builds bundle
38
+ the library into the app; people installing your finished app do not install
39
+ its packages separately. You can also import your own JavaScript or TypeScript
40
+ file, such as `use formatPrice from "./helpers.js"`.
75
41
 
76
- ### Lists and objects
42
+ Choose libraries that work where your app runs. Plain JavaScript packages can
43
+ work on all three platforms; packages requiring browser APIs, Node.js APIs, or
44
+ native phone modules need platform-specific support. See
45
+ [Using libraries](LANGUAGE.md#using-libraries) for details and server libraries.
77
46
 
78
- Change them with these, and the screen updates by itself:
47
+ ## What you can build
79
48
 
80
- ```orv
81
- state todos = []
82
- state user = { name: "Asha", age: 20 }
49
+ Orvyn uses the same `.orv` app code for a website and generated native iPhone
50
+ and Android projects. Start with `orvyn new my-app`; edit `src/app.orv`. The
51
+ [first-app guide](GUIDE.md) walks through a working app, and the
52
+ [language reference](LANGUAGE.md) has syntax and examples for each feature.
83
53
 
84
- todos.add({ text: "Milk", done: false }) // add to the end
85
- todos.remove(todo) // remove this item
86
- todos.removeAt(0) // remove by position
87
- todos.update(todo, { done: true }) // change fields of one item
88
- todos.clear() // empty the list
89
- user.name = "Ravi" // change one field
90
- ```
91
-
92
- Reading is safe even before data arrives: `user.name` is just empty while `user` is `null`.
93
-
94
- ### Remember things after the app closes
95
-
96
- Put `saved` in front of `state`:
54
+ | Need | Orvyn features | Guide |
55
+ |---|---|---|
56
+ | Screens and shared UI | `screen`, reusable `component`, `Row`, `Column`, `List`, tabs, pop-ups, and maps | [Elements](LANGUAGE.md#elements), [long lists](LANGUAGE.md#long-lists) |
57
+ | Data and logic | Reactive `state`, component state, `fn`, lists, objects, optional types, and imports across files | [Declarations](LANGUAGE.md#declarations-top-level), [types](LANGUAGE.md#types-and-bigger-projects) |
58
+ | Navigation | `go()`, `back()`, screen parameters, browser URLs, and mobile back gestures | [Screens and navigation](LANGUAGE.md#screens-and-navigation) |
59
+ | Forms | Bound inputs, validation rules, errors, and submit actions | [Forms and validation](LANGUAGE.md#forms-and-validation) |
60
+ | Data that persists | `saved state`, migrations, reset, and secure storage for credentials | [Remember things](LANGUAGE.md#remember-things-after-the-app-closes) |
61
+ | Network and accounts | `load`, `get`, `post`, async tasks, login, guarded screens, and token refresh | [Internet data](LANGUAGE.md#internet-data), [login and auth](LANGUAGE.md#login-and-auth) |
62
+ | Backend | Tables, API routes, database access, authorization, secrets, and server-side libraries | [Backend](LANGUAGE.md#backend-database-and-login) |
63
+ | Device features | Photo and file picking, camera, location, maps, and declared permissions | [Camera, files and location](LANGUAGE.md#camera-files-and-location) |
64
+ | Appearance and access | Styles, themes, dark mode, responsive layouts, labels, and accessibility support | [Styling](LANGUAGE.md#styling-themes--dark-mode), [accessibility](LANGUAGE.md#accessibility) |
65
+ | Quality and release | App tests, mocks, `orvyn check`, environments, app settings, and web/mobile build commands | [Testing](LANGUAGE.md#testing-your-app), [publishing](LANGUAGE.md#publishing) |
66
+
67
+ ### Build and ship
97
68
 
98
- ```orv
99
- saved state cart = []
100
- saved state darkMode = false
69
+ ```bash
70
+ orvyn test # run app tests without a device
71
+ orvyn check # check the app for mistakes
72
+ orvyn doctor # check required mobile build tools and settings
73
+ orvyn build # production website in dist/web/
74
+ orvyn build server # backend to deploy on Node 24 or Docker
75
+ orvyn build ios --release # signed iOS archive when signing is configured
76
+ orvyn build android --release # signed Android bundle when signing is configured
101
77
  ```
102
78
 
103
- The value is stored on the device (browser storage on the web, UserDefaults on
104
- iPhone, SharedPreferences on Android) and comes back the next time the app opens.
105
- It also survives live reload while you develop.
106
-
107
- ### Internet data
108
-
109
- ```orv
110
- state users = []
79
+ Before a public release, test the complete app on real devices, configure
80
+ signing and permissions, verify login and data upgrades, and check the store
81
+ submission artifacts. Orvyn is still an experimental alpha; the repository's
82
+ [production milestones](#what-we-build-next) track device verification and
83
+ release work that remains. A successful build alone does not establish that a
84
+ particular app is ready for production.
111
85
 
112
- start {
113
- users = wait fetch("https://api.example.com/users")
114
- }
115
- ```
86
+ ## Current status
116
87
 
117
- `fetch` gives back the JSON directly. To send data: `fetch(url, { method: "POST", body: { name: "A" } })`.
118
- `wait` pauses until it's done: use it with `fetch` and `sleep(1000)`.
88
+ Orvyn is an experimental alpha. The goal is to make everyday app development
89
+ easy, with simple syntax and useful defaults across web, iOS, and Android.
90
+ Production readiness is the next development goal, not a guarantee of the
91
+ current release.
119
92
 
120
- Use `wait` inside a function, `start` block, event handler block, or lambda.
121
- The compiler makes that function async automatically. A lambda containing
122
- `wait` returns a promise; using it in `map` produces a list of promises, not
123
- finished results. For sequential work, use `for` inside a function instead.
124
- Top-level initializers and screen rendering cannot use `wait` directly.
93
+ The current implementation includes:
125
94
 
126
- ```orv
127
- state status = "Ready"
95
+ - A lexer, parser, JavaScript compiler, CLI, and VS Code syntax support.
96
+ - Reactive state, saved state, functions, components, screens, and imports.
97
+ - Lists, objects, navigation with `go()`, and network requests with `fetch()`.
98
+ - Input binding, forms, automatic field validation, and manual validation.
99
+ - Styling props, a browser renderer, and generated native app projects.
100
+ - Compiler execution tests, simulated native-host tests, and native-build CI
101
+ configuration. Real browser/device behavior and release builds still need
102
+ verification.
128
103
 
129
- screen Home {
130
- Button "Pause", onTap: {
131
- status = "Waiting"
132
- wait sleep(1000)
133
- status = "Done"
134
- }
135
- }
136
- ```
104
+ ## What's in this repo
137
105
 
138
- ### Try a complete offline app
106
+ | Folder | What it is |
107
+ |---|---|
108
+ | `src/lang/` | The language: lexer, parser, compiler, web + native runtimes |
109
+ | `src/lang/native/` | iPhone (SwiftUI) and Android project generators |
110
+ | `src/core`, `src/runtime`, `src/styling` | Reactive signals and rendering used by the web runtime |
111
+ | `src/cli/orvyn.js` | The `orvyn` command |
112
+ | `examples/` | Example apps (counter, todo, shop) |
113
+ | `editors/vscode/` | VS Code extension |
139
114
 
140
- From this repository, run `npm run dev` and open `/lang.html?app=todo`.
141
- `examples/todo.orv` includes blank-input validation, saved tasks, completion
142
- toggles, removal, clearing completed tasks, and navigation to an About screen.
143
- It works without a network request. Saved tasks belong to the current browser
144
- origin or installed app; they do not sync between devices.
115
+ Work on Orvyn itself: `npm install`, `npm test`, `npm run dev` (examples playground).
145
116
 
146
- ### Built-in functions
117
+ Try `/lang.html?app=form` for a profile form with input binding, required fields,
118
+ text length rules, email checks, and automatic inline errors. See the forms section in
119
+ [LANGUAGE.md](LANGUAGE.md) for the syntax.
147
120
 
148
- | Function | Does |
149
- |---|---|
150
- | `print(x)` | Log to the console |
151
- | `fetch(url)` | Get data from the internet |
152
- | `go(Screen)` | Open another screen |
153
- | `sleep(ms)` | Wait (use with `wait`) |
154
- | `random(1, 6)` | Random whole number |
155
- | `len(list)` | Number of items |
121
+ ## What we build next
156
122
 
157
- Short functions: `todos.filter(t => t.done)`, `prices.map((p, i) => p * 2)`.
158
- Choose a value: `done ? "Yes" : "No"`.
123
+ The initial production target is small apps with forms, lists, navigation, and
124
+ backend data: task apps, internal tools, dashboards, and similar products.
125
+ Specialized apps may require additional platform capabilities.
159
126
 
160
- ## Values
127
+ Work through the milestones below in order. Each milestone has a completion
128
+ check; adding an API alone does not complete it. Keep the language easy by
129
+ choosing sensible defaults, avoiding repeated setup, and giving actionable errors.
161
130
 
162
- `12`, `3.5`, `"text"`, `"Hi {name}"` (interpolation), `true`, `false`, `null`,
163
- `[1, 2, 3]`, `#1e293b` (colors), `a.b`, `list[0]`, `f(x)`.
131
+ ### 1. State and lifecycle cleanup
164
132
 
165
- Operators: `+ - * / %`, `== != < > <= >=`, `&& || !`.
133
+ - [x] Add unsubscribe/dispose support for signals and effects.
134
+ - [x] Remove obsolete reactive dependencies after an effect runs again.
135
+ - [x] Clean up removed views, their effects, subscriptions, event listeners, and form state.
136
+ - [x] Stop timers and requests started by a screen that was left: its next
137
+ `wait` never finishes. Work from `start { }` keeps running for the whole app.
166
138
 
167
- ## Elements
139
+ **Complete when:** repeatedly mounting, updating, navigating, and removing views
140
+ leaves no active work for removed views, and memory use settles after cleanup.
141
+ Start in `src/core/signal.ts`, `src/runtime/`, and `src/lang/form.ts`.
168
142
 
169
- ### Forms and validation
143
+ Status: done. `src/lang/lifecycle.test.ts` navigates 500 times on web and
144
+ native and checks that nothing piles up, and that waiting work from a left
145
+ screen stops; `src/core/signal.test.ts` covers the reactive core.
170
146
 
171
- Use `bind` to show state in an input and update it when the user types:
147
+ ### 2. Component-local state
172
148
 
173
- ```orv
174
- state name = ""
149
+ - [x] Support state inside a component with a separate value for each instance.
150
+ - [x] Preserve state during updates and keyed list reordering.
151
+ - [x] Define when state resets and dispose it when its component is removed.
175
152
 
176
- screen Home {
177
- Input "Your name", bind: name
178
- }
179
- ```
153
+ **Complete when:** two instances of the same counter work independently, survive
154
+ unrelated updates, and release their state when removed on web and native.
180
155
 
181
- `bind: name` replaces `value: name, onChange: { name = value }`. It works
182
- with state names, one object field (`bind: profile.name`), or a list entry
183
- (`bind: items[0]`), including imported state. Input values are text. Do not
184
- combine `bind` with `value` or `onChange`. For a custom change handler, use the
185
- explicit `value` and `onChange` form instead.
156
+ Status: done. `state` and `let` work at the top of `component` and `screen`
157
+ blocks, preserve values across parent updates and `key:` list reordering, and
158
+ dispose their signals when removed (`src/lang/component-state.test.ts`).
159
+
160
+ ### 3. Production styling
186
161
 
187
- Put inputs inside `Form` and give it an `onSubmit` action. `SubmitButton` runs
188
- that action; the browser form stays on the current page. Ordinary `Button`
189
- elements default to `type: "button"`, so they do not submit a form accidentally.
190
- On native, tapping `SubmitButton` runs the enclosing form's action. Put submission
191
- logic on `Form onSubmit`, rather than adding an `onTap` to `SubmitButton`.
162
+ - [x] Define and document which styling props work on each platform.
163
+ - [x] Make dimensions, percentages, alignment, wrapping, scrolling, and responsive
164
+ layouts behave predictably. Native percentage widths currently become full width.
165
+ - [x] Add reusable theme values for colors, spacing, typography, and dark mode.
166
+ - [x] Support focus, pressed, disabled, loading, and error appearances.
167
+ - [x] Verify custom fonts, text scaling, long text, right-to-left layouts, and
168
+ safe-area behavior. Warn clearly about unsupported styles.
192
169
 
193
- Put rules directly on your inputs. Orvyn displays field errors and runs your
194
- submit action only when every field passes. You do not need an errors state,
195
- a separate rules object, or a validation function for this:
170
+ **Complete when:** a shared example UI passes visual and interaction checks on
171
+ desktop, tablet, iPhone, and Android, including large text and light/dark themes.
172
+ Start in `src/styling/`, `src/runtime/style.ts`, and the native renderers.
196
173
 
197
- ```orv
198
- state profile = { name: "", email: "" }
174
+ Status: done. `src/styling/spec.ts`, `src/styling/fluid.ts`, `src/runtime/`,
175
+ `OrvynViews.swift`, and `OrvynRenderer.kt` implement the shared style matrix,
176
+ native percentage widths, wrapping/scrolling/justify, light/dark themes,
177
+ interactive states, and unsupported-style warnings; `examples/style.orv` and
178
+ `src/styling/styling.test.ts` verify web and native builds.
199
179
 
200
- fn save() {
201
- print("Ready to save", profile)
202
- }
180
+ ### 4. Complete navigation
203
181
 
204
- screen Home {
205
- Form gap: 12, padding: 24, onSubmit: save {
206
- Input "Name", bind: profile.name, required: true, minLength: 2
207
- Input "Email", bind: profile.email, type: "email", required: true
208
- SubmitButton "Save"
209
- }
210
- }
211
- ```
182
+ - [x] Add screen parameters, browser URLs, deep links, and navigation history.
183
+ - [x] Support browser back/forward and mobile back behavior.
184
+ - [x] Define screen-state preservation and reset behavior.
212
185
 
213
- Errors appear after the first submission attempt. After that, they update as
214
- users edit the fields. `type: "email"` also enables email validation and requests
215
- an email keyboard in the generated iOS and Android apps. For a friendlier error,
216
- add `label: "Full name"` or `message: "Please enter your full name"` to the input.
217
- The placeholder is the default label used in automatic error messages.
186
+ **Complete when:** list/detail navigation works through direct links, refresh,
187
+ back, and forward without unexpected state loss or leftover subscriptions.
218
188
 
219
- Use `bind` for these fields, or explicit `value` and `onChange` props. A validated
220
- input needs an update handler. Separate forms keep their own errors. If you render
221
- repeated forms with the same state, give each Form a distinct string or numeric
222
- `key` to keep their validation state separate. Do not nest forms.
189
+ Status: done. `src/lang/router.ts`, `src/lang/runtime.ts`, `src/lang/native-runtime.ts`,
190
+ and the iOS/Android templates support screen parameters (`go(Detail, id)`), hash/path
191
+ URLs and deep links, browser `popstate` back/forward, mobile back (`back()`,
192
+ `canGoBack()`, Android Back button, iOS edge swipe), and per-visit screen reset;
193
+ verified in `src/lang/navigation.test.ts` and `examples/nav.orv`.
223
194
 
224
- For complete control of your own validation UI, `validate()` remains available.
225
- See `examples/form-manual.orv` for the explicit version with a rules object and
226
- manual error rendering.
195
+ ### 5. Async work and recovery
227
196
 
228
- `validate(values, rules)` returns `{ valid, errors }`. `valid` is true when
229
- every field passes. `errors` contains one message per failing field and no entry
230
- for passing fields. The same validator runs on web, iOS, and Android.
197
+ - [x] Provide simple loading, success, empty, and error states.
198
+ - [x] Support error handling, timeouts, cancellation, and explicit retries.
199
+ - [x] Prevent stale responses from replacing newer data and handle duplicate
200
+ submissions while an operation is pending.
231
201
 
232
- | Rule | Meaning |
233
- |---|---|
234
- | `required: true` | Reject missing, null, empty, or whitespace-only text. |
235
- | `minLength: 2` | Require at least this many Unicode code points. |
236
- | `maxLength: 40` | Allow at most this many Unicode code points. |
237
- | `email: true` | Check a basic email format; does not verify the mailbox exists. |
238
- | `label: "Name"` | Use this name in default messages, such as “Name is required.” |
239
- | `message: "Enter your name"` | Replace the default message for this field. |
240
-
241
- Validation checks trimmed text without changing your state. Optional empty fields
242
- skip length and email checks. Length limits are non-negative whole numbers;
243
- unknown or invalid rules produce an error explaining what to fix. These rules
244
- validate text fields; numeric and cross-field rules are not included yet.
245
-
246
- Standalone `validate()` runs only when called. Forms with inline input rules
247
- handle submission checks and error display automatically.
248
- To try the complete example, run `npm run dev` here and open `/lang.html?app=form`.
249
- The example validates locally; it does not send data to a server.
250
-
251
- `Element firstArgument, name: value, name: value { children }`
252
-
253
- | Element | First argument | Renders as |
254
- |---|---|---|
255
- | `Column` | — | vertical stack |
256
- | `Row` | — | horizontal stack |
257
- | `Box` | — | container |
258
- | `Text`, `Heading` | text | text |
259
- | `Button` | label | button |
260
- | `Form` | — | form container with `onSubmit` |
261
- | `SubmitButton` | label | submits the enclosing form |
262
- | `Input` | placeholder | text field |
263
- | `Image` | source URL | image |
264
- | `Link` | text | link (`href: "..."`) |
265
-
266
- Style props: `bg`, `color`, `size`, `padding`, `margin`, `gap`, `radius`, `width`,
267
- `height`, `align`, `justify`, `border`, `shadow`, and the rest of Orvyn's style props.
268
- Plain words like `black` or `center` are treated as text.
269
-
270
- Events: `onTap`, `onChange`, `onSubmit`, `onHover`, `onLeave`. Give a function name,
271
- one statement, or a block:
272
-
273
- ```orv
274
- Button "Add", onTap: increment
275
- Button "-1", onTap: count -= 1
276
- Input "Name", onChange: { name = value } // value = the typed text
277
- ```
202
+ **Complete when:** slow, failed, interrupted, and out-of-order requests behave
203
+ predictably, with a visible recovery path and no updates to removed screens.
278
204
 
279
- Inside a view you can use `if` / `else` and `for item in list { ... }`.
205
+ Status: done. `src/lang/runtime-shared.ts`, `src/lang/runtime.ts`, `src/lang/native-runtime.ts`,
206
+ `src/lang/form.ts`, `src/runtime/patch.ts`, `src/runtime/mount.ts`, and `OrvynEngine.swift` /
207
+ `OrvynEngine.kt` provide `load` & `task` states (`loading`, `success`, `empty`, `error`,
208
+ `cancelled`, `retry()`, `cancel()`), `try/catch`, request timeouts and native/web abort,
209
+ automatic retry options, stale-response protection, and duplicate-tap / duplicate-submit
210
+ guards; verified in `src/lang/async-recovery.test.ts` and `examples/data.orv`.
280
211
 
281
- ### Screens and navigation
212
+ ### 6. Reliable storage
282
213
 
283
- ```orv
284
- screen Home {
285
- Button "About", onTap: go(About)
286
- }
214
+ - [x] Namespace saved state by app and module to prevent key collisions.
215
+ - [x] Add data versions, migrations, reset behavior, and visible storage failures.
216
+ - [x] Provide a separate secure-storage integration for credentials; ordinary
217
+ saved state is not a secure credential store.
287
218
 
288
- screen About {
289
- Button "Back", onTap: go(Home)
290
- }
291
- ```
219
+ **Complete when:** an app update preserves or migrates existing user data, and
220
+ missing, corrupted, or unavailable storage has tested recovery behavior.
292
221
 
293
- `App` (or the first screen in the file) opens first.
222
+ Status: done. `src/lang/runtime-shared.ts`, `src/lang/runtime.ts`, `src/lang/native-runtime.ts`,
223
+ `src/lang/parser.ts`, `src/lang/codegen.ts`, `src/lang/vite-plugin.ts`, `src/lang/bundle-native.ts`,
224
+ and `OrvynEngine.swift` / `OrvynEngine.kt` provide app+module key namespacing, `saved(version, migrate)`,
225
+ `.reset()` / `storage.resetAll()`, reactive `storage.error`, and separate `secure` storage
226
+ (iOS Keychain, Android KeyStore AES-GCM, web `sessionStorage` with security notice); verified in
227
+ `src/lang/storage.test.ts` and `examples/storage.orv`.
294
228
 
295
- ## Editor colours (VS Code)
229
+ ### 7. Browser and device verification
296
230
 
297
- Install **Orvyn Language** from the VS Code Extensions panel.
231
+ - [ ] Add real-browser end-to-end tests for the supported browser matrix.
232
+ - [ ] Run interaction tests on iOS and Android simulators and real devices.
233
+ - [ ] Check keyboard/focus behavior, accessibility, background/resume, offline
234
+ behavior, large lists, and extended use.
235
+ - [ ] Run required checks in CI and retain results for release candidates.
298
236
 
299
- ## Errors
237
+ **Complete when:** supported user journeys pass on the documented platform matrix,
238
+ including failure scenarios. Simulated-host tests remain useful but do not replace
239
+ browser or device testing.
300
240
 
301
- The compiler stops at the first error and shows the line:
241
+ ### 8. Production builds and releases
302
242
 
303
- ```
304
- ✗ app.orv:4:3
305
- Unknown element "Buton". Available: Column, Row, Box, Text, ...
243
+ - [ ] Verify signed iOS device archives and Android release APK/AAB workflows.
244
+ - [ ] Make clean-install builds reproducible with pinned dependencies and tools.
245
+ - [ ] Separate development and production configuration, package the runtime,
246
+ and verify installation in a fresh consumer project.
247
+ - [ ] Document app versioning, upgrades, crash diagnostics, and release recovery.
306
248
 
307
- 4 | Buton "x"
308
- | ^
309
- ```
249
+ **Complete when:** a fresh checkout produces documented release artifacts that can
250
+ be installed and updated on real devices. The current CLI builds an unsigned iOS
251
+ simulator app and an Android debug APK when the required tools are installed.
310
252
 
311
- ## Not in v0.1 yet
253
+ ### 9. Stable language and developer tools
254
+
255
+ - [ ] Specify binding, mutation, imports, async behavior, and component semantics.
256
+ - [ ] Expand execution tests for valid programs and diagnostics for invalid ones.
257
+ - [ ] Add source maps, formatting, autocomplete, and inline diagnostics.
258
+ - [ ] Document supported Node/platform versions, compatibility policy, and
259
+ migration steps for breaking changes.
260
+
261
+ **Complete when:** a developer can install Orvyn, build the documented examples,
262
+ find errors in their `.orv` source, and upgrade using a tested migration guide.
263
+
264
+ ## Production acceptance app
265
+
266
+ After the milestones, build and release one complete reference app with login,
267
+ backend data, list/detail editing, forms, persistence, and loading/error states.
268
+ Use existing backend/auth services through documented integrations where useful.
269
+ Add uploads, notifications, payments, or other device APIs when the target app
270
+ requires them.
271
+
272
+ - [ ] Test installation, normal use, failures, logout, and an app/data upgrade.
273
+ - [ ] Verify release builds on web, real iPhones, and real Android devices.
274
+ - [ ] Have a small external pilot group use the app and resolve blocking issues.
275
+ - [ ] Publish the supported capabilities, known limitations, and test evidence.
312
276
 
313
- - Native: `Image` sizes, `justify`, and hover events are basic on phones
314
- - Live reload is iPhone-only for now (Android: `orvyn android` rebuilds)
315
- - `state` inside components (keep state at the top of the file for now)
316
- - Browser back button with `go()`
317
- - `while` loops
277
+ Declare the initial production scope only after this acceptance app passes.
278
+ Maintainability, reliability, and a verified release path matter alongside syntax.
@@ -0,0 +1,15 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" class="asunset"><style>
2
+ .asunset .s{opacity:0;stroke-dasharray:29.3;stroke-dashoffset:29.3;animation:asunsetdraw 3.6s cubic-bezier(.65,0,.35,1) infinite}
3
+ .asunset .s1{animation-delay:0s} .asunset .s2{animation-delay:.18s} .asunset .s3{animation-delay:.36s}
4
+ .asunset .ring{transform-origin:32px 32px;animation:asunsetspin 3.6s cubic-bezier(.65,0,.35,1) infinite}
5
+ .asunset .dot{transform-origin:32px 32px;transform:scale(0);animation:asunsetpop 3.6s cubic-bezier(.34,1.56,.64,1) infinite}
6
+ @keyframes asunsetdraw{0%{stroke-dashoffset:29.3;opacity:0}6%{opacity:1}22%,82%{stroke-dashoffset:0}94%{opacity:1}100%{stroke-dashoffset:29.3;opacity:0}}
7
+ @keyframes asunsetspin{0%,38%{transform:rotate(0)}56%,100%{transform:rotate(120deg)}}
8
+ @keyframes asunsetpop{0%,24%{transform:scale(0)}34%{transform:scale(1.35)}40%,82%{transform:scale(1)}92%,100%{transform:scale(0)}}
9
+ @media (prefers-reduced-motion:reduce){.asunset *{animation:none!important;stroke-dashoffset:0!important;transform:none!important}}
10
+ </style>
11
+ <defs><linearGradient id="bgasunset" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#14141f"/><stop offset="1" stop-color="#05050a"/></linearGradient></defs>
12
+ <rect x="2" y="2" width="60" height="60" rx="16" fill="url(#bgasunset)"/>
13
+ <g class="ring"><path class="s s1" d="M33.05 17.04 A15 15 0 0 1 45.48 38.58" fill="none" stroke="#fde68a" stroke-width="9" stroke-linecap="round"/><path class="s s2" d="M44.44 40.39 A15 15 0 0 1 19.56 40.39" fill="none" stroke="#fb923c" stroke-width="9" stroke-linecap="round"/><path class="s s3" d="M18.52 38.58 A15 15 0 0 1 30.95 17.04" fill="none" stroke="#e11d48" stroke-width="9" stroke-linecap="round"/></g>
14
+ <circle class="dot" cx="32" cy="32" r="3.4" fill="#fff"/>
15
+ </svg>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orvyn-lang",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "Orvyn — one language for web, iPhone and Android. Write .orv files once, get a website and native apps.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -16,7 +16,9 @@
16
16
  },
17
17
  "files": [
18
18
  "src",
19
+ "brand/orvyn-sunset-animated.svg",
19
20
  "README.md",
21
+ "GUIDE.md",
20
22
  "LANGUAGE.md",
21
23
  "LICENSE"
22
24
  ],