@visulima/package 3.4.2 → 3.4.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 +12 -0
- package/LICENSE.md +1 -1
- package/dist/error.cjs +9 -1
- package/dist/error.mjs +1 -1
- package/dist/index.cjs +33 -1
- package/dist/index.mjs +5 -1
- package/dist/monorepo.cjs +103 -1
- package/dist/monorepo.mjs +98 -1
- package/dist/package-json.cjs +430 -1
- package/dist/package-json.mjs +413 -1
- package/dist/package-manager.cjs +176 -9
- package/dist/package-manager.mjs +166 -9
- package/dist/package.cjs +67 -1
- package/dist/package.mjs +62 -1
- package/dist/packem_shared/PackageNotFoundError-BQIw1KE1.mjs +51 -0
- package/dist/packem_shared/PackageNotFoundError-CK1uhGFr.cjs +53 -0
- package/package.json +14 -14
- package/dist/packem_shared/PackageNotFoundError-4CX3Vfcu.mjs +0 -1
- package/dist/packem_shared/PackageNotFoundError-CY57YCot.cjs +0 -1
package/dist/package-manager.mjs
CHANGED
|
@@ -1,13 +1,170 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
3
|
+
import { findUp, findUpSync } from '@visulima/fs';
|
|
4
|
+
import { NotFoundError } from '@visulima/fs/error';
|
|
5
|
+
import { join, dirname } from '@visulima/path';
|
|
6
|
+
import { parsePackageJson } from './package-json.mjs';
|
|
4
7
|
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
var __defProp = Object.defineProperty;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
10
|
+
const lockFileNames = ["yarn.lock", "package-lock.json", "pnpm-lock.yaml", "npm-shrinkwrap.json", "bun.lockb"];
|
|
11
|
+
const packageMangerFindUpMatcher = /* @__PURE__ */ __name((directory) => {
|
|
12
|
+
let lockFile;
|
|
13
|
+
lockFileNames.forEach((lockFileName) => {
|
|
14
|
+
if (!lockFile && existsSync(join(directory, lockFileName))) {
|
|
15
|
+
lockFile = join(directory, lockFileName);
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
if (lockFile) {
|
|
19
|
+
return lockFile;
|
|
20
|
+
}
|
|
21
|
+
const packageJsonFilePath = join(directory, "package.json");
|
|
22
|
+
if (existsSync(packageJsonFilePath)) {
|
|
23
|
+
const packageJson = parsePackageJson(readFileSync(packageJsonFilePath, "utf8"));
|
|
24
|
+
if (packageJson.packageManager !== undefined) {
|
|
25
|
+
return packageJsonFilePath;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return undefined;
|
|
29
|
+
}, "packageMangerFindUpMatcher");
|
|
30
|
+
const findPackageManagerOnFile = /* @__PURE__ */ __name((foundFile) => {
|
|
31
|
+
if (!foundFile) {
|
|
32
|
+
throw new NotFoundError("Could not find a package manager");
|
|
33
|
+
}
|
|
34
|
+
if (foundFile.endsWith("package.json")) {
|
|
35
|
+
const packageJson = parsePackageJson(foundFile);
|
|
36
|
+
if (packageJson.packageManager) {
|
|
37
|
+
const packageManagerNames = ["npm", "yarn", "pnpm", "bun"];
|
|
38
|
+
const foundPackageManager = packageManagerNames.find((prefix) => packageJson.packageManager.startsWith(prefix));
|
|
39
|
+
if (foundPackageManager) {
|
|
40
|
+
return {
|
|
41
|
+
packageManager: foundPackageManager,
|
|
42
|
+
path: dirname(foundFile)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
if (foundFile.endsWith("yarn.lock")) {
|
|
48
|
+
return {
|
|
49
|
+
packageManager: "yarn",
|
|
50
|
+
path: dirname(foundFile)
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
if (foundFile.endsWith("package-lock.json") || foundFile.endsWith("npm-shrinkwrap.json")) {
|
|
54
|
+
return {
|
|
55
|
+
packageManager: "npm",
|
|
56
|
+
path: dirname(foundFile)
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (foundFile.endsWith("pnpm-lock.yaml")) {
|
|
60
|
+
return {
|
|
61
|
+
packageManager: "pnpm",
|
|
62
|
+
path: dirname(foundFile)
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
if (foundFile.endsWith("bun.lockb")) {
|
|
66
|
+
return {
|
|
67
|
+
packageManager: "bun",
|
|
68
|
+
path: dirname(foundFile)
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
throw new NotFoundError("Could not find a package manager");
|
|
72
|
+
}, "findPackageManagerOnFile");
|
|
73
|
+
const findLockFile = /* @__PURE__ */ __name(async (cwd) => {
|
|
74
|
+
const filePath = await findUp(lockFileNames, {
|
|
75
|
+
type: "file",
|
|
76
|
+
...cwd && { cwd }
|
|
77
|
+
});
|
|
78
|
+
if (!filePath) {
|
|
79
|
+
throw new Error("Could not find lock file");
|
|
80
|
+
}
|
|
81
|
+
return filePath;
|
|
82
|
+
}, "findLockFile");
|
|
83
|
+
const findLockFileSync = /* @__PURE__ */ __name((cwd) => {
|
|
84
|
+
const filePath = findUpSync(lockFileNames, {
|
|
85
|
+
type: "file",
|
|
86
|
+
...cwd && { cwd }
|
|
87
|
+
});
|
|
88
|
+
if (!filePath) {
|
|
89
|
+
throw new Error("Could not find lock file");
|
|
90
|
+
}
|
|
91
|
+
return filePath;
|
|
92
|
+
}, "findLockFileSync");
|
|
93
|
+
const findPackageManager = /* @__PURE__ */ __name(async (cwd) => {
|
|
94
|
+
const foundFile = await findUp(packageMangerFindUpMatcher, {
|
|
95
|
+
...cwd && { cwd }
|
|
96
|
+
});
|
|
97
|
+
return findPackageManagerOnFile(foundFile);
|
|
98
|
+
}, "findPackageManager");
|
|
99
|
+
const findPackageManagerSync = /* @__PURE__ */ __name((cwd) => {
|
|
100
|
+
const foundFile = findUpSync(packageMangerFindUpMatcher, {
|
|
101
|
+
...cwd && { cwd }
|
|
102
|
+
});
|
|
103
|
+
return findPackageManagerOnFile(foundFile);
|
|
104
|
+
}, "findPackageManagerSync");
|
|
105
|
+
const getPackageManagerVersion = /* @__PURE__ */ __name((name) => execSync(`${name} --version`).toString("utf8").trim(), "getPackageManagerVersion");
|
|
106
|
+
const identifyInitiatingPackageManager = /* @__PURE__ */ __name(async () => {
|
|
107
|
+
if (!process.env.npm_config_user_agent) {
|
|
108
|
+
return undefined;
|
|
109
|
+
}
|
|
110
|
+
const pmSpec = process.env.npm_config_user_agent.split(" ")[0];
|
|
111
|
+
const separatorPos = pmSpec.lastIndexOf("/");
|
|
112
|
+
const name = pmSpec.slice(0, Math.max(0, separatorPos));
|
|
113
|
+
return {
|
|
114
|
+
name: name === "npminstall" ? "cnpm" : name,
|
|
115
|
+
version: pmSpec.slice(Math.max(0, separatorPos + 1))
|
|
116
|
+
};
|
|
117
|
+
}, "identifyInitiatingPackageManager");
|
|
118
|
+
const generateMissingPackagesInstallMessage = /* @__PURE__ */ __name((packageName, missingPackages, options) => {
|
|
119
|
+
const s = missingPackages.length === 1 ? "" : "s";
|
|
120
|
+
if (options.packageManagers === undefined) {
|
|
121
|
+
options.packageManagers = ["npm", "pnpm", "yarn"];
|
|
122
|
+
}
|
|
123
|
+
if (options.packageManagers.length === 0) {
|
|
124
|
+
throw new Error("No package managers provided, please provide at least one package manager");
|
|
125
|
+
}
|
|
126
|
+
if (missingPackages.length === 0) {
|
|
127
|
+
throw new Error("No missing packages provided, please provide at least one missing package");
|
|
128
|
+
}
|
|
129
|
+
let message = `
|
|
130
|
+
${options.preMessage ?? ""}
|
|
131
|
+
${packageName} could not find the following package${s}
|
|
7
132
|
|
|
8
|
-
|
|
9
|
-
`;const w=r(i=>i.split("@").includes("@")?i:`${i}@latest`,"atLatest"),y=e.packageManagers.map(i=>{const s=a.map(v=>w(v)).join(" ");switch(i){case"bun":return` bun add ${s} -D`;case"npm":return` npm install ${s} --save-dev`;case"pnpm":return` pnpm add ${s} -D`;case"yarn":return` yarn add ${s} --dev`;default:throw new Error("Unknown package manager")}});return c+=y.join(`
|
|
133
|
+
${missingPackages.join("\n ")}
|
|
10
134
|
|
|
11
|
-
|
|
135
|
+
To install the missing package${s}, please run the following command:
|
|
136
|
+
`;
|
|
137
|
+
const atLatest = /* @__PURE__ */ __name((name) => {
|
|
138
|
+
if (!name.split("@").includes("@")) {
|
|
139
|
+
return `${name}@latest`;
|
|
140
|
+
}
|
|
141
|
+
return name;
|
|
142
|
+
}, "atLatest");
|
|
143
|
+
const packageManagerCommands = options.packageManagers.map((packageManager) => {
|
|
144
|
+
const missingPackagesString = missingPackages.map((element) => atLatest(element)).join(" ");
|
|
145
|
+
switch (packageManager) {
|
|
146
|
+
case "bun": {
|
|
147
|
+
return ` bun add ${missingPackagesString} -D`;
|
|
148
|
+
}
|
|
149
|
+
case "npm": {
|
|
150
|
+
return ` npm install ${missingPackagesString} --save-dev`;
|
|
151
|
+
}
|
|
152
|
+
case "pnpm": {
|
|
153
|
+
return ` pnpm add ${missingPackagesString} -D`;
|
|
154
|
+
}
|
|
155
|
+
case "yarn": {
|
|
156
|
+
return ` yarn add ${missingPackagesString} --dev`;
|
|
157
|
+
}
|
|
158
|
+
default: {
|
|
159
|
+
throw new Error("Unknown package manager");
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
message += packageManagerCommands.join("\n\nor\n\n");
|
|
164
|
+
if (options.postMessage) {
|
|
165
|
+
message += options.postMessage;
|
|
166
|
+
}
|
|
167
|
+
return message;
|
|
168
|
+
}, "generateMissingPackagesInstallMessage");
|
|
12
169
|
|
|
13
|
-
|
|
170
|
+
export { findLockFile, findLockFileSync, findPackageManager, findPackageManagerSync, generateMissingPackagesInstallMessage, getPackageManagerVersion, identifyInitiatingPackageManager };
|
package/dist/package.cjs
CHANGED
|
@@ -1 +1,67 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
4
|
+
|
|
5
|
+
const node_fs = require('node:fs');
|
|
6
|
+
const fs = require('@visulima/fs');
|
|
7
|
+
const path = require('@visulima/path');
|
|
8
|
+
const packageManager = require('./package-manager.cjs');
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
12
|
+
const packageJsonMatcher = /* @__PURE__ */ __name((directory) => {
|
|
13
|
+
if (node_fs.existsSync(path.join(directory, "package.json"))) {
|
|
14
|
+
const packageJson = fs.readJsonSync(path.join(directory, "package.json"));
|
|
15
|
+
if (packageJson.name && packageJson.private !== true) {
|
|
16
|
+
return "package.json";
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
}, "packageJsonMatcher");
|
|
21
|
+
const findPackageRoot = /* @__PURE__ */ __name(async (cwd) => {
|
|
22
|
+
try {
|
|
23
|
+
const lockFile = await packageManager.findLockFile(cwd);
|
|
24
|
+
return path.dirname(lockFile);
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
const gitConfig = await fs.findUp(".git/config", {
|
|
28
|
+
...cwd && { cwd },
|
|
29
|
+
type: "file"
|
|
30
|
+
});
|
|
31
|
+
if (gitConfig) {
|
|
32
|
+
return path.dirname(path.dirname(gitConfig));
|
|
33
|
+
}
|
|
34
|
+
const filePath = await fs.findUp(packageJsonMatcher, {
|
|
35
|
+
...cwd && { cwd },
|
|
36
|
+
type: "file"
|
|
37
|
+
});
|
|
38
|
+
if (filePath) {
|
|
39
|
+
return path.dirname(filePath);
|
|
40
|
+
}
|
|
41
|
+
throw new Error("Could not find root directory");
|
|
42
|
+
}, "findPackageRoot");
|
|
43
|
+
const findPackageRootSync = /* @__PURE__ */ __name((cwd) => {
|
|
44
|
+
try {
|
|
45
|
+
const lockFile = packageManager.findLockFileSync(cwd);
|
|
46
|
+
return path.dirname(lockFile);
|
|
47
|
+
} catch {
|
|
48
|
+
}
|
|
49
|
+
const gitConfig = fs.findUpSync(".git/config", {
|
|
50
|
+
...cwd && { cwd },
|
|
51
|
+
type: "file"
|
|
52
|
+
});
|
|
53
|
+
if (gitConfig) {
|
|
54
|
+
return path.dirname(path.dirname(gitConfig));
|
|
55
|
+
}
|
|
56
|
+
const filePath = fs.findUpSync(packageJsonMatcher, {
|
|
57
|
+
...cwd && { cwd },
|
|
58
|
+
type: "file"
|
|
59
|
+
});
|
|
60
|
+
if (filePath) {
|
|
61
|
+
return path.dirname(filePath);
|
|
62
|
+
}
|
|
63
|
+
throw new Error("Could not find root directory");
|
|
64
|
+
}, "findPackageRootSync");
|
|
65
|
+
|
|
66
|
+
exports.findPackageRoot = findPackageRoot;
|
|
67
|
+
exports.findPackageRootSync = findPackageRootSync;
|
package/dist/package.mjs
CHANGED
|
@@ -1 +1,62 @@
|
|
|
1
|
-
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { findUp, findUpSync, readJsonSync } from '@visulima/fs';
|
|
3
|
+
import { dirname, join } from '@visulima/path';
|
|
4
|
+
import { findLockFile, findLockFileSync } from './package-manager.mjs';
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
const packageJsonMatcher = /* @__PURE__ */ __name((directory) => {
|
|
9
|
+
if (existsSync(join(directory, "package.json"))) {
|
|
10
|
+
const packageJson = readJsonSync(join(directory, "package.json"));
|
|
11
|
+
if (packageJson.name && packageJson.private !== true) {
|
|
12
|
+
return "package.json";
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}, "packageJsonMatcher");
|
|
17
|
+
const findPackageRoot = /* @__PURE__ */ __name(async (cwd) => {
|
|
18
|
+
try {
|
|
19
|
+
const lockFile = await findLockFile(cwd);
|
|
20
|
+
return dirname(lockFile);
|
|
21
|
+
} catch {
|
|
22
|
+
}
|
|
23
|
+
const gitConfig = await findUp(".git/config", {
|
|
24
|
+
...cwd && { cwd },
|
|
25
|
+
type: "file"
|
|
26
|
+
});
|
|
27
|
+
if (gitConfig) {
|
|
28
|
+
return dirname(dirname(gitConfig));
|
|
29
|
+
}
|
|
30
|
+
const filePath = await findUp(packageJsonMatcher, {
|
|
31
|
+
...cwd && { cwd },
|
|
32
|
+
type: "file"
|
|
33
|
+
});
|
|
34
|
+
if (filePath) {
|
|
35
|
+
return dirname(filePath);
|
|
36
|
+
}
|
|
37
|
+
throw new Error("Could not find root directory");
|
|
38
|
+
}, "findPackageRoot");
|
|
39
|
+
const findPackageRootSync = /* @__PURE__ */ __name((cwd) => {
|
|
40
|
+
try {
|
|
41
|
+
const lockFile = findLockFileSync(cwd);
|
|
42
|
+
return dirname(lockFile);
|
|
43
|
+
} catch {
|
|
44
|
+
}
|
|
45
|
+
const gitConfig = findUpSync(".git/config", {
|
|
46
|
+
...cwd && { cwd },
|
|
47
|
+
type: "file"
|
|
48
|
+
});
|
|
49
|
+
if (gitConfig) {
|
|
50
|
+
return dirname(dirname(gitConfig));
|
|
51
|
+
}
|
|
52
|
+
const filePath = findUpSync(packageJsonMatcher, {
|
|
53
|
+
...cwd && { cwd },
|
|
54
|
+
type: "file"
|
|
55
|
+
});
|
|
56
|
+
if (filePath) {
|
|
57
|
+
return dirname(filePath);
|
|
58
|
+
}
|
|
59
|
+
throw new Error("Could not find root directory");
|
|
60
|
+
}, "findPackageRootSync");
|
|
61
|
+
|
|
62
|
+
export { findPackageRoot, findPackageRootSync };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { findPackageManagerSync } from '../package-manager.mjs';
|
|
2
|
+
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
5
|
+
class PackageNotFoundError extends Error {
|
|
6
|
+
static {
|
|
7
|
+
__name(this, "PackageNotFoundError");
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @param {string} packageName - The name of the package that was not found.
|
|
11
|
+
* @param {string} packageManager - The package manager used to install the package.
|
|
12
|
+
*/
|
|
13
|
+
constructor(packageName, packageManager) {
|
|
14
|
+
if (typeof packageName === "string") {
|
|
15
|
+
packageName = [packageName];
|
|
16
|
+
}
|
|
17
|
+
if (packageName.length === 0) {
|
|
18
|
+
super("Package was not found.");
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
if (packageManager === undefined) {
|
|
22
|
+
try {
|
|
23
|
+
const foundManager = findPackageManagerSync();
|
|
24
|
+
packageManager = foundManager.packageManager;
|
|
25
|
+
} catch {
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (packageManager === undefined) {
|
|
29
|
+
packageManager = "npm";
|
|
30
|
+
}
|
|
31
|
+
super(`Package '${packageName.join(" ")}' was not found. Please install it using '${packageManager} install ${packageName.join(" ")}'`);
|
|
32
|
+
}
|
|
33
|
+
// eslint-disable-next-line class-methods-use-this
|
|
34
|
+
get code() {
|
|
35
|
+
return "PACKAGE_NOT_FOUND";
|
|
36
|
+
}
|
|
37
|
+
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
|
|
38
|
+
set code(_name) {
|
|
39
|
+
throw new Error("Cannot overwrite code PACKAGE_NOT_FOUND");
|
|
40
|
+
}
|
|
41
|
+
// eslint-disable-next-line class-methods-use-this
|
|
42
|
+
get name() {
|
|
43
|
+
return "PackageNotFoundError";
|
|
44
|
+
}
|
|
45
|
+
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
|
|
46
|
+
set name(_name) {
|
|
47
|
+
throw new Error("Cannot overwrite name of PackageNotFoundError");
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { PackageNotFoundError as default };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const packageManager = require('../package-manager.cjs');
|
|
4
|
+
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
+
class PackageNotFoundError extends Error {
|
|
8
|
+
static {
|
|
9
|
+
__name(this, "PackageNotFoundError");
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* @param {string} packageName - The name of the package that was not found.
|
|
13
|
+
* @param {string} packageManager - The package manager used to install the package.
|
|
14
|
+
*/
|
|
15
|
+
constructor(packageName, packageManager$1) {
|
|
16
|
+
if (typeof packageName === "string") {
|
|
17
|
+
packageName = [packageName];
|
|
18
|
+
}
|
|
19
|
+
if (packageName.length === 0) {
|
|
20
|
+
super("Package was not found.");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (packageManager$1 === undefined) {
|
|
24
|
+
try {
|
|
25
|
+
const foundManager = packageManager.findPackageManagerSync();
|
|
26
|
+
packageManager$1 = foundManager.packageManager;
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
if (packageManager$1 === undefined) {
|
|
31
|
+
packageManager$1 = "npm";
|
|
32
|
+
}
|
|
33
|
+
super(`Package '${packageName.join(" ")}' was not found. Please install it using '${packageManager$1} install ${packageName.join(" ")}'`);
|
|
34
|
+
}
|
|
35
|
+
// eslint-disable-next-line class-methods-use-this
|
|
36
|
+
get code() {
|
|
37
|
+
return "PACKAGE_NOT_FOUND";
|
|
38
|
+
}
|
|
39
|
+
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
|
|
40
|
+
set code(_name) {
|
|
41
|
+
throw new Error("Cannot overwrite code PACKAGE_NOT_FOUND");
|
|
42
|
+
}
|
|
43
|
+
// eslint-disable-next-line class-methods-use-this
|
|
44
|
+
get name() {
|
|
45
|
+
return "PackageNotFoundError";
|
|
46
|
+
}
|
|
47
|
+
// eslint-disable-next-line class-methods-use-this,@typescript-eslint/explicit-module-boundary-types
|
|
48
|
+
set name(_name) {
|
|
49
|
+
throw new Error("Cannot overwrite name of PackageNotFoundError");
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
module.exports = PackageNotFoundError;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@visulima/package",
|
|
3
|
-
"version": "3.4.
|
|
3
|
+
"version": "3.4.3",
|
|
4
4
|
"description": "One Package to rule them all, finds your root-dir, monorepo, or package manager.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"anolilab",
|
|
@@ -145,14 +145,14 @@
|
|
|
145
145
|
"LICENSE.md"
|
|
146
146
|
],
|
|
147
147
|
"dependencies": {
|
|
148
|
-
"@visulima/fs": "2.3.
|
|
149
|
-
"@visulima/path": "1.3.
|
|
148
|
+
"@visulima/fs": "2.3.6",
|
|
149
|
+
"@visulima/path": "1.3.2",
|
|
150
150
|
"normalize-package-data": "^7.0.0",
|
|
151
|
-
"@inquirer/confirm": "^5.1.
|
|
152
|
-
"@antfu/install-pkg": "^0.
|
|
151
|
+
"@inquirer/confirm": "^5.1.2",
|
|
152
|
+
"@antfu/install-pkg": "^1.0.0"
|
|
153
153
|
},
|
|
154
154
|
"devDependencies": {
|
|
155
|
-
"@inquirer/core": "^10.1.
|
|
155
|
+
"@inquirer/core": "^10.1.3",
|
|
156
156
|
"@inquirer/type": "^3.0.2",
|
|
157
157
|
"@anolilab/eslint-config": "^15.0.3",
|
|
158
158
|
"@anolilab/prettier-config": "^5.0.14",
|
|
@@ -160,19 +160,19 @@
|
|
|
160
160
|
"@anolilab/semantic-release-preset": "^9.0.3",
|
|
161
161
|
"@arethetypeswrong/cli": "^0.17.2",
|
|
162
162
|
"@babel/core": "^7.26.0",
|
|
163
|
-
"@pnpm/exe": "^9.15.
|
|
163
|
+
"@pnpm/exe": "^9.15.3",
|
|
164
164
|
"@rushstack/eslint-plugin-security": "^0.8.3",
|
|
165
165
|
"@total-typescript/ts-reset": "^0.6.1",
|
|
166
166
|
"@types/node": "18.19.15",
|
|
167
167
|
"@types/normalize-package-data": "^2.4.4",
|
|
168
|
-
"@visulima/packem": "1.
|
|
168
|
+
"@visulima/packem": "1.10.7",
|
|
169
169
|
"@vitest/coverage-v8": "^2.1.8",
|
|
170
170
|
"@vitest/ui": "^2.1.8",
|
|
171
|
-
"@yarnpkg/pnp": "4.0.
|
|
171
|
+
"@yarnpkg/pnp": "4.0.8",
|
|
172
172
|
"conventional-changelog-conventionalcommits": "8.0.0",
|
|
173
173
|
"cross-env": "^7.0.3",
|
|
174
174
|
"dot-prop": "^9.0.0",
|
|
175
|
-
"esbuild": "0.24.
|
|
175
|
+
"esbuild": "0.24.2",
|
|
176
176
|
"eslint": "8.57.0",
|
|
177
177
|
"eslint-plugin-deprecation": "^3.0.0",
|
|
178
178
|
"eslint-plugin-etc": "^2.0.3",
|
|
@@ -183,11 +183,11 @@
|
|
|
183
183
|
"execa": "^9.5.2",
|
|
184
184
|
"npm": "^11.0.0",
|
|
185
185
|
"prettier": "^3.4.2",
|
|
186
|
-
"rimraf": "
|
|
187
|
-
"semantic-release": "24.
|
|
186
|
+
"rimraf": "6.0.1",
|
|
187
|
+
"semantic-release": "24.2.1",
|
|
188
188
|
"tempy": "^3.1.0",
|
|
189
|
-
"type-fest": "^4.
|
|
190
|
-
"typescript": "5.
|
|
189
|
+
"type-fest": "^4.32.0",
|
|
190
|
+
"typescript": "5.7.3",
|
|
191
191
|
"vitest": "^2.1.8",
|
|
192
192
|
"yarn": "^1.22.22"
|
|
193
193
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var t=Object.defineProperty;var o=(a,e)=>t(a,"name",{value:e,configurable:!0});import{findPackageManagerSync as n}from"../package-manager.mjs";var c=Object.defineProperty,i=o((a,e)=>c(a,"name",{value:e,configurable:!0}),"t");class g extends Error{static{o(this,"u")}static{i(this,"PackageNotFoundError")}constructor(e,r){if(typeof e=="string"&&(e=[e]),e.length===0){super("Package was not found.");return}if(r===void 0)try{r=n().packageManager}catch{}r===void 0&&(r="npm"),super(`Package '${e.join(" ")}' was not found. Please install it using '${r} install ${e.join(" ")}'`)}get code(){return"PACKAGE_NOT_FOUND"}set code(e){throw new Error("Cannot overwrite code PACKAGE_NOT_FOUND")}get name(){return"PackageNotFoundError"}set name(e){throw new Error("Cannot overwrite name of PackageNotFoundError")}}export{g as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var o=Object.defineProperty;var t=(a,e)=>o(a,"name",{value:e,configurable:!0});const n=require("../package-manager.cjs");var c=Object.defineProperty,s=t((a,e)=>c(a,"name",{value:e,configurable:!0}),"t");class i extends Error{static{t(this,"u")}static{s(this,"PackageNotFoundError")}constructor(e,r){if(typeof e=="string"&&(e=[e]),e.length===0){super("Package was not found.");return}if(r===void 0)try{r=n.findPackageManagerSync().packageManager}catch{}r===void 0&&(r="npm"),super(`Package '${e.join(" ")}' was not found. Please install it using '${r} install ${e.join(" ")}'`)}get code(){return"PACKAGE_NOT_FOUND"}set code(e){throw new Error("Cannot overwrite code PACKAGE_NOT_FOUND")}get name(){return"PackageNotFoundError"}set name(e){throw new Error("Cannot overwrite name of PackageNotFoundError")}}module.exports=i;
|