react-code-locator 0.1.15 → 0.1.17

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 (56) hide show
  1. package/README.md +54 -0
  2. package/dist/core/transform-cjs.cjs +7014 -0
  3. package/dist/core/webpackPitchLoader-cjs.cjs +7032 -0
  4. package/dist/esbuild.cjs +7025 -295
  5. package/dist/esbuild.cjs.map +1 -1
  6. package/dist/esbuild.d.cts +38 -6
  7. package/dist/esbuild.d.ts +38 -6
  8. package/dist/esbuild.js +7025 -295
  9. package/dist/esbuild.js.map +1 -1
  10. package/dist/swc.cjs +7020 -293
  11. package/dist/swc.cjs.map +1 -1
  12. package/dist/swc.d.cts +43 -19
  13. package/dist/swc.d.ts +43 -19
  14. package/dist/swc.js +7020 -293
  15. package/dist/swc.js.map +1 -1
  16. package/dist/transform-CXh-m5Ez.d.cts +12 -0
  17. package/dist/transform-CXh-m5Ez.d.ts +12 -0
  18. package/dist/unplugin.cjs +7147 -0
  19. package/dist/unplugin.cjs.map +1 -0
  20. package/dist/unplugin.d.cts +41 -0
  21. package/dist/unplugin.d.ts +41 -0
  22. package/dist/unplugin.js +7118 -0
  23. package/dist/unplugin.js.map +1 -0
  24. package/dist/vite.cjs +7029 -304
  25. package/dist/vite.cjs.map +1 -1
  26. package/dist/vite.d.cts +39 -14
  27. package/dist/vite.d.ts +39 -14
  28. package/dist/vite.js +7029 -303
  29. package/dist/vite.js.map +1 -1
  30. package/dist/webpack.cjs +85 -61
  31. package/dist/webpack.cjs.map +1 -1
  32. package/dist/webpack.d.cts +55 -1
  33. package/dist/webpack.d.ts +55 -1
  34. package/dist/webpack.js +51 -71
  35. package/dist/webpack.js.map +1 -1
  36. package/dist/webpackLoader.cjs +7115 -0
  37. package/dist/webpackLoader.cjs.map +1 -0
  38. package/dist/webpackLoader.d.cts +15 -0
  39. package/dist/webpackLoader.d.ts +15 -0
  40. package/dist/webpackLoader.js +7092 -0
  41. package/dist/webpackLoader.js.map +1 -0
  42. package/package.json +26 -11
  43. package/dist/babel.cjs +0 -370
  44. package/dist/babel.cjs.map +0 -1
  45. package/dist/babel.d.cts +0 -13
  46. package/dist/babel.d.ts +0 -13
  47. package/dist/babel.js +0 -341
  48. package/dist/babel.js.map +0 -1
  49. package/dist/babelInjectComponentSource.cjs +0 -342
  50. package/dist/babelInjectComponentSource.cjs.map +0 -1
  51. package/dist/babelInjectComponentSource.d.cts +0 -15
  52. package/dist/babelInjectComponentSource.d.ts +0 -15
  53. package/dist/babelInjectComponentSource.js +0 -317
  54. package/dist/babelInjectComponentSource.js.map +0 -1
  55. package/dist/sourceAdapter-dPr5CgLi.d.cts +0 -14
  56. package/dist/sourceAdapter-dPr5CgLi.d.ts +0 -14
package/dist/vite.d.cts CHANGED
@@ -1,10 +1,5 @@
1
- import { S as SourceAdapterDescriptor } from './sourceAdapter-dPr5CgLi.cjs';
2
- export { b as SourceAdapterKind, a as SourceInjectionOptions } from './sourceAdapter-dPr5CgLi.cjs';
3
- import { BabelInjectComponentSourceOptions } from './babelInjectComponentSource.cjs';
4
- export { babelInjectComponentSource } from './babelInjectComponentSource.cjs';
5
1
  import { PluginOption, Plugin } from 'vite';
6
2
  import { LocatorOptions } from './client.cjs';
7
- import '@babel/core';
8
3
 
9
4
  type ViteClientInjectorOptions = {
10
5
  command?: "serve" | "build";
@@ -13,15 +8,45 @@ type ViteClientInjectorOptions = {
13
8
  };
14
9
  declare function createViteClientInjector(options?: ViteClientInjectorOptions): PluginOption[];
15
10
 
16
- type ViteSourceAdapterOptions = ViteClientInjectorOptions & {
17
- babel?: BabelInjectComponentSourceOptions;
18
- };
19
- type ViteSourceAdapterConfig = {
20
- plugins: Plugin[];
11
+ /**
12
+ * Vite Plugin for react-code-locator
13
+ * Uses acorn-based transform (zero-dependency)
14
+ */
15
+
16
+ interface ViteReactCodeLocatorOptions extends ViteClientInjectorOptions {
17
+ /**
18
+ * Enable source transform for component definitions
19
+ * @default true
20
+ */
21
+ injectComponentSource?: boolean;
22
+ /**
23
+ * Enable source transform for JSX call sites
24
+ * @default true
25
+ */
26
+ injectJsxSource?: boolean;
27
+ /**
28
+ * Project root for relative path calculation
29
+ * @default process.cwd()
30
+ */
31
+ projectRoot?: string;
32
+ }
33
+ declare function viteSourceTransformPlugin(options?: Omit<ViteReactCodeLocatorOptions, keyof ViteClientInjectorOptions>): Plugin;
34
+ declare function createViteSourceAdapter(options?: ViteReactCodeLocatorOptions): {
35
+ kind: "vite";
36
+ name: string;
37
+ options: ViteReactCodeLocatorOptions;
38
+ config: {
39
+ plugins: Plugin<any>[];
40
+ };
21
41
  };
22
42
 
23
- declare function viteSourceTransformPlugin(options?: BabelInjectComponentSourceOptions): Plugin;
24
- declare function createViteSourceAdapter(options?: ViteSourceAdapterOptions): SourceAdapterDescriptor<ViteSourceAdapterConfig, ViteSourceAdapterOptions>;
25
- declare const viteSourceAdapter: SourceAdapterDescriptor<ViteSourceAdapterConfig, ViteSourceAdapterOptions>;
43
+ declare const viteSourceAdapter: {
44
+ kind: "vite";
45
+ name: string;
46
+ options: ViteReactCodeLocatorOptions;
47
+ config: {
48
+ plugins: Plugin<any>[];
49
+ };
50
+ };
26
51
 
27
- export { BabelInjectComponentSourceOptions, SourceAdapterDescriptor, type ViteClientInjectorOptions, type ViteSourceAdapterConfig, type ViteSourceAdapterOptions, createViteClientInjector, createViteSourceAdapter, createViteClientInjector as reactComponentJump, viteSourceAdapter, viteSourceTransformPlugin };
52
+ export { type ViteClientInjectorOptions, type ViteReactCodeLocatorOptions, createViteClientInjector, createViteSourceAdapter, createViteClientInjector as reactComponentJump, viteSourceAdapter, viteSourceTransformPlugin };
package/dist/vite.d.ts CHANGED
@@ -1,10 +1,5 @@
1
- import { S as SourceAdapterDescriptor } from './sourceAdapter-dPr5CgLi.js';
2
- export { b as SourceAdapterKind, a as SourceInjectionOptions } from './sourceAdapter-dPr5CgLi.js';
3
- import { BabelInjectComponentSourceOptions } from './babelInjectComponentSource.js';
4
- export { babelInjectComponentSource } from './babelInjectComponentSource.js';
5
1
  import { PluginOption, Plugin } from 'vite';
6
2
  import { LocatorOptions } from './client.js';
7
- import '@babel/core';
8
3
 
9
4
  type ViteClientInjectorOptions = {
10
5
  command?: "serve" | "build";
@@ -13,15 +8,45 @@ type ViteClientInjectorOptions = {
13
8
  };
14
9
  declare function createViteClientInjector(options?: ViteClientInjectorOptions): PluginOption[];
15
10
 
16
- type ViteSourceAdapterOptions = ViteClientInjectorOptions & {
17
- babel?: BabelInjectComponentSourceOptions;
18
- };
19
- type ViteSourceAdapterConfig = {
20
- plugins: Plugin[];
11
+ /**
12
+ * Vite Plugin for react-code-locator
13
+ * Uses acorn-based transform (zero-dependency)
14
+ */
15
+
16
+ interface ViteReactCodeLocatorOptions extends ViteClientInjectorOptions {
17
+ /**
18
+ * Enable source transform for component definitions
19
+ * @default true
20
+ */
21
+ injectComponentSource?: boolean;
22
+ /**
23
+ * Enable source transform for JSX call sites
24
+ * @default true
25
+ */
26
+ injectJsxSource?: boolean;
27
+ /**
28
+ * Project root for relative path calculation
29
+ * @default process.cwd()
30
+ */
31
+ projectRoot?: string;
32
+ }
33
+ declare function viteSourceTransformPlugin(options?: Omit<ViteReactCodeLocatorOptions, keyof ViteClientInjectorOptions>): Plugin;
34
+ declare function createViteSourceAdapter(options?: ViteReactCodeLocatorOptions): {
35
+ kind: "vite";
36
+ name: string;
37
+ options: ViteReactCodeLocatorOptions;
38
+ config: {
39
+ plugins: Plugin<any>[];
40
+ };
21
41
  };
22
42
 
23
- declare function viteSourceTransformPlugin(options?: BabelInjectComponentSourceOptions): Plugin;
24
- declare function createViteSourceAdapter(options?: ViteSourceAdapterOptions): SourceAdapterDescriptor<ViteSourceAdapterConfig, ViteSourceAdapterOptions>;
25
- declare const viteSourceAdapter: SourceAdapterDescriptor<ViteSourceAdapterConfig, ViteSourceAdapterOptions>;
43
+ declare const viteSourceAdapter: {
44
+ kind: "vite";
45
+ name: string;
46
+ options: ViteReactCodeLocatorOptions;
47
+ config: {
48
+ plugins: Plugin<any>[];
49
+ };
50
+ };
26
51
 
27
- export { BabelInjectComponentSourceOptions, SourceAdapterDescriptor, type ViteClientInjectorOptions, type ViteSourceAdapterConfig, type ViteSourceAdapterOptions, createViteClientInjector, createViteSourceAdapter, createViteClientInjector as reactComponentJump, viteSourceAdapter, viteSourceTransformPlugin };
52
+ export { type ViteClientInjectorOptions, type ViteReactCodeLocatorOptions, createViteClientInjector, createViteSourceAdapter, createViteClientInjector as reactComponentJump, viteSourceAdapter, viteSourceTransformPlugin };