resuxjs 0.4.0-beta.3 → 0.4.0-beta.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.
@@ -1,4 +1,5 @@
1
1
  import { pathExists, readJsonRecord } from "./common.js";
2
+ import { collectServerRuntimeDependencyNames, ensureRuntimeDependencyTrees } from "./runtime-dependencies.js";
2
3
  import { createRequire } from "node:module";
3
4
  import { cp, mkdir, rm } from "node:fs/promises";
4
5
  import path from "node:path";
@@ -31,6 +32,7 @@ async function ensureResuxFrameworkRuntime(appRoot, runtimeRoots) {
31
32
  const packageRoot = path.dirname(packageJsonPath);
32
33
  const distRoot = path.join(packageRoot, "dist");
33
34
  if (!await pathExists(distRoot)) throw new Error(`Resux deployment resolved resuxjs at ${packageRoot}, but its dist runtime is missing.`);
35
+ const frameworkRuntimeDependencies = await collectServerRuntimeDependencyNames(distRoot);
34
36
  for (const runtimeRoot of runtimeRoots) {
35
37
  const targetRoot = path.join(runtimeRoot, "node_modules", "resuxjs");
36
38
  await rm(targetRoot, {
@@ -45,6 +47,7 @@ async function ensureResuxFrameworkRuntime(appRoot, runtimeRoots) {
45
47
  dereference: true
46
48
  });
47
49
  }
50
+ if (frameworkRuntimeDependencies.includes("vue")) await ensureRuntimeDependencyTrees(appRoot, runtimeRoots, "vue", "Resux framework Vue runtime");
48
51
  }
49
52
 
50
53
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"framework-runtime.js","names":[],"sources":["../../src/deploy/framework-runtime.ts"],"sourcesContent":["import { cp, mkdir, rm } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathExists, readJsonRecord } from \"./common.js\";\n\ninterface PackageRecord extends Record<string, unknown> {\n name?: unknown;\n}\n\nasync function findPackageJsonFromEntry(\n packageName: string,\n entryPath: string,\n): Promise<string | null> {\n let currentDirectory = path.dirname(entryPath);\n\n while (true) {\n const candidate = path.join(currentDirectory, \"package.json\");\n const packageJson = (await readJsonRecord(candidate)) as PackageRecord | null;\n if (packageJson?.name === packageName) {\n return candidate;\n }\n\n const parentDirectory = path.dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n return null;\n }\n currentDirectory = parentDirectory;\n }\n}\n\nasync function resolvePackageJsonPath(\n appRoot: string,\n packageName: string,\n): Promise<string> {\n const resolver = createRequire(path.join(appRoot, \"package.json\"));\n\n try {\n return resolver.resolve(`${packageName}/package.json`);\n } catch {\n const entryPath = resolver.resolve(packageName);\n const packageJsonPath = await findPackageJsonFromEntry(packageName, entryPath);\n if (packageJsonPath) {\n return packageJsonPath;\n }\n throw new Error(\n `Resux deployment could resolve \"${packageName}\" to ${entryPath}, but could not locate its package root.`,\n );\n }\n}\n\nexport async function ensureResuxFrameworkRuntime(\n appRoot: string,\n runtimeRoots: string[],\n): Promise<void> {\n if (!runtimeRoots.length) {\n return;\n }\n\n const packageJsonPath = await resolvePackageJsonPath(appRoot, \"resuxjs\");\n const packageRoot = path.dirname(packageJsonPath);\n const distRoot = path.join(packageRoot, \"dist\");\n if (!(await pathExists(distRoot))) {\n throw new Error(\n `Resux deployment resolved resuxjs at ${packageRoot}, but its dist runtime is missing.`,\n );\n }\n\n for (const runtimeRoot of runtimeRoots) {\n const targetRoot = path.join(runtimeRoot, \"node_modules\", \"resuxjs\");\n await rm(targetRoot, { recursive: true, force: true });\n await mkdir(targetRoot, { recursive: true });\n await cp(packageJsonPath, path.join(targetRoot, \"package.json\"), { force: true });\n await cp(distRoot, path.join(targetRoot, \"dist\"), {\n recursive: true,\n force: true,\n dereference: true,\n });\n }\n}\n"],"mappings":";;;;;;AASA,eAAe,yBACb,aACA,WACwB;CACxB,IAAI,mBAAmB,KAAK,QAAQ,UAAU;AAE9C,QAAO,MAAM;EACX,MAAM,YAAY,KAAK,KAAK,kBAAkB,eAAe;AAE7D,OADqB,MAAM,eAAe,UAAU,GACnC,SAAS,YACxB,QAAO;EAGT,MAAM,kBAAkB,KAAK,QAAQ,iBAAiB;AACtD,MAAI,oBAAoB,iBACtB,QAAO;AAET,qBAAmB;;;AAIvB,eAAe,uBACb,SACA,aACiB;CACjB,MAAM,WAAW,cAAc,KAAK,KAAK,SAAS,eAAe,CAAC;AAElE,KAAI;AACF,SAAO,SAAS,QAAQ,GAAG,YAAY,eAAe;SAChD;EACN,MAAM,YAAY,SAAS,QAAQ,YAAY;EAC/C,MAAM,kBAAkB,MAAM,yBAAyB,aAAa,UAAU;AAC9E,MAAI,gBACF,QAAO;AAET,QAAM,IAAI,MACR,mCAAmC,YAAY,OAAO,UAAU,0CACjE;;;AAIL,eAAsB,4BACpB,SACA,cACe;AACf,KAAI,CAAC,aAAa,OAChB;CAGF,MAAM,kBAAkB,MAAM,uBAAuB,SAAS,UAAU;CACxE,MAAM,cAAc,KAAK,QAAQ,gBAAgB;CACjD,MAAM,WAAW,KAAK,KAAK,aAAa,OAAO;AAC/C,KAAI,CAAE,MAAM,WAAW,SAAS,CAC9B,OAAM,IAAI,MACR,wCAAwC,YAAY,oCACrD;AAGH,MAAK,MAAM,eAAe,cAAc;EACtC,MAAM,aAAa,KAAK,KAAK,aAAa,gBAAgB,UAAU;AACpE,QAAM,GAAG,YAAY;GAAE,WAAW;GAAM,OAAO;GAAM,CAAC;AACtD,QAAM,MAAM,YAAY,EAAE,WAAW,MAAM,CAAC;AAC5C,QAAM,GAAG,iBAAiB,KAAK,KAAK,YAAY,eAAe,EAAE,EAAE,OAAO,MAAM,CAAC;AACjF,QAAM,GAAG,UAAU,KAAK,KAAK,YAAY,OAAO,EAAE;GAChD,WAAW;GACX,OAAO;GACP,aAAa;GACd,CAAC"}
1
+ {"version":3,"file":"framework-runtime.js","names":[],"sources":["../../src/deploy/framework-runtime.ts"],"sourcesContent":["import { cp, mkdir, rm } from \"node:fs/promises\";\nimport { createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport { pathExists, readJsonRecord } from \"./common.js\";\nimport { collectServerRuntimeDependencyNames, ensureRuntimeDependencyTrees } from \"./runtime-dependencies.js\";\n\ninterface PackageRecord extends Record<string, unknown> {\n name?: unknown;\n}\n\nasync function findPackageJsonFromEntry(\n packageName: string,\n entryPath: string,\n): Promise<string | null> {\n let currentDirectory = path.dirname(entryPath);\n\n while (true) {\n const candidate = path.join(currentDirectory, \"package.json\");\n const packageJson = (await readJsonRecord(candidate)) as PackageRecord | null;\n if (packageJson?.name === packageName) {\n return candidate;\n }\n\n const parentDirectory = path.dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n return null;\n }\n currentDirectory = parentDirectory;\n }\n}\n\nasync function resolvePackageJsonPath(\n appRoot: string,\n packageName: string,\n): Promise<string> {\n const resolver = createRequire(path.join(appRoot, \"package.json\"));\n\n try {\n return resolver.resolve(`${packageName}/package.json`);\n } catch {\n const entryPath = resolver.resolve(packageName);\n const packageJsonPath = await findPackageJsonFromEntry(packageName, entryPath);\n if (packageJsonPath) {\n return packageJsonPath;\n }\n throw new Error(\n `Resux deployment could resolve \"${packageName}\" to ${entryPath}, but could not locate its package root.`,\n );\n }\n}\n\nexport async function ensureResuxFrameworkRuntime(\n appRoot: string,\n runtimeRoots: string[],\n): Promise<void> {\n if (!runtimeRoots.length) {\n return;\n }\n\n const packageJsonPath = await resolvePackageJsonPath(appRoot, \"resuxjs\");\n const packageRoot = path.dirname(packageJsonPath);\n const distRoot = path.join(packageRoot, \"dist\");\n if (!(await pathExists(distRoot))) {\n throw new Error(\n `Resux deployment resolved resuxjs at ${packageRoot}, but its dist runtime is missing.`,\n );\n }\n\n const frameworkRuntimeDependencies = await collectServerRuntimeDependencyNames(distRoot);\n\n for (const runtimeRoot of runtimeRoots) {\n const targetRoot = path.join(runtimeRoot, \"node_modules\", \"resuxjs\");\n await rm(targetRoot, { recursive: true, force: true });\n await mkdir(targetRoot, { recursive: true });\n await cp(packageJsonPath, path.join(targetRoot, \"package.json\"), { force: true });\n await cp(distRoot, path.join(targetRoot, \"dist\"), {\n recursive: true,\n force: true,\n dereference: true,\n });\n }\n\n // Resux UI/icons are optional runtime surfaces. Only include Vue when the\n // packaged framework build actually imports it, so server-only/minimal\n // framework fixtures and consumers do not gain an unconditional dependency.\n if (frameworkRuntimeDependencies.includes(\"vue\")) {\n await ensureRuntimeDependencyTrees(\n appRoot,\n runtimeRoots,\n \"vue\",\n \"Resux framework Vue runtime\",\n );\n }\n}\n"],"mappings":";;;;;;;AAUA,eAAe,yBACb,aACA,WACwB;CACxB,IAAI,mBAAmB,KAAK,QAAQ,UAAU;AAE9C,QAAO,MAAM;EACX,MAAM,YAAY,KAAK,KAAK,kBAAkB,eAAe;AAE7D,OADqB,MAAM,eAAe,UAAU,GACnC,SAAS,YACxB,QAAO;EAGT,MAAM,kBAAkB,KAAK,QAAQ,iBAAiB;AACtD,MAAI,oBAAoB,iBACtB,QAAO;AAET,qBAAmB;;;AAIvB,eAAe,uBACb,SACA,aACiB;CACjB,MAAM,WAAW,cAAc,KAAK,KAAK,SAAS,eAAe,CAAC;AAElE,KAAI;AACF,SAAO,SAAS,QAAQ,GAAG,YAAY,eAAe;SAChD;EACN,MAAM,YAAY,SAAS,QAAQ,YAAY;EAC/C,MAAM,kBAAkB,MAAM,yBAAyB,aAAa,UAAU;AAC9E,MAAI,gBACF,QAAO;AAET,QAAM,IAAI,MACR,mCAAmC,YAAY,OAAO,UAAU,0CACjE;;;AAIL,eAAsB,4BACpB,SACA,cACe;AACf,KAAI,CAAC,aAAa,OAChB;CAGF,MAAM,kBAAkB,MAAM,uBAAuB,SAAS,UAAU;CACxE,MAAM,cAAc,KAAK,QAAQ,gBAAgB;CACjD,MAAM,WAAW,KAAK,KAAK,aAAa,OAAO;AAC/C,KAAI,CAAE,MAAM,WAAW,SAAS,CAC9B,OAAM,IAAI,MACR,wCAAwC,YAAY,oCACrD;CAGH,MAAM,+BAA+B,MAAM,oCAAoC,SAAS;AAExF,MAAK,MAAM,eAAe,cAAc;EACtC,MAAM,aAAa,KAAK,KAAK,aAAa,gBAAgB,UAAU;AACpE,QAAM,GAAG,YAAY;GAAE,WAAW;GAAM,OAAO;GAAM,CAAC;AACtD,QAAM,MAAM,YAAY,EAAE,WAAW,MAAM,CAAC;AAC5C,QAAM,GAAG,iBAAiB,KAAK,KAAK,YAAY,eAAe,EAAE,EAAE,OAAO,MAAM,CAAC;AACjF,QAAM,GAAG,UAAU,KAAK,KAAK,YAAY,OAAO,EAAE;GAChD,WAAW;GACX,OAAO;GACP,aAAa;GACd,CAAC;;AAMJ,KAAI,6BAA6B,SAAS,MAAM,CAC9C,OAAM,6BACJ,SACA,cACA,OACA,8BACD"}
@@ -1,7 +1,7 @@
1
1
  import { assertRuntimeClientAsset, ensureResuxClientAssets, ensureResuxServerPayload, pathExists } from "./common.js";
2
+ import { ensureRuntimeDependencyTrees, ensureServerRuntimeDependencyTrees } from "./runtime-dependencies.js";
2
3
  import { ensureResuxFrameworkRuntime } from "./framework-runtime.js";
3
4
  import { ensureResuxProductionReport } from "./production-report.js";
4
- import { ensureRuntimeDependencyTrees, ensureServerRuntimeDependencyTrees } from "./runtime-dependencies.js";
5
5
  import { readdir } from "node:fs/promises";
6
6
  import path from "node:path";
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { assertRuntimeClientAsset, ensureResuxClientAssets, ensureResuxServerPayload, pathExists, readJsonRecord, writeJson } from "./common.js";
2
+ import { ensureRuntimeDependencyTrees, ensureServerRuntimeDependencyTrees } from "./runtime-dependencies.js";
2
3
  import { ensureResuxFrameworkRuntime } from "./framework-runtime.js";
3
4
  import { ensureResuxProductionReport } from "./production-report.js";
4
- import { ensureRuntimeDependencyTrees, ensureServerRuntimeDependencyTrees } from "./runtime-dependencies.js";
5
5
  import { existsSync } from "node:fs";
6
6
  import { cp, lstat, mkdir, readdir, realpath, rm, stat, writeFile } from "node:fs/promises";
7
7
  import path from "node:path";
@@ -84,9 +84,9 @@ declare const Icon: vue0.DefineComponent<vue0.ExtractPropTypes<{
84
84
  default: string;
85
85
  };
86
86
  }>> & Readonly<{}>, {
87
- lazy: boolean;
88
87
  size: string | number;
89
88
  mode: string;
89
+ lazy: boolean;
90
90
  loading: string;
91
91
  apiProvider: string;
92
92
  class: string;
@@ -152,9 +152,9 @@ declare const ResuxIcon: vue0.DefineComponent<vue0.ExtractPropTypes<{
152
152
  default: string;
153
153
  };
154
154
  }>> & Readonly<{}>, {
155
- lazy: boolean;
156
155
  size: string | number;
157
156
  mode: string;
157
+ lazy: boolean;
158
158
  loading: string;
159
159
  apiProvider: string;
160
160
  class: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resuxjs",
3
- "version": "0.4.0-beta.3",
3
+ "version": "0.4.0-beta.4",
4
4
  "private": false,
5
5
  "description": "Resumable web framework with Vue-like SFC routing and a custom SSR/runtime pipeline.",
6
6
  "type": "module",