@visulima/packem 1.0.0-alpha.1 → 1.0.0-alpha.11
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 +90 -0
- package/README.md +3 -0
- package/dist/cli.cjs +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +6 -2
- package/dist/config.d.mts +6 -2
- package/dist/config.d.ts +6 -2
- package/dist/create-bundler.cjs +52 -51
- package/dist/create-bundler.d.cts +6 -3
- package/dist/create-bundler.d.mts +6 -3
- package/dist/create-bundler.d.ts +6 -3
- package/dist/create-bundler.mjs +54 -53
- package/dist/rollup/plugins/esbuild/index.cjs +1 -0
- package/dist/rollup/plugins/esbuild/index.d.cts +9 -0
- package/dist/rollup/plugins/esbuild/index.d.mts +9 -0
- package/dist/rollup/plugins/esbuild/index.d.ts +9 -0
- package/dist/rollup/plugins/esbuild/index.mjs +9 -0
- package/dist/rollup/plugins/sucrase/index.cjs +1 -0
- package/dist/rollup/plugins/sucrase/index.d.cts +8 -0
- package/dist/rollup/plugins/sucrase/index.d.mts +8 -0
- package/dist/rollup/plugins/sucrase/index.d.ts +8 -0
- package/dist/rollup/plugins/sucrase/index.mjs +1 -0
- package/dist/rollup/plugins/swc/index.cjs +1 -0
- package/dist/rollup/plugins/swc/index.d.cts +7 -0
- package/dist/rollup/plugins/swc/index.d.mts +7 -0
- package/dist/rollup/plugins/swc/index.d.ts +7 -0
- package/dist/rollup/plugins/swc/index.mjs +1 -0
- package/dist/shared/packem.Bdmp1hC5.mjs +1 -0
- package/dist/shared/packem.Bj4QPFg7.mjs +1 -0
- package/dist/shared/{packem.gPxnaycf.d.cts → packem.C44tLE3n.d.cts} +3 -196
- package/dist/shared/{packem.gPxnaycf.d.mts → packem.C44tLE3n.d.mts} +3 -196
- package/dist/shared/{packem.gPxnaycf.d.ts → packem.C44tLE3n.d.ts} +3 -196
- package/dist/shared/packem.CAQMZ6ex.d.mts +176 -0
- package/dist/shared/packem.CEXB7aOL.cjs +1 -0
- package/dist/shared/packem.D09xRBAa.d.cts +25 -0
- package/dist/shared/packem.D09xRBAa.d.mts +25 -0
- package/dist/shared/packem.D09xRBAa.d.ts +25 -0
- package/dist/shared/packem.DZfoF9Bk.d.cts +176 -0
- package/dist/shared/packem.DvWhOdt5.d.cts +10 -0
- package/dist/shared/packem.DvWhOdt5.d.mts +10 -0
- package/dist/shared/packem.DvWhOdt5.d.ts +10 -0
- package/dist/shared/packem.aHRI8QbF.d.ts +176 -0
- package/dist/shared/packem.uvB0cQX0.cjs +1 -0
- package/package.json +35 -3
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
var O=Object.defineProperty;var g=(e,r)=>O(e,"name",{value:r,configurable:!0});import{existsSync as k,statSync as M}from"node:fs";import{createFilter as $}from"@rollup/pluginutils";import{join as P,resolve as R,dirname as S,extname as W}from"@visulima/path";import{formatMessages as A,transform as b,build as C}from"esbuild";import{E as F,D as L}from"../../../shared/packem.Bj4QPFg7.mjs";import{x as D}from"../../../shared/packem.Bdmp1hC5.mjs";import{readFile as I}from"node:fs/promises";import{findCacheDirectory as U}from"@visulima/package";import{init as X,parse as q}from"es-module-lexer";
|
|
2
|
+
// -- pack CommonJS Shims --
|
|
3
|
+
import __cjs_url__ from "node:url";
|
|
4
|
+
import __cjs_path__ from "node:path";
|
|
5
|
+
import __cjs_mod__ from "node:module";
|
|
6
|
+
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = __cjs_path__.dirname(__filename);
|
|
8
|
+
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
9
|
+
var G=Object.defineProperty,T=g((e,r)=>G(e,"name",{value:r,configurable:!0}),"t$1");const _=T(async(e,r)=>{r.length>0&&(await A(r,{color:!0,kind:"warning"})).forEach(l=>e.warn(l))},"warn");var B=Object.defineProperty,z=g((e,r)=>B(e,"name",{value:r,configurable:!0}),"t");const H=z(e=>{if(e==="es")return"esm";if(e==="cjs")return e},"getEsbuildFormat"),J=z(({sourceMap:e=!0,...r})=>async function(l,s,i){if(r.minify||r.minifyWhitespace||r.minifyIdentifiers||r.minifySyntax){const n=H(i.format),c=await b(l,{format:n,loader:"js",sourcemap:e,...r});if(await _(this,c.warnings),c.code)return{code:c.code,map:c.map||null}}return null},"getRenderChunk");var K=Object.defineProperty,x=g((e,r)=>K(e,"name",{value:r,configurable:!0}),"o");const E=x(e=>e.replaceAll("\\","/"),"slash"),N=x(async e=>{const r=await U("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 X,await C({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(s){s.onResolve({filter:/.*/},async i=>{if(e.exclude?.includes(i.path))return{external:!0};if(i.pluginData?.__resolving_dep_path__)return null;if(e.include.includes(i.path)){const n=await s.resolve(i.path,{kind:"import-statement",pluginData:{__resolving_dep_path__:!0},resolveDir:i.resolveDir});return n.errors.length>0||n.warnings.length>0?n:{namespace:"optimize-deps",path:i.path,pluginData:{absolute:n.path,resolveDir:i.resolveDir}}}return null}),s.onLoad({filter:/.*/,namespace:"optimize-deps"},async i=>{const{absolute:n,resolveDir:c}=i.pluginData,u=await I(n,"utf8"),[,f]=q(u);return{contents:f.length>0?`export * from '${E(n)}'`:`module.exports = require('${E(n)}')`,resolveDir:c}})}},...e.esbuildOptions?.plugins||[]]});const l=new Map;for(const s of e.include)l.set(s,{file:P(r,`${s}.js`)});return{cacheDir:r,optimized:l}},"optimizeDeps");var Q=Object.defineProperty,V=g((e,r)=>Q(e,"name",{value:r,configurable:!0}),"w");const Y=V(({exclude:e,include:r,loaders:l,logger:s,optimizeDeps:i,sourceMap:n=!0,...c})=>{const u=L;if(l!==void 0)for(let[t,a]of Object.entries(l))t=t.startsWith(".")?t:`.${t}`,typeof a=="string"?u[t]=a:a||delete u[t];const f=Object.keys(u),j=new RegExp(`\\.(${f.map(t=>t.slice(1)).join("|")})$`),v=$(r??j,e??F);let d,y=process.cwd();const h=new Map;return{async buildStart(){!i||d||(d=await N({cwd:y,sourceMap:n,...i}),s.debug("optimized %O",d.optimized))},name:"esbuild",options({context:t}){return t&&(y=t),null},renderChunk:J({...c,sourceMap:n}),async resolveId(t,a,{isEntry:w}){if(!a||w||!v(t)||t.startsWith("\0"))return null;if(d?.optimized.has(t)){const o=d.optimized.get(t);if(o)return s.debug("resolved %s to %s",t,o.file),o.file}const p=h.get(t);if(p!==void 0)return p;if(a&&t.startsWith(".")){const o=R(a?S(a):process.cwd(),t);let m=D(f,o);if(m||!m&&k(o)&&M(o).isDirectory()&&(m=D(f,o,!0),m))return h.set(t,m),m}return h.set(t,null),null},async transform(t,a){if(!v(a)||d?.optimized.has(a))return null;const w=W(a),p=u[w];if(s.debug("transforming %s with %s loader",a,p),!p)return null;const o=await b(t,{format:["base64","binary","dataurl","text","json"].includes(p)?"esm":void 0,loader:p,sourcefile:a.replace(/\.[cm]ts/,".ts"),sourcemap:n,...c});return await _(this,o.warnings),o.code?{code:o.code,map:o.map||null}:null}}},"default");export{Y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var l=(n,r)=>y(n,"name",{value:r,configurable:!0});const f=require("node:fs"),q=require("@rollup/pluginutils"),d=require("@visulima/path"),x=require("sucrase"),p=require("../../../shared/packem.uvB0cQX0.cjs"),E=require("../../../shared/packem.CEXB7aOL.cjs");var g=Object.defineProperty,h=l((n,r)=>g(n,"name",{value:r,configurable:!0}),"f");const F=h(({exclude:n,extensions:r=p.DEFAULT_EXTENSIONS,include:m,...v})=>{const a=q.createFilter(m,n??p.EXCLUDE_REGEXP),c=new Map;return{async resolveId(e,t,{isEntry:u}){if(!t||u||!a(e)||e.startsWith("\0"))return null;const i=c.get(e);if(i!==void 0)return i;if(t&&e.startsWith(".")){const o=d.resolve(t?d.dirname(t):process.cwd(),e);let s=E.x(r,o);if(s||!s&&f.existsSync(o)&&f.statSync(o).isDirectory()&&(s=E.x(r,o,!0),s))return c.set(e,s),s}return c.set(e,null),null},async transform(e,t){if(!a(t))return null;const{code:u,sourceMap:i}=x.transform(e,{...v,filePath:t,sourceMapOptions:{compiledFilename:t}});return{code:u,map:i}}}},"sucrasePlugin");module.exports=F;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
import { S as SucrasePluginConfig } from '../../../shared/packem.DvWhOdt5.cjs';
|
|
3
|
+
import '@rollup/pluginutils';
|
|
4
|
+
import 'sucrase';
|
|
5
|
+
|
|
6
|
+
declare const sucrasePlugin: ({ exclude, extensions, include, ...transformOptions }: SucrasePluginConfig) => Plugin;
|
|
7
|
+
|
|
8
|
+
export { sucrasePlugin as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
import { S as SucrasePluginConfig } from '../../../shared/packem.DvWhOdt5.mjs';
|
|
3
|
+
import '@rollup/pluginutils';
|
|
4
|
+
import 'sucrase';
|
|
5
|
+
|
|
6
|
+
declare const sucrasePlugin: ({ exclude, extensions, include, ...transformOptions }: SucrasePluginConfig) => Plugin;
|
|
7
|
+
|
|
8
|
+
export { sucrasePlugin as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
import { S as SucrasePluginConfig } from '../../../shared/packem.DvWhOdt5.js';
|
|
3
|
+
import '@rollup/pluginutils';
|
|
4
|
+
import 'sucrase';
|
|
5
|
+
|
|
6
|
+
declare const sucrasePlugin: ({ exclude, extensions, include, ...transformOptions }: SucrasePluginConfig) => Plugin;
|
|
7
|
+
|
|
8
|
+
export { sucrasePlugin as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var u=(n,e)=>d(n,"name",{value:e,configurable:!0});import{existsSync as E,statSync as y}from"node:fs";import{createFilter as v}from"@rollup/pluginutils";import{resolve as x,dirname as g}from"@visulima/path";import{transform as P}from"sucrase";import{E as S,a as h}from"../../../shared/packem.Bj4QPFg7.mjs";import{x as m}from"../../../shared/packem.Bdmp1hC5.mjs";var D=Object.defineProperty,F=u((n,e)=>D(n,"name",{value:e,configurable:!0}),"f");const I=F(({exclude:n,extensions:e=h,include:f,...p})=>{const l=v(f,n??S),a=new Map;return{async resolveId(t,r,{isEntry:c}){if(!r||c||!l(t)||t.startsWith("\0"))return null;const s=a.get(t);if(s!==void 0)return s;if(r&&t.startsWith(".")){const i=x(r?g(r):process.cwd(),t);let o=m(e,i);if(o||!o&&E(i)&&y(i).isDirectory()&&(o=m(e,i,!0),o))return a.set(t,o),o}return a.set(t,null),null},async transform(t,r){if(!l(r))return null;const{code:c,sourceMap:s}=P(t,{...p,filePath:r,sourceMapOptions:{compiledFilename:r}});return{code:c,map:s}}}},"sucrasePlugin");export{I as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var y=Object.defineProperty;var a=(s,r)=>y(s,"name",{value:r,configurable:!0});const f=require("node:fs"),q=require("@rollup/pluginutils"),x=require("@swc/core"),d=require("@visulima/path"),p=require("../../../shared/packem.uvB0cQX0.cjs"),E=require("../../../shared/packem.CEXB7aOL.cjs");var g=Object.defineProperty,w=a((s,r)=>g(s,"name",{value:r,configurable:!0}),"a");const F=w(({exclude:s,extensions:r=p.DEFAULT_EXTENSIONS,include:m,...v})=>{const l=q.createFilter(m,s??p.EXCLUDE_REGEXP),o=new Map;return{async resolveId(e,t,{isEntry:u}){if(!t||u||!l(e)||e.startsWith("\0"))return null;const i=o.get(e);if(i!==void 0)return i;if(t&&e.startsWith(".")){const c=d.resolve(t?d.dirname(t):process.cwd(),e);let n=E.x(r,c);if(n||!n&&f.existsSync(c)&&f.statSync(c).isDirectory()&&(n=E.x(r,c,!0),n))return o.set(e,n),n}return o.set(e,null),null},async transform(e,t){if(!l(t))return null;const{code:u,map:i}=await x.transform(e,{...v,configFile:!1,filename:t,swcrc:!1});return{code:u,map:i}}}},"swcPlugin");module.exports=F;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
import { S as SwcPluginConfig } from '../../../shared/packem.C44tLE3n.cjs';
|
|
3
|
+
import '@rollup/pluginutils';
|
|
4
|
+
|
|
5
|
+
declare const swcPlugin: ({ exclude, extensions, include, ...transformOptions }: SwcPluginConfig) => Plugin;
|
|
6
|
+
|
|
7
|
+
export { swcPlugin as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
import { S as SwcPluginConfig } from '../../../shared/packem.C44tLE3n.mjs';
|
|
3
|
+
import '@rollup/pluginutils';
|
|
4
|
+
|
|
5
|
+
declare const swcPlugin: ({ exclude, extensions, include, ...transformOptions }: SwcPluginConfig) => Plugin;
|
|
6
|
+
|
|
7
|
+
export { swcPlugin as default };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'rollup';
|
|
2
|
+
import { S as SwcPluginConfig } from '../../../shared/packem.C44tLE3n.js';
|
|
3
|
+
import '@rollup/pluginutils';
|
|
4
|
+
|
|
5
|
+
declare const swcPlugin: ({ exclude, extensions, include, ...transformOptions }: SwcPluginConfig) => Plugin;
|
|
6
|
+
|
|
7
|
+
export { swcPlugin as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var d=Object.defineProperty;var f=(o,e)=>d(o,"name",{value:e,configurable:!0});import{existsSync as E,statSync as y}from"node:fs";import{createFilter as v}from"@rollup/pluginutils";import{transform as w}from"@swc/core";import{resolve as x,dirname as g}from"@visulima/path";import{E as S,a as D}from"../../../shared/packem.Bj4QPFg7.mjs";import{x as m}from"../../../shared/packem.Bdmp1hC5.mjs";var F=Object.defineProperty,I=f((o,e)=>F(o,"name",{value:e,configurable:!0}),"a");const P=I(({exclude:o,extensions:e=D,include:u,...p})=>{const l=v(u,o??S),a=new Map;return{async resolveId(t,r,{isEntry:c}){if(!r||c||!l(t)||t.startsWith("\0"))return null;const s=a.get(t);if(s!==void 0)return s;if(r&&t.startsWith(".")){const i=x(r?g(r):process.cwd(),t);let n=m(e,i);if(n||!n&&E(i)&&y(i).isDirectory()&&(n=m(e,i,!0),n))return a.set(t,n),n}return a.set(t,null),null},async transform(t,r){if(!l(r))return null;const{code:c,map:s}=await w(t,{...p,configFile:!1,filename:r,swcrc:!1});return{code:c,map:s}}}},"swcPlugin");export{P as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c=Object.defineProperty;var t=(r,e)=>c(r,"name",{value:e,configurable:!0});import{existsSync as f}from"node:fs";import{join as l}from"@visulima/path";var a=Object.defineProperty,m=t((r,e)=>a(r,"name",{value:e,configurable:!0}),"o");const p=m((r,e,i=!1)=>{const s=e.replace(/\.[jt]sx?$/,"");for(const o of r){const n=i?l(e,`index${o}`):`${s}${o}`;if(f(n))return n}return null},"resolveFile");export{p as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{DEFAULTS as s}from"@rollup/plugin-node-resolve";const e=[...s.extensions,".cjs"],f=[...e,".ts",".cts",".mts",".tsx",".jsx"],i={".aac":"file",".cjs":"js",".css":"file",".cts":"ts",".eot":"file",".flac":"file",".gif":"file",".jpeg":"file",".jpg":"file",".js":"js",".json":"json",".jsx":"jsx",".mjs":"js",".mp3":"file",".mp4":"file",".mts":"ts",".ogg":"file",".otf":"file",".png":"file",".svg":"file",".ts":"ts",".tsx":"tsx",".ttf":"file",".wav":"file",".webm":"file",".webp":"file",".woff":"file",".woff2":"file"},l=/node_modules/;export{i as D,l as E,f as a};
|
|
@@ -1,77 +1,4 @@
|
|
|
1
|
-
import { RollupAliasOptions } from '@rollup/plugin-alias';
|
|
2
|
-
import { RollupCommonJSOptions } from '@rollup/plugin-commonjs';
|
|
3
|
-
import { RollupJsonOptions } from '@rollup/plugin-json';
|
|
4
|
-
import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
5
|
-
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
|
-
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
1
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson, TsConfigResult } from '@visulima/package';
|
|
9
|
-
import { Pail } from '@visulima/pail';
|
|
10
|
-
import { Hookable } from 'hookable';
|
|
11
|
-
import { JITIOptions } from 'jiti';
|
|
12
|
-
import { RollupBuild, RollupOptions, RollupWatcher, OutputOptions } from 'rollup';
|
|
13
|
-
import { Options as Options$3 } from 'rollup-plugin-dts';
|
|
14
|
-
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
|
-
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { TransformOptions, Loader, BuildOptions as BuildOptions$1 } from 'esbuild';
|
|
17
|
-
import { Options as Options$2 } from 'sucrase';
|
|
18
|
-
|
|
19
|
-
interface CJSInteropOptions {
|
|
20
|
-
addDefaultProperty?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type SingleTargetDesc = {
|
|
24
|
-
dest?: string;
|
|
25
|
-
exclude?: string[] | string;
|
|
26
|
-
src: string[] | string;
|
|
27
|
-
};
|
|
28
|
-
type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
|
|
29
|
-
type CopyPluginOptions = {
|
|
30
|
-
copyOnce?: boolean;
|
|
31
|
-
exactFileNames?: boolean;
|
|
32
|
-
flatten?: boolean;
|
|
33
|
-
targets: MultipleTargetsDesc;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
type MarkOptional<Type, Keys extends keyof Type> = Type extends Type ? Omit<Type, Keys> & Partial<Pick<Type, Keys>> : never;
|
|
37
|
-
|
|
38
|
-
type Options$1 = Omit<TransformOptions, "loader" | "sourcemap"> & {
|
|
39
|
-
exclude?: FilterPattern;
|
|
40
|
-
include?: FilterPattern;
|
|
41
|
-
loaders?: Record<string, Loader | false>;
|
|
42
|
-
optimizeDeps?: MarkOptional<OptimizeDepsOptions, "cwd" | "sourceMap">;
|
|
43
|
-
sourceMap?: boolean;
|
|
44
|
-
};
|
|
45
|
-
type OptimizeDepsOptions = {
|
|
46
|
-
cwd: string;
|
|
47
|
-
esbuildOptions?: BuildOptions$1;
|
|
48
|
-
exclude?: string[];
|
|
49
|
-
include: string[];
|
|
50
|
-
sourceMap: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
type JSXRemoveAttributesPlugin = {
|
|
54
|
-
attributes: string[];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
interface LicenseOptions {
|
|
58
|
-
dtsMarker?: string;
|
|
59
|
-
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
60
|
-
marker?: string;
|
|
61
|
-
path?: string;
|
|
62
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface RawLoaderOptions {
|
|
66
|
-
exclude?: FilterPattern;
|
|
67
|
-
include?: FilterPattern;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface SucrasePluginConfig extends Options$2 {
|
|
71
|
-
exclude?: FilterPattern;
|
|
72
|
-
extensions?: string[];
|
|
73
|
-
include?: FilterPattern;
|
|
74
|
-
}
|
|
75
2
|
|
|
76
3
|
interface Plugin {
|
|
77
4
|
(module: Program): Program;
|
|
@@ -1983,130 +1910,10 @@ interface Invalid extends Node, HasSpan {
|
|
|
1983
1910
|
type: "Invalid";
|
|
1984
1911
|
}
|
|
1985
1912
|
|
|
1986
|
-
type SwcPluginConfig =
|
|
1913
|
+
type SwcPluginConfig = {
|
|
1987
1914
|
exclude?: FilterPattern;
|
|
1988
1915
|
extensions?: string[];
|
|
1989
1916
|
include?: FilterPattern;
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
interface PatchTypesOptions {
|
|
1993
|
-
identifierReplacements?: Record<string, Record<string, string>>;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
type DeepPartial<T> = {
|
|
1997
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1998
|
-
};
|
|
1999
|
-
interface RollupDynamicImportVariablesOptions {
|
|
2000
|
-
errorWhenNoFilesFound?: boolean;
|
|
2001
|
-
exclude?: FilterPattern;
|
|
2002
|
-
include?: FilterPattern;
|
|
2003
|
-
warnOnError?: boolean;
|
|
2004
|
-
}
|
|
2005
|
-
interface RollupBuildOptions {
|
|
2006
|
-
alias: RollupAliasOptions | false;
|
|
2007
|
-
cjsInterop?: CJSInteropOptions;
|
|
2008
|
-
commonjs: RollupCommonJSOptions | false;
|
|
2009
|
-
copy?: CopyPluginOptions | false;
|
|
2010
|
-
dts: Options$3;
|
|
2011
|
-
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
2012
|
-
emitCJS?: boolean;
|
|
2013
|
-
emitESM?: boolean;
|
|
2014
|
-
esbuild: Options$1 | false;
|
|
2015
|
-
json: RollupJsonOptions | false;
|
|
2016
|
-
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
2017
|
-
license?: LicenseOptions | false;
|
|
2018
|
-
metafile?: boolean;
|
|
2019
|
-
output?: OutputOptions;
|
|
2020
|
-
patchTypes: PatchTypesOptions | false;
|
|
2021
|
-
polyfillNode?: NodePolyfillsOptions | false;
|
|
2022
|
-
preserveDynamicImports?: boolean;
|
|
2023
|
-
raw?: RawLoaderOptions | false;
|
|
2024
|
-
replace: RollupReplaceOptions | false;
|
|
2025
|
-
resolve: RollupNodeResolveOptions | false;
|
|
2026
|
-
shim?: boolean;
|
|
2027
|
-
sucrase?: SucrasePluginConfig | false;
|
|
2028
|
-
swc?: SwcPluginConfig | false;
|
|
2029
|
-
treeshake?: RollupOptions["treeshake"];
|
|
2030
|
-
visualizer?: PluginVisualizerOptions | false;
|
|
2031
|
-
watch?: RollupOptions["watch"];
|
|
2032
|
-
wsam?: RollupWasmOptions | false;
|
|
2033
|
-
}
|
|
2034
|
-
type BuildEntry = {
|
|
2035
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2036
|
-
format?: string;
|
|
2037
|
-
input: string;
|
|
2038
|
-
isExecutable?: boolean;
|
|
2039
|
-
name?: string;
|
|
2040
|
-
outDir?: string;
|
|
2041
|
-
};
|
|
2042
|
-
interface BuildOptions {
|
|
2043
|
-
alias: Record<string, string>;
|
|
2044
|
-
cjsInterop?: boolean;
|
|
2045
|
-
clean: boolean;
|
|
2046
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2047
|
-
dependencies: string[];
|
|
2048
|
-
devDependencies: string[];
|
|
2049
|
-
entries: BuildEntry[];
|
|
2050
|
-
externals: (RegExp | string)[];
|
|
2051
|
-
failOnWarn?: boolean;
|
|
2052
|
-
name: string;
|
|
2053
|
-
optionalDependencies: string[];
|
|
2054
|
-
outDir: string;
|
|
2055
|
-
peerDependencies: string[];
|
|
2056
|
-
replace: Record<string, string>;
|
|
2057
|
-
rollup: RollupBuildOptions;
|
|
2058
|
-
rootDir: string;
|
|
2059
|
-
sourcemap: boolean;
|
|
2060
|
-
stub: boolean;
|
|
2061
|
-
stubOptions: {
|
|
2062
|
-
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
2063
|
-
};
|
|
2064
|
-
target: string;
|
|
2065
|
-
transformer: "esbuild" | "sucrase" | "swc";
|
|
2066
|
-
}
|
|
2067
|
-
interface BuildHooks {
|
|
2068
|
-
"build:before": (context: BuildContext) => Promise<void> | void;
|
|
2069
|
-
"build:done": (context: BuildContext) => Promise<void> | void;
|
|
2070
|
-
"build:prepare": (context: BuildContext) => Promise<void> | void;
|
|
2071
|
-
"rollup:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2072
|
-
"rollup:done": (context: BuildContext) => Promise<void> | void;
|
|
2073
|
-
"rollup:dts:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2074
|
-
"rollup:dts:done": (context: BuildContext) => Promise<void> | void;
|
|
2075
|
-
"rollup:dts:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2076
|
-
"rollup:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2077
|
-
"rollup:watch": (context: BuildContext, watcher: RollupWatcher) => Promise<void> | void;
|
|
2078
|
-
}
|
|
2079
|
-
type BuildContextBuildEntry = {
|
|
2080
|
-
bytes?: number;
|
|
2081
|
-
chunk?: boolean;
|
|
2082
|
-
chunks?: string[];
|
|
2083
|
-
exports?: string[];
|
|
2084
|
-
modules?: {
|
|
2085
|
-
bytes: number;
|
|
2086
|
-
id: string;
|
|
2087
|
-
}[];
|
|
2088
|
-
path: string;
|
|
2089
|
-
type?: "asset" | "chunk" | "entry";
|
|
2090
|
-
};
|
|
2091
|
-
interface BuildContext {
|
|
2092
|
-
buildEntries: BuildContextBuildEntry[];
|
|
2093
|
-
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
2094
|
-
hooks: Hookable<BuildHooks>;
|
|
2095
|
-
logger: Pail<never, string>;
|
|
2096
|
-
mode: Mode;
|
|
2097
|
-
options: BuildOptions;
|
|
2098
|
-
pkg: PackageJson;
|
|
2099
|
-
rootDir: string;
|
|
2100
|
-
tsconfig?: TsConfigResult;
|
|
2101
|
-
usedImports: Set<string>;
|
|
2102
|
-
warnings: Set<string>;
|
|
2103
|
-
}
|
|
2104
|
-
type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
2105
|
-
interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
2106
|
-
entries?: (BuildEntry | string)[];
|
|
2107
|
-
hooks?: Partial<BuildHooks>;
|
|
2108
|
-
preset?: BuildPreset | string;
|
|
2109
|
-
}
|
|
2110
|
-
type Mode = "build" | "jit" | "watch";
|
|
1917
|
+
} & Exclude<Options, "configFile" | "exclude" | "filename" | "sourceMaps" | "swcrc">;
|
|
2111
1918
|
|
|
2112
|
-
export type {
|
|
1919
|
+
export type { SwcPluginConfig as S };
|
|
@@ -1,77 +1,4 @@
|
|
|
1
|
-
import { RollupAliasOptions } from '@rollup/plugin-alias';
|
|
2
|
-
import { RollupCommonJSOptions } from '@rollup/plugin-commonjs';
|
|
3
|
-
import { RollupJsonOptions } from '@rollup/plugin-json';
|
|
4
|
-
import { RollupNodeResolveOptions } from '@rollup/plugin-node-resolve';
|
|
5
|
-
import { RollupReplaceOptions } from '@rollup/plugin-replace';
|
|
6
|
-
import { RollupWasmOptions } from '@rollup/plugin-wasm';
|
|
7
1
|
import { FilterPattern } from '@rollup/pluginutils';
|
|
8
|
-
import { PackageJson, TsConfigResult } from '@visulima/package';
|
|
9
|
-
import { Pail } from '@visulima/pail';
|
|
10
|
-
import { Hookable } from 'hookable';
|
|
11
|
-
import { JITIOptions } from 'jiti';
|
|
12
|
-
import { RollupBuild, RollupOptions, RollupWatcher, OutputOptions } from 'rollup';
|
|
13
|
-
import { Options as Options$3 } from 'rollup-plugin-dts';
|
|
14
|
-
import { NodePolyfillsOptions } from 'rollup-plugin-polyfill-node';
|
|
15
|
-
import { PluginVisualizerOptions } from 'rollup-plugin-visualizer';
|
|
16
|
-
import { TransformOptions, Loader, BuildOptions as BuildOptions$1 } from 'esbuild';
|
|
17
|
-
import { Options as Options$2 } from 'sucrase';
|
|
18
|
-
|
|
19
|
-
interface CJSInteropOptions {
|
|
20
|
-
addDefaultProperty?: boolean;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
type SingleTargetDesc = {
|
|
24
|
-
dest?: string;
|
|
25
|
-
exclude?: string[] | string;
|
|
26
|
-
src: string[] | string;
|
|
27
|
-
};
|
|
28
|
-
type MultipleTargetsDesc = SingleTargetDesc | SingleTargetDesc[] | string[] | string;
|
|
29
|
-
type CopyPluginOptions = {
|
|
30
|
-
copyOnce?: boolean;
|
|
31
|
-
exactFileNames?: boolean;
|
|
32
|
-
flatten?: boolean;
|
|
33
|
-
targets: MultipleTargetsDesc;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
type MarkOptional<Type, Keys extends keyof Type> = Type extends Type ? Omit<Type, Keys> & Partial<Pick<Type, Keys>> : never;
|
|
37
|
-
|
|
38
|
-
type Options$1 = Omit<TransformOptions, "loader" | "sourcemap"> & {
|
|
39
|
-
exclude?: FilterPattern;
|
|
40
|
-
include?: FilterPattern;
|
|
41
|
-
loaders?: Record<string, Loader | false>;
|
|
42
|
-
optimizeDeps?: MarkOptional<OptimizeDepsOptions, "cwd" | "sourceMap">;
|
|
43
|
-
sourceMap?: boolean;
|
|
44
|
-
};
|
|
45
|
-
type OptimizeDepsOptions = {
|
|
46
|
-
cwd: string;
|
|
47
|
-
esbuildOptions?: BuildOptions$1;
|
|
48
|
-
exclude?: string[];
|
|
49
|
-
include: string[];
|
|
50
|
-
sourceMap: boolean;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
type JSXRemoveAttributesPlugin = {
|
|
54
|
-
attributes: string[];
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
interface LicenseOptions {
|
|
58
|
-
dtsMarker?: string;
|
|
59
|
-
dtsTemplate?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
60
|
-
marker?: string;
|
|
61
|
-
path?: string;
|
|
62
|
-
template?: (licenses: string[], dependencyLicenseTexts: string, packageName: string | undefined) => string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface RawLoaderOptions {
|
|
66
|
-
exclude?: FilterPattern;
|
|
67
|
-
include?: FilterPattern;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface SucrasePluginConfig extends Options$2 {
|
|
71
|
-
exclude?: FilterPattern;
|
|
72
|
-
extensions?: string[];
|
|
73
|
-
include?: FilterPattern;
|
|
74
|
-
}
|
|
75
2
|
|
|
76
3
|
interface Plugin {
|
|
77
4
|
(module: Program): Program;
|
|
@@ -1983,130 +1910,10 @@ interface Invalid extends Node, HasSpan {
|
|
|
1983
1910
|
type: "Invalid";
|
|
1984
1911
|
}
|
|
1985
1912
|
|
|
1986
|
-
type SwcPluginConfig =
|
|
1913
|
+
type SwcPluginConfig = {
|
|
1987
1914
|
exclude?: FilterPattern;
|
|
1988
1915
|
extensions?: string[];
|
|
1989
1916
|
include?: FilterPattern;
|
|
1990
|
-
}
|
|
1991
|
-
|
|
1992
|
-
interface PatchTypesOptions {
|
|
1993
|
-
identifierReplacements?: Record<string, Record<string, string>>;
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
type DeepPartial<T> = {
|
|
1997
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1998
|
-
};
|
|
1999
|
-
interface RollupDynamicImportVariablesOptions {
|
|
2000
|
-
errorWhenNoFilesFound?: boolean;
|
|
2001
|
-
exclude?: FilterPattern;
|
|
2002
|
-
include?: FilterPattern;
|
|
2003
|
-
warnOnError?: boolean;
|
|
2004
|
-
}
|
|
2005
|
-
interface RollupBuildOptions {
|
|
2006
|
-
alias: RollupAliasOptions | false;
|
|
2007
|
-
cjsInterop?: CJSInteropOptions;
|
|
2008
|
-
commonjs: RollupCommonJSOptions | false;
|
|
2009
|
-
copy?: CopyPluginOptions | false;
|
|
2010
|
-
dts: Options$3;
|
|
2011
|
-
dynamicVars?: RollupDynamicImportVariablesOptions | false;
|
|
2012
|
-
emitCJS?: boolean;
|
|
2013
|
-
emitESM?: boolean;
|
|
2014
|
-
esbuild: Options$1 | false;
|
|
2015
|
-
json: RollupJsonOptions | false;
|
|
2016
|
-
jsxRemoveAttributes?: JSXRemoveAttributesPlugin | false;
|
|
2017
|
-
license?: LicenseOptions | false;
|
|
2018
|
-
metafile?: boolean;
|
|
2019
|
-
output?: OutputOptions;
|
|
2020
|
-
patchTypes: PatchTypesOptions | false;
|
|
2021
|
-
polyfillNode?: NodePolyfillsOptions | false;
|
|
2022
|
-
preserveDynamicImports?: boolean;
|
|
2023
|
-
raw?: RawLoaderOptions | false;
|
|
2024
|
-
replace: RollupReplaceOptions | false;
|
|
2025
|
-
resolve: RollupNodeResolveOptions | false;
|
|
2026
|
-
shim?: boolean;
|
|
2027
|
-
sucrase?: SucrasePluginConfig | false;
|
|
2028
|
-
swc?: SwcPluginConfig | false;
|
|
2029
|
-
treeshake?: RollupOptions["treeshake"];
|
|
2030
|
-
visualizer?: PluginVisualizerOptions | false;
|
|
2031
|
-
watch?: RollupOptions["watch"];
|
|
2032
|
-
wsam?: RollupWasmOptions | false;
|
|
2033
|
-
}
|
|
2034
|
-
type BuildEntry = {
|
|
2035
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2036
|
-
format?: string;
|
|
2037
|
-
input: string;
|
|
2038
|
-
isExecutable?: boolean;
|
|
2039
|
-
name?: string;
|
|
2040
|
-
outDir?: string;
|
|
2041
|
-
};
|
|
2042
|
-
interface BuildOptions {
|
|
2043
|
-
alias: Record<string, string>;
|
|
2044
|
-
cjsInterop?: boolean;
|
|
2045
|
-
clean: boolean;
|
|
2046
|
-
declaration?: boolean | "compatible" | "node16";
|
|
2047
|
-
dependencies: string[];
|
|
2048
|
-
devDependencies: string[];
|
|
2049
|
-
entries: BuildEntry[];
|
|
2050
|
-
externals: (RegExp | string)[];
|
|
2051
|
-
failOnWarn?: boolean;
|
|
2052
|
-
name: string;
|
|
2053
|
-
optionalDependencies: string[];
|
|
2054
|
-
outDir: string;
|
|
2055
|
-
peerDependencies: string[];
|
|
2056
|
-
replace: Record<string, string>;
|
|
2057
|
-
rollup: RollupBuildOptions;
|
|
2058
|
-
rootDir: string;
|
|
2059
|
-
sourcemap: boolean;
|
|
2060
|
-
stub: boolean;
|
|
2061
|
-
stubOptions: {
|
|
2062
|
-
jiti: Omit<JITIOptions, "onError" | "transform">;
|
|
2063
|
-
};
|
|
2064
|
-
target: string;
|
|
2065
|
-
transformer: "esbuild" | "sucrase" | "swc";
|
|
2066
|
-
}
|
|
2067
|
-
interface BuildHooks {
|
|
2068
|
-
"build:before": (context: BuildContext) => Promise<void> | void;
|
|
2069
|
-
"build:done": (context: BuildContext) => Promise<void> | void;
|
|
2070
|
-
"build:prepare": (context: BuildContext) => Promise<void> | void;
|
|
2071
|
-
"rollup:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2072
|
-
"rollup:done": (context: BuildContext) => Promise<void> | void;
|
|
2073
|
-
"rollup:dts:build": (context: BuildContext, build: RollupBuild) => Promise<void> | void;
|
|
2074
|
-
"rollup:dts:done": (context: BuildContext) => Promise<void> | void;
|
|
2075
|
-
"rollup:dts:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2076
|
-
"rollup:options": (context: BuildContext, options: RollupOptions) => Promise<void> | void;
|
|
2077
|
-
"rollup:watch": (context: BuildContext, watcher: RollupWatcher) => Promise<void> | void;
|
|
2078
|
-
}
|
|
2079
|
-
type BuildContextBuildEntry = {
|
|
2080
|
-
bytes?: number;
|
|
2081
|
-
chunk?: boolean;
|
|
2082
|
-
chunks?: string[];
|
|
2083
|
-
exports?: string[];
|
|
2084
|
-
modules?: {
|
|
2085
|
-
bytes: number;
|
|
2086
|
-
id: string;
|
|
2087
|
-
}[];
|
|
2088
|
-
path: string;
|
|
2089
|
-
type?: "asset" | "chunk" | "entry";
|
|
2090
|
-
};
|
|
2091
|
-
interface BuildContext {
|
|
2092
|
-
buildEntries: BuildContextBuildEntry[];
|
|
2093
|
-
dependencyGraphMap: Map<string, Set<[string, string]>>;
|
|
2094
|
-
hooks: Hookable<BuildHooks>;
|
|
2095
|
-
logger: Pail<never, string>;
|
|
2096
|
-
mode: Mode;
|
|
2097
|
-
options: BuildOptions;
|
|
2098
|
-
pkg: PackageJson;
|
|
2099
|
-
rootDir: string;
|
|
2100
|
-
tsconfig?: TsConfigResult;
|
|
2101
|
-
usedImports: Set<string>;
|
|
2102
|
-
warnings: Set<string>;
|
|
2103
|
-
}
|
|
2104
|
-
type BuildPreset = BuildConfig | (() => BuildConfig);
|
|
2105
|
-
interface BuildConfig extends DeepPartial<Omit<BuildOptions, "entries">> {
|
|
2106
|
-
entries?: (BuildEntry | string)[];
|
|
2107
|
-
hooks?: Partial<BuildHooks>;
|
|
2108
|
-
preset?: BuildPreset | string;
|
|
2109
|
-
}
|
|
2110
|
-
type Mode = "build" | "jit" | "watch";
|
|
1917
|
+
} & Exclude<Options, "configFile" | "exclude" | "filename" | "sourceMaps" | "swcrc">;
|
|
2111
1918
|
|
|
2112
|
-
export type {
|
|
1919
|
+
export type { SwcPluginConfig as S };
|