@visulima/packem-rollup 1.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (61) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE.md +890 -0
  3. package/README.md +71 -0
  4. package/dist/index.d.mts +56 -0
  5. package/dist/index.d.ts +56 -0
  6. package/dist/index.mjs +1 -0
  7. package/dist/packem_shared/browserslist-to-esbuild-DY9HwYtp.d.mts +3 -0
  8. package/dist/packem_shared/browserslist-to-esbuild-DY9HwYtp.d.ts +3 -0
  9. package/dist/packem_shared/browserslistToEsbuild-C0IWmbNe.mjs +1 -0
  10. package/dist/packem_shared/cachingPlugin-D0BBFJPD.mjs +1 -0
  11. package/dist/packem_shared/chunkSplitter-DWAy1JkE.mjs +1 -0
  12. package/dist/packem_shared/cjsInteropPlugin-D5wyoQ_B.mjs +2 -0
  13. package/dist/packem_shared/copyPlugin--6RITp1-.mjs +1 -0
  14. package/dist/packem_shared/createSplitChunks-CGDk55G3.mjs +1 -0
  15. package/dist/packem_shared/esbuildPlugin-BAwyhG6L.mjs +1 -0
  16. package/dist/packem_shared/esmShimCjsSyntaxPlugin-DjKqX4DE.mjs +11 -0
  17. package/dist/packem_shared/fix-dts-default-cjs-exports-BQc0nwIG.mjs +26 -0
  18. package/dist/packem_shared/fixDtsDefaultCjsExportsPlugin-Dp1UcHVR.mjs +1 -0
  19. package/dist/packem_shared/fixDynamicImportExtension-BBGNRniz.mjs +1 -0
  20. package/dist/packem_shared/getCustomModuleLayer-d8i66lfh.mjs +1 -0
  21. package/dist/packem_shared/getModuleLayer-rF9RxnJ5.mjs +1 -0
  22. package/dist/packem_shared/index-Dq8IUFTs.mjs +1 -0
  23. package/dist/packem_shared/index-IiwweiIe.d.mts +4538 -0
  24. package/dist/packem_shared/index-IiwweiIe.d.ts +4538 -0
  25. package/dist/packem_shared/isolatedDeclarationsOxcTransformer-WbfE6cGu.mjs +1 -0
  26. package/dist/packem_shared/isolatedDeclarationsPlugin-BqP17nSP.mjs +3 -0
  27. package/dist/packem_shared/isolatedDeclarationsSwcTransformer-Ch2AgtWC.mjs +1 -0
  28. package/dist/packem_shared/isolatedDeclarationsTypescriptTransformer-DkuEkofo.mjs +3 -0
  29. package/dist/packem_shared/jsonPlugin-BAi3Da-h.mjs +1 -0
  30. package/dist/packem_shared/jsxRemoveAttributes-B1PLPffj.mjs +1 -0
  31. package/dist/packem_shared/licensePlugin-C5yzUqe-.mjs +13 -0
  32. package/dist/packem_shared/makeExecutable-6aOVHoJR.mjs +4 -0
  33. package/dist/packem_shared/metafilePlugin-ObS4J7mO.mjs +1 -0
  34. package/dist/packem_shared/oxcResolvePlugin-BJpi-eSG.mjs +1 -0
  35. package/dist/packem_shared/oxcTransformPlugin-DfVQouIB.mjs +4 -0
  36. package/dist/packem_shared/patchTypescriptTypes-BEdkvKxL.mjs +6 -0
  37. package/dist/packem_shared/preserveDirectivesPlugin-B49Cbykd.mjs +4 -0
  38. package/dist/packem_shared/rawPlugin-BqlR6ZOI.mjs +1 -0
  39. package/dist/packem_shared/resolveFileUrl-BkpjVHeK.mjs +1 -0
  40. package/dist/packem_shared/resolveTsconfigPathsPlugin-Crf4lzxq.mjs +1 -0
  41. package/dist/packem_shared/resolveTsconfigRootDirectoriesPlugin-_93afm2q.mjs +1 -0
  42. package/dist/packem_shared/resolveTypescriptMjsCtsPlugin-DcZrZTmM.mjs +1 -0
  43. package/dist/packem_shared/sourcemapsPlugin-B4W3J79w.mjs +1 -0
  44. package/dist/packem_shared/swcPlugin-Boip4lWG.mjs +1 -0
  45. package/dist/packem_shared/urlPlugin-DBgFIkTc.mjs +1 -0
  46. package/dist/plugins/esbuild/index.d.mts +24 -0
  47. package/dist/plugins/esbuild/index.d.ts +24 -0
  48. package/dist/plugins/esbuild/index.mjs +1 -0
  49. package/dist/plugins/oxc/index.d.mts +27 -0
  50. package/dist/plugins/oxc/index.d.ts +27 -0
  51. package/dist/plugins/oxc/index.mjs +1 -0
  52. package/dist/plugins/sucrase/index.d.mts +18 -0
  53. package/dist/plugins/sucrase/index.d.ts +18 -0
  54. package/dist/plugins/sucrase/index.mjs +1 -0
  55. package/dist/plugins/swc/index.d.mts +25 -0
  56. package/dist/plugins/swc/index.d.ts +25 -0
  57. package/dist/plugins/swc/index.mjs +1 -0
  58. package/dist/plugins/typescript/index.d.mts +28 -0
  59. package/dist/plugins/typescript/index.d.ts +28 -0
  60. package/dist/plugins/typescript/index.mjs +1 -0
  61. package/package.json +133 -0
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ <div align="center">
2
+ <h3>visulima packem-rollup</h3>
3
+ <p>
4
+ Rollup plugins for packem
5
+ </p>
6
+ </div>
7
+
8
+ <br />
9
+
10
+ <div align="center">
11
+
12
+ [![typescript-image]][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
13
+
14
+ </div>
15
+
16
+ ---
17
+
18
+ <div align="center">
19
+ <p>
20
+ <sup>
21
+ Daniel Bannert's open source work is supported by the community on <a href="https://github.com/sponsors/prisis">GitHub Sponsors</a>
22
+ </sup>
23
+ </p>
24
+ </div>
25
+
26
+ ---
27
+
28
+ ## Install
29
+
30
+ ```sh
31
+ npm install @visulima/packem-rollup
32
+ ```
33
+
34
+ ```sh
35
+ yarn add @visulima/packem-rollup
36
+ ```
37
+
38
+ ```sh
39
+ pnpm add @visulima/packem-rollup
40
+ ```
41
+
42
+ ## Usage
43
+
44
+ ## Related
45
+
46
+ ## Supported Node.js Versions
47
+
48
+ Libraries in this ecosystem make the best effort to track [Node.js’ release schedule](https://github.com/nodejs/release#release-schedule).
49
+ Here’s [a post on why we think this is important](https://medium.com/the-node-js-collection/maintainers-should-consider-following-node-js-release-schedule-ab08ed4de71a).
50
+
51
+ ## Contributing
52
+
53
+ If you would like to help take a look at the [list of issues](https://github.com/visulima/packem/issues) and check our [Contributing](.github/CONTRIBUTING.md) guidelines.
54
+
55
+ > **Note:** please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
56
+
57
+ ## Credits
58
+
59
+ - [Daniel Bannert](https://github.com/prisis)
60
+ - [All Contributors](https://github.com/visulima/packem/graphs/contributors)
61
+
62
+ ## License
63
+
64
+ The visulima packem-rollup is open-sourced software licensed under the [MIT][license-url]
65
+
66
+ [typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
67
+ [typescript-url]: "typescript"
68
+ [license-image]: https://img.shields.io/npm/l/@visulima/packem-rollup?color=blueviolet&style=for-the-badge
69
+ [license-url]: LICENSE.md "license"
70
+ [npm-image]: https://img.shields.io/npm/v/@visulima/packem-rollup/latest.svg?style=for-the-badge&logo=npm
71
+ [npm-url]: https://www.npmjs.com/package/@visulima/packem-rollup/v/latest "npm"
@@ -0,0 +1,56 @@
1
+ import { Plugin, RenderedChunk, GetManualChunk, CustomPluginOptions } from 'rollup';
2
+ import { P as PailServerType } from './packem_shared/index-IiwweiIe.mjs';
3
+ export { C as CJSInteropOptions, a as CopyPluginOptions, E as EsmShimCjsSyntaxOptions, I as IsolatedDeclarationsOptions, k as IsolatedDeclarationsResult, n as IsolatedDeclarationsTransformer, J as JSXRemoveAttributesPlugin, L as LicenseOptions, o as PackemRollupOptions, R as RawLoaderOptions, p as RollupPlugins, S as ShebangOptions, f as SourcemapsPluginOptions, T as TransformerFn, q as TransformerName, U as UrlOptions, c as cjsInteropPlugin, b as copyPlugin, e as esmShimCjsSyntaxPlugin, g as getShebang, i as isolatedDeclarationsPlugin, j as jsxRemoveAttributes, l as licensePlugin, m as makeExecutable, r as rawPlugin, d as removeShebangPlugin, s as shebangPlugin, h as sourcemapsPlugin, u as urlPlugin } from './packem_shared/index-IiwweiIe.mjs';
4
+ export { b as browserslistToEsbuild } from './packem_shared/browserslist-to-esbuild-DY9HwYtp.mjs';
5
+ import { RollupJsonOptions } from '@rollup/plugin-json';
6
+ import { FileCache } from '@visulima/packem-share/utils';
7
+ import { FilterPattern } from '@rollup/pluginutils';
8
+ import { BuildContextBuildAssetAndChunk, BuildContextBuildEntry } from '@visulima/packem-share/types';
9
+ export { Alias, ResolverObject as AliasResolverObject, ResolvedAlias, RollupAliasOptions, default as alias } from '@rollup/plugin-alias';
10
+ export { RollupCommonJSOptions, default as commonjs } from '@rollup/plugin-commonjs';
11
+ export { RollupDynamicImportVariablesOptions, default as dynamicImportVars } from '@rollup/plugin-dynamic-import-vars';
12
+ export { RollupInjectOptions, default as inject } from '@rollup/plugin-inject';
13
+ export { RollupNodeResolveOptions, default as nodeResolve } from '@rollup/plugin-node-resolve';
14
+ export { RollupReplaceOptions, default as replace } from '@rollup/plugin-replace';
15
+ export { RollupWasmOptions, default as wasm } from '@rollup/plugin-wasm';
16
+ export { NodePolyfillsOptions as RollupNodePolyfillsOptions, default as polyfillNode } from 'rollup-plugin-polyfill-node';
17
+ export { PureAnnotationsOptions as RollupPureAnnotationsOptions, PluginPure as pure } from 'rollup-plugin-pure';
18
+ export { PluginVisualizerOptions as RollupPluginVisualizerOptions, default as visualizer } from 'rollup-plugin-visualizer';
19
+ import 'rollup-plugin-dts';
20
+ import 'esbuild';
21
+ import '@visulima/package';
22
+ import 'oxc-resolver';
23
+ import 'oxc-transform';
24
+ import 'sucrase';
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 };
@@ -0,0 +1,56 @@
1
+ import { Plugin, RenderedChunk, GetManualChunk, CustomPluginOptions } from 'rollup';
2
+ import { P as PailServerType } from './packem_shared/index-IiwweiIe.js';
3
+ export { C as CJSInteropOptions, a as CopyPluginOptions, E as EsmShimCjsSyntaxOptions, I as IsolatedDeclarationsOptions, k as IsolatedDeclarationsResult, n as IsolatedDeclarationsTransformer, J as JSXRemoveAttributesPlugin, L as LicenseOptions, o as PackemRollupOptions, R as RawLoaderOptions, p as RollupPlugins, S as ShebangOptions, f as SourcemapsPluginOptions, T as TransformerFn, q as TransformerName, U as UrlOptions, c as cjsInteropPlugin, b as copyPlugin, e as esmShimCjsSyntaxPlugin, g as getShebang, i as isolatedDeclarationsPlugin, j as jsxRemoveAttributes, l as licensePlugin, m as makeExecutable, r as rawPlugin, d as removeShebangPlugin, s as shebangPlugin, h as sourcemapsPlugin, u as urlPlugin } from './packem_shared/index-IiwweiIe.js';
4
+ export { b as browserslistToEsbuild } from './packem_shared/browserslist-to-esbuild-DY9HwYtp.js';
5
+ import { RollupJsonOptions } from '@rollup/plugin-json';
6
+ import { FileCache } from '@visulima/packem-share/utils';
7
+ import { FilterPattern } from '@rollup/pluginutils';
8
+ import { BuildContextBuildAssetAndChunk, BuildContextBuildEntry } from '@visulima/packem-share/types';
9
+ export { Alias, ResolverObject as AliasResolverObject, ResolvedAlias, RollupAliasOptions, default as alias } from '@rollup/plugin-alias';
10
+ export { RollupCommonJSOptions, default as commonjs } from '@rollup/plugin-commonjs';
11
+ export { RollupDynamicImportVariablesOptions, default as dynamicImportVars } from '@rollup/plugin-dynamic-import-vars';
12
+ export { RollupInjectOptions, default as inject } from '@rollup/plugin-inject';
13
+ export { RollupNodeResolveOptions, default as nodeResolve } from '@rollup/plugin-node-resolve';
14
+ export { RollupReplaceOptions, default as replace } from '@rollup/plugin-replace';
15
+ export { RollupWasmOptions, default as wasm } from '@rollup/plugin-wasm';
16
+ export { NodePolyfillsOptions as RollupNodePolyfillsOptions, default as polyfillNode } from 'rollup-plugin-polyfill-node';
17
+ export { PureAnnotationsOptions as RollupPureAnnotationsOptions, PluginPure as pure } from 'rollup-plugin-pure';
18
+ export { PluginVisualizerOptions as RollupPluginVisualizerOptions, default as visualizer } from 'rollup-plugin-visualizer';
19
+ import 'rollup-plugin-dts';
20
+ import 'esbuild';
21
+ import '@visulima/package';
22
+ import 'oxc-resolver';
23
+ import 'oxc-transform';
24
+ import 'sucrase';
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 };
package/dist/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{default as o}from"./packem_shared/chunkSplitter-DWAy1JkE.mjs";import{cjsInteropPlugin as a}from"./packem_shared/cjsInteropPlugin-D5wyoQ_B.mjs";import{copyPlugin as f}from"./packem_shared/copyPlugin--6RITp1-.mjs";import{default as u}from"./packem_shared/browserslistToEsbuild-C0IWmbNe.mjs";import{esmShimCjsSyntaxPlugin as p}from"./packem_shared/esmShimCjsSyntaxPlugin-DjKqX4DE.mjs";import{fixDtsDefaultCjsExportsPlugin as x}from"./packem_shared/fixDtsDefaultCjsExportsPlugin-Dp1UcHVR.mjs";import{default as d}from"./packem_shared/fixDynamicImportExtension-BBGNRniz.mjs";import{isolatedDeclarationsPlugin as c}from"./packem_shared/isolatedDeclarationsPlugin-BqP17nSP.mjs";import{default as b}from"./packem_shared/jsonPlugin-BAi3Da-h.mjs";import{jsxRemoveAttributes as j}from"./packem_shared/jsxRemoveAttributes-B1PLPffj.mjs";import{license as y}from"./packem_shared/licensePlugin-C5yzUqe-.mjs";import{default as D}from"./packem_shared/metafilePlugin-ObS4J7mO.mjs";import{default as E}from"./packem_shared/cachingPlugin-D0BBFJPD.mjs";import{default as w}from"./packem_shared/preserveDirectivesPlugin-B49Cbykd.mjs";import{rawPlugin as L}from"./packem_shared/rawPlugin-BqlR6ZOI.mjs";import{default as R}from"./packem_shared/resolveFileUrl-BkpjVHeK.mjs";import{getShebang as A,makeExecutable as F,removeShebangPlugin as N,shebangPlugin as T}from"./packem_shared/makeExecutable-6aOVHoJR.mjs";import{sourcemapsPlugin as V}from"./packem_shared/sourcemapsPlugin-B4W3J79w.mjs";import{urlPlugin as B}from"./packem_shared/urlPlugin-DBgFIkTc.mjs";import{default as H}from"./packem_shared/createSplitChunks-CGDk55G3.mjs";import{default as K}from"./packem_shared/getCustomModuleLayer-d8i66lfh.mjs";import{default as Q}from"./packem_shared/getModuleLayer-rF9RxnJ5.mjs";import{default as X}from"@rollup/plugin-alias";import{default as Z}from"@rollup/plugin-commonjs";import{default as $}from"@rollup/plugin-dynamic-import-vars";import{default as re}from"@rollup/plugin-inject";import{default as te}from"@rollup/plugin-node-resolve";import{default as le}from"@rollup/plugin-replace";import{default as se}from"@rollup/plugin-wasm";import{default as me}from"rollup-plugin-polyfill-node";import{PluginPure as ie}from"rollup-plugin-pure";import{default as ne}from"rollup-plugin-visualizer";export{X as alias,u as browserslistToEsbuild,E as cachingPlugin,o as chunkSplitter,a as cjsInteropPlugin,Z as commonjs,f as copyPlugin,H as createSplitChunks,$ as dynamicImportVars,p as esmShimCjsSyntaxPlugin,x as fixDtsDefaultCjsExportsPlugin,d as fixDynamicImportExtension,K as getCustomModuleLayer,Q as getModuleLayer,A as getShebang,re as inject,c as isolatedDeclarationsPlugin,b as jsonPlugin,j as jsxRemoveAttributes,y as licensePlugin,F as makeExecutable,D as metafilePlugin,te as nodeResolve,me as polyfillNode,w as preserveDirectivesPlugin,ie as pure,L as rawPlugin,N as removeShebangPlugin,le as replace,R as resolveFileUrl,T as shebangPlugin,V as sourcemapsPlugin,B as urlPlugin,ne as visualizer,se as wasm};
@@ -0,0 +1,3 @@
1
+ declare const browserslistToEsbuild: (browserList: string[]) => string[];
2
+
3
+ export { browserslistToEsbuild as b };
@@ -0,0 +1,3 @@
1
+ declare const browserslistToEsbuild: (browserList: string[]) => string[];
2
+
3
+ export { browserslistToEsbuild as b };
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var a=(s,i)=>o(s,"name",{value:i,configurable:!0});var t=Object.defineProperty,d=a((s,i)=>t(s,"name",{value:i,configurable:!0}),"r");const n=new Set(["chrome","edge","es","firefox","ie","ios","node","opera","safari"]),l=["android 4"],f={android:"chrome",ios_saf:"ios"},c=" ",p=d(s=>{let i=s.filter(e=>!l.some(r=>e.startsWith(r))).map(e=>e.split(c)).map(([e,r])=>[f[e]||e,r]).map(([e,r])=>[e,r.includes("-")?r.slice(0,r.indexOf("-")):r]).map(([e,r])=>[e,r.endsWith(".0")?r.slice(0,-2):r]).filter(([,e])=>/^\d+(?:\.\d+)*$/.test(e)).filter(([e])=>n.has(e));return i=Object.entries(Object.fromEntries(i)),i.map(([e,r])=>`${e}${r}`)},"browserslistToEsbuild");export{p as default};
@@ -0,0 +1 @@
1
+ var h=Object.defineProperty;var m=(a,r)=>h(a,"name",{value:r,configurable:!0});import{join as l}from"@visulima/path";import{getHash as o}from"@visulima/packem-share/utils";var g=Object.defineProperty,f=m((a,r)=>g(a,"name",{value:r,configurable:!0}),"m");const c=f(a=>a.handler||a,"getHandler"),v=f((a,r,d="")=>({...a,async buildEnd(n){a.buildEnd&&await c(a.buildEnd).call(this,n)},async buildStart(n){a.buildStart&&await c(a.buildStart).call(this,n)},async load(n){if(!a.load)return;const t=l(d,a.name),s=l("load",o(n));if(r.has(s,t))return await r.get(s,t);const e=await c(a.load).call(this,n);return r.set(s,e,t),e},name:`cached(${a.name})`,async resolveId(n,t,s){if(!a.resolveId)return;const e=l(d,a.name),i=l("resolveId",o(n),t?o(t):"",o(JSON.stringify(s)));if(r.has(i,e))return await r.get(i,e);const u=await c(a.resolveId).call(this,n,t,s);return r.set(i,u,e),u},async transform(n,t){if(!a.transform)return;const s=l(d,a.name),e=l("transform",o(t),o(n));if(r.has(e,s))return await r.get(e,s);const i=await c(a.transform).call(this,n,t);return r.set(e,i,s),i}}),"cachingPlugin");export{v as default};
@@ -0,0 +1 @@
1
+ var m=Object.defineProperty;var d=(e,a)=>m(e,"name",{value:a,configurable:!0});import c from"node:assert/strict";import{extractAssignedNames as u}from"@rollup/pluginutils";var y=Object.defineProperty,n=d((e,a)=>y(e,"name",{value:a,configurable:!0}),"r$1");const x=n(function*(e){switch(e.declaration?.type){case"ClassDeclaration":case"FunctionDeclaration":{const{id:a}=e.declaration;c.ok(a,"Expected class/function to have a name"),yield a.name;break}case"VariableDeclaration":{for(const a of e.declaration.declarations)for(const o of u(a.id))yield o;break}}},"exportName"),N=n(function*(e){if(e.declaration)for(const a of x(e))yield{exportedName:a,from:"self",type:"named"};else if(e.source)yield{bindings:e.specifiers.map(a=>({exportedName:a.exported.name,importedName:a.local.name})),from:"other",source:e.source.value,type:"named"};else for(const a of e.specifiers)yield{exportedName:a.exported.name,from:"self",type:"named"}},"parseExportNamed"),b=n(function*(e){e.exported?yield{exportedName:e.exported.name,from:"self",type:"named"}:yield{from:"other",source:e.source.value,type:"barrel"}},"parseExportAll"),h=n(function*(){yield{exportedName:"default",from:"self",type:"named"}},"parseExportDefault"),v=n(function*(e,a){c.ok(a.code!=null,`Module ${a.id} doesn't have associated code`);const o=e.parse(a.code);for(const r of o.body)switch(r.type){case"ExportAllDeclaration":{yield*b(r);break}case"ExportDefaultDeclaration":{yield*h();break}case"ExportNamedDeclaration":{yield*N(r);break}}},"parseExports");var g=Object.defineProperty,i=d((e,a)=>g(e,"name",{value:a,configurable:!0}),"n$1");const f=i(async function(e,a,o){const r=await e.resolve(a,o.id);if(c.ok(r,`Rollup can't resolve ${a} from ${o.id}`),r.external)return;const s=await e.load(r);return c.ok(s,`Rollup doesn't have a module for id ${r.id}`),s},"getImportedModule"),k=i(async function*(e,a,o){const r=await f(e,a.source,o);r&&(yield*l(e,r))},"gatherBarrelReExports"),E=i(async function*(e,a,o){const r=await f(e,a.source,o);if(!r)return;const s=new Map(a.bindings.map(t=>[t.importedName,t]));for await(const t of l(e,r)){const p=s.get(t.exportedName);p&&(yield{...t,exportedName:p.exportedName})}},"gatherNamedReExports"),$=i(async function*(e,a){yield{exportedName:a.exportedName,id:e.id,sourceName:a.exportedName}},"gatherNamedSelfExports"),l=i(async function*(e,a){for(const o of v(e,a))o.from==="self"?yield*$(a,o):o.type==="barrel"?yield*k(e,o,a):yield*E(e,o,a)},"gatherExports");var w=Object.defineProperty,D=d((e,a)=>w(e,"name",{value:a,configurable:!0}),"r");const A=D(()=>({moduleParsed:{async handler(e){if(e.isEntry)for await(const a of l(this,e))a.id!==e.id&&this.emitFile({id:a.id,name:a.exportedName,preserveSignature:"exports-only",type:"chunk"})},order:"post"},name:"packem:chunk-splitter"}),"chunkSplitter");export{A as default};
@@ -0,0 +1,2 @@
1
+ var i=Object.defineProperty;var a=(e,r)=>i(e,"name",{value:r,configurable:!0});import c from"magic-string";var d=Object.defineProperty,s=a((e,r)=>d(e,"name",{value:r,configurable:!0}),"i");const g=s(({addDefaultProperty:e=!1,logger:r})=>({name:"packem:cjs-interop",renderChunk:s(async(l,o,u)=>{if(!(o.type!=="chunk"||!o.isEntry)&&u.format==="cjs"&&u.exports==="auto"){const n=/(exports(?:\['default'\]|\.default)) = (.*);/i.exec(l);if(n===null||n.length<3)return;const t=new c(l);t.replace("Object.defineProperty(exports, '__esModule', { value: true });",""),t.replaceAll(/exports\.(.*) = (.*);/g,"module.exports.$1 = $2;"),e&&t.append(`
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 @@
1
+ var g=Object.defineProperty;var l=(c,i)=>g(c,"name",{value:i,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((c,i)=>A(c,"name",{value:i,configurable:!0}),"f");const C=j((c,i)=>{const n=new Map,p={copyOnce:!0,exactFileNames:!0,flatten:!1,...c};let{targets:o}=p;return Array.isArray(o)?o=o.map(s=>{if(typeof s=="string")return{src:s};if(typeof s=="object"&&"src"in s)return s}).filter(Boolean):typeof o=="string"&&(o=[{src:o}]),{async buildStart(){const s=await Promise.all(o.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 s)for(const r of e.src){let a;n.has(r)?a=n.get(r):(a={copied:[],dest:[],timestamp:0},n.set(r,a));const t=p.flatten?b(e.dest):y(e.dest,w(e.parent,F(r)));a.dest.includes(t)||a.dest.push(t),this.addWatchFile(r)}i.info({message:"Copying files...",prefix:"plugin:copy"}),await Promise.all([...n].map(async([e,r])=>{let a;try{const t=await x(e);if(!t.isFile())return;const m=t.mtime.getTime();m>r.timestamp&&(r.timestamp=m,r.copied=[]),a=await h(e,{buffer:!0})}catch(t){i.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:a,type:"asset"}),i.debug({message:`copied ${e} → ${f}`,prefix:"plugin:copy"}),r.copied.push(t)}catch(d){i.error({context:[d],message:`error copying file ${e} → ${f}`,prefix:"plugin:copy"})}}}))},name:"packem:copy"}},"copyPlugin");export{C as copyPlugin};
@@ -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.mjs";import l from"./getModuleLayer-rF9RxnJ5.mjs";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 $}from"@visulima/path";import{formatMessages as E,transform as b,build as M}from"esbuild";import{findCacheDirSync as A}from"@visulima/find-cache-dir";import{readFileSync as P}from"@visulima/fs";import{init as R,parse as S}from"es-module-lexer";var F=Object.defineProperty,C=u((e,r)=>F(e,"name",{value:r,configurable:!0}),"n$1");const h=C(async(e,r)=>{r.length>0&&(await E(r,{color:!0,kind:"warning"})).forEach(s=>e.warn(s))},"warn");var L=Object.defineProperty,w=u((e,r)=>L(e,"name",{value:r,configurable:!0}),"t");const W=w(e=>{if(e==="es")return"esm";if(e==="cjs")return e},"getEsbuildFormat"),I=w(({sourceMap:e=!0,...r})=>async function(s,n,t){if(r.minify||r.minifyWhitespace||r.minifyIdentifiers||r.minifySyntax){const i=W(t.format),c=await b(s,{format:i,loader:"js",sourcemap:e,...r});if(await h(this,c.warnings),c.code)return{code:c.code,map:c.map||void 0}}},"getRenderChunk");var T=Object.defineProperty,y=u((e,r)=>T(e,"name",{value:r,configurable:!0}),"n");const v=y(e=>e.replaceAll("\\","/"),"slash"),q=y(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 R,await M({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 t=>{if(e.exclude?.includes(t.path))return{external:!0};if(!t.pluginData?.__resolving_dep_path__&&e.include.includes(t.path)){const i=await n.resolve(t.path,{kind:"import-statement",pluginData:{__resolving_dep_path__:!0},resolveDir:t.resolveDir});return i.errors.length>0||i.warnings.length>0?i:{namespace:"optimize-deps",path:t.path,pluginData:{absolute:i.path,resolveDir:t.resolveDir}}}}),n.onLoad({filter:/.*/,namespace:"optimize-deps"},async t=>{const{absolute:i,resolveDir:c}=t.pluginData,[,p]=S(P(i));return{contents:p.length>0?`export * from '${v(i)}'`:`module.exports = require('${v(i)}')`,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:t,sourceMap:i,...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 D=Object.keys(p),_=new RegExp(`\\.(${D.map(a=>a.slice(1)).join("|")})$`),z=x(r??_,e);let l,g=process.cwd();return{async buildStart(){!t||l||(l=await q({cwd:g,sourceMap:i??!1,...t}),n.debug("optimized %O",l.optimized))},name:"packem:esbuild",options({context:a}){a&&(g=a)},renderChunk:I({...c,sourceMap:i}),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=$(o),m=p[d];if(n.debug("transforming %s with %s loader",o,m),!m)return;const f=await b(a,{format:["base64","binary","dataurl","text","json"].includes(m)?"esm":void 0,loader:m,sourcefile:o.replace(/\.[cm]ts/,".ts"),sourcemap:i,...c});if(await h(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,11 @@
1
+ var c=Object.defineProperty;var s=(e,r)=>c(e,"name",{value:r,configurable:!0});import{env as u}from"node:process";import{createFilter as l}from"@rollup/pluginutils";import p from"magic-string";import{findStaticImports as d}from"mlly";import{minVersion as f}from"semver";var S=Object.defineProperty,a=s((e,r)=>S(e,"name",{value:r,configurable:!0}),"t");const h=/(?:^|[^.\w'"`])require(\.resolve)?\(\s*([\w'"`])/,C=a((e,r)=>{if(u.INTERNAL_PACKEM_BUILD!=="1"&&(e.includes("// -- packem CommonJS __filename shim")||e.includes("// -- packem CommonJS __dirname shim")||e.includes("// -- packem CommonJS require shim")))return;let o=!1,m=!1,n=!1;if(e.includes("__filename")&&(o=!0),e.includes("__dirname")&&(m=!0),h.test(e)&&(n=!0),!o&&!m&&!n)return;const t=d(e).pop(),_=t?t.end:0,i=new p(e);return i.appendRight(_,r(o,m,n)),{code:i.toString(),map:i.generateMap()}},"CJSToESM"),j=a((e,r,o)=>{let m="";return(e||r)&&(m+=`import __cjs_url__ from "node:url"; // -- packem CommonJS __filename shim --
2
+ `),r&&(m+=`import __cjs_path__ from "node:path"; // -- packem CommonJS __dirname shim --
3
+ `),o&&(m+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
4
+ `),(e||r)&&(m+=`const __filename = __cjs_url__.fileURLToPath(import.meta.url);
5
+ `),r&&(m+=`const __dirname = __cjs_path__.dirname(__filename);
6
+ `),o&&(m+=`const require = __cjs_mod__.createRequire(import.meta.url);
7
+ `),m},"generateCJSShim"),J=a((e,r,o)=>{let m="";return o&&(m+=`import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
8
+ `),e&&(m+=`const __filename = import.meta.filename; // -- packem CommonJS __filename shim --
9
+ `),r&&(m+=`const __dirname = import.meta.dirname; // -- packem CommonJS __dirname shim --
10
+ `),o&&(m+=`const require = __cjs_mod__.createRequire(import.meta.url);
11
+ `),m},"generateCJSShimNode20_11"),x=a((e,r)=>{const o=l(r.include,r.exclude);return{name:"packem:esm-shim-cjs-syntax",renderChunk(m,n,t){if(t.format==="es"&&o(n.fileName)){let _=j;if(e.engines?.node){const i=f(e.engines.node);i&&i.major>=20&&i.minor>=11&&(_=J)}return C(m,_)}}}},"esmShimCjsSyntaxPlugin");export{h as GLOBAL_REQUIRE_REGEX,x as esmShimCjsSyntaxPlugin};
@@ -0,0 +1,26 @@
1
+ var A=Object.defineProperty;var v=(a,t)=>A(a,"name",{value:t,configurable:!0});import y from"magic-string";import{findExports as N,findStaticImports as I,parseStaticImport as C}from"mlly";import{parseSync as b}from"oxc-parser";var T=Object.defineProperty,g=v((a,t)=>T(a,"name",{value:t,configurable:!0}),"h");const _=g((a,t,n)=>{const l=N(a).find(e=>e.names.includes("default")),r=a.match(/^export\s+default\s+(\w+);/m);if(r&&r[1])return{defaultAlias:r[1],defaultExport:{code:r[0],end:r.index===void 0?void 0:r.index+r[0].length,names:["default"],specifier:void 0,start:r.index,type:"default"},exports:[]};if(!l)return;const p=l.code.match(/export\s*\{([^}]*)\}/);if(!p?.length){n.warn?.(`A default export was indicated in ${t.fileName}, but its structure could not be parsed.`);return}let i;const c=[];for(const e of p[1].split(",").map(o=>o.trim())){if(e==="default"){i=e;continue}const o=e.match(/\s*as\s+default\s*/);o?i=e.replace(o[0],""):c.push(e)}if(!i){n.warn?.(`A default export was indicated in ${t.fileName}, but its alias could not be determined from the export statement.`);return}return{defaultAlias:i,defaultExport:l,exports:c}},"extractExports"),j=g((a,t,n)=>{if("declarations"in t&&t.declarations.length>0){const l=t.declarations[0];if(l&&l.id.type==="Identifier"){a.set(l.id.name,{declare:t.declare===!0,end:t.end,isVariable:!0,start:t.start});return}}if("id"in t&&t.id&&t.id.type==="Identifier"){const{name:l}=t.id;a.set(l,{declare:t.declare===!0,end:t.end,isClass:t.type==="ClassDeclaration",start:t.start});return}a.set(n(),{declare:t.declare===!0,end:t.end,start:t.start})},"prepareDeclaration"),E=g((a,t,n,l)=>{const r=b(n.fileName,a,{astType:"ts",lang:"ts",sourceType:"module"});let p,i=0;const c=g(()=>(i+=1,`__unnamed_${i}$$`),"generateUnnamed"),e=new Map,o=new Map,{program:m}=r;for(const s of m.body)if(s.type==="ExportNamedDeclaration")for(const d of s.specifiers)d.exported.type==="Identifier"&&(d.exported.name==="default"?d.local.type==="Identifier"&&(p={end:d.end,local:d.local.name,start:d.start}):d.exported.type==="Identifier"&&o.set(d.exported.name,{type:d.exportKind==="type"}));else{if(s.type==="ImportDeclaration")continue;switch(s.type){case"ClassDeclaration":case"FunctionDeclaration":case"TSDeclareFunction":case"TSEnumDeclaration":case"TSInterfaceDeclaration":case"TSTypeAliasDeclaration":case"VariableDeclaration":{j(e,s,c);break}case"TSImportEqualsDeclaration":case"TSModuleDeclaration":{e.set(c(),{declare:!1,end:s.end,start:s.start});break}}}const x=[];if(p)for(const[s,d]of o.entries())s!==p.local&&d.type&&x.push(s);if(!p){const s=[...o.values()].every(d=>d.type);return t.startsWith("export type")&&o.size>0&&s||l.warn?.(`Cannot infer default export from the file: ${n.fileName}`),t}if(!e.get(p.local))return l.warn?.(`Cannot infer default export from the file: ${n.fileName}. Declaration for '${p.local}' not found.`),t;const u=t,f=new y(`${u}
2
+ declare namespace ${p.local} {
3
+ `);for(const[s,d]of e.entries()){if(x.includes(s)&&s!==p.local)continue;const h=a.slice(d.start,d.end).replace(/\s+\}$/," }");f.append(" "),d.declare?f.append(h.replace("declare","export").replaceAll(" "," ")):f.append(`export ${h}`.replaceAll(" "," ")),f.append(`
4
+ `)}return f.append(` import _default = ${p.local};
5
+ export { _default as default };
6
+ `),f.append(`}
7
+ export = ${p.local};
8
+ `),f.toString()},"createCjsNamespace"),D=g((a,t,n)=>{const{defaultExport:l,exports:r}=t;if(n){let x="";x=r.length===0?`export = ${n.defaultImport};`:`// @ts-ignore
9
+ export = ${n.defaultImport};
10
+ export { ${r.join(", ")} } from '${l.specifier}'`;const u=a.replace(l.code.replace(/;$/,""),x.replace(/;$/,""));return u.endsWith(";")?u:`${u};`}const p=`import _default from '${l.specifier}';`,i=new y(a),c=I(a),e=c.length>0?c.at(-1):void 0;e?.end!==void 0&&e.end>0?i.appendRight(e.end,`
11
+ ${p}
12
+ `):i.prepend(`${p}
13
+ `);let o=i.toString();o=o.replaceAll(/(\r?\n\s*){2,}/g,`
14
+ `);let m;if(r.length===0)m=o.replace(l.code.replace(/;$/,""),"export = _default");else{const x=`// @ts-ignore
15
+ export = _default;
16
+ export { ${r.join(", ")} } from '${l.specifier}';`;m=o.replace(l.code.replace(/;$/,""),x)}return m.replaceAll(";;",";")},"handleDefaultCJSExportAsDefault"),M=g((a,t,n,l,r,p)=>{const{defaultAlias:i,defaultExport:c,exports:e}=n;if(p){if(p.namedImports?.[i]===i){if(e.length===0)return a.replace(c.code,`export = ${i}`);const f=`export { ${e.join(", ")} } from '${c.specifier}'`,s=new y(a).replace(c.code,f).toString();return E(a,s,t,r)}r.warn?.(`Cannot parse "${i}" named export from ${p.specifier} import at ${t.fileName}!.`);return}const o=`import { ${i} } from '${c.specifier}';
17
+ `;let m=a;const x=l.length>0?l.at(-1)?.end??0:0,u=new y(m);if(x>0?u.appendRight(x,`
18
+ ${o}`):u.prepend(o),m=u.toString(),e.length>0){const f=`export { ${e.join(", ")} } from '${c.specifier}'`,s=new y(m).replace(c.code,f).toString();return E(a,s,t,r)}return new y(m).replace(c.code,`export = ${i}`).toString()},"handleDefaultNamedCJSExport"),w=g((a,t,{defaultAlias:n,defaultExport:l,exports:r},p)=>{const i=r.filter(e=>/^type\s+/.test(e)),c=r.filter(e=>!/^type\s+/.test(e));if(i.length>0){let e="";return n&&(e+=`// @ts-ignore
19
+ ${n};
20
+ `),e+=`export type { ${i.map(o=>o.replace(/^type\s+/,"").trim()).join(", ")} };
21
+ `,c.length>0&&(e+=`export { ${c.join(", ")} };
22
+ `),E(a,e.trim(),t,p)}if(n&&c.length>0&&i.length===0){let e=`// @ts-ignore
23
+ ${n};
24
+ `;return e+=`export { ${c.join(", ")} };
25
+ `,E(a,e.trim(),t,p)}if(n&&c.length===0&&i.length===0){const e=new RegExp(`^export\\\\s+default\\\\s+${n};`,"m"),o=a.match(e);return o?`${a.slice(0,Math.max(0,o.index??0))}export = ${n};`:a.replace(l.code,`export = ${n};`).replace(";;",";")}},"handleNoSpecifierDefaultCJSExport"),J=/^export\s+default\s+from\s+['"]([^'"]+)['"];?$/m,O=g((a,t,n)=>{const l=a.match(J);if(l)return{code:`import _default from '${l[1]}';
26
+ export = _default;`,map:void 0};const r=_(a,t,n);if(r){let e;if(r.defaultExport.specifier){const{specifier:o}=r.defaultExport,m=I(a),x=m.filter($=>$.imports).map($=>C($)),u=x.find($=>$.specifier===o),{defaultAlias:f,defaultExport:s,exports:d}=r,h=s.exports;if(f==="default"&&s.specifier&&d.length>0)e=D(a,r,u);else if(f==="default"&&s.specifier&&d.length===0&&h&&/\bas\s+default\b/.test(h))x.find($=>$.specifier===s.specifier)?.defaultImport?e=D(a,r,u):(n.warn?.(`Cannot parse default export name from ${s.specifier} import at ${t.fileName}!. The module might not have a default export, or it's aliased as 'default'.`),e=void 0);else if(f==="default"&&s.specifier&&d.length===0)e=D(a,r,u);else if(s.specifier&&f!=="default"){e=M(a,t,r,m,n,u);const $=u&&r.defaultExport.specifier&&f!=="default"&&(!u.namedImports||u.namedImports[f]!==f);if(!(e===void 0&&$)&&e===void 0&&!(f==="default"&&d.length===0&&h&&/\bas\s+default\b/.test(h))){const S=w(a,t,r,n);S&&(e=S)}}}else e=w(a,t,r,n);return e?{code:e,map:void 0}:void 0}const p=b(t.fileName,a,{astType:"ts",lang:"ts",sourceType:"module"});let i=[],c=!1;if(p.program.body.length>0){const e=p.program.body.at(-1);e?.type==="ExportNamedDeclaration"&&!e.declaration&&e.specifiers.length>0&&e.specifiers.every(o=>o.exportKind==="type")&&(c=!0,i=e.specifiers.map(o=>o.local.type==="Identifier"?o.local.name:"").filter(Boolean))}if(c&&i.length>0){const e=`export type { ${i.join(", ")} };`,o=E(a,e,t,n);return o?{code:o,map:void 0}:void 0}},"fixDtsDefaultCJSExports");export{O as _};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var n=(e,r)=>i(e,"name",{value:r,configurable:!0});import{_ as o}from"./fix-dts-default-cjs-exports-BQc0nwIG.mjs";var p=Object.defineProperty,a=n((e,r)=>p(e,"name",{value:r,configurable:!0}),"n");const l=a((e={})=>{const{matcher:r=a(t=>(t.type==="chunk"||t.type==="asset")&&t.exports?.length>0&&/\.d\.c?ts$/.test(t.fileName)&&t.isEntry,"matcher")}=e;return{name:"packem:fix-dts-default-cjs-exports-plugin",renderChunk(t,s){return r(s)?o(t,{fileName:s.fileName,imports:s.imports},{warn:this.warn}):void 0}}},"fixDtsDefaultCjsExportsPlugin");export{l as fixDtsDefaultCjsExportsPlugin};
@@ -0,0 +1 @@
1
+ var u=Object.defineProperty;var c=(e,t)=>u(e,"name",{value:t,configurable:!0});import d from"magic-string";var g=Object.defineProperty,x=c((e,t)=>g(e,"name",{value:t,configurable:!0}),"c");const j=x(()=>({name:"packem:fix-dynamic-import-extension",renderChunk(e,t,r){if(r.format==="es"||r.format==="cjs"){const o=new d(e),f=r.format==="es"?"mjs":"cjs",l=/(import\(.*?)(?<!\.d)(\.ts)(?=['´"`]\))/g;let a=!1,n;for(;(n=l.exec(e))!==null;){const[,i,m]=n;if(i&&m){const s=n.index+i.length,p=s+m.length;o.overwrite(s,p,`.${f}`),a=!0}}if(a)return{code:o.toString(),map:r.sourcemap?o.generateMap({hires:!0}):void 0}}}}),"fixDynamicImportExtension");export{j as default};
@@ -0,0 +1 @@
1
+ var s=Object.defineProperty;var n=(t,e)=>s(t,"name",{value:e,configurable:!0});import{DEFAULT_EXTENSIONS as l}from"@visulima/packem-share/constants";import{basename as u}from"@visulima/path";var c=Object.defineProperty,m=n((t,e)=>c(t,"name",{value:e,configurable:!0}),"s");const d=m(t=>{const e=u(t).split(".");if(e.length>=2){const[o,a]=e.slice(-2),i=e[0],r=/^(\w+)-runtime$/.exec(o)?.[1];if(l.includes(a)&&r&&r.length>0)return`${i}-${r}`}},"getCustomModuleLayer");export{d as default};
@@ -0,0 +1 @@
1
+ var i=Object.defineProperty;var t=(r,e)=>i(r,"name",{value:e,configurable:!0});var a=Object.defineProperty,s=t((r,e)=>a(r,"name",{value:e,configurable:!0}),"i");const v=s(r=>(r.preserveDirectives||{directives:[]}).directives.map(e=>e.replace(/^use /,"")).find(e=>e!=="strict"),"getModuleLayer");export{v as default};
@@ -0,0 +1 @@
1
+ var y=Object.defineProperty;var n=(s,e)=>y(s,"name",{value:e,configurable:!0});var b=Object.defineProperty,m=n((s,e)=>b(s,"name",{value:e,configurable:!0}),"i");class _{static{n(this,"WalkerBase")}static{m(this,"WalkerBase")}constructor(){this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:m(()=>this.should_skip=!0,"skip"),remove:m(()=>this.should_remove=!0,"remove"),replace:m(e=>this.replacement=e,"replace")}}replace(e,t,i,o){e&&t&&(i!=null?e[t][i]=o:e[t]=o)}remove(e,t,i){e&&t&&(i!=null?e[t].splice(i,1):delete e[t])}}var w=Object.defineProperty,c=n((s,e)=>w(s,"name",{value:e,configurable:!0}),"c$1");class x extends _{static{n(this,"SyncWalker")}static{c(this,"SyncWalker")}constructor(e,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:c(()=>this.should_skip=!0,"skip"),remove:c(()=>this.should_remove=!0,"remove"),replace:c(i=>this.replacement=i,"replace")},this.enter=e,this.leave=t}visit(e,t,i,o){if(e){if(this.enter){const l=this.should_skip,h=this.should_remove,r=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.enter.call(this.context,e,t,i,o),this.replacement&&(e=this.replacement,this.replace(t,i,o,e)),this.should_remove&&this.remove(t,i,o);const u=this.should_skip,v=this.should_remove;if(this.should_skip=l,this.should_remove=h,this.replacement=r,u)return e;if(v)return null}let a;for(a in e){const l=e[a];if(l&&typeof l=="object")if(Array.isArray(l)){const h=l;for(let r=0;r<h.length;r+=1){const u=h[r];f(u)&&(this.visit(u,e,a,r)||r--)}}else f(l)&&this.visit(l,e,a,null)}if(this.leave){const l=this.replacement,h=this.should_remove;this.replacement=null,this.should_remove=!1,this.leave.call(this.context,e,t,i,o),this.replacement&&(e=this.replacement,this.replace(t,i,o,e)),this.should_remove&&this.remove(t,i,o);const r=this.should_remove;if(this.replacement=l,this.should_remove=h,r)return null}}return e}}function f(s){return s!==null&&typeof s=="object"&&"type"in s&&typeof s.type=="string"}n(f,"n");c(f,"isNode");var g=Object.defineProperty,p=n((s,e)=>g(s,"name",{value:e,configurable:!0}),"c");class j extends _{static{n(this,"AsyncWalker")}static{p(this,"AsyncWalker")}constructor(e,t){super(),this.should_skip=!1,this.should_remove=!1,this.replacement=null,this.context={skip:p(()=>this.should_skip=!0,"skip"),remove:p(()=>this.should_remove=!0,"remove"),replace:p(i=>this.replacement=i,"replace")},this.enter=e,this.leave=t}async visit(e,t,i,o){if(e){if(this.enter){const l=this.should_skip,h=this.should_remove,r=this.replacement;this.should_skip=!1,this.should_remove=!1,this.replacement=null,await this.enter.call(this.context,e,t,i,o),this.replacement&&(e=this.replacement,this.replace(t,i,o,e)),this.should_remove&&this.remove(t,i,o);const u=this.should_skip,v=this.should_remove;if(this.should_skip=l,this.should_remove=h,this.replacement=r,u)return e;if(v)return null}let a;for(a in e){const l=e[a];if(l&&typeof l=="object")if(Array.isArray(l)){const h=l;for(let r=0;r<h.length;r+=1){const u=h[r];d(u)&&(await this.visit(u,e,a,r)||r--)}}else d(l)&&await this.visit(l,e,a,null)}if(this.leave){const l=this.replacement,h=this.should_remove;this.replacement=null,this.should_remove=!1,await this.leave.call(this.context,e,t,i,o),this.replacement&&(e=this.replacement,this.replace(t,i,o,e)),this.should_remove&&this.remove(t,i,o);const r=this.should_remove;if(this.replacement=l,this.should_remove=h,r)return null}}return e}}function d(s){return s!==null&&typeof s=="object"&&"type"in s&&typeof s.type=="string"}n(d,"a$1");p(d,"isNode");var W=Object.defineProperty,k=n((s,e)=>W(s,"name",{value:e,configurable:!0}),"a");function A(s,{enter:e,leave:t}){return new x(e,t).visit(s,null)}n(A,"walk");k(A,"walk");async function O(s,{enter:e,leave:t}){return await new j(e,t).visit(s,null)}n(O,"asyncWalk");k(O,"asyncWalk");export{A as w};