create-buntui 0.1.0-alpha.3 → 0.1.0-alpha.4

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 (39) hide show
  1. package/dist/main.js +4 -0
  2. package/package.json +8 -9
  3. package/templates/basic/package.json +3 -3
  4. package/templates/basic/src/apps/main/main.ts +12 -0
  5. package/templates/basic/src/shared/runApp.ts +14 -0
  6. package/templates/full/README.md +14 -12
  7. package/templates/full/package.json +3 -3
  8. package/templates/full/src/{components → apps/main/components}/BoxDemo.vue +5 -5
  9. package/templates/full/src/apps/main/main.ts +12 -0
  10. package/templates/full/src/shared/runApp.ts +14 -0
  11. package/templates/sfc/README.md +5 -3
  12. package/templates/sfc/package.json +3 -3
  13. package/templates/sfc/src/apps/main/main.ts +12 -0
  14. package/templates/sfc/src/shared/runApp.ts +14 -0
  15. package/dist/buntui.so +0 -0
  16. package/dist/index.js +0 -7
  17. package/templates/basic/scripts/build.ts +0 -65
  18. package/templates/basic/src/dev.ts +0 -27
  19. package/templates/basic/src/main.ts +0 -15
  20. package/templates/full/scripts/build.ts +0 -66
  21. package/templates/full/src/dev.ts +0 -40
  22. package/templates/full/src/main.ts +0 -21
  23. package/templates/sfc/scripts/build.ts +0 -66
  24. package/templates/sfc/src/dev.ts +0 -40
  25. package/templates/sfc/src/main.ts +0 -21
  26. /package/templates/basic/src/{App.vue → apps/main/App.vue} +0 -0
  27. /package/templates/full/src/{App.vue → apps/main/App.vue} +0 -0
  28. /package/templates/full/src/{components → apps/main/components}/ButtonDemo.vue +0 -0
  29. /package/templates/full/src/{components → apps/main/components}/CheckboxDemo.vue +0 -0
  30. /package/templates/full/src/{components → apps/main/components}/InputDemo.vue +0 -0
  31. /package/templates/full/src/{components → apps/main/components}/ProgressDemo.vue +0 -0
  32. /package/templates/full/src/{components → apps/main/components}/RadioDemo.vue +0 -0
  33. /package/templates/full/src/{components → apps/main/components}/ScrollBoxDemo.vue +0 -0
  34. /package/templates/full/src/{components → apps/main/components}/SelectDemo.vue +0 -0
  35. /package/templates/full/src/{components → apps/main/components}/SwitchDemo.vue +0 -0
  36. /package/templates/full/src/{components → apps/main/components}/TableDemo.vue +0 -0
  37. /package/templates/full/src/{components → apps/main/components}/TextDemo.vue +0 -0
  38. /package/templates/full/src/{components → apps/main/components}/TextareaDemo.vue +0 -0
  39. /package/templates/sfc/src/{App.vue → apps/main/App.vue} +0 -0
@@ -1,40 +0,0 @@
1
- import path from 'node:path';
2
- import fs from 'node:fs';
3
- import {createDevServer, CORE_REGISTRY, type DevServerOptions} from '@buntui/compiler';
4
- import {mountHmrErrorOverlay, type HmrErrorOverlayHandle} from '@buntui/extensions/hmr-error-overlay';
5
- import {ENTRY, run} from './main';
6
-
7
- const DEV_DIR = path.join(import.meta.dir, '.dev');
8
- fs.mkdirSync(DEV_DIR, {recursive: true});
9
-
10
- const {scene} = run({logFilePath: DEV_DIR});
11
-
12
- const VUE_FILE = path.join(import.meta.dir, ENTRY);
13
-
14
- let errorOverlay: HmrErrorOverlayHandle | undefined;
15
-
16
- createDevServer({
17
- file: VUE_FILE,
18
- tempDir: DEV_DIR,
19
- compileOptions: {
20
- registry: CORE_REGISTRY,
21
- codegen: {
22
- coreModuleId: '@buntui/core',
23
- reactivityModuleId: '@vue/reactivity',
24
- },
25
- },
26
- onClear() {
27
- errorOverlay?.dismiss();
28
- errorOverlay = undefined;
29
- scene.clearWidgets();
30
- },
31
- onReload(setupFn: (scene: unknown) => void) {
32
- errorOverlay?.dismiss();
33
- errorOverlay = undefined;
34
- setupFn(scene);
35
- },
36
- onError(error: Error) {
37
- errorOverlay?.dismiss();
38
- errorOverlay = mountHmrErrorOverlay(scene, error);
39
- },
40
- } satisfies DevServerOptions);
@@ -1,21 +0,0 @@
1
- import {createApp} from '@buntui/core';
2
- import App from './App.vue';
3
-
4
- export const ENTRY = 'App.vue';
5
-
6
- export function run(devOptions: {logFilePath?: string} = {}) {
7
- const app = createApp({
8
- logLevel: 'info',
9
- clearLog: true,
10
- tickRate: 60,
11
- renderRate: 24,
12
- ...devOptions,
13
- });
14
- const scene = app.createScene(App, {bgHexRgb: 0x1A_1B_26, visible: true});
15
- app.start();
16
- return {app, scene};
17
- }
18
-
19
- if (import.meta.main) {
20
- run();
21
- }