@monstermann/unplugin-map 0.3.0 → 0.4.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,34 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ Object.defineProperty(exports, '__toESM', {
30
+ enumerable: true,
31
+ get: function () {
32
+ return __toESM;
33
+ }
34
+ });
package/dist/esbuild.cjs CHANGED
@@ -1,7 +1,7 @@
1
- const require_src = require('./src-AjuA4p5U.cjs');
1
+ const require_index = require('./index.cjs');
2
2
 
3
3
  //#region src/esbuild.ts
4
- var esbuild_default = require_src.src_default.esbuild;
4
+ var esbuild_default = require_index.esbuild;
5
5
 
6
6
  //#endregion
7
7
  module.exports = esbuild_default;
@@ -1,6 +1,6 @@
1
1
  import { Options } from "./types.cjs";
2
- import * as esbuild0 from "esbuild";
2
+ import { n as Plugin } from "./main-BM15Gvzx.cjs";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options: Options) => esbuild0.Plugin;
5
+ declare const _default: (options: Options) => Plugin;
6
6
  export = _default;
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./types.mjs";
2
- import * as esbuild0 from "esbuild";
2
+ import { n as Plugin } from "./main-C-Md8Psx.mjs";
3
3
 
4
4
  //#region src/esbuild.d.ts
5
- declare const _default: (options: Options) => esbuild0.Plugin;
5
+ declare const _default: (options: Options) => Plugin;
6
6
  //#endregion
7
7
  export { _default as default };
package/dist/index.cjs CHANGED
@@ -1,3 +1,31 @@
1
- const require_src = require('./src-AjuA4p5U.cjs');
1
+ const require_chunk = require('./chunk-C0xms8kb.cjs');
2
+ let _monstermann_tree_shake_import_namespaces = require("@monstermann/tree-shake-import-namespaces");
3
+ _monstermann_tree_shake_import_namespaces = require_chunk.__toESM(_monstermann_tree_shake_import_namespaces);
4
+ let unplugin = require("unplugin");
5
+ let unplugin_utils = require("unplugin-utils");
2
6
 
3
- module.exports = require_src.src_default;
7
+ //#region src/index.ts
8
+ var src_default = (0, unplugin.createUnplugin)(({ debug, enforce, exclude, include } = {}) => {
9
+ const shouldDebug = debug === void 0 ? () => false : typeof debug === "boolean" ? () => debug : (0, unplugin_utils.createFilter)(debug);
10
+ return {
11
+ enforce,
12
+ name: "unplugin-map",
13
+ transform: {
14
+ filter: { id: {
15
+ exclude,
16
+ include: include || [/\.[jt]sx?$/]
17
+ } },
18
+ handler(code, id) {
19
+ return (0, _monstermann_tree_shake_import_namespaces.default)(code, id, {
20
+ debug: shouldDebug(id),
21
+ resolve({ importAlias, importName, importPath, propertyName }) {
22
+ if (importPath === "@monstermann/map" && importName === "Map") return `import { ${propertyName} as ${importAlias} } from "@monstermann/map/Map/${propertyName}.mjs"`;
23
+ }
24
+ });
25
+ }
26
+ }
27
+ };
28
+ });
29
+
30
+ //#endregion
31
+ module.exports = src_default;
package/dist/index.d.cts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Options } from "./types.cjs";
2
- import * as unplugin0 from "unplugin";
2
+ import * as unplugin from "unplugin";
3
3
 
4
4
  //#region src/index.d.ts
5
- declare const _default: unplugin0.UnpluginInstance<Options, boolean>;
5
+ declare const _default: unplugin.UnpluginInstance<Options, boolean>;
6
6
  export = _default;
package/dist/index.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Options } from "./types.mjs";
2
- import * as unplugin0 from "unplugin";
2
+ import * as unplugin from "unplugin";
3
3
 
4
4
  //#region src/index.d.ts
5
- declare const _default: unplugin0.UnpluginInstance<Options, boolean>;
5
+ declare const _default: unplugin.UnpluginInstance<Options, boolean>;
6
6
  //#endregion
7
7
  export { _default as default };