@absolutejs/absolute 0.20.0-beta.107 → 0.20.0-beta.108

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,35 +1,10 @@
1
- /** Dev-only Vue composable state tracking for bundled client output.
2
- *
3
- * The first HMR cycle of a Vue page starts from the BUNDLED graph (the
4
- * hydration index / page bundle / shared chunks emitted by `Bun.build`), not
5
- * from the dev module server. Every later cycle re-imports the edited
6
- * composable through `/@src/...`, where `moduleServer.injectComposableTracking`
7
- * wraps each `use*` export so ref values survive a reload. For that first
8
- * cycle to preserve state too, the bundled copy of each composable has to
9
- * record its refs under the SAME module id the module server will use —
10
- * the absolute path of the composable's source file.
11
- *
12
- * This pass finds every top-level `var useXxx = ...` in a bundled output,
13
- * resolves the source file it came from (Bun prints a `// <path>` comment at
14
- * each module boundary of unminified output), and wraps the initializer with
15
- * `__hmr_wrap(<moduleId>, <name>, <fn>)`. With code splitting on, a
16
- * composable shared by several pages lives in a `/chunk-*.js` file, so the
17
- * pass runs over the page bundles AND every chunk they (transitively) import.
18
- *
19
- * The statement end is located on `maskLiterals`-masked text: template
20
- * literals and comments are opaque placeholders there, so Bun's formatting
21
- * invariant ("nested code is indented, only top-level statements start at
22
- * column 0") is enough to find the terminating `;` without parsing — no
23
- * brace counting that a quote inside a comment or regex literal could
24
- * desynchronise. A `use*` binding whose end cannot be located is left
25
- * untouched rather than emitted half-wrapped. */
26
1
  export type VueComposableModuleIdOptions = {
27
2
  /** Directory Bun printed its module-boundary comments relative to. */
28
3
  projectRoot: string;
29
4
  /** Absolute path of the configured Vue directory (`vueDirectory`). */
30
5
  vueDir?: string;
31
6
  /** `<generatedRoot>/vue` — compileVue writes transpiled TS helpers to
32
- * `<generatedVueDir>/client/<path relative to vueDir>.js`. */
7
+ * a source mirror contained inside `<generatedVueDir>/client/`. */
33
8
  generatedVueDir?: string;
34
9
  };
35
10
  type ModuleIdResolver = (commentPath: string | undefined) => string;
@@ -54,8 +29,7 @@ export declare const injectVueComposableTrackingIntoContent: (content: string, r
54
29
  export declare const isSharedChunkPath: (path: string) => boolean;
55
30
  /** Map a Bun module-boundary comment path to the module id the dev module
56
31
  * server keys composable state by: the absolute source path. Transpiled TS
57
- * helpers under `<generatedVueDir>/client/` map back to their source under
58
- * `vueDir`; anything else (node_modules, other frameworks) resolves against
32
+ * helpers under `<generatedVueDir>/client/` map back to their original source paths; anything else (node_modules, other frameworks) resolves against
59
33
  * the project root and simply never matches a served module. */
60
34
  export declare const resolveVueComposableModuleId: (commentPath: string, options: VueComposableModuleIdOptions) => string;
61
35
  export {};
@@ -0,0 +1,7 @@
1
+ /** Mirror source paths under each compilation mode. Using the filesystem root
2
+ * preserves relative imports, including imports outside the configured Vue
3
+ * directory, without letting parent traversals escape the client/server tree.
4
+ * Encode the root separately so Windows drives and UNC roots cannot collide. */
5
+ export declare const vueModuleOutputPath: (outputDir: string, sourcePath: string) => string;
6
+ /** Reverse the generated mirror for composable hot-reload module identities. */
7
+ export declare const vueModuleSourcePath: (outputDir: string, outputPath: string) => string | null;
package/package.json CHANGED
@@ -537,7 +537,7 @@
537
537
  ]
538
538
  }
539
539
  },
540
- "version": "0.20.0-beta.107",
540
+ "version": "0.20.0-beta.108",
541
541
  "workspaces": [
542
542
  "tests/fixtures/*",
543
543
  "tests/fixtures/_packages/*"