@visulima/rollup-plugin-dts 1.0.0-alpha.18 → 1.0.0-alpha.19

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,9 @@
1
+ ## @visulima/rollup-plugin-dts [1.0.0-alpha.19](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.18...@visulima/rollup-plugin-dts@1.0.0-alpha.19) (2026-04-24)
2
+
3
+ ### Bug Fixes
4
+
5
+ * **rollup-plugin-dts:** sibling .d.ts fallback for string-form exports ([2a26b69](https://github.com/visulima/packem/commit/2a26b69b322375061cdcd55a14c72301085606ef))
6
+
1
7
  ## @visulima/rollup-plugin-dts [1.0.0-alpha.18](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.17...@visulima/rollup-plugin-dts@1.0.0-alpha.18) (2026-04-24)
2
8
 
3
9
  ## @visulima/rollup-plugin-dts [1.0.0-alpha.17](https://github.com/visulima/packem/compare/@visulima/rollup-plugin-dts@1.0.0-alpha.16...@visulima/rollup-plugin-dts@1.0.0-alpha.17) (2026-04-24)
package/dist/index.js CHANGED
@@ -1,3 +1,3 @@
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-DhesHehE.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};
1
+ var k=Object.defineProperty;var p=(t,e)=>k(t,"name",{value:e,configurable:!0});import{createDebug as T}from"obug";import I from"magic-string";import{RE_DTS as m,resolveTemplateFn as J,replaceTemplateName as N,RE_TS as M,RE_VUE as C,RE_JSON as U,RE_CSS as W,filename_to_dts as P,RE_NODE_MODULES as R,RE_JS as A,filename_js_to_dts as q}from"./filename.js";import{RE_DTS_MAP as ye}from"./filename.js";import z from"./packem_shared/createFakeJsPlugin-DhesHehE.js";import{c as B}from"./packem_shared/generate-vg0AGQZR.js";import{resolveOptions as G}from"./packem_shared/resolveOptions-Bp8RzeQ2.js";import g from"node:path";import{ResolverFactory as L}from"oxc-resolver";import{existsSync as D,readFileSync as V}from"node:fs";var H=Object.defineProperty,K=p((t,e)=>H(t,"name",{value:e,configurable:!0}),"o$1");const Q=K(({banner:t,footer:e})=>({name:"rollup-plugin-dts:banner",async renderChunk(n,a){if(!m.test(a.fileName))return;const o=new I(n);if(t){const d=await(typeof t=="function"?t(a):t);d&&o.prepend(`${d}
2
+ `)}if(e){const d=await(typeof e=="function"?e(a):e);d&&o.append(`
3
+ ${d}`)}return{code:o.toString(),get map(){return o.generateMap({hires:"boundary",includeContent:!0,source:a.fileName})}}}}),"createBannerPlugin");var X=Object.defineProperty,Y=p((t,e)=>X(t,"name",{value:e,configurable:!0}),"m$1");const Z=Y(({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(n){const{entryFileNames:a}=e;if(a){const o=J(a,n),d=N(o,n.name);if(m.test(d))return o;const v=N(o,`${n.name}.d`);if(m.test(v))return v}return m.test(n.name)?n.name:n.name.endsWith(".d")?"[name].ts":"[name].d.ts"}}}}),"createDtsInputPlugin");var ee=Object.defineProperty,E=p((t,e)=>ee(t,"name",{value:e,configurable:!0}),"u");const y=E(t=>M.test(t)||C.test(t)||U.test(t),"isSourceFile"),te=E(({cwd:t,resolve:e,resolver:n,sideEffects:a,tsconfig:o,tsconfigRaw:d})=>{const v=new L({conditionNames:["types","typings","import","require"],mainFields:["types","typings","module","main"],tsconfig:o?{configFile:o,references:"auto"}:void 0}),h=a?!0:null;return{name:"rollup-plugin-dts:resolver",resolveId:{async handler(s,i,u){if(!i||!m.test(i))return;const r={external:!0,id:s,moduleSideEffects:a};if(W.test(s))return r;if(!S(s)&&b(s)){const l=await w(s,i,null);if(l&&m.test(l))return{id:l,moduleSideEffects:h};if(l&&y(l))return await this.load({id:l}),{id:P(l),moduleSideEffects:h}}const f=await this.resolve(s,i,u);if(f?.external)return r;const c=await w(s,i,f);return c?R.test(c)&&!b(s)&&!(S(s)&&R.test(i)&&$(i))?r:m.test(c)?{id:c,moduleSideEffects:h}:y(c)?(await this.load({id:c}),{id:P(c),moduleSideEffects:h}):null:S(s)?null:r},order:"pre"}};function b(s){return typeof e=="boolean"?e:e.some(i=>typeof i=="string"?s===i:i.test(s))}function $(s){const i=s.replace(/\\/g,"/"),u="/node_modules/",r=i.lastIndexOf(u);if(r<0)return!1;const f=i.slice(r+u.length),c=f.indexOf("/");let l=c===-1?f:f.slice(0,c);if(l.startsWith("@")){const _=f.slice(l.length+1),x=_.indexOf("/"),j=x===-1?_:_.slice(0,x);l=`${l}/${j}`}return b(l)}async function w(s,i,u){let r;if(n==="tsc"){const{default:f}=await import("./packem_chunks/resolver.js");r=f(s,i,t,o,d)}else r=v.resolveDtsSync(i,s).path;if(r&&(r=g.normalize(r)),r&&A.test(r)&&ne(r)){const f=q(r);if(D(f))return f}return!r||!y(r)?u&&S(u.id)&&y(u.id)&&!u.external?u.id:null:r}},"createDtsResolvePlugin"),S=E(t=>t.startsWith(".")||g.isAbsolute(t),"isFilePath"),O=new Map,ne=E(t=>{let e=g.dirname(t);for(;;){const n=g.join(e,"package.json");if(O.has(n))return O.get(n);if(D(n)){let o=!1;try{o=typeof JSON.parse(V(n,"utf8")).exports=="string"}catch{o=!1}return O.set(n,o),o}const a=g.dirname(e);if(a===e)return!1;e=a}},"hasStringExports");var re=Object.defineProperty,se=p((t,e)=>re(t,"name",{value:e,configurable:!0}),"o");const F=T("rollup-plugin-dts:options"),ge=se((t={})=>{F("resolving dts options");const e=G(t);F("resolved dts options %o",e);const n=[];return t.dtsInput?n.push(Z(e)):n.push(B(e)),n.push(te(e),z(e)),(t.banner||t.footer)&&n.push(Q(e)),n},"dts");export{W as RE_CSS,m as RE_DTS,ye as RE_DTS_MAP,A as RE_JS,U as RE_JSON,R as RE_NODE_MODULES,M as RE_TS,C as RE_VUE,z as createFakeJsPlugin,B as createGeneratePlugin,ge as dts,G 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.18",
3
+ "version": "1.0.0-alpha.19",
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": {