@effindomv2/fui-as 0.1.39 → 0.1.42

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.
@@ -1 +1 @@
1
- export * from '../../browser-bridge/src/routed-app-conventions.js';
1
+ export * from '@effindomv2/runtime/routed-app-conventions';
@@ -1,6 +1,3 @@
1
- export * from '../../../browser-bridge/src/managed-harness.js';
2
- export * from '../../../browser-bridge/src/managed-harness/abi-version.js';
3
- export * from '../../../browser-bridge/src/managed-harness/persisted-restore-policy.js';
4
- export * from '../../../browser-bridge/src/managed-harness/ui-chrome.js';
5
- export * from '../../../browser-bridge/src/routed-app-conventions.js';
6
- export * from '../../../browser-bridge/src/routed-harness.js';
1
+ export * from '@effindomv2/runtime/managed-harness';
2
+ export * from '@effindomv2/runtime/routed-app-conventions';
3
+ export * from '@effindomv2/runtime/routed-harness';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@effindomv2/fui-as",
3
- "version": "0.1.39",
3
+ "version": "0.1.42",
4
4
  "private": false,
5
5
  "license": "AGPL-3.0-only OR LicenseRef-EffinDom-Commercial",
6
6
  "description": "EffinDom v2 AssemblyScript frontend framework SDK and browser harness",
@@ -96,7 +96,7 @@
96
96
  },
97
97
  "dependencies": {
98
98
  "@assemblyscript/loader": "^0.28.19",
99
- "@effindomv2/runtime": "0.1.20"
99
+ "@effindomv2/runtime": "0.1.22"
100
100
  },
101
101
  "devDependencies": {
102
102
  "@as-pect/assembly": "9.0.0",
package/scripts/build.sh CHANGED
@@ -22,6 +22,11 @@ RUNTIME_CONFIG_FILE="effindom-runtime-config.js"
22
22
  DEFAULT_MANIFEST_PATH="./runtime/dist/effindom.v2.manifest.json"
23
23
  LOADING_OVERLAY_STYLES_FILE="${PACKAGE_DIR}/browser/loading-overlay-styles.html"
24
24
  LOADING_OVERLAY_BODY_FILE="${PACKAGE_DIR}/browser/loading-overlay-body.html"
25
+ RUNTIME_PACKAGE_DIR="${PACKAGE_DIR}/node_modules/@effindomv2/runtime"
26
+
27
+ if [ ! -d "${RUNTIME_PACKAGE_DIR}" ]; then
28
+ RUNTIME_PACKAGE_DIR="${REPO_ROOT}/node_modules/@effindomv2/runtime"
29
+ fi
25
30
 
26
31
  rm -rf "${OUT_DIR}"
27
32
  mkdir -p "${PACKAGE_DIR}/build" "${OUT_DIR}" "${DEMO_OUT_DIR}" "${WORKER_BUILD_DIR}"
@@ -38,10 +43,28 @@ else
38
43
  fi
39
44
 
40
45
  ESBUILD_RUNTIME_ALIAS_ARGS=()
41
- if [ -f "${REPO_ROOT}/v2/browser-bridge/src/index.ts" ]; then
46
+ LOCAL_RUNTIME_PACKAGE_JSON="${REPO_ROOT}/v2/browser-bridge/package.json"
47
+ if [ -f "${LOCAL_RUNTIME_PACKAGE_JSON}" ]; then
48
+ REQUIRED_RUNTIME_VERSION="$(
49
+ node -e '
50
+ const pkg = require(process.argv[1]);
51
+ process.stdout.write(String(pkg.dependencies?.["@effindomv2/runtime"] ?? ""));
52
+ ' "${PACKAGE_DIR}/package.json"
53
+ )"
54
+ LOCAL_RUNTIME_VERSION="$(
55
+ node -e '
56
+ const pkg = require(process.argv[1]);
57
+ process.stdout.write(String(pkg.version ?? ""));
58
+ ' "${LOCAL_RUNTIME_PACKAGE_JSON}"
59
+ )"
60
+ else
61
+ REQUIRED_RUNTIME_VERSION=""
62
+ LOCAL_RUNTIME_VERSION=""
63
+ fi
64
+
65
+ if [ -n "${REQUIRED_RUNTIME_VERSION}" ] && [ "${LOCAL_RUNTIME_VERSION}" = "${REQUIRED_RUNTIME_VERSION}" ]; then
42
66
  ESBUILD_RUNTIME_ALIAS_ARGS+=(
43
- "--alias:@effindomv2/runtime=${REPO_ROOT}/v2/browser-bridge/src/index.ts"
44
- "--alias:@effindomv2/runtime/core-types=${REPO_ROOT}/v2/browser-bridge/src/core-types.ts"
67
+ "--alias:@effindomv2/runtime=${REPO_ROOT}/v2/browser-bridge/src"
45
68
  )
46
69
  fi
47
70
 
@@ -308,7 +331,7 @@ npx esbuild "${PACKAGE_DIR}/demo/harness.ts" \
308
331
  --outfile="${DEMO_OUT_DIR}/harness.js" \
309
332
  --sourcemap
310
333
 
311
- npx esbuild "${REPO_ROOT}/v2/browser-bridge/src/managed-harness/file-processing-worker.ts" \
334
+ npx esbuild "${RUNTIME_PACKAGE_DIR}/src/managed-harness/file-processing-worker.ts" \
312
335
  --bundle \
313
336
  --format=iife \
314
337
  --platform=browser \
@@ -323,7 +346,7 @@ cp "${FILE_PROCESSING_WORKER_MAP_BUILD}" "${OUT_DIR}/file-processing-worker.js.m
323
346
  cp "${FILE_PROCESSING_WORKER_BUILD}" "${DEMO_OUT_DIR}/file-processing-worker.js"
324
347
  cp "${FILE_PROCESSING_WORKER_MAP_BUILD}" "${DEMO_OUT_DIR}/file-processing-worker.js.map"
325
348
 
326
- npx esbuild "${REPO_ROOT}/v2/browser-bridge/src/managed-harness/worker-bootstrap.ts" \
349
+ npx esbuild "${RUNTIME_PACKAGE_DIR}/src/managed-harness/worker-bootstrap.ts" \
327
350
  --bundle \
328
351
  --format=iife \
329
352
  --platform=browser \
@@ -3,9 +3,7 @@
3
3
  set -euo pipefail
4
4
 
5
5
  PACKAGE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
6
- REPO_ROOT="$(cd "${PACKAGE_DIR}/../.." && pwd)"
7
6
  PACKAGE_JSON="${PACKAGE_DIR}/package.json"
8
- RUNTIME_PACKAGE_JSON="${REPO_ROOT}/v2/browser-bridge/package.json"
9
7
 
10
8
  if [ ! -f "${PACKAGE_JSON}" ]; then
11
9
  echo "Missing package.json at ${PACKAGE_JSON}" >&2
@@ -29,20 +27,3 @@ if ! printf '%s' "${runtime_spec}" | grep -Eq '^[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A
29
27
  echo "@effindomv2/runtime must be pinned to an exact version, found: ${runtime_spec}" >&2
30
28
  exit 1
31
29
  fi
32
-
33
- if [ -f "${RUNTIME_PACKAGE_JSON}" ]; then
34
- runtime_version="$(
35
- node -e '
36
- const fs = require("node:fs");
37
- const pkg = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));
38
- process.stdout.write(String(pkg.version ?? ""));
39
- ' "${RUNTIME_PACKAGE_JSON}"
40
- )"
41
-
42
- if [ -n "${runtime_version}" ] && [ "${runtime_spec}" != "${runtime_version}" ]; then
43
- echo "@effindomv2/fui-as depends on @effindomv2/runtime@${runtime_spec}, but monorepo runtime is ${runtime_version}." >&2
44
- echo "Update v2/fui-as/package.json to match v2/browser-bridge/package.json." >&2
45
- exit 1
46
- fi
47
- fi
48
-
@@ -117,12 +117,17 @@ export async function generateAssemblyScriptHostEventsFile(
117
117
  const callbackImport =
118
118
  primitivesImportOverride ??
119
119
  relativeImport(outputPath, path.resolve(path.dirname(modulePath), "..", "..", "src/FuiPrimitives.ts"));
120
+ const callbackNames = ["Callback0", "Callback1", "Callback2"].filter((_name, arity) =>
121
+ methods.some((method) => method.args.length === arity),
122
+ );
120
123
  const blocks: string[] = [
121
124
  "// @ts-nocheck",
122
125
  `// Generated by hostgen from ${sourcePathForHeader(modulePath)}#${exportName}.`,
123
- `import { Callback0, Callback1, Callback2 } from "${callbackImport}";`,
124
- "",
125
126
  ];
127
+ if (callbackNames.length > 0) {
128
+ blocks.push(`import { ${callbackNames.join(", ")} } from "${callbackImport}";`);
129
+ blocks.push("");
130
+ }
126
131
  methods.forEach((method, index) => {
127
132
  const callbackType = callbackTypeFor(method.args);
128
133
  const exportArgs = emitExportArgs(method.args);