flet-box 1.0.4 → 1.0.6
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/README.md +10 -0
- package/bin/cli.js +23 -7
- package/bin/commands/checkApi.js +761 -0
- package/bin/commands/create.js +77 -5
- package/bin/utils/dtsProps.js +191 -0
- package/bin/utils/moduleExports.js +165 -0
- package/bin/utils/neutralise.js +64 -0
- package/bin/utils/templates.js +366 -27
- package/docs/CONTRIBUTING.md +156 -0
- package/docs/README.md +68 -0
- package/docs/arquitectura.md +164 -0
- package/docs/cli/README.md +542 -0
- package/docs/guides/README.md +33 -0
- package/docs/guides/app-templates.md +197 -0
- package/docs/guides/compatibility.md +95 -0
- package/docs/guides/embedding.md +284 -0
- package/docs/guides/first-app.md +208 -0
- package/docs/guides/frontend-services.md +171 -0
- package/docs/guides/minification-and-protection.md +260 -0
- package/docs/guides/mobile-and-platforms.md +439 -0
- package/docs/guides/online-updates.md +196 -0
- package/docs/guides/router.md +282 -0
- package/docs/guides/state.md +283 -0
- package/docs/guides/syntax-philosophy.md +150 -0
- package/docs/guides/utilities.md +241 -0
- package/docs/guides/widget-structure.md +163 -0
- package/docs/server/README.md +68 -0
- package/docs/server/START_HERE.md +121 -0
- package/docs/server/api.md +225 -0
- package/docs/server/data-services.md +300 -0
- package/docs/server/deployment.md +113 -0
- package/docs/server/security.md +196 -0
- package/docs/services/README.md +79 -0
- package/docs/services/RamStore.md +84 -0
- package/docs/services/Session.md +84 -0
- package/docs/services/Storage.md +88 -0
- package/docs/services/http.md +86 -0
- package/docs/tools/README.md +138 -0
- package/docs/tools/animation.md +87 -0
- package/docs/tools/async-ids-log.md +80 -0
- package/docs/tools/device.md +132 -0
- package/docs/tools/introspection.md +67 -0
- package/docs/tools/lists.md +96 -0
- package/docs/tools/markdown.md +79 -0
- package/docs/tools/reactivity.md +288 -0
- package/docs/tools/state.md +103 -0
- package/docs/tools/styling.md +92 -0
- package/docs/tools/text-and-time.md +89 -0
- package/docs/tools/theme.md +102 -0
- package/docs/tools/validation.md +75 -0
- package/docs/tools/visual-effects.md +84 -0
- package/docs/widget/Accordion.md +144 -0
- package/docs/widget/AdMob.md +144 -0
- package/docs/widget/AdSense.md +133 -0
- package/docs/widget/AdaptiveScaffold.md +105 -0
- package/docs/widget/AlertDialog.md +103 -0
- package/docs/widget/AnimatedBox.md +130 -0
- package/docs/widget/AnimatedText.md +123 -0
- package/docs/widget/AppBar.md +118 -0
- package/docs/widget/Audio.md +135 -0
- package/docs/widget/Avatar.md +119 -0
- package/docs/widget/Badge.md +128 -0
- package/docs/widget/BottomNavigation.md +116 -0
- package/docs/widget/BottomSheet.md +125 -0
- package/docs/widget/Button.md +137 -0
- package/docs/widget/COMMON_PROPS.md +150 -0
- package/docs/widget/Card.md +125 -0
- package/docs/widget/Carousel.md +151 -0
- package/docs/widget/Chart.md +151 -0
- package/docs/widget/Checkbox.md +118 -0
- package/docs/widget/Chip.md +126 -0
- package/docs/widget/CircularBar.md +168 -0
- package/docs/widget/CircularChart.md +164 -0
- package/docs/widget/CodeViewer.md +130 -0
- package/docs/widget/CollapsibleSideBar.md +112 -0
- package/docs/widget/Column.md +129 -0
- package/docs/widget/Container.md +136 -0
- package/docs/widget/DataTable.md +150 -0
- package/docs/widget/Divider.md +109 -0
- package/docs/widget/DraggBox.md +129 -0
- package/docs/widget/Drawer.md +135 -0
- package/docs/widget/DrawerItem.md +98 -0
- package/docs/widget/Dropdown.md +139 -0
- package/docs/widget/DroppBox.md +152 -0
- package/docs/widget/FloatingActionButton.md +120 -0
- package/docs/widget/GridView.md +140 -0
- package/docs/widget/Icon.md +117 -0
- package/docs/widget/Image.md +125 -0
- package/docs/widget/Input.md +151 -0
- package/docs/widget/Inspector.md +92 -0
- package/docs/widget/InstallButton.md +128 -0
- package/docs/widget/ListTile.md +132 -0
- package/docs/widget/ListView.md +138 -0
- package/docs/widget/Markdown.md +175 -0
- package/docs/widget/MatrixRain.md +122 -0
- package/docs/widget/Modal.md +129 -0
- package/docs/widget/Pagination.md +135 -0
- package/docs/widget/ParallaxBox.md +128 -0
- package/docs/widget/ProgressBar.md +130 -0
- package/docs/widget/QRCode.md +117 -0
- package/docs/widget/README.md +188 -0
- package/docs/widget/Radio.md +123 -0
- package/docs/widget/Rating.md +131 -0
- package/docs/widget/Row.md +131 -0
- package/docs/widget/START_HERE.md +146 -0
- package/docs/widget/Scaffold.md +152 -0
- package/docs/widget/Skeleton.md +130 -0
- package/docs/widget/Slider.md +146 -0
- package/docs/widget/SnackBar.md +102 -0
- package/docs/widget/Stack.md +128 -0
- package/docs/widget/Stepper.md +145 -0
- package/docs/widget/Switch.md +118 -0
- package/docs/widget/Tabs.md +124 -0
- package/docs/widget/Text.md +133 -0
- package/docs/widget/Tooltip.md +145 -0
- package/docs/widget/TreeView.md +176 -0
- package/docs/widget/Video.md +127 -0
- package/docs/widget/_template.md +61 -0
- package/package.json +3 -2
- package/src/animations/animate.js +180 -70
- package/src/animations/index.js +1 -0
- package/src/create-index.sh +1 -1
- package/src/index.d.ts +45 -22
- package/src/index.js +1 -0
- package/src/navigations/AdaptiveScaffold.js +11 -2
- package/src/navigations/BottomNavigation.js +10 -3
- package/src/navigations/Tabs.js +6 -2
- package/src/tools/useState.js +54 -63
- package/src/widget-factory/assignProps.js +23 -1
- package/src/widget-factory/processProps.js +10 -3
- package/src/widget-factory/reactiveValue.js +43 -18
- package/src/widget-factory/translateProps.js +777 -901
- package/src/widgets/AlertDialog.js +7 -5
- package/src/widgets/Checkbox.js +9 -7
- package/src/widgets/CircularBar.js +12 -1
- package/src/widgets/FloatingActionButton.js +4 -7
- package/src/widgets/Image.js +5 -7
- package/src/widgets/Input.js +92 -0
- package/src/widgets/ListView.js +73 -29
- package/src/widgets/Pagination.js +6 -3
- package/src/widgets/ProgressBar.js +16 -13
- package/src/widgets/Radio.js +6 -7
- package/src/widgets/Slider.js +23 -4
- package/src/widgets/Stack.js +36 -3
- package/src/widgets/Stepper.js +4 -3
- package/src/widgets/Switch.js +3 -4
- package/src/widgets/TreeView.js +0 -1
package/README.md
CHANGED
|
@@ -95,8 +95,18 @@ flet-box createBundle www # bundle the app into www/
|
|
|
95
95
|
flet-box build android # Android debug APK
|
|
96
96
|
flet-box build ios # iOS Simulator app (macOS + Xcode)
|
|
97
97
|
flet-box build ios --archive # unsigned iOS archive, sign in Xcode
|
|
98
|
+
|
|
99
|
+
# API lookup + anti-hallucination gate (works offline, in the repo or any app)
|
|
100
|
+
flet-box check-api # scan src/ for invented widgets/props
|
|
101
|
+
flet-box check-api --props Button # print the real props of one widget
|
|
102
|
+
flet-box check-api --list # print every public export
|
|
103
|
+
flet-box check-api --emit-api # (re)generate .fletbox/api/cheatsheet.md
|
|
98
104
|
```
|
|
99
105
|
|
|
106
|
+
In a generated app these are also `npm run check` (and `npm run check -- --props Button`),
|
|
107
|
+
because `flet-box create` writes `scripts/check-app.mjs` plus the `AGENTS.md` contract
|
|
108
|
+
that points any AI assistant at the real API.
|
|
109
|
+
|
|
100
110
|
## Android and iOS
|
|
101
111
|
|
|
102
112
|
`flet-box create` ships the Capacitor config, so the same SPA builds for both platforms. FletBox isn't on the npm registry — link it before installing:
|
package/bin/cli.js
CHANGED
|
@@ -13,17 +13,15 @@ import { createRequire } from "module";
|
|
|
13
13
|
import fs from "fs";
|
|
14
14
|
import path from "path";
|
|
15
15
|
import { createProject } from "./commands/create.js";
|
|
16
|
+
import { checkApi } from "./commands/checkApi.js";
|
|
16
17
|
import { packageManager } from "./commands/package.js";
|
|
17
18
|
import { createBundle } from "./commands/createBundle.js";
|
|
18
19
|
import { buildAndroid } from "./commands/buildAndroid.js";
|
|
19
20
|
import { buildIOS } from "./commands/buildIOS.js";
|
|
20
21
|
import { runNative } from "./commands/runNative.js";
|
|
21
|
-
import { runDevServer } from "./commands/runServer.js";
|
|
22
22
|
import { createScreen } from "./commands/createScreen.js";
|
|
23
23
|
import { createComponent } from "./commands/createComponent.js";
|
|
24
24
|
import { killServer } from "./commands/killServer.js";
|
|
25
|
-
import { runBundle } from "./commands/runBundle.js";
|
|
26
|
-
import { runCloudflareDemo } from "./commands/runCloudflare.js";
|
|
27
25
|
import { release } from "./commands/release.js";
|
|
28
26
|
import { c, gradient, section, banner, divider, width, setupCtrlC } from "./utils/colors.js";
|
|
29
27
|
|
|
@@ -73,6 +71,11 @@ ${cmd(" └─ [dir]", "target folder (default www)")}
|
|
|
73
71
|
${cmd("release [--patch]", "Bump version, rebuild, tag (OTA release)")}
|
|
74
72
|
${cmd(" └─ --minor|--major", "bump that position instead of patch")}
|
|
75
73
|
${cmd(" └─ --push", "push the commit + tag to origin")}
|
|
74
|
+
${cmd("check-api", "Validate the app against the installed flet-box API")}
|
|
75
|
+
${cmd(" └─ --props <Widget>", "print one widget's real props")}
|
|
76
|
+
${cmd(" └─ --list", "list every widget")}
|
|
77
|
+
${cmd(" └─ --emit-api", "write .fletbox/api/cheatsheet.md")}
|
|
78
|
+
${cmd(" └─ alias", "check | checkApi | doctor")}
|
|
76
79
|
${cmd("build android", "Build Android debug APK")}
|
|
77
80
|
${cmd("build android --release", "Build unsigned release APK/AAB to sign yourself")}
|
|
78
81
|
${cmd("build ios", "Build iOS Simulator app (macOS + Xcode)")}
|
|
@@ -262,6 +265,15 @@ async function main() {
|
|
|
262
265
|
await release(args.slice(1));
|
|
263
266
|
break;
|
|
264
267
|
|
|
268
|
+
case "check-api":
|
|
269
|
+
case "checkApi":
|
|
270
|
+
case "check":
|
|
271
|
+
case "doctor": {
|
|
272
|
+
const { exitCode } = await checkApi(args.slice(1));
|
|
273
|
+
if (exitCode) process.exit(exitCode);
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
|
|
265
277
|
case "build":
|
|
266
278
|
if (args[1] === "android") {
|
|
267
279
|
buildAndroid(args.slice(2));
|
|
@@ -308,7 +320,11 @@ async function main() {
|
|
|
308
320
|
runNative(args.slice(1));
|
|
309
321
|
break;
|
|
310
322
|
}
|
|
311
|
-
|
|
323
|
+
// The server commands are the only ones that pull in `ws`/`chokidar`,
|
|
324
|
+
// which are devDependencies: a consumer installing `flet-box` from npm
|
|
325
|
+
// has neither, so loading them at module scope would break every CLI
|
|
326
|
+
// command for them. Import them when a server is actually started.
|
|
327
|
+
await (await import("./commands/runServer.js")).runDevServer({
|
|
312
328
|
spaMode: false,
|
|
313
329
|
hotReload: flags.hot,
|
|
314
330
|
port: flags.port,
|
|
@@ -329,7 +345,7 @@ async function main() {
|
|
|
329
345
|
!args[1].startsWith("-")
|
|
330
346
|
? args[1]
|
|
331
347
|
: "www";
|
|
332
|
-
await runBundle({
|
|
348
|
+
await (await import("./commands/runBundle.js")).runBundle({
|
|
333
349
|
target: targetDir,
|
|
334
350
|
port: flags.port,
|
|
335
351
|
askPort: !flags.portExplicit,
|
|
@@ -342,7 +358,7 @@ async function main() {
|
|
|
342
358
|
case "runSpa":
|
|
343
359
|
case "spa":
|
|
344
360
|
ensureProject();
|
|
345
|
-
await runDevServer({
|
|
361
|
+
await (await import("./commands/runServer.js")).runDevServer({
|
|
346
362
|
spaMode: true,
|
|
347
363
|
hotReload: true,
|
|
348
364
|
port: flags.port,
|
|
@@ -356,7 +372,7 @@ async function main() {
|
|
|
356
372
|
case "demo":
|
|
357
373
|
case "tunnel":
|
|
358
374
|
ensureProject();
|
|
359
|
-
await runCloudflareDemo({
|
|
375
|
+
await (await import("./commands/runCloudflare.js")).runCloudflareDemo({
|
|
360
376
|
port: flags.port,
|
|
361
377
|
logRequests: flags.logRequests,
|
|
362
378
|
});
|