attaform 0.27.5 → 0.28.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.
Files changed (184) hide show
  1. package/dist/abstract.d.mts +5 -4
  2. package/dist/abstract.mjs +4 -3
  3. package/dist/chunks/fingerprint.mjs +0 -1
  4. package/dist/chunks/fingerprint2.mjs +1 -2
  5. package/dist/dev/abstract.mjs +4 -0
  6. package/dist/{chunks → dev/chunks}/dev-key-collision-warnings.mjs +0 -1
  7. package/dist/{chunks → dev/chunks}/devtools.mjs +5 -6
  8. package/dist/{chunks/fingerprint.cjs → dev/chunks/fingerprint.mjs} +7 -10
  9. package/dist/{chunks/fingerprint2.cjs → dev/chunks/fingerprint2.mjs} +32 -35
  10. package/dist/dev/directive.mjs +1 -0
  11. package/dist/dev/history.mjs +89 -0
  12. package/dist/dev/index.mjs +5 -0
  13. package/dist/dev/runtime/plugins/attaform.mjs +40 -0
  14. package/dist/{shared/attaform.f2zyNh5d.cjs → dev/shared/attaform-dev.6qxD-Yqo.mjs} +187 -43
  15. package/dist/{shared/attaform.CQN9R62B.cjs → dev/shared/attaform-dev.BJGA_UOS.mjs} +1 -4
  16. package/dist/{shared/attaform.Dc1mx48r.mjs → dev/shared/attaform-dev.BR8u0YOZ.mjs} +6 -7
  17. package/dist/dev/shared/attaform-dev.BXE2cr0L.mjs +220 -0
  18. package/dist/dev/shared/attaform-dev.By4PRjt0.mjs +248 -0
  19. package/dist/{shared/attaform.Cg_8gFQ7.mjs → dev/shared/attaform-dev.D2I8e_Mm.mjs} +132 -568
  20. package/dist/dev/shared/attaform-dev.Dr2YzS5B.mjs +197 -0
  21. package/dist/{shared/attaform.nMaz2C5P.mjs → dev/shared/attaform-dev.P7cseiEG.mjs} +178 -397
  22. package/dist/{shared/attaform.BypWgXRB.mjs → dev/shared/attaform-dev.WmuhD_CZ.mjs} +3955 -5029
  23. package/dist/{shared/attaform.Dkjh_F30.mjs → dev/shared/attaform-dev.oYrkP9dj.mjs} +160 -508
  24. package/dist/dev/zod-v3.mjs +17 -0
  25. package/dist/dev/zod-v4.mjs +16 -0
  26. package/dist/dev/zod.mjs +5 -0
  27. package/dist/directive.d.mts +20 -0
  28. package/dist/directive.mjs +1 -0
  29. package/dist/esbuild.mjs +0 -1
  30. package/dist/history.d.mts +59 -0
  31. package/dist/history.mjs +89 -0
  32. package/dist/index.d.mts +11 -5
  33. package/dist/index.mjs +5 -4
  34. package/dist/nuxt.d.mts +1 -1
  35. package/dist/nuxt.mjs +5 -2
  36. package/dist/rollup.mjs +0 -1
  37. package/dist/rspack.d.mts +6 -1
  38. package/dist/rspack.mjs +0 -1
  39. package/dist/runtime/components/AttaformDevtoolsPanel.vue +9 -8
  40. package/dist/runtime/plugins/attaform.mjs +1 -2
  41. package/dist/shared/{attaform.CIBMfxg9.d.ts → attaform.B4VkS43-.d.mts} +2 -2
  42. package/dist/shared/{attaform.Cg1rUfcF.cjs → attaform.B8k8JrmK.mjs} +3778 -5297
  43. package/dist/shared/attaform.BJGA_UOS.mjs +0 -1
  44. package/dist/shared/{attaform.CTiZ9Rrv.mjs → attaform.C09fpdLS.mjs} +172 -16
  45. package/dist/shared/{attaform.Bh8A6YAc.cjs → attaform.CJP3RkGa.mjs} +141 -590
  46. package/dist/shared/{attaform.CzL2CZ8U.d.ts → attaform.Cgu-hdSb.d.mts} +328 -78
  47. package/dist/shared/attaform.Cs2Rbdlo.mjs +0 -1
  48. package/dist/shared/{attaform.DcFDQVpa.d.ts → attaform.D5V4tZWq.d.mts} +79 -179
  49. package/dist/shared/{attaform.CF-EnyJn.cjs → attaform.D6DCnnQu.mjs} +11 -16
  50. package/dist/shared/attaform.DhnPb6nK.mjs +0 -1
  51. package/dist/shared/attaform.Dq4vWxuG.mjs +197 -0
  52. package/dist/shared/attaform.JfSWdEcb.d.mts +44 -0
  53. package/dist/shared/attaform.KvlEedlF.mjs +0 -1
  54. package/dist/shared/{attaform.Crv0RNiz.cjs → attaform.NLmerepI.mjs} +175 -557
  55. package/dist/shared/attaform.h0i6LijT.mjs +242 -0
  56. package/dist/shared/{attaform.Biytrv0-.cjs → attaform.uLbun31C.mjs} +204 -544
  57. package/dist/shared/attaform.v0fQtWyA.mjs +0 -1
  58. package/dist/shared/attaform.wfY8XFvm.mjs +197 -0
  59. package/dist/transforms.mjs +0 -1
  60. package/dist/vite.d.mts +17 -5
  61. package/dist/vite.mjs +24 -2
  62. package/dist/webpack.d.mts +6 -1
  63. package/dist/webpack.mjs +0 -1
  64. package/dist/zod-v3.d.mts +11 -6
  65. package/dist/zod-v3.mjs +17 -4
  66. package/dist/zod-v4.d.mts +12 -6
  67. package/dist/zod-v4.mjs +16 -4
  68. package/dist/zod.d.mts +4 -3
  69. package/dist/zod.mjs +5 -4
  70. package/package.json +23 -8
  71. package/skills/attaform/SKILL.md +2 -1
  72. package/dist/abstract.cjs +0 -48
  73. package/dist/abstract.cjs.map +0 -1
  74. package/dist/abstract.d.cts +0 -42
  75. package/dist/abstract.d.ts +0 -42
  76. package/dist/abstract.mjs.map +0 -1
  77. package/dist/chunks/dev-key-collision-warnings.cjs +0 -25
  78. package/dist/chunks/dev-key-collision-warnings.cjs.map +0 -1
  79. package/dist/chunks/dev-key-collision-warnings.mjs.map +0 -1
  80. package/dist/chunks/devtools.cjs +0 -157
  81. package/dist/chunks/devtools.cjs.map +0 -1
  82. package/dist/chunks/devtools.mjs.map +0 -1
  83. package/dist/chunks/fingerprint.cjs.map +0 -1
  84. package/dist/chunks/fingerprint.mjs.map +0 -1
  85. package/dist/chunks/fingerprint2.cjs.map +0 -1
  86. package/dist/chunks/fingerprint2.mjs.map +0 -1
  87. package/dist/esbuild.cjs +0 -28
  88. package/dist/esbuild.cjs.map +0 -1
  89. package/dist/esbuild.d.cts +0 -56
  90. package/dist/esbuild.d.ts +0 -56
  91. package/dist/esbuild.mjs.map +0 -1
  92. package/dist/index.cjs +0 -51
  93. package/dist/index.cjs.map +0 -1
  94. package/dist/index.d.cts +0 -249
  95. package/dist/index.d.ts +0 -249
  96. package/dist/index.mjs.map +0 -1
  97. package/dist/nuxt.cjs +0 -84
  98. package/dist/nuxt.cjs.map +0 -1
  99. package/dist/nuxt.d.cts +0 -66
  100. package/dist/nuxt.d.ts +0 -66
  101. package/dist/nuxt.mjs.map +0 -1
  102. package/dist/rollup.cjs +0 -24
  103. package/dist/rollup.cjs.map +0 -1
  104. package/dist/rollup.d.cts +0 -35
  105. package/dist/rollup.d.ts +0 -35
  106. package/dist/rollup.mjs.map +0 -1
  107. package/dist/rspack.cjs +0 -10
  108. package/dist/rspack.cjs.map +0 -1
  109. package/dist/rspack.d.cts +0 -40
  110. package/dist/rspack.d.ts +0 -40
  111. package/dist/rspack.mjs.map +0 -1
  112. package/dist/runtime/components/AttaformDevtoolsPanel.vue.d.ts +0 -7
  113. package/dist/runtime/components/DevtoolsValueTree.vue.d.ts +0 -35
  114. package/dist/runtime/plugins/attaform.cjs +0 -43
  115. package/dist/runtime/plugins/attaform.cjs.map +0 -1
  116. package/dist/runtime/plugins/attaform.d.cts +0 -5
  117. package/dist/runtime/plugins/attaform.d.ts +0 -5
  118. package/dist/runtime/plugins/attaform.mjs.map +0 -1
  119. package/dist/shared/attaform.B3abZaCV.d.cts +0 -2484
  120. package/dist/shared/attaform.BJGA_UOS.mjs.map +0 -1
  121. package/dist/shared/attaform.Bh8A6YAc.cjs.map +0 -1
  122. package/dist/shared/attaform.Biytrv0-.cjs.map +0 -1
  123. package/dist/shared/attaform.Bn0IzhD_.cjs +0 -800
  124. package/dist/shared/attaform.Bn0IzhD_.cjs.map +0 -1
  125. package/dist/shared/attaform.BypWgXRB.mjs.map +0 -1
  126. package/dist/shared/attaform.C9fPTxjB.d.cts +0 -41
  127. package/dist/shared/attaform.C9fPTxjB.d.ts +0 -41
  128. package/dist/shared/attaform.CF-EnyJn.cjs.map +0 -1
  129. package/dist/shared/attaform.CJ1Z9Mz4.d.mts +0 -2484
  130. package/dist/shared/attaform.CQN9R62B.cjs.map +0 -1
  131. package/dist/shared/attaform.CTiZ9Rrv.mjs.map +0 -1
  132. package/dist/shared/attaform.Cg1rUfcF.cjs.map +0 -1
  133. package/dist/shared/attaform.Cg_8gFQ7.mjs.map +0 -1
  134. package/dist/shared/attaform.Crv0RNiz.cjs.map +0 -1
  135. package/dist/shared/attaform.Cs2Rbdlo.mjs.map +0 -1
  136. package/dist/shared/attaform.CzL2CZ8U.d.cts +0 -4713
  137. package/dist/shared/attaform.CzL2CZ8U.d.mts +0 -4713
  138. package/dist/shared/attaform.DRUT703x.d.cts +0 -56
  139. package/dist/shared/attaform.DRUT703x.d.ts +0 -56
  140. package/dist/shared/attaform.DYwyM5Cp.d.cts +0 -232
  141. package/dist/shared/attaform.Dc1mx48r.mjs.map +0 -1
  142. package/dist/shared/attaform.DhnPb6nK.mjs.map +0 -1
  143. package/dist/shared/attaform.Dkjh_F30.mjs.map +0 -1
  144. package/dist/shared/attaform.DoQm_Vkd.cjs +0 -58
  145. package/dist/shared/attaform.DoQm_Vkd.cjs.map +0 -1
  146. package/dist/shared/attaform.DrHOqB-d.d.mts +0 -232
  147. package/dist/shared/attaform.KvlEedlF.mjs.map +0 -1
  148. package/dist/shared/attaform.RaTzp1WF.cjs +0 -26
  149. package/dist/shared/attaform.RaTzp1WF.cjs.map +0 -1
  150. package/dist/shared/attaform.f2zyNh5d.cjs.map +0 -1
  151. package/dist/shared/attaform.nMaz2C5P.mjs.map +0 -1
  152. package/dist/shared/attaform.v0fQtWyA.mjs.map +0 -1
  153. package/dist/shared/attaform.yUrz7C2z.cjs +0 -29
  154. package/dist/shared/attaform.yUrz7C2z.cjs.map +0 -1
  155. package/dist/transforms.cjs +0 -12
  156. package/dist/transforms.cjs.map +0 -1
  157. package/dist/transforms.d.cts +0 -73
  158. package/dist/transforms.d.ts +0 -73
  159. package/dist/transforms.mjs.map +0 -1
  160. package/dist/vite.cjs +0 -363
  161. package/dist/vite.cjs.map +0 -1
  162. package/dist/vite.d.cts +0 -133
  163. package/dist/vite.d.ts +0 -133
  164. package/dist/vite.mjs.map +0 -1
  165. package/dist/webpack.cjs +0 -10
  166. package/dist/webpack.cjs.map +0 -1
  167. package/dist/webpack.d.cts +0 -37
  168. package/dist/webpack.d.ts +0 -37
  169. package/dist/webpack.mjs.map +0 -1
  170. package/dist/zod-v3.cjs +0 -53
  171. package/dist/zod-v3.cjs.map +0 -1
  172. package/dist/zod-v3.d.cts +0 -246
  173. package/dist/zod-v3.d.ts +0 -246
  174. package/dist/zod-v3.mjs.map +0 -1
  175. package/dist/zod-v4.cjs +0 -55
  176. package/dist/zod-v4.cjs.map +0 -1
  177. package/dist/zod-v4.d.cts +0 -172
  178. package/dist/zod-v4.d.ts +0 -172
  179. package/dist/zod-v4.mjs.map +0 -1
  180. package/dist/zod.cjs +0 -51
  181. package/dist/zod.cjs.map +0 -1
  182. package/dist/zod.d.cts +0 -7
  183. package/dist/zod.d.ts +0 -7
  184. package/dist/zod.mjs.map +0 -1
package/dist/rollup.d.ts DELETED
@@ -1,35 +0,0 @@
1
- /** Options for the Rollup `attaform()` plugin. */
2
- interface AttaformRollupPluginOptions {
3
- /**
4
- * Rewrite `attaform` and `attaform/zod` imports at build time to the
5
- * matching adapter subpath. Default `true`. Set to `false` to keep the
6
- * runtime-dispatch unified entry (ships both adapters).
7
- */
8
- resolveZodAlias?: boolean;
9
- /**
10
- * Project root to resolve the installed Zod from. Defaults to
11
- * `process.cwd()`. Set this when the build runs from a directory other
12
- * than the project that owns the Zod dependency.
13
- */
14
- root?: string;
15
- }
16
- interface RollupResolveContext {
17
- resolve(source: string, importer: string | undefined, options: {
18
- skipSelf: boolean;
19
- }): Promise<{
20
- id: string;
21
- external: boolean | 'absolute' | 'relative';
22
- } | null>;
23
- }
24
- /** The structural shape Rollup requires of the plugin. */
25
- interface AttaformRollupPlugin {
26
- name: string;
27
- buildStart(): void;
28
- resolveId(this: RollupResolveContext, source: string, importer: string | undefined): Promise<{
29
- id: string;
30
- } | null> | null;
31
- }
32
- declare function attaform(options?: AttaformRollupPluginOptions): AttaformRollupPlugin;
33
-
34
- export { attaform };
35
- export type { AttaformRollupPlugin, AttaformRollupPluginOptions };
@@ -1 +0,0 @@
1
- {"version":3,"file":"rollup.mjs","sources":["../src/rollup.ts"],"sourcesContent":["/**\n * `attaform/rollup` — Rollup plugin that rewrites `attaform` and\n * `attaform/zod` imports to the single matching adapter subpath\n * (`attaform/zod-v3` or `attaform/zod-v4`) at build time, based on the\n * consumer's installed Zod major. Without it, Rollup ships both adapters\n * because those entries import both for runtime dispatch.\n *\n * Usage:\n *\n * // rollup.config.js\n * import { attaform } from 'attaform/rollup'\n *\n * export default {\n * plugins: [attaform()],\n * }\n *\n * This plugin only does the adapter rewrite. The Vue SFC `v-register`\n * transforms that `attaform/vite` wires (load-bearing for SSR initial\n * render) are `@vitejs/plugin-vue`-specific and do not transfer; a\n * non-Vite consumer that needs them wires `attaform/transforms` into\n * their Vue compiler separately.\n *\n * Zero-dep: the plugin imports nothing from `rollup` (the bundler injects\n * its plugin context at the consumer's build); the structural types below\n * are all it needs to compile.\n */\nimport { isRewritableZodSpecifier, resolveZodAliasTarget } from './core/detect-zod-major'\n\n/** Options for the Rollup `attaform()` plugin. */\nexport interface AttaformRollupPluginOptions {\n /**\n * Rewrite `attaform` and `attaform/zod` imports at build time to the\n * matching adapter subpath. Default `true`. Set to `false` to keep the\n * runtime-dispatch unified entry (ships both adapters).\n */\n resolveZodAlias?: boolean\n /**\n * Project root to resolve the installed Zod from. Defaults to\n * `process.cwd()`. Set this when the build runs from a directory other\n * than the project that owns the Zod dependency.\n */\n root?: string\n}\n\ninterface RollupResolveContext {\n resolve(\n source: string,\n importer: string | undefined,\n options: { skipSelf: boolean }\n ): Promise<{ id: string; external: boolean | 'absolute' | 'relative' } | null>\n}\n\n/** The structural shape Rollup requires of the plugin. */\nexport interface AttaformRollupPlugin {\n name: string\n buildStart(): void\n resolveId(\n this: RollupResolveContext,\n source: string,\n importer: string | undefined\n ): Promise<{ id: string } | null> | null\n}\n\nexport function attaform(options: AttaformRollupPluginOptions = {}): AttaformRollupPlugin {\n const resolveZodAlias = options.resolveZodAlias !== false\n const root = options.root ?? process.cwd()\n const warnState = { warned: false }\n let aliasTarget: string | null = null\n\n return {\n name: 'attaform',\n buildStart() {\n // Detect once at build start (fail fast on missing zod). `buildStart`\n // is guaranteed to run before any `resolveId`, so the target is set\n // before the rewrite hook fires.\n aliasTarget = resolveZodAliasTarget(root, 'attaform/rollup', resolveZodAlias, warnState)\n },\n resolveId(source, importer) {\n if (aliasTarget === null) return null\n // Both the bare `attaform` barrel and the explicit `attaform/zod`\n // carry the runtime dispatcher, so both collapse to the one detected\n // adapter; the pinned subpaths pass through untouched.\n if (!isRewritableZodSpecifier(source)) return null\n // Re-run the rewritten specifier through the resolver chain so the\n // matching subpath export lands as a real module. `skipSelf` keeps\n // the hook reentrant (our source check rejects the rewritten target\n // anyway, since it is no longer a rewritable specifier).\n return this.resolve(aliasTarget, importer, { skipSelf: true })\n },\n }\n}\n"],"names":[],"mappings":";;AA+DO,SAAS,QAAA,CAAS,OAAA,GAAuC,EAAC,EAAyB;AACxF,EAAA,MAAM,eAAA,GAAkB,QAAQ,eAAA,KAAoB,KAAA;AACpD,EAAA,MAAM,IAAA,GAAO,OAAA,CAAQ,IAAA,IAAQ,OAAA,CAAQ,GAAA,EAAI;AACzC,EAAA,MAAM,SAAA,GAAY,EAAE,MAAA,EAAQ,KAAA,EAAM;AAClC,EAAA,IAAI,WAAA,GAA6B,IAAA;AAEjC,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,UAAA,GAAa;AAIX,MAAA,WAAA,GAAc,qBAAA,CAAsB,IAAA,EAAM,iBAAA,EAAmB,eAAA,EAAiB,SAAS,CAAA;AAAA,IACzF,CAAA;AAAA,IACA,SAAA,CAAU,QAAQ,QAAA,EAAU;AAC1B,MAAA,IAAI,WAAA,KAAgB,MAAM,OAAO,IAAA;AAIjC,MAAA,IAAI,CAAC,wBAAA,CAAyB,MAAM,CAAA,EAAG,OAAO,IAAA;AAK9C,MAAA,OAAO,KAAK,OAAA,CAAQ,WAAA,EAAa,UAAU,EAAE,QAAA,EAAU,MAAM,CAAA;AAAA,IAC/D;AAAA,GACF;AACF;;;;"}
package/dist/rspack.cjs DELETED
@@ -1,10 +0,0 @@
1
- 'use strict';
2
-
3
- const webpackFamilyPlugin = require('./shared/attaform.RaTzp1WF.cjs');
4
-
5
- function attaform(options = {}) {
6
- return webpackFamilyPlugin.createWebpackFamilyPlugin("attaform/rspack", options);
7
- }
8
-
9
- exports.attaform = attaform;
10
- //# sourceMappingURL=rspack.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rspack.cjs","sources":["../src/rspack.ts"],"sourcesContent":["/**\n * `attaform/rspack` — Rspack plugin that rewrites `attaform/zod` imports\n * to the single matching adapter subpath (`attaform/zod-v3` or\n * `attaform/zod-v4`) at build time, based on the consumer's installed Zod\n * major. Without it, Rspack ships both adapters because the unified\n * `attaform/zod` entry imports both for runtime dispatch.\n *\n * Usage:\n *\n * // rspack.config.mjs\n * import { attaform } from 'attaform/rspack'\n *\n * export default {\n * plugins: [attaform()],\n * }\n *\n * Rspack mirrors webpack's plugin API for the resolve hook attaform taps,\n * so this shares its body with `attaform/webpack` via\n * `createWebpackFamilyPlugin`; only the diagnostic tag differs.\n *\n * This plugin only does the adapter rewrite. The Vue SFC `v-register`\n * transforms that `attaform/vite` wires (load-bearing for SSR initial\n * render) are `@vitejs/plugin-vue`-specific and do not transfer; a\n * non-Vite consumer that needs them wires `attaform/transforms` into\n * their Vue compiler separately.\n *\n * Zero-dep: the plugin imports nothing from `@rspack/core` (it taps the\n * resolve hook the compiler injects at the consumer's build).\n */\nimport {\n createWebpackFamilyPlugin,\n type WebpackFamilyPlugin,\n type WebpackFamilyPluginOptions,\n} from './core/webpack-family-plugin'\n\n/** Options for the Rspack `attaform()` plugin. */\nexport type AttaformRspackPluginOptions = WebpackFamilyPluginOptions\n/** The structural shape Rspack requires of the plugin. */\nexport type AttaformRspackPlugin = WebpackFamilyPlugin\n\nexport function attaform(options: AttaformRspackPluginOptions = {}): AttaformRspackPlugin {\n return createWebpackFamilyPlugin('attaform/rspack', options)\n}\n"],"names":["createWebpackFamilyPlugin"],"mappings":";;;;AAwCO,SAAS,QAAA,CAAS,OAAA,GAAuC,EAAC,EAAyB;AACxF,EAAA,OAAOA,6CAAA,CAA0B,mBAAmB,OAAO,CAAA;AAC7D;;;;"}
package/dist/rspack.d.cts DELETED
@@ -1,40 +0,0 @@
1
- import { W as WebpackFamilyPlugin, a as WebpackFamilyPluginOptions } from './shared/attaform.C9fPTxjB.cjs';
2
-
3
- /**
4
- * `attaform/rspack` — Rspack plugin that rewrites `attaform/zod` imports
5
- * to the single matching adapter subpath (`attaform/zod-v3` or
6
- * `attaform/zod-v4`) at build time, based on the consumer's installed Zod
7
- * major. Without it, Rspack ships both adapters because the unified
8
- * `attaform/zod` entry imports both for runtime dispatch.
9
- *
10
- * Usage:
11
- *
12
- * // rspack.config.mjs
13
- * import { attaform } from 'attaform/rspack'
14
- *
15
- * export default {
16
- * plugins: [attaform()],
17
- * }
18
- *
19
- * Rspack mirrors webpack's plugin API for the resolve hook attaform taps,
20
- * so this shares its body with `attaform/webpack` via
21
- * `createWebpackFamilyPlugin`; only the diagnostic tag differs.
22
- *
23
- * This plugin only does the adapter rewrite. The Vue SFC `v-register`
24
- * transforms that `attaform/vite` wires (load-bearing for SSR initial
25
- * render) are `@vitejs/plugin-vue`-specific and do not transfer; a
26
- * non-Vite consumer that needs them wires `attaform/transforms` into
27
- * their Vue compiler separately.
28
- *
29
- * Zero-dep: the plugin imports nothing from `@rspack/core` (it taps the
30
- * resolve hook the compiler injects at the consumer's build).
31
- */
32
-
33
- /** Options for the Rspack `attaform()` plugin. */
34
- type AttaformRspackPluginOptions = WebpackFamilyPluginOptions;
35
- /** The structural shape Rspack requires of the plugin. */
36
- type AttaformRspackPlugin = WebpackFamilyPlugin;
37
- declare function attaform(options?: AttaformRspackPluginOptions): AttaformRspackPlugin;
38
-
39
- export { attaform };
40
- export type { AttaformRspackPlugin, AttaformRspackPluginOptions };
package/dist/rspack.d.ts DELETED
@@ -1,40 +0,0 @@
1
- import { W as WebpackFamilyPlugin, a as WebpackFamilyPluginOptions } from './shared/attaform.C9fPTxjB.js';
2
-
3
- /**
4
- * `attaform/rspack` — Rspack plugin that rewrites `attaform/zod` imports
5
- * to the single matching adapter subpath (`attaform/zod-v3` or
6
- * `attaform/zod-v4`) at build time, based on the consumer's installed Zod
7
- * major. Without it, Rspack ships both adapters because the unified
8
- * `attaform/zod` entry imports both for runtime dispatch.
9
- *
10
- * Usage:
11
- *
12
- * // rspack.config.mjs
13
- * import { attaform } from 'attaform/rspack'
14
- *
15
- * export default {
16
- * plugins: [attaform()],
17
- * }
18
- *
19
- * Rspack mirrors webpack's plugin API for the resolve hook attaform taps,
20
- * so this shares its body with `attaform/webpack` via
21
- * `createWebpackFamilyPlugin`; only the diagnostic tag differs.
22
- *
23
- * This plugin only does the adapter rewrite. The Vue SFC `v-register`
24
- * transforms that `attaform/vite` wires (load-bearing for SSR initial
25
- * render) are `@vitejs/plugin-vue`-specific and do not transfer; a
26
- * non-Vite consumer that needs them wires `attaform/transforms` into
27
- * their Vue compiler separately.
28
- *
29
- * Zero-dep: the plugin imports nothing from `@rspack/core` (it taps the
30
- * resolve hook the compiler injects at the consumer's build).
31
- */
32
-
33
- /** Options for the Rspack `attaform()` plugin. */
34
- type AttaformRspackPluginOptions = WebpackFamilyPluginOptions;
35
- /** The structural shape Rspack requires of the plugin. */
36
- type AttaformRspackPlugin = WebpackFamilyPlugin;
37
- declare function attaform(options?: AttaformRspackPluginOptions): AttaformRspackPlugin;
38
-
39
- export { attaform };
40
- export type { AttaformRspackPlugin, AttaformRspackPluginOptions };
@@ -1 +0,0 @@
1
- {"version":3,"file":"rspack.mjs","sources":["../src/rspack.ts"],"sourcesContent":["/**\n * `attaform/rspack` — Rspack plugin that rewrites `attaform/zod` imports\n * to the single matching adapter subpath (`attaform/zod-v3` or\n * `attaform/zod-v4`) at build time, based on the consumer's installed Zod\n * major. Without it, Rspack ships both adapters because the unified\n * `attaform/zod` entry imports both for runtime dispatch.\n *\n * Usage:\n *\n * // rspack.config.mjs\n * import { attaform } from 'attaform/rspack'\n *\n * export default {\n * plugins: [attaform()],\n * }\n *\n * Rspack mirrors webpack's plugin API for the resolve hook attaform taps,\n * so this shares its body with `attaform/webpack` via\n * `createWebpackFamilyPlugin`; only the diagnostic tag differs.\n *\n * This plugin only does the adapter rewrite. The Vue SFC `v-register`\n * transforms that `attaform/vite` wires (load-bearing for SSR initial\n * render) are `@vitejs/plugin-vue`-specific and do not transfer; a\n * non-Vite consumer that needs them wires `attaform/transforms` into\n * their Vue compiler separately.\n *\n * Zero-dep: the plugin imports nothing from `@rspack/core` (it taps the\n * resolve hook the compiler injects at the consumer's build).\n */\nimport {\n createWebpackFamilyPlugin,\n type WebpackFamilyPlugin,\n type WebpackFamilyPluginOptions,\n} from './core/webpack-family-plugin'\n\n/** Options for the Rspack `attaform()` plugin. */\nexport type AttaformRspackPluginOptions = WebpackFamilyPluginOptions\n/** The structural shape Rspack requires of the plugin. */\nexport type AttaformRspackPlugin = WebpackFamilyPlugin\n\nexport function attaform(options: AttaformRspackPluginOptions = {}): AttaformRspackPlugin {\n return createWebpackFamilyPlugin('attaform/rspack', options)\n}\n"],"names":[],"mappings":";;AAwCO,SAAS,QAAA,CAAS,OAAA,GAAuC,EAAC,EAAyB;AACxF,EAAA,OAAO,yBAAA,CAA0B,mBAAmB,OAAO,CAAA;AAC7D;;;;"}
@@ -1,7 +0,0 @@
1
- import { type AttaformDevtoolsBridge } from 'attaform';
2
- type __VLS_Props = {
3
- bridge: AttaformDevtoolsBridge;
4
- };
5
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
6
- declare const _default: typeof __VLS_export;
7
- export default _default;
@@ -1,35 +0,0 @@
1
- type __VLS_Props = {
2
- value: unknown;
3
- label?: string;
4
- depth?: number;
5
- /**
6
- * Path-from-root for this node. Used by edit-aware mounts so the
7
- * commit handler knows which leaf the user just touched. Default
8
- * `[]` for non-editable mounts; the panel passes the explicit path
9
- * when it wires up `onEdit`.
10
- */
11
- path?: ReadonlyArray<string | number>;
12
- /**
13
- * Edit-mode toggle. When `true` and `onEdit` is wired, leaf cells
14
- * become click-to-edit. Values render raw (DevTools does not redact).
15
- */
16
- editable?: boolean | undefined;
17
- onEdit?: ((path: ReadonlyArray<string | number>, next: unknown) => void) | undefined;
18
- /**
19
- * Canonical JSON-array key of the currently-selected path (`null`
20
- * for no selection). Compared against this node's own key so the
21
- * key label can render in a highlighted state. Plumbed as a key
22
- * rather than a path array because string equality is cheap and
23
- * cross-renders consistently.
24
- */
25
- selectedKey?: string | null | undefined;
26
- /**
27
- * Click handler for the key label. Called with the node's current
28
- * path-from-root; the panel toggles selection on identical paths.
29
- * When omitted, the key label is plain text (no selection UX).
30
- */
31
- onSelectPath?: ((path: ReadonlyArray<string | number>) => void) | undefined;
32
- };
33
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
34
- declare const _default: typeof __VLS_export;
35
- export default _default;
@@ -1,43 +0,0 @@
1
- 'use strict';
2
-
3
- const app = require('nuxt/app');
4
- const devtoolsShared = require('../../shared/attaform.Biytrv0-.cjs');
5
-
6
- var attaform_default = app.defineNuxtPlugin({
7
- // `enforce: 'pre'` makes the "we run before any component's setup" claim
8
- // explicit. Combined with `prepend: true` on the addPlugin call in
9
- // src/nuxt.ts, this guarantees hydration is staged into pendingHydration
10
- // before any user plugin or page can call `useForm`. Without it, a user
11
- // plugin running first would observe an empty registry and skip hydration.
12
- enforce: "pre",
13
- setup(nuxtApp) {
14
- const isServer = undefined;
15
- const config = app.useRuntimeConfig().public;
16
- const { defaults, version } = config.attaform;
17
- nuxtApp.vueApp.use(devtoolsShared.createAttaform({ ssr: isServer, defaults }));
18
- nuxtApp.vueApp.provide(devtoolsShared.kAttaformWizardActiveStepResolver, (param) => {
19
- const value = app.useRoute().query[param];
20
- if (typeof value === "string") return value;
21
- if (Array.isArray(value) && typeof value[0] === "string") return value[0];
22
- return void 0;
23
- });
24
- if (isServer) {
25
- nuxtApp.hook("app:rendered", () => {
26
- const state = devtoolsShared.renderAttaformState(nuxtApp.vueApp);
27
- nuxtApp.payload.attaform = state;
28
- });
29
- } else {
30
- const serialized = nuxtApp.payload.attaform;
31
- if (serialized !== void 0) {
32
- devtoolsShared.hydrateAttaformState(nuxtApp.vueApp, serialized);
33
- }
34
- if (undefined) {
35
- const registry = devtoolsShared.getRegistryFromApp(nuxtApp.vueApp);
36
- window[devtoolsShared.DEVTOOLS_WINDOW_KEY] = { registry, version };
37
- }
38
- }
39
- }
40
- });
41
-
42
- module.exports = attaform_default;
43
- //# sourceMappingURL=attaform.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"attaform.cjs","sources":["../../../src/runtime/plugins/attaform.ts"],"sourcesContent":["/**\n * Nuxt plugin: installs the framework-agnostic createAttaform Vue\n * plugin on nuxtApp.vueApp and wires the Nuxt payload mechanism to the\n * registry's SSR serialization helpers. Replaces the old split of\n * register.ts (client-only) + register-stub.ts (server-only).\n *\n * Runs on BOTH server and client — Vue's SSR renderer is a natural no-op\n * for directive lifecycle hooks, so the same plugin works on both sides\n * without a stub.\n */\nimport { defineNuxtPlugin, useRoute, useRuntimeConfig } from 'nuxt/app'\nimport { DEVTOOLS_WINDOW_KEY } from '../core/devtools-shared'\nimport { createAttaform } from '../core/plugin'\nimport { getRegistryFromApp, kAttaformWizardActiveStepResolver } from '../core/registry'\nimport { hydrateAttaformState, renderAttaformState } from '../core/serialize'\nimport type { SerializedAttaformState } from '../core/serialize'\nimport type { AttaformDefaults } from '../types/types-api'\n\nexport default defineNuxtPlugin({\n // `enforce: 'pre'` makes the \"we run before any component's setup\" claim\n // explicit. Combined with `prepend: true` on the addPlugin call in\n // src/nuxt.ts, this guarantees hydration is staged into pendingHydration\n // before any user plugin or page can call `useForm`. Without it, a user\n // plugin running first would observe an empty registry and skip hydration.\n enforce: 'pre',\n setup(nuxtApp) {\n const isServer = import.meta.server\n\n // Read app-level defaults from the Nuxt module's runtime-config slot\n // (populated in src/nuxt.ts). The module ships in the same package\n // as this plugin, so the slot is always present and well-typed.\n const config = useRuntimeConfig().public as {\n attaform: { defaults: AttaformDefaults; version: string }\n }\n const { defaults, version } = config.attaform\n\n nuxtApp.vueApp.use(createAttaform({ ssr: isServer, defaults }))\n\n // Bridge `useWizard`'s active-step resolution to the Nuxt route so\n // deep-links hydrate without flicker. On the server, `useRoute()`\n // reads the incoming request URL; on the client, it reads the live\n // route — so server and client compute the same initial step and\n // Vue's hydration walks a matching tree. Without this bridge, the\n // wizard would fall back to its first step on the server while the\n // client reads the URL, producing the deep-link mismatch cascade.\n // Consumers can still pass `options.restore` explicitly to override;\n // this just removes the boilerplate for the common case.\n nuxtApp.vueApp.provide(kAttaformWizardActiveStepResolver, (param) => {\n const value = useRoute().query[param]\n if (typeof value === 'string') return value\n if (Array.isArray(value) && typeof value[0] === 'string') return value[0]\n return undefined\n })\n\n if (isServer) {\n // After the app renders, capture every FormStore into the Nuxt payload\n // so the client can hydrate with matching form values and errors.\n nuxtApp.hook('app:rendered', () => {\n const state = renderAttaformState(nuxtApp.vueApp)\n ;(nuxtApp.payload as unknown as { attaform?: SerializedAttaformState }).attaform = state\n })\n } else {\n // Stage the payload into pendingHydration so `useForm` finds it. The\n // `enforce: 'pre'` + `prepend: true` pair above is what makes it safe\n // to assume this runs before any user setup.\n const serialized = (nuxtApp.payload as unknown as { attaform?: SerializedAttaformState })\n .attaform\n if (serialized !== undefined) {\n hydrateAttaformState(nuxtApp.vueApp, serialized)\n }\n\n // Dev-only: attach the registry to window so the Nuxt DevTools overlay\n // panel (which runs in an iframe at /_attaform_devtools) can reach it\n // via `window.parent.__attaform_devtools__`. The bridge holds a live\n // reference to the registry — Vue's reactivity flows across the\n // same-origin iframe boundary, so the panel re-renders on every form\n // mutation without an explicit push channel. `import.meta.dev` is\n // statically replaced by Nuxt at build time, so this whole branch is\n // tree-shaken from production builds.\n if (import.meta.dev) {\n const registry = getRegistryFromApp(nuxtApp.vueApp)\n window[DEVTOOLS_WINDOW_KEY] = { registry, version }\n }\n }\n },\n})\n"],"names":["defineNuxtPlugin","useRuntimeConfig","createAttaform","kAttaformWizardActiveStepResolver","useRoute","renderAttaformState","hydrateAttaformState","getRegistryFromApp","DEVTOOLS_WINDOW_KEY"],"mappings":";;;;;AAkBA,IAAO,mBAAQA,oBAAA,CAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,OAAA,EAAS,KAAA;AAAA,EACT,MAAM,OAAA,EAAS;AACb,IAAA,MAAM,WAAW,SAAY;AAK7B,IAAA,MAAM,MAAA,GAASC,sBAAiB,CAAE,MAAA;AAGlC,IAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAQ,GAAI,MAAA,CAAO,QAAA;AAErC,IAAA,OAAA,CAAQ,MAAA,CAAO,IAAIC,6BAAA,CAAe,EAAE,KAAK,QAAA,EAAU,QAAA,EAAU,CAAC,CAAA;AAW9D,IAAA,OAAA,CAAQ,MAAA,CAAO,OAAA,CAAQC,gDAAA,EAAmC,CAAC,KAAA,KAAU;AACnE,MAAA,MAAM,KAAA,GAAQC,YAAA,EAAS,CAAE,KAAA,CAAM,KAAK,CAAA;AACpC,MAAA,IAAI,OAAO,KAAA,KAAU,QAAA,EAAU,OAAO,KAAA;AACtC,MAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,IAAK,OAAO,KAAA,CAAM,CAAC,CAAA,KAAM,QAAA,EAAU,OAAO,KAAA,CAAM,CAAC,CAAA;AACxE,MAAA,OAAO,MAAA;AAAA,IACT,CAAC,CAAA;AAED,IAAA,IAAI,QAAA,EAAU;AAGZ,MAAA,OAAA,CAAQ,IAAA,CAAK,gBAAgB,MAAM;AACjC,QAAA,MAAM,KAAA,GAAQC,kCAAA,CAAoB,OAAA,CAAQ,MAAM,CAAA;AAC/C,QAAC,OAAA,CAAQ,QAA8D,QAAA,GAAW,KAAA;AAAA,MACrF,CAAC,CAAA;AAAA,IACH,CAAA,MAAO;AAIL,MAAA,MAAM,UAAA,GAAc,QAAQ,OAAA,CACzB,QAAA;AACH,MAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,QAAAC,mCAAA,CAAqB,OAAA,CAAQ,QAAQ,UAAU,CAAA;AAAA,MACjD;AAUA,MAAA,IAAI,SAAY,EAAK;AACnB,QAAA,MAAM,QAAA,GAAWC,iCAAA,CAAmB,OAAA,CAAQ,MAAM,CAAA;AAClD,QAAA,MAAA,CAAOC,kCAAmB,CAAA,GAAI,EAAE,QAAA,EAAU,OAAA,EAAQ;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;;"}
@@ -1,5 +0,0 @@
1
- import * as nuxt_app from 'nuxt/app';
2
-
3
- declare const _default: nuxt_app.Plugin<Record<string, unknown>> & nuxt_app.ObjectPlugin<Record<string, unknown>>;
4
-
5
- export = _default;
@@ -1,5 +0,0 @@
1
- import * as nuxt_app from 'nuxt/app';
2
-
3
- declare const _default: nuxt_app.Plugin<Record<string, unknown>> & nuxt_app.ObjectPlugin<Record<string, unknown>>;
4
-
5
- export = _default;
@@ -1 +0,0 @@
1
- {"version":3,"file":"attaform.mjs","sources":["../../../src/runtime/plugins/attaform.ts"],"sourcesContent":["/**\n * Nuxt plugin: installs the framework-agnostic createAttaform Vue\n * plugin on nuxtApp.vueApp and wires the Nuxt payload mechanism to the\n * registry's SSR serialization helpers. Replaces the old split of\n * register.ts (client-only) + register-stub.ts (server-only).\n *\n * Runs on BOTH server and client — Vue's SSR renderer is a natural no-op\n * for directive lifecycle hooks, so the same plugin works on both sides\n * without a stub.\n */\nimport { defineNuxtPlugin, useRoute, useRuntimeConfig } from 'nuxt/app'\nimport { DEVTOOLS_WINDOW_KEY } from '../core/devtools-shared'\nimport { createAttaform } from '../core/plugin'\nimport { getRegistryFromApp, kAttaformWizardActiveStepResolver } from '../core/registry'\nimport { hydrateAttaformState, renderAttaformState } from '../core/serialize'\nimport type { SerializedAttaformState } from '../core/serialize'\nimport type { AttaformDefaults } from '../types/types-api'\n\nexport default defineNuxtPlugin({\n // `enforce: 'pre'` makes the \"we run before any component's setup\" claim\n // explicit. Combined with `prepend: true` on the addPlugin call in\n // src/nuxt.ts, this guarantees hydration is staged into pendingHydration\n // before any user plugin or page can call `useForm`. Without it, a user\n // plugin running first would observe an empty registry and skip hydration.\n enforce: 'pre',\n setup(nuxtApp) {\n const isServer = import.meta.server\n\n // Read app-level defaults from the Nuxt module's runtime-config slot\n // (populated in src/nuxt.ts). The module ships in the same package\n // as this plugin, so the slot is always present and well-typed.\n const config = useRuntimeConfig().public as {\n attaform: { defaults: AttaformDefaults; version: string }\n }\n const { defaults, version } = config.attaform\n\n nuxtApp.vueApp.use(createAttaform({ ssr: isServer, defaults }))\n\n // Bridge `useWizard`'s active-step resolution to the Nuxt route so\n // deep-links hydrate without flicker. On the server, `useRoute()`\n // reads the incoming request URL; on the client, it reads the live\n // route — so server and client compute the same initial step and\n // Vue's hydration walks a matching tree. Without this bridge, the\n // wizard would fall back to its first step on the server while the\n // client reads the URL, producing the deep-link mismatch cascade.\n // Consumers can still pass `options.restore` explicitly to override;\n // this just removes the boilerplate for the common case.\n nuxtApp.vueApp.provide(kAttaformWizardActiveStepResolver, (param) => {\n const value = useRoute().query[param]\n if (typeof value === 'string') return value\n if (Array.isArray(value) && typeof value[0] === 'string') return value[0]\n return undefined\n })\n\n if (isServer) {\n // After the app renders, capture every FormStore into the Nuxt payload\n // so the client can hydrate with matching form values and errors.\n nuxtApp.hook('app:rendered', () => {\n const state = renderAttaformState(nuxtApp.vueApp)\n ;(nuxtApp.payload as unknown as { attaform?: SerializedAttaformState }).attaform = state\n })\n } else {\n // Stage the payload into pendingHydration so `useForm` finds it. The\n // `enforce: 'pre'` + `prepend: true` pair above is what makes it safe\n // to assume this runs before any user setup.\n const serialized = (nuxtApp.payload as unknown as { attaform?: SerializedAttaformState })\n .attaform\n if (serialized !== undefined) {\n hydrateAttaformState(nuxtApp.vueApp, serialized)\n }\n\n // Dev-only: attach the registry to window so the Nuxt DevTools overlay\n // panel (which runs in an iframe at /_attaform_devtools) can reach it\n // via `window.parent.__attaform_devtools__`. The bridge holds a live\n // reference to the registry — Vue's reactivity flows across the\n // same-origin iframe boundary, so the panel re-renders on every form\n // mutation without an explicit push channel. `import.meta.dev` is\n // statically replaced by Nuxt at build time, so this whole branch is\n // tree-shaken from production builds.\n if (import.meta.dev) {\n const registry = getRegistryFromApp(nuxtApp.vueApp)\n window[DEVTOOLS_WINDOW_KEY] = { registry, version }\n }\n }\n },\n})\n"],"names":[],"mappings":";;;AAkBA,IAAO,mBAAQ,gBAAA,CAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,OAAA,EAAS,KAAA;AAAA,EACT,MAAM,OAAA,EAAS;AACb,IAAA,MAAM,WAAW,MAAA,CAAA,IAAA,CAAY,MAAA;AAK7B,IAAA,MAAM,MAAA,GAAS,kBAAiB,CAAE,MAAA;AAGlC,IAAA,MAAM,EAAE,QAAA,EAAU,OAAA,EAAQ,GAAI,MAAA,CAAO,QAAA;AAErC,IAAA,OAAA,CAAQ,MAAA,CAAO,IAAI,cAAA,CAAe,EAAE,KAAK,QAAA,EAAU,QAAA,EAAU,CAAC,CAAA;AAW9D,IAAA,OAAA,CAAQ,MAAA,CAAO,OAAA,CAAQ,iCAAA,EAAmC,CAAC,KAAA,KAAU;AACnE,MAAA,MAAM,KAAA,GAAQ,QAAA,EAAS,CAAE,KAAA,CAAM,KAAK,CAAA;AACpC,MAAA,IAAI,OAAO,KAAA,KAAU,QAAA,EAAU,OAAO,KAAA;AACtC,MAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,IAAK,OAAO,KAAA,CAAM,CAAC,CAAA,KAAM,QAAA,EAAU,OAAO,KAAA,CAAM,CAAC,CAAA;AACxE,MAAA,OAAO,MAAA;AAAA,IACT,CAAC,CAAA;AAED,IAAA,IAAI,QAAA,EAAU;AAGZ,MAAA,OAAA,CAAQ,IAAA,CAAK,gBAAgB,MAAM;AACjC,QAAA,MAAM,KAAA,GAAQ,mBAAA,CAAoB,OAAA,CAAQ,MAAM,CAAA;AAC/C,QAAC,OAAA,CAAQ,QAA8D,QAAA,GAAW,KAAA;AAAA,MACrF,CAAC,CAAA;AAAA,IACH,CAAA,MAAO;AAIL,MAAA,MAAM,UAAA,GAAc,QAAQ,OAAA,CACzB,QAAA;AACH,MAAA,IAAI,eAAe,MAAA,EAAW;AAC5B,QAAA,oBAAA,CAAqB,OAAA,CAAQ,QAAQ,UAAU,CAAA;AAAA,MACjD;AAUA,MAAA,IAAI,YAAY,GAAA,EAAK;AACnB,QAAA,MAAM,QAAA,GAAW,kBAAA,CAAmB,OAAA,CAAQ,MAAM,CAAA;AAClD,QAAA,MAAA,CAAO,mBAAmB,CAAA,GAAI,EAAE,QAAA,EAAU,OAAA,EAAQ;AAAA,MACpD;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;;"}