@stealthscale/tool-testing 0.1.0
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/README.md +17 -0
- package/dist/index.d.mts +186 -0
- package/dist/index.mjs +210 -0
- package/package.json +39 -0
package/README.md
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# @stealthscale/tool-testing
|
|
2
|
+
|
|
3
|
+
A **kit**: a dev-time library another repository takes.
|
|
4
|
+
|
|
5
|
+
Builds a scratch workspace in the temporary directory, writes the manifests that go in it,
|
|
6
|
+
and measures what a rendered element draws. A guard's spec, a package's spec, a story and a
|
|
7
|
+
repository's own conformance spec all reach for the same three.
|
|
8
|
+
|
|
9
|
+
A spec that reads the real workspace states the rule and derives its expectation from the
|
|
10
|
+
tree. A spec that writes its own scratch workspace in `tmpdir` may pin exact counts and
|
|
11
|
+
names, because it wrote them.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
bun add -d @stealthscale/tool-testing
|
|
17
|
+
```
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
//#region src/scratch.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* @fileoverview Builds a scratch workspace in the temporary directory for a specification
|
|
4
|
+
* that reads a tree: a guard, a generator, a release step. The spec writes the files it
|
|
5
|
+
* needs, runs the code under test against the directory, and removes it.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Maps a path relative to the workspace root to the content of the file at that path.
|
|
9
|
+
*/
|
|
10
|
+
type ScratchFiles = Readonly<Record<string, string>>;
|
|
11
|
+
/**
|
|
12
|
+
* Owns a temporary directory for a specification: writes into it, reads from it, lists it
|
|
13
|
+
* and removes it. `scratchWorkspace` creates one.
|
|
14
|
+
*/
|
|
15
|
+
declare class ScratchWorkspace {
|
|
16
|
+
/**
|
|
17
|
+
* Holds the absolute path of the directory.
|
|
18
|
+
*/
|
|
19
|
+
readonly root: string;
|
|
20
|
+
/**
|
|
21
|
+
* Wraps a directory that already exists. `scratchWorkspace` calls this; a specification
|
|
22
|
+
* does not.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} root - The absolute path of the directory.
|
|
25
|
+
*/
|
|
26
|
+
constructor(root: string);
|
|
27
|
+
/**
|
|
28
|
+
* Lists every file below the root as a path relative to it, with `/` as the separator.
|
|
29
|
+
*
|
|
30
|
+
* @returns {string[]} The paths, sorted.
|
|
31
|
+
*/
|
|
32
|
+
files(): string[];
|
|
33
|
+
/**
|
|
34
|
+
* Resolves a path relative to the root into an absolute one.
|
|
35
|
+
*
|
|
36
|
+
* @param {string} relative - The path to resolve.
|
|
37
|
+
* @returns {string} The absolute path.
|
|
38
|
+
* @throws {Error} When the path leaves the root.
|
|
39
|
+
*/
|
|
40
|
+
path(relative: string): string;
|
|
41
|
+
/**
|
|
42
|
+
* Reads a file as UTF-8 text.
|
|
43
|
+
*
|
|
44
|
+
* @param {string} relative - The path to read.
|
|
45
|
+
* @returns {string} The file's content.
|
|
46
|
+
* @throws {Error} When the file does not exist or the path leaves the root.
|
|
47
|
+
*/
|
|
48
|
+
read(relative: string): string;
|
|
49
|
+
/**
|
|
50
|
+
* Removes the directory and everything in it. A second call does nothing.
|
|
51
|
+
*/
|
|
52
|
+
remove(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Writes files, creating the directories they sit in. An existing file is overwritten.
|
|
55
|
+
*
|
|
56
|
+
* @param {ScratchFiles} files - The content per path.
|
|
57
|
+
* @throws {Error} When a path leaves the root.
|
|
58
|
+
*/
|
|
59
|
+
write(files: ScratchFiles): void;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Creates a scratch workspace in the temporary directory and writes the files given.
|
|
63
|
+
*
|
|
64
|
+
* @param {ScratchFiles} [files] - The files to write first. Default: none.
|
|
65
|
+
* @returns {ScratchWorkspace} The workspace. The caller removes it.
|
|
66
|
+
*/
|
|
67
|
+
declare function scratchWorkspace(files?: ScratchFiles): ScratchWorkspace;
|
|
68
|
+
/**
|
|
69
|
+
* Runs a function against a scratch workspace and removes the workspace afterwards, whether
|
|
70
|
+
* the function returned or threw.
|
|
71
|
+
*
|
|
72
|
+
* @template Result - The type the function returns.
|
|
73
|
+
* @param {ScratchFiles} files - The files to write first.
|
|
74
|
+
* @param {(workspace: ScratchWorkspace) => Result} run - The function to run.
|
|
75
|
+
* @returns {Result} The function's return value.
|
|
76
|
+
*/
|
|
77
|
+
declare function withScratchWorkspace<Result>(files: ScratchFiles, run: (workspace: ScratchWorkspace) => Result): Result;
|
|
78
|
+
/**
|
|
79
|
+
* Runs an asynchronous function against a scratch workspace and removes the workspace after
|
|
80
|
+
* it settles, whether it resolved or rejected.
|
|
81
|
+
*
|
|
82
|
+
* @template Result - The type the function resolves to.
|
|
83
|
+
* @param {ScratchFiles} files - The files to write first.
|
|
84
|
+
* @param {(workspace: ScratchWorkspace) => Promise<Result>} run - The function to run.
|
|
85
|
+
* @returns {Promise<Result>} The value the function resolved to.
|
|
86
|
+
*/
|
|
87
|
+
declare function withScratchWorkspaceAsync<Result>(files: ScratchFiles, run: (workspace: ScratchWorkspace) => Promise<Result>): Promise<Result>;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/manifest.d.ts
|
|
90
|
+
/**
|
|
91
|
+
* Holds the fields of a scratch manifest. Beyond the name, a field is whatever the
|
|
92
|
+
* specification needs the code under test to read.
|
|
93
|
+
*/
|
|
94
|
+
interface ManifestFields {
|
|
95
|
+
/**
|
|
96
|
+
* Names the package.
|
|
97
|
+
*/
|
|
98
|
+
readonly name: string;
|
|
99
|
+
readonly [field: string]: unknown;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Serialises a manifest the way a package manager writes one: two-space indentation and a
|
|
103
|
+
* final newline.
|
|
104
|
+
*
|
|
105
|
+
* @param {ManifestFields} fields - The fields to write. `version` defaults to `0.0.0`.
|
|
106
|
+
* @returns {string} The JSON text.
|
|
107
|
+
*/
|
|
108
|
+
declare function manifest(fields: ManifestFields): string;
|
|
109
|
+
/**
|
|
110
|
+
* Builds the files of one package under a directory: its manifest, and any other files at
|
|
111
|
+
* paths relative to that directory.
|
|
112
|
+
*
|
|
113
|
+
* @param {string} directory - The package's directory, relative to the workspace root.
|
|
114
|
+
* @param {ManifestFields} fields - The fields to write into the manifest.
|
|
115
|
+
* @param {ScratchFiles} [files] - Other files of the package, relative to its directory. Default: none.
|
|
116
|
+
* @returns {ScratchFiles} Every file of the package, keyed relative to the workspace root.
|
|
117
|
+
*/
|
|
118
|
+
declare function packageFiles(directory: string, fields: ManifestFields, files?: ScratchFiles): ScratchFiles;
|
|
119
|
+
/**
|
|
120
|
+
* Builds the root manifest of a workspace: private, named `root`, with the globs given.
|
|
121
|
+
*
|
|
122
|
+
* @param {readonly string[]} workspaces - The workspace globs: `core/*`, `tools/*`.
|
|
123
|
+
* @param {Readonly<Record<string, unknown>>} [fields] - Other root fields, such as a catalog or devDependencies. Default: none.
|
|
124
|
+
* @returns {ScratchFiles} The root `package.json`.
|
|
125
|
+
*/
|
|
126
|
+
declare function workspaceFiles(workspaces: readonly string[], fields?: Readonly<Record<string, unknown>>): ScratchFiles;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/measure.d.ts
|
|
129
|
+
/**
|
|
130
|
+
* @fileoverview Reads geometry off a rendered element, so a specification asserts what a
|
|
131
|
+
* reader would see rather than what a class name promises.
|
|
132
|
+
*/
|
|
133
|
+
/**
|
|
134
|
+
* Describes the box a measurement reads: the two inline edges of a rendered element.
|
|
135
|
+
*/
|
|
136
|
+
interface Box {
|
|
137
|
+
/**
|
|
138
|
+
* Holds the distance from the viewport's left edge to the element's, in pixels.
|
|
139
|
+
*/
|
|
140
|
+
left: number;
|
|
141
|
+
/**
|
|
142
|
+
* Holds the distance from the viewport's left edge to the element's right edge, in pixels.
|
|
143
|
+
*/
|
|
144
|
+
right: number;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Names what a measurement needs of an element: its box, and nothing else.
|
|
148
|
+
*
|
|
149
|
+
* Structural rather than `Element`, for two reasons. This package compiles without the DOM
|
|
150
|
+
* library, and a specification states the boxes it is measuring instead of laying out a
|
|
151
|
+
* document, which jsdom reports as zero anyway. A real element satisfies it, because
|
|
152
|
+
* `DOMRect` carries both edges.
|
|
153
|
+
*/
|
|
154
|
+
interface Measured {
|
|
155
|
+
/**
|
|
156
|
+
* Reads the element's box.
|
|
157
|
+
*
|
|
158
|
+
* @returns {Box} The box the element currently occupies.
|
|
159
|
+
*/
|
|
160
|
+
getBoundingClientRect: () => Box;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Reads a CSS length as a number.
|
|
164
|
+
*
|
|
165
|
+
* `getComputedStyle` answers in `px` strings. A comparison against `NaN` is false rather than
|
|
166
|
+
* loud, so a measurement that failed to parse would pass while measuring nothing. The
|
|
167
|
+
* conversion lives here once, and a length with no number in it reads as `0`.
|
|
168
|
+
*
|
|
169
|
+
* @param {string} length - A computed length, with its unit.
|
|
170
|
+
* @returns {number} The number in front of the unit. `0` for a length with no number.
|
|
171
|
+
*/
|
|
172
|
+
declare function pixels(length: string): number;
|
|
173
|
+
/**
|
|
174
|
+
* Measures how far apart two elements sit in the inline direction.
|
|
175
|
+
*
|
|
176
|
+
* Zero means flush: a shared border rather than a gap, which is the claim a segmented control
|
|
177
|
+
* makes. Reading it from the boxes rather than from a class catches the day the rounding and
|
|
178
|
+
* the border stop agreeing.
|
|
179
|
+
*
|
|
180
|
+
* @param {Measured} first - The left-hand element in a row.
|
|
181
|
+
* @param {Measured} second - The element after it.
|
|
182
|
+
* @returns {number} The gap between them, in pixels. Never negative.
|
|
183
|
+
*/
|
|
184
|
+
declare function seamBetween(first: Measured, second: Measured): number;
|
|
185
|
+
//#endregion
|
|
186
|
+
export { type Box, type ManifestFields, type Measured, type ScratchFiles, type ScratchWorkspace, manifest, packageFiles, pixels, scratchWorkspace, seamBetween, withScratchWorkspace, withScratchWorkspaceAsync, workspaceFiles };
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { mkdirSync, mkdtempSync, readFileSync, readdirSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { dirname, join, resolve, sep } from "node:path";
|
|
4
|
+
//#region src/scratch.ts
|
|
5
|
+
/**
|
|
6
|
+
* @fileoverview Builds a scratch workspace in the temporary directory for a specification
|
|
7
|
+
* that reads a tree: a guard, a generator, a release step. The spec writes the files it
|
|
8
|
+
* needs, runs the code under test against the directory, and removes it.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Lists every file below a directory.
|
|
12
|
+
*
|
|
13
|
+
* @param {string} directory - The directory to walk, absolute.
|
|
14
|
+
* @param {string} prefix - The directory's path relative to the root. It ends in `/`, or is empty for the root.
|
|
15
|
+
* @returns {string[]} The paths relative to the root, in directory order.
|
|
16
|
+
*/
|
|
17
|
+
function walk(directory, prefix) {
|
|
18
|
+
return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => entry.isDirectory() ? walk(join(directory, entry.name), `${prefix}${entry.name}/`) : [`${prefix}${entry.name}`]);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Owns a temporary directory for a specification: writes into it, reads from it, lists it
|
|
22
|
+
* and removes it. `scratchWorkspace` creates one.
|
|
23
|
+
*/
|
|
24
|
+
var ScratchWorkspace = class {
|
|
25
|
+
/**
|
|
26
|
+
* Holds the absolute path of the directory.
|
|
27
|
+
*/
|
|
28
|
+
root;
|
|
29
|
+
/**
|
|
30
|
+
* Wraps a directory that already exists. `scratchWorkspace` calls this; a specification
|
|
31
|
+
* does not.
|
|
32
|
+
*
|
|
33
|
+
* @param {string} root - The absolute path of the directory.
|
|
34
|
+
*/
|
|
35
|
+
constructor(root) {
|
|
36
|
+
this.root = root;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Lists every file below the root as a path relative to it, with `/` as the separator.
|
|
40
|
+
*
|
|
41
|
+
* @returns {string[]} The paths, sorted.
|
|
42
|
+
*/
|
|
43
|
+
files() {
|
|
44
|
+
return walk(this.root, "").toSorted();
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Resolves a path relative to the root into an absolute one.
|
|
48
|
+
*
|
|
49
|
+
* @param {string} relative - The path to resolve.
|
|
50
|
+
* @returns {string} The absolute path.
|
|
51
|
+
* @throws {Error} When the path leaves the root.
|
|
52
|
+
*/
|
|
53
|
+
path(relative) {
|
|
54
|
+
const target = resolve(this.root, relative);
|
|
55
|
+
if (target !== this.root && !target.startsWith(this.root + sep)) throw new Error(`${relative} leaves the scratch workspace`);
|
|
56
|
+
return target;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reads a file as UTF-8 text.
|
|
60
|
+
*
|
|
61
|
+
* @param {string} relative - The path to read.
|
|
62
|
+
* @returns {string} The file's content.
|
|
63
|
+
* @throws {Error} When the file does not exist or the path leaves the root.
|
|
64
|
+
*/
|
|
65
|
+
read(relative) {
|
|
66
|
+
return readFileSync(this.path(relative), "utf8");
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Removes the directory and everything in it. A second call does nothing.
|
|
70
|
+
*/
|
|
71
|
+
remove() {
|
|
72
|
+
rmSync(this.root, {
|
|
73
|
+
force: true,
|
|
74
|
+
recursive: true
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Writes files, creating the directories they sit in. An existing file is overwritten.
|
|
79
|
+
*
|
|
80
|
+
* @param {ScratchFiles} files - The content per path.
|
|
81
|
+
* @throws {Error} When a path leaves the root.
|
|
82
|
+
*/
|
|
83
|
+
write(files) {
|
|
84
|
+
for (const [relative, content] of Object.entries(files)) {
|
|
85
|
+
const target = this.path(relative);
|
|
86
|
+
mkdirSync(dirname(target), { recursive: true });
|
|
87
|
+
writeFileSync(target, content);
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Creates a scratch workspace in the temporary directory and writes the files given.
|
|
93
|
+
*
|
|
94
|
+
* @param {ScratchFiles} [files] - The files to write first. Default: none.
|
|
95
|
+
* @returns {ScratchWorkspace} The workspace. The caller removes it.
|
|
96
|
+
*/
|
|
97
|
+
function scratchWorkspace(files = {}) {
|
|
98
|
+
const workspace = new ScratchWorkspace(mkdtempSync(join(tmpdir(), "stealth-")));
|
|
99
|
+
workspace.write(files);
|
|
100
|
+
return workspace;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Runs a function against a scratch workspace and removes the workspace afterwards, whether
|
|
104
|
+
* the function returned or threw.
|
|
105
|
+
*
|
|
106
|
+
* @template Result - The type the function returns.
|
|
107
|
+
* @param {ScratchFiles} files - The files to write first.
|
|
108
|
+
* @param {(workspace: ScratchWorkspace) => Result} run - The function to run.
|
|
109
|
+
* @returns {Result} The function's return value.
|
|
110
|
+
*/
|
|
111
|
+
function withScratchWorkspace(files, run) {
|
|
112
|
+
const workspace = scratchWorkspace(files);
|
|
113
|
+
try {
|
|
114
|
+
return run(workspace);
|
|
115
|
+
} finally {
|
|
116
|
+
workspace.remove();
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Runs an asynchronous function against a scratch workspace and removes the workspace after
|
|
121
|
+
* it settles, whether it resolved or rejected.
|
|
122
|
+
*
|
|
123
|
+
* @template Result - The type the function resolves to.
|
|
124
|
+
* @param {ScratchFiles} files - The files to write first.
|
|
125
|
+
* @param {(workspace: ScratchWorkspace) => Promise<Result>} run - The function to run.
|
|
126
|
+
* @returns {Promise<Result>} The value the function resolved to.
|
|
127
|
+
*/
|
|
128
|
+
async function withScratchWorkspaceAsync(files, run) {
|
|
129
|
+
const workspace = scratchWorkspace(files);
|
|
130
|
+
try {
|
|
131
|
+
return await run(workspace);
|
|
132
|
+
} finally {
|
|
133
|
+
workspace.remove();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/manifest.ts
|
|
138
|
+
/**
|
|
139
|
+
* Serialises a manifest the way a package manager writes one: two-space indentation and a
|
|
140
|
+
* final newline.
|
|
141
|
+
*
|
|
142
|
+
* @param {ManifestFields} fields - The fields to write. `version` defaults to `0.0.0`.
|
|
143
|
+
* @returns {string} The JSON text.
|
|
144
|
+
*/
|
|
145
|
+
function manifest(fields) {
|
|
146
|
+
return `${JSON.stringify({
|
|
147
|
+
version: "0.0.0",
|
|
148
|
+
...fields
|
|
149
|
+
}, null, 2)}\n`;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Builds the files of one package under a directory: its manifest, and any other files at
|
|
153
|
+
* paths relative to that directory.
|
|
154
|
+
*
|
|
155
|
+
* @param {string} directory - The package's directory, relative to the workspace root.
|
|
156
|
+
* @param {ManifestFields} fields - The fields to write into the manifest.
|
|
157
|
+
* @param {ScratchFiles} [files] - Other files of the package, relative to its directory. Default: none.
|
|
158
|
+
* @returns {ScratchFiles} Every file of the package, keyed relative to the workspace root.
|
|
159
|
+
*/
|
|
160
|
+
function packageFiles(directory, fields, files = {}) {
|
|
161
|
+
const entries = [[`${directory}/package.json`, manifest(fields)], ...Object.entries(files).map(([path, content]) => [`${directory}/${path}`, content])];
|
|
162
|
+
return Object.fromEntries(entries);
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* Builds the root manifest of a workspace: private, named `root`, with the globs given.
|
|
166
|
+
*
|
|
167
|
+
* @param {readonly string[]} workspaces - The workspace globs: `core/*`, `tools/*`.
|
|
168
|
+
* @param {Readonly<Record<string, unknown>>} [fields] - Other root fields, such as a catalog or devDependencies. Default: none.
|
|
169
|
+
* @returns {ScratchFiles} The root `package.json`.
|
|
170
|
+
*/
|
|
171
|
+
function workspaceFiles(workspaces, fields = {}) {
|
|
172
|
+
return { "package.json": manifest({
|
|
173
|
+
name: "root",
|
|
174
|
+
private: true,
|
|
175
|
+
workspaces: [...workspaces],
|
|
176
|
+
...fields
|
|
177
|
+
}) };
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/measure.ts
|
|
181
|
+
/**
|
|
182
|
+
* Reads a CSS length as a number.
|
|
183
|
+
*
|
|
184
|
+
* `getComputedStyle` answers in `px` strings. A comparison against `NaN` is false rather than
|
|
185
|
+
* loud, so a measurement that failed to parse would pass while measuring nothing. The
|
|
186
|
+
* conversion lives here once, and a length with no number in it reads as `0`.
|
|
187
|
+
*
|
|
188
|
+
* @param {string} length - A computed length, with its unit.
|
|
189
|
+
* @returns {number} The number in front of the unit. `0` for a length with no number.
|
|
190
|
+
*/
|
|
191
|
+
function pixels(length) {
|
|
192
|
+
const value = Number.parseFloat(length);
|
|
193
|
+
return Number.isNaN(value) ? 0 : value;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Measures how far apart two elements sit in the inline direction.
|
|
197
|
+
*
|
|
198
|
+
* Zero means flush: a shared border rather than a gap, which is the claim a segmented control
|
|
199
|
+
* makes. Reading it from the boxes rather than from a class catches the day the rounding and
|
|
200
|
+
* the border stop agreeing.
|
|
201
|
+
*
|
|
202
|
+
* @param {Measured} first - The left-hand element in a row.
|
|
203
|
+
* @param {Measured} second - The element after it.
|
|
204
|
+
* @returns {number} The gap between them, in pixels. Never negative.
|
|
205
|
+
*/
|
|
206
|
+
function seamBetween(first, second) {
|
|
207
|
+
return Math.abs(second.getBoundingClientRect().left - first.getBoundingClientRect().right);
|
|
208
|
+
}
|
|
209
|
+
//#endregion
|
|
210
|
+
export { manifest, packageFiles, pixels, scratchWorkspace, seamBetween, withScratchWorkspace, withScratchWorkspaceAsync, workspaceFiles };
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@stealthscale/tool-testing",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Builds the scratch workspace a specification reads a tree from, writes the manifests in it, and measures what a rendered element draws.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/stealth-scale/tooling.git",
|
|
9
|
+
"directory": "tools/testing"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"imports": {
|
|
17
|
+
"#*": "./src/*"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"tooling-source": "./src/index.ts",
|
|
22
|
+
"default": "./dist/index.mjs"
|
|
23
|
+
},
|
|
24
|
+
"./package.json": "./package.json"
|
|
25
|
+
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"exports": {
|
|
28
|
+
".": "./dist/index.mjs",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"scripts": {
|
|
34
|
+
"build": "vp pack src/index.ts"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@stealthscale/tool-config": "^0.1.0"
|
|
38
|
+
}
|
|
39
|
+
}
|