@dotcom-tool-kit/package-json-hook 4.2.0 → 5.0.0-beta.1
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/.toolkitrc.yml +7 -0
- package/lib/package-json-helper.d.ts +16 -14
- package/lib/package-json-helper.d.ts.map +1 -1
- package/lib/package-json-helper.js +126 -24
- package/package.json +14 -6
- package/readme.md +70 -0
- package/lib/index.d.ts +0 -3
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -8
- package/lib/script-hook.d.ts +0 -5
- package/lib/script-hook.d.ts.map +0 -1
- package/lib/script-hook.js +0 -11
package/.toolkitrc.yml
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { Hook, HookInstallation } from '@dotcom-tool-kit/base';
|
|
3
|
+
import type { Plugin } from '@dotcom-tool-kit/plugin';
|
|
4
|
+
import { PackageJsonSchema } from '@dotcom-tool-kit/schemas/lib/hooks/package-json';
|
|
5
|
+
import { Conflict } from '@dotcom-tool-kit/conflict';
|
|
6
|
+
interface PackageJsonContents {
|
|
7
|
+
[field: string]: PackageJsonContents | string;
|
|
4
8
|
}
|
|
5
9
|
interface PackageJsonStateValue {
|
|
6
|
-
|
|
7
|
-
trailingString
|
|
10
|
+
commands: string[];
|
|
11
|
+
trailingString?: string;
|
|
12
|
+
installedBy: PackageJson;
|
|
8
13
|
}
|
|
9
14
|
interface PackageJsonState {
|
|
10
|
-
[
|
|
15
|
+
[path: string]: PackageJsonStateValue;
|
|
11
16
|
}
|
|
12
|
-
export
|
|
17
|
+
export default class PackageJson extends Hook<typeof PackageJsonSchema, PackageJsonState> {
|
|
13
18
|
private _packageJson?;
|
|
14
|
-
abstract field: string | string[];
|
|
15
|
-
abstract key: string;
|
|
16
|
-
abstract hook: string;
|
|
17
|
-
trailingString?: string;
|
|
18
19
|
installGroup: string;
|
|
19
20
|
filepath: string;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
static mergeChildInstallations(plugin: Plugin, childInstallations: (HookInstallation<z.output<typeof PackageJsonSchema>> | Conflict<HookInstallation<z.output<typeof PackageJsonSchema>>>)[]): (HookInstallation<z.output<typeof PackageJsonSchema>> | Conflict<HookInstallation>)[];
|
|
22
|
+
static overrideChildInstallations(plugin: Plugin, parentInstallation: HookInstallation<z.output<typeof PackageJsonSchema>>, childInstallations: (HookInstallation<z.output<typeof PackageJsonSchema>> | Conflict<HookInstallation<z.output<typeof PackageJsonSchema>>>)[]): (HookInstallation<z.output<typeof PackageJsonSchema>> | Conflict<HookInstallation>)[];
|
|
23
|
+
getPackageJson(): Promise<PackageJsonContents>;
|
|
24
|
+
isInstalled(): Promise<boolean>;
|
|
23
25
|
install(state?: PackageJsonState): Promise<PackageJsonState>;
|
|
24
26
|
commitInstall(state: PackageJsonState): Promise<void>;
|
|
25
27
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"package-json-helper.d.ts","sourceRoot":"","sources":["../src/package-json-helper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"package-json-helper.d.ts","sourceRoot":"","sources":["../src/package-json-helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC9D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AASrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AACnF,OAAO,EAAE,QAAQ,EAAc,MAAM,2BAA2B,CAAA;AAEhE,UAAU,mBAAmB;IAC3B,CAAC,KAAK,EAAE,MAAM,GAAG,mBAAmB,GAAG,MAAM,CAAA;CAC9C;AAED,UAAU,qBAAqB;IAC7B,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,EAAE,WAAW,CAAA;CACzB;AAED,UAAU,gBAAgB;IACxB,CAAC,IAAI,EAAE,MAAM,GAAG,qBAAqB,CAAA;CACtC;AAuED,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,IAAI,CAAC,OAAO,iBAAiB,EAAE,gBAAgB,CAAC;IACvF,OAAO,CAAC,YAAY,CAAC,CAAqB;IAE1C,YAAY,SAAiB;IAE7B,QAAQ,SAA8C;IAEtD,MAAM,CAAC,uBAAuB,CAC5B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,CAChB,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,GACpD,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CACjE,EAAE,GACF,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE;IAexF,MAAM,CAAC,0BAA0B,CAC/B,MAAM,EAAE,MAAM,EACd,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,EACxE,kBAAkB,EAAE,CAChB,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,GACpD,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CACjE,EAAE,GACF,CAAC,gBAAgB,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC,EAAE;IAsBlF,cAAc,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAW9C,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAsB/B,OAAO,CAAC,KAAK,GAAE,gBAAqB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAgChE,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAe5D"}
|
|
@@ -1,20 +1,93 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PackageJsonHelper = void 0;
|
|
4
3
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
4
|
+
const base_1 = require("@dotcom-tool-kit/base");
|
|
6
5
|
const fs_1 = tslib_1.__importDefault(require("fs"));
|
|
7
6
|
const get_1 = tslib_1.__importDefault(require("lodash/get"));
|
|
8
|
-
const
|
|
9
|
-
const
|
|
7
|
+
const set_1 = tslib_1.__importDefault(require("lodash/set"));
|
|
8
|
+
const partition_1 = tslib_1.__importDefault(require("lodash/partition"));
|
|
10
9
|
const update_1 = tslib_1.__importDefault(require("lodash/update"));
|
|
10
|
+
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
11
11
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
12
|
-
|
|
12
|
+
const conflict_1 = require("@dotcom-tool-kit/conflict");
|
|
13
|
+
function installationsOverlap(installation, other) {
|
|
14
|
+
for (const [field, object] of Object.entries(installation.options)) {
|
|
15
|
+
for (const key of Object.keys(object)) {
|
|
16
|
+
if (field in other.options && key in other.options[field]) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
}
|
|
23
|
+
function partitionInstallations(installation, mergeable, unmergeable) {
|
|
24
|
+
const [noLongerMergeable, stillMergeable] = (0, partition_1.default)(mergeable, (other) => installationsOverlap(installation, other));
|
|
25
|
+
const overlapsWithUnmergeable = unmergeable.some((other) => installationsOverlap(installation, other));
|
|
26
|
+
if (noLongerMergeable.length > 0 || overlapsWithUnmergeable) {
|
|
27
|
+
return [stillMergeable, [...unmergeable, ...noLongerMergeable, installation]];
|
|
28
|
+
}
|
|
29
|
+
return [[...stillMergeable, installation], unmergeable];
|
|
30
|
+
}
|
|
31
|
+
function mergeInstallationResults(plugin, mergeable, unmergeable) {
|
|
32
|
+
const results = [];
|
|
33
|
+
if (mergeable.length > 0) {
|
|
34
|
+
results.push({
|
|
35
|
+
plugin,
|
|
36
|
+
forHook: 'PackageJson',
|
|
37
|
+
hookConstructor: PackageJson,
|
|
38
|
+
options: (0, merge_1.default)({}, ...mergeable.map((installation) => installation.options))
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (unmergeable.length > 0) {
|
|
42
|
+
results.push({
|
|
43
|
+
plugin,
|
|
44
|
+
conflicting: unmergeable
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
return results;
|
|
48
|
+
}
|
|
49
|
+
// split the path on all unescaped full stops, then unescape all escaped full
|
|
50
|
+
// stops. this will mean we can pass fields to lodash functions taking a path
|
|
51
|
+
// even if the fields contain full stops.
|
|
52
|
+
function splitAndUnescapePath(path) {
|
|
53
|
+
return path.split(/(?<!\\)\./).map((component) => component.replace('\\.', '.'));
|
|
54
|
+
}
|
|
55
|
+
class PackageJson extends base_1.Hook {
|
|
13
56
|
constructor() {
|
|
14
57
|
super(...arguments);
|
|
15
58
|
this.installGroup = 'package-json';
|
|
16
59
|
this.filepath = path_1.default.resolve(process.cwd(), 'package.json');
|
|
17
60
|
}
|
|
61
|
+
static mergeChildInstallations(plugin, childInstallations) {
|
|
62
|
+
let mergeable = [];
|
|
63
|
+
let unmergeable = [];
|
|
64
|
+
for (const installation of childInstallations) {
|
|
65
|
+
if ((0, conflict_1.isConflict)(installation)) {
|
|
66
|
+
unmergeable.push(...installation.conflicting);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
;
|
|
70
|
+
[mergeable, unmergeable] = partitionInstallations(installation, mergeable, unmergeable);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return mergeInstallationResults(plugin, mergeable, unmergeable);
|
|
74
|
+
}
|
|
75
|
+
static overrideChildInstallations(plugin, parentInstallation, childInstallations) {
|
|
76
|
+
const mergeable = [];
|
|
77
|
+
const unmergeable = [];
|
|
78
|
+
for (const installation of childInstallations) {
|
|
79
|
+
if ((0, conflict_1.isConflict)(installation)) {
|
|
80
|
+
const [canHandle, cannotHandle] = (0, partition_1.default)(installation.conflicting, (other) => installationsOverlap(parentInstallation, other));
|
|
81
|
+
mergeable.push(...canHandle);
|
|
82
|
+
unmergeable.push(...cannotHandle);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
mergeable.push(installation);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
mergeable.push(parentInstallation);
|
|
89
|
+
return mergeInstallationResults(plugin, mergeable, unmergeable);
|
|
90
|
+
}
|
|
18
91
|
async getPackageJson() {
|
|
19
92
|
if (!this._packageJson) {
|
|
20
93
|
const rawPackageJson = await fs_1.default.promises.readFile(this.filepath, 'utf8');
|
|
@@ -24,28 +97,57 @@ class PackageJsonHelper extends types_1.Hook {
|
|
|
24
97
|
}
|
|
25
98
|
return this._packageJson;
|
|
26
99
|
}
|
|
27
|
-
|
|
28
|
-
return Array.isArray(this.field) ? [...this.field, this.key] : [this.field, this.key];
|
|
29
|
-
}
|
|
30
|
-
async check() {
|
|
100
|
+
async isInstalled() {
|
|
31
101
|
const packageJson = await this.getPackageJson();
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
102
|
+
// this instance's `options` is a nested object of expected package.json field/command mappings, e.g.
|
|
103
|
+
// { "scripts": { "build": "build:local" } }. in the package.json, they'll have the same structure
|
|
104
|
+
// with a `dotcom-tool-kit` CLI prefix, e.g. { "scripts": { "build": "dotcom-tool-kit build:local" } }.
|
|
105
|
+
// loop through the nested options object, get the same nested key from package.json, and check that
|
|
106
|
+
// field exists, and its string includes the name of the command. if any command from our options is
|
|
107
|
+
// missing, the check should fail.
|
|
108
|
+
for (const [field, object] of Object.entries(this.options)) {
|
|
109
|
+
for (const [key, command] of Object.entries(object)) {
|
|
110
|
+
const currentPackageJsonField = (0, get_1.default)(packageJson, [...splitAndUnescapePath(field), key]);
|
|
111
|
+
if (!currentPackageJsonField || !currentPackageJsonField.includes(command)) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
async install(state = {}) {
|
|
119
|
+
for (const [field, object] of Object.entries(this.options)) {
|
|
120
|
+
for (const [key, entry] of Object.entries(object)) {
|
|
121
|
+
let trailingString;
|
|
122
|
+
let commands;
|
|
123
|
+
if (Array.isArray(entry)) {
|
|
124
|
+
commands = entry;
|
|
125
|
+
}
|
|
126
|
+
else if (typeof entry === 'string') {
|
|
127
|
+
commands = [entry];
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
commands = Array.isArray(entry.commands) ? entry.commands : [entry.commands];
|
|
131
|
+
trailingString = entry.trailingString;
|
|
132
|
+
}
|
|
133
|
+
(0, update_1.default)(state,
|
|
134
|
+
// full stops in the key shouldn't be treated as path separators
|
|
135
|
+
[field + '.' + key.replace('.', '\\.')], (hookState) => ({
|
|
136
|
+
// prepend each command to maintain the same order as previous implementations
|
|
137
|
+
commands: [...commands, ...(hookState?.commands ?? [])],
|
|
138
|
+
installedBy: this,
|
|
139
|
+
trailingString: trailingString
|
|
140
|
+
}));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
41
143
|
return state;
|
|
42
144
|
}
|
|
43
145
|
async commitInstall(state) {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
await fs_1.default.promises.writeFile(this.filepath, JSON.stringify(
|
|
146
|
+
const packageJson = await this.getPackageJson();
|
|
147
|
+
for (const [path, installation] of Object.entries(state)) {
|
|
148
|
+
(0, set_1.default)(packageJson, splitAndUnescapePath(path), `dotcom-tool-kit ${installation.commands.join(' ')}${installation.trailingString ? ' ' + installation.trailingString : ''}`);
|
|
149
|
+
}
|
|
150
|
+
await fs_1.default.promises.writeFile(this.filepath, JSON.stringify(packageJson, null, 2) + '\n');
|
|
49
151
|
}
|
|
50
152
|
}
|
|
51
|
-
exports.
|
|
153
|
+
exports.default = PackageJson;
|
package/package.json
CHANGED
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcom-tool-kit/package-json-hook",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0-beta.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "lib",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "cd ../../ ; npx jest --silent --projects
|
|
7
|
+
"test": "cd ../../ ; npx jest --silent --projects plugins/package-json-hook"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [],
|
|
10
10
|
"author": "FT.com Platforms Team <platforms-team.customer-products@ft.com>",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
+
"@dotcom-tool-kit/base": "4.0.0-beta.0",
|
|
14
|
+
"@dotcom-tool-kit/conflict": "2.0.0-beta.0",
|
|
15
|
+
"@dotcom-tool-kit/plugin": "2.0.0-beta.0",
|
|
13
16
|
"@financial-times/package-json": "^3.0.0",
|
|
14
17
|
"lodash": "^4.17.21",
|
|
15
18
|
"tslib": "^2.3.1"
|
|
@@ -17,14 +20,19 @@
|
|
|
17
20
|
"repository": {
|
|
18
21
|
"type": "git",
|
|
19
22
|
"url": "https://github.com/financial-times/dotcom-tool-kit.git",
|
|
20
|
-
"directory": "
|
|
23
|
+
"directory": "plugins/package-json-hook"
|
|
21
24
|
},
|
|
22
25
|
"bugs": "https://github.com/financial-times/dotcom-tool-kit/issues",
|
|
23
|
-
"homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/
|
|
26
|
+
"homepage": "https://github.com/financial-times/dotcom-tool-kit/tree/main/plugins/package-json-hook",
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"zod": "^3.22.4"
|
|
29
|
+
},
|
|
24
30
|
"devDependencies": {
|
|
31
|
+
"@dotcom-tool-kit/schemas": "2.0.0-beta.0",
|
|
25
32
|
"@jest/globals": "^27.4.6",
|
|
26
33
|
"@types/lodash": "^4.14.185",
|
|
27
|
-
"winston": "^3.5.1"
|
|
34
|
+
"winston": "^3.5.1",
|
|
35
|
+
"zod": "^3.22.4"
|
|
28
36
|
},
|
|
29
37
|
"files": [
|
|
30
38
|
"/lib",
|
|
@@ -34,7 +42,7 @@
|
|
|
34
42
|
"extends": "../../package.json"
|
|
35
43
|
},
|
|
36
44
|
"engines": {
|
|
37
|
-
"node": "
|
|
45
|
+
"node": "18.x || 20.x",
|
|
38
46
|
"npm": "7.x || 8.x || 9.x || 10.x"
|
|
39
47
|
}
|
|
40
48
|
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# @dotcom-tool-kit/package-json-hook
|
|
2
|
+
|
|
3
|
+
This plugin manages Tool Kit commands that are run from npm scripts, via a Tool Kit [`Hook`](#hooks) that automatically manages `package.json`.
|
|
4
|
+
|
|
5
|
+
Although you can write npm scripts yourself in `package.json`, this plugin allows other Tool Kit plugins to define them in a repeatable, modular way. Adding custom scripts via configuring this plugin in your `.toolkitrc.yml` means that if a new use case emerges, it's much easier to abstract it into a plugin that can be shared with other Tool Kit users.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Most repositories won't need to use this plugin directly. It's installed of a dependency of plugins like [`npm`](../npm) which configure it with standard use cases.
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Install `@dotcom-tool-kit/package-json-hook` as a `devDependency` in your app:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install --save-dev @dotcom-tool-kit/package-json-hook
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Add the plugin to your [Tool Kit configuration](https://github.com/financial-times/dotcom-tool-kit/blob/main/readme.md#configuration):
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
plugins:
|
|
22
|
+
- '@dotcom-tool-kit/package-json-hook'
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
And install this plugin's hooks:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
npx dotcom-tool-kit --install
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
<!-- begin autogenerated docs -->
|
|
32
|
+
## Hooks
|
|
33
|
+
|
|
34
|
+
### `PackageJson`
|
|
35
|
+
|
|
36
|
+
This hook accepts a nested object with a structure that matches the generated output in `package.json`. The values are used as Tool Kit command names to run. You can provide a single command or an array; multiple commands are concatenated in order.
|
|
37
|
+
|
|
38
|
+
For more complex use cases, you can provide an object instead of a command. The object must contain keys `commands` (as above), and `trailingString` (which will be appended to the resulting `dotcom-tool-kit` CLI invocation). This is useful for tasks that accept a list of files after a trailing `--`.
|
|
39
|
+
|
|
40
|
+
Options provided in your repository's `.toolkitrc.yml` for this hook are merged with any Tool Kit plugin that also provides options for the hook.
|
|
41
|
+
|
|
42
|
+
For example, configuring this hook with the following options:
|
|
43
|
+
|
|
44
|
+
~~~yml
|
|
45
|
+
options:
|
|
46
|
+
hooks:
|
|
47
|
+
- PackageJson:
|
|
48
|
+
scripts:
|
|
49
|
+
start: 'run:local'
|
|
50
|
+
customScript:
|
|
51
|
+
commands:
|
|
52
|
+
- custom:one
|
|
53
|
+
- custom:two
|
|
54
|
+
trailingString: '--'
|
|
55
|
+
~~~
|
|
56
|
+
|
|
57
|
+
will result in the following output in `package.json`:
|
|
58
|
+
|
|
59
|
+
~~~json
|
|
60
|
+
{
|
|
61
|
+
"scripts": {
|
|
62
|
+
"start": "dotcom-tool-kit run:local",
|
|
63
|
+
"customScript": "dotcom-tool-kit custom:one custom:two --"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
~~~
|
|
67
|
+
|
|
68
|
+
<!-- hide autogenerated schema docs -->
|
|
69
|
+
|
|
70
|
+
<!-- end autogenerated docs -->
|
package/lib/index.d.ts
DELETED
package/lib/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,IAAI,eAAe,EAAE,MAAM,eAAe,CAAA;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA"}
|
package/lib/index.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PackageJsonHelper = exports.PackageJsonHook = exports.PackageJsonScriptHook = void 0;
|
|
4
|
-
var script_hook_1 = require("./script-hook");
|
|
5
|
-
Object.defineProperty(exports, "PackageJsonScriptHook", { enumerable: true, get: function () { return script_hook_1.PackageJsonScriptHook; } });
|
|
6
|
-
Object.defineProperty(exports, "PackageJsonHook", { enumerable: true, get: function () { return script_hook_1.PackageJsonScriptHook; } });
|
|
7
|
-
var package_json_helper_1 = require("./package-json-helper");
|
|
8
|
-
Object.defineProperty(exports, "PackageJsonHelper", { enumerable: true, get: function () { return package_json_helper_1.PackageJsonHelper; } });
|
package/lib/script-hook.d.ts
DELETED
package/lib/script-hook.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"script-hook.d.ts","sourceRoot":"","sources":["../src/script-hook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAA;AAEzD,8BAAsB,qBAAsB,SAAQ,iBAAiB;IACnE,KAAK,SAAY;CAClB"}
|
package/lib/script-hook.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PackageJsonScriptHook = void 0;
|
|
4
|
-
const package_json_helper_1 = require("./package-json-helper");
|
|
5
|
-
class PackageJsonScriptHook extends package_json_helper_1.PackageJsonHelper {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.field = 'scripts';
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
exports.PackageJsonScriptHook = PackageJsonScriptHook;
|