@monstermann/unplugin-result 0.5.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) Michael Ostermann
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ <div align="center">
2
+
3
+ <h1>unplugin-result</h1>
4
+
5
+ **Functional utilities for success | error types.**
6
+
7
+ [Documentation](https://MichaelOstermann.github.io/result)
8
+
9
+ </div>
@@ -0,0 +1,7 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ //#region src/esbuild.ts
4
+ var esbuild_default = require_src.src_default.esbuild;
5
+
6
+ //#endregion
7
+ module.exports = esbuild_default;
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+ import * as esbuild2 from "esbuild";
3
+
4
+ //#region src/esbuild.d.ts
5
+ declare const _default: (options: Options) => esbuild2.Plugin;
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+ import * as esbuild1 from "esbuild";
3
+
4
+ //#region src/esbuild.d.ts
5
+ declare const _default: (options: Options) => esbuild1.Plugin;
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ //#region src/esbuild.ts
4
+ var esbuild_default = src_default.esbuild;
5
+
6
+ //#endregion
7
+ export { esbuild_default as default };
package/dist/index.cjs ADDED
@@ -0,0 +1,3 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ module.exports = require_src.src_default;
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+ import * as unplugin0 from "unplugin";
3
+
4
+ //#region src/index.d.ts
5
+ declare const _default: unplugin0.UnpluginInstance<Options, boolean>;
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+ import * as unplugin5 from "unplugin";
3
+
4
+ //#region src/index.d.ts
5
+ declare const _default: unplugin5.UnpluginInstance<Options, boolean>;
6
+ //#endregion
7
+ export { _default as default };
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ export { src_default as default };
@@ -0,0 +1,7 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ //#region src/rolldown.ts
4
+ var rolldown_default = require_src.src_default.rolldown;
5
+
6
+ //#endregion
7
+ module.exports = rolldown_default;
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+ import * as rolldown5 from "rolldown";
3
+
4
+ //#region src/rolldown.d.ts
5
+ declare const _default: (options: Options) => rolldown5.Plugin<any> | rolldown5.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+ import * as rolldown3 from "rolldown";
3
+
4
+ //#region src/rolldown.d.ts
5
+ declare const _default: (options: Options) => rolldown3.Plugin<any> | rolldown3.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ //#region src/rolldown.ts
4
+ var rolldown_default = src_default.rolldown;
5
+
6
+ //#endregion
7
+ export { rolldown_default as default };
@@ -0,0 +1,7 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ //#region src/rollup.ts
4
+ var rollup_default = require_src.src_default.rollup;
5
+
6
+ //#endregion
7
+ module.exports = rollup_default;
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+ import * as rollup8 from "rollup";
3
+
4
+ //#region src/rollup.d.ts
5
+ declare const _default: (options: Options) => rollup8.Plugin<any> | rollup8.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+ import * as rollup12 from "rollup";
3
+
4
+ //#region src/rollup.d.ts
5
+ declare const _default: (options: Options) => rollup12.Plugin<any> | rollup12.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
package/dist/rollup.js ADDED
@@ -0,0 +1,7 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ //#region src/rollup.ts
4
+ var rollup_default = src_default.rollup;
5
+
6
+ //#endregion
7
+ export { rollup_default as default };
@@ -0,0 +1,7 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ //#region src/rspack.ts
4
+ var rspack_default = require_src.src_default.rspack;
5
+
6
+ //#endregion
7
+ module.exports = rspack_default;
@@ -0,0 +1,6 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+
3
+ //#region src/rspack.d.ts
4
+ declare const _default: (options: Options) => RspackPluginInstance;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,6 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+
3
+ //#region src/rspack.d.ts
4
+ declare const _default: (options: Options) => RspackPluginInstance;
5
+ //#endregion
6
+ export { _default as default };
package/dist/rspack.js ADDED
@@ -0,0 +1,7 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ //#region src/rspack.ts
4
+ var rspack_default = src_default.rspack;
5
+
6
+ //#endregion
7
+ export { rspack_default as default };
@@ -0,0 +1,31 @@
1
+ import transform from "@monstermann/tree-shake-import-namespaces";
2
+ import { createUnplugin } from "unplugin";
3
+ import { createFilter } from "unplugin-utils";
4
+
5
+ //#region src/index.ts
6
+ var src_default = createUnplugin(({ debug, enforce, exclude, include }) => {
7
+ const shouldDebug = debug === void 0 ? () => false : typeof debug === "boolean" ? () => debug : createFilter(debug);
8
+ return {
9
+ enforce,
10
+ name: "unplugin-result",
11
+ transform: {
12
+ filter: { id: {
13
+ exclude,
14
+ include: include || [/\.[jt]sx?$/]
15
+ } },
16
+ handler(code, id) {
17
+ return transform(code, id, {
18
+ debug: shouldDebug(id),
19
+ resolve({ importAlias, importName, importPath, propertyName }) {
20
+ if (importPath === "@monstermann/result" && importName === "Result") return `import { ${propertyName} as ${importAlias} } from "@monstermann/result/Result/${propertyName}.js"`;
21
+ if (importPath === "@monstermann/result" && importName === "ResultAsync") return `import { ${propertyName} as ${importAlias} } from "@monstermann/result/ResultAsync/${propertyName}.js"`;
22
+ return void 0;
23
+ }
24
+ });
25
+ }
26
+ }
27
+ };
28
+ });
29
+
30
+ //#endregion
31
+ export { src_default };
@@ -0,0 +1,59 @@
1
+ //#region rolldown:runtime
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") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+
23
+ //#endregion
24
+ const __monstermann_tree_shake_import_namespaces = __toESM(require("@monstermann/tree-shake-import-namespaces"));
25
+ const unplugin = __toESM(require("unplugin"));
26
+ const unplugin_utils = __toESM(require("unplugin-utils"));
27
+
28
+ //#region src/index.ts
29
+ var src_default = (0, unplugin.createUnplugin)(({ debug, enforce, exclude, include }) => {
30
+ const shouldDebug = debug === void 0 ? () => false : typeof debug === "boolean" ? () => debug : (0, unplugin_utils.createFilter)(debug);
31
+ return {
32
+ enforce,
33
+ name: "unplugin-result",
34
+ transform: {
35
+ filter: { id: {
36
+ exclude,
37
+ include: include || [/\.[jt]sx?$/]
38
+ } },
39
+ handler(code, id) {
40
+ return (0, __monstermann_tree_shake_import_namespaces.default)(code, id, {
41
+ debug: shouldDebug(id),
42
+ resolve({ importAlias, importName, importPath, propertyName }) {
43
+ if (importPath === "@monstermann/result" && importName === "Result") return `import { ${propertyName} as ${importAlias} } from "@monstermann/result/Result/${propertyName}.js"`;
44
+ if (importPath === "@monstermann/result" && importName === "ResultAsync") return `import { ${propertyName} as ${importAlias} } from "@monstermann/result/ResultAsync/${propertyName}.js"`;
45
+ return void 0;
46
+ }
47
+ });
48
+ }
49
+ }
50
+ };
51
+ });
52
+
53
+ //#endregion
54
+ Object.defineProperty(exports, 'src_default', {
55
+ enumerable: true,
56
+ get: function () {
57
+ return src_default;
58
+ }
59
+ });
@@ -0,0 +1,11 @@
1
+ import { FilterPattern } from "unplugin";
2
+
3
+ //#region src/types.d.ts
4
+ interface Options {
5
+ debug?: boolean | FilterPattern;
6
+ enforce?: "post" | "pre" | undefined;
7
+ exclude?: FilterPattern;
8
+ include?: FilterPattern;
9
+ }
10
+ //#endregion
11
+ export { Options };
@@ -0,0 +1,11 @@
1
+ import { FilterPattern } from "unplugin";
2
+
3
+ //#region src/types.d.ts
4
+ interface Options {
5
+ debug?: boolean | FilterPattern;
6
+ enforce?: "post" | "pre" | undefined;
7
+ exclude?: FilterPattern;
8
+ include?: FilterPattern;
9
+ }
10
+ //#endregion
11
+ export { Options };
package/dist/types.cjs ADDED
File without changes
@@ -0,0 +1,2 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+ export { Options };
@@ -0,0 +1,2 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+ export { Options };
package/dist/types.js ADDED
File without changes
package/dist/vite.cjs ADDED
@@ -0,0 +1,7 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ //#region src/vite.ts
4
+ var vite_default = require_src.src_default.vite;
5
+
6
+ //#endregion
7
+ module.exports = vite_default;
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+ import * as vite11 from "vite";
3
+
4
+ //#region src/vite.d.ts
5
+ declare const _default: (options: Options) => vite11.Plugin<any> | vite11.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
package/dist/vite.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+ import * as vite8 from "vite";
3
+
4
+ //#region src/vite.d.ts
5
+ declare const _default: (options: Options) => vite8.Plugin<any> | vite8.Plugin<any>[];
6
+ //#endregion
7
+ export { _default as default };
package/dist/vite.js ADDED
@@ -0,0 +1,7 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ //#region src/vite.ts
4
+ var vite_default = src_default.vite;
5
+
6
+ //#endregion
7
+ export { vite_default as default };
@@ -0,0 +1,7 @@
1
+ const require_src = require('./src-hg4zJavC.cjs');
2
+
3
+ //#region src/webpack.ts
4
+ var webpack_default = require_src.src_default.webpack;
5
+
6
+ //#endregion
7
+ module.exports = webpack_default;
@@ -0,0 +1,6 @@
1
+ import { Options } from "./types-C5O69-EH.cjs";
2
+
3
+ //#region src/webpack.d.ts
4
+ declare const _default: (options: Options) => WebpackPluginInstance;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,6 @@
1
+ import { Options } from "./types-BnIZbJOa.js";
2
+
3
+ //#region src/webpack.d.ts
4
+ declare const _default: (options: Options) => WebpackPluginInstance;
5
+ //#endregion
6
+ export { _default as default };
@@ -0,0 +1,7 @@
1
+ import { src_default } from "./src-B4WsctRY.js";
2
+
3
+ //#region src/webpack.ts
4
+ var webpack_default = src_default.webpack;
5
+
6
+ //#endregion
7
+ export { webpack_default as default };
package/package.json ADDED
@@ -0,0 +1,123 @@
1
+ {
2
+ "name": "@monstermann/unplugin-result",
3
+ "type": "module",
4
+ "version": "0.5.0",
5
+ "description": "Functional utilities for success | error types.",
6
+ "author": "Michael Ostermann <michaelostermann@me.com>",
7
+ "license": "MIT",
8
+ "homepage": "https://MichaelOstermann.github.io/result",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/MichaelOstermann/result.git"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/MichaelOstermann/result/issues"
15
+ },
16
+ "keywords": [],
17
+ "sideEffects": false,
18
+ "exports": {
19
+ ".": {
20
+ "import": {
21
+ "types": "./dist/index.d.ts",
22
+ "default": "./dist/index.js"
23
+ },
24
+ "require": {
25
+ "types": "./dist/index.d.cts",
26
+ "default": "./dist/index.cjs"
27
+ }
28
+ },
29
+ "./esbuild": {
30
+ "import": {
31
+ "types": "./dist/esbuild.d.ts",
32
+ "default": "./dist/esbuild.js"
33
+ },
34
+ "require": {
35
+ "types": "./dist/esbuild.d.cts",
36
+ "default": "./dist/esbuild.cjs"
37
+ }
38
+ },
39
+ "./rolldown": {
40
+ "import": {
41
+ "types": "./dist/rolldown.d.ts",
42
+ "default": "./dist/rolldown.js"
43
+ },
44
+ "require": {
45
+ "types": "./dist/rolldown.d.cts",
46
+ "default": "./dist/rolldown.cjs"
47
+ }
48
+ },
49
+ "./rollup": {
50
+ "import": {
51
+ "types": "./dist/rollup.d.ts",
52
+ "default": "./dist/rollup.js"
53
+ },
54
+ "require": {
55
+ "types": "./dist/rollup.d.cts",
56
+ "default": "./dist/rollup.cjs"
57
+ }
58
+ },
59
+ "./rspack": {
60
+ "import": {
61
+ "types": "./dist/rspack.d.ts",
62
+ "default": "./dist/rspack.js"
63
+ },
64
+ "require": {
65
+ "types": "./dist/rspack.d.cts",
66
+ "default": "./dist/rspack.cjs"
67
+ }
68
+ },
69
+ "./types": {
70
+ "import": {
71
+ "types": "./dist/types.d.ts",
72
+ "default": "./dist/types.js"
73
+ },
74
+ "require": {
75
+ "types": "./dist/types.d.cts",
76
+ "default": "./dist/types.cjs"
77
+ }
78
+ },
79
+ "./vite": {
80
+ "import": {
81
+ "types": "./dist/vite.d.ts",
82
+ "default": "./dist/vite.js"
83
+ },
84
+ "require": {
85
+ "types": "./dist/vite.d.cts",
86
+ "default": "./dist/vite.cjs"
87
+ }
88
+ },
89
+ "./webpack": {
90
+ "import": {
91
+ "types": "./dist/webpack.d.ts",
92
+ "default": "./dist/webpack.js"
93
+ },
94
+ "require": {
95
+ "types": "./dist/webpack.d.cts",
96
+ "default": "./dist/webpack.cjs"
97
+ }
98
+ }
99
+ },
100
+ "main": "./dist/index.js",
101
+ "module": "./dist/index.js",
102
+ "types": "./dist/index.d.ts",
103
+ "typesVersions": {
104
+ "*": {
105
+ "*": [
106
+ "./dist/*",
107
+ "./*"
108
+ ]
109
+ }
110
+ },
111
+ "files": [
112
+ "dist"
113
+ ],
114
+ "scripts": {
115
+ "bundle": "tsdown",
116
+ "release": "bun publish --access public"
117
+ },
118
+ "dependencies": {
119
+ "@monstermann/tree-shake-import-namespaces": "^0.2.0",
120
+ "unplugin": "^2.3.4",
121
+ "unplugin-utils": "^0.2.4"
122
+ }
123
+ }