@web-remarq/unplugin 0.0.2 → 0.1.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.
@@ -0,0 +1,59 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }
2
+
3
+
4
+ var _chunkVPHMCVGBcjs = require('./chunk-VPHMCVGB.cjs');
5
+
6
+ // src/index.ts
7
+ var _unplugin = require('unplugin');
8
+ var _path = require('path');
9
+ var DEFAULT_INCLUDE = ["**/*.jsx", "**/*.tsx", "**/*.vue"];
10
+ var DEFAULT_EXCLUDE = ["node_modules/**"];
11
+ function createFilter(include, exclude) {
12
+ function toRegex(glob) {
13
+ const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "\xA7GLOBSTAR\xA7").replace(/\*/g, "[^/]*").replace(/\/§GLOBSTAR§\//g, "\xA7OPTPATH\xA7").replace(/§GLOBSTAR§/g, ".*").replace(/\?/g, "[^/]").replace(/§OPTPATH§/g, "/(?:.*/)?");
14
+ return new RegExp(`(?:^|/)${escaped}$`);
15
+ }
16
+ const includePatterns = include.map(toRegex);
17
+ const excludePatterns = exclude.map(toRegex);
18
+ return (id) => {
19
+ const normalized = id.split("\\").join("/");
20
+ if (excludePatterns.some((re) => re.test(normalized))) return false;
21
+ return includePatterns.some((re) => re.test(normalized));
22
+ };
23
+ }
24
+ var unplugin = _unplugin.createUnplugin.call(void 0, (options = {}) => {
25
+ const include = _nullishCoalesce(options.include, () => ( DEFAULT_INCLUDE));
26
+ const exclude = _nullishCoalesce(options.exclude, () => ( DEFAULT_EXCLUDE));
27
+ const filter = createFilter(include, exclude);
28
+ return {
29
+ name: "web-remarq",
30
+ enforce: "pre",
31
+ transformInclude(id) {
32
+ if (!options.production && process.env.NODE_ENV === "production") return false;
33
+ return filter(id);
34
+ },
35
+ transform(code, id) {
36
+ const cwd = process.cwd();
37
+ const filePath = _path.relative.call(void 0, cwd, id).split("\\").join("/");
38
+ if (id.endsWith(".vue")) {
39
+ return _nullishCoalesce(_chunkVPHMCVGBcjs.transformVueSFC.call(void 0, code, filePath), () => ( void 0));
40
+ }
41
+ return _nullishCoalesce(_chunkVPHMCVGBcjs.transformJSX.call(void 0, code, filePath), () => ( void 0));
42
+ }
43
+ };
44
+ });
45
+ var src_default = unplugin;
46
+ var vitePlugin = unplugin.vite;
47
+ var rollupPlugin = unplugin.rollup;
48
+ var webpackPlugin = unplugin.webpack;
49
+ var esbuildPlugin = unplugin.esbuild;
50
+ var rspackPlugin = unplugin.rspack;
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+ exports.src_default = src_default; exports.vitePlugin = vitePlugin; exports.rollupPlugin = rollupPlugin; exports.webpackPlugin = webpackPlugin; exports.esbuildPlugin = esbuildPlugin; exports.rspackPlugin = rspackPlugin;
@@ -0,0 +1,59 @@
1
+ import {
2
+ transformJSX,
3
+ transformVueSFC
4
+ } from "./chunk-Y54FMSA3.js";
5
+
6
+ // src/index.ts
7
+ import { createUnplugin } from "unplugin";
8
+ import { relative } from "path";
9
+ var DEFAULT_INCLUDE = ["**/*.jsx", "**/*.tsx", "**/*.vue"];
10
+ var DEFAULT_EXCLUDE = ["node_modules/**"];
11
+ function createFilter(include, exclude) {
12
+ function toRegex(glob) {
13
+ const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "\xA7GLOBSTAR\xA7").replace(/\*/g, "[^/]*").replace(/\/§GLOBSTAR§\//g, "\xA7OPTPATH\xA7").replace(/§GLOBSTAR§/g, ".*").replace(/\?/g, "[^/]").replace(/§OPTPATH§/g, "/(?:.*/)?");
14
+ return new RegExp(`(?:^|/)${escaped}$`);
15
+ }
16
+ const includePatterns = include.map(toRegex);
17
+ const excludePatterns = exclude.map(toRegex);
18
+ return (id) => {
19
+ const normalized = id.split("\\").join("/");
20
+ if (excludePatterns.some((re) => re.test(normalized))) return false;
21
+ return includePatterns.some((re) => re.test(normalized));
22
+ };
23
+ }
24
+ var unplugin = createUnplugin((options = {}) => {
25
+ const include = options.include ?? DEFAULT_INCLUDE;
26
+ const exclude = options.exclude ?? DEFAULT_EXCLUDE;
27
+ const filter = createFilter(include, exclude);
28
+ return {
29
+ name: "web-remarq",
30
+ enforce: "pre",
31
+ transformInclude(id) {
32
+ if (!options.production && process.env.NODE_ENV === "production") return false;
33
+ return filter(id);
34
+ },
35
+ transform(code, id) {
36
+ const cwd = process.cwd();
37
+ const filePath = relative(cwd, id).split("\\").join("/");
38
+ if (id.endsWith(".vue")) {
39
+ return transformVueSFC(code, filePath) ?? void 0;
40
+ }
41
+ return transformJSX(code, filePath) ?? void 0;
42
+ }
43
+ };
44
+ });
45
+ var src_default = unplugin;
46
+ var vitePlugin = unplugin.vite;
47
+ var rollupPlugin = unplugin.rollup;
48
+ var webpackPlugin = unplugin.webpack;
49
+ var esbuildPlugin = unplugin.esbuild;
50
+ var rspackPlugin = unplugin.rspack;
51
+
52
+ export {
53
+ src_default,
54
+ vitePlugin,
55
+ rollupPlugin,
56
+ webpackPlugin,
57
+ esbuildPlugin,
58
+ rspackPlugin
59
+ };
@@ -1,8 +1,4 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/index.ts
2
- var _unplugin = require('unplugin');
3
- var _path = require('path');
4
-
5
- // src/transform.ts
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// src/transform.ts
6
2
  var _parser = require('@babel/parser');
7
3
  var _magicstring = require('magic-string'); var _magicstring2 = _interopRequireDefault(_magicstring);
8
4
  function findComponentName(ast, jsxStart) {
@@ -15,7 +11,7 @@ function findComponentName(ast, jsxStart) {
15
11
  }
16
12
  if (node.type === "ExportDefaultDeclaration") {
17
13
  const decl = node.declaration;
18
- if (decl.type === "FunctionDeclaration" && decl.id && typeof decl.id.name === "string") {
14
+ if ((decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") && decl.id && typeof decl.id.name === "string") {
19
15
  return decl.id.name;
20
16
  }
21
17
  }
@@ -39,6 +35,9 @@ function findComponentName(ast, jsxStart) {
39
35
  if (decl.type === "FunctionDeclaration" && decl.id && containsPosition(decl, jsxStart)) {
40
36
  return decl.id.name;
41
37
  }
38
+ if (decl.type === "ClassDeclaration" && decl.id && containsPosition(decl, jsxStart)) {
39
+ return decl.id.name;
40
+ }
42
41
  }
43
42
  if (node.type === "ClassDeclaration" && node.id && containsPosition(node, jsxStart)) {
44
43
  return node.id.name;
@@ -157,55 +156,7 @@ function transformVueSFC(code, filePath) {
157
156
  };
158
157
  }
159
158
 
160
- // src/index.ts
161
- var DEFAULT_INCLUDE = ["**/*.jsx", "**/*.tsx", "**/*.vue"];
162
- var DEFAULT_EXCLUDE = ["node_modules/**"];
163
- function createFilter(include, exclude) {
164
- function toRegex(glob) {
165
- const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "\xA7GLOBSTAR\xA7").replace(/\*/g, "[^/]*").replace(/§GLOBSTAR§/g, ".*").replace(/\?/g, "[^/]");
166
- return new RegExp(`(?:^|/)${escaped}$`);
167
- }
168
- const includePatterns = include.map(toRegex);
169
- const excludePatterns = exclude.map(toRegex);
170
- return (id) => {
171
- const normalized = id.split("\\").join("/");
172
- if (excludePatterns.some((re) => re.test(normalized))) return false;
173
- return includePatterns.some((re) => re.test(normalized));
174
- };
175
- }
176
- var unplugin = _unplugin.createUnplugin.call(void 0, (options = {}) => {
177
- const include = _nullishCoalesce(options.include, () => ( DEFAULT_INCLUDE));
178
- const exclude = _nullishCoalesce(options.exclude, () => ( DEFAULT_EXCLUDE));
179
- const filter = createFilter(include, exclude);
180
- return {
181
- name: "web-remarq",
182
- enforce: "pre",
183
- transformInclude(id) {
184
- if (!options.production && process.env.NODE_ENV === "production") return false;
185
- return filter(id);
186
- },
187
- transform(code, id) {
188
- const cwd = process.cwd();
189
- const filePath = _path.relative.call(void 0, cwd, id).split("\\").join("/");
190
- if (id.endsWith(".vue")) {
191
- return _nullishCoalesce(transformVueSFC(code, filePath), () => ( void 0));
192
- }
193
- return _nullishCoalesce(transformJSX(code, filePath), () => ( void 0));
194
- }
195
- };
196
- });
197
- var index_default = unplugin;
198
- var vitePlugin = unplugin.vite;
199
- var rollupPlugin = unplugin.rollup;
200
- var webpackPlugin = unplugin.webpack;
201
- var esbuildPlugin = unplugin.esbuild;
202
- var rspackPlugin = unplugin.rspack;
203
-
204
-
205
-
206
-
207
-
208
159
 
209
160
 
210
161
 
211
- exports.index_default = index_default; exports.vitePlugin = vitePlugin; exports.rollupPlugin = rollupPlugin; exports.webpackPlugin = webpackPlugin; exports.esbuildPlugin = esbuildPlugin; exports.rspackPlugin = rspackPlugin;
162
+ exports.transformJSX = transformJSX; exports.transformVueSFC = transformVueSFC;
@@ -1,7 +1,3 @@
1
- // src/index.ts
2
- import { createUnplugin } from "unplugin";
3
- import { relative } from "path";
4
-
5
1
  // src/transform.ts
6
2
  import { parse } from "@babel/parser";
7
3
  import MagicString from "magic-string";
@@ -15,7 +11,7 @@ function findComponentName(ast, jsxStart) {
15
11
  }
16
12
  if (node.type === "ExportDefaultDeclaration") {
17
13
  const decl = node.declaration;
18
- if (decl.type === "FunctionDeclaration" && decl.id && typeof decl.id.name === "string") {
14
+ if ((decl.type === "FunctionDeclaration" || decl.type === "ClassDeclaration") && decl.id && typeof decl.id.name === "string") {
19
15
  return decl.id.name;
20
16
  }
21
17
  }
@@ -39,6 +35,9 @@ function findComponentName(ast, jsxStart) {
39
35
  if (decl.type === "FunctionDeclaration" && decl.id && containsPosition(decl, jsxStart)) {
40
36
  return decl.id.name;
41
37
  }
38
+ if (decl.type === "ClassDeclaration" && decl.id && containsPosition(decl, jsxStart)) {
39
+ return decl.id.name;
40
+ }
42
41
  }
43
42
  if (node.type === "ClassDeclaration" && node.id && containsPosition(node, jsxStart)) {
44
43
  return node.id.name;
@@ -157,55 +156,7 @@ function transformVueSFC(code, filePath) {
157
156
  };
158
157
  }
159
158
 
160
- // src/index.ts
161
- var DEFAULT_INCLUDE = ["**/*.jsx", "**/*.tsx", "**/*.vue"];
162
- var DEFAULT_EXCLUDE = ["node_modules/**"];
163
- function createFilter(include, exclude) {
164
- function toRegex(glob) {
165
- const escaped = glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*\*/g, "\xA7GLOBSTAR\xA7").replace(/\*/g, "[^/]*").replace(/§GLOBSTAR§/g, ".*").replace(/\?/g, "[^/]");
166
- return new RegExp(`(?:^|/)${escaped}$`);
167
- }
168
- const includePatterns = include.map(toRegex);
169
- const excludePatterns = exclude.map(toRegex);
170
- return (id) => {
171
- const normalized = id.split("\\").join("/");
172
- if (excludePatterns.some((re) => re.test(normalized))) return false;
173
- return includePatterns.some((re) => re.test(normalized));
174
- };
175
- }
176
- var unplugin = createUnplugin((options = {}) => {
177
- const include = options.include ?? DEFAULT_INCLUDE;
178
- const exclude = options.exclude ?? DEFAULT_EXCLUDE;
179
- const filter = createFilter(include, exclude);
180
- return {
181
- name: "web-remarq",
182
- enforce: "pre",
183
- transformInclude(id) {
184
- if (!options.production && process.env.NODE_ENV === "production") return false;
185
- return filter(id);
186
- },
187
- transform(code, id) {
188
- const cwd = process.cwd();
189
- const filePath = relative(cwd, id).split("\\").join("/");
190
- if (id.endsWith(".vue")) {
191
- return transformVueSFC(code, filePath) ?? void 0;
192
- }
193
- return transformJSX(code, filePath) ?? void 0;
194
- }
195
- };
196
- });
197
- var index_default = unplugin;
198
- var vitePlugin = unplugin.vite;
199
- var rollupPlugin = unplugin.rollup;
200
- var webpackPlugin = unplugin.webpack;
201
- var esbuildPlugin = unplugin.esbuild;
202
- var rspackPlugin = unplugin.rspack;
203
-
204
159
  export {
205
- index_default,
206
- vitePlugin,
207
- rollupPlugin,
208
- webpackPlugin,
209
- esbuildPlugin,
210
- rspackPlugin
160
+ transformJSX,
161
+ transformVueSFC
211
162
  };
package/dist/esbuild.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPRGGVU7Pcjs = require('./chunk-PRGGVU7P.cjs');
3
+ var _chunkNSNSAOA6cjs = require('./chunk-NSNSAOA6.cjs');
4
+ require('./chunk-VPHMCVGB.cjs');
4
5
 
5
6
 
6
- exports.default = _chunkPRGGVU7Pcjs.esbuildPlugin;
7
+ exports.default = _chunkNSNSAOA6cjs.esbuildPlugin;
@@ -1,4 +1,7 @@
1
1
  export { Options, esbuildPlugin as default } from './index.cjs';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.cjs';
7
+ import 'magic-string';
package/dist/esbuild.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, esbuildPlugin as default } from './index.js';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.js';
7
+ import 'magic-string';
package/dist/esbuild.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  esbuildPlugin
3
- } from "./chunk-CRVREGZW.js";
3
+ } from "./chunk-UWZ7ECC5.js";
4
+ import "./chunk-Y54FMSA3.js";
4
5
  export {
5
6
  esbuildPlugin as default
6
7
  };
package/dist/index.cjs CHANGED
@@ -5,12 +5,18 @@
5
5
 
6
6
 
7
7
 
8
- var _chunkPRGGVU7Pcjs = require('./chunk-PRGGVU7P.cjs');
8
+ var _chunkNSNSAOA6cjs = require('./chunk-NSNSAOA6.cjs');
9
9
 
10
10
 
11
11
 
12
+ var _chunkVPHMCVGBcjs = require('./chunk-VPHMCVGB.cjs');
12
13
 
13
14
 
14
15
 
15
16
 
16
- exports.default = _chunkPRGGVU7Pcjs.index_default; exports.esbuildPlugin = _chunkPRGGVU7Pcjs.esbuildPlugin; exports.rollupPlugin = _chunkPRGGVU7Pcjs.rollupPlugin; exports.rspackPlugin = _chunkPRGGVU7Pcjs.rspackPlugin; exports.vitePlugin = _chunkPRGGVU7Pcjs.vitePlugin; exports.webpackPlugin = _chunkPRGGVU7Pcjs.webpackPlugin;
17
+
18
+
19
+
20
+
21
+
22
+ exports.default = _chunkNSNSAOA6cjs.src_default; exports.esbuildPlugin = _chunkNSNSAOA6cjs.esbuildPlugin; exports.rollupPlugin = _chunkNSNSAOA6cjs.rollupPlugin; exports.rspackPlugin = _chunkNSNSAOA6cjs.rspackPlugin; exports.transformJSX = _chunkVPHMCVGBcjs.transformJSX; exports.transformVueSFC = _chunkVPHMCVGBcjs.transformVueSFC; exports.vitePlugin = _chunkNSNSAOA6cjs.vitePlugin; exports.webpackPlugin = _chunkNSNSAOA6cjs.webpackPlugin;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,9 @@
1
1
  import * as esbuild from 'esbuild';
2
2
  import * as rollup from 'rollup';
3
+ import * as vite from 'vite';
3
4
  import * as _unplugin from 'unplugin';
5
+ export { transformJSX, transformVueSFC } from './transform.cjs';
6
+ import 'magic-string';
4
7
 
5
8
  interface Options {
6
9
  /** Glob patterns for files to include. Default: ['**\/*.jsx', '**\/*.tsx', '**\/*.vue'] */
@@ -12,7 +15,7 @@ interface Options {
12
15
  }
13
16
  declare const unplugin: _unplugin.UnpluginInstance<Options, boolean>;
14
17
 
15
- declare const vitePlugin: (options: Options) => any;
18
+ declare const vitePlugin: (options: Options) => vite.Plugin<any> | vite.Plugin<any>[];
16
19
  declare const rollupPlugin: (options: Options) => rollup.Plugin<any> | rollup.Plugin<any>[];
17
20
  declare const webpackPlugin: (options: Options) => WebpackPluginInstance;
18
21
  declare const esbuildPlugin: (options: Options) => esbuild.Plugin;
package/dist/index.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import * as esbuild from 'esbuild';
2
2
  import * as rollup from 'rollup';
3
+ import * as vite from 'vite';
3
4
  import * as _unplugin from 'unplugin';
5
+ export { transformJSX, transformVueSFC } from './transform.js';
6
+ import 'magic-string';
4
7
 
5
8
  interface Options {
6
9
  /** Glob patterns for files to include. Default: ['**\/*.jsx', '**\/*.tsx', '**\/*.vue'] */
@@ -12,7 +15,7 @@ interface Options {
12
15
  }
13
16
  declare const unplugin: _unplugin.UnpluginInstance<Options, boolean>;
14
17
 
15
- declare const vitePlugin: (options: Options) => any;
18
+ declare const vitePlugin: (options: Options) => vite.Plugin<any> | vite.Plugin<any>[];
16
19
  declare const rollupPlugin: (options: Options) => rollup.Plugin<any> | rollup.Plugin<any>[];
17
20
  declare const webpackPlugin: (options: Options) => WebpackPluginInstance;
18
21
  declare const esbuildPlugin: (options: Options) => esbuild.Plugin;
package/dist/index.js CHANGED
@@ -1,16 +1,22 @@
1
1
  import {
2
2
  esbuildPlugin,
3
- index_default,
4
3
  rollupPlugin,
5
4
  rspackPlugin,
5
+ src_default,
6
6
  vitePlugin,
7
7
  webpackPlugin
8
- } from "./chunk-CRVREGZW.js";
8
+ } from "./chunk-UWZ7ECC5.js";
9
+ import {
10
+ transformJSX,
11
+ transformVueSFC
12
+ } from "./chunk-Y54FMSA3.js";
9
13
  export {
10
- index_default as default,
14
+ src_default as default,
11
15
  esbuildPlugin,
12
16
  rollupPlugin,
13
17
  rspackPlugin,
18
+ transformJSX,
19
+ transformVueSFC,
14
20
  vitePlugin,
15
21
  webpackPlugin
16
22
  };
package/dist/rollup.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPRGGVU7Pcjs = require('./chunk-PRGGVU7P.cjs');
3
+ var _chunkNSNSAOA6cjs = require('./chunk-NSNSAOA6.cjs');
4
+ require('./chunk-VPHMCVGB.cjs');
4
5
 
5
6
 
6
- exports.default = _chunkPRGGVU7Pcjs.rollupPlugin;
7
+ exports.default = _chunkNSNSAOA6cjs.rollupPlugin;
package/dist/rollup.d.cts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, rollupPlugin as default } from './index.cjs';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.cjs';
7
+ import 'magic-string';
package/dist/rollup.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, rollupPlugin as default } from './index.js';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.js';
7
+ import 'magic-string';
package/dist/rollup.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  rollupPlugin
3
- } from "./chunk-CRVREGZW.js";
3
+ } from "./chunk-UWZ7ECC5.js";
4
+ import "./chunk-Y54FMSA3.js";
4
5
  export {
5
6
  rollupPlugin as default
6
7
  };
package/dist/rspack.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPRGGVU7Pcjs = require('./chunk-PRGGVU7P.cjs');
3
+ var _chunkNSNSAOA6cjs = require('./chunk-NSNSAOA6.cjs');
4
+ require('./chunk-VPHMCVGB.cjs');
4
5
 
5
6
 
6
- exports.default = _chunkPRGGVU7Pcjs.rspackPlugin;
7
+ exports.default = _chunkNSNSAOA6cjs.rspackPlugin;
package/dist/rspack.d.cts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, rspackPlugin as default } from './index.cjs';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.cjs';
7
+ import 'magic-string';
package/dist/rspack.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, rspackPlugin as default } from './index.js';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.js';
7
+ import 'magic-string';
package/dist/rspack.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  rspackPlugin
3
- } from "./chunk-CRVREGZW.js";
3
+ } from "./chunk-UWZ7ECC5.js";
4
+ import "./chunk-Y54FMSA3.js";
4
5
  export {
5
6
  rspackPlugin as default
6
7
  };
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+ var _chunkVPHMCVGBcjs = require('./chunk-VPHMCVGB.cjs');
5
+
6
+
7
+
8
+ exports.transformJSX = _chunkVPHMCVGBcjs.transformJSX; exports.transformVueSFC = _chunkVPHMCVGBcjs.transformVueSFC;
@@ -0,0 +1,17 @@
1
+ import MagicString from 'magic-string';
2
+
3
+ interface TransformResult {
4
+ code: string;
5
+ map: ReturnType<MagicString['generateMap']>;
6
+ }
7
+ /**
8
+ * Transform JSX/TSX source code to inject data-remarq-source and data-remarq-component.
9
+ */
10
+ declare function transformJSX(code: string, filePath: string): TransformResult | null;
11
+ /**
12
+ * Transform Vue SFC <template> block to inject data-remarq-source and data-remarq-component.
13
+ * Uses simple regex-based approach for HTML element detection.
14
+ */
15
+ declare function transformVueSFC(code: string, filePath: string): TransformResult | null;
16
+
17
+ export { transformJSX, transformVueSFC };
@@ -0,0 +1,17 @@
1
+ import MagicString from 'magic-string';
2
+
3
+ interface TransformResult {
4
+ code: string;
5
+ map: ReturnType<MagicString['generateMap']>;
6
+ }
7
+ /**
8
+ * Transform JSX/TSX source code to inject data-remarq-source and data-remarq-component.
9
+ */
10
+ declare function transformJSX(code: string, filePath: string): TransformResult | null;
11
+ /**
12
+ * Transform Vue SFC <template> block to inject data-remarq-source and data-remarq-component.
13
+ * Uses simple regex-based approach for HTML element detection.
14
+ */
15
+ declare function transformVueSFC(code: string, filePath: string): TransformResult | null;
16
+
17
+ export { transformJSX, transformVueSFC };
@@ -0,0 +1,8 @@
1
+ import {
2
+ transformJSX,
3
+ transformVueSFC
4
+ } from "./chunk-Y54FMSA3.js";
5
+ export {
6
+ transformJSX,
7
+ transformVueSFC
8
+ };
package/dist/vite.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPRGGVU7Pcjs = require('./chunk-PRGGVU7P.cjs');
3
+ var _chunkNSNSAOA6cjs = require('./chunk-NSNSAOA6.cjs');
4
+ require('./chunk-VPHMCVGB.cjs');
4
5
 
5
6
 
6
- exports.default = _chunkPRGGVU7Pcjs.vitePlugin;
7
+ exports.default = _chunkNSNSAOA6cjs.vitePlugin;
package/dist/vite.d.cts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, vitePlugin as default } from './index.cjs';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.cjs';
7
+ import 'magic-string';
package/dist/vite.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, vitePlugin as default } from './index.js';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.js';
7
+ import 'magic-string';
package/dist/vite.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  vitePlugin
3
- } from "./chunk-CRVREGZW.js";
3
+ } from "./chunk-UWZ7ECC5.js";
4
+ import "./chunk-Y54FMSA3.js";
4
5
  export {
5
6
  vitePlugin as default
6
7
  };
package/dist/webpack.cjs CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkPRGGVU7Pcjs = require('./chunk-PRGGVU7P.cjs');
3
+ var _chunkNSNSAOA6cjs = require('./chunk-NSNSAOA6.cjs');
4
+ require('./chunk-VPHMCVGB.cjs');
4
5
 
5
6
 
6
- exports.default = _chunkPRGGVU7Pcjs.webpackPlugin;
7
+ exports.default = _chunkNSNSAOA6cjs.webpackPlugin;
@@ -1,4 +1,7 @@
1
1
  export { Options, webpackPlugin as default } from './index.cjs';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.cjs';
7
+ import 'magic-string';
package/dist/webpack.d.ts CHANGED
@@ -1,4 +1,7 @@
1
1
  export { Options, webpackPlugin as default } from './index.js';
2
2
  import 'esbuild';
3
3
  import 'rollup';
4
+ import 'vite';
4
5
  import 'unplugin';
6
+ import './transform.js';
7
+ import 'magic-string';
package/dist/webpack.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import {
2
2
  webpackPlugin
3
- } from "./chunk-CRVREGZW.js";
3
+ } from "./chunk-UWZ7ECC5.js";
4
+ import "./chunk-Y54FMSA3.js";
4
5
  export {
5
6
  webpackPlugin as default
6
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@web-remarq/unplugin",
3
- "version": "0.0.2",
3
+ "version": "0.1.0",
4
4
  "description": "Unplugin for web-remarq source location injection (Vite/webpack/Rollup/esbuild/Rspack)",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",
@@ -36,6 +36,11 @@
36
36
  "types": "./dist/rspack.d.ts",
37
37
  "import": "./dist/rspack.js",
38
38
  "require": "./dist/rspack.cjs"
39
+ },
40
+ "./transform": {
41
+ "types": "./dist/transform.d.ts",
42
+ "import": "./dist/transform.js",
43
+ "require": "./dist/transform.cjs"
39
44
  }
40
45
  },
41
46
  "files": [