@visulima/rollup-plugin-dts 1.0.0-alpha.14 → 1.0.0-alpha.16

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 CHANGED
@@ -1,3 +1,15 @@
1
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.16](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.15...@visulima/rollup-plugin-dts@1.0.0-alpha.16) (2026-04-24)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **rollup-plugin-dts:** inline bundled-package types in emitted .d.ts ([ce4c00d](https://github.com/visulima/packem/commit/ce4c00d24ebf14b25c799dc51f3b5f8939a9fae3))
6
+
7
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.15](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.14...@visulima/rollup-plugin-dts@1.0.0-alpha.15) (2026-04-24)
8
+
9
+ ### Bug Fixes
10
+
11
+ * **rollup-plugin-dts:** don't force disk-mode for composite-only projects ([a2498f7](https://github.com/visulima/packem/commit/a2498f722ed30369ecb715381bed5ad607274967))
12
+
1
13
  ## @visulima/rollup-plugin-dts [1.0.0-alpha.14](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.13...@visulima/rollup-plugin-dts@1.0.0-alpha.14) (2026-04-23)
2
14
 
3
15
  ## @visulima/rollup-plugin-dts [1.0.0-alpha.13](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.12...@visulima/rollup-plugin-dts@1.0.0-alpha.13) (2026-04-23)
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
1
- var R=Object.defineProperty;var c=(t,e)=>R(t,"name",{value:e,configurable:!0});import{createDebug as w}from"obug";import O from"magic-string";import{RE_DTS as p,resolveTemplateFn as F,replaceTemplateName as h,RE_TS as N,RE_VUE as $,RE_JSON as D,RE_CSS as k,RE_NODE_MODULES as j,filename_to_dts as x}from"./filename.js";import{RE_DTS_MAP as ie,RE_JS as ae}from"./filename.js";import T from"./packem_shared/createFakeJsPlugin-Yi-FbbFw.js";import{c as C}from"./packem_shared/generate-vg0AGQZR.js";import{resolveOptions as I}from"./packem_shared/resolveOptions-MWViYRPS.js";import S from"node:path";import{ResolverFactory as J}from"oxc-resolver";var M=Object.defineProperty,A=c((t,e)=>M(t,"name",{value:e,configurable:!0}),"o$2");const U=A(({banner:t,footer:e})=>({name:"rollup-plugin-dts:banner",async renderChunk(r,a){if(!p.test(a.fileName))return;const o=new O(r);if(t){const l=await(typeof t=="function"?t(a):t);l&&o.prepend(`${l}
2
- `)}if(e){const l=await(typeof e=="function"?e(a):e);l&&o.append(`
3
- ${l}`)}return{code:o.toString(),get map(){return o.generateMap({hires:"boundary",includeContent:!0,source:a.fileName})}}}}),"createBannerPlugin");var W=Object.defineProperty,q=c((t,e)=>W(t,"name",{value:e,configurable:!0}),"m");const z=q(({sideEffects:t})=>({name:"rollup-plugin-dts:dts-input",options:t===!1?e=>({treeshake:e.treeshake===!1?!1:{...typeof e.treeshake=="object"&&e.treeshake!==null?e.treeshake:{},moduleSideEffects:!1},...e}):void 0,outputOptions(e){return{...e,entryFileNames(r){const{entryFileNames:a}=e;if(a){const o=F(a,r),l=h(o,r.name);if(p.test(l))return o;const d=h(o,`${r.name}.d`);if(p.test(d))return d}return p.test(r.name)?r.name:r.name.endsWith(".d")?"[name].ts":"[name].d.ts"}}}}),"createDtsInputPlugin");var B=Object.defineProperty,v=c((t,e)=>B(t,"name",{value:e,configurable:!0}),"o$1");const g=v(t=>N.test(t)||$.test(t)||D.test(t),"isSourceFile"),G=v(({cwd:t,resolve:e,resolver:r,sideEffects:a,tsconfig:o,tsconfigRaw:l})=>{const d=new J({conditionNames:["types","typings","import","require"],mainFields:["types","typings","module","main"],tsconfig:o?{configFile:o,references:"auto"}:void 0}),y=a?!0:null;return{name:"rollup-plugin-dts:resolver",resolveId:{async handler(s,i,u){if(!i||!p.test(i))return;const n={external:!0,id:s,moduleSideEffects:a};if(k.test(s))return n;const m=await this.resolve(s,i,u);if(m?.external)return n;const f=await P(s,i,m);return f?j.test(f)&&!_(s)?n:p.test(f)?{id:f,moduleSideEffects:y}:g(f)?(await this.load({id:f}),{id:x(f),moduleSideEffects:y}):null:E(s)?null:n},order:"pre"}};function _(s){return typeof e=="boolean"?e:e.some(i=>typeof i=="string"?s===i:i.test(s))}async function P(s,i,u){let n;if(r==="tsc"){const{default:m}=await import("./packem_chunks/resolver.js");n=m(s,i,t,o,l)}else n=d.resolveDtsSync(i,s).path;return n&&(n=S.normalize(n)),!n||!g(n)?u&&E(u.id)&&g(u.id)&&!u.external?u.id:null:n}},"createDtsResolvePlugin"),E=v(t=>t.startsWith(".")||S.isAbsolute(t),"isFilePath");var L=Object.defineProperty,V=c((t,e)=>L(t,"name",{value:e,configurable:!0}),"o");const b=w("rollup-plugin-dts:options"),ne=V((t={})=>{b("resolving dts options");const e=I(t);b("resolved dts options %o",e);const r=[];return t.dtsInput?r.push(z(e)):r.push(C(e)),r.push(G(e),T(e)),(t.banner||t.footer)&&r.push(U(e)),r},"dts");export{k as RE_CSS,p as RE_DTS,ie as RE_DTS_MAP,ae as RE_JS,D as RE_JSON,j as RE_NODE_MODULES,N as RE_TS,$ as RE_VUE,T as createFakeJsPlugin,C as createGeneratePlugin,ne as dts,I as resolveOptions};
1
+ var $=Object.defineProperty;var p=(t,e)=>$(t,"name",{value:e,configurable:!0});import{createDebug as k}from"obug";import j from"magic-string";import{RE_DTS as m,resolveTemplateFn as I,replaceTemplateName as w,RE_TS as T,RE_VUE as C,RE_JSON as J,RE_CSS as M,filename_to_dts as P,RE_NODE_MODULES as R}from"./filename.js";import{RE_DTS_MAP as ce,RE_JS as de}from"./filename.js";import W from"./packem_shared/createFakeJsPlugin-Yi-FbbFw.js";import{c as A}from"./packem_shared/generate-vg0AGQZR.js";import{resolveOptions as B}from"./packem_shared/resolveOptions-Bp8RzeQ2.js";import F from"node:path";import{ResolverFactory as U}from"oxc-resolver";var q=Object.defineProperty,z=p((t,e)=>q(t,"name",{value:e,configurable:!0}),"o$1");const G=z(({banner:t,footer:e})=>({name:"rollup-plugin-dts:banner",async renderChunk(s,l){if(!m.test(l.fileName))return;const a=new j(s);if(t){const c=await(typeof t=="function"?t(l):t);c&&a.prepend(`${c}
2
+ `)}if(e){const c=await(typeof e=="function"?e(l):e);c&&a.append(`
3
+ ${c}`)}return{code:a.toString(),get map(){return a.generateMap({hires:"boundary",includeContent:!0,source:l.fileName})}}}}),"createBannerPlugin");var L=Object.defineProperty,V=p((t,e)=>L(t,"name",{value:e,configurable:!0}),"m");const H=V(({sideEffects:t})=>({name:"rollup-plugin-dts:dts-input",options:t===!1?e=>({treeshake:e.treeshake===!1?!1:{...typeof e.treeshake=="object"&&e.treeshake!==null?e.treeshake:{},moduleSideEffects:!1},...e}):void 0,outputOptions(e){return{...e,entryFileNames(s){const{entryFileNames:l}=e;if(l){const a=I(l,s),c=w(a,s.name);if(m.test(c))return a;const g=w(a,`${s.name}.d`);if(m.test(g))return g}return m.test(s.name)?s.name:s.name.endsWith(".d")?"[name].ts":"[name].d.ts"}}}}),"createDtsInputPlugin");var K=Object.defineProperty,b=p((t,e)=>K(t,"name",{value:e,configurable:!0}),"a");const h=b(t=>T.test(t)||C.test(t)||J.test(t),"isSourceFile"),Q=b(({cwd:t,resolve:e,resolver:s,sideEffects:l,tsconfig:a,tsconfigRaw:c})=>{const g=new U({conditionNames:["types","typings","import","require"],mainFields:["types","typings","module","main"],tsconfig:a?{configFile:a,references:"auto"}:void 0}),v=l?!0:null;return{name:"rollup-plugin-dts:resolver",resolveId:{async handler(n,r,u){if(!r||!m.test(r))return;const o={external:!0,id:n,moduleSideEffects:l};if(M.test(n))return o;if(!y(n)&&E(n)){const i=await O(n,r,null);if(i&&m.test(i))return{id:i,moduleSideEffects:v};if(i&&h(i))return await this.load({id:i}),{id:P(i),moduleSideEffects:v}}const d=await this.resolve(n,r,u);if(d?.external)return o;const f=await O(n,r,d);return f?R.test(f)&&!E(n)&&!(y(n)&&R.test(r)&&N(r))?o:m.test(f)?{id:f,moduleSideEffects:v}:h(f)?(await this.load({id:f}),{id:P(f),moduleSideEffects:v}):null:y(n)?null:o},order:"pre"}};function E(n){return typeof e=="boolean"?e:e.some(r=>typeof r=="string"?n===r:r.test(n))}function N(n){const r=n.replace(/\\/g,"/"),u="/node_modules/",o=r.lastIndexOf(u);if(o<0)return!1;const d=r.slice(o+u.length),f=d.indexOf("/");let i=f===-1?d:d.slice(0,f);if(i.startsWith("@")){const S=d.slice(i.length+1),_=S.indexOf("/"),x=_===-1?S:S.slice(0,_);i=`${i}/${x}`}return E(i)}async function O(n,r,u){let o;if(s==="tsc"){const{default:d}=await import("./packem_chunks/resolver.js");o=d(n,r,t,a,c)}else o=g.resolveDtsSync(r,n).path;return o&&(o=F.normalize(o)),!o||!h(o)?u&&y(u.id)&&h(u.id)&&!u.external?u.id:null:o}},"createDtsResolvePlugin"),y=b(t=>t.startsWith(".")||F.isAbsolute(t),"isFilePath");var X=Object.defineProperty,Y=p((t,e)=>X(t,"name",{value:e,configurable:!0}),"o");const D=k("rollup-plugin-dts:options"),le=Y((t={})=>{D("resolving dts options");const e=B(t);D("resolved dts options %o",e);const s=[];return t.dtsInput?s.push(H(e)):s.push(A(e)),s.push(Q(e),W(e)),(t.banner||t.footer)&&s.push(G(e)),s},"dts");export{M as RE_CSS,m as RE_DTS,ce as RE_DTS_MAP,de as RE_JS,J as RE_JSON,R as RE_NODE_MODULES,T as RE_TS,C as RE_VUE,W as createFakeJsPlugin,A as createGeneratePlugin,le as dts,B as resolveOptions};
@@ -0,0 +1 @@
1
+ var A=Object.defineProperty;var b=(i,n)=>A(i,"name",{value:n,configurable:!0});import{existsSync as W}from"node:fs";import{createRequire as $}from"node:module";import d from"node:path";import T from"node:process";import{findTsConfigSync as q,readTsConfig as z}from"@visulima/tsconfig";import O from"typescript";var G=Object.defineProperty,I=b((i,n)=>G(i,"name",{value:n,configurable:!0}),"w");let E=!1;const M=I((i,n=new Set)=>{if(n.has(i))return!1;n.add(i);const a=O.readConfigFile(i,o=>W(o)?O.sys.readFile(o):void 0);if(a.error||!a.config)return!1;const e=a.config,s=e.compilerOptions;if(s){if(s.incremental===!1)return!1;if(s.incremental===!0||typeof s.tsBuildInfoFile=="string")return!0}if(!e.extends)return!1;const h=Array.isArray(e.extends)?e.extends:[e.extends],c=d.dirname(i);for(const o of h){if(typeof o!="string")continue;let l;if(o.startsWith("."))l=d.resolve(c,o.endsWith(".json")?o:`${o}.json`);else try{l=$(d.join(c,"package.json")).resolve(o)}catch{l=void 0}if(l&&M(l,n))return!0}return!1},"hasExplicitIncrementalInTsconfig"),X=I(({banner:i,build:n=!1,cjsDefault:a=!1,compilerOptions:e={},cwd:s=T.cwd(),dtsInput:h=!1,eager:c=!1,emitDtsOnly:o=!1,emitJs:l,exclude:j=null,footer:P,include:C=null,incremental:v=!1,newContext:D=!1,oxc:r,parallel:F=!1,resolve:J=!1,resolver:R="oxc",sideEffects:B=!1,sourcemap:g,tsconfig:t,tsconfigRaw:S={},tsgo:w=!1,tsMacro:p=!1,vue:u=!1})=>{let m;if(t===!0||t==null)try{const y=q(s);t=y.path,m=y.config}catch{t=void 0}else typeof t=="string"?(t=d.resolve(s||T.cwd(),t),m=z(t)):t=void 0;const x=e;e={...m?.compilerOptions,...e},v||=x.incremental===!0||typeof x.tsBuildInfoFile=="string"||typeof t=="string"&&M(t),g??=!!e.declarationMap,e.declarationMap=g;const k={...m,...S,compilerOptions:e};let f=!1;if(w&&(f=w===!0?{}:w),r??=!!(e?.isolatedDeclarations&&!u&&!f&&!p),r===!0&&(r={}),r&&(r.stripInternal??=!!e?.stripInternal,r.sourcemap=!!e.declarationMap),l??=!!(e.checkJs||e.allowJs),f){if(u)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `vue` option. Please disable one of them.");if(p)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `tsMacro` option. Please disable one of them.");if(r)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `oxc` option. Please disable one of them.")}if(r&&u)throw new Error("[@visulima/rollup-plugin-dts] The `oxc` option is not compatible with the `vue` option. Please disable one of them.");if(r&&p)throw new Error("[@visulima/rollup-plugin-dts] The `oxc` option is not compatible with the `tsMacro` option. Please disable one of them.");return f&&!E&&(console.warn("The `tsgo` option is experimental and may change in the future."),E=!0),{banner:i,build:n,cjsDefault:a,cwd:s,dtsInput:h,eager:c,emitDtsOnly:o,emitJs:l,exclude:j,footer:P,include:C,incremental:v,newContext:D,oxc:r,parallel:F,resolve:J,resolver:R,sideEffects:B,sourcemap:g,tsconfig:t,tsconfigRaw:k,tsgo:f,tsMacro:p,vue:u}},"resolveOptions");export{X as resolveOptions};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/rollup-plugin-dts",
3
- "version": "1.0.0-alpha.14",
3
+ "version": "1.0.0-alpha.16",
4
4
  "description": "A Rollup plugin to bundle dts files",
5
5
  "homepage": "https://github.com/visulima/packem/tree/main/packages/rollup-plugin-dts",
6
6
  "bugs": {
@@ -1 +0,0 @@
1
- var R=Object.defineProperty;var h=(l,i)=>R(l,"name",{value:i,configurable:!0});import k from"node:path";import w from"node:process";import{findTsConfigSync as B,readTsConfig as F}from"@visulima/tsconfig";var S=Object.defineProperty,q=h((l,i)=>S(l,"name",{value:i,configurable:!0}),"h");let g=!1;const K=q(({banner:l,build:i=!1,cjsDefault:v=!1,compilerOptions:e={},cwd:c=w.cwd(),dtsInput:b=!1,eager:x=!1,emitDtsOnly:O=!1,emitJs:u,exclude:T=null,footer:y,include:E=null,incremental:m=!1,newContext:M=!1,oxc:o,parallel:D=!1,resolve:I=!1,resolver:P="oxc",sideEffects:C=!1,sourcemap:p,tsconfig:t,tsconfigRaw:J={},tsgo:f=!1,tsMacro:n=!1,vue:r=!1})=>{let a;if(t===!0||t==null)try{const d=B(c);t=d.path,a=d.config}catch{t=void 0}else typeof t=="string"?(t=k.resolve(c||w.cwd(),t),a=F(t)):t=void 0;e={...a?.compilerOptions,...e},m||=e.incremental||!!e.tsBuildInfoFile,p??=!!e.declarationMap,e.declarationMap=p;const j={...a,...J,compilerOptions:e};let s=!1;if(f&&(s=f===!0?{}:f),o??=!!(e?.isolatedDeclarations&&!r&&!s&&!n),o===!0&&(o={}),o&&(o.stripInternal??=!!e?.stripInternal,o.sourcemap=!!e.declarationMap),u??=!!(e.checkJs||e.allowJs),s){if(r)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `vue` option. Please disable one of them.");if(n)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `tsMacro` option. Please disable one of them.");if(o)throw new Error("[@visulima/rollup-plugin-dts] The `tsgo` option is not compatible with the `oxc` option. Please disable one of them.")}if(o&&r)throw new Error("[@visulima/rollup-plugin-dts] The `oxc` option is not compatible with the `vue` option. Please disable one of them.");if(o&&n)throw new Error("[@visulima/rollup-plugin-dts] The `oxc` option is not compatible with the `tsMacro` option. Please disable one of them.");return s&&!g&&(console.warn("The `tsgo` option is experimental and may change in the future."),g=!0),{banner:l,build:i,cjsDefault:v,cwd:c,dtsInput:b,eager:x,emitDtsOnly:O,emitJs:u,exclude:T,footer:y,include:E,incremental:m,newContext:M,oxc:o,parallel:D,resolve:I,resolver:P,sideEffects:C,sourcemap:p,tsconfig:t,tsconfigRaw:j,tsgo:s,tsMacro:n,vue:r}},"resolveOptions");export{K as resolveOptions};