@visulima/packem 2.0.0-alpha.89 → 2.0.0-alpha.90
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 +14 -0
- package/dist/builder/typedoc/index.d.ts +1 -1
- package/dist/cli/index.js +37 -37
- package/dist/config/index.d.ts +1 -1
- package/dist/config/preset/preact.d.ts +1 -1
- package/dist/config/preset/react.d.ts +1 -1
- package/dist/config/preset/solid.d.ts +1 -1
- package/dist/config/preset/svelte.d.ts +1 -1
- package/dist/config/preset/vue.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/packem_shared/default-mHB0zin0.js +1 -0
- package/dist/packem_shared/index-bcxmFLOh.js +249 -0
- package/dist/packem_shared/{oxcTransformPlugin-Dwvbw2jE-DgTjbGep.js → oxcTransformPlugin-Dwvbw2jE-BsmmBg7q.js} +1 -1
- package/dist/packem_shared/{types.d-ICL9GlqC.d.ts → types.d-BkLP91NJ.d.ts} +36 -1
- package/dist/rollup/plugins/oxc/oxc-transformer.js +1 -1
- package/package.json +4 -4
- package/dist/packem_shared/default-BKj8akkL.js +0 -1
- package/dist/packem_shared/index-BnalE1Ho.js +0 -245
|
@@ -174,4 +174,4 @@ ${ke(["gray"],"→")} ${i(e)}`),o(e)})})},"confirm"),Ub=typeof process.stdout<"u
|
|
|
174
174
|
- `)}`),this.name="PackageJsonValidationError"}}const gs=Ee((t,e,r=[])=>{const n=[];if(Ob(t,s=>{n.push(s)},e),e&&n.length>0){const s=n.filter(i=>!r.some(o=>o instanceof RegExp?o.test(i):o===i));if(s.length>0)throw new Kb(s)}return t},"normalizeInput"),Wb=Ee(async t=>await hs(t),"parseYamlFile"),qb=Ee(t=>ps(t),"parseYamlFileSync"),Vb=Ee(async t=>{const e=await Zi(t);return El.parse(e)},"parseJson5File"),Yb=Ee(t=>{const e=eo(t);return El.parse(e)},"parseJson5FileSync"),Ef=Ee(async(t,e)=>e?.yaml!==!1&&(t.endsWith(".yaml")||t.endsWith(".yml"))?Wb(t):e?.json5!==!1&&t.endsWith(".json5")?Vb(t):no(t),"parsePackageFile"),bf=Ee((t,e)=>e?.yaml!==!1&&(t.endsWith(".yaml")||t.endsWith(".yml"))?qb(t):e?.json5!==!1&&t.endsWith(".json5")?Yb(t):so(t),"parsePackageFileSync"),zb=Ee(async(t,e={})=>{const r={type:"file"};t&&(r.cwd=t);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");let s;for(const a of n)if(s=await pa(a,r),s)break;if(!s)throw new bc(`No such file or directory, for ${n.join(", ").replace(yf," or $1")} found.`);const i=e.cache&&typeof e.cache!="boolean"?e.cache:Df;if(e.cache&&i.has(s))return i.get(s);const o=await Ef(s,e);if(e.resolveCatalogs){const a=await cf(s);a&&ds(o,a)}gs(o,e.strict??!1,e.ignoreWarnings);const u={packageJson:o,path:s};return e.cache&&i.set(s,u),u},"findPackageJson");Ee((t,e={})=>{const r={type:"file"};t&&(r.cwd=t);const n=["package.json"];e.yaml!==!1&&n.push("package.yaml","package.yml"),e.json5!==!1&&n.push("package.json5");let s;for(const a of n)if(s=ga(a,r),s)break;if(!s)throw new bc(`No such file or directory, for ${n.join(", ").replace(yf," or $1")} found.`);const i=e.cache&&typeof e.cache!="boolean"?e.cache:Df;if(e.cache&&i.has(s))return i.get(s);const o=bf(s,e);if(e.resolveCatalogs){const a=lf(s);a&&ds(o,a)}gs(o,e.strict??!1,e.ignoreWarnings);const u={packageJson:o,path:s};return e.cache&&i.set(s,u),u},"findPackageJsonSync");Ee(async(t,e={})=>{const{cwd:r,...n}=e,s=V(r??process.cwd());await jy(Vt(s,"package.json"),t,n)},"writePackageJson");Ee((t,e={})=>{const{cwd:r,...n}=e,s=V(r??process.cwd());qy(Vt(s,"package.json"),t,n)},"writePackageJsonSync");const Y1=Ee((t,e)=>{const r=typeof t=="object"&&!Array.isArray(t);if(!r&&typeof t!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,s=!1,i;if(r)n=structuredClone(t);else if(ff(t)){i=t;const u=e?.cache&&typeof e.cache!="boolean"?e.cache:Mn;if(e?.cache&&u.has(i))return u.get(i);n=bf(i,e),s=!0}else n=Jt(t);if(e?.resolveCatalogs)if(s){const u=lf(t);u&&ds(n,u)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");gs(n,e?.strict??!1,e?.ignoreWarnings);const o=n;return s&&e?.cache&&(typeof e.cache=="boolean"?Mn:e.cache).set(i,o),o},"parsePackageJsonSync"),z1=Ee(async(t,e)=>{const r=typeof t=="object"&&!Array.isArray(t);if(!r&&typeof t!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let n,s=!1,i;if(r)n=structuredClone(t);else if(ff(t)){i=t;const u=e?.cache&&typeof e.cache!="boolean"?e.cache:Mn;if(e?.cache&&u.has(i))return u.get(i);n=await Ef(i,e),s=!0}else n=Jt(t);if(e?.resolveCatalogs)if(s){const u=await cf(t);u&&ds(n,u)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");gs(n,e?.strict??!1,e?.ignoreWarnings);const o=n;return s&&e?.cache&&(typeof e.cache=="boolean"?Mn:e.cache).set(i,o),o},"parsePackageJson");Ee((t,e,r)=>lt(t,e,r),"getPackageJsonProperty");Ee((t,e)=>Lt(t,e),"hasPackageJsonProperty");Ee((t,e,r)=>{const n=lt(t,"dependencies",{}),s=lt(t,"devDependencies",{}),i=lt(t,"peerDependencies",{}),o={...n,...s,...r?.peerDeps===!1?{}:i};for(const u of e)if(Lt(o,u))return!0;return!1},"hasPackageJsonAnyDependency");Ee(async(t,e,r="dependencies",n={})=>{const s=lt(t,"dependencies",{}),i=lt(t,"devDependencies",{}),o=lt(t,"peerDependencies",{}),u=[],a={deps:!0,devDeps:!0,peerDeps:!1,...n};for(const c of e)a.deps&&Lt(s,c)||a.devDeps&&Lt(i,c)||a.peerDeps&&Lt(o,c)||u.push(c);if(u.length!==0){if(process.env.CI||Ub&&!process.stdout.isTTY){const c=`Skipping package installation for [${e.join(", ")}] because the process is not interactive.`;if(n.throwOnWarn)throw new Error(c);n.logger?.warn?n.logger.warn(c):console.warn(c);return}if(typeof a.confirm?.message=="function"&&(a.confirm.message=a.confirm.message(u)),a.confirm?.message===void 0){const c=`${u.length===1?"Package is":"Packages are"} required for this config: ${u.join(", ")}. Do you want to install them?`;a.confirm===void 0?a.confirm={message:c}:a.confirm.message=c}await Gb(a.confirm)&&await Cf(u,{...a.installPackage,cwd:a.cwd?V(a.cwd):void 0,dev:r==="devDependencies"})}},"ensurePackages");var Xb=Object.defineProperty,Jb=(t,e)=>Xb(t,"name",{value:e,configurable:!0}),Qb=Object.defineProperty,bi=Jb((t,e)=>Qb(t,"name",{value:e,configurable:!0}),"c");const Zb=/^\0/,e1=bi((t,e)=>{if(typeof t=="boolean")return()=>t;if(Array.isArray(t)){const r=t.map(n=>n.includes("/")?n:`**/${n}`);return qu(r,void 0,{resolve:e})}return r=>!0},"buildSideEffectsPredicate"),X1=bi((t,e,r,n)=>{const{ignoreSideEffectsForRoot:s,...i}=t,o=new Map,u=new Of({...i,roots:[...i.roots??[],e],tsconfig:n?{configFile:n,references:"auto"}:void 0});return{name:"oxc-resolve",resolveId:{filter:{id:{exclude:Zb}},async handler(a,c,l){if(a.startsWith("\0"))return;const{isEntry:h}=l,d=h||!c?ee(a):ee(c),{error:D,path:b}=await u.async(d,a);if(D){r.debug(D,{context:[{basedir:e,extensions:i.extensions,id:b}]});return}let p=bi(m=>!0,"hasModuleSideEffects");try{const{packageJson:m,path:v}=await zb(ee(b),{cache:o}),$=ee(v);(!s||e!==$)&&(p=e1(m.sideEffects,$))}catch(m){const v=m instanceof Error?m.message:String(m);r.debug(v,{context:[{basedir:d,caller:"Resolver",error:m,extensions:i.extensions,id:b}]})}if(a.includes("?"))return{id:b,moduleSideEffects:p(b)};const g=await this.resolve(b,c,{skipSelf:!0,...l});if(g)return g.external?!1:g.id!==b?g:{id:b,meta:g.meta,moduleSideEffects:p(b)}},order:"post"}}},"oxcResolvePlugin"),L=Y(import.meta.url);new URL(".",import.meta.url).pathname;const{readFileSync:t1}=L("node:fs");let it=null;const B=[],Ir=()=>{let t=!1;return process.platform==="linux"&&(t=n1(),t===null&&(t=s1()),t===null&&(t=i1())),t},r1=t=>t.includes("libc.musl-")||t.includes("ld-musl-"),n1=()=>{try{return t1("/usr/bin/ldd","utf-8").includes("musl")}catch{return null}},s1=()=>{let t=null;return typeof process.report?.getReport=="function"&&(process.report.excludeNetwork=!0,t=process.report.getReport()),t?t.header&&t.header.glibcVersionRuntime?!1:!!(Array.isArray(t.sharedObjects)&&t.sharedObjects.some(r1)):null},i1=()=>{try{return L("child_process").execSync("ldd --version",{encoding:"utf8"}).includes("musl")}catch{return!1}};function o1(){if(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)try{return L(process.env.NAPI_RS_NATIVE_LIBRARY_PATH)}catch(t){B.push(t)}else if(process.platform==="android")if(process.arch==="arm64"){try{return L("./transform.android-arm64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-android-arm64"),e=L("@oxc-transform/binding-android-arm64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm"){try{return L("./transform.android-arm-eabi.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-android-arm-eabi"),e=L("@oxc-transform/binding-android-arm-eabi/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else B.push(new Error(`Unsupported architecture on Android ${process.arch}`));else if(process.platform==="win32")if(process.arch==="x64")if(process.config?.variables?.shlib_suffix==="dll.a"||process.config?.variables?.node_target_type==="shared_library"){try{return L("./transform.win32-x64-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-win32-x64-gnu"),e=L("@oxc-transform/binding-win32-x64-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else{try{return L("./transform.win32-x64-msvc.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-win32-x64-msvc"),e=L("@oxc-transform/binding-win32-x64-msvc/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="ia32"){try{return L("./transform.win32-ia32-msvc.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-win32-ia32-msvc"),e=L("@oxc-transform/binding-win32-ia32-msvc/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm64"){try{return L("./transform.win32-arm64-msvc.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-win32-arm64-msvc"),e=L("@oxc-transform/binding-win32-arm64-msvc/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else B.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));else if(process.platform==="darwin"){try{return L("./transform.darwin-universal.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-darwin-universal"),e=L("@oxc-transform/binding-darwin-universal/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}if(process.arch==="x64"){try{return L("./transform.darwin-x64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-darwin-x64"),e=L("@oxc-transform/binding-darwin-x64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm64"){try{return L("./transform.darwin-arm64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-darwin-arm64"),e=L("@oxc-transform/binding-darwin-arm64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else B.push(new Error(`Unsupported architecture on macOS: ${process.arch}`))}else if(process.platform==="freebsd")if(process.arch==="x64"){try{return L("./transform.freebsd-x64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-freebsd-x64"),e=L("@oxc-transform/binding-freebsd-x64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm64"){try{return L("./transform.freebsd-arm64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-freebsd-arm64"),e=L("@oxc-transform/binding-freebsd-arm64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else B.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));else if(process.platform==="linux")if(process.arch==="x64")if(Ir()){try{return L("./transform.linux-x64-musl.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-x64-musl"),e=L("@oxc-transform/binding-linux-x64-musl/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else{try{return L("./transform.linux-x64-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-x64-gnu"),e=L("@oxc-transform/binding-linux-x64-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm64")if(Ir()){try{return L("./transform.linux-arm64-musl.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-arm64-musl"),e=L("@oxc-transform/binding-linux-arm64-musl/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else{try{return L("./transform.linux-arm64-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-arm64-gnu"),e=L("@oxc-transform/binding-linux-arm64-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm")if(Ir()){try{return L("./transform.linux-arm-musleabihf.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-arm-musleabihf"),e=L("@oxc-transform/binding-linux-arm-musleabihf/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else{try{return L("./transform.linux-arm-gnueabihf.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-arm-gnueabihf"),e=L("@oxc-transform/binding-linux-arm-gnueabihf/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="loong64")if(Ir()){try{return L("./transform.linux-loong64-musl.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-loong64-musl"),e=L("@oxc-transform/binding-linux-loong64-musl/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else{try{return L("./transform.linux-loong64-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-loong64-gnu"),e=L("@oxc-transform/binding-linux-loong64-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="riscv64")if(Ir()){try{return L("./transform.linux-riscv64-musl.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-riscv64-musl"),e=L("@oxc-transform/binding-linux-riscv64-musl/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else{try{return L("./transform.linux-riscv64-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-riscv64-gnu"),e=L("@oxc-transform/binding-linux-riscv64-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="ppc64"){try{return L("./transform.linux-ppc64-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-ppc64-gnu"),e=L("@oxc-transform/binding-linux-ppc64-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="s390x"){try{return L("./transform.linux-s390x-gnu.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-linux-s390x-gnu"),e=L("@oxc-transform/binding-linux-s390x-gnu/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else B.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));else if(process.platform==="openharmony")if(process.arch==="arm64"){try{return L("./transform.openharmony-arm64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-openharmony-arm64"),e=L("@oxc-transform/binding-openharmony-arm64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="x64"){try{return L("./transform.openharmony-x64.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-openharmony-x64"),e=L("@oxc-transform/binding-openharmony-x64/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else if(process.arch==="arm"){try{return L("./transform.openharmony-arm.node")}catch(t){B.push(t)}try{const t=L("@oxc-transform/binding-openharmony-arm"),e=L("@oxc-transform/binding-openharmony-arm/package.json").version;if(e!=="0.133.0"&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK&&process.env.NAPI_RS_ENFORCE_VERSION_CHECK!=="0")throw new Error(`Native binding package version mismatch, expected 0.133.0 but got ${e}. You can reinstall dependencies to fix this issue.`);return t}catch(t){B.push(t)}}else B.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));else B.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`))}it=o1();if(!it||process.env.NAPI_RS_FORCE_WASI){let t=null,e=null;try{t=L("./transform.wasi.cjs"),it=t}catch(r){process.env.NAPI_RS_FORCE_WASI&&(e=r)}if(!it||process.env.NAPI_RS_FORCE_WASI)try{t=L("@oxc-transform/binding-wasm32-wasi"),it=t}catch(r){process.env.NAPI_RS_FORCE_WASI&&(e?e.cause=r:e=r,B.push(r))}if(process.env.NAPI_RS_FORCE_WASI==="error"&&!t){const r=new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");throw r.cause=e,r}}if(!it&&globalThis.process?.versions?.webcontainer)try{it=L("./webcontainer-fallback.cjs")}catch(t){B.push(t)}if(!it)throw B.length>0?new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.",{cause:B.reduce((t,e)=>(e.cause=t,e))}):new Error("Failed to load native binding");const{transform:u1}=it;var a1=Object.defineProperty,c1=(t,e)=>a1(t,"name",{value:e,configurable:!0}),l1=Object.defineProperty,f1=c1((t,e)=>l1(t,"name",{value:e,configurable:!0}),"s");const h1=f1(({exclude:t,include:e,...r})=>{const n=qu(e,t??Nf);return{name:"packem:oxc-transform",async transform(s,i){if(!n(i))return;const o=await u1(i,s,{...r,sourcemap:!0}),{code:u,errors:a,map:c}=o;if(a.length>0){const l=a.map(h=>typeof h=="string"?h:h.message??JSON.stringify(h));return this.error({message:[`
|
|
175
175
|
transform errors:`,...l].join(`
|
|
176
176
|
|
|
177
|
-
`),pluginCode:"ERR_TRANSFORM"})}return{code:u,map:c}}}},"oxcTransformPlugin");h1.NAME="oxc";export{Y1 as A,Rn as E,ll as L,w1 as M,eo as P,z1 as S,
|
|
177
|
+
`),pluginCode:"ERR_TRANSFORM"})}return{code:u,map:c}}}},"oxcTransformPlugin");h1.NAME="oxc";export{Y1 as A,Rn as E,ll as L,w1 as M,eo as P,z1 as S,hc as T,ot as a,Zi as b,$l as c,zE as d,vl as e,C1 as f,XE as g,bl as h,El as i,X1 as j,JE as k,ZE as l,eb as m,vi as n,YE as o,Ob as p,QE as r,ut as s,h1 as t,zb as v};
|
|
@@ -8,7 +8,7 @@ import { BuildContext, Environment, Runtime, Format, BuildHooks, Mode } from '@v
|
|
|
8
8
|
import { FileCache } from '@visulima/packem-share/utils';
|
|
9
9
|
import { StyleOptions } from '@visulima/rollup-plugin-css';
|
|
10
10
|
import { JitiOptions } from 'jiti';
|
|
11
|
-
import 'rollup';
|
|
11
|
+
import { RenderedChunk } from 'rollup';
|
|
12
12
|
import { TypeDocOptions } from 'typedoc';
|
|
13
13
|
type ExePlatform = "darwin" | "linux" | "win";
|
|
14
14
|
type ExeArch = "arm64" | "x64";
|
|
@@ -179,11 +179,39 @@ type BuildEntry = {
|
|
|
179
179
|
/** Runtime environment for this entry */
|
|
180
180
|
runtime?: Runtime;
|
|
181
181
|
};
|
|
182
|
+
/**
|
|
183
|
+
* A banner/footer value. Either a static string or a function receiving the
|
|
184
|
+
* rendered chunk and returning the text to prepend/append. Passed straight
|
|
185
|
+
* through to Rollup/Rolldown `output.banner` / `output.footer`, so both
|
|
186
|
+
* bundler backends honour it.
|
|
187
|
+
*/
|
|
188
|
+
type BannerFooterValue = string | ((chunk: RenderedChunk) => Promise<string> | string);
|
|
189
|
+
/**
|
|
190
|
+
* Banner/footer configuration. A bare string or function targets the JavaScript
|
|
191
|
+
* output only. Use the object form to target the JavaScript bundle (`js`) and/or
|
|
192
|
+
* the generated declaration files (`dts`) independently.
|
|
193
|
+
* @example
|
|
194
|
+
* ```ts
|
|
195
|
+
* banner: "/* @license MIT *\/", // js only
|
|
196
|
+
* banner: { js: "'use client';", dts: "// types" } // per output
|
|
197
|
+
* ```
|
|
198
|
+
*/
|
|
199
|
+
type BannerFooterOption = BannerFooterValue | {
|
|
200
|
+
dts?: BannerFooterValue;
|
|
201
|
+
js?: BannerFooterValue;
|
|
202
|
+
};
|
|
182
203
|
interface BuildOptions {
|
|
183
204
|
/** Path alias mappings for module resolution */
|
|
184
205
|
alias: Record<string, string>;
|
|
185
206
|
/** Whether to analyze bundle size and dependencies */
|
|
186
207
|
analyze?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* Text to prepend to the build output. Maps to Rollup/Rolldown
|
|
210
|
+
* `output.banner` and is applied to both the CommonJS and ESM bundles.
|
|
211
|
+
* A bare string/function targets the JS output; use `{ js, dts }` to also
|
|
212
|
+
* prepend a header to the generated declaration files.
|
|
213
|
+
*/
|
|
214
|
+
banner?: BannerFooterOption;
|
|
187
215
|
/** Browser targets for transpilation (e.g., ['chrome 58', 'firefox 57']) */
|
|
188
216
|
browserTargets?: string[];
|
|
189
217
|
/** Custom builder functions for different build types */
|
|
@@ -245,6 +273,13 @@ interface BuildOptions {
|
|
|
245
273
|
/** Whether to enable file caching for faster rebuilds */
|
|
246
274
|
fileCache?: boolean;
|
|
247
275
|
/**
|
|
276
|
+
* Text to append to the build output. Maps to Rollup/Rolldown
|
|
277
|
+
* `output.footer` and is applied to both the CommonJS and ESM bundles.
|
|
278
|
+
* A bare string/function targets the JS output; use `{ js, dts }` to also
|
|
279
|
+
* append text to the generated declaration files.
|
|
280
|
+
*/
|
|
281
|
+
footer?: BannerFooterOption;
|
|
282
|
+
/**
|
|
248
283
|
* Array of export keys to ignore during entry inference.
|
|
249
284
|
* Useful for excluding exports that only contain images or other non-JavaScript assets.
|
|
250
285
|
* @example ["images", "assets", "icons"]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"../../../packem_shared/oxcTransformPlugin-Dwvbw2jE-
|
|
1
|
+
import{t as e}from"../../../packem_shared/oxcTransformPlugin-Dwvbw2jE-BsmmBg7q.js";export{e as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/packem",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.90",
|
|
4
4
|
"description": "A fast and modern bundler for Node.js and TypeScript.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -175,8 +175,8 @@
|
|
|
175
175
|
"@rollup/pluginutils": "5.4.0",
|
|
176
176
|
"@visulima/cerebro": "3.0.0-alpha.25",
|
|
177
177
|
"@visulima/packem-share": "1.0.0-alpha.50",
|
|
178
|
-
"@visulima/rollup-plugin-css": "1.0.0-alpha.
|
|
179
|
-
"@visulima/rollup-plugin-dts": "1.0.0-alpha.
|
|
178
|
+
"@visulima/rollup-plugin-css": "1.0.0-alpha.54",
|
|
179
|
+
"@visulima/rollup-plugin-dts": "1.0.0-alpha.35",
|
|
180
180
|
"@visulima/tsconfig": "3.0.0-alpha.24",
|
|
181
181
|
"browserslist": "4.28.2",
|
|
182
182
|
"cjs-module-lexer": "2.2.0",
|
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
"@swc/core": ">=1.15.40",
|
|
203
203
|
"@tailwindcss/node": "4.3.0",
|
|
204
204
|
"@tailwindcss/oxide": "4.3.0",
|
|
205
|
-
"@visulima/packem-rollup": "1.0.0-alpha.
|
|
205
|
+
"@visulima/packem-rollup": "1.0.0-alpha.74",
|
|
206
206
|
"cssnano": ">=8.0.1",
|
|
207
207
|
"esbuild": ">=0.28.0",
|
|
208
208
|
"icss-utils": ">=5.1.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,t as a}from"./oxcTransformPlugin-Dwvbw2jE-DgTjbGep.js";export{s as oxcResolvePlugin,a as oxcTransformPlugin};
|