pastoralist 0.0.2
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/LICENSE +21 -0
- package/README.md +39 -0
- package/dist/chunk-T637KLSH.mjs +23 -0
- package/dist/chunk-WXUCJGGF.mjs +130 -0
- package/dist/index.js +132 -0
- package/dist/index.mjs +3 -0
- package/dist/program.js +158 -0
- package/dist/program.mjs +10 -0
- package/dist/scripts.js +148 -0
- package/dist/scripts.mjs +15 -0
- package/dist/types.d.ts +47 -0
- package/dist/types.js +17 -0
- package/dist/types.mjs +0 -0
- package/package.json +61 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Jeff Wainwright
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Pastoralist (WIP)
|
|
2
|
+
|
|
3
|
+
A tool to watch over node module *overrides and resolutions ๐ ๐ฉ๐ฝโ๐พ
|
|
4
|
+
|
|
5
|
+
> *overrides: throughout this repository the key words "overrides" and "resolutions" are used interchangeably as the nomenclature between npm, pnpm, and yarn differs.
|
|
6
|
+
## Synopsis
|
|
7
|
+
|
|
8
|
+
While maintaining a secure `node_module` ecosystem, `package.json` overrides and resolutions assist in ensuring vulnerable dependencies are not installed.
|
|
9
|
+
|
|
10
|
+
Pastoralist manages node overrides and resolutions so you don't have to.
|
|
11
|
+
|
|
12
|
+
## How Pastoralist works
|
|
13
|
+
|
|
14
|
+
Pastoralist manages overrides and resolutions object by, first, creating a reviewable list of overrides and, second, removing unneeded overrides and resolutions items.
|
|
15
|
+
### Key notes
|
|
16
|
+
|
|
17
|
+
1. Pastoralist does **not** manage what is added to overrides and resolutions objects.
|
|
18
|
+
2. Pastoralist **does** manage a package that exists in the overrides object
|
|
19
|
+
- Pastoralist will remove overrides and resolutions if they become unneeded according to child `package.json`'s spec.
|
|
20
|
+
|
|
21
|
+
## Inistall
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm install pastoralist --save-dev
|
|
25
|
+
# pastoralist does not expect to be a dependency! It's a tool
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
Pastoralist is built to be used as a CLI program. Run and configure to your liking.
|
|
31
|
+
### Basic
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
pastoralist <...args to be added>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Advanced
|
|
38
|
+
|
|
39
|
+
Pastoralist can _and should be incorporated_ into your workflowโwhich every way is best for you and your team's developer experience! ๐
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
update
|
|
3
|
+
} from "./chunk-WXUCJGGF.mjs";
|
|
4
|
+
|
|
5
|
+
// src/program.ts
|
|
6
|
+
import { program } from "commander";
|
|
7
|
+
var version = "VERSION";
|
|
8
|
+
async function action(options = {}) {
|
|
9
|
+
try {
|
|
10
|
+
if (options == null ? void 0 : options.isTestingCLI)
|
|
11
|
+
console.info({ options });
|
|
12
|
+
update(options);
|
|
13
|
+
} catch (err) {
|
|
14
|
+
console.error(err);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
program.version(version).description("Pastoralist, a utility CLI to manage your dependency overrides").option("-p, --path <path>", "the path to the package.json file to manage").option("-d, --depPaths <depPaths>", "a path to dependency package.json files").option("-t, --isTestingCLI", "enables CLI testing, no scripts are run").parse(process.argv).action(action);
|
|
18
|
+
var program_default = program;
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
action,
|
|
22
|
+
program_default
|
|
23
|
+
};
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
21
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
22
|
+
}) : x)(function(x) {
|
|
23
|
+
if (typeof require !== "undefined")
|
|
24
|
+
return require.apply(this, arguments);
|
|
25
|
+
throw new Error('Dynamic require of "' + x + '" is not supported');
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// src/scripts.ts
|
|
29
|
+
import { resolve } from "path";
|
|
30
|
+
import { writeFile } from "fs";
|
|
31
|
+
import { sync } from "fast-glob";
|
|
32
|
+
import { compare } from "compare-versions";
|
|
33
|
+
function resolveJSON(path) {
|
|
34
|
+
const jsonPath = resolve(path);
|
|
35
|
+
return __require(jsonPath);
|
|
36
|
+
}
|
|
37
|
+
function resolveResolutions({
|
|
38
|
+
config: {
|
|
39
|
+
overrides: npmOverrides = {},
|
|
40
|
+
pnpm: { overrides: pnpmOverrides = {} } = {},
|
|
41
|
+
resolutions = {}
|
|
42
|
+
} = {},
|
|
43
|
+
options: { debug = false } = {}
|
|
44
|
+
}) {
|
|
45
|
+
const overridesItems = Object.keys(npmOverrides);
|
|
46
|
+
const hasOverrides = overridesItems.length > 0;
|
|
47
|
+
const hasComplexOverrides = hasOverrides && overridesItems.some((name) => typeof npmOverrides[name] === "object");
|
|
48
|
+
if (hasComplexOverrides && debug) {
|
|
49
|
+
console.warn("\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist only supports simple overrides! Pastoralist is bypassing the specified complex overrides. \u{1F44C}");
|
|
50
|
+
}
|
|
51
|
+
const overrides = hasOverrides ? overridesItems.filter((name) => typeof npmOverrides[name] === "string").reduce((acc, name) => __spreadProps(__spreadValues({}, acc), { [name]: npmOverrides[name] }), {}) : {};
|
|
52
|
+
return __spreadValues(__spreadValues(__spreadValues({}, overrides), pnpmOverrides), resolutions);
|
|
53
|
+
}
|
|
54
|
+
function updateAppendix({
|
|
55
|
+
dependencies,
|
|
56
|
+
resolutions,
|
|
57
|
+
name,
|
|
58
|
+
version,
|
|
59
|
+
appendix = {}
|
|
60
|
+
}) {
|
|
61
|
+
const dependencyList = Object.keys(dependencies);
|
|
62
|
+
const resolutionsList = Object.keys(resolutions);
|
|
63
|
+
return resolutionsList.reduce((acc, resolution) => {
|
|
64
|
+
if (!dependencyList.includes(resolution)) {
|
|
65
|
+
const hasResolutionOverride = compare(resolutions[resolution], dependencies[resolution], ">");
|
|
66
|
+
if (hasResolutionOverride) {
|
|
67
|
+
return __spreadProps(__spreadValues(__spreadValues({}, appendix), acc), {
|
|
68
|
+
[`${resolution}@${resolutions[resolution]}`]: __spreadProps(__spreadValues({}, appendix[`${resolution}@${resolutions[resolution]}`]), {
|
|
69
|
+
[name]: [version]
|
|
70
|
+
})
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return acc || {};
|
|
75
|
+
}, {});
|
|
76
|
+
}
|
|
77
|
+
function updatePackageJSON({
|
|
78
|
+
appendix,
|
|
79
|
+
path,
|
|
80
|
+
config,
|
|
81
|
+
resolutions
|
|
82
|
+
}) {
|
|
83
|
+
var _a;
|
|
84
|
+
const jsonPath = resolve(path);
|
|
85
|
+
const pastoralist = (config == null ? void 0 : config.pastoralist) ? __spreadProps(__spreadValues({}, config.pastoralist), { appendix }) : { appendix };
|
|
86
|
+
const json = __spreadValues(__spreadProps(__spreadValues({}, config), {
|
|
87
|
+
pastoralist
|
|
88
|
+
}), (config == null ? void 0 : config.resolutions) ? { resolutions } : (config == null ? void 0 : config.overrides) ? { overrides: resolutions } : ((_a = config == null ? void 0 : config.pnpm) == null ? void 0 : _a.overrides) ? { pnpm: __spreadProps(__spreadValues({}, config.pnpm), { overrides: resolutions }) } : {});
|
|
89
|
+
writeFile(jsonPath, JSON.stringify(json, null, 2), (err) => console.log(`\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist had an issue updating overrides or resolutions in the package.json!${err ? `, ${err}` : ""}`));
|
|
90
|
+
}
|
|
91
|
+
function update(options) {
|
|
92
|
+
const { depPaths = ["node_modules/**/package.json"], path = "package.json" } = options;
|
|
93
|
+
const config = resolveJSON(path);
|
|
94
|
+
const resolutions = resolveResolutions({ options, config });
|
|
95
|
+
const resolutionsList = Object.keys(resolutions);
|
|
96
|
+
const nodeModulePackageJSONs = sync(depPaths);
|
|
97
|
+
const appendix = nodeModulePackageJSONs.reduce((acc, packageJSON) => {
|
|
98
|
+
const { dependencies = {}, name, version } = resolveJSON(packageJSON);
|
|
99
|
+
const dependenciesList = Object.keys(dependencies);
|
|
100
|
+
if (!dependenciesList.length)
|
|
101
|
+
return acc;
|
|
102
|
+
const hasOverriddenDependencies = dependenciesList.some((dependencyItem) => resolutionsList.includes(dependencyItem));
|
|
103
|
+
if (!hasOverriddenDependencies)
|
|
104
|
+
return acc;
|
|
105
|
+
const appendixItem = updateAppendix(__spreadValues({
|
|
106
|
+
dependencies,
|
|
107
|
+
name,
|
|
108
|
+
resolutions,
|
|
109
|
+
version
|
|
110
|
+
}, options.appendix ? { appendix: options.appendix } : {}));
|
|
111
|
+
return __spreadValues(__spreadValues({}, acc), appendixItem);
|
|
112
|
+
}, {});
|
|
113
|
+
const appendixItems = Object.keys(appendix);
|
|
114
|
+
const updatedResolutions = appendixItems.length > 0 && appendixItems.filter((item) => Object.keys(appendix[item]).length > 0);
|
|
115
|
+
updatePackageJSON({
|
|
116
|
+
appendix,
|
|
117
|
+
path,
|
|
118
|
+
config,
|
|
119
|
+
resolutions: updatedResolutions
|
|
120
|
+
});
|
|
121
|
+
return appendix;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export {
|
|
125
|
+
resolveJSON,
|
|
126
|
+
resolveResolutions,
|
|
127
|
+
updateAppendix,
|
|
128
|
+
updatePackageJSON,
|
|
129
|
+
update
|
|
130
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
5
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __spreadValues = (a, b) => {
|
|
10
|
+
for (var prop in b || (b = {}))
|
|
11
|
+
if (__hasOwnProp.call(b, prop))
|
|
12
|
+
__defNormalProp(a, prop, b[prop]);
|
|
13
|
+
if (__getOwnPropSymbols)
|
|
14
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
+
if (__propIsEnum.call(b, prop))
|
|
16
|
+
__defNormalProp(a, prop, b[prop]);
|
|
17
|
+
}
|
|
18
|
+
return a;
|
|
19
|
+
};
|
|
20
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
21
|
+
|
|
22
|
+
// src/program.ts
|
|
23
|
+
var import_commander = require("commander");
|
|
24
|
+
|
|
25
|
+
// src/scripts.ts
|
|
26
|
+
var import_path = require("path");
|
|
27
|
+
var import_fs = require("fs");
|
|
28
|
+
var import_fast_glob = require("fast-glob");
|
|
29
|
+
var import_compare_versions = require("compare-versions");
|
|
30
|
+
function resolveJSON(path) {
|
|
31
|
+
const jsonPath = (0, import_path.resolve)(path);
|
|
32
|
+
return require(jsonPath);
|
|
33
|
+
}
|
|
34
|
+
function resolveResolutions({
|
|
35
|
+
config: {
|
|
36
|
+
overrides: npmOverrides = {},
|
|
37
|
+
pnpm: { overrides: pnpmOverrides = {} } = {},
|
|
38
|
+
resolutions = {}
|
|
39
|
+
} = {},
|
|
40
|
+
options: { debug = false } = {}
|
|
41
|
+
}) {
|
|
42
|
+
const overridesItems = Object.keys(npmOverrides);
|
|
43
|
+
const hasOverrides = overridesItems.length > 0;
|
|
44
|
+
const hasComplexOverrides = hasOverrides && overridesItems.some((name) => typeof npmOverrides[name] === "object");
|
|
45
|
+
if (hasComplexOverrides && debug) {
|
|
46
|
+
console.warn("\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist only supports simple overrides! Pastoralist is bypassing the specified complex overrides. \u{1F44C}");
|
|
47
|
+
}
|
|
48
|
+
const overrides = hasOverrides ? overridesItems.filter((name) => typeof npmOverrides[name] === "string").reduce((acc, name) => __spreadProps(__spreadValues({}, acc), { [name]: npmOverrides[name] }), {}) : {};
|
|
49
|
+
return __spreadValues(__spreadValues(__spreadValues({}, overrides), pnpmOverrides), resolutions);
|
|
50
|
+
}
|
|
51
|
+
function updateAppendix({
|
|
52
|
+
dependencies,
|
|
53
|
+
resolutions,
|
|
54
|
+
name,
|
|
55
|
+
version: version2,
|
|
56
|
+
appendix = {}
|
|
57
|
+
}) {
|
|
58
|
+
const dependencyList = Object.keys(dependencies);
|
|
59
|
+
const resolutionsList = Object.keys(resolutions);
|
|
60
|
+
return resolutionsList.reduce((acc, resolution) => {
|
|
61
|
+
if (!dependencyList.includes(resolution)) {
|
|
62
|
+
const hasResolutionOverride = (0, import_compare_versions.compare)(resolutions[resolution], dependencies[resolution], ">");
|
|
63
|
+
if (hasResolutionOverride) {
|
|
64
|
+
return __spreadProps(__spreadValues(__spreadValues({}, appendix), acc), {
|
|
65
|
+
[`${resolution}@${resolutions[resolution]}`]: __spreadProps(__spreadValues({}, appendix[`${resolution}@${resolutions[resolution]}`]), {
|
|
66
|
+
[name]: [version2]
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return acc || {};
|
|
72
|
+
}, {});
|
|
73
|
+
}
|
|
74
|
+
function updatePackageJSON({
|
|
75
|
+
appendix,
|
|
76
|
+
path,
|
|
77
|
+
config,
|
|
78
|
+
resolutions
|
|
79
|
+
}) {
|
|
80
|
+
var _a;
|
|
81
|
+
const jsonPath = (0, import_path.resolve)(path);
|
|
82
|
+
const pastoralist = (config == null ? void 0 : config.pastoralist) ? __spreadProps(__spreadValues({}, config.pastoralist), { appendix }) : { appendix };
|
|
83
|
+
const json = __spreadValues(__spreadProps(__spreadValues({}, config), {
|
|
84
|
+
pastoralist
|
|
85
|
+
}), (config == null ? void 0 : config.resolutions) ? { resolutions } : (config == null ? void 0 : config.overrides) ? { overrides: resolutions } : ((_a = config == null ? void 0 : config.pnpm) == null ? void 0 : _a.overrides) ? { pnpm: __spreadProps(__spreadValues({}, config.pnpm), { overrides: resolutions }) } : {});
|
|
86
|
+
(0, import_fs.writeFile)(jsonPath, JSON.stringify(json, null, 2), (err) => console.log(`\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist had an issue updating overrides or resolutions in the package.json!${err ? `, ${err}` : ""}`));
|
|
87
|
+
}
|
|
88
|
+
function update(options) {
|
|
89
|
+
const { depPaths = ["node_modules/**/package.json"], path = "package.json" } = options;
|
|
90
|
+
const config = resolveJSON(path);
|
|
91
|
+
const resolutions = resolveResolutions({ options, config });
|
|
92
|
+
const resolutionsList = Object.keys(resolutions);
|
|
93
|
+
const nodeModulePackageJSONs = (0, import_fast_glob.sync)(depPaths);
|
|
94
|
+
const appendix = nodeModulePackageJSONs.reduce((acc, packageJSON) => {
|
|
95
|
+
const { dependencies = {}, name, version: version2 } = resolveJSON(packageJSON);
|
|
96
|
+
const dependenciesList = Object.keys(dependencies);
|
|
97
|
+
if (!dependenciesList.length)
|
|
98
|
+
return acc;
|
|
99
|
+
const hasOverriddenDependencies = dependenciesList.some((dependencyItem) => resolutionsList.includes(dependencyItem));
|
|
100
|
+
if (!hasOverriddenDependencies)
|
|
101
|
+
return acc;
|
|
102
|
+
const appendixItem = updateAppendix(__spreadValues({
|
|
103
|
+
dependencies,
|
|
104
|
+
name,
|
|
105
|
+
resolutions,
|
|
106
|
+
version: version2
|
|
107
|
+
}, options.appendix ? { appendix: options.appendix } : {}));
|
|
108
|
+
return __spreadValues(__spreadValues({}, acc), appendixItem);
|
|
109
|
+
}, {});
|
|
110
|
+
const appendixItems = Object.keys(appendix);
|
|
111
|
+
const updatedResolutions = appendixItems.length > 0 && appendixItems.filter((item) => Object.keys(appendix[item]).length > 0);
|
|
112
|
+
updatePackageJSON({
|
|
113
|
+
appendix,
|
|
114
|
+
path,
|
|
115
|
+
config,
|
|
116
|
+
resolutions: updatedResolutions
|
|
117
|
+
});
|
|
118
|
+
return appendix;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// src/program.ts
|
|
122
|
+
var version = "VERSION";
|
|
123
|
+
async function action(options = {}) {
|
|
124
|
+
try {
|
|
125
|
+
if (options == null ? void 0 : options.isTestingCLI)
|
|
126
|
+
console.info({ options });
|
|
127
|
+
update(options);
|
|
128
|
+
} catch (err) {
|
|
129
|
+
console.error(err);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
import_commander.program.version(version).description("Pastoralist, a utility CLI to manage your dependency overrides").option("-p, --path <path>", "the path to the package.json file to manage").option("-d, --depPaths <depPaths>", "a path to dependency package.json files").option("-t, --isTestingCLI", "enables CLI testing, no scripts are run").parse(process.argv).action(action);
|
package/dist/index.mjs
ADDED
package/dist/program.js
ADDED
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
|
|
37
|
+
// src/program.ts
|
|
38
|
+
var program_exports = {};
|
|
39
|
+
__export(program_exports, {
|
|
40
|
+
action: () => action,
|
|
41
|
+
default: () => program_default
|
|
42
|
+
});
|
|
43
|
+
module.exports = __toCommonJS(program_exports);
|
|
44
|
+
var import_commander = require("commander");
|
|
45
|
+
|
|
46
|
+
// src/scripts.ts
|
|
47
|
+
var import_path = require("path");
|
|
48
|
+
var import_fs = require("fs");
|
|
49
|
+
var import_fast_glob = require("fast-glob");
|
|
50
|
+
var import_compare_versions = require("compare-versions");
|
|
51
|
+
function resolveJSON(path) {
|
|
52
|
+
const jsonPath = (0, import_path.resolve)(path);
|
|
53
|
+
return require(jsonPath);
|
|
54
|
+
}
|
|
55
|
+
function resolveResolutions({
|
|
56
|
+
config: {
|
|
57
|
+
overrides: npmOverrides = {},
|
|
58
|
+
pnpm: { overrides: pnpmOverrides = {} } = {},
|
|
59
|
+
resolutions = {}
|
|
60
|
+
} = {},
|
|
61
|
+
options: { debug = false } = {}
|
|
62
|
+
}) {
|
|
63
|
+
const overridesItems = Object.keys(npmOverrides);
|
|
64
|
+
const hasOverrides = overridesItems.length > 0;
|
|
65
|
+
const hasComplexOverrides = hasOverrides && overridesItems.some((name) => typeof npmOverrides[name] === "object");
|
|
66
|
+
if (hasComplexOverrides && debug) {
|
|
67
|
+
console.warn("\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist only supports simple overrides! Pastoralist is bypassing the specified complex overrides. \u{1F44C}");
|
|
68
|
+
}
|
|
69
|
+
const overrides = hasOverrides ? overridesItems.filter((name) => typeof npmOverrides[name] === "string").reduce((acc, name) => __spreadProps(__spreadValues({}, acc), { [name]: npmOverrides[name] }), {}) : {};
|
|
70
|
+
return __spreadValues(__spreadValues(__spreadValues({}, overrides), pnpmOverrides), resolutions);
|
|
71
|
+
}
|
|
72
|
+
function updateAppendix({
|
|
73
|
+
dependencies,
|
|
74
|
+
resolutions,
|
|
75
|
+
name,
|
|
76
|
+
version: version2,
|
|
77
|
+
appendix = {}
|
|
78
|
+
}) {
|
|
79
|
+
const dependencyList = Object.keys(dependencies);
|
|
80
|
+
const resolutionsList = Object.keys(resolutions);
|
|
81
|
+
return resolutionsList.reduce((acc, resolution) => {
|
|
82
|
+
if (!dependencyList.includes(resolution)) {
|
|
83
|
+
const hasResolutionOverride = (0, import_compare_versions.compare)(resolutions[resolution], dependencies[resolution], ">");
|
|
84
|
+
if (hasResolutionOverride) {
|
|
85
|
+
return __spreadProps(__spreadValues(__spreadValues({}, appendix), acc), {
|
|
86
|
+
[`${resolution}@${resolutions[resolution]}`]: __spreadProps(__spreadValues({}, appendix[`${resolution}@${resolutions[resolution]}`]), {
|
|
87
|
+
[name]: [version2]
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return acc || {};
|
|
93
|
+
}, {});
|
|
94
|
+
}
|
|
95
|
+
function updatePackageJSON({
|
|
96
|
+
appendix,
|
|
97
|
+
path,
|
|
98
|
+
config,
|
|
99
|
+
resolutions
|
|
100
|
+
}) {
|
|
101
|
+
var _a;
|
|
102
|
+
const jsonPath = (0, import_path.resolve)(path);
|
|
103
|
+
const pastoralist = (config == null ? void 0 : config.pastoralist) ? __spreadProps(__spreadValues({}, config.pastoralist), { appendix }) : { appendix };
|
|
104
|
+
const json = __spreadValues(__spreadProps(__spreadValues({}, config), {
|
|
105
|
+
pastoralist
|
|
106
|
+
}), (config == null ? void 0 : config.resolutions) ? { resolutions } : (config == null ? void 0 : config.overrides) ? { overrides: resolutions } : ((_a = config == null ? void 0 : config.pnpm) == null ? void 0 : _a.overrides) ? { pnpm: __spreadProps(__spreadValues({}, config.pnpm), { overrides: resolutions }) } : {});
|
|
107
|
+
(0, import_fs.writeFile)(jsonPath, JSON.stringify(json, null, 2), (err) => console.log(`\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist had an issue updating overrides or resolutions in the package.json!${err ? `, ${err}` : ""}`));
|
|
108
|
+
}
|
|
109
|
+
function update(options) {
|
|
110
|
+
const { depPaths = ["node_modules/**/package.json"], path = "package.json" } = options;
|
|
111
|
+
const config = resolveJSON(path);
|
|
112
|
+
const resolutions = resolveResolutions({ options, config });
|
|
113
|
+
const resolutionsList = Object.keys(resolutions);
|
|
114
|
+
const nodeModulePackageJSONs = (0, import_fast_glob.sync)(depPaths);
|
|
115
|
+
const appendix = nodeModulePackageJSONs.reduce((acc, packageJSON) => {
|
|
116
|
+
const { dependencies = {}, name, version: version2 } = resolveJSON(packageJSON);
|
|
117
|
+
const dependenciesList = Object.keys(dependencies);
|
|
118
|
+
if (!dependenciesList.length)
|
|
119
|
+
return acc;
|
|
120
|
+
const hasOverriddenDependencies = dependenciesList.some((dependencyItem) => resolutionsList.includes(dependencyItem));
|
|
121
|
+
if (!hasOverriddenDependencies)
|
|
122
|
+
return acc;
|
|
123
|
+
const appendixItem = updateAppendix(__spreadValues({
|
|
124
|
+
dependencies,
|
|
125
|
+
name,
|
|
126
|
+
resolutions,
|
|
127
|
+
version: version2
|
|
128
|
+
}, options.appendix ? { appendix: options.appendix } : {}));
|
|
129
|
+
return __spreadValues(__spreadValues({}, acc), appendixItem);
|
|
130
|
+
}, {});
|
|
131
|
+
const appendixItems = Object.keys(appendix);
|
|
132
|
+
const updatedResolutions = appendixItems.length > 0 && appendixItems.filter((item) => Object.keys(appendix[item]).length > 0);
|
|
133
|
+
updatePackageJSON({
|
|
134
|
+
appendix,
|
|
135
|
+
path,
|
|
136
|
+
config,
|
|
137
|
+
resolutions: updatedResolutions
|
|
138
|
+
});
|
|
139
|
+
return appendix;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// src/program.ts
|
|
143
|
+
var version = "VERSION";
|
|
144
|
+
async function action(options = {}) {
|
|
145
|
+
try {
|
|
146
|
+
if (options == null ? void 0 : options.isTestingCLI)
|
|
147
|
+
console.info({ options });
|
|
148
|
+
update(options);
|
|
149
|
+
} catch (err) {
|
|
150
|
+
console.error(err);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
import_commander.program.version(version).description("Pastoralist, a utility CLI to manage your dependency overrides").option("-p, --path <path>", "the path to the package.json file to manage").option("-d, --depPaths <depPaths>", "a path to dependency package.json files").option("-t, --isTestingCLI", "enables CLI testing, no scripts are run").parse(process.argv).action(action);
|
|
154
|
+
var program_default = import_commander.program;
|
|
155
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
156
|
+
0 && (module.exports = {
|
|
157
|
+
action
|
|
158
|
+
});
|
package/dist/program.mjs
ADDED
package/dist/scripts.js
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
+
var __spreadValues = (a, b) => {
|
|
12
|
+
for (var prop in b || (b = {}))
|
|
13
|
+
if (__hasOwnProp.call(b, prop))
|
|
14
|
+
__defNormalProp(a, prop, b[prop]);
|
|
15
|
+
if (__getOwnPropSymbols)
|
|
16
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
+
if (__propIsEnum.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
};
|
|
22
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
+
var __export = (target, all) => {
|
|
24
|
+
for (var name in all)
|
|
25
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
+
};
|
|
27
|
+
var __copyProps = (to, from, except, desc) => {
|
|
28
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
+
for (let key of __getOwnPropNames(from))
|
|
30
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
+
}
|
|
33
|
+
return to;
|
|
34
|
+
};
|
|
35
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
+
|
|
37
|
+
// src/scripts.ts
|
|
38
|
+
var scripts_exports = {};
|
|
39
|
+
__export(scripts_exports, {
|
|
40
|
+
resolveJSON: () => resolveJSON,
|
|
41
|
+
resolveResolutions: () => resolveResolutions,
|
|
42
|
+
update: () => update,
|
|
43
|
+
updateAppendix: () => updateAppendix,
|
|
44
|
+
updatePackageJSON: () => updatePackageJSON
|
|
45
|
+
});
|
|
46
|
+
module.exports = __toCommonJS(scripts_exports);
|
|
47
|
+
var import_path = require("path");
|
|
48
|
+
var import_fs = require("fs");
|
|
49
|
+
var import_fast_glob = require("fast-glob");
|
|
50
|
+
var import_compare_versions = require("compare-versions");
|
|
51
|
+
function resolveJSON(path) {
|
|
52
|
+
const jsonPath = (0, import_path.resolve)(path);
|
|
53
|
+
return require(jsonPath);
|
|
54
|
+
}
|
|
55
|
+
function resolveResolutions({
|
|
56
|
+
config: {
|
|
57
|
+
overrides: npmOverrides = {},
|
|
58
|
+
pnpm: { overrides: pnpmOverrides = {} } = {},
|
|
59
|
+
resolutions = {}
|
|
60
|
+
} = {},
|
|
61
|
+
options: { debug = false } = {}
|
|
62
|
+
}) {
|
|
63
|
+
const overridesItems = Object.keys(npmOverrides);
|
|
64
|
+
const hasOverrides = overridesItems.length > 0;
|
|
65
|
+
const hasComplexOverrides = hasOverrides && overridesItems.some((name) => typeof npmOverrides[name] === "object");
|
|
66
|
+
if (hasComplexOverrides && debug) {
|
|
67
|
+
console.warn("\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist only supports simple overrides! Pastoralist is bypassing the specified complex overrides. \u{1F44C}");
|
|
68
|
+
}
|
|
69
|
+
const overrides = hasOverrides ? overridesItems.filter((name) => typeof npmOverrides[name] === "string").reduce((acc, name) => __spreadProps(__spreadValues({}, acc), { [name]: npmOverrides[name] }), {}) : {};
|
|
70
|
+
return __spreadValues(__spreadValues(__spreadValues({}, overrides), pnpmOverrides), resolutions);
|
|
71
|
+
}
|
|
72
|
+
function updateAppendix({
|
|
73
|
+
dependencies,
|
|
74
|
+
resolutions,
|
|
75
|
+
name,
|
|
76
|
+
version,
|
|
77
|
+
appendix = {}
|
|
78
|
+
}) {
|
|
79
|
+
const dependencyList = Object.keys(dependencies);
|
|
80
|
+
const resolutionsList = Object.keys(resolutions);
|
|
81
|
+
return resolutionsList.reduce((acc, resolution) => {
|
|
82
|
+
if (!dependencyList.includes(resolution)) {
|
|
83
|
+
const hasResolutionOverride = (0, import_compare_versions.compare)(resolutions[resolution], dependencies[resolution], ">");
|
|
84
|
+
if (hasResolutionOverride) {
|
|
85
|
+
return __spreadProps(__spreadValues(__spreadValues({}, appendix), acc), {
|
|
86
|
+
[`${resolution}@${resolutions[resolution]}`]: __spreadProps(__spreadValues({}, appendix[`${resolution}@${resolutions[resolution]}`]), {
|
|
87
|
+
[name]: [version]
|
|
88
|
+
})
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
return acc || {};
|
|
93
|
+
}, {});
|
|
94
|
+
}
|
|
95
|
+
function updatePackageJSON({
|
|
96
|
+
appendix,
|
|
97
|
+
path,
|
|
98
|
+
config,
|
|
99
|
+
resolutions
|
|
100
|
+
}) {
|
|
101
|
+
var _a;
|
|
102
|
+
const jsonPath = (0, import_path.resolve)(path);
|
|
103
|
+
const pastoralist = (config == null ? void 0 : config.pastoralist) ? __spreadProps(__spreadValues({}, config.pastoralist), { appendix }) : { appendix };
|
|
104
|
+
const json = __spreadValues(__spreadProps(__spreadValues({}, config), {
|
|
105
|
+
pastoralist
|
|
106
|
+
}), (config == null ? void 0 : config.resolutions) ? { resolutions } : (config == null ? void 0 : config.overrides) ? { overrides: resolutions } : ((_a = config == null ? void 0 : config.pnpm) == null ? void 0 : _a.overrides) ? { pnpm: __spreadProps(__spreadValues({}, config.pnpm), { overrides: resolutions }) } : {});
|
|
107
|
+
(0, import_fs.writeFile)(jsonPath, JSON.stringify(json, null, 2), (err) => console.log(`\u{1F411} \u{1F469}\u{1F3FD}\u200D\u{1F33E} Pastoralist had an issue updating overrides or resolutions in the package.json!${err ? `, ${err}` : ""}`));
|
|
108
|
+
}
|
|
109
|
+
function update(options) {
|
|
110
|
+
const { depPaths = ["node_modules/**/package.json"], path = "package.json" } = options;
|
|
111
|
+
const config = resolveJSON(path);
|
|
112
|
+
const resolutions = resolveResolutions({ options, config });
|
|
113
|
+
const resolutionsList = Object.keys(resolutions);
|
|
114
|
+
const nodeModulePackageJSONs = (0, import_fast_glob.sync)(depPaths);
|
|
115
|
+
const appendix = nodeModulePackageJSONs.reduce((acc, packageJSON) => {
|
|
116
|
+
const { dependencies = {}, name, version } = resolveJSON(packageJSON);
|
|
117
|
+
const dependenciesList = Object.keys(dependencies);
|
|
118
|
+
if (!dependenciesList.length)
|
|
119
|
+
return acc;
|
|
120
|
+
const hasOverriddenDependencies = dependenciesList.some((dependencyItem) => resolutionsList.includes(dependencyItem));
|
|
121
|
+
if (!hasOverriddenDependencies)
|
|
122
|
+
return acc;
|
|
123
|
+
const appendixItem = updateAppendix(__spreadValues({
|
|
124
|
+
dependencies,
|
|
125
|
+
name,
|
|
126
|
+
resolutions,
|
|
127
|
+
version
|
|
128
|
+
}, options.appendix ? { appendix: options.appendix } : {}));
|
|
129
|
+
return __spreadValues(__spreadValues({}, acc), appendixItem);
|
|
130
|
+
}, {});
|
|
131
|
+
const appendixItems = Object.keys(appendix);
|
|
132
|
+
const updatedResolutions = appendixItems.length > 0 && appendixItems.filter((item) => Object.keys(appendix[item]).length > 0);
|
|
133
|
+
updatePackageJSON({
|
|
134
|
+
appendix,
|
|
135
|
+
path,
|
|
136
|
+
config,
|
|
137
|
+
resolutions: updatedResolutions
|
|
138
|
+
});
|
|
139
|
+
return appendix;
|
|
140
|
+
}
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
resolveJSON,
|
|
144
|
+
resolveResolutions,
|
|
145
|
+
update,
|
|
146
|
+
updateAppendix,
|
|
147
|
+
updatePackageJSON
|
|
148
|
+
});
|
package/dist/scripts.mjs
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
resolveJSON,
|
|
4
|
+
resolveResolutions,
|
|
5
|
+
update,
|
|
6
|
+
updateAppendix,
|
|
7
|
+
updatePackageJSON
|
|
8
|
+
} from "./chunk-WXUCJGGF.mjs";
|
|
9
|
+
export {
|
|
10
|
+
resolveJSON,
|
|
11
|
+
resolveResolutions,
|
|
12
|
+
update,
|
|
13
|
+
updateAppendix,
|
|
14
|
+
updatePackageJSON
|
|
15
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
declare type PastoralistJSON = {
|
|
2
|
+
dependencies?: Record<string, string>;
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
resolutions?: Record<string, string>;
|
|
6
|
+
overrides?: Record<string, string>;
|
|
7
|
+
pnpm?: {
|
|
8
|
+
overrides?: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
pastoralist?: {
|
|
11
|
+
appendix?: Appendix;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
declare type Appendix = Record<string, Record<string, string> | string>;
|
|
15
|
+
declare type ResolveResolutionOptions = {
|
|
16
|
+
config?: {
|
|
17
|
+
overrides?: Record<string, string> | undefined;
|
|
18
|
+
pnpm?: {
|
|
19
|
+
overrides?: Record<string, string> | undefined;
|
|
20
|
+
};
|
|
21
|
+
resolutions?: Record<string, string> | undefined;
|
|
22
|
+
};
|
|
23
|
+
options?: Options;
|
|
24
|
+
};
|
|
25
|
+
declare type UpdateAppendixOptions = {
|
|
26
|
+
appendix?: Appendix;
|
|
27
|
+
dependencies: Record<string, string>;
|
|
28
|
+
resolutions: Record<string, string>;
|
|
29
|
+
name: string;
|
|
30
|
+
version: string;
|
|
31
|
+
};
|
|
32
|
+
declare type Options = {
|
|
33
|
+
appendix?: Appendix;
|
|
34
|
+
debug?: boolean;
|
|
35
|
+
isTestingCLI?: boolean;
|
|
36
|
+
path?: string;
|
|
37
|
+
depPaths?: string[];
|
|
38
|
+
};
|
|
39
|
+
declare type OverridesType = Record<string, string>;
|
|
40
|
+
declare type UpdatePackageJSONOptions = {
|
|
41
|
+
appendix?: Appendix;
|
|
42
|
+
path: string;
|
|
43
|
+
config: PastoralistJSON;
|
|
44
|
+
resolutions?: false | string[];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export { Appendix, Options, OverridesType, PastoralistJSON, ResolveResolutionOptions, UpdateAppendixOptions, UpdatePackageJSONOptions };
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
|
|
15
|
+
// src/types.ts
|
|
16
|
+
var types_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(types_exports);
|
package/dist/types.mjs
ADDED
|
File without changes
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pastoralist",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "(WIP) a tool to watch over node module resolutions and overrides ๐ ๐ฉ๐ฝโ๐พ",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/types.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"require": "./dist/index.cjs",
|
|
10
|
+
"import": "./dist/index.mjs"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"bin": {
|
|
17
|
+
"pastoralist": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup src/index.ts src/program.ts src/scripts.ts --format cjs,esm && tsup src/types.ts --dts-only",
|
|
21
|
+
"test": "vitest run"
|
|
22
|
+
},
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "git+https://github.com/yowainwright/pastoralist.git"
|
|
26
|
+
},
|
|
27
|
+
"keywords": [
|
|
28
|
+
"resolutions",
|
|
29
|
+
"overrides",
|
|
30
|
+
"dependencies",
|
|
31
|
+
"security",
|
|
32
|
+
"dependency-management",
|
|
33
|
+
"yarn",
|
|
34
|
+
"pnpm"
|
|
35
|
+
],
|
|
36
|
+
"author": "Jeff Wainwright <https:jeffry.in> (yowainwright@gmail.com)",
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/yowainwright/pastoralist/issues"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/yowainwright/pastoralist#readme",
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"commander": "^9.2.0",
|
|
44
|
+
"compare-versions": "^4.1.3",
|
|
45
|
+
"fast-glob": "^3.2.11"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/node": "^17.0.31",
|
|
49
|
+
"@typescript-eslint/eslint-plugin": "^5.14.0",
|
|
50
|
+
"@typescript-eslint/parser": "^5.21.0",
|
|
51
|
+
"eslint": "^8.10.0",
|
|
52
|
+
"eslint-config-prettier": "^8.5.0",
|
|
53
|
+
"release-it": "^15.0.0",
|
|
54
|
+
"stdouttojson": "^0.3.1",
|
|
55
|
+
"ts-node": "^10.7.0",
|
|
56
|
+
"tslib": "^2.3.1",
|
|
57
|
+
"tsup": "^5.12.6",
|
|
58
|
+
"typescript": "^4.6.4",
|
|
59
|
+
"vitest": "^0.10.0"
|
|
60
|
+
}
|
|
61
|
+
}
|