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.
- package/GUIDE.md +149 -0
- package/LANGUAGE.md +744 -27
- package/README.md +211 -250
- package/brand/orvyn-sunset-animated.svg +15 -0
- package/package.json +3 -1
- package/src/cli/orvyn.js +186 -10
- package/src/core/signal.js +104 -6
- package/src/devtools/runtime.js +25 -1
- package/src/lang/a11y.js +102 -0
- package/src/lang/auth.js +239 -0
- package/src/lang/bundle-native.js +10 -6
- package/src/lang/codegen.js +428 -57
- package/src/lang/device.js +41 -0
- package/src/lang/doctor.js +60 -0
- package/src/lang/env.js +27 -0
- package/src/lang/errors.js +513 -0
- package/src/lang/form.js +69 -8
- package/src/lang/index.js +2 -1
- package/src/lang/lexer.js +2 -0
- package/src/lang/list.js +44 -0
- package/src/lang/native/android/MainActivity.kt +43 -4
- package/src/lang/native/android/OrvynDevice.kt +163 -0
- package/src/lang/native/android/OrvynEngine.kt +154 -7
- package/src/lang/native/android/OrvynRenderer.kt +518 -44
- package/src/lang/native/android.js +74 -11
- package/src/lang/native/build.js +130 -60
- package/src/lang/native/config.js +108 -0
- package/src/lang/native/ios/OrvynApp.swift +6 -0
- package/src/lang/native/ios/OrvynEngine.swift +266 -4
- package/src/lang/native/ios/OrvynViews.swift +429 -34
- package/src/lang/native/ios.js +75 -2
- package/src/lang/native-runtime.js +406 -56
- package/src/lang/page.js +52 -0
- package/src/lang/parser.js +243 -15
- package/src/lang/prerender.js +300 -0
- package/src/lang/read-import.js +11 -0
- package/src/lang/router.js +266 -0
- package/src/lang/runtime-shared.js +792 -10
- package/src/lang/runtime.js +362 -52
- package/src/lang/select.js +13 -0
- package/src/lang/server-code.js +233 -0
- package/src/lang/server-export.js +78 -0
- package/src/lang/server-libs.js +53 -0
- package/src/lang/server.js +409 -0
- package/src/lang/test-runner.js +134 -0
- package/src/lang/types.js +312 -0
- package/src/lang/vite-plugin.js +82 -3
- package/src/lang/web-overlay.js +578 -0
- package/src/lang/widgets.js +94 -0
- package/src/lang/words.js +38 -0
- package/src/runtime/mount.js +116 -27
- package/src/runtime/patch.js +90 -11
- package/src/runtime/style.js +11 -1
- package/src/styling/fluid.js +91 -4
- 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
|
|
11
|
-
orvyn ios
|
|
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
|
-
|
|
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
|
-
|
|
21
|
+
Install a package in **your app folder**, then import it with `use`:
|
|
27
22
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
-
```
|
|
50
|
-
|
|
51
|
-
use count from "./store"
|
|
28
|
+
```orvyn
|
|
29
|
+
use dayjs from "dayjs"
|
|
52
30
|
|
|
53
31
|
screen Home {
|
|
54
|
-
|
|
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
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
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
|
-
|
|
47
|
+
## What you can build
|
|
79
48
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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
|
-
```
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
113
|
-
users = wait fetch("https://api.example.com/users")
|
|
114
|
-
}
|
|
115
|
-
```
|
|
86
|
+
## Current status
|
|
116
87
|
|
|
117
|
-
|
|
118
|
-
|
|
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
|
-
|
|
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
|
-
|
|
127
|
-
state
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
158
|
-
|
|
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
|
-
|
|
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
|
-
|
|
163
|
-
`[1, 2, 3]`, `#1e293b` (colors), `a.b`, `list[0]`, `f(x)`.
|
|
131
|
+
### 1. State and lifecycle cleanup
|
|
164
132
|
|
|
165
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
147
|
+
### 2. Component-local state
|
|
172
148
|
|
|
173
|
-
|
|
174
|
-
state
|
|
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
|
-
|
|
177
|
-
|
|
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
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
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
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
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
|
-
|
|
194
|
-
|
|
195
|
-
|
|
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
|
-
|
|
198
|
-
|
|
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
|
-
|
|
201
|
-
print("Ready to save", profile)
|
|
202
|
-
}
|
|
180
|
+
### 4. Complete navigation
|
|
203
181
|
|
|
204
|
-
screen
|
|
205
|
-
|
|
206
|
-
|
|
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
|
-
|
|
214
|
-
|
|
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
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
`
|
|
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
|
-
|
|
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
|
-
|
|
229
|
-
|
|
230
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
###
|
|
212
|
+
### 6. Reliable storage
|
|
282
213
|
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
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
|
-
|
|
289
|
-
|
|
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
|
-
|
|
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
|
-
|
|
229
|
+
### 7. Browser and device verification
|
|
296
230
|
|
|
297
|
-
|
|
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
|
-
|
|
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
|
-
|
|
241
|
+
### 8. Production builds and releases
|
|
302
242
|
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
314
|
-
|
|
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.
|
|
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
|
],
|