flet-box 1.0.5 → 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.
Files changed (2) hide show
  1. package/bin/cli.js +8 -7
  2. package/package.json +2 -2
package/bin/cli.js CHANGED
@@ -19,12 +19,9 @@ import { createBundle } from "./commands/createBundle.js";
19
19
  import { buildAndroid } from "./commands/buildAndroid.js";
20
20
  import { buildIOS } from "./commands/buildIOS.js";
21
21
  import { runNative } from "./commands/runNative.js";
22
- import { runDevServer } from "./commands/runServer.js";
23
22
  import { createScreen } from "./commands/createScreen.js";
24
23
  import { createComponent } from "./commands/createComponent.js";
25
24
  import { killServer } from "./commands/killServer.js";
26
- import { runBundle } from "./commands/runBundle.js";
27
- import { runCloudflareDemo } from "./commands/runCloudflare.js";
28
25
  import { release } from "./commands/release.js";
29
26
  import { c, gradient, section, banner, divider, width, setupCtrlC } from "./utils/colors.js";
30
27
 
@@ -323,7 +320,11 @@ async function main() {
323
320
  runNative(args.slice(1));
324
321
  break;
325
322
  }
326
- await runDevServer({
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({
327
328
  spaMode: false,
328
329
  hotReload: flags.hot,
329
330
  port: flags.port,
@@ -344,7 +345,7 @@ async function main() {
344
345
  !args[1].startsWith("-")
345
346
  ? args[1]
346
347
  : "www";
347
- await runBundle({
348
+ await (await import("./commands/runBundle.js")).runBundle({
348
349
  target: targetDir,
349
350
  port: flags.port,
350
351
  askPort: !flags.portExplicit,
@@ -357,7 +358,7 @@ async function main() {
357
358
  case "runSpa":
358
359
  case "spa":
359
360
  ensureProject();
360
- await runDevServer({
361
+ await (await import("./commands/runServer.js")).runDevServer({
361
362
  spaMode: true,
362
363
  hotReload: true,
363
364
  port: flags.port,
@@ -371,7 +372,7 @@ async function main() {
371
372
  case "demo":
372
373
  case "tunnel":
373
374
  ensureProject();
374
- await runCloudflareDemo({
375
+ await (await import("./commands/runCloudflare.js")).runCloudflareDemo({
375
376
  port: flags.port,
376
377
  logRequests: flags.logRequests,
377
378
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flet-box",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Declarative, zero-dependency UI framework in vanilla JS — ship web, PWA, Android and iOS from one codebase",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -19,7 +19,7 @@
19
19
  "dev": "node bin/cli.js run --hot",
20
20
  "build": "node bin/cli.js createBundle",
21
21
  "release": "node bin/cli.js release",
22
- "test": "node scripts/check-widgets.mjs && node scripts/check-prop-registry.mjs && node scripts/check-docs-props.mjs && node scripts/check-api-surface.mjs && node scripts/check-router-base.mjs && python3 tools/snippets-creator-flet-box/build_snippets.py --check && node scripts/check-snippets.mjs",
22
+ "test": "node scripts/check-widgets.mjs && node scripts/check-prop-registry.mjs && node scripts/check-docs-props.mjs && node scripts/check-api-surface.mjs && node scripts/check-router-base.mjs && node scripts/check-cli-install.mjs && python3 tools/snippets-creator-flet-box/build_snippets.py --check && node scripts/check-snippets.mjs",
23
23
  "test:browser": "node scripts/run-browser-tests.mjs"
24
24
  },
25
25
  "keywords": [