@visulima/package 4.1.2 → 4.1.3
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 +18 -1
- package/dist/package-json.js +2 -2
- package/dist/package.js +1 -1
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## @visulima/package [4.1.3](https://github.com/visulima/visulima/compare/@visulima/package@4.1.2...@visulima/package@4.1.3) (2025-11-05)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* update dependencies across multiple packages ([36a47f2](https://github.com/visulima/visulima/commit/36a47f26d65d25a7b4d8371186710e7d0ab61a2b))
|
|
6
|
+
* Upgraded `type-fest` to version `5.2.0` ([bd6cd53](https://github.com/visulima/visulima/commit/bd6cd5367ff102a7487372dc1ca7742a41c69ea9))
|
|
7
|
+
|
|
8
|
+
### Miscellaneous Chores
|
|
9
|
+
|
|
10
|
+
* update package dependencies and configurations ([7bfe7e7](https://github.com/visulima/visulima/commit/7bfe7e71869580900aab50efb064b4293994ed9a))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Dependencies
|
|
14
|
+
|
|
15
|
+
* **@visulima/fs:** upgraded to 4.0.3
|
|
16
|
+
* **@visulima/path:** upgraded to 2.0.2
|
|
17
|
+
|
|
1
18
|
## @visulima/package [4.1.2](https://github.com/visulima/visulima/compare/@visulima/package@4.1.1...@visulima/package@4.1.2) (2025-10-21)
|
|
2
19
|
|
|
3
20
|
### Bug Fixes
|
|
@@ -38,7 +55,7 @@
|
|
|
38
55
|
|
|
39
56
|
### Bug Fixes
|
|
40
57
|
|
|
41
|
-
* update @visulima/packem to 2.0.0-alpha.
|
|
58
|
+
* update @visulima/packem to 2.0.0-alpha.32 across multiple packages for improved compatibility ([27b346e](https://github.com/visulima/visulima/commit/27b346eaa1c0fb0e420d9a9824482028307f4249))
|
|
42
59
|
* update LICENSE.md and package.json dependencies ([cea0533](https://github.com/visulima/visulima/commit/cea0533dda1161c2280a823d2ecaefb814818535))
|
|
43
60
|
|
|
44
61
|
### Miscellaneous Chores
|
package/dist/package-json.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
var q=Object.defineProperty;var f=(e,n)=>q(e,"name",{value:n,configurable:!0});import{createRequire as
|
|
1
|
+
var q=Object.defineProperty;var f=(e,n)=>q(e,"name",{value:n,configurable:!0});import{createRequire as z}from"node:module";import{installPackage as V}from"@antfu/install-pkg";import G from"@inquirer/confirm";import{readJsonSync as U,readFileSync as X,findUp as H,findUpSync as L,writeJson as Q,writeJsonSync as Z,readJson as ee,readFile as ne}from"@visulima/fs";import{NotFoundError as J}from"@visulima/fs/error";import{parseJson as A,toPath as j}from"@visulima/fs/utils";import{readYamlSync as re,readYaml as te}from"@visulima/fs/yaml";import{join as S}from"@visulima/path";import N from"json5";import oe from"normalize-package-data";import{readPnpmCatalogsSync as I,resolveCatalogReferences as P,readPnpmCatalogs as T}from"./pnpm.js";const B=z(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,K=f(e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[n,t]=y.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return y.getBuiltinModule(e)}return B(e)},"__cjs_getBuiltinModule"),{existsSync:x}=K("node:fs");var se=Object.defineProperty,l=f((e,n)=>se(e,"name",{value:n,configurable:!0}),"f");const h=l(e=>{const n=typeof e;return e!==null&&(n==="object"||n==="function")},"isObject"),ae=l(e=>{if(!h(e))return!1;for(const n in e)if(Object.hasOwn(e,n))return!1;return!0},"isEmptyObject"),_=new Set(["__proto__","prototype","constructor"]),F=1e6,ie=l(e=>e>="0"&&e<="9","isDigit");function m(e){if(e==="0")return!0;if(/^[1-9]\d*$/.test(e)){const n=Number.parseInt(e,10);return n<=Number.MAX_SAFE_INTEGER&&n<=F}return!1}f(m,"p");l(m,"shouldCoerceToNumber");function b(e,n){return _.has(e)?!1:(e&&m(e)?n.push(Number.parseInt(e,10)):n.push(e),!0)}f(b,"y");l(b,"processSegment");function D(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);const n=[];let t="",r="start",o=!1,s=0;for(const a of e){if(s++,o){t+=a,o=!1;continue}if(a==="\\"){if(r==="index")throw new Error(`Invalid character '${a}' in an index at position ${s}`);if(r==="indexEnd")throw new Error(`Invalid character '${a}' after an index at position ${s}`);o=!0,r=r==="start"?"property":r;continue}switch(a){case".":{if(r==="index")throw new Error(`Invalid character '${a}' in an index at position ${s}`);if(r==="indexEnd"){r="property";break}if(!b(t,n))return[];t="",r="property";break}case"[":{if(r==="index")throw new Error(`Invalid character '${a}' in an index at position ${s}`);if(r==="indexEnd"){r="index";break}if(r==="property"||r==="start"){if((t||r==="property")&&!b(t,n))return[];t=""}r="index";break}case"]":{if(r==="index"){if(t==="")t=(n.pop()||"")+"[]",r="property";else{const i=Number.parseInt(t,10);!Number.isNaN(i)&&Number.isFinite(i)&&i>=0&&i<=Number.MAX_SAFE_INTEGER&&i<=F&&t===String(i)?n.push(i):n.push(t),t="",r="indexEnd"}break}if(r==="indexEnd")throw new Error(`Invalid character '${a}' after an index at position ${s}`);t+=a;break}default:{if(r==="index"&&!ie(a))throw new Error(`Invalid character '${a}' in an index at position ${s}`);if(r==="indexEnd")throw new Error(`Invalid character '${a}' after an index at position ${s}`);r==="start"&&(r="property"),t+=a}}}switch(o&&(t+="\\"),r){case"property":{if(!b(t,n))return[];break}case"index":throw new Error("Index was not closed");case"start":{n.push("");break}}return n}f(D,"parsePath");l(D,"parsePath");function w(e){if(typeof e=="string")return D(e);if(Array.isArray(e)){const n=[];for(const[t,r]of e.entries()){if(typeof r!="string"&&typeof r!="number")throw new TypeError(`Expected a string or number for path segment at index ${t}, got ${typeof r}`);if(typeof r=="number"&&!Number.isFinite(r))throw new TypeError(`Path segment at index ${t} must be a finite number, got ${r}`);if(_.has(r))return[];typeof r=="string"&&m(r)?n.push(Number.parseInt(r,10)):n.push(r)}return n}return[]}f(w,"d");l(w,"normalizePath");function d(e,n,t){if(!h(e)||typeof n!="string"&&!Array.isArray(n))return t===void 0?e:t;const r=w(n);if(r.length===0)return t;for(let o=0;o<r.length;o++){const s=r[o];if(e=e[s],e==null){if(o!==r.length-1)return t;break}}return e===void 0?t:e}f(d,"getProperty");l(d,"getProperty");function C(e,n,t){if(!h(e)||typeof n!="string"&&!Array.isArray(n))return e;const r=e,o=w(n);if(o.length===0)return e;for(let s=0;s<o.length;s++){const a=o[s];if(s===o.length-1)e[a]=t;else if(!h(e[a])){const i=typeof o[s+1]=="number";e[a]=i?[]:{}}e=e[a]}return r}f(C,"setProperty");l(C,"setProperty");function ce(e,n){if(!h(e)||typeof n!="string"&&!Array.isArray(n))return!1;const t=w(n);if(t.length===0)return!1;for(let r=0;r<t.length;r++){const o=t[r];if(r===t.length-1)return Object.hasOwn(e,o)?(delete e[o],!0):!1;if(e=e[o],!h(e))return!1}}f(ce,"deleteProperty");l(ce,"deleteProperty");function g(e,n){if(!h(e)||typeof n!="string"&&!Array.isArray(n))return!1;const t=w(n);if(t.length===0)return!1;for(const r of t){if(!h(e)||!(r in e))return!1;e=e[r]}return!0}f(g,"hasProperty");l(g,"hasProperty");function $(e){if(typeof e!="string")throw new TypeError(`Expected a string, got ${typeof e}`);return e.replaceAll(/[\\.[]/g,String.raw`\$&`)}f($,"escapePath");l($,"escapePath");function O(e){const n=Object.entries(e);return Array.isArray(e)?n.map(([t,r])=>[m(t)?Number.parseInt(t,10):t,r]):n}f(O,"m$1");l(O,"normalizeEntries");function W(e,n={}){if(!Array.isArray(e))throw new TypeError(`Expected an array, got ${typeof e}`);const{preferDotForIndices:t=!1}=n,r=[];for(const[o,s]of e.entries()){if(typeof s!="string"&&typeof s!="number")throw new TypeError(`Expected a string or number for path segment at index ${o}, got ${typeof s}`);if(typeof s=="number")if(!Number.isInteger(s)||s<0){const a=$(String(s));r.push(o===0?a:`.${a}`)}else t&&o>0?r.push(`.${s}`):r.push(`[${s}]`);else if(typeof s=="string")if(s==="")o===0||r.push(".");else if(m(s)){const a=Number.parseInt(s,10);t&&o>0?r.push(`.${a}`):r.push(`[${a}]`)}else{const a=$(s);r.push(o===0?a:`.${a}`)}}return r.join("")}f(W,"stringifyPath");l(W,"stringifyPath");function*v(e,n=[],t=new Set){if(!h(e)||ae(e)){n.length>0&&(yield W(n));return}if(!t.has(e)){t.add(e);for(const[r,o]of O(e))n.push(r),yield*v(o,n,t),n.pop();t.delete(e)}}f(v,"x");l(v,"deepKeysIterator");function fe(e){return[...v(e)]}f(fe,"deepKeys");l(fe,"deepKeys");function pe(e){const n={};if(!h(e))return n;for(const[t,r]of Object.entries(e))C(n,t,r);return n}f(pe,"unflatten");l(pe,"unflatten");const le=typeof process.stdout<"u"&&!process.versions.deno&&!globalThis.window;var ue=Object.defineProperty,p=f((e,n)=>ue(e,"name",{value:n,configurable:!0}),"l");const k=new Map,M=new Map;class he extends Error{static{f(this,"F")}static{p(this,"PackageJsonValidationError")}constructor(n){super(`The following warnings were encountered while normalizing package data:
|
|
2
2
|
- ${n.join(`
|
|
3
|
-
- `)}`),this.name="PackageJsonValidationError"}}const E=p((e,n,
|
|
3
|
+
- `)}`),this.name="PackageJsonValidationError"}}const E=p((e,n,t=[])=>{const r=[];if(oe(e,o=>{r.push(o)},n),n&&r.length>0){const o=r.filter(s=>!t.some(a=>a instanceof RegExp?a.test(s):a===s));if(o.length>0)throw new he(o)}return e},"normalizeInput"),de=p(async e=>await te(e),"parseYamlFile"),ge=p(e=>re(e),"parseYamlFileSync"),ye=p(async e=>{const n=await ne(e);return N.parse(n)},"parseJson5File"),me=p(e=>{const n=X(e);return N.parse(n)},"parseJson5FileSync"),R=p(async(e,n)=>n?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?de(e):n?.json5!==!1&&e.endsWith(".json5")?ye(e):ee(e),"parsePackageFile"),Y=p((e,n)=>n?.yaml!==!1&&(e.endsWith(".yaml")||e.endsWith(".yml"))?ge(e):n?.json5!==!1&&e.endsWith(".json5")?me(e):U(e),"parsePackageFileSync"),Ne=p(async(e,n={})=>{const t={type:"file"};e&&(t.cwd=e);const r=["package.json"];n.yaml!==!1&&r.push("package.yaml","package.yml"),n.json5!==!1&&r.push("package.json5");let o;for await(const c of r)if(o=await H(c,t),o)break;if(!o)throw new J(`No such file or directory, for ${r.join(", ").replace(/, ([^,]*)$/," or $1")} found.`);const s=n.cache&&typeof n.cache!="boolean"?n.cache:M;if(n.cache&&s.has(o))return s.get(o);const a=await R(o,n);if(n.resolveCatalogs){const c=await T(o);c&&P(a,c)}E(a,n.strict??!1,n.ignoreWarnings);const i={packageJson:a,path:o};return n.cache&&s.set(o,i),i},"findPackageJson"),Ie=p((e,n={})=>{const t={type:"file"};e&&(t.cwd=e);const r=["package.json"];n.yaml!==!1&&r.push("package.yaml","package.yml"),n.json5!==!1&&r.push("package.json5");let o;for(const c of r)if(o=L(c,t),o)break;if(!o)throw new J(`No such file or directory, for ${r.join(", ").replace(/, ([^,]*)$/," or $1")} found.`);const s=n.cache&&typeof n.cache!="boolean"?n.cache:M;if(n.cache&&s.has(o))return s.get(o);const a=Y(o,n);if(n.resolveCatalogs){const c=I(o);c&&P(a,c)}E(a,n.strict??!1,n.ignoreWarnings);const i={packageJson:a,path:o};return n.cache&&s.set(o,i),i},"findPackageJsonSync"),Te=p(async(e,n={})=>{const{cwd:t,...r}=n,o=j(n.cwd??process.cwd());await Q(S(o,"package.json"),e,r)},"writePackageJson"),_e=p((e,n={})=>{const{cwd:t,...r}=n,o=j(n.cwd??process.cwd());Z(S(o,"package.json"),e,r)},"writePackageJsonSync"),Fe=p((e,n)=>{const t=e!==null&&typeof e=="object"&&!Array.isArray(e);if(!t&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let r,o=!1,s;if(t)r=structuredClone(e);else if(x(e)){s=e;const i=n?.cache&&typeof n.cache!="boolean"?n.cache:k;if(n?.cache&&i.has(s))return i.get(s);r=Y(s,n),o=!0}else r=A(e);if(n?.resolveCatalogs)if(o){const i=I(e);i&&P(r,i)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");E(r,n?.strict??!1,n?.ignoreWarnings);const a=r;return o&&s&&n?.cache&&(n.cache&&typeof n.cache!="boolean"?n.cache:k).set(s,a),a},"parsePackageJsonSync"),De=p(async(e,n)=>{const t=e!==null&&typeof e=="object"&&!Array.isArray(e);if(!t&&typeof e!="string")throw new TypeError("`packageFile` should be either an `object` or a `string`.");let r,o=!1,s;if(t)r=structuredClone(e);else if(x(e)){s=e;const i=n?.cache&&typeof n.cache!="boolean"?n.cache:k;if(n?.cache&&i.has(s))return i.get(s);r=await R(s,n),o=!0}else r=A(e);if(n?.resolveCatalogs)if(o){const i=await T(e);i&&P(r,i)}else throw new Error("The 'resolveCatalogs' option can only be used on a file path.");E(r,n?.strict??!1,n?.ignoreWarnings);const a=r;return o&&s&&n?.cache&&(n.cache&&typeof n.cache!="boolean"?n.cache:k).set(s,a),a},"parsePackageJson"),Ce=p((e,n,t)=>d(e,n,t),"getPackageJsonProperty"),Oe=p((e,n)=>g(e,n),"hasPackageJsonProperty"),We=p((e,n,t)=>{const r=d(e,"dependencies",{}),o=d(e,"devDependencies",{}),s=d(e,"peerDependencies",{}),a={...r,...o,...t?.peerDeps===!1?{}:s};for(const i of n)if(g(a,i))return!0;return!1},"hasPackageJsonAnyDependency"),Me=p(async(e,n,t="dependencies",r={})=>{const o=d(e,"dependencies",{}),s=d(e,"devDependencies",{}),a=d(e,"peerDependencies",{}),i=[],c={deps:!0,devDeps:!0,peerDeps:!1,...r};for(const u of n)c.deps&&g(o,u)||c.devDeps&&g(s,u)||c.peerDeps&&g(a,u)||i.push(u);if(i.length!==0){if(process.env.CI||le&&!process.stdout?.isTTY){const u=`Skipping package installation for [${n.join(", ")}] because the process is not interactive.`;if(r.throwOnWarn)throw new Error(u);r.logger?.warn?r.logger.warn(u):console.warn(u);return}if(typeof c.confirm?.message=="function"&&(c.confirm.message=c.confirm.message(i)),c.confirm?.message===void 0){const u=`${i.length===1?"Package is":"Packages are"} required for this config: ${i.join(", ")}. Do you want to install them?`;c.confirm===void 0?c.confirm={message:u}:c.confirm.message=u}await G(c.confirm)&&await V(i,{...c.installPackage,cwd:c.cwd?j(c.cwd):void 0,dev:t==="devDependencies"})}},"ensurePackages");export{Me as ensurePackages,Ne as findPackageJson,Ie as findPackageJsonSync,Ce as getPackageJsonProperty,We as hasPackageJsonAnyDependency,Oe as hasPackageJsonProperty,De as parsePackageJson,Fe as parsePackageJsonSync,Te as writePackageJson,_e as writePackageJsonSync};
|
package/dist/package.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var u=Object.defineProperty;var c=(e,o)=>u(e,"name",{value:o,configurable:!0});import{createRequire as l}from"node:module";import{findUp as a,findUpSync as f,readJsonSync as _}from"@visulima/fs";import{dirname as r,join as d}from"@visulima/path";import{findLockFile as w,findLockFileSync as j}from"./package-manager.js";const g=l(import.meta.url),
|
|
1
|
+
var u=Object.defineProperty;var c=(e,o)=>u(e,"name",{value:o,configurable:!0});import{createRequire as l}from"node:module";import{findUp as a,findUpSync as f,readJsonSync as _}from"@visulima/fs";import{dirname as r,join as d}from"@visulima/path";import{findLockFile as w,findLockFileSync as j}from"./package-manager.js";const g=l(import.meta.url),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=c(e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[o,n]=i.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return i.getBuiltinModule(e)}return g(e)},"__cjs_getBuiltinModule"),{existsSync:m}=y("node:fs");var k=Object.defineProperty,s=c((e,o)=>k(e,"name",{value:o,configurable:!0}),"r");const p=s(e=>{if(m(d(e,"package.json"))){const o=_(d(e,"package.json"));if(o.name&&o.private!==!0)return"package.json"}},"packageJsonMatcher"),S=s(async e=>{try{const t=await w(e);return r(t)}catch{}const o=await a(".git/config",{...e&&{cwd:e},type:"file"});if(o)return r(r(o));const n=await a(p,{...e&&{cwd:e},type:"file"});if(n)return r(n);throw new Error("Could not find root directory")},"findPackageRoot"),q=s(e=>{try{const t=j(e);return r(t)}catch{}const o=f(".git/config",{...e&&{cwd:e},type:"file"});if(o)return r(r(o));const n=f(p,{...e&&{cwd:e},type:"file"});if(n)return r(n);throw new Error("Could not find root directory")},"findPackageRootSync");export{S as findPackageRoot,q as findPackageRootSync};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/package",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.3",
|
|
4
4
|
"description": "A comprehensive package management utility that helps you find root directories, monorepos, package managers, and parse package.json, package.yaml, and package.json5 files with advanced features like catalog resolution.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -98,15 +98,15 @@
|
|
|
98
98
|
"dependencies": {
|
|
99
99
|
"@antfu/install-pkg": "^1.1.0",
|
|
100
100
|
"@inquirer/confirm": "^5.1.19",
|
|
101
|
-
"@visulima/fs": "4.0.
|
|
102
|
-
"@visulima/path": "2.0.
|
|
101
|
+
"@visulima/fs": "4.0.3",
|
|
102
|
+
"@visulima/path": "2.0.2",
|
|
103
103
|
"json5": "^2.2.3",
|
|
104
104
|
"normalize-package-data": "^8.0.0",
|
|
105
|
-
"type-fest": "^5.
|
|
105
|
+
"type-fest": "^5.2.0",
|
|
106
106
|
"yaml": "^2.8.1"
|
|
107
107
|
},
|
|
108
108
|
"engines": {
|
|
109
|
-
"node": ">=20.19 <=
|
|
109
|
+
"node": ">=20.19 <=25.x"
|
|
110
110
|
},
|
|
111
111
|
"os": [
|
|
112
112
|
"darwin",
|