@effindomv2/create-fui-as-app 0.1.3 → 0.1.5
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/build/templates/hello/asconfig.json +24 -0
- package/build/templates/hello/harness.ts +9 -0
- package/build/templates/hello/index.html +98 -0
- package/build/templates/hello/package.json +32 -0
- package/build/templates/hello/scripts/prepare-runtime.ts +18 -0
- package/build/templates/hello/scripts/smoke.ts +15 -0
- package/build/templates/hello/src/App.ts +7 -0
- package/build/templates/hello/src/HelloWorld.ts +105 -0
- package/build/templates/hello/src/fui/Fui.ts +1 -0
- package/build/templates/hello/src/fui/FuiBrowser.ts +1 -0
- package/build/templates/hello/src/fui/FuiExports.ts +1 -0
- package/build/templates/hello/src/fui/FuiPrimitives.ts +1 -0
- package/build/templates/hello/src/host/generated/HostEvents.ts +20 -0
- package/build/templates/hello/src/host/generated/HostServices.ts +8 -0
- package/build/templates/hello/src/host/host-events.ts +22 -0
- package/build/templates/hello/src/host/host-services.ts +18 -0
- package/build/templates/hello/tsconfig.json +9 -0
- package/build/templates/mvc/asconfig.json +24 -0
- package/build/templates/mvc/harness.ts +40 -0
- package/build/templates/mvc/index.html +11 -0
- package/build/templates/mvc/package.json +34 -0
- package/build/templates/mvc/route-shell.html +56 -0
- package/build/templates/mvc/scripts/prepare-runtime.ts +22 -0
- package/build/templates/mvc/scripts/smoke.ts +18 -0
- package/build/templates/mvc/src/fui/Fui.ts +1 -0
- package/build/templates/mvc/src/fui/FuiBrowser.ts +1 -0
- package/build/templates/mvc/src/fui/FuiExports.ts +1 -0
- package/build/templates/mvc/src/fui/FuiPrimitives.ts +1 -0
- package/build/templates/mvc/src/host/generated/HostEvents.ts +20 -0
- package/build/templates/mvc/src/host/generated/HostServices.ts +8 -0
- package/build/templates/mvc/src/host/host-events.ts +22 -0
- package/build/templates/mvc/src/host/host-services.ts +17 -0
- package/build/templates/mvc/src/routes/mvc/pages/home/HomeController.ts +55 -0
- package/build/templates/mvc/src/routes/mvc/pages/home/HomeModel.ts +8 -0
- package/build/templates/mvc/src/routes/mvc/pages/home/HomeView.ts +76 -0
- package/build/templates/mvc/src/routes/mvc/pages/settings/SettingsController.ts +27 -0
- package/build/templates/mvc/src/routes/mvc/pages/settings/SettingsModel.ts +6 -0
- package/build/templates/mvc/src/routes/mvc/pages/settings/SettingsView.ts +61 -0
- package/build/templates/mvc/src/routes/mvc/shared/design-system/MvcNavPill.ts +42 -0
- package/build/templates/mvc/src/routes/mvc/shared/design-system/MvcPrimaryButton.ts +19 -0
- package/build/templates/mvc/src/routes/mvc/shared/routes.ts +22 -0
- package/build/templates/mvc/src/routes/mvc_home.ts +20 -0
- package/build/templates/mvc/src/routes/mvc_settings.ts +20 -0
- package/build/templates/mvc/tsconfig.json +9 -0
- package/dist/scripts/sync-templates.d.ts +1 -0
- package/dist/scripts/sync-templates.js +297 -0
- package/dist/src/scaffold.d.ts +2 -0
- package/dist/src/scaffold.js +50 -5
- package/dist/src/templates.d.ts +2 -1
- package/dist/src/templates.js +39 -228
- package/dist/src/versions.d.ts +1 -1
- package/dist/src/versions.js +1 -1
- package/dist/tests/scaffold.test.js +32 -0
- package/package.json +6 -3
package/dist/src/versions.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const FUI_AS_VERSION = "0.1.
|
|
1
|
+
export const FUI_AS_VERSION = "0.1.2";
|
|
2
2
|
export const RUNTIME_VERSION = "0.1.0";
|
|
@@ -19,6 +19,38 @@ test("createProject writes hello-world scaffold including AssemblyScript tsconfi
|
|
|
19
19
|
assert.equal(typeof packageJson.scripts.dev, "string");
|
|
20
20
|
assert.equal(typeof packageJson.scripts.build, "string");
|
|
21
21
|
assert.equal(typeof packageJson.scripts.test, "string");
|
|
22
|
+
assert.equal(typeof packageJson.scripts["generate:host"], "string");
|
|
23
|
+
assert.equal(readFileSync(join(target, "src", "HelloWorld.ts"), "utf8").includes("Hello world"), true);
|
|
24
|
+
assert.equal(readFileSync(join(target, "src", "fui", "Fui.ts"), "utf8").includes("@effindomv2/fui-as/src/Fui"), true);
|
|
25
|
+
assert.equal(readFileSync(join(target, "src", "host", "host-events.ts"), "utf8").includes("appHostEvents"), true);
|
|
26
|
+
assert.equal(readFileSync(join(target, "src", "host", "host-services.ts"), "utf8").includes("appHostServices"), true);
|
|
27
|
+
assert.equal(readFileSync(join(target, "src", "host", "generated", "HostEvents.ts"), "utf8").includes("onAppClockTick"), true);
|
|
28
|
+
assert.equal(readFileSync(join(target, "src", "host", "generated", "HostServices.ts"), "utf8").includes("appClockNowUnixSeconds"), true);
|
|
29
|
+
}
|
|
30
|
+
finally {
|
|
31
|
+
rmSync(root, { recursive: true, force: true });
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
test("createProject writes mvc scaffold when template is mvc", () => {
|
|
35
|
+
const root = mkdtempSync(join(tmpdir(), "create-fui-as-app-"));
|
|
36
|
+
const target = join(root, "my-mvc-app");
|
|
37
|
+
try {
|
|
38
|
+
createProject({
|
|
39
|
+
targetDirectory: target,
|
|
40
|
+
projectName: "my-mvc-app",
|
|
41
|
+
template: "mvc",
|
|
42
|
+
});
|
|
43
|
+
const packageJson = JSON.parse(readFileSync(join(target, "package.json"), "utf8"));
|
|
44
|
+
assert.equal(typeof packageJson.scripts["build:wasm:home"], "string");
|
|
45
|
+
assert.equal(typeof packageJson.scripts["build:wasm:settings"], "string");
|
|
46
|
+
assert.equal(typeof packageJson.scripts["generate:host"], "string");
|
|
47
|
+
assert.equal(readFileSync(join(target, "src", "routes", "mvc", "pages", "home", "HomeController.ts"), "utf8").includes("HomeController"), true);
|
|
48
|
+
assert.equal(readFileSync(join(target, "src", "host", "host-events.ts"), "utf8").includes("appHostEvents"), true);
|
|
49
|
+
assert.equal(readFileSync(join(target, "src", "host", "host-services.ts"), "utf8").includes("appHostServices"), true);
|
|
50
|
+
assert.equal(readFileSync(join(target, "src", "fui", "Fui.ts"), "utf8").includes("@effindomv2/fui-as/src/Fui"), true);
|
|
51
|
+
assert.equal(readFileSync(join(target, "src", "host", "generated", "HostEvents.ts"), "utf8").includes("onAppClockTick"), true);
|
|
52
|
+
assert.equal(readFileSync(join(target, "src", "host", "generated", "HostServices.ts"), "utf8").includes("appClockNowUnixSeconds"), true);
|
|
53
|
+
assert.equal(readFileSync(join(target, "route-shell.html"), "utf8").includes("FUI-AS MVC Demo"), true);
|
|
22
54
|
}
|
|
23
55
|
finally {
|
|
24
56
|
rmSync(root, { recursive: true, force: true });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effindomv2/create-fui-as-app",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "Scaffold a minimal EffinDom v2 FUI-AS app",
|
|
@@ -23,16 +23,19 @@
|
|
|
23
23
|
"main": "./dist/src/scaffold.js",
|
|
24
24
|
"types": "./dist/src/scaffold.d.ts",
|
|
25
25
|
"files": [
|
|
26
|
-
"dist"
|
|
26
|
+
"dist",
|
|
27
|
+
"build/templates"
|
|
27
28
|
],
|
|
28
29
|
"scripts": {
|
|
29
|
-
"
|
|
30
|
+
"sync:templates": "tsx scripts/sync-templates.ts",
|
|
31
|
+
"build": "npm run sync:templates && tsc -p tsconfig.json",
|
|
30
32
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
31
33
|
"test": "npm run build && node --test dist/tests/**/*.test.js",
|
|
32
34
|
"prepack": "npm run build"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@types/node": "^24.10.1",
|
|
38
|
+
"tsx": "^4.20.6",
|
|
36
39
|
"typescript": "^5.9.3"
|
|
37
40
|
}
|
|
38
41
|
}
|