@visulima/package 3.5.1 → 3.5.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 +23 -0
- package/LICENSE.md +1 -1
- package/README.md +1 -0
- package/dist/error.cjs +1 -1
- package/dist/error.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/monorepo.mjs +2 -2
- package/dist/package-json.cjs +8 -8
- package/dist/package-json.d.cts +1 -1
- package/dist/package-json.d.mts +1 -1
- package/dist/package-json.d.ts +1 -1
- package/dist/package-json.mjs +8 -8
- package/dist/package-manager.cjs +4 -4
- package/dist/package-manager.mjs +4 -4
- package/dist/package.cjs +1 -1
- package/dist/package.mjs +3 -3
- package/dist/packem_shared/{PackageNotFoundError-BQIw1KE1.mjs → PackageNotFoundError-Ck8Sk4z9.mjs} +2 -2
- package/dist/packem_shared/{PackageNotFoundError-CK1uhGFr.cjs → PackageNotFoundError-g9G2-W3s.cjs} +2 -2
- package/dist/packem_shared/{package-json-B2CLbuXK.d.mts → package-json-DvaC9k-3.d.cts} +180 -146
- package/dist/packem_shared/{package-json-B2CLbuXK.d.cts → package-json-DvaC9k-3.d.mts} +180 -146
- package/dist/packem_shared/{package-json-B2CLbuXK.d.mjs → package-json-DvaC9k-3.d.ts} +180 -146
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,26 @@
|
|
|
1
|
+
## @visulima/package [3.5.3](https://github.com/visulima/visulima/compare/@visulima/package@3.5.2...@visulima/package@3.5.3) (2025-03-07)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
* updated @visulima/packem and other dev deps, for better bundling size ([e940581](https://github.com/visulima/visulima/commit/e9405812201594e54dd81d17ddb74177df5f3c24))
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Dependencies
|
|
9
|
+
|
|
10
|
+
* **@visulima/fs:** upgraded to 3.1.2
|
|
11
|
+
* **@visulima/path:** upgraded to 1.3.5
|
|
12
|
+
|
|
13
|
+
## @visulima/package [3.5.2](https://github.com/visulima/visulima/compare/@visulima/package@3.5.1...@visulima/package@3.5.2) (2025-03-03)
|
|
14
|
+
|
|
15
|
+
### Miscellaneous Chores
|
|
16
|
+
|
|
17
|
+
* updated dev dependencies ([487a976](https://github.com/visulima/visulima/commit/487a976932dc7c39edfc19ffd3968960ff338066))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Dependencies
|
|
21
|
+
|
|
22
|
+
* **@visulima/fs:** upgraded to 3.1.1
|
|
23
|
+
|
|
1
24
|
## @visulima/package [3.5.1](https://github.com/visulima/visulima/compare/@visulima/package@3.5.0...@visulima/package@3.5.1) (2025-01-29)
|
|
2
25
|
|
|
3
26
|
|
package/LICENSE.md
CHANGED
|
@@ -86,7 +86,7 @@ License: MIT
|
|
|
86
86
|
By: Simon Boudrias
|
|
87
87
|
Repository: https://github.com/SBoudrias/Inquirer.js.git
|
|
88
88
|
|
|
89
|
-
> Copyright (c)
|
|
89
|
+
> Copyright (c) 2025 Simon Boudrias
|
|
90
90
|
>
|
|
91
91
|
> Permission is hereby granted, free of charge, to any person
|
|
92
92
|
> obtaining a copy of this software and associated documentation
|
package/README.md
CHANGED
|
@@ -166,6 +166,7 @@ If you would like to help take a look at the [list of issues](https://github.com
|
|
|
166
166
|
The visulima package is open-sourced software licensed under the [MIT][license-url]
|
|
167
167
|
|
|
168
168
|
[typescript-image]: https://img.shields.io/badge/Typescript-294E80.svg?style=for-the-badge&logo=typescript
|
|
169
|
+
|
|
169
170
|
[typescript-url]: https://www.typescriptlang.org/ "TypeScript" "typescript"
|
|
170
171
|
[license-image]: https://img.shields.io/npm/l/@visulima/package?color=blueviolet&style=for-the-badge
|
|
171
172
|
[license-url]: LICENSE.md "license"
|
package/dist/error.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
4
|
|
|
5
|
-
const PackageNotFoundError = require('./packem_shared/PackageNotFoundError-
|
|
5
|
+
const PackageNotFoundError = require('./packem_shared/PackageNotFoundError-g9G2-W3s.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
package/dist/error.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-
|
|
1
|
+
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-Ck8Sk4z9.mjs';
|
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
4
|
|
|
5
|
-
const PackageNotFoundError = require('./packem_shared/PackageNotFoundError-
|
|
5
|
+
const PackageNotFoundError = require('./packem_shared/PackageNotFoundError-g9G2-W3s.cjs');
|
|
6
6
|
const monorepo = require('./monorepo.cjs');
|
|
7
7
|
const _package = require('./package.cjs');
|
|
8
8
|
const packageJson = require('./package-json.cjs');
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PackageNotFoundError } from './error.cjs';
|
|
2
2
|
export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync } from './monorepo.cjs';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.cjs';
|
|
4
|
-
export { E as EnsurePackagesOptions, F as FindPackageJsonCache, d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-
|
|
4
|
+
export { E as EnsurePackagesOptions, F as FindPackageJsonCache, d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-DvaC9k-3.cjs';
|
|
5
5
|
export { PackageManager, PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.cjs';
|
|
6
6
|
import '@visulima/fs';
|
|
7
7
|
import '@antfu/install-pkg';
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PackageNotFoundError } from './error.mjs';
|
|
2
2
|
export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync } from './monorepo.mjs';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.mjs';
|
|
4
|
-
export { E as EnsurePackagesOptions, F as FindPackageJsonCache, d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-
|
|
4
|
+
export { E as EnsurePackagesOptions, F as FindPackageJsonCache, d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-DvaC9k-3.mjs';
|
|
5
5
|
export { PackageManager, PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.mjs';
|
|
6
6
|
import '@visulima/fs';
|
|
7
7
|
import '@antfu/install-pkg';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { PackageNotFoundError } from './error.js';
|
|
2
2
|
export { RootMonorepo, Strategy, findMonorepoRoot, findMonorepoRootSync } from './monorepo.js';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.js';
|
|
4
|
-
export { E as EnsurePackagesOptions, F as FindPackageJsonCache, d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-
|
|
4
|
+
export { E as EnsurePackagesOptions, F as FindPackageJsonCache, d as NormalizedPackageJson, N as NormalizedReadResult, P as PackageJson, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-DvaC9k-3.js';
|
|
5
5
|
export { PackageManager, PackageManagerResult, findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager } from './package-manager.js';
|
|
6
6
|
import '@visulima/fs';
|
|
7
7
|
import '@antfu/install-pkg';
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-
|
|
1
|
+
export { default as PackageNotFoundError } from './packem_shared/PackageNotFoundError-Ck8Sk4z9.mjs';
|
|
2
2
|
export { findMonorepoRoot, findMonorepoRootSync } from './monorepo.mjs';
|
|
3
3
|
export { findPackageRoot, findPackageRootSync } from './package.mjs';
|
|
4
4
|
export { ensurePackages, findPackageJson, findPackageJsonSync, getPackageJsonProperty, hasPackageJsonAnyDependency, hasPackageJsonProperty, parsePackageJson, writePackageJson, writePackageJsonSync } from './package-json.mjs';
|
package/dist/monorepo.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { findUpSync, readJsonSync, findUp, readJson } from '@visulima/fs';
|
|
3
3
|
import { NotFoundError } from '@visulima/fs/error';
|
|
4
4
|
import { dirname, join } from '@visulima/path';
|
|
5
|
-
import {
|
|
5
|
+
import { findPackageManagerSync, findPackageManager } from './package-manager.mjs';
|
|
6
6
|
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
package/dist/package-json.cjs
CHANGED
|
@@ -161,7 +161,7 @@ function assertNotStringIndex(object, key) {
|
|
|
161
161
|
__name$1(assertNotStringIndex, "assertNotStringIndex");
|
|
162
162
|
function getProperty(object, path, value) {
|
|
163
163
|
if (!isObject(object) || typeof path !== "string") {
|
|
164
|
-
return value ===
|
|
164
|
+
return value === void 0 ? object : value;
|
|
165
165
|
}
|
|
166
166
|
const pathArray = getPathSegments(path);
|
|
167
167
|
if (pathArray.length === 0) {
|
|
@@ -170,18 +170,18 @@ function getProperty(object, path, value) {
|
|
|
170
170
|
for (let index = 0; index < pathArray.length; index++) {
|
|
171
171
|
const key = pathArray[index];
|
|
172
172
|
if (isStringIndex(object, key)) {
|
|
173
|
-
object = index === pathArray.length - 1 ?
|
|
173
|
+
object = index === pathArray.length - 1 ? void 0 : null;
|
|
174
174
|
} else {
|
|
175
175
|
object = object[key];
|
|
176
176
|
}
|
|
177
|
-
if (object ===
|
|
177
|
+
if (object === void 0 || object === null) {
|
|
178
178
|
if (index !== pathArray.length - 1) {
|
|
179
179
|
return value;
|
|
180
180
|
}
|
|
181
181
|
break;
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
|
-
return object ===
|
|
184
|
+
return object === void 0 ? value : object;
|
|
185
185
|
}
|
|
186
186
|
__name$1(getProperty, "getProperty");
|
|
187
187
|
function setProperty(object, path, value) {
|
|
@@ -284,7 +284,7 @@ function deepKeys(object) {
|
|
|
284
284
|
}
|
|
285
285
|
__name$1(deepKeys, "deepKeys");
|
|
286
286
|
|
|
287
|
-
const isNode = typeof process.stdout < "u" && !process.versions
|
|
287
|
+
const isNode = typeof process.stdout < "u" && !process.versions.deno && !globalThis.window;
|
|
288
288
|
|
|
289
289
|
var __defProp = Object.defineProperty;
|
|
290
290
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -432,9 +432,9 @@ const ensurePackages = /* @__PURE__ */ __name(async (packageJson, packages, inst
|
|
|
432
432
|
if (typeof config.confirm?.message === "function") {
|
|
433
433
|
config.confirm.message = config.confirm.message(nonExistingPackages);
|
|
434
434
|
}
|
|
435
|
-
if (config.confirm?.message ===
|
|
435
|
+
if (config.confirm?.message === void 0) {
|
|
436
436
|
const message = `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`;
|
|
437
|
-
if (config.confirm ===
|
|
437
|
+
if (config.confirm === void 0) {
|
|
438
438
|
config.confirm = {
|
|
439
439
|
message
|
|
440
440
|
};
|
|
@@ -448,7 +448,7 @@ const ensurePackages = /* @__PURE__ */ __name(async (packageJson, packages, inst
|
|
|
448
448
|
}
|
|
449
449
|
await installPkg.installPackage(nonExistingPackages, {
|
|
450
450
|
...config.installPackage,
|
|
451
|
-
cwd: config.cwd ? utils.toPath(config.cwd) :
|
|
451
|
+
cwd: config.cwd ? utils.toPath(config.cwd) : void 0,
|
|
452
452
|
dev: installKey === "devDependencies"
|
|
453
453
|
});
|
|
454
454
|
}, "ensurePackages");
|
package/dist/package-json.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FindPackageJsonCache, N as NormalizedReadResult, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-B2CLbuXK.cjs';
|
|
2
1
|
import '@visulima/fs';
|
|
2
|
+
export { F as FindPackageJsonCache, N as NormalizedReadResult, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-DvaC9k-3.cjs';
|
|
3
3
|
import '@antfu/install-pkg';
|
|
4
4
|
import 'normalize-package-data';
|
package/dist/package-json.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FindPackageJsonCache, N as NormalizedReadResult, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-B2CLbuXK.mjs';
|
|
2
1
|
import '@visulima/fs';
|
|
2
|
+
export { F as FindPackageJsonCache, N as NormalizedReadResult, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-DvaC9k-3.mjs';
|
|
3
3
|
import '@antfu/install-pkg';
|
|
4
4
|
import 'normalize-package-data';
|
package/dist/package-json.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { F as FindPackageJsonCache, N as NormalizedReadResult, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-B2CLbuXK.d.mjs';
|
|
2
1
|
import '@visulima/fs';
|
|
2
|
+
export { F as FindPackageJsonCache, N as NormalizedReadResult, e as ensurePackages, f as findPackageJson, a as findPackageJsonSync, g as getPackageJsonProperty, h as hasPackageJsonAnyDependency, b as hasPackageJsonProperty, p as parsePackageJson, w as writePackageJson, c as writePackageJsonSync } from './packem_shared/package-json-DvaC9k-3.js';
|
|
3
3
|
import '@antfu/install-pkg';
|
|
4
4
|
import 'normalize-package-data';
|
package/dist/package-json.mjs
CHANGED
|
@@ -152,7 +152,7 @@ function assertNotStringIndex(object, key) {
|
|
|
152
152
|
__name$1(assertNotStringIndex, "assertNotStringIndex");
|
|
153
153
|
function getProperty(object, path, value) {
|
|
154
154
|
if (!isObject(object) || typeof path !== "string") {
|
|
155
|
-
return value ===
|
|
155
|
+
return value === void 0 ? object : value;
|
|
156
156
|
}
|
|
157
157
|
const pathArray = getPathSegments(path);
|
|
158
158
|
if (pathArray.length === 0) {
|
|
@@ -161,18 +161,18 @@ function getProperty(object, path, value) {
|
|
|
161
161
|
for (let index = 0; index < pathArray.length; index++) {
|
|
162
162
|
const key = pathArray[index];
|
|
163
163
|
if (isStringIndex(object, key)) {
|
|
164
|
-
object = index === pathArray.length - 1 ?
|
|
164
|
+
object = index === pathArray.length - 1 ? void 0 : null;
|
|
165
165
|
} else {
|
|
166
166
|
object = object[key];
|
|
167
167
|
}
|
|
168
|
-
if (object ===
|
|
168
|
+
if (object === void 0 || object === null) {
|
|
169
169
|
if (index !== pathArray.length - 1) {
|
|
170
170
|
return value;
|
|
171
171
|
}
|
|
172
172
|
break;
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
|
-
return object ===
|
|
175
|
+
return object === void 0 ? value : object;
|
|
176
176
|
}
|
|
177
177
|
__name$1(getProperty, "getProperty");
|
|
178
178
|
function setProperty(object, path, value) {
|
|
@@ -275,7 +275,7 @@ function deepKeys(object) {
|
|
|
275
275
|
}
|
|
276
276
|
__name$1(deepKeys, "deepKeys");
|
|
277
277
|
|
|
278
|
-
const isNode = typeof process.stdout < "u" && !process.versions
|
|
278
|
+
const isNode = typeof process.stdout < "u" && !process.versions.deno && !globalThis.window;
|
|
279
279
|
|
|
280
280
|
var __defProp = Object.defineProperty;
|
|
281
281
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -423,9 +423,9 @@ const ensurePackages = /* @__PURE__ */ __name(async (packageJson, packages, inst
|
|
|
423
423
|
if (typeof config.confirm?.message === "function") {
|
|
424
424
|
config.confirm.message = config.confirm.message(nonExistingPackages);
|
|
425
425
|
}
|
|
426
|
-
if (config.confirm?.message ===
|
|
426
|
+
if (config.confirm?.message === void 0) {
|
|
427
427
|
const message = `${nonExistingPackages.length === 1 ? "Package is" : "Packages are"} required for this config: ${nonExistingPackages.join(", ")}. Do you want to install them?`;
|
|
428
|
-
if (config.confirm ===
|
|
428
|
+
if (config.confirm === void 0) {
|
|
429
429
|
config.confirm = {
|
|
430
430
|
message
|
|
431
431
|
};
|
|
@@ -439,7 +439,7 @@ const ensurePackages = /* @__PURE__ */ __name(async (packageJson, packages, inst
|
|
|
439
439
|
}
|
|
440
440
|
await installPackage(nonExistingPackages, {
|
|
441
441
|
...config.installPackage,
|
|
442
|
-
cwd: config.cwd ? toPath(config.cwd) :
|
|
442
|
+
cwd: config.cwd ? toPath(config.cwd) : void 0,
|
|
443
443
|
dev: installKey === "devDependencies"
|
|
444
444
|
});
|
|
445
445
|
}, "ensurePackages");
|
package/dist/package-manager.cjs
CHANGED
|
@@ -25,11 +25,11 @@ const packageMangerFindUpMatcher = /* @__PURE__ */ __name((directory) => {
|
|
|
25
25
|
const packageJsonFilePath = path.join(directory, "package.json");
|
|
26
26
|
if (node_fs.existsSync(packageJsonFilePath)) {
|
|
27
27
|
const packageJson$1 = packageJson.parsePackageJson(node_fs.readFileSync(packageJsonFilePath, "utf8"));
|
|
28
|
-
if (packageJson$1.packageManager !==
|
|
28
|
+
if (packageJson$1.packageManager !== void 0) {
|
|
29
29
|
return packageJsonFilePath;
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return void 0;
|
|
33
33
|
}, "packageMangerFindUpMatcher");
|
|
34
34
|
const findPackageManagerOnFile = /* @__PURE__ */ __name((foundFile) => {
|
|
35
35
|
if (!foundFile) {
|
|
@@ -109,7 +109,7 @@ const findPackageManagerSync = /* @__PURE__ */ __name((cwd) => {
|
|
|
109
109
|
const getPackageManagerVersion = /* @__PURE__ */ __name((name) => node_child_process.execSync(`${name} --version`).toString("utf8").trim(), "getPackageManagerVersion");
|
|
110
110
|
const identifyInitiatingPackageManager = /* @__PURE__ */ __name(async () => {
|
|
111
111
|
if (!process.env.npm_config_user_agent) {
|
|
112
|
-
return
|
|
112
|
+
return void 0;
|
|
113
113
|
}
|
|
114
114
|
const pmSpec = process.env.npm_config_user_agent.split(" ")[0];
|
|
115
115
|
const separatorPos = pmSpec.lastIndexOf("/");
|
|
@@ -121,7 +121,7 @@ const identifyInitiatingPackageManager = /* @__PURE__ */ __name(async () => {
|
|
|
121
121
|
}, "identifyInitiatingPackageManager");
|
|
122
122
|
const generateMissingPackagesInstallMessage = /* @__PURE__ */ __name((packageName, missingPackages, options) => {
|
|
123
123
|
const s = missingPackages.length === 1 ? "" : "s";
|
|
124
|
-
if (options.packageManagers ===
|
|
124
|
+
if (options.packageManagers === void 0) {
|
|
125
125
|
options.packageManagers = ["npm", "pnpm", "yarn"];
|
|
126
126
|
}
|
|
127
127
|
if (options.packageManagers.length === 0) {
|
package/dist/package-manager.mjs
CHANGED
|
@@ -21,11 +21,11 @@ const packageMangerFindUpMatcher = /* @__PURE__ */ __name((directory) => {
|
|
|
21
21
|
const packageJsonFilePath = join(directory, "package.json");
|
|
22
22
|
if (existsSync(packageJsonFilePath)) {
|
|
23
23
|
const packageJson = parsePackageJson(readFileSync(packageJsonFilePath, "utf8"));
|
|
24
|
-
if (packageJson.packageManager !==
|
|
24
|
+
if (packageJson.packageManager !== void 0) {
|
|
25
25
|
return packageJsonFilePath;
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
return
|
|
28
|
+
return void 0;
|
|
29
29
|
}, "packageMangerFindUpMatcher");
|
|
30
30
|
const findPackageManagerOnFile = /* @__PURE__ */ __name((foundFile) => {
|
|
31
31
|
if (!foundFile) {
|
|
@@ -105,7 +105,7 @@ const findPackageManagerSync = /* @__PURE__ */ __name((cwd) => {
|
|
|
105
105
|
const getPackageManagerVersion = /* @__PURE__ */ __name((name) => execSync(`${name} --version`).toString("utf8").trim(), "getPackageManagerVersion");
|
|
106
106
|
const identifyInitiatingPackageManager = /* @__PURE__ */ __name(async () => {
|
|
107
107
|
if (!process.env.npm_config_user_agent) {
|
|
108
|
-
return
|
|
108
|
+
return void 0;
|
|
109
109
|
}
|
|
110
110
|
const pmSpec = process.env.npm_config_user_agent.split(" ")[0];
|
|
111
111
|
const separatorPos = pmSpec.lastIndexOf("/");
|
|
@@ -117,7 +117,7 @@ const identifyInitiatingPackageManager = /* @__PURE__ */ __name(async () => {
|
|
|
117
117
|
}, "identifyInitiatingPackageManager");
|
|
118
118
|
const generateMissingPackagesInstallMessage = /* @__PURE__ */ __name((packageName, missingPackages, options) => {
|
|
119
119
|
const s = missingPackages.length === 1 ? "" : "s";
|
|
120
|
-
if (options.packageManagers ===
|
|
120
|
+
if (options.packageManagers === void 0) {
|
|
121
121
|
options.packageManagers = ["npm", "pnpm", "yarn"];
|
|
122
122
|
}
|
|
123
123
|
if (options.packageManagers.length === 0) {
|
package/dist/package.cjs
CHANGED
package/dist/package.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync } from 'node:fs';
|
|
2
|
-
import {
|
|
2
|
+
import { findUpSync, readJsonSync, findUp } from '@visulima/fs';
|
|
3
3
|
import { dirname, join } from '@visulima/path';
|
|
4
|
-
import {
|
|
4
|
+
import { findLockFileSync, findLockFile } from './package-manager.mjs';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -12,7 +12,7 @@ const packageJsonMatcher = /* @__PURE__ */ __name((directory) => {
|
|
|
12
12
|
return "package.json";
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return void 0;
|
|
16
16
|
}, "packageJsonMatcher");
|
|
17
17
|
const findPackageRoot = /* @__PURE__ */ __name(async (cwd) => {
|
|
18
18
|
try {
|
package/dist/packem_shared/{PackageNotFoundError-BQIw1KE1.mjs → PackageNotFoundError-Ck8Sk4z9.mjs}
RENAMED
|
@@ -18,14 +18,14 @@ class PackageNotFoundError extends Error {
|
|
|
18
18
|
super("Package was not found.");
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
|
-
if (packageManager ===
|
|
21
|
+
if (packageManager === void 0) {
|
|
22
22
|
try {
|
|
23
23
|
const foundManager = findPackageManagerSync();
|
|
24
24
|
packageManager = foundManager.packageManager;
|
|
25
25
|
} catch {
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
if (packageManager ===
|
|
28
|
+
if (packageManager === void 0) {
|
|
29
29
|
packageManager = "npm";
|
|
30
30
|
}
|
|
31
31
|
super(`Package '${packageName.join(" ")}' was not found. Please install it using '${packageManager} install ${packageName.join(" ")}'`);
|
package/dist/packem_shared/{PackageNotFoundError-CK1uhGFr.cjs → PackageNotFoundError-g9G2-W3s.cjs}
RENAMED
|
@@ -20,14 +20,14 @@ class PackageNotFoundError extends Error {
|
|
|
20
20
|
super("Package was not found.");
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
if (packageManager$1 ===
|
|
23
|
+
if (packageManager$1 === void 0) {
|
|
24
24
|
try {
|
|
25
25
|
const foundManager = packageManager.findPackageManagerSync();
|
|
26
26
|
packageManager$1 = foundManager.packageManager;
|
|
27
27
|
} catch {
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
if (packageManager$1 ===
|
|
30
|
+
if (packageManager$1 === void 0) {
|
|
31
31
|
packageManager$1 = "npm";
|
|
32
32
|
}
|
|
33
33
|
super(`Package '${packageName.join(" ")}' was not found. Please install it using '${packageManager$1} install ${packageName.join(" ")}'`);
|