@visulima/packem-rollup 1.0.0-alpha.28 → 1.0.0-alpha.29

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,10 @@
1
+ ## @visulima/packem-rollup [1.0.0-alpha.29](https://github.com/visulima/packem/compare/@visulima/packem-rollup@1.0.0-alpha.28...@visulima/packem-rollup@1.0.0-alpha.29) (2025-11-26)
2
+
3
+ ### Miscellaneous Chores
4
+
5
+ * remove patched dependencies and update oxc-parser usage ([24411c1](https://github.com/visulima/packem/commit/24411c1b75bb5a69e7466446a0805c22953c5f78))
6
+ * update oxc dependencies and add patch for oxc-parser ([a3a87fe](https://github.com/visulima/packem/commit/a3a87fe8ea10f0958ee70bc9b8c37aa666c95cb0))
7
+
1
8
  ## @visulima/packem-rollup [1.0.0-alpha.28](https://github.com/visulima/packem/compare/@visulima/packem-rollup@1.0.0-alpha.27...@visulima/packem-rollup@1.0.0-alpha.28) (2025-11-25)
2
9
 
3
10
  ### Bug Fixes
@@ -1,3 +1,3 @@
1
- var U=Object.defineProperty;var x=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createFilter as X}from"@rollup/pluginutils";import{readFile as W}from"@visulima/fs";import{EXCLUDE_REGEXP as _,ENDING_REGEX as E}from"@visulima/packem-share/constants";import{getDtsExtension as L}from"@visulima/packem-share/utils";import{dirname as S,toNamespacedPath as D,sep as A,extname as J,isAbsolute as q,relative as C,join as k,basename as O}from"@visulima/path";import{parse as z}from"oxc-parser";import{_ as B}from"../../packem_shared/fix-dts-default-cjs-exports-BQc0nwIG.js";var H=Object.defineProperty,Q=x((t,e)=>H(t,"name",{value:e,configurable:!0}),"e");const P=/^([\w-]+):/,K=Q(t=>{if(!t||typeof t!="string")throw new Error("Invalid key: Key must be a non-empty string.");const e=[],c=P.exec(t);c&&(e.push(c[1]),t=t.replace(P,""));const n=t.split("/");for(const p of n)(p.includes("*")||p)&&e.push(p);return e},"splitTsconfigPathKey");var V=Object.defineProperty,Y=x((t,e)=>V(t,"name",{value:e,configurable:!0}),"h");const Z=Y((t,e)=>{const c=t.replace(/^\.\//,""),n=e.replace(/^\.\//,"");if(n.startsWith(c))return t+n.slice(c.length);if(t.endsWith(e))return t;const p=K(t),d=K(e);let l=p.length-1,r=d.length-1;for(;l>=0&&r>=0&&p[l]===d[r];)l--,r--;let a=p.slice(0,l).join("/");const f=d.slice(r).join("/");return(!a.startsWith(".")||a==="")&&(a=`./${a}`),a+(f?`/${f}`:"")},"extendString");var ee=Object.defineProperty,te=x((t,e)=>ee(t,"name",{value:e,configurable:!0}),"s");const re=te((...t)=>{if(t.length===0)return"";if(t.length===1)return S(t[0]);t=t.map(p=>D(p).split(A).join("/"));const[e,...c]=t;let n=e.split("/");for(const p of c){const d=p.split("/",n.length);let l=0;for(const r of d)if(r===n[l])l+=1;else{n=n.slice(0,l);break}n=n.slice(0,l)}return(n.length<=1&&n[0]===""?`/${n[0]}`:n.join("/")).split("/").join(A)},"lowestCommonAncestor");var ie=Object.defineProperty,j=x((t,e)=>ie(t,"name",{value:e,configurable:!0}),"g");const I=j((t,e)=>`${t}
1
+ var U=Object.defineProperty;var x=(t,e)=>U(t,"name",{value:e,configurable:!0});import{createFilter as X}from"@rollup/pluginutils";import{readFile as W}from"@visulima/fs";import{EXCLUDE_REGEXP as _,ENDING_REGEX as E}from"@visulima/packem-share/constants";import{getDtsExtension as L}from"@visulima/packem-share/utils";import{dirname as R,toNamespacedPath as D,sep as k,extname as J,isAbsolute as q,relative as C,join as A,basename as O}from"@visulima/path";import{parseSync as z}from"oxc-parser";import{_ as B}from"../../packem_shared/fix-dts-default-cjs-exports-BQc0nwIG.js";var H=Object.defineProperty,Q=x((t,e)=>H(t,"name",{value:e,configurable:!0}),"e");const P=/^([\w-]+):/,K=Q(t=>{if(!t||typeof t!="string")throw new Error("Invalid key: Key must be a non-empty string.");const e=[],c=P.exec(t);c&&(e.push(c[1]),t=t.replace(P,""));const n=t.split("/");for(const p of n)(p.includes("*")||p)&&e.push(p);return e},"splitTsconfigPathKey");var V=Object.defineProperty,Y=x((t,e)=>V(t,"name",{value:e,configurable:!0}),"h");const Z=Y((t,e)=>{const c=t.replace(/^\.\//,""),n=e.replace(/^\.\//,"");if(n.startsWith(c))return t+n.slice(c.length);if(t.endsWith(e))return t;const p=K(t),d=K(e);let l=p.length-1,r=d.length-1;for(;l>=0&&r>=0&&p[l]===d[r];)l--,r--;let a=p.slice(0,l).join("/");const f=d.slice(r).join("/");return(!a.startsWith(".")||a==="")&&(a=`./${a}`),a+(f?`/${f}`:"")},"extendString");var ee=Object.defineProperty,te=x((t,e)=>ee(t,"name",{value:e,configurable:!0}),"s");const re=te((...t)=>{if(t.length===0)return"";if(t.length===1)return R(t[0]);t=t.map(p=>D(p).split(k).join("/"));const[e,...c]=t;let n=e.split("/");for(const p of c){const d=p.split("/",n.length);let l=0;for(const r of d)if(r===n[l])l+=1;else{n=n.slice(0,l);break}n=n.slice(0,l)}return(n.length<=1&&n[0]===""?`/${n[0]}`:n.join("/")).split("/").join(k)},"lowestCommonAncestor");var ie=Object.defineProperty,j=x((t,e)=>ie(t,"name",{value:e,configurable:!0}),"g");const S=j((t,e)=>`${t}
2
2
  //# sourceMappingURL=${O(e)}.map
3
- `,"appendMapUrl"),R=j((t,e,c)=>JSON.stringify({file:O(c),mappings:t,names:[],sourceRoot:"",sources:[C(S(c),e)],version:3}),"generateDtsMap"),fe=j((t,e)=>{const c=X(/\.(?:[mc]?ts|[jt]sx?)$/,e.options.rollup.isolatedDeclarations?.exclude||_);let n=Object.create(null);const p=j((r,a)=>{n[r.replace(E,"")]={...a,ext:J(r)}},"addOutput");let d=[];e.tsconfig?.config.compilerOptions&&(d=Object.entries(e.tsconfig.config.compilerOptions.paths??{}).map(([r])=>r.endsWith("*")?new RegExp(`^${r.replace("*","(.*)")}$`):new RegExp(`^${r}$`)));async function l(r,a){if(!c(a))return;e.logger.debug({message:`Processing file: ${a}`,prefix:"packem:isolated-declarations"});let f;try{f=(await z(a,r)).program}catch(s){e.logger.debug({message:s.message,prefix:"packem:isolated-declarations"})}if(f){const s=f.body.filter(i=>(i.type==="ImportDeclaration"||i.type==="ExportAllDeclaration"||i.type==="ExportNamedDeclaration")&&i.source);for await(const i of s){if(O(i.source.value).includes("."))continue;const o=await this.resolve(i.source.value,a);if(!(!o||o.external)&&(o.id.endsWith(".ts")||o.id.endsWith(".cts")||o.id.endsWith(".mts")||o.id.endsWith(".tsx")||o.id.endsWith(".ctsx")||o.id.endsWith(".mtsx"))){const g=o.id.replace(`${t}/`,"");let u=i.source.value;d.some($=>$.test(i.source.value))&&!i.source.value.startsWith(".")&&(u=`./${i.source.value}`),r=r.replaceAll(`from "${i.source.value}"`,`from "${Z(u,g)}"`)}}}const{errors:b,map:w,sourceText:m}=await e.options.isolatedDeclarationTransformer(a,r,e.options.sourcemap,e.tsconfig?.config?.compilerOptions);if(b.length>0){if(e.options.rollup.isolatedDeclarations.ignoreErrors){this.warn(b[0]);return}return this.error(b[0])}if(p(a,{map:w,source:m}),!f)return;const h=f.body.filter(s=>!("source"in s)||!s.source?!1:"importKind"in s&&s.importKind==="type"||"exportKind"in s&&s.exportKind==="type"?!0:s.type==="ImportDeclaration"?s.specifiers&&s.specifiers.every(i=>i.type==="ImportSpecifier"&&i.importKind==="type"):s.type==="ExportNamedDeclaration"&&s.specifiers&&s.specifiers.every(i=>i.exportKind==="type"));for await(const s of h){if(!s.source)continue;const i=await this.resolve(s.source.value,a);if(!i)return;const o=i.id;if(c(o)&&!n[o.replace(E,"")])try{const g=await W(o);await l.call(this,g,o)}catch{}}}return x(l,"N"),j(l,"transform"),{buildStart(){n=Object.create(null)},name:"packem:isolated-declarations",async renderStart(r,{input:a}){const f=re(...Array.isArray(a)?a:Object.values(a));e.logger.debug({message:`Input base:${f}`,prefix:"packem:isolated-declarations"});const b=Array.isArray(a)?a:Object.values(a);for await(const m of b)if(c(m)&&!n[m.replace(E,"")])try{const h=await W(m);await l.call(this,h,m)}catch{}typeof r.entryFileNames=="function"&&(r.entryFileNames=r.entryFileNames({name:r.name}));const w=r.entryFileNames.replace(/\.(.)?[jt]sx?$/,(m,h)=>`.d.${h||""}ts`);for await(let[m,{ext:h,map:s,source:i}]of Object.entries(n)){let o;if(q(m)){if(!m.startsWith(t)){e.logger.debug({message:`Skipping file outside sourceDirectory: ${m}`,prefix:"packem:isolated-declarations"});continue}o=C(t,m)}else o=m.replace(`${t}/`,"");if(o.startsWith("/")&&(o=o.slice(1)),e.options.rollup.cjsInterop&&r.format==="cjs"){const y=B(i,{fileName:o,imports:[]},{warn:this.warn});y&&(i=y.code)}const g=i.includes("from '")?"'":'"',u=o+h;if((e.options.declaration===!0||e.options.declaration==="compatible")&&r.format==="cjs"){e.logger.debug({message:`Emit compatible dts file: ${o}`,prefix:"packem:isolated-declarations"});const y=w.replace("[name]",D(o)).replace(".cts",".ts");let v=i;e.options.sourcemap&&s&&(v=I(v.trim(),y),this.emitFile({fileName:`${y}.map`,originalFileName:u,source:R(s,u,k(r.dir,y)),type:"asset"})),this.emitFile({fileName:y,originalFileName:u,source:v.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(F,N,M,T)=>`${N+g+(T||M)}.d.ts${g};`),type:"asset"})}e.logger.debug({message:`Emit dts file: ${o}`,prefix:"packem:isolated-declarations"});const $=w.replace("[name]",D(o));e.options.sourcemap&&s&&(i=I(i.trim(),$),this.emitFile({fileName:`${$}.map`,originalFileName:u,source:R(s,u,k(r.dir,$)),type:"asset"}));const G=L(e,r.format==="cjs"?"cjs":"esm");this.emitFile({fileName:$,originalFileName:u,source:i.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(y,v,F,N)=>`${v+g+(N||F)}.${G}${g};`),type:"asset"})}},transform:l}},"isolatedDeclarationsPlugin");export{fe as isolatedDeclarationsPlugin};
3
+ `,"appendMapUrl"),I=j((t,e,c)=>JSON.stringify({file:O(c),mappings:t,names:[],sourceRoot:"",sources:[C(R(c),e)],version:3}),"generateDtsMap"),fe=j((t,e)=>{const c=X(/\.(?:[mc]?ts|[jt]sx?)$/,e.options.rollup.isolatedDeclarations?.exclude||_);let n=Object.create(null);const p=j((r,a)=>{n[r.replace(E,"")]={...a,ext:J(r)}},"addOutput");let d=[];e.tsconfig?.config.compilerOptions&&(d=Object.entries(e.tsconfig.config.compilerOptions.paths??{}).map(([r])=>r.endsWith("*")?new RegExp(`^${r.replace("*","(.*)")}$`):new RegExp(`^${r}$`)));async function l(r,a){if(!c(a))return;e.logger.debug({message:`Processing file: ${a}`,prefix:"packem:isolated-declarations"});let f;try{f=z(a,r).program}catch(s){e.logger.debug({message:s.message,prefix:"packem:isolated-declarations"})}if(f){const s=f.body.filter(i=>(i.type==="ImportDeclaration"||i.type==="ExportAllDeclaration"||i.type==="ExportNamedDeclaration")&&i.source);for await(const i of s){if(O(i.source.value).includes("."))continue;const o=await this.resolve(i.source.value,a);if(!(!o||o.external)&&(o.id.endsWith(".ts")||o.id.endsWith(".cts")||o.id.endsWith(".mts")||o.id.endsWith(".tsx")||o.id.endsWith(".ctsx")||o.id.endsWith(".mtsx"))){const g=o.id.replace(`${t}/`,"");let u=i.source.value;d.some($=>$.test(i.source.value))&&!i.source.value.startsWith(".")&&(u=`./${i.source.value}`),r=r.replaceAll(`from "${i.source.value}"`,`from "${Z(u,g)}"`)}}}const{errors:b,map:w,sourceText:m}=await e.options.isolatedDeclarationTransformer(a,r,e.options.sourcemap,e.tsconfig?.config?.compilerOptions);if(b.length>0){if(e.options.rollup.isolatedDeclarations.ignoreErrors){this.warn(b[0]);return}return this.error(b[0])}if(p(a,{map:w,source:m}),!f)return;const h=f.body.filter(s=>!("source"in s)||!s.source?!1:"importKind"in s&&s.importKind==="type"||"exportKind"in s&&s.exportKind==="type"?!0:s.type==="ImportDeclaration"?s.specifiers&&s.specifiers.every(i=>i.type==="ImportSpecifier"&&i.importKind==="type"):s.type==="ExportNamedDeclaration"&&s.specifiers&&s.specifiers.every(i=>i.exportKind==="type"));for await(const s of h){if(!s.source)continue;const i=await this.resolve(s.source.value,a);if(!i)return;const o=i.id;if(c(o)&&!n[o.replace(E,"")])try{const g=await W(o);await l.call(this,g,o)}catch{}}}return x(l,"N"),j(l,"transform"),{buildStart(){n=Object.create(null)},name:"packem:isolated-declarations",async renderStart(r,{input:a}){const f=re(...Array.isArray(a)?a:Object.values(a));e.logger.debug({message:`Input base:${f}`,prefix:"packem:isolated-declarations"});const b=Array.isArray(a)?a:Object.values(a);for await(const m of b)if(c(m)&&!n[m.replace(E,"")])try{const h=await W(m);await l.call(this,h,m)}catch{}typeof r.entryFileNames=="function"&&(r.entryFileNames=r.entryFileNames({name:r.name}));const w=r.entryFileNames.replace(/\.(.)?[jt]sx?$/,(m,h)=>`.d.${h||""}ts`);for await(let[m,{ext:h,map:s,source:i}]of Object.entries(n)){let o;if(q(m)){if(!m.startsWith(t)){e.logger.debug({message:`Skipping file outside sourceDirectory: ${m}`,prefix:"packem:isolated-declarations"});continue}o=C(t,m)}else o=m.replace(`${t}/`,"");if(o.startsWith("/")&&(o=o.slice(1)),e.options.rollup.cjsInterop&&r.format==="cjs"){const y=B(i,{fileName:o,imports:[]},{warn:this.warn});y&&(i=y.code)}const g=i.includes("from '")?"'":'"',u=o+h;if((e.options.declaration===!0||e.options.declaration==="compatible")&&r.format==="cjs"){e.logger.debug({message:`Emit compatible dts file: ${o}`,prefix:"packem:isolated-declarations"});const y=w.replace("[name]",D(o)).replace(".cts",".ts");let v=i;e.options.sourcemap&&s&&(v=S(v.trim(),y),this.emitFile({fileName:`${y}.map`,originalFileName:u,source:I(s,u,A(r.dir,y)),type:"asset"})),this.emitFile({fileName:y,originalFileName:u,source:v.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(F,N,M,T)=>`${N+g+(T||M)}.d.ts${g};`),type:"asset"})}e.logger.debug({message:`Emit dts file: ${o}`,prefix:"packem:isolated-declarations"});const $=w.replace("[name]",D(o));e.options.sourcemap&&s&&(i=S(i.trim(),$),this.emitFile({fileName:`${$}.map`,originalFileName:u,source:I(s,u,A(r.dir,$)),type:"asset"}));const G=L(e,r.format==="cjs"?"cjs":"esm");this.emitFile({fileName:$,originalFileName:u,source:i.replaceAll(/(from\s)['|"]((.*)\..+|['|"].*)['|"];?/g,(y,v,F,N)=>`${v+g+(N||F)}.${G}${g};`),type:"asset"})}},transform:l}},"isolatedDeclarationsPlugin");export{fe as isolatedDeclarationsPlugin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@visulima/packem-rollup",
3
- "version": "1.0.0-alpha.28",
3
+ "version": "1.0.0-alpha.29",
4
4
  "description": "Rollup plugins for packem",
5
5
  "keywords": [
6
6
  "visulima",
@@ -160,7 +160,7 @@
160
160
  "magic-string": "0.30.19",
161
161
  "mlly": "1.8.0",
162
162
  "oxc-parser": "0.99.0",
163
- "oxc-resolver": "11.8.2",
163
+ "oxc-resolver": "11.14.0",
164
164
  "rollup-plugin-dts": "6.2.3",
165
165
  "rollup-plugin-license": "3.6.0",
166
166
  "rollup-plugin-polyfill-node": "0.13.0",