@visulima/packem-share 1.0.0-alpha.47 → 1.0.0-alpha.48
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 +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/packem_shared/FileCache-CLJAB2z6.js +1 -0
- package/dist/packem_shared/getCacheHash-4niJCJ9M.js +1 -0
- package/dist/packem_shared/memoize-DCINm_no.js +1 -0
- package/dist/packem_shared/{warn.d-DEWZGYGb.d.ts → warn.d-CYg7fBg6.d.ts} +8 -3
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/FileCache-CCtIxlUG.js +0 -1
- package/dist/packem_shared/memoize-BS77chPw.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
## @visulima/packem-share [1.0.0-alpha.48](https://github.com/visulima/packem/compare/@visulima/packem-share@1.0.0-alpha.47...@visulima/packem-share@1.0.0-alpha.48) (2026-06-02)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* add duplicated package detector ([#203](https://github.com/visulima/packem/issues/203)) ([2b29466](https://github.com/visulima/packem/commit/2b29466bc7980477fe0e2a500feba2487dd7758a))
|
|
6
|
+
|
|
7
|
+
### Miscellaneous Chores
|
|
8
|
+
|
|
9
|
+
* **benchmarks:** port build-tool benchmark suite onto the 2.0 codebase ([#201](https://github.com/visulima/packem/issues/201)) ([8abdf09](https://github.com/visulima/packem/commit/8abdf0938bb7c5b2b7baabbb6d2698c73dba5d55))
|
|
10
|
+
|
|
1
11
|
## @visulima/packem-share [1.0.0-alpha.47](https://github.com/visulima/packem/compare/@visulima/packem-share@1.0.0-alpha.46...@visulima/packem-share@1.0.0-alpha.47) (2026-05-28)
|
|
2
12
|
|
|
3
13
|
### Features
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { ALLOWED_TRANSFORM_EXTENSIONS_REGEX, CHUNKS_PACKEM_FOLDER, DEFAULT_EXTENSIONS, DEFAULT_LOADERS, DEVELOPMENT_ENV, ENDING_REGEX, EXCLUDE_REGEXP, PRODUCTION_ENV, RUNTIME_EXPORT_CONVENTIONS, SHARED_PACKEM_FOLDER, SPECIAL_EXPORT_CONVENTIONS, VALID_EXPORT_EXTENSIONS } from "./constants/index.js";
|
|
2
2
|
export { BuildContext, BuildContextBuildAssetAndChunk, BuildContextBuildEntry, BuildHooks, Environment, Format, Mode, Runtime } from "./types/index.js";
|
|
3
|
-
export { F as FileCache, R as RollupLogger, a as arrayIncludes, b as arrayify, c as createRollupLogger, e as enhanceRollupError, g as
|
|
3
|
+
export { F as FileCache, M as Memoized, R as RollupLogger, a as arrayIncludes, b as arrayify, c as createRollupLogger, e as enhanceRollupError, g as getCacheHash, d as getChunkFilename, f as getDtsExtension, h as getEntryFileNames, i as getHash, j as getOutputExtension, k as getPackageName, l as getRegexMatches, m as isBareSpecifier, n as isFromNodeModules, o as isOutsideProject, p as memoize, q as memoizeByKey, r as parseSpecifier, s as replaceContentWithinMarker, t as sortUserPlugins, u as svgEncoder, v as svgToCssDataUri, w as svgToTinyDataUri, x as warn } from "./packem_shared/warn.d-CYg7fBg6.js";
|
|
4
4
|
import 'esbuild';
|
|
5
5
|
import '@visulima/package';
|
|
6
6
|
import '@visulima/pail';
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ALLOWED_TRANSFORM_EXTENSIONS_REGEX as
|
|
1
|
+
import{ALLOWED_TRANSFORM_EXTENSIONS_REGEX as t,CHUNKS_PACKEM_FOLDER as o,DEFAULT_EXTENSIONS as a,DEFAULT_LOADERS as E,DEVELOPMENT_ENV as f,ENDING_REGEX as s,EXCLUDE_REGEXP as m,PRODUCTION_ENV as p,RUNTIME_EXPORT_CONVENTIONS as l,SHARED_PACKEM_FOLDER as N,SPECIAL_EXPORT_CONVENTIONS as u,VALID_EXPORT_EXTENSIONS as x}from"./constants/index.js";import{default as O}from"./packem_shared/FileCache-CLJAB2z6.js";import{default as _}from"./packem_shared/arrayIncludes-Car4Lj1a.js";import{default as R}from"./packem_shared/arrayify-DIG_ZdB6.js";import{default as g}from"./packem_shared/enhanceRollupError-CNmnSy3y.js";import{default as S}from"./packem_shared/getCacheHash-4niJCJ9M.js";import{default as c}from"./packem_shared/getChunkFilename-O3C-FgIo.js";import{default as P}from"./packem_shared/getEntryFileNames-DF1zHqbH.js";import{default as A}from"./packem_shared/getHash-C4PDVNN_.js";import{default as F}from"./packem_shared/getPackageName-CwjDzCnN.js";import{default as h}from"./packem_shared/getRegexMatches-CIyZXB3k.js";import{default as y}from"./packem_shared/replaceContentWithinMarker-Caj_BLpr.js";import{default as G}from"./packem_shared/sortUserPlugins-BeSpxWa9.js";import{default as K}from"./packem_shared/svgEncoder-BHLRmBWl.js";import{default as v}from"./packem_shared/warn-B6AJDQdJ.js";import{createRollupLogger as B}from"./packem_shared/createRollupLogger-DyOYcur8.js";import{getDtsExtension as j,getOutputExtension as w}from"./packem_shared/getOutputExtension-xbQeHdwM.js";import{isBareSpecifier as q,isFromNodeModules as J,isOutsideProject as Q,parseSpecifier as Y}from"./packem_shared/parseSpecifier-BHrCHJCo.js";import{memoize as $,memoizeByKey as ee}from"./packem_shared/memoize-DCINm_no.js";import{svgToCssDataUri as te,svgToTinyDataUri as oe}from"./packem_shared/svgToTinyDataUri-k5AhPAh0.js";export{t as ALLOWED_TRANSFORM_EXTENSIONS_REGEX,o as CHUNKS_PACKEM_FOLDER,a as DEFAULT_EXTENSIONS,E as DEFAULT_LOADERS,f as DEVELOPMENT_ENV,s as ENDING_REGEX,m as EXCLUDE_REGEXP,O as FileCache,p as PRODUCTION_ENV,l as RUNTIME_EXPORT_CONVENTIONS,N as SHARED_PACKEM_FOLDER,u as SPECIAL_EXPORT_CONVENTIONS,x as VALID_EXPORT_EXTENSIONS,_ as arrayIncludes,R as arrayify,B as createRollupLogger,g as enhanceRollupError,S as getCacheHash,c as getChunkFilename,j as getDtsExtension,P as getEntryFileNames,A as getHash,w as getOutputExtension,F as getPackageName,h as getRegexMatches,q as isBareSpecifier,J as isFromNodeModules,Q as isOutsideProject,$ as memoize,ee as memoizeByKey,Y as parseSpecifier,y as replaceContentWithinMarker,G as sortUserPlugins,K as svgEncoder,te as svgToCssDataUri,oe as svgToTinyDataUri,v as warn};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var z=Object.defineProperty;var o=(a,e)=>z(a,"name",{value:e,configurable:!0});import{isAccessibleSync as P,readFileSync as A,writeFile as N}from"@visulima/fs";import{toNamespacedPath as F,join as V}from"@visulima/path";import E from"safe-stable-stringify";var J=Object.defineProperty,S=o(a=>{throw TypeError(a)},"k"),g=o((a,e)=>J(a,"name",{value:e,configurable:!0}),"d"),W=o((a,e,t)=>e.has(a)||S("Cannot "+t),"V"),s=o((a,e,t)=>(W(a,e,"read from private field"),t?t.call(a):e.get(a)),"r"),f=o((a,e,t)=>e.has(a)?S("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(a):e.set(a,t),"f"),y=o((a,e,t,r)=>(W(a,e,"write to private field"),e.set(a,t),t),"g");const M=g(a=>{try{return{ok:!0,value:JSON.parse(a)}}catch{return{ok:!1}}},"tryParseJson"),b=Symbol("packem.lazyCacheValue"),O=g(a=>({[b]:a}),"lazyCacheValue"),x=g(a=>typeof a=="object"&&a!==null&&b in a,"isLazyCacheValue");var m,l,v,c,h,p,d;const j=(d=class{constructor(e,t,r,i){f(this,m),f(this,l),f(this,v),f(this,c,!0),f(this,h,new Map),f(this,p,new Set),y(this,m,F(e)),y(this,v,r),t===void 0?i.debug({message:"Could not create cache directory."}):(y(this,l,t),i.debug({message:`Cache path is: ${s(this,l)}`}))}set isEnabled(e){y(this,c,e)}get isEnabled(){return s(this,c)}has(e,t){if(!s(this,c)||s(this,l)===void 0)return!1;const r=this.getFilePath(e,t);return s(this,h).has(r)?!0:P(r)}get(e,t){if(!s(this,c)||s(this,l)===void 0)return;const r=this.getFilePath(e,t);if(s(this,h).has(r)){const u=s(this,h).get(r);if(x(u)){const w=u[b],k=M(w),C=k.ok?k.value:w;return s(this,h).set(r,C),C}return u}if(!P(r))return;const i=A(r),n=M(i);return n.ok?(s(this,h).set(r,n.value),n.value):(s(this,h).set(r,i),i)}set(e,t,r){if(!s(this,c)||s(this,l)===void 0||t===void 0)return;const i=this.getFilePath(e,r);let n=t;if(typeof t=="object"||typeof t=="number"||typeof t=="boolean")try{n=JSON.stringify(t)}catch{n=E(t)}typeof n=="string"?s(this,h).set(i,O(n)):s(this,h).set(i,t);const u=N(i,n,{overwrite:!0}).catch(()=>{}).finally(()=>{s(this,p).delete(u)});s(this,p).add(u)}async flush(){for(;s(this,p).size>0;)await Promise.all(s(this,p))}getFilePath(e,t){let r=e.replaceAll(s(this,m),"");return r=r.replaceAll(":","-"),V(s(this,l),s(this,v),t?.replaceAll(":","-")??"",F(r))}},o(d,"w"),d);m=new WeakMap,l=new WeakMap,v=new WeakMap,c=new WeakMap,h=new WeakMap,p=new WeakMap,g(j,"FileCache");let q=j;export{q as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t=Object.defineProperty;var r=(e,a)=>t(e,"name",{value:a,configurable:!0});import{createHash as s}from"node:crypto";var o=Object.defineProperty,u=r((e,a)=>o(e,"name",{value:a,configurable:!0}),"r");const d=u(e=>s("sha1").update(e).digest("base64url"),"getCacheHash");export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var f=Object.defineProperty;var y=(r,e)=>f(r,"name",{value:e,configurable:!0});import p from"safe-stable-stringify";var v=Object.defineProperty,n=y((r,e)=>v(r,"name",{value:e,configurable:!0}),"r");const z=n((r,e,t)=>{const i=t??new Map,u=n(o=>e?typeof e=="function"?e(...o):e:p({args:o})??JSON.stringify(o),"resolveKey"),m=n(((...o)=>{const a=u(o),c=i.get(a);if(c!==void 0)return c;const s=r(...o);return i.set(a,s),s}),"memoized");return m.destroy=()=>{i.clear()},m},"memoize"),l=n(r=>{const e=new Map;return t=>z(r,t,e)},"memoizeByKey");export{z as memoize,l as memoizeByKey};
|
|
@@ -47,8 +47,10 @@ declare class FileCache {
|
|
|
47
47
|
has(name: string, subDirectory?: string): boolean;
|
|
48
48
|
get<R>(name: string, subDirectory?: string): R | undefined;
|
|
49
49
|
set(name: string, data: ArrayBuffer | ArrayBufferView | boolean | number | object | string | null | undefined, subDirectory?: string): void;
|
|
50
|
+
flush(): Promise<void>;
|
|
50
51
|
private getFilePath;
|
|
51
52
|
}
|
|
53
|
+
declare const getCacheHash: (data: NodeJS.ArrayBufferView | string) => string;
|
|
52
54
|
declare const getChunkFilename: (chunk: PreRenderedChunk, extension: string) => string;
|
|
53
55
|
declare const getEntryFileNames: (chunkInfo: PreRenderedAsset, extension: string) => string;
|
|
54
56
|
interface FileExtensionOptions {
|
|
@@ -71,8 +73,11 @@ declare const isBareSpecifier: (id: string) => boolean;
|
|
|
71
73
|
declare const isFromNodeModules: (filePath: string, cwd?: string) => boolean;
|
|
72
74
|
declare const isOutsideProject: (filePath: string, cwd?: string) => boolean;
|
|
73
75
|
type CacheKeyResolver = string | ((...arguments_: any[]) => string);
|
|
74
|
-
|
|
75
|
-
|
|
76
|
+
type Memoized<T extends (...arguments_: any[]) => any> = T & {
|
|
77
|
+
destroy: () => void;
|
|
78
|
+
};
|
|
79
|
+
declare const memoize: <T extends (...arguments_: any[]) => any>(function_: T, cacheKey?: CacheKeyResolver, cacheArgument?: Map<string, ReturnType<T>>) => Memoized<T>;
|
|
80
|
+
declare const memoizeByKey: <T extends (...arguments_: any[]) => any>(function_: T) => (cacheKey?: CacheKeyResolver) => Memoized<T>;
|
|
76
81
|
declare const replaceContentWithinMarker: (content: string, marker: string, replacement: string) => string | undefined;
|
|
77
82
|
declare const sortUserPlugins: (plugins: {
|
|
78
83
|
enforce?: "pre" | "post";
|
|
@@ -86,4 +91,4 @@ interface WarningContext {
|
|
|
86
91
|
warnings: Set<string>;
|
|
87
92
|
}
|
|
88
93
|
declare const warn: (context: WarningContext, message: string) => void;
|
|
89
|
-
export { FileCache as F, RollupLogger as R, arrayIncludes as a, arrayify as b, createRollupLogger as c,
|
|
94
|
+
export { FileCache as F, Memoized as M, RollupLogger as R, arrayIncludes as a, arrayify as b, createRollupLogger as c, getChunkFilename as d, enhanceRollupError as e, getDtsExtension as f, getCacheHash as g, getEntryFileNames as h, getHash as i, getOutputExtension as j, getPackageName as k, getRegexMatches as l, isBareSpecifier as m, isFromNodeModules as n, isOutsideProject as o, memoize as p, memoizeByKey as q, parseSpecifier as r, replaceContentWithinMarker as s, sortUserPlugins as t, svgEncoder as u, svgToCssDataUri as v, svgToTinyDataUri as w, warn as x };
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FileCache, type R as RollupLogger, a as arrayIncludes, b as arrayify, c as createRollupLogger, e as enhanceRollupError, g as
|
|
1
|
+
export { F as FileCache, type M as Memoized, type R as RollupLogger, a as arrayIncludes, b as arrayify, c as createRollupLogger, e as enhanceRollupError, g as getCacheHash, d as getChunkFilename, f as getDtsExtension, h as getEntryFileNames, i as getHash, j as getOutputExtension, k as getPackageName, l as getRegexMatches, m as isBareSpecifier, n as isFromNodeModules, o as isOutsideProject, p as memoize, q as memoizeByKey, r as parseSpecifier, s as replaceContentWithinMarker, t as sortUserPlugins, u as svgEncoder, v as svgToCssDataUri, w as svgToTinyDataUri, x as warn } from "../packem_shared/warn.d-CYg7fBg6.js";
|
|
2
2
|
import 'rollup';
|
|
3
3
|
import "../types/index.js";
|
|
4
4
|
import '@visulima/package';
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{default as t}from"../packem_shared/arrayIncludes-Car4Lj1a.js";import{default as a}from"../packem_shared/arrayify-DIG_ZdB6.js";import{createRollupLogger as s}from"../packem_shared/createRollupLogger-DyOYcur8.js";import{default as p}from"../packem_shared/enhanceRollupError-CNmnSy3y.js";import{default as
|
|
1
|
+
import{default as t}from"../packem_shared/arrayIncludes-Car4Lj1a.js";import{default as a}from"../packem_shared/arrayify-DIG_ZdB6.js";import{createRollupLogger as s}from"../packem_shared/createRollupLogger-DyOYcur8.js";import{default as p}from"../packem_shared/enhanceRollupError-CNmnSy3y.js";import{default as u}from"../packem_shared/FileCache-CLJAB2z6.js";import{default as x}from"../packem_shared/getCacheHash-4niJCJ9M.js";import{default as n}from"../packem_shared/getChunkFilename-O3C-FgIo.js";import{default as c}from"../packem_shared/getEntryFileNames-DF1zHqbH.js";import{getDtsExtension as y,getOutputExtension as C}from"../packem_shared/getOutputExtension-xbQeHdwM.js";import{default as F}from"../packem_shared/getHash-C4PDVNN_.js";import{default as v}from"../packem_shared/getPackageName-CwjDzCnN.js";import{default as M}from"../packem_shared/getRegexMatches-CIyZXB3k.js";import{isBareSpecifier as P,isFromNodeModules as R,isOutsideProject as T,parseSpecifier as U}from"../packem_shared/parseSpecifier-BHrCHJCo.js";import{memoize as B,memoizeByKey as H}from"../packem_shared/memoize-DCINm_no.js";import{default as S}from"../packem_shared/replaceContentWithinMarker-Caj_BLpr.js";import{default as w}from"../packem_shared/sortUserPlugins-BeSpxWa9.js";import{svgToCssDataUri as K,svgToTinyDataUri as L}from"../packem_shared/svgToTinyDataUri-k5AhPAh0.js";import{default as b}from"../packem_shared/svgEncoder-BHLRmBWl.js";import{default as A}from"../packem_shared/warn-B6AJDQdJ.js";export{u as FileCache,t as arrayIncludes,a as arrayify,s as createRollupLogger,p as enhanceRollupError,x as getCacheHash,n as getChunkFilename,y as getDtsExtension,c as getEntryFileNames,F as getHash,C as getOutputExtension,v as getPackageName,M as getRegexMatches,P as isBareSpecifier,R as isFromNodeModules,T as isOutsideProject,B as memoize,H as memoizeByKey,U as parseSpecifier,S as replaceContentWithinMarker,w as sortUserPlugins,b as svgEncoder,K as svgToCssDataUri,L as svgToTinyDataUri,A as warn};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var k=Object.defineProperty;var n=(r,e)=>k(r,"name",{value:e,configurable:!0});import{isAccessibleSync as v,readFileSync as M,writeFileSync as P}from"@visulima/fs";import{toNamespacedPath as g,join as S}from"@visulima/path";import W from"safe-stable-stringify";var C=Object.defineProperty,b=n(r=>{throw TypeError(r)},"y"),w=n((r,e)=>C(r,"name",{value:e,configurable:!0}),"g"),y=n((r,e,t)=>e.has(r)||b("Cannot "+t),"m"),s=n((r,e,t)=>(y(r,e,"read from private field"),t?t.call(r):e.get(r)),"n"),p=n((r,e,t)=>e.has(r)?b("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),"a"),u=n((r,e,t,a)=>(y(r,e,"write to private field"),e.set(r,t),t),"f");const A=w(r=>{try{JSON.parse(r)}catch{return!1}return!0},"isJson");var d,h,f,o,l,c;const F=(c=class{constructor(e,t,a,i){p(this,d),p(this,h),p(this,f),p(this,o,!0),p(this,l,new Map),u(this,d,e),u(this,f,a),t===void 0?i.debug({message:"Could not create cache directory."}):(u(this,h,t),i.debug({message:`Cache path is: ${s(this,h)}`}))}set isEnabled(e){u(this,o,e)}get isEnabled(){return s(this,o)}has(e,t){return!s(this,o)||s(this,h)===void 0?!1:v(this.getFilePath(e,t))}get(e,t){if(!s(this,o)||s(this,h)===void 0)return;const a=this.getFilePath(e,t);if(s(this,l).has(a))return s(this,l).get(a);if(!v(a))return;const i=M(a);if(A(i)){const m=JSON.parse(i);return s(this,l).set(a,m),m}return s(this,l).set(a,i),i}set(e,t,a){if(!s(this,o)||s(this,h)===void 0||t===void 0)return;const i=this.getFilePath(e,a);(typeof t=="object"||typeof t=="number"||typeof t=="boolean")&&(t=W(t)),P(i,t,{overwrite:!0})}getFilePath(e,t){let a=e.replaceAll(g(s(this,d)),"");return a=a.replaceAll(":","-"),S(s(this,h),s(this,f),t?.replaceAll(":","-")??"",g(a))}},n(c,"p"),c);d=new WeakMap,h=new WeakMap,f=new WeakMap,o=new WeakMap,l=new WeakMap,w(F,"FileCache");let O=F;export{O as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var u=Object.defineProperty;var y=(r,e)=>u(r,"name",{value:e,configurable:!0});import f from"safe-stable-stringify";var p=Object.defineProperty,n=y((r,e)=>p(r,"name",{value:e,configurable:!0}),"r");const v=n((r,e,t)=>{const i=t??new Map,c=n(o=>e?typeof e=="function"?e(...o):e:f({args:o})??JSON.stringify(o),"resolveKey");return((...o)=>{const m=c(o),a=i.get(m);if(a!==void 0)return a;const s=r(...o);return i.set(m,s),s})},"memoize"),l=n(r=>{const e=new Map;return t=>v(r,t,e)},"memoizeByKey");export{v as memoize,l as memoizeByKey};
|