@visulima/packem 1.0.0-alpha.66 → 1.0.0-alpha.67
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 +6 -0
- package/dist/cli.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
## @visulima/packem [1.0.0-alpha.67](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.66...@visulima/packem@1.0.0-alpha.67) (2024-08-05)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* added more tests ([fe2c0a5](https://github.com/visulima/packem/commit/fe2c0a5212eba41c428bd49646b96eb9be83e32e))
|
|
6
|
+
|
|
1
7
|
## @visulima/packem [1.0.0-alpha.66](https://github.com/visulima/packem/compare/@visulima/packem@1.0.0-alpha.65...@visulima/packem@1.0.0-alpha.66) (2024-08-04)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
package/dist/cli.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import __cjs_mod__ from "node:module"; // -- packem CommonJS require shim --
|
|
|
5
5
|
const __filename = __cjs_url__.fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = __cjs_path__.dirname(__filename);
|
|
7
7
|
const require = __cjs_mod__.createRequire(import.meta.url);
|
|
8
|
-
const jo="@visulima/packem",ko="1.0.0-alpha.
|
|
8
|
+
const jo="@visulima/packem",ko="1.0.0-alpha.66",T=[...Yt.extensions,".cjs",".ts",".cts",".mts",".tsx",".jsx"],xo=["development","production"],Ke=["react-server","react-native","edge-light"];[...xo,...Ke];const Z=/node_modules/;var Eo=Object.defineProperty,G=d((e,t)=>Eo(e,"name",{value:t,configurable:!0}),"i$c");const de=/^#![^\n]*/,se=G(async e=>{await Ct(e,493).catch(()=>{})},"makeExecutable"),Oo=G((e,t=`#!/usr/bin/env node
|
|
9
9
|
`)=>({name:"packem:shebang",renderChunk:{handler(o,r,n){if(!r.isEntry||!r.facadeModuleId||o.startsWith("#")&&o[1]==="!")return null;if(e.includes(r.name)){const s=new _(o);return s.prepend(t),{code:s.toString(),map:n.sourcemap?s.generateMap({hires:!0}):void 0}}return null},order:"post"},async writeBundle(o,r){for(const[n,s]of Object.entries(r))if(s.type==="chunk"&&de.test(s.code)&&o.dir){const i=g(o.dir,n);await se(i)}}}),"shebangPlugin"),So=G(()=>({name:"packem:remove-shebang",renderChunk(e){return e.replace(de,"")}}),"removeShebangPlugin"),Do=G((e,t=`
|
|
10
10
|
`)=>{const o=de.exec(e);return o?o+t:""},"getShebang");var No=Object.defineProperty,_o=d((e,t)=>No(e,"name",{value:t,configurable:!0}),"p$4");const me=_o((e,t)=>{let o={};if(e.pkg.name&&(o[e.pkg.name]=e.options.rootDir),e.pkg.imports){const{imports:r}=e.pkg;for(const n in r){if(n.startsWith("#"))continue;const s=r[n];typeof s=="string"&&(o[n]=h(e.options.rootDir,s))}}return o={...o,...e.options.alias},e.options.rollup.alias&&(Array.isArray(e.options.rollup.alias.entries)?Object.assign(o,Object.fromEntries(e.options.rollup.alias.entries.map(r=>[r.find,r.replacement]))):Object.assign(o,e.options.rollup.alias.entries??e.options.rollup.alias)),e.logger.debug({message:"Resolved aliases: "+JSON.stringify(o),prefix:t}),o},"resolveAliases");var Po=Object.defineProperty,Co=d((e,t)=>Po(e,"name",{value:t,configurable:!0}),"o$3");const Mo=Co((e,t)=>{const o=He(t,{esmResolve:!0,interopDefault:!0});try{return o.resolve(e)}catch(r){if(r.code!=="MODULE_NOT_FOUND")throw new Error(`Error trying import ${e} from ${t}`,{cause:r});return e}},"tryResolve");var Io=Object.defineProperty,Fo=d((e,t)=>Io(e,"name",{value:t,configurable:!0}),"r$a");const J=Fo((e,t)=>{e.warnings.has(t)||e.warnings.add(t)},"warn");var Ro=Object.defineProperty,To=d((e,t)=>Ro(e,"name",{value:t,configurable:!0}),"u$9");const Ao=To(async e=>{const t=await Zt("jiti",{url:import.meta.url}),o=JSON.stringify({...e.options.stubOptions.jiti,alias:{...me(e,"jit"),...e.options.stubOptions.jiti.alias}},null,2);for(const r of e.options.entries){const n=g(e.options.rootDir,e.options.outDir,r.name),s=le(Mo(r.input,e.options.rootDir)||r.input),i=s.slice(0,Math.max(0,s.length-ce(s).length)),a=await ae(s),l=Do(a);e.options.emitCJS&&await B(`${n}.cjs`,l+[`const jiti = require(${JSON.stringify(t)})`,"",`const _jiti = jiti(null, ${o})`,"",`/** @type {import(${JSON.stringify(i)})} */`,`module.exports = _jiti(${JSON.stringify(s)})`].join(`
|
|
11
11
|
`));let c=[];try{c=await Qt(s,{extensions:T})}catch(u){J(e,`Cannot analyze ${s} for exports: ${u.toString()}`);return}const p=c.includes("default")||c.length===0;await B(`${n}.mjs`,l+[`import jiti from ${JSON.stringify(Kt(t).href)};`,"",`const _jiti = jiti(null, ${o})`,"",`/** @type {import(${JSON.stringify(s)})} */`,`const _module = await _jiti.import(${JSON.stringify(s)});`,p?`
|