@jskit-ai/agent-docs 0.1.131 → 0.1.132
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/agent/app-extras/assistant.md +29 -605
- package/guide/agent/app-extras/mobile-capacitor.md +29 -362
- package/guide/agent/app-extras/realtime.md +29 -277
- package/guide/agent/app-setup/a-more-interesting-shell.md +44 -815
- package/guide/agent/app-setup/authentication.md +43 -1073
- package/guide/agent/app-setup/console.md +26 -298
- package/guide/agent/app-setup/database-layer.md +110 -790
- package/guide/agent/app-setup/initial-scaffolding.md +50 -784
- package/guide/agent/app-setup/multi-homing.md +39 -712
- package/guide/agent/app-setup/quickstart.md +43 -179
- package/guide/agent/app-setup/users.md +34 -353
- package/guide/agent/index.md +16 -23
- package/package.json +2 -2
- package/patterns/INDEX.md +7 -7
- package/patterns/child-cruds.md +3 -3
- package/patterns/client-requests.md +6 -6
- package/patterns/crud-authoring.md +94 -0
- package/patterns/crud-links.md +1 -1
- package/patterns/feature-package/PATTERN.md +108 -0
- package/patterns/feature-package/example/booking-engine/package.json +48 -0
- package/patterns/feature-package/example/booking-engine/src/server/BookingEngineProvider.js +33 -0
- package/patterns/feature-package/example/booking-engine/src/server/actions.js +26 -0
- package/patterns/feature-package/example/booking-engine/src/server/inputSchemas.js +19 -0
- package/patterns/feature-package/example/variations/AvailabilityEngineProvider.js +31 -0
- package/patterns/feature-package/example/variations/InvoiceRollupProvider.js +36 -0
- package/patterns/feature-package/example/variations/customKnexRepository.js +34 -0
- package/patterns/feature-package/example/variations/orchestratorService.js +23 -0
- package/patterns/filters.md +8 -8
- package/patterns/live-actions.md +5 -18
- package/patterns/minimal-foundation/PATTERN.md +98 -0
- package/patterns/minimal-foundation/example/.nvmrc +1 -0
- package/patterns/minimal-foundation/example/AGENTS.md +17 -0
- package/patterns/minimal-foundation/example/Procfile +2 -0
- package/patterns/minimal-foundation/example/app.json +14 -0
- package/patterns/minimal-foundation/example/bin/develop.js +71 -0
- package/patterns/minimal-foundation/example/bin/server.js +8 -0
- package/patterns/minimal-foundation/example/config/public.js +40 -0
- package/patterns/minimal-foundation/example/config/server.js +1 -0
- package/patterns/minimal-foundation/example/config/surfaceAccessPolicies.js +3 -0
- package/patterns/minimal-foundation/example/eslint.config.mjs +19 -0
- package/patterns/minimal-foundation/example/favicon.svg +7 -0
- package/patterns/minimal-foundation/example/gitignore +9 -0
- package/patterns/minimal-foundation/example/index.html +13 -0
- package/patterns/minimal-foundation/example/jsconfig.json +8 -0
- package/patterns/minimal-foundation/example/package.json +57 -0
- package/patterns/minimal-foundation/example/packages/main/package.json +42 -0
- package/patterns/minimal-foundation/example/packages/main/src/shared/index.js +10 -0
- package/patterns/minimal-foundation/example/packages/main/src/shared/schemas/index.js +22 -0
- package/patterns/minimal-foundation/example/playwright.config.mjs +31 -0
- package/patterns/minimal-foundation/example/server/lib/runtimeEnv.js +45 -0
- package/patterns/minimal-foundation/example/server/lib/surfaceRuntime.js +10 -0
- package/patterns/minimal-foundation/example/server.js +195 -0
- package/patterns/minimal-foundation/example/src/App.vue +13 -0
- package/patterns/minimal-foundation/example/src/main.js +85 -0
- package/patterns/minimal-foundation/example/src/pages/home/index.vue +48 -0
- package/patterns/minimal-foundation/example/src/pages/home.vue +13 -0
- package/patterns/minimal-foundation/example/src/views/NotFound.vue +13 -0
- package/patterns/minimal-foundation/example/tests/client/smoke.vitest.js +7 -0
- package/patterns/minimal-foundation/example/tests/e2e/base-shell.spec.ts +23 -0
- package/patterns/minimal-foundation/example/tests/server/smoke.test.js +16 -0
- package/patterns/minimal-foundation/example/vite.config.mjs +81 -0
- package/patterns/page-scaffolding.md +20 -17
- package/patterns/placements.md +17 -15
- package/patterns/row-policies.md +4 -5
- package/patterns/server-search.md +3 -3
- package/patterns/shell-foundation/PATTERN.md +104 -0
- package/patterns/shell-foundation/example/.nvmrc +1 -0
- package/patterns/shell-foundation/example/AGENTS.md +17 -0
- package/patterns/shell-foundation/example/Procfile +2 -0
- package/patterns/shell-foundation/example/app.json +14 -0
- package/patterns/shell-foundation/example/bin/develop.js +71 -0
- package/patterns/shell-foundation/example/bin/server.js +8 -0
- package/patterns/shell-foundation/example/config/public.js +40 -0
- package/patterns/shell-foundation/example/config/server.js +1 -0
- package/patterns/shell-foundation/example/config/surfaceAccessPolicies.js +3 -0
- package/patterns/shell-foundation/example/eslint.config.mjs +19 -0
- package/patterns/shell-foundation/example/favicon.svg +7 -0
- package/patterns/shell-foundation/example/gitignore +9 -0
- package/patterns/shell-foundation/example/index.html +13 -0
- package/patterns/shell-foundation/example/jsconfig.json +8 -0
- package/patterns/shell-foundation/example/package.json +59 -0
- package/patterns/shell-foundation/example/packages/main/package.json +56 -0
- package/patterns/shell-foundation/example/packages/main/src/client/index.js +9 -0
- package/patterns/shell-foundation/example/packages/main/src/client/providers/MainClientProvider.js +18 -0
- package/patterns/shell-foundation/example/packages/main/src/shared/index.js +10 -0
- package/patterns/shell-foundation/example/packages/main/src/shared/schemas/index.js +22 -0
- package/patterns/shell-foundation/example/playwright.config.mjs +31 -0
- package/patterns/shell-foundation/example/server/lib/runtimeEnv.js +45 -0
- package/patterns/shell-foundation/example/server/lib/surfaceRuntime.js +10 -0
- package/patterns/shell-foundation/example/server.js +195 -0
- package/patterns/shell-foundation/example/src/App.vue +11 -0
- package/patterns/shell-foundation/example/src/components/ShellLayout.vue +12 -0
- package/patterns/shell-foundation/example/src/components/menus/MenuLinkItem.vue +30 -0
- package/patterns/shell-foundation/example/src/components/menus/SurfaceAwareMenuLinkItem.vue +42 -0
- package/patterns/shell-foundation/example/src/components/menus/TabLinkItem.vue +42 -0
- package/patterns/shell-foundation/example/src/error.js +19 -0
- package/patterns/shell-foundation/example/src/main.js +85 -0
- package/patterns/shell-foundation/example/src/pages/home/index.vue +116 -0
- package/patterns/shell-foundation/example/src/pages/home/settings/general/index.vue +40 -0
- package/patterns/shell-foundation/example/src/pages/home/settings/index.vue +7 -0
- package/patterns/shell-foundation/example/src/pages/home/settings.vue +109 -0
- package/patterns/shell-foundation/example/src/pages/home.vue +20 -0
- package/patterns/shell-foundation/example/src/placement.js +56 -0
- package/patterns/shell-foundation/example/src/placementTopology.js +149 -0
- package/patterns/shell-foundation/example/src/views/NotFound.vue +13 -0
- package/patterns/shell-foundation/example/tests/client/smoke.vitest.js +7 -0
- package/patterns/shell-foundation/example/tests/e2e/adaptive-shell.spec.ts +10 -0
- package/patterns/shell-foundation/example/tests/e2e/base-shell.spec.ts +23 -0
- package/patterns/shell-foundation/example/tests/server/smoke.test.js +16 -0
- package/patterns/shell-foundation/example/vite.config.mjs +81 -0
- package/patterns/ui-contract.md +56 -0
- package/patterns/ui-testing.md +10 -12
- package/reference/autogen/KERNEL_MAP.md +29 -107
- package/reference/autogen/PATTERN_INDEX.md +230 -0
- package/reference/autogen/README.md +4 -8
- package/reference/autogen/packages/agent-docs.md +259 -0
- package/reference/autogen/packages/assistant-core.md +3 -3
- package/reference/autogen/packages/assistant-runtime.md +32 -17
- package/reference/autogen/packages/auth-core.md +31 -33
- package/reference/autogen/packages/auth-provider-local-core.md +4 -12
- package/reference/autogen/packages/auth-provider-local-db-core.md +4 -4
- package/reference/autogen/packages/auth-provider-supabase-core.md +14 -18
- package/reference/autogen/packages/auth-web.md +42 -22
- package/reference/autogen/packages/console-core.md +8 -25
- package/reference/autogen/packages/console-web.md +5 -5
- package/reference/autogen/packages/crud-core.md +61 -17
- package/reference/autogen/packages/database-runtime-mysql.md +12 -2
- package/reference/autogen/packages/database-runtime-postgres.md +12 -2
- package/reference/autogen/packages/database-runtime.md +26 -25
- package/reference/autogen/packages/google-rewarded-core.md +19 -104
- package/reference/autogen/packages/http-runtime.md +4 -8
- package/reference/autogen/packages/http-web.md +32 -0
- package/reference/autogen/packages/json-rest-api-core.md +4 -6
- package/reference/autogen/packages/kernel.md +109 -390
- package/reference/autogen/packages/mobile-capacitor.md +2 -13
- package/reference/autogen/packages/realtime.md +29 -26
- package/reference/autogen/packages/resource-crud-core.md +6 -0
- package/reference/autogen/packages/shell-web.md +69 -54
- package/reference/autogen/packages/storage-runtime.md +3 -3
- package/reference/autogen/packages/uploads-image-web.md +0 -1
- package/reference/autogen/packages/uploads-runtime.md +3 -3
- package/reference/autogen/packages/users-core.md +45 -90
- package/reference/autogen/packages/users-web.md +5 -7
- package/reference/autogen/packages/workspaces-core.md +53 -74
- package/reference/autogen/packages/workspaces-web.md +15 -16
- package/reference/autogen/tooling/jskit-catalog.md +34 -0
- package/reference/autogen/tooling/testUtils.md +4 -4
- package/skills/jskit/SKILL.md +34 -29
- package/skills/jskit/references/app-operations.md +68 -53
- package/skills/jskit/references/crud-operations.md +58 -106
- package/skills/jskit/references/material-3.md +1 -1
- package/skills/jskit/references/ui-operations.md +41 -44
- package/templates/app/AGENTS.md +7 -3
- package/guide/agent/app-setup/upgrade-beta-1-to-final.md +0 -252
- package/guide/agent/app-setup/working-with-the-jskit-cli.md +0 -325
- package/guide/agent/generators/advanced-cruds.md +0 -1935
- package/guide/agent/generators/crud-generators.md +0 -948
- package/guide/agent/generators/intro.md +0 -65
- package/guide/agent/generators/row-policies.md +0 -537
- package/guide/agent/generators/ui-generators.md +0 -690
- package/patterns/crud-scaffolding.md +0 -198
- package/patterns/generated-ui-contract-tracking.md +0 -66
- package/reference/autogen/packages/assistant.md +0 -68
- package/reference/autogen/packages/crud-server-generator.md +0 -215
- package/reference/autogen/packages/crud-ui-generator.md +0 -192
- package/reference/autogen/packages/feature-server-generator.md +0 -65
- package/reference/autogen/packages/ui-generator.md +0 -127
- package/reference/autogen/tooling/create-app.md +0 -317
- package/reference/autogen/tooling/jskit-cli.md +0 -933
- package/reference/autogen/tooling/test-support.md +0 -27
|
@@ -2,380 +2,47 @@
|
|
|
2
2
|
|
|
3
3
|
# Mobile Capacitor
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
Capacitor shell.
|
|
7
|
-
|
|
8
|
-
The normal result is:
|
|
9
|
-
|
|
10
|
-
- your JSKIT web app runs inside an Android shell
|
|
11
|
-
- the app can talk to your backend
|
|
12
|
-
- deep links and auth callback routing still go through normal JSKIT routes
|
|
13
|
-
- you can rebuild, reinstall, tunnel, and restart with `jskit mobile ...`
|
|
14
|
-
|
|
15
|
-
## Install it
|
|
16
|
-
|
|
17
|
-
From the app root:
|
|
18
|
-
|
|
19
|
-
```bash
|
|
20
|
-
npx jskit add package @jskit-ai/mobile-capacitor
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
That command:
|
|
24
|
-
|
|
25
|
-
- installs `@jskit-ai/mobile-capacitor`
|
|
26
|
-
- installs the required Capacitor packages
|
|
27
|
-
- seeds `config.mobile` if it is missing
|
|
28
|
-
- renders `capacitor.config.json`
|
|
29
|
-
- provisions `android/`
|
|
30
|
-
- refreshes the managed Android shell files from `config.mobile`
|
|
31
|
-
|
|
32
|
-
After that, run:
|
|
33
|
-
|
|
34
|
-
```bash
|
|
35
|
-
npx jskit mobile android doctor
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
If doctor passes, the app is ready for the normal mobile workflow.
|
|
39
|
-
The `jskit mobile android ...` commands expect
|
|
40
|
-
`@jskit-ai/mobile-capacitor` in the installed npm graph; they do not install the
|
|
41
|
-
runtime package for you.
|
|
42
|
-
|
|
43
|
-
## What you need on your machine
|
|
44
|
-
|
|
45
|
-
::: tip Required Host Tools
|
|
46
|
-
Before this workflow is healthy, the machine needs all of the following:
|
|
47
|
-
|
|
48
|
-
- `adb` on `PATH`
|
|
49
|
-
- Android SDK installed, with the required platform and build-tools
|
|
50
|
-
- a full JDK, not just a runtime
|
|
51
|
-
- `java` on `PATH`
|
|
52
|
-
- `javac` on `PATH`
|
|
53
|
-
- `ANDROID_HOME` or `ANDROID_SDK_ROOT` set, or `android/local.properties` with `sdk.dir=...`
|
|
54
|
-
- `JAVA_HOME` pointing at a full JDK if `java` / `javac` are not already resolved correctly from `PATH`
|
|
55
|
-
|
|
56
|
-
The end state should be:
|
|
57
|
-
|
|
58
|
-
- `adb devices -l` works
|
|
59
|
-
- `java -version` works
|
|
60
|
-
- `javac -version` works
|
|
61
|
-
- `npx jskit mobile android doctor` passes
|
|
62
|
-
:::
|
|
63
|
-
|
|
64
|
-
If you installed Android Studio, its bundled JDK is often the easiest working
|
|
65
|
-
Java home:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
export JAVA_HOME="$HOME/android-studio/jbr"
|
|
69
|
-
export PATH="$JAVA_HOME/bin:$PATH"
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## Put the app on your phone
|
|
73
|
-
|
|
74
|
-
Start the backend first:
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
PORT=3000 npm run server
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
Then use the all-in-one command:
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
npx jskit mobile android dev
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
This is the one-stop shop for local Android phone testing.
|
|
87
|
-
|
|
88
|
-
It runs these commands in this exact order:
|
|
89
|
-
|
|
90
|
-
```bash
|
|
91
|
-
npx jskit mobile android sync
|
|
92
|
-
npx jskit mobile android tunnel
|
|
93
|
-
npx jskit mobile android run
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
That first step is important: for bundled apps, `npx jskit mobile android sync` runs `npm run build` first and then runs `cap sync android`. So yes, `npx jskit mobile android dev` does build the app before it installs/runs the Android shell.
|
|
97
|
-
|
|
98
|
-
If more than one Android device is attached:
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
npx jskit mobile android devices
|
|
102
|
-
npx jskit mobile android dev --target <device-id>
|
|
103
|
-
```
|
|
104
|
-
|
|
105
|
-
That is the shortest path.
|
|
106
|
-
|
|
107
|
-
## Manual commands
|
|
108
|
-
|
|
109
|
-
If you want to run the steps yourself instead of using `mobile android dev`,
|
|
110
|
-
these are the commands that matter.
|
|
111
|
-
|
|
112
|
-
### List devices
|
|
113
|
-
|
|
114
|
-
```bash
|
|
115
|
-
npx jskit mobile android devices
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Prints the Android devices currently visible to `adb`.
|
|
119
|
-
|
|
120
|
-
### Sync the Android shell
|
|
121
|
-
|
|
122
|
-
```bash
|
|
123
|
-
npx jskit mobile android sync
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
This:
|
|
127
|
-
|
|
128
|
-
- refreshes the managed mobile files from `config.mobile`
|
|
129
|
-
- builds the JSKIT web app into `dist/`
|
|
130
|
-
- runs `cap sync android`
|
|
131
|
-
|
|
132
|
-
The refresh step requires the managed files from the package install to exist.
|
|
133
|
-
If `capacitor.config.json` or `.jskit/mobile-capacitor.md` is missing, install
|
|
134
|
-
the package again with `npx jskit add package @jskit-ai/mobile-capacitor`.
|
|
135
|
-
|
|
136
|
-
### Create the local tunnel
|
|
137
|
-
|
|
138
|
-
```bash
|
|
139
|
-
npx jskit mobile android tunnel
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
If you want a specific device:
|
|
143
|
-
|
|
144
|
-
```bash
|
|
145
|
-
npx jskit mobile android tunnel --target <device-id>
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
This command creates the `adb reverse` tunnel that lets the phone reach your
|
|
149
|
-
laptop's local backend.
|
|
150
|
-
|
|
151
|
-
### Install and run the app
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
npx jskit mobile android run
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
Or:
|
|
5
|
+
Use `@jskit-ai/mobile-capacitor` when the web application should run inside a
|
|
6
|
+
Capacitor Android shell.
|
|
158
7
|
|
|
159
8
|
```bash
|
|
160
|
-
|
|
9
|
+
npm install @jskit-ai/mobile-capacitor \
|
|
10
|
+
@capacitor/android @capacitor/app @capacitor/cli
|
|
161
11
|
```
|
|
162
12
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
### Restart cleanly
|
|
166
|
-
|
|
167
|
-
```bash
|
|
168
|
-
npx jskit mobile android restart
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
Or:
|
|
172
|
-
|
|
173
|
-
```bash
|
|
174
|
-
npx jskit mobile android restart --target <device-id>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
This:
|
|
178
|
-
|
|
179
|
-
- clears app data
|
|
180
|
-
- force-stops the Android app
|
|
181
|
-
- cold-starts `MainActivity`
|
|
182
|
-
|
|
183
|
-
Use it when you want a clean signed-out state.
|
|
184
|
-
|
|
185
|
-
## The command set
|
|
186
|
-
|
|
187
|
-
These are the CLI mobile commands used by the package workflow:
|
|
188
|
-
|
|
189
|
-
- `jskit mobile android devices`
|
|
190
|
-
- list visible Android devices
|
|
191
|
-
- `jskit mobile android doctor`
|
|
192
|
-
- validate config, shell files, SDK, and host readiness
|
|
193
|
-
- `jskit mobile android dev`
|
|
194
|
-
- run the standard local-phone development flow
|
|
195
|
-
- `jskit mobile android sync`
|
|
196
|
-
- rebuild and sync the Android shell
|
|
197
|
-
- `jskit mobile android tunnel`
|
|
198
|
-
- create and verify the `adb reverse` tunnel
|
|
199
|
-
- `jskit mobile android run`
|
|
200
|
-
- launch the Android shell
|
|
201
|
-
- `jskit mobile android restart`
|
|
202
|
-
- clear app data and cold-start the app
|
|
203
|
-
- `jskit mobile android build`
|
|
204
|
-
- build the Android release bundle
|
|
205
|
-
|
|
206
|
-
## The default local-dev setup
|
|
207
|
-
|
|
208
|
-
When `jskit add package @jskit-ai/mobile-capacitor` seeds `config.mobile` for the first time, it
|
|
209
|
-
creates a working local-dev default.
|
|
210
|
-
|
|
211
|
-
The important part is:
|
|
212
|
-
|
|
213
|
-
```js
|
|
214
|
-
config.mobile = {
|
|
215
|
-
enabled: true,
|
|
216
|
-
strategy: "capacitor",
|
|
217
|
-
assetMode: "bundled",
|
|
218
|
-
apiBaseUrl: "http://127.0.0.1:3000",
|
|
219
|
-
auth: {
|
|
220
|
-
callbackPath: "/auth/login",
|
|
221
|
-
customScheme: "your-app-slug"
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
That default is good for local phone development against your laptop.
|
|
227
|
-
|
|
228
|
-
It also means:
|
|
229
|
-
|
|
230
|
-
- the backend must be running on your laptop
|
|
231
|
-
- the app needs an `adb reverse` tunnel
|
|
232
|
-
|
|
233
|
-
An `apiBaseUrl` that points to a remote `https://...` backend uses the device's
|
|
234
|
-
normal network connection and does not need the tunnel.
|
|
235
|
-
|
|
236
|
-
## A good day-to-day loop
|
|
237
|
-
|
|
238
|
-
Once the package is installed, the normal loop is:
|
|
239
|
-
|
|
240
|
-
```bash
|
|
241
|
-
PORT=3000 npm run server
|
|
242
|
-
npx jskit mobile android dev
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
If you want to rerun steps manually, a predictable sequence is:
|
|
13
|
+
Use the `mobile/android-application` pattern for the small app-owned Capacitor
|
|
14
|
+
configuration. Then use Capacitor and Android tools directly:
|
|
246
15
|
|
|
247
16
|
```bash
|
|
248
|
-
npx
|
|
249
|
-
|
|
250
|
-
npx
|
|
17
|
+
npx cap add android
|
|
18
|
+
npm run build
|
|
19
|
+
npx cap sync android
|
|
20
|
+
npx cap run android
|
|
251
21
|
```
|
|
252
22
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
```bash
|
|
256
|
-
npx jskit mobile android restart
|
|
257
|
-
```
|
|
258
|
-
|
|
259
|
-
## Behind the scenes
|
|
260
|
-
|
|
261
|
-
### `config.mobile` is the source of truth
|
|
262
|
-
|
|
263
|
-
The Android shell is not configured by hand in scattered native files. JSKIT
|
|
264
|
-
renders the shell from `config.mobile`.
|
|
265
|
-
|
|
266
|
-
That config drives:
|
|
267
|
-
|
|
268
|
-
- Capacitor app id and app name
|
|
269
|
-
- Android package name
|
|
270
|
-
- app version values
|
|
271
|
-
- API base URL
|
|
272
|
-
- auth callback path
|
|
273
|
-
- custom URL scheme
|
|
274
|
-
|
|
275
|
-
### The shell is still a JSKIT web app
|
|
276
|
-
|
|
277
|
-
The UI still comes from the JSKIT web client.
|
|
278
|
-
|
|
279
|
-
Stage 1 mobile does not turn JSKIT into a native UI framework. It packages the
|
|
280
|
-
web app into a Capacitor Android shell.
|
|
281
|
-
|
|
282
|
-
That is why `jskit mobile android sync` still builds the web app first.
|
|
283
|
-
|
|
284
|
-
### Managed files
|
|
285
|
-
|
|
286
|
-
The package manages:
|
|
287
|
-
|
|
288
|
-
- `capacitor.config.json`
|
|
289
|
-
- `.jskit/mobile-capacitor.md`
|
|
290
|
-
- the Android shell under `android/`
|
|
291
|
-
- managed Android identity files such as:
|
|
292
|
-
- `android/app/build.gradle`
|
|
293
|
-
- `android/variables.gradle`
|
|
294
|
-
- `android/app/src/main/res/values/strings.xml`
|
|
295
|
-
- `MainActivity.java` or `MainActivity.kt`
|
|
296
|
-
- the managed deep-link block in `AndroidManifest.xml`
|
|
297
|
-
|
|
298
|
-
After the package is installed, `jskit mobile android sync` refreshes those
|
|
299
|
-
managed files from `config.mobile`.
|
|
300
|
-
|
|
301
|
-
### Why the tunnel exists
|
|
302
|
-
|
|
303
|
-
Inside the Android shell, the phone's `127.0.0.1` is the phone itself, not your
|
|
304
|
-
laptop.
|
|
305
|
-
|
|
306
|
-
So when local development uses:
|
|
307
|
-
|
|
308
|
-
```text
|
|
309
|
-
http://127.0.0.1:3000
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
the phone still needs a bridge back to your laptop.
|
|
313
|
-
|
|
314
|
-
That bridge is:
|
|
315
|
-
|
|
316
|
-
```bash
|
|
317
|
-
adb reverse tcp:3000 tcp:3000
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
`jskit mobile android tunnel` wraps that and shows `adb reverse --list`
|
|
321
|
-
afterward so you can see the active mapping.
|
|
322
|
-
|
|
323
|
-
### What happens to URLs
|
|
324
|
-
|
|
325
|
-
Inside the Capacitor shell there are two relevant URL worlds:
|
|
326
|
-
|
|
327
|
-
- shell/webview origin:
|
|
328
|
-
- `https://localhost/...`
|
|
329
|
-
- backend/API origin:
|
|
330
|
-
- usually `config.mobile.apiBaseUrl`
|
|
331
|
-
|
|
332
|
-
JSKIT keeps app code using normal relative server paths such as:
|
|
333
|
-
|
|
334
|
-
- `/api/session`
|
|
335
|
-
- `/api/bootstrap`
|
|
336
|
-
- `/socket.io/...`
|
|
337
|
-
|
|
338
|
-
The mobile runtime adapts those requests to the configured backend origin.
|
|
339
|
-
|
|
340
|
-
That is why app code does not need a separate "mobile API client" pattern for
|
|
341
|
-
the standard JSKIT server routes.
|
|
342
|
-
|
|
343
|
-
### Why local HTTP works on Android
|
|
344
|
-
|
|
345
|
-
For the local-dev case, the backend URL is often plain `http`.
|
|
346
|
-
|
|
347
|
-
The mobile shell therefore needs:
|
|
348
|
-
|
|
349
|
-
- Capacitor native HTTP enabled
|
|
350
|
-
- Android cleartext traffic allowed for the generated shell
|
|
351
|
-
|
|
352
|
-
Without those, Android or the WebView will block local backend traffic even if
|
|
353
|
-
the tunnel itself is correct.
|
|
354
|
-
|
|
355
|
-
### Auth and deep links
|
|
356
|
-
|
|
357
|
-
The mobile shell does not invent a separate auth route system.
|
|
358
|
-
|
|
359
|
-
The normal contract stays:
|
|
23
|
+
JSKIT does not wrap Capacitor, `adb`, Android Studio, or Gradle in another CLI.
|
|
360
24
|
|
|
361
|
-
|
|
362
|
-
- callback returns through the app's custom scheme
|
|
363
|
-
- callback path is still the normal JSKIT path:
|
|
364
|
-
- `/auth/login`
|
|
25
|
+
## Product decisions
|
|
365
26
|
|
|
366
|
-
|
|
27
|
+
Choose the stable application id, display name, built web directory, callback
|
|
28
|
+
URLs, development server policy, native permissions, and signing/release
|
|
29
|
+
ownership before creating the Android project.
|
|
367
30
|
|
|
368
|
-
|
|
31
|
+
## Invariants
|
|
369
32
|
|
|
370
|
-
|
|
33
|
+
- `webDir` matches the application's production build output.
|
|
34
|
+
- Development origins never leak into release configuration.
|
|
35
|
+
- Deep links and auth callbacks enter through explicit application routes.
|
|
36
|
+
- Navigation leaving the application uses the package's public mobile routing
|
|
37
|
+
capability.
|
|
38
|
+
- The Android project and signing configuration are ordinary app-owned source;
|
|
39
|
+
signing secrets remain outside Git.
|
|
371
40
|
|
|
372
|
-
|
|
41
|
+
## Verification
|
|
373
42
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
- deep-link wiring
|
|
378
|
-
- Android SDK basics
|
|
379
|
-
- host readiness for the shell path
|
|
43
|
+
Build the web application, sync Android, launch on an explicitly selected
|
|
44
|
+
device, exercise callbacks and external links, then build the intended native
|
|
45
|
+
release variant.
|
|
380
46
|
|
|
381
|
-
|
|
47
|
+
Do not hide device selection, write signing keys into source, or recreate a
|
|
48
|
+
JSKIT-specific mobile command language or operation receipt.
|