@visulima/packem-rollup 1.0.0-alpha.3 → 1.0.0-alpha.30
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/CHANGELOG.md +267 -0
- package/LICENSE.md +199 -590
- package/README.md +89 -2
- package/dist/index.d.ts +24 -56
- package/dist/index.js +1 -0
- package/dist/packem_shared/cachingPlugin-CLawAGhx.js +1 -0
- package/dist/packem_shared/createSplitChunks-Ceq_Ca5Y.js +1 -0
- package/dist/packem_shared/esbuildPlugin-DpLtQGuZ.js +1 -0
- package/dist/packem_shared/index-QEzU3Fey.js +1 -0
- package/dist/packem_shared/{metafilePlugin-ObS4J7mO.mjs → metafilePlugin-CVcqFpPJ.js} +1 -1
- package/dist/packem_shared/oxcResolvePlugin-Ccef6pyL.js +1 -0
- package/dist/packem_shared/{patchTypescriptTypes-BEdkvKxL.mjs → patchTypescriptTypes-BX_sJsvd.js} +2 -2
- package/dist/packem_shared/resolveTsconfigPathsPlugin-CEasmDpi.js +1 -0
- package/dist/packem_shared/{resolveTsconfigRootDirectoriesPlugin-_93afm2q.mjs → resolveTsconfigRootDirectoriesPlugin-Cwj3tqCJ.js} +1 -1
- package/dist/plugins/cache-plugin.d.ts +11 -0
- package/dist/plugins/chunk-splitter/gather.d.ts +8 -0
- package/dist/plugins/chunk-splitter/index.d.ts +6 -0
- package/dist/plugins/chunk-splitter/parse/index.d.ts +4 -0
- package/dist/plugins/chunk-splitter/parse/types.d.ts +24 -0
- package/dist/plugins/cjs-interop.d.ts +7 -0
- package/dist/{packem_shared/cjsInteropPlugin-D5wyoQ_B.mjs → plugins/cjs-interop.js} +1 -1
- package/dist/plugins/copy.d.ts +23 -0
- package/dist/plugins/copy.js +1 -0
- package/dist/plugins/data-uri.d.ts +25 -0
- package/dist/plugins/data-uri.js +1 -0
- package/dist/plugins/debarrel.d.ts +7 -0
- package/dist/plugins/debarrel.js +2 -0
- package/dist/{packem_shared/browserslist-to-esbuild-DY9HwYtp.d.mts → plugins/esbuild/browserslist-to-esbuild.d.ts} +1 -2
- package/dist/plugins/esbuild/esbuild-plugin.d.ts +3 -0
- package/dist/plugins/esbuild/index.d.ts +3 -25
- package/dist/plugins/esbuild/index.js +1 -0
- package/dist/plugins/esbuild/types.d.ts +39 -0
- package/dist/plugins/esbuild/utils/get-render-chunk.d.ts +14 -0
- package/dist/plugins/esbuild/utils/optimize-deps.d.ts +3 -0
- package/dist/plugins/esbuild/utils/warn.d.ts +4 -0
- package/dist/plugins/esm-shim-cjs-syntax.d.ts +9 -0
- package/dist/plugins/fix-dts-default-cjs-exports.d.ts +26 -0
- package/dist/plugins/fix-dts-default-cjs-exports.js +1 -0
- package/dist/plugins/fix-dynamic-import-extension.d.ts +3 -0
- package/dist/plugins/isolated-declarations/index.d.ts +8 -0
- package/dist/plugins/isolated-declarations/index.js +3 -0
- package/dist/plugins/isolated-declarations/utils/extend-string.d.ts +2 -0
- package/dist/plugins/isolated-declarations/utils/fix-dts-default-cjs-exports.d.ts +35 -0
- package/dist/plugins/isolated-declarations/utils/lowest-common-ancestor.d.ts +2 -0
- package/dist/plugins/isolated-declarations/utils/split-tsconfig-path-key.d.ts +2 -0
- package/dist/plugins/json.d.ts +4 -0
- package/dist/plugins/json.js +1 -0
- package/dist/plugins/jsx-remove-attributes.d.ts +7 -0
- package/dist/plugins/jsx-remove-attributes.js +1 -0
- package/dist/plugins/license.d.ts +17 -0
- package/dist/plugins/license.js +13 -0
- package/dist/plugins/metafile.d.ts +3 -0
- package/dist/plugins/minify-html-literals/index.d.ts +41 -0
- package/dist/plugins/minify-html-literals/index.js +3 -0
- package/dist/plugins/minify-html-literals/lib/minify-html-literals.d.ts +200 -0
- package/dist/plugins/minify-html-literals/lib/models.d.ts +25 -0
- package/dist/plugins/minify-html-literals/lib/parse-literals.d.ts +13 -0
- package/dist/plugins/minify-html-literals/lib/strategy.d.ts +69 -0
- package/dist/plugins/minify-html-literals/lib/typescript.d.ts +23 -0
- package/dist/plugins/native-modules-plugin.d.ts +14 -0
- package/dist/plugins/native-modules-plugin.js +1 -0
- package/dist/plugins/oxc/index.d.ts +4 -28
- package/dist/plugins/oxc/index.js +1 -0
- package/dist/plugins/oxc/isolated-declarations-oxc-transformer.d.ts +4 -0
- package/dist/plugins/oxc/oxc-resolve-plugin.d.ts +4 -0
- package/dist/plugins/oxc/oxc-transformer-plugin.d.ts +3 -0
- package/dist/plugins/oxc/types.d.ts +16 -0
- package/dist/plugins/preserve-directives.d.ts +16 -0
- package/dist/{packem_shared/preserveDirectivesPlugin-B49Cbykd.mjs → plugins/preserve-directives.js} +3 -3
- package/dist/plugins/raw.d.ts +7 -0
- package/dist/plugins/raw.js +6 -0
- package/dist/plugins/require-cjs-transformer.d.ts +43 -0
- package/dist/plugins/require-cjs-transformer.js +21 -0
- package/dist/plugins/resolve-file-url.d.ts +3 -0
- package/dist/plugins/shebang.d.ts +9 -0
- package/dist/plugins/source-maps.d.ts +7 -0
- package/dist/plugins/sucrase/index.d.ts +8 -19
- package/dist/plugins/swc/index.d.ts +3 -26
- package/dist/plugins/swc/index.js +1 -0
- package/dist/plugins/swc/isolated-declarations-swc-transformer.d.ts +3 -0
- package/dist/plugins/swc/swc-plugin.d.ts +3 -0
- package/dist/plugins/swc/types.d.ts +6 -0
- package/dist/plugins/typescript/index.d.ts +8 -29
- package/dist/plugins/typescript/index.js +1 -0
- package/dist/plugins/typescript/isolated-declarations-typescript-transformer.d.ts +4 -0
- package/dist/plugins/typescript/patch-typescript-types.d.ts +13 -0
- package/dist/plugins/typescript/resolve-tsconfig-paths-plugin.d.ts +11 -0
- package/dist/plugins/typescript/resolve-tsconfig-root-dirs.d.ts +24 -0
- package/dist/plugins/typescript/resolve-typescript-mjs-cjs.d.ts +10 -0
- package/dist/plugins/url.d.ts +72 -0
- package/dist/plugins/url.js +1 -0
- package/dist/types.d.ts +133 -0
- package/dist/utils/chunks/create-split-chunks.d.ts +11 -0
- package/dist/utils/chunks/get-custom-module-layer.d.ts +2 -0
- package/dist/utils/chunks/get-module-layer.d.ts +10 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/is-pure-cjs.d.ts +9 -0
- package/package.json +104 -29
- package/dist/index.d.mts +0 -56
- package/dist/index.mjs +0 -1
- package/dist/packem_shared/browserslist-to-esbuild-DY9HwYtp.d.ts +0 -3
- package/dist/packem_shared/cachingPlugin-D0BBFJPD.mjs +0 -1
- package/dist/packem_shared/copyPlugin--6RITp1-.mjs +0 -1
- package/dist/packem_shared/createSplitChunks-CGDk55G3.mjs +0 -1
- package/dist/packem_shared/esbuildPlugin-BAwyhG6L.mjs +0 -1
- package/dist/packem_shared/fixDtsDefaultCjsExportsPlugin-Dp1UcHVR.mjs +0 -1
- package/dist/packem_shared/isolatedDeclarationsPlugin-A0wmmw3Y.mjs +0 -3
- package/dist/packem_shared/jsonPlugin-BAi3Da-h.mjs +0 -1
- package/dist/packem_shared/jsxRemoveAttributes-B1PLPffj.mjs +0 -1
- package/dist/packem_shared/licensePlugin-C5yzUqe-.mjs +0 -13
- package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG.mjs +0 -1
- package/dist/packem_shared/rawPlugin-BqlR6ZOI.mjs +0 -1
- package/dist/packem_shared/resolveTsconfigPathsPlugin-Crf4lzxq.mjs +0 -1
- package/dist/packem_shared/types-C_grznAP.d.mts +0 -4539
- package/dist/packem_shared/types-C_grznAP.d.ts +0 -4539
- package/dist/packem_shared/urlPlugin-DBgFIkTc.mjs +0 -1
- package/dist/plugins/esbuild/index.d.mts +0 -25
- package/dist/plugins/esbuild/index.mjs +0 -1
- package/dist/plugins/oxc/index.d.mts +0 -28
- package/dist/plugins/oxc/index.mjs +0 -1
- package/dist/plugins/sucrase/index.d.mts +0 -19
- package/dist/plugins/swc/index.d.mts +0 -26
- package/dist/plugins/swc/index.mjs +0 -1
- package/dist/plugins/typescript/index.d.mts +0 -29
- package/dist/plugins/typescript/index.mjs +0 -1
- /package/dist/packem_shared/{browserslistToEsbuild-C0IWmbNe.mjs → browserslistToEsbuild-C0IWmbNe.js} +0 -0
- /package/dist/packem_shared/{chunkSplitter-DWAy1JkE.mjs → chunkSplitter-DWAy1JkE.js} +0 -0
- /package/dist/packem_shared/{fix-dts-default-cjs-exports-BQc0nwIG.mjs → fix-dts-default-cjs-exports-BQc0nwIG.js} +0 -0
- /package/dist/packem_shared/{fixDynamicImportExtension-BBGNRniz.mjs → fixDynamicImportExtension-BBGNRniz.js} +0 -0
- /package/dist/packem_shared/{getCustomModuleLayer-d8i66lfh.mjs → getCustomModuleLayer-d8i66lfh.js} +0 -0
- /package/dist/packem_shared/{getModuleLayer-rF9RxnJ5.mjs → getModuleLayer-rF9RxnJ5.js} +0 -0
- /package/dist/packem_shared/{index-Dq8IUFTs.mjs → index-Dq8IUFTs.js} +0 -0
- /package/dist/packem_shared/{isolatedDeclarationsOxcTransformer-WbfE6cGu.mjs → isolatedDeclarationsOxcTransformer-WbfE6cGu.js} +0 -0
- /package/dist/packem_shared/{isolatedDeclarationsSwcTransformer-Ch2AgtWC.mjs → isolatedDeclarationsSwcTransformer-Ch2AgtWC.js} +0 -0
- /package/dist/packem_shared/{isolatedDeclarationsTypescriptTransformer-DkuEkofo.mjs → isolatedDeclarationsTypescriptTransformer-DkuEkofo.js} +0 -0
- /package/dist/packem_shared/{oxcTransformPlugin-DfVQouIB.mjs → oxcTransformPlugin-DfVQouIB.js} +0 -0
- /package/dist/packem_shared/{resolveFileUrl-BkpjVHeK.mjs → resolveFileUrlPlugin-BkpjVHeK.js} +0 -0
- /package/dist/packem_shared/{resolveTypescriptMjsCtsPlugin-DcZrZTmM.mjs → resolveTypescriptMjsCtsPlugin-DcZrZTmM.js} +0 -0
- /package/dist/packem_shared/{swcPlugin-Boip4lWG.mjs → swcPlugin-Boip4lWG.js} +0 -0
- /package/dist/{packem_shared/esmShimCjsSyntaxPlugin-DjKqX4DE.mjs → plugins/esm-shim-cjs-syntax.js} +0 -0
- /package/dist/{packem_shared/makeExecutable-6aOVHoJR.mjs → plugins/shebang.js} +0 -0
- /package/dist/{packem_shared/sourcemapsPlugin-B4W3J79w.mjs → plugins/source-maps.js} +0 -0
- /package/dist/plugins/sucrase/{index.mjs → index.js} +0 -0
package/README.md
CHANGED
|
@@ -41,6 +41,93 @@ pnpm add @visulima/packem-rollup
|
|
|
41
41
|
|
|
42
42
|
## Usage
|
|
43
43
|
|
|
44
|
+
### Data URI Plugin
|
|
45
|
+
|
|
46
|
+
The `dataUriPlugin` converts files to data URIs for inline embedding. It supports configurable SVG encoding strategies via query parameters.
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
import { dataUriPlugin } from "@visulima/packem-rollup";
|
|
50
|
+
|
|
51
|
+
export default {
|
|
52
|
+
plugins: [dataUriPlugin()],
|
|
53
|
+
};
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
#### Query Parameters
|
|
57
|
+
|
|
58
|
+
- `?data-uri` - Basic data URI conversion
|
|
59
|
+
- `?data-uri&encoding=css` - Use CSS-optimized SVG encoding
|
|
60
|
+
- `?data-uri&encoding=tiny` - Use tiny SVG encoding (default)
|
|
61
|
+
- `?data-uri&srcset` - Encode spaces as %20 for srcset compatibility
|
|
62
|
+
|
|
63
|
+
#### Examples
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
// Tiny SVG encoding (default)
|
|
67
|
+
import icon from "./icon.svg?data-uri";
|
|
68
|
+
|
|
69
|
+
// CSS-optimized SVG encoding
|
|
70
|
+
import icon from "./icon.svg?data-uri&encoding=css";
|
|
71
|
+
|
|
72
|
+
// Tiny SVG with srcset compatibility
|
|
73
|
+
import icon from "./icon.svg?data-uri&srcset";
|
|
74
|
+
|
|
75
|
+
// CSS encoding with srcset compatibility
|
|
76
|
+
import icon from "./icon.svg?data-uri&encoding=css&srcset";
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### Lazy Barrel Plugin
|
|
80
|
+
|
|
81
|
+
The `lazyBarrelPlugin` implements lazy barrel optimization similar to Rspack's `lazyBarrel` experiment. It identifies side-effect-free barrel files and marks their re-export dependencies as lazy, only building them when their exports are actually requested.
|
|
82
|
+
|
|
83
|
+
```typescript
|
|
84
|
+
import { lazyBarrelPlugin } from "@visulima/packem-rollup";
|
|
85
|
+
|
|
86
|
+
export default {
|
|
87
|
+
plugins: [
|
|
88
|
+
lazyBarrelPlugin({
|
|
89
|
+
sideEffectsCheck: true,
|
|
90
|
+
lazyThreshold: 2,
|
|
91
|
+
include: [/\.ts$/, /\.js$/],
|
|
92
|
+
exclude: [/\.test\.ts$/],
|
|
93
|
+
}),
|
|
94
|
+
],
|
|
95
|
+
};
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
#### Features
|
|
99
|
+
|
|
100
|
+
- **Barrel Detection**: Automatically identifies files with multiple re-exports
|
|
101
|
+
- **Side Effects Checking**: Reads package.json to check `sideEffects` field
|
|
102
|
+
- **Lazy Loading**: Generates lazy loading code for unused exports
|
|
103
|
+
- **Configurable Threshold**: Set minimum exports to consider a file as a barrel
|
|
104
|
+
- **Filtering**: Include/exclude specific file patterns
|
|
105
|
+
|
|
106
|
+
#### How It Works
|
|
107
|
+
|
|
108
|
+
1. **Analysis**: Parses module code to detect barrel export patterns
|
|
109
|
+
2. **Side Effects Check**: Verifies if the module is marked as side-effect-free
|
|
110
|
+
3. **Lazy Marking**: Marks re-export dependencies as lazy for deferred building
|
|
111
|
+
4. **Code Generation**: Creates lazy loading wrappers for unused exports
|
|
112
|
+
5. **Optimization**: Only builds modules when their exports are actually requested
|
|
113
|
+
|
|
114
|
+
### URL Plugin
|
|
115
|
+
|
|
116
|
+
The `urlPlugin` handles asset URLs, either inlining them as data URIs or copying them to a destination directory. SVG files are optimized using the shared `svgEncoder` utility before being base64 encoded.
|
|
117
|
+
|
|
118
|
+
```typescript
|
|
119
|
+
import { urlPlugin } from "@visulima/packem-rollup";
|
|
120
|
+
|
|
121
|
+
export default {
|
|
122
|
+
plugins: [
|
|
123
|
+
urlPlugin({
|
|
124
|
+
limit: 14336, // 14kb
|
|
125
|
+
fileName: "[hash][extname]",
|
|
126
|
+
}),
|
|
127
|
+
],
|
|
128
|
+
};
|
|
129
|
+
```
|
|
130
|
+
|
|
44
131
|
## Related
|
|
45
132
|
|
|
46
133
|
## Supported Node.js Versions
|
|
@@ -56,8 +143,8 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
56
143
|
|
|
57
144
|
## Credits
|
|
58
145
|
|
|
59
|
-
-
|
|
60
|
-
-
|
|
146
|
+
- [Daniel Bannert](https://github.com/prisis)
|
|
147
|
+
- [All Contributors](https://github.com/visulima/packem/graphs/contributors)
|
|
61
148
|
|
|
62
149
|
## License
|
|
63
150
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,56 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
declare const chunkSplitter: () => Plugin;
|
|
27
|
-
|
|
28
|
-
type FixDtsDefaultCjsExportsPluginOptions = {
|
|
29
|
-
matcher?: (info: RenderedChunk) => boolean;
|
|
30
|
-
};
|
|
31
|
-
declare const fixDtsDefaultCjsExportsPlugin: (options?: FixDtsDefaultCjsExportsPluginOptions) => Plugin;
|
|
32
|
-
|
|
33
|
-
declare const fixDynamicImportExtension: () => Plugin;
|
|
34
|
-
|
|
35
|
-
declare const JSONPlugin: (options: RollupJsonOptions) => Plugin;
|
|
36
|
-
|
|
37
|
-
declare const metafilePlugin: () => Plugin;
|
|
38
|
-
|
|
39
|
-
declare const cachingPlugin: (plugin: Plugin, cache: FileCache, subDirectory?: string) => Plugin;
|
|
40
|
-
|
|
41
|
-
declare const preserveDirectives: ({ directiveRegex, exclude, include, logger, }: {
|
|
42
|
-
directiveRegex: RegExp;
|
|
43
|
-
exclude?: FilterPattern;
|
|
44
|
-
include?: FilterPattern;
|
|
45
|
-
logger: PailServerType;
|
|
46
|
-
}) => Plugin;
|
|
47
|
-
|
|
48
|
-
declare const resolveFileUrl: () => Plugin;
|
|
49
|
-
|
|
50
|
-
declare const createSplitChunks: (dependencyGraphMap: Map<string, Set<[string, string]>>, entryFiles: (BuildContextBuildAssetAndChunk | BuildContextBuildEntry)[]) => GetManualChunk;
|
|
51
|
-
|
|
52
|
-
declare const getCustomModuleLayer: (moduleId: string) => string | undefined;
|
|
53
|
-
|
|
54
|
-
declare const getModuleLayer: (moduleMeta: CustomPluginOptions) => any;
|
|
55
|
-
|
|
56
|
-
export { cachingPlugin, chunkSplitter, createSplitChunks, fixDtsDefaultCjsExportsPlugin, fixDynamicImportExtension, getCustomModuleLayer, getModuleLayer, JSONPlugin as jsonPlugin, metafilePlugin, preserveDirectives as preserveDirectivesPlugin, resolveFileUrl };
|
|
1
|
+
export { default as cachingPlugin } from "./plugins/cache-plugin.d.ts";
|
|
2
|
+
export { default as chunkSplitter } from "./plugins/chunk-splitter/index.d.ts";
|
|
3
|
+
export { default as browserslistToEsbuild } from "./plugins/esbuild/browserslist-to-esbuild.d.ts";
|
|
4
|
+
export { default as fixDynamicImportExtension } from "./plugins/fix-dynamic-import-extension.d.ts";
|
|
5
|
+
export { default as metafilePlugin } from "./plugins/metafile.d.ts";
|
|
6
|
+
export { default as resolveFileUrlPlugin } from "./plugins/resolve-file-url.d.ts";
|
|
7
|
+
export type { ExtendedRollupNodeResolveOptions, IsolatedDeclarationsResult, IsolatedDeclarationsTransformer, PackemRollupOptions, RollupPlugins, TransformerFn, TransformerName } from "./types.d.ts";
|
|
8
|
+
export { default as createSplitChunks } from "./utils/chunks/create-split-chunks.d.ts";
|
|
9
|
+
export { default as getCustomModuleLayer } from "./utils/chunks/get-custom-module-layer.d.ts";
|
|
10
|
+
export { default as getModuleLayer } from "./utils/chunks/get-module-layer.d.ts";
|
|
11
|
+
export type { Alias, ResolverObject as AliasResolverObject, ResolvedAlias, RollupAliasOptions } from "@rollup/plugin-alias";
|
|
12
|
+
export { default as alias } from "@rollup/plugin-alias";
|
|
13
|
+
export type { RollupCommonJSOptions } from "@rollup/plugin-commonjs";
|
|
14
|
+
export { default as commonjs } from "@rollup/plugin-commonjs";
|
|
15
|
+
export type { RollupDynamicImportVariablesOptions } from "@rollup/plugin-dynamic-import-vars";
|
|
16
|
+
export { default as dynamicImportVars } from "@rollup/plugin-dynamic-import-vars";
|
|
17
|
+
export { default as inject, type RollupInjectOptions } from "@rollup/plugin-inject";
|
|
18
|
+
export { default as nodeResolve, type RollupNodeResolveOptions } from "@rollup/plugin-node-resolve";
|
|
19
|
+
export { default as replace, type RollupReplaceOptions } from "@rollup/plugin-replace";
|
|
20
|
+
export { type RollupWasmOptions, default as wasm } from "@rollup/plugin-wasm";
|
|
21
|
+
export { default as polyfillNode, type NodePolyfillsOptions as RollupNodePolyfillsOptions } from "rollup-plugin-polyfill-node";
|
|
22
|
+
export { PluginPure, type PureAnnotationsOptions as RollupPureAnnotationsOptions } from "rollup-plugin-pure";
|
|
23
|
+
export type { PluginVisualizerOptions as RollupPluginVisualizerOptions } from "rollup-plugin-visualizer";
|
|
24
|
+
export { default as visualizer } from "rollup-plugin-visualizer";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{default as r}from"./packem_shared/cachingPlugin-CLawAGhx.js";import{default as a}from"./packem_shared/chunkSplitter-DWAy1JkE.js";import{default as l}from"./packem_shared/browserslistToEsbuild-C0IWmbNe.js";import{default as u}from"./packem_shared/fixDynamicImportExtension-BBGNRniz.js";import{default as p}from"./packem_shared/metafilePlugin-CVcqFpPJ.js";import{default as x}from"./packem_shared/resolveFileUrlPlugin-BkpjVHeK.js";import{default as n}from"./packem_shared/createSplitChunks-Ceq_Ca5Y.js";import{default as g}from"./packem_shared/getCustomModuleLayer-d8i66lfh.js";import{default as P}from"./packem_shared/getModuleLayer-rF9RxnJ5.js";import{default as v}from"@rollup/plugin-alias";import{default as j}from"@rollup/plugin-commonjs";import{default as w}from"@rollup/plugin-dynamic-import-vars";import{default as E}from"@rollup/plugin-inject";import{default as L}from"@rollup/plugin-node-resolve";import{default as S}from"@rollup/plugin-replace";import{default as D}from"@rollup/plugin-wasm";import{default as N}from"rollup-plugin-polyfill-node";import{PluginPure as T}from"rollup-plugin-pure";import{default as V}from"rollup-plugin-visualizer";export{T as PluginPure,v as alias,l as browserslistToEsbuild,r as cachingPlugin,a as chunkSplitter,j as commonjs,n as createSplitChunks,w as dynamicImportVars,u as fixDynamicImportExtension,g as getCustomModuleLayer,P as getModuleLayer,E as inject,p as metafilePlugin,L as nodeResolve,N as polyfillNode,S as replace,x as resolveFileUrlPlugin,V as visualizer,D as wasm};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var w=Object.defineProperty;var m=(a,r)=>w(a,"name",{value:r,configurable:!0});import{isAccessibleSync as b,readFileSync as g}from"@visulima/fs";import{join as l}from"@visulima/path";import{getHash as o}from"@visulima/packem-share/utils";var _=Object.defineProperty,h=m((a,r)=>_(a,"name",{value:r,configurable:!0}),"f");const d=h(a=>a.handler||a,"getHandler"),f=h(a=>a&&typeof a=="object"&&a.__packem_cache_wrapped===!0?a.data:a,"unwrapCachedValue"),E=h((a,r,u="")=>({...a,async buildEnd(e){a.buildEnd&&await d(a.buildEnd).call(this,e)},async buildStart(e){a.buildStart&&await d(a.buildStart).call(this,e)},async load(e){if(!a.load)return;const t=l(u,a.name),n=e.includes("?")?e.split("?")[0]:e;let c="";try{if(n&&b(n)){const y=g(n);c=o(y)}}catch{}const s=l("load",o(e),c);if(r.has(s,t))return f(await r.get(s,t));const i=await d(a.load).call(this,e),p=i&&typeof i=="object"&&"code"in i?i:{__packem_cache_wrapped:!0,data:i};return r.set(s,p,t),i},name:`cached(${a.name})`,async resolveId(e,t,n){if(!a.resolveId)return;const c=l(u,a.name),s=l("resolveId",o(e),t?o(t):"",o(JSON.stringify(n)));if(r.has(s,c))return f(await r.get(s,c));const i=await d(a.resolveId).call(this,e,t,n);return r.set(s,i,c),i},async transform(e,t){if(!a.transform)return;const n=l(u,a.name),c=l("transform",o(t),o(e));if(r.has(c,n))return f(await r.get(c,n));const s=await d(a.transform).call(this,e,t);return r.set(c,s,n),s}}),"cachePlugin");export{E as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var I=Object.defineProperty;var p=(t,n)=>I(t,"name",{value:n,configurable:!0});import{memoize as y}from"@visulima/packem-share/utils";import{basename as b,extname as w}from"@visulima/path";import S from"./getCustomModuleLayer-d8i66lfh.js";import l from"./getModuleLayer-rF9RxnJ5.js";var $=Object.defineProperty,h=p((t,n)=>$(t,"name",{value:n,configurable:!0}),"d");const M=y(t=>{let n=0;for(let r=0;r<t.length;r+=1)n=(n<<5)-n+t.codePointAt(r);return(n>>>0).toString(36).slice(0,3)}),j=h((t,n)=>{const r=new Map;return h(function(e,u){if(/[\\/]node_modules[\\/]@swc[\\/]helper/.test(e))return"cc";const c=u.getModuleInfo(e);if(!c)return;const{isEntry:m}=c,d=c.meta;let s=l(d);if(s&&(s=M(s)),!m){const f=r.get(e);if(f)return f;const o=S(e);if(o)return r.set(e,o),o}if(m){const f=u.getModuleIds();for(const o of f)u.getModuleInfo(o)&&l(d)===s&&(t.has(o)||t.set(o,new Set),t.get(o).add([e,s]))}if(s&&!m&&t.has(e)){const f=[...t.get(e)];if(f.some(([i])=>{if(n.some(a=>a.path===i)){const a=u.getModuleInfo(i);return l(a?a.meta:{})===s}return!1}))return;if(f.every(([,i])=>i===s))return r.has(e)?r.get(e):void 0;const o=b(e,w(e)),v=M(s),g=`${o}-${v}`;return r.set(e,g),g}},"splitChunks")},"createSplitChunks");export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var j=Object.defineProperty;var u=(e,r)=>j(e,"name",{value:r,configurable:!0});import{createFilter as x}from"@rollup/pluginutils";import{DEFAULT_LOADERS as k}from"@visulima/packem-share/constants";import{join as O,extname as E}from"@visulima/path";import{formatMessages as M,transform as h,build as $}from"esbuild";import{findCacheDirSync as A}from"@visulima/find-cache-dir";import{readFileSync as P}from"@visulima/fs";import*as R from"rs-module-lexer";var S=Object.defineProperty,F=u((e,r)=>S(e,"name",{value:r,configurable:!0}),"n$1");const y=F(async(e,r)=>{r.length>0&&(await M(r,{color:!0,kind:"warning"})).forEach(s=>e.warn(s))},"warn");var C=Object.defineProperty,w=u((e,r)=>C(e,"name",{value:r,configurable:!0}),"t");const L=w(e=>{if(e==="es")return"esm";if(e==="cjs")return e},"getEsbuildFormat"),W=w(({sourceMap:e=!0,...r})=>async function(s,n,i){if(r.minify||r.minifyWhitespace||r.minifyIdentifiers||r.minifySyntax){const t=L(i.format),c=await h(s,{format:t,loader:"js",sourcemap:e,...r});if(await y(this,c.warnings),c.code)return{code:c.code,map:c.map||void 0}}},"getRenderChunk");var I=Object.defineProperty,D=u((e,r)=>I(e,"name",{value:r,configurable:!0}),"n");const b=D(e=>e.replaceAll("\\","/"),"slash"),{parseAsync:T}=R,q=D(async e=>{const r=A("@visulima/packem/optimize-deps",{create:!0,cwd:e.cwd});if(!r)throw new Error('[packem:optimize-deps]: failed to find or create cache directory "node_modules/.cache/packem/optimize_deps".');await $({absWorkingDir:e.cwd,bundle:!0,entryPoints:e.include,format:"esm",ignoreAnnotations:!0,metafile:!0,outdir:r,sourcemap:e.sourceMap,splitting:!0,...e.esbuildOptions,plugins:[{name:"optimize-deps",async setup(n){n.onResolve({filter:/.*/},async i=>{if(e.exclude?.includes(i.path))return{external:!0};if(!i.pluginData?.__resolving_dep_path__&&e.include.includes(i.path)){const t=await n.resolve(i.path,{kind:"import-statement",pluginData:{__resolving_dep_path__:!0},resolveDir:i.resolveDir});return t.errors.length>0||t.warnings.length>0?t:{namespace:"optimize-deps",path:i.path,pluginData:{absolute:t.path,resolveDir:i.resolveDir}}}}),n.onLoad({filter:/.*/,namespace:"optimize-deps"},async i=>{const{absolute:t,resolveDir:c}=i.pluginData,p=P(t),{output:g}=await T({input:[{code:p,filename:t}]});return{contents:(g[0]?.exports??[]).length>0?`export * from '${b(t)}'`:`module.exports = require('${b(t)}')`,resolveDir:c}})}},...e.esbuildOptions?.plugins??[]]});const s=new Map;for(const n of e.include)s.set(n,{file:O(r,`${n}.js`)});return{cacheDir:r,optimized:s}},"optimizeDeps");var N=Object.defineProperty,U=u((e,r)=>N(e,"name",{value:r,configurable:!0}),"g");const B=U(({exclude:e,include:r,loaders:s,logger:n,optimizeDeps:i,sourceMap:t,...c})=>{const p=k;if(s!==void 0)for(let[a,o]of Object.entries(s)){const d=a.startsWith(".")?a:`.${a}`;typeof o=="string"?p[d]=o:o||delete p[d]}const g=Object.keys(p),_=new RegExp(`\\.(${g.map(a=>a.slice(1)).join("|")})$`),z=x(r??_,e);let l,v=process.cwd();return{async buildStart(){!i||l||(l=await q({cwd:v,sourceMap:t??!1,...i}),n.debug("optimized %O",l.optimized))},name:"packem:esbuild",options({context:a}){a&&(v=a)},renderChunk:W({...c,sourceMap:t}),async resolveId(a){if(l?.optimized.has(a)){const o=l.optimized.get(a);if(o)return n.debug("resolved %s to %s",a,o.file),o.file}},async transform(a,o){if(!z(o)||l?.optimized.has(o))return;const d=E(o),m=p[d];if(n.debug("transforming %s with %s loader",o,m),!m)return;const f=await h(a,{format:["base64","binary","dataurl","text","json"].includes(m)?"esm":void 0,loader:m,sourcefile:o.replace(/\.[cm]ts/,".ts"),sourcemap:t,...c});if(await y(this,f.warnings),f.code)return{code:f.code,map:f.map||void 0}}}},"esbuildTransformer");B.NAME="esbuild";export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var u=Object.defineProperty;var m=(o,a)=>u(o,"name",{value:a,configurable:!0});const r={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.autodesk.fbx":["fbx"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dcmp+xml":["dcmp"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.drawing":["gdraw"],"application/vnd.google-apps.form":["gform"],"application/vnd.google-apps.jam":["gjam"],"application/vnd.google-apps.map":["gmap"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.script":["gscript"],"application/vnd.google-apps.site":["gsite"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-visio.viewer":["vdx"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.procrate.brushset":["brushset"],"application/vnd.procreate.brush":["brush"],"application/vnd.procreate.dream":["drm"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw","vsdx","vtx"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blender":["blend"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-compressed":["*rar"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-ipynb+json":["ipynb"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zip-compressed":["*zip"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.blockfact.facti":["facti"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-adobe-dng":["dng"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(r);const f={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(f);var b=Object.defineProperty,h=m((o,a)=>b(o,"name",{value:a,configurable:!0}),"g"),t=m(function(o,a,n,i){if(typeof a=="function"?o!==a||!i:!a.has(o))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(o):i?i.value:a.get(o)},"n"),c,d,l;class w{static{m(this,"p")}static{h(this,"Mime")}constructor(...a){c.set(this,new Map),d.set(this,new Map),l.set(this,new Map);for(const n of a)this.define(n)}define(a,n=!1){for(let[i,e]of Object.entries(a)){i=i.toLowerCase(),e=e.map(p=>p.toLowerCase()),t(this,l,"f").has(i)||t(this,l,"f").set(i,new Set);const g=t(this,l,"f").get(i);let x=!0;for(let p of e){const v=p.startsWith("*");if(p=v?p.slice(1):p,g?.add(p),x&&t(this,d,"f").set(i,p),x=!1,v)continue;const s=t(this,c,"f").get(p);if(s&&s!=i&&!n)throw new Error(`"${i} -> ${p}" conflicts with "${s} -> ${p}". Pass \`force=true\` to override this definition.`);t(this,c,"f").set(p,i)}}return this}getType(a){if(typeof a!="string")return null;const n=a.replace(/^.*[/\\]/s,"").toLowerCase(),i=n.replace(/^.*\./s,"").toLowerCase(),e=n.length<a.length;return!(i.length<n.length-1)&&e?null:t(this,c,"f").get(i)??null}getExtension(a){return typeof a!="string"?null:(a=a?.split?.(";")[0],(a&&t(this,d,"f").get(a.trim().toLowerCase()))??null)}getAllExtensions(a){return typeof a!="string"?null:t(this,l,"f").get(a.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const a of t(this,l,"f").values())Object.freeze(a);return this}_getTestState(){return{types:t(this,c,"f"),extensions:t(this,d,"f")}}}c=new WeakMap,d=new WeakMap,l=new WeakMap;const j=new w(f,r)._freeze();export{j as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var f=Object.defineProperty;var a=(e,t)=>f(e,"name",{value:t,configurable:!0});import{ENDING_REGEX as l}from"@visulima/packem-share";var c=Object.defineProperty,u=a((e,t)=>c(e,"name",{value:t,configurable:!0}),"o");const g=u(()=>({async generateBundle(e,t){const r=[];for(const s of this.getModuleIds()){const o=this.getModuleInfo(s);if(o!=null&&!o.isExternal)for(const n of o.importedIds)r.push({source:s,target:n})}if(Array.isArray(r)&&r.length===0)return;const i=Object.keys(t);this.emitFile({fileName:`metafile-${i[0].replace(l,"")}-${e.format}.json`,source:JSON.stringify(r,void 0,2),type:"asset"})},name:"packem:metafile"}),"metafilePlugin");export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var S=Object.defineProperty;var g=(t,e)=>S(t,"name",{value:e,configurable:!0});import{createFilter as P}from"@rollup/pluginutils";import{findPackageJson as k}from"@visulima/package/package-json";import{dirname as n}from"@visulima/path";import{ResolverFactory as J}from"oxc-resolver";var M=Object.defineProperty,m=g((t,e)=>M(t,"name",{value:e,configurable:!0}),"a");let b;const A=new Map,z=m((t,e,h,u)=>{const{ignoreSideEffectsForRoot:E,...a}=t;let c=b;return c||(c=b=new J({...a,roots:[...a.roots??[],e],tsconfig:u?{configFile:u,references:"auto"}:void 0})),{name:"oxc-resolve",resolveId:{async handler(p,l,{isEntry:w}){const v=w||!l?n(p):n(l),{error:x,path:o}=await c.async(v,p);if(x){h.debug(x,{context:[{basedir:e,extensions:a.extensions,id:o}]});return}let f=m(s=>!1,"hasModuleSideEffects");try{const{packageJson:s,path:F}=await k(n(o),{cache:A}),y=n(F);if(!E||e!==y){const i=s.sideEffects;if(typeof i=="boolean")f=m(()=>i,"hasModuleSideEffects");else if(Array.isArray(i)){const R=i.map(d=>d.includes("/")?d:`**/${d}`);f=P(R,void 0,{resolve:y})}}}catch(s){console.debug(s.message,{context:[{basedir:v,caller:"Resolver",error:s,extensions:a.extensions,id:o}]})}const r=await this.resolve(o,l,{skipSelf:!0});if(r)return r.external?!1:r.id!==o?r:{id:o,meta:r.meta,moduleSideEffects:f(o)}},order:"post"}}},"oxcResolvePlugin");export{z as default};
|
package/dist/packem_shared/{patchTypescriptTypes-BEdkvKxL.mjs → patchTypescriptTypes-BX_sJsvd.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var $=Object.defineProperty;var l=(e,n)=>$(e,"name",{value:n,configurable:!0});import{parse as w}from"@babel/parser";import{w as y}from"./index-Dq8IUFTs.
|
|
1
|
+
var $=Object.defineProperty;var l=(e,n)=>$(e,"name",{value:n,configurable:!0});import{parse as w}from"@babel/parser";import{w as y}from"./index-Dq8IUFTs.js";import T from"magic-string";import{findStaticImports as b}from"mlly";var x=Object.defineProperty,s=l((e,n)=>x(e,"name",{value:n,configurable:!0}),"s");const C=/\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\//g,N=/MIT License|MIT license|BSD license/,k=/\n{2,}/g,v=/\b(\w+)\$\d+\b/g,A=/[-/\\^$*+?.()|[\]{}]/g,I=s(e=>e.replaceAll(A,String.raw`\$&`),"escapeRegex"),R=s(e=>[...new Set(e)],"unique"),S=s(e=>e.replaceAll(C,n=>N.test(n)?"":n).replaceAll(k,`
|
|
2
2
|
|
|
3
3
|
`),"cleanUnnecessaryComments"),d=new Map;function g(e,n,{identifierReplacements:r},o){const p=b(e);for(const t in r){const a=p.find(i=>i.specifier===t&&i.imports.includes("{"));if(!a){this.warn(`${n.fileName} does not import "${t}" for replacement`),process.exitCode=1;continue}const c=r[t];for(const i in c){if(!a.imports.includes(i))throw new Error(`${n.fileName} does not import "${i}" from "${t}" for replacement`);const f=c[i],u=I(i);f.includes(".")&&(e=e.replace(new RegExp(`\\b\\w+\\b as ${u},?\\s?`),"")),e=e.replaceAll(new RegExp(`\\b${u}\\b`,"g"),f)}}const m=R(Array.from(e.matchAll(v),t=>t[0]));if(m.length>0){const t=m.map(c=>`
|
|
4
4
|
- ${c}`).join(""),a=n.fileName.replace(/\.[^/.]+$/,"");d.has(a)||o.warn({message:`${n.fileName} contains confusing identifier names${t}
|
|
5
5
|
|
|
6
|
-
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),d.set(a,!0)}return e}l(g,"
|
|
6
|
+
To replace these, add them to the "rollup -> patchTypes -> identifierReplacements" option in your packem config.`,prefix:"plugin:patch-types"}),d.set(a,!0)}return e}l(g,"N");s(g,"replaceConfusingTypeNames");const E=s((e,n)=>{if(n.leadingComments?.some(r=>r.type==="CommentBlock"&&r.value.includes("@internal"))){const r=e.original[n.end]===","?n.end+1:n.end;return e.remove(n.leadingComments[0].start,r),!0}return!1},"removeInternal");function h(e,n){if(e.includes("@internal")){const r=new T(e),o=w(e,{plugins:["typescript"],sourceType:"module"});if(y(o,{enter(p){E(r,p)&&this.skip()}}),e=r.toString(),e.includes("@internal"))throw new Error(`${n.fileName} has unhandled @internal declarations`)}return e}l(h,"S");s(h,"stripInternalTypes");const D=s((e,n)=>({name:"packem:patch-types",renderChunk(r,o){return r=g.call(this,r,o,e,n),r=h.call(this,r,o),r=S(r),r}}),"patchTypescriptTypes");export{D as patchTypescriptTypes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var b=Object.defineProperty;var d=(t,e)=>b(t,"name",{value:e,configurable:!0});import{isAbsolute as P,join as $,dirname as O,resolve as k}from"@visulima/path";import{isRelative as y}from"@visulima/path/utils";var j=Object.defineProperty,o=d((t,e)=>j(t,"name",{value:e,configurable:!0}),"o");const S=42,U=o(t=>{let e=!1;for(let s=0;s<t.length;s++)if(t.codePointAt(s)===S){if(e)return!1;e=!0}return!0},"hasZeroOrOneAsteriskCharacter"),W=o(t=>{const e=t.indexOf("*");return e===-1?void 0:{prefix:t.slice(0,e),suffix:t.slice(e+1)}},"tryParsePattern"),A=o(({prefix:t,suffix:e},s)=>s.length>=t.length+e.length&&s.startsWith(t)&&s.endsWith(e),"isPatternMatch"),T=o((t,e,s)=>{let i,r=-1;for(const f of t){const a=e(f);A(a,s)&&a.prefix.length>r&&(r=a.prefix.length,i=f)}return i},"findBestPatternMatch"),q=o((t,e)=>{const s=[];for(const i of t){if(!U(i))continue;const r=W(i);if(r)s.push(r);else if(i===e)return i}return T(s,i=>i,e)},"matchPatternOrExact"),B=o((t,e)=>e.substring(t.prefix.length,e.length-t.suffix.length),"matchedText"),R=o(({prefix:t,suffix:e})=>`${t}*${e}`,"patternText"),w=o((t,e,s)=>{let i=O(e.path);e.config.compilerOptions?.baseUrl&&(i=k(t,e.config.compilerOptions.baseUrl)),s?.debug({message:`Resolved baseUrl to ${i}`,prefix:"plugin:resolve-tsconfig-paths"});const r=e.config.compilerOptions?.paths??{};return Object.keys(r).length===0&&s?.debug({message:"No paths found in tsconfig.json",prefix:"plugin:resolve-tsconfig-paths"}),{paths:r,resolvedBaseUrl:i}},"getTsconfigPaths"),_=o((t,e,s,i)=>{const{paths:r,resolvedBaseUrl:f}=w(t,e,s),a=Object.keys(r);return{name:"plugin:resolve-tsconfig-paths",async resolveId(n,m,v){if(a.length===0)return;if(n.includes("\0")){s.debug({message:`Skipping resolution of ${n} as it is a virtual module`,prefix:"plugin:resolve-tsconfig-paths"});return}if(n.includes("node_modules")){s.debug({message:`Skipping request as it is inside node_modules ${n}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(!i.resolveAbsolutePath&&P(n)){s.debug({message:`Skipping request as it is an absolute path ${n}`,prefix:"plugin:resolve-tsconfig-paths"});return}if(y(n)){s.debug({message:`Skipping request as it is a relative path ${n}`,prefix:"plugin:resolve-tsconfig-paths"});return}const l=q(a,n);if(!l){s.debug({message:`moduleName did not match any paths pattern ${n}`,prefix:"plugin:resolve-tsconfig-paths"});return}const u=typeof l=="string"?void 0:B(l,n),x=typeof l=="string"?l:R(l);for await(const c of r[x]){const p=u?c.replace("*",u):c;if(p.endsWith(".d.ts")||p.endsWith(".d.cts")||p.endsWith(".d.mts"))continue;const h=$(f,p);try{const g=await this.resolve(h,m,{skipSelf:!0,...v});if(g)return g}catch(g){s.debug({context:[g],message:`Failed to resolve ${h} from ${n}`,prefix:"plugin:resolve-tsconfig-paths"})}}}}},"resolveTsconfigPathsPlugin");export{_ as resolveTsconfigPathsPlugin};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var v=Object.defineProperty;var
|
|
1
|
+
var v=Object.defineProperty;var a=(o,r)=>v(o,"name",{value:r,configurable:!0});import{join as d,resolve as p}from"@visulima/path";var g=Object.defineProperty,c=a((o,r)=>g(o,"name",{value:r,configurable:!0}),"u");const m=c((o,r)=>{if(!r)return;const{config:s,path:t}=r;if(!s.compilerOptions)return;const{rootDirs:e}=s.compilerOptions;if(!e)return;const n=[];for(const i of e){if(i.startsWith("."))throw new Error(`Invalid rootDir value '.' in ${t}.`);if(i.startsWith(".."))throw new Error(`Invalid rootDir value '..' in ${t}.`);n.push(p(o,i))}return n},"getRootDirectories"),w=c((o,r,s)=>{const t=m(o,s);return{name:"packem:resolve-tsconfig-root-dirs",async resolveId(e,n,i){if(!(t===void 0||t.length===0)&&e.startsWith("."))for(const l of t){const u=d(l,e),f=await this.resolve(u,n,{skipSelf:!0,...i});if(f)return r.debug({message:`Resolved ${e} to ${f.id} using rootDirs from tsconfig.json.`,prefix:"plugin:resolve-tsconfig-root-dirs"}),f.id}}}},"resolveTsconfigRootDirectories");export{w as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { FileCache } from "@visulima/packem-share/utils";
|
|
2
|
+
import type { Plugin } from "rollup";
|
|
3
|
+
/**
|
|
4
|
+
* Wrap a Rollup plugin to add caching to various hooks.
|
|
5
|
+
* @param plugin
|
|
6
|
+
* @param cache
|
|
7
|
+
* @param subDirectory
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
declare const cachePlugin: (plugin: Plugin, cache: FileCache, subDirectory?: string) => Plugin;
|
|
11
|
+
export default cachePlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ModuleInfo, PluginContext } from "rollup";
|
|
2
|
+
interface ExportInfo {
|
|
3
|
+
exportedName: string;
|
|
4
|
+
id: string;
|
|
5
|
+
sourceName: string;
|
|
6
|
+
}
|
|
7
|
+
declare const gatherExports: (context: PluginContext, module_: ModuleInfo) => AsyncGenerator<ExportInfo>;
|
|
8
|
+
export default gatherExports;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface BarrelReExport {
|
|
2
|
+
from: "other";
|
|
3
|
+
source: string;
|
|
4
|
+
type: "barrel";
|
|
5
|
+
}
|
|
6
|
+
export interface ExportBinding {
|
|
7
|
+
exportedName: string;
|
|
8
|
+
importedName: string;
|
|
9
|
+
}
|
|
10
|
+
export interface NamedReExport {
|
|
11
|
+
bindings: ExportBinding[];
|
|
12
|
+
from: "other";
|
|
13
|
+
source: string;
|
|
14
|
+
type: "named";
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Modified copy of https://github.com/cprecioso/rollup-plugin-chunk-per-export/blob/main/src/parse/types.ts
|
|
18
|
+
*/
|
|
19
|
+
export interface NamedSelfExport {
|
|
20
|
+
exportedName: string;
|
|
21
|
+
from: "self";
|
|
22
|
+
type: "named";
|
|
23
|
+
}
|
|
24
|
+
export type ParsedExportInfo = BarrelReExport | NamedReExport | NamedSelfExport;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var c=Object.defineProperty;var l=(e,r)=>c(e,"name",{value:r,configurable:!0});import d from"magic-string";var i=Object.defineProperty,s=l((e,r)=>i(e,"name",{value:r,configurable:!0}),"u");const g=s(({addDefaultProperty:e=!1,logger:r})=>({name:"packem:cjs-interop",renderChunk:s(async(u,o,a)=>{if(!(o.type!=="chunk"||!o.isEntry)&&a.format==="cjs"&&a.exports==="auto"){const n=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(u);if(n===null||n.length<3)return;const t=new d(u);t.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),t.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&t.append(`
|
|
2
2
|
module.exports.default = ${n[2]};`);let p=t.toString();return p=p.replace(/(?:module\.)?exports(?:\['default'\]|\.default)/i,"module.exports"),r.debug({message:`Applied CommonJS interop to entry chunk ${o.fileName}.`,prefix:"plugin:cjs-interop"}),{code:p,map:t.generateMap({hires:!0})}}},"renderChunk")}),"cjsInteropPlugin");export{g as cjsInteropPlugin};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Plugin } from "rollup";
|
|
2
|
+
export type CopyPluginOptions = {
|
|
3
|
+
/**
|
|
4
|
+
* Copy items once. Useful in watch mode.
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
copyOnce?: boolean;
|
|
8
|
+
exactFileNames?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Remove the directory structure of copied files.
|
|
11
|
+
* @default true
|
|
12
|
+
*/
|
|
13
|
+
flatten?: boolean;
|
|
14
|
+
targets: MultipleTargetsDesc;
|
|
15
|
+
};
|
|
16
|
+
type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
|
|
17
|
+
type SingleTargetDesc = {
|
|
18
|
+
dest?: string;
|
|
19
|
+
exclude?: string[] | string;
|
|
20
|
+
src: string[] | string;
|
|
21
|
+
};
|
|
22
|
+
export declare const copyPlugin: (options: CopyPluginOptions, logger: Console) => Plugin;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var g=Object.defineProperty;var l=(n,a)=>g(n,"name",{value:a,configurable:!0});import{stat as x}from"node:fs/promises";import{readFile as h}from"@visulima/fs";import{arrayify as u}from"@visulima/packem-share/utils";import{normalize as b,join as y,relative as w,dirname as F,basename as P}from"@visulima/path";import $ from"glob-parent";import{glob as v}from"tinyglobby";var A=Object.defineProperty,j=l((n,a)=>A(n,"name",{value:a,configurable:!0}),"f");const C=j((n,a)=>{const c=new Map,p={copyOnce:!0,exactFileNames:!0,flatten:!1,...n};let{targets:s}=p;return Array.isArray(s)?s=s.map(o=>{if(typeof o=="string")return{src:o};if(typeof o=="object"&&"src"in o)return o}).filter(Boolean):typeof s=="string"&&(s=[{src:s}]),{async buildStart(){const o=await Promise.all(s.flatMap(e=>Array.isArray(e.src)?e.src.map(r=>({...e,src:r})):e).map(async e=>await v(u(e.src),{ignore:u(e.exclude).filter(Boolean)}).then(r=>({dest:e.dest??"",parent:$(e.src),src:r}))));for(const e of o)for(const r of e.src){let i;c.has(r)?i=c.get(r):(i={copied:[],dest:[],timestamp:0},c.set(r,i));const t=p.flatten?b(e.dest):y(e.dest,w(e.parent,F(r)));i.dest.includes(t)||i.dest.push(t),this.addWatchFile(r)}a.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...c].map(async([e,r])=>{let i;try{const t=await x(e);if(!t.isFile())return;const m=t.mtime.getTime();m>r.timestamp&&(r.timestamp=m,r.copied=[]),i=await h(e,{buffer:!0})}catch(t){a.error({context:[t],message:`error reading file ${e}`,prefix:"plugin:copy"});return}for(const t of r.dest){if(p.copyOnce&&r.copied.includes(t))continue;const m=P(e),f=y(t,m);try{this.emitFile({[p.exactFileNames?"fileName":"name"]:f,source:i,type:"asset"}),a.debug({message:`copied ${e} → ${f}`,prefix:"plugin:copy"}),r.copied.push(t)}catch(d){a.error({context:[d],message:`error copying file ${e} → ${f}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");export{C as copyPlugin};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FilterPattern } from "@rollup/pluginutils";
|
|
2
|
+
import type { Plugin } from "rollup";
|
|
3
|
+
export type DataUriPluginOptions = {
|
|
4
|
+
exclude?: FilterPattern;
|
|
5
|
+
include?: FilterPattern;
|
|
6
|
+
/** Encode spaces for use in srcset attribute */
|
|
7
|
+
srcset?: boolean;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Data URI plugin that converts files to data URIs for inline embedding.
|
|
11
|
+
*
|
|
12
|
+
* Query parameters:
|
|
13
|
+
* - ?data-uri - Basic data URI conversion
|
|
14
|
+
* - ?data-uri and encoding=css - Use CSS-optimized SVG encoding
|
|
15
|
+
* - ?data-uri and encoding=tiny - Use tiny SVG encoding (default)
|
|
16
|
+
* - ?data-uri and srcset - Encode spaces as %20 for srcset compatibility
|
|
17
|
+
*
|
|
18
|
+
* Examples:
|
|
19
|
+
* - ./icon.svg?data-uri - Tiny SVG encoding
|
|
20
|
+
* - ./icon.svg?data-uri and encoding=css - CSS-optimized SVG encoding
|
|
21
|
+
* - ./icon.svg?data-uri and srcset - Tiny SVG with srcset compatibility
|
|
22
|
+
* - ./icon.svg?data-uri and encoding=css and srcset - CSS encoding with srcset compatibility
|
|
23
|
+
*/
|
|
24
|
+
export declare const dataUriPlugin: (options?: DataUriPluginOptions) => Plugin;
|
|
25
|
+
export default dataUriPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var p=Object.defineProperty;var c=(a,e)=>p(a,"name",{value:e,configurable:!0});import{createFilter as g}from"@rollup/pluginutils";import{readFile as u}from"@visulima/fs";import{svgToCssDataUri as h,svgToTinyDataUri as b}from"@visulima/packem-share";import{R as v}from"../packem_shared/index-QEzU3Fey.js";var x=Object.defineProperty,$=c((a,e)=>x(a,"name",{value:e,configurable:!0}),"l");const F=$((a={})=>{const e=g(a.include??[/\?data-uri/],a.exclude);return{async load(s){if(!e(s)||!s.includes("?data-uri"))return;const i=new URL(s,"file://"),t=i.pathname,f=i.searchParams.get("encoding")||"tiny",l=i.searchParams.has("srcset")||a.srcset;this.addWatchFile(t);const r=v.getType(t)||"application/octet-stream";if(r==="image/svg+xml"){const n=await u(t,{buffer:!1}),o=f==="css"?h(n):b(n);return`export default "${l?o.replaceAll(" ","%20"):o}"`}const d=await u(t,{buffer:!0}),m=Buffer.from(d).toString("base64");return`export default "${`${r.startsWith("text/")?`data:${r};charset=utf-8;base64,`:`data:${r};base64,`}${m}`}"`},name:"packem:data-uri"}},"dataUriPlugin");export{F as dataUriPlugin,F as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FilterPattern } from "@rollup/pluginutils";
|
|
2
|
+
import type { Plugin } from "rollup";
|
|
3
|
+
export interface DebarrelPluginOptions {
|
|
4
|
+
include?: FilterPattern;
|
|
5
|
+
possibleBarrelFiles?: (RegExp | string)[];
|
|
6
|
+
}
|
|
7
|
+
export declare const debarrelPlugin: (options: DebarrelPluginOptions, logger: Console) => Plugin;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var I=Object.defineProperty;var $=(e,t)=>I(e,"name",{value:t,configurable:!0});import S from"node:fs/promises";import{createFilter as j}from"@rollup/pluginutils";import M from"magic-string";import*as B from"rs-module-lexer";var E=Object.defineProperty,d=$((e,t)=>E(e,"name",{value:t,configurable:!0}),"u");const A=/\.[mc]?tsx?(?:\?.*)?$/,D=/(?:\.(?:[tj]s|[tj]sx)|\/index\.(?:[tj]s|[tj]sx))(?:\?.*)?$/,O=/^\s*export/,_={exports:[],facade:!1,imports:[]},y=d(e=>A.test(e),"isSourceFile"),b=d(e=>e.includes("/build/cache/vite/")||e.includes("/node_modules/"),"isIgnoredModule"),k=d((e,t)=>b(e)?!1:D.test(e)?!0:t.possibleBarrelFiles?t.possibleBarrelFiles.some(s=>e.match(s)):!1,"isPossibleBarrelSpecifier"),N=d(e=>O.test(e)?"export":"import","getDeclarationKind"),{parseAsync:z}=B,C=d(async(e,t,s)=>{try{const{output:r}=await z({input:[{code:t,filename:e}]});return r[0]}catch(r){return s.warn({message:`Failed to parse ${e}:
|
|
2
|
+
${r instanceof Error?r.message:String(r)}`,prefix:"plugin:debarrel"}),_}},"safeParse"),K=d(async(e,t,s,r)=>{const a=e.parseCache.get(t);if(a!==void 0)return a;const o=await C(t,s,r);return e.parseCache.set(t,o),o},"parsePotentialBarrelFile"),R=d((e,t)=>{const s=e.fileCache.get(t);if(s!==void 0)return s;const r=S.readFile(t,"utf8");return e.fileCache.set(t,r),r},"readFileCached"),P=d(e=>{const t=/^(?:import|export)\s+([\w$]+)/,s=/([\w$]+)\s*,\s*\{|\}\s*,\s*([\w$]+)/,r=/[{,]\s*(type\s+)?([\w$]+)(?:\s+as\s+([\w$]+))?/gi;r.lastIndex=0;const a=[];if(e.includes("*"))return a;if(!e.includes("{")){const i=e.match(t);return i&&a.push({imported:"default",local:i[1]}),a}const o=e.match(s);o&&a.push({imported:"default",local:o[1]||o[2]});let n;for(;n=r.exec(e);)n[1]||n[2]&&a.push({imported:n[2],local:n[3]});return a},"getImportNames"),T=d((e,t,s)=>{let r=e.ln,a=t.find(o=>o.ss<e.s&&o.se>e.e&&o.d===-1);if(!a||!a.n){const o=r||s.slice(e.s).match(/default\s+([a-zA-Z_$][\w$]*)(?:;|\n|$)/)?.[1];o&&(a=t.find(n=>{const i=P(s.slice(n.ss,n.s)).find(c=>c.local===o);return i&&(r=i.imported),i}))}if(a&&!r){const o=s.slice(a.ss,e.s);if(!o.includes("*")){const n=o.match(/([\w$]+)\s*as\s*$/)?.[1];n&&(r=n)}}return{imp:a,localExportName:r}},"findMatchingImport"),v=d(async(e,t,s,r,a)=>{const{resolve:o}=e,n=await R(e,t),{exports:i,imports:c}=await K(e,t,n,a);for await(const l of i){const p=l.n;if(p!==s)continue;const u=T(l,c,n),{imp:f,localExportName:w}=u;if(!f||!f.n)return{exportName:s,id:t,resolved:!0};if(f.d>-1)return{exportName:s,id:t,resolved:!0};let h;const g=n.slice(f.ss,l.s);if(N(g)==="import"&&/\bas\b/.test(g)){const F=new RegExp(`(\\w+)\\s+as\\s+${s}(?!\\w)`);h=g.match(F)?.[0]}const x=(await o(f.n,t))?.id;return x?k(x,r)?v(e,x,w||p,r,a):{aliasedImportName:h,exportName:w||s,id:x,resolved:!1}:{aliasedImportName:h,exportName:w,id:t,resolved:!1}}const m=c.filter(l=>/^export\s+\*(?!\s+as)/.test(n.slice(l.ss,l.s)));if(m.length===1){const l=m[0]?.n,p=l?(await e.resolve(l,t))?.id:void 0;if(!p)return{exportName:s,id:t,resolved:!1};const u=await v(e,p,s,r);if(u.resolved)return u}else if(m.length>1){const l=(await Promise.all(m.map(async p=>{const u=p.n,f=u?(await e.resolve(u,t))?.id:void 0;if(f)return v(e,f,s,r)}))).find(p=>p?.resolved);if(l)return l}return{exportName:s,id:t,resolved:!1}},"resolveThroughBarrel"),J=d((e,t,s)=>{const{aliasedImportName:r,exportName:a}=e,o=t.local||t.imported;return r?`{${r}}`:a==="default"&&s!=="export"?o:`{${a!==o?`${a} as ${o}`:a}}`},"getDeclarationClause"),L=d(async(e,t,s,r,a)=>{const o=[],{imports:n}=await C(t,s,a);return await Promise.all(n.map(async i=>{if(!i.n||i.d!==-1)return;const c=s.slice(i.ss,i.s),m=P(c);if(m.length===0)return;const l=(await e.resolve(i.n,t))?.id;if(!l||!y(l)||b(l))return;const p=N(c);try{const u=await Promise.all(m.map(async f=>{const w=await v(e,l,f.imported,r);if(!w)return;const h=J(w,f,p),g=JSON.stringify(w.id);return`${p} ${h} from ${g}`}));if(u.includes(void 0))return;o.push([i.ss,i.se,u.join(";")])}catch(u){a.warn({context:{error:u},message:u.toString(),prefix:"plugin:debarrel"})}})),o},"getDebarrelModifications"),X=d((e,t,s,r)=>{if(s.length===0)return;const a=new M(t,{filename:e});for(const[o,n,i]of s)a.update(o,n,i);return{code:a.toString(),map:r?a.generateMap({file:e}):void 0}},"applyModifications"),Q=d((e,t)=>{const s=new Map,r=new Map,a=d(()=>{s.clear(),r.clear()},"purgeCaches"),o=e.include?j(e.include,[]):void 0;let n=!0;return{buildEnd:a,buildStart:a,async load(i){const c=s.get(i);if(c)return await c},name:"packem:debarrel",options(i){(i.output&&(Array.isArray(i.output)?i.output[0]?.sourcemap:i.output?.sourcemap))===!1&&(n=!1)},async transform(i,c){if(!y(c)||o&&!o(c))return;const m={fileCache:s,parseCache:r,resolve:this.resolve.bind(this)},l=await L(m,c,i,e,t);return X(c,i,l,n)},watchChange(i){s.delete(i),r.delete(i)}}},"debarrelPlugin");export{Q as debarrelPlugin};
|