@vite-hub/workflow 0.5.1 → 0.6.0

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/dist/vite.d.ts CHANGED
@@ -229,7 +229,7 @@ interface ViteHubConsoleOperationAction {
229
229
  operation: string;
230
230
  input: Readonly<Record<string, string>>;
231
231
  /**
232
- * The result is `{ url }`, such as a one-time link or a provider sign-in: the Console opens it in a new tab, and loads
232
+ * The result is `{ url }`, such as a provider sign-in: the Console opens it in a new tab, and loads
233
233
  * the list again when the person comes back. The URL must be `https:`, or `http:` on a loopback host.
234
234
  */
235
235
  tab?: true;
package/dist/vite.js CHANGED
@@ -97,7 +97,11 @@ function encodeProviderOutputAliases(configAliases) {
97
97
  /** Select the runtime constants from one resolved Vite configuration. */
98
98
  function resolveViteHubBundleDefines(config) {
99
99
  const defines = {};
100
- for (const name of ["__VITEHUB_PUBLIC_URL__", "__VITEHUB_APP_BASE_URL__"]) {
100
+ for (const name of [
101
+ "__VITEHUB_PUBLIC_URL__",
102
+ "__VITEHUB_APP_BASE_URL__",
103
+ "__VITEHUB_CONSOLE_URL__"
104
+ ]) {
101
105
  const value = config.define?.[name];
102
106
  if (typeof value === "string") defines[name] = value;
103
107
  }
@@ -705,20 +709,20 @@ function createFileUrlPlugin$1() {
705
709
  }
706
710
  };
707
711
  }
708
- /**
709
- * Copies a `.wasm?module` import next to the bundle and keeps it as a relative `.wasm` import. Wrangler and Nitro load
710
- * such an import as a compiled WebAssembly module, which Workers need because they can't compile WebAssembly bytes.
711
- * Node.js compiles WebAssembly bytes, so there the import becomes the bytes of the file.
712
- */
713
712
  function createWasmModulePlugin(outdir, workingDir, copy) {
714
713
  return {
715
714
  name: "vitehub-wasm-module",
716
715
  async resolveId(source, importer, extra) {
717
- if (!source.endsWith(".wasm?module")) return;
718
- const resolved = await this.resolve(source.slice(0, -7), importerFor(importer, workingDir), {
716
+ const explicitModule = source.endsWith(".wasm?module");
717
+ if (!explicitModule && (!copy || !source.endsWith(".wasm") || extra.custom?.[skipMarkdownTemplateResolve$1])) return;
718
+ const path = explicitModule ? source.slice(0, -7) : source;
719
+ const resolved = await this.resolve(path, importerFor(importer, workingDir), {
719
720
  custom: extra.custom,
720
- kind: extra.kind
721
+ isEntry: extra.isEntry,
722
+ kind: extra.kind,
723
+ skipSelf: true
721
724
  });
725
+ if (!explicitModule && (!isFileResolution(resolved) || !resolved.id.endsWith(".wasm"))) return resolved ?? void 0;
722
726
  if (!isFileResolution(resolved)) this.error(`[vitehub] Could not resolve ${JSON.stringify(source)}.`);
723
727
  if (!copy) return resolved.id;
724
728
  const bytes = await readFile(resolved.id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vite-hub/workflow",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "description": "Workflow primitives and Vite integration for ViteHub.",
5
5
  "keywords": [
6
6
  "background-jobs",
@@ -65,7 +65,7 @@
65
65
  },
66
66
  "dependencies": {
67
67
  "@valibot/to-json-schema": "^1.8.0",
68
- "@vite-hub/runtime": "0.5.1",
68
+ "@vite-hub/runtime": "0.6.0",
69
69
  "defu": "^6.1.7",
70
70
  "esbuild": "^0.28.2",
71
71
  "h3": "^2.0.8",
@@ -88,7 +88,7 @@
88
88
  },
89
89
  "peerDependencies": {
90
90
  "@vercel/functions": "^3.11.3",
91
- "@vite-hub/database": "0.5.1",
91
+ "@vite-hub/database": "0.6.0",
92
92
  "@workflow/builders": "^5.1.4",
93
93
  "vite": ">=8.0.0",
94
94
  "workflow": "^5.7.1"