aronrepo 1.0.0-beta.9 → 1.0.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 +533 -0
- package/dist/bin/index +26 -0
- package/dist/bin/index.map +7 -0
- package/package.json +1 -36
package/README.md
ADDED
|
@@ -0,0 +1,533 @@
|
|
|
1
|
+
<br>
|
|
2
|
+
<div align="center">
|
|
3
|
+
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://repo.master.co">
|
|
6
|
+
<picture>
|
|
7
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/33840671/204220749-4536401e-20c4-49b7-bf37-b07fce15f1c2.svg">
|
|
8
|
+
<source media="(prefers-color-scheme: light)" srcset="https://user-images.githubusercontent.com/33840671/204220755-744f6b4f-a90e-442f-bd30-53ce7995a8f8.svg">
|
|
9
|
+
<img alt="aronrepo" src="https://user-images.githubusercontent.com/33840671/204220755-744f6b4f-a90e-442f-bd30-53ce7995a8f8.svg" width="100%">
|
|
10
|
+
</picture>
|
|
11
|
+
</a>
|
|
12
|
+
</p>
|
|
13
|
+
<p align="center">A monorepo ecosystem integrating first-class packages and build systems</p>
|
|
14
|
+
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a aria-label="overview" href="https://github.com/1aron/aronrepo">
|
|
17
|
+
<picture>
|
|
18
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=212022&style=for-the-badge">
|
|
19
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge">
|
|
20
|
+
<img alt="NPM Version" src="https://img.shields.io/badge/%E2%AC%85%20back-%20?color=f6f7f8&style=for-the-badge">
|
|
21
|
+
</picture>
|
|
22
|
+
</a>
|
|
23
|
+
<a aria-label="GitHub release (latest by date including pre-releases)" href="https://github.com/1aron/aronrepo/releases">
|
|
24
|
+
<picture>
|
|
25
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/v/release/1aron/aronrepo?include_prereleases&color=212022&label=&style=for-the-badge&logo=github&logoColor=fff">
|
|
26
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/v/release/1aron/aronrepo?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github&logoColor=%23000">
|
|
27
|
+
<img alt="NPM Version" src="https://img.shields.io/github/v/release/1aron/aronrepo?include_prereleases&color=f6f7f8&label=&style=for-the-badge&logo=github">
|
|
28
|
+
</picture>
|
|
29
|
+
</a>
|
|
30
|
+
<a aria-label="NPM Package" href="https://www.npmjs.com/package/aronrepo">
|
|
31
|
+
<picture>
|
|
32
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/npm/dm/aronrepo?color=212022&label=%20&logo=npm&style=for-the-badge">
|
|
33
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/npm/dm/aronrepo?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
34
|
+
<img alt="NPM package ( download / month )" src="https://img.shields.io/npm/dm/aronrepo?color=f6f7f8&label=%20&logo=npm&style=for-the-badge">
|
|
35
|
+
</picture>
|
|
36
|
+
</a>
|
|
37
|
+
<a aria-label="Follow @aron1tw" href="https://twitter.com/aron1tw">
|
|
38
|
+
<picture>
|
|
39
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=212022&logo=twitter&style=for-the-badge">
|
|
40
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
41
|
+
<img alt="Follow @mastercorg" src="https://img.shields.io/static/v1?label=%20&message=twitter&color=f6f7f8&logo=twitter&style=for-the-badge">
|
|
42
|
+
</picture>
|
|
43
|
+
</a>
|
|
44
|
+
<a aria-label="Github Actions" href="https://github.com/1aron/aronrepo/actions/workflows/release.yml">
|
|
45
|
+
<picture>
|
|
46
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/github/actions/workflow/status/1aron/aronrepo/release.yml?branch=beta&label=%20&message=twitter&color=212022&logo=githubactions&style=for-the-badge">
|
|
47
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/github/actions/workflow/status/1aron/aronrepo/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
48
|
+
<img alt="Github release actions" src="https://img.shields.io/github/actions/workflow/status/1aron/aronrepo/release.yml?branch=beta&label=%20&message=twitter&color=f6f7f8&logo=githubactions&style=for-the-badge&logoColor=%23000">
|
|
49
|
+
</picture>
|
|
50
|
+
</a>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
</div>
|
|
54
|
+
|
|
55
|
+
## Features
|
|
56
|
+
|
|
57
|
+
**Monorepo**
|
|
58
|
+
- Using a high-performance build system —— [Turborepo](https://turbo.build/repo)
|
|
59
|
+
- Run the `build`, `dev`, `test`, `lint` commands across all workspaces
|
|
60
|
+
- Remember what you've built and skip the stuff that's already been computed
|
|
61
|
+
- Multiple workspaces work simultaneously, just like one workspace used to.
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
**Packing**
|
|
66
|
+
- An extremely fast bundler built on top of [esbuild](https://esbuild.github.io/)
|
|
67
|
+
- Output or watch multiple formats in one-linear command
|
|
68
|
+
- Support **ESM**, **CJS**, and **IIFE** JavaScript modules
|
|
69
|
+
- Support **CSS** bundle
|
|
70
|
+
- Generate `.d.ts` type declarations
|
|
71
|
+
- Extract options from `package.json`
|
|
72
|
+
- Prevent bundling `dependencies` and `peerDependencies` by `package.json`
|
|
73
|
+
|
|
74
|
+
**Versioning**
|
|
75
|
+
- Synchronize versions of packages in all workspaces
|
|
76
|
+
- Bump packages to a specific version by the `.workspaces` of `package.json`
|
|
77
|
+
- Bump versions by analyzing `dependencies` and `peerDependencies` of the workspace
|
|
78
|
+
- Prevent bumping versions for `private: true` packages
|
|
79
|
+
|
|
80
|
+
## Getting Started
|
|
81
|
+
|
|
82
|
+
Add `packages/**` to `.workspaces` of the root `./package.json`
|
|
83
|
+
```json
|
|
84
|
+
{
|
|
85
|
+
"workspaces": [
|
|
86
|
+
"packages/**"
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
```
|
|
90
|
+
Install CLI and core packages by `aronrepo`:
|
|
91
|
+
```bash
|
|
92
|
+
npm i aronrepo -D
|
|
93
|
+
```
|
|
94
|
+
- Requires `npm@>=7` when using `npm`
|
|
95
|
+
- Set [`auto-install-peers`](https://pnpm.io/next/npmrc#auto-install-peers) when using `pnpm`
|
|
96
|
+
- You can also manually install [`peerDependencies`](https://github.com/1aron/aronrepo/blob/beta/packages/aronrepo/package.json#L32-L41) for fixed versions
|
|
97
|
+
|
|
98
|
+
To create your first package, you may automate the required steps to define a new workspace using `npm init`.
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
npm init -w ./packages/a
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
When the package is ready, including the dependencies setup, run `npm i` in the project root directory to install all dependencies, including the workspaces.
|
|
105
|
+
|
|
106
|
+
## Pack
|
|
107
|
+
|
|
108
|
+
Bundling your TypeScript and CSS packages with zero configuration.
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
aron pack [entryPaths...]
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
[Check out the available options here for now](https://github.com/1aron/aronrepo/blob/beta/packages/aronrepo/src/commands/pack.ts#L17-L25)
|
|
115
|
+
|
|
116
|
+
`aron pack` analyzes the `package.json` entry point relative to input sources in the `src` directory for builds.
|
|
117
|
+
|
|
118
|
+
### Javascript packages
|
|
119
|
+
|
|
120
|
+
```diff
|
|
121
|
+
.
|
|
122
|
+
├── package.json
|
|
123
|
+
└── packages
|
|
124
|
+
└─── a
|
|
125
|
+
├─── src
|
|
126
|
+
│ ├─── index.ts
|
|
127
|
+
│ └─── index.browser.ts
|
|
128
|
+
+ ├─── dist
|
|
129
|
+
+ │ ├─── index.cjs
|
|
130
|
+
+ │ ├─── index.mjs
|
|
131
|
+
+ │ ├─── index.d.ts
|
|
132
|
+
+ │ └─── index.browser.ts
|
|
133
|
+
└─── package.json
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Simultaneously output `cjs`, `esm`, `iife`, `type declarations` respectively according to `main`, `module`, `browser`, `types` of `package.json`
|
|
137
|
+
|
|
138
|
+
```json
|
|
139
|
+
{
|
|
140
|
+
"name": "a",
|
|
141
|
+
"scripts": {
|
|
142
|
+
"build": "aron pack",
|
|
143
|
+
"dev": "npm run build -- --watch"
|
|
144
|
+
},
|
|
145
|
+
"main": "dist/index.cjs",
|
|
146
|
+
"browser": "dist/index.browser.js",
|
|
147
|
+
"module": "dist/index.mjs",
|
|
148
|
+
"types": "dist/index.d.ts",
|
|
149
|
+
"jsnext:main": "dist/index.mjs",
|
|
150
|
+
"esnext": "dist/index.mjs",
|
|
151
|
+
"exports": {
|
|
152
|
+
".": {
|
|
153
|
+
"require": "./dist/index.cjs",
|
|
154
|
+
"import": "./dist/index.mjs",
|
|
155
|
+
"types": "./dist/index.d.ts"
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"files": [
|
|
159
|
+
"dist"
|
|
160
|
+
]
|
|
161
|
+
}
|
|
162
|
+
```
|
|
163
|
+
If you only want to pack specific javascript modules, remove the corresponding entry point from `package.json`.
|
|
164
|
+
|
|
165
|
+
Run with the above configuration:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
npm run build
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
<img width="628" alt="cjs-esm-iife-type-pack" src="https://user-images.githubusercontent.com/33840671/204300928-23e2d2f9-b0ed-4feb-b7cf-1b9ba6cf8127.png">
|
|
172
|
+
|
|
173
|
+
Now import the above package `a` in your project or publish it.
|
|
174
|
+
|
|
175
|
+
```ts
|
|
176
|
+
import 'a'
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
### CSS packages
|
|
180
|
+
|
|
181
|
+
```diff
|
|
182
|
+
.
|
|
183
|
+
├── package.json
|
|
184
|
+
└── packages
|
|
185
|
+
└─── b
|
|
186
|
+
├─── src
|
|
187
|
+
│ └─── index.css
|
|
188
|
+
+ ├─── dist
|
|
189
|
+
+ │ └─── index.css
|
|
190
|
+
└─── package.json
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Packaging CSS is more straightforward, configuring `style` and `main` entry points in `package.json`.
|
|
194
|
+
|
|
195
|
+
```json
|
|
196
|
+
{
|
|
197
|
+
"name": "b",
|
|
198
|
+
"scripts": {
|
|
199
|
+
"build": "aron pack",
|
|
200
|
+
"dev": "npm run build -- --watch"
|
|
201
|
+
},
|
|
202
|
+
"main": "./dist/index.css",
|
|
203
|
+
"style": "./dist/index.css",
|
|
204
|
+
"files": [
|
|
205
|
+
"dist"
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Run with the above configuration:
|
|
211
|
+
|
|
212
|
+
```bash
|
|
213
|
+
npm run build
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
<img width="523" alt="css-pack" src="https://user-images.githubusercontent.com/33840671/204450194-7831c448-2e21-4ce8-8c45-5139febc10e6.png">
|
|
217
|
+
|
|
218
|
+
Now import the above package `b` in your project or publish it.
|
|
219
|
+
|
|
220
|
+
```css
|
|
221
|
+
@import 'b'
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### Multiple entry points
|
|
225
|
+
|
|
226
|
+
`aron pack <entryPaths...>` supports glob patterns that let you specify multiple entry points at once, including the output of nested directories.
|
|
227
|
+
|
|
228
|
+
Specifying an entry point will cause the Javascript output `format` to be preset to `cjs,esm`.
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
aron src/**/*.ts
|
|
232
|
+
```
|
|
233
|
+
```diff
|
|
234
|
+
.
|
|
235
|
+
├── package.json
|
|
236
|
+
└── packages
|
|
237
|
+
└─── a
|
|
238
|
+
├─── src
|
|
239
|
+
│ ├─── index.ts
|
|
240
|
+
│ └─── utils
|
|
241
|
+
│ └─── exec.ts
|
|
242
|
+
+ ├─── dist
|
|
243
|
+
+ │ ├─── index.cjs
|
|
244
|
+
+ │ ├─── index.mjs
|
|
245
|
+
+ │ ├─── index.d.ts
|
|
246
|
+
+ │ └─── utils
|
|
247
|
+
+ │ ├─── exec.cjs
|
|
248
|
+
+ │ ├─── exec.mjs
|
|
249
|
+
+ │ └─── exec.d.ts
|
|
250
|
+
└─── package.json
|
|
251
|
+
```
|
|
252
|
+
The same goes for multiple CSS entries:
|
|
253
|
+
```
|
|
254
|
+
aron src/**/*.css
|
|
255
|
+
```
|
|
256
|
+
```diff
|
|
257
|
+
.
|
|
258
|
+
├── package.json
|
|
259
|
+
└── packages
|
|
260
|
+
└─── a
|
|
261
|
+
├─── src
|
|
262
|
+
│ ├─── index.css
|
|
263
|
+
│ └─── components
|
|
264
|
+
│ ├─── card.css
|
|
265
|
+
│ └─── button.css
|
|
266
|
+
+ ├─── dist
|
|
267
|
+
+ │ ├─── index.css
|
|
268
|
+
+ │ └─── components
|
|
269
|
+
+ │ ├─── card.css
|
|
270
|
+
+ │ └─── button.css
|
|
271
|
+
└─── package.json
|
|
272
|
+
```
|
|
273
|
+
Usually, it would be best to bundle CSS packages through a main `index.css` and output other CSS files so developers can import on demand instead of the whole package. For example [@master/keyframes.css](https://www.npmjs.com/package/@master/keyframes.css)
|
|
274
|
+
|
|
275
|
+
### Exclude external dependencies
|
|
276
|
+
`aron pack` automatically excludes external dependencies to be bundled by the `.dependencies` and `peerDependencies` of `package.json`
|
|
277
|
+
|
|
278
|
+
`src/index.ts`
|
|
279
|
+
```ts
|
|
280
|
+
import '@master/css'
|
|
281
|
+
import '@master/css.webpack'
|
|
282
|
+
import '@master/style-element.react'
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
`package.json`
|
|
286
|
+
```json
|
|
287
|
+
{
|
|
288
|
+
"name": "externals",
|
|
289
|
+
"main": "dist/index.cjs",
|
|
290
|
+
"exports": {
|
|
291
|
+
".": {
|
|
292
|
+
"require": "./dist/index.cjs"
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"files": [
|
|
296
|
+
"dist"
|
|
297
|
+
],
|
|
298
|
+
"dependencies": {
|
|
299
|
+
"@master/css": "^2.0.0-beta.55"
|
|
300
|
+
},
|
|
301
|
+
"peerDependencies": {
|
|
302
|
+
"@master/style-element.react": "^1.1.6"
|
|
303
|
+
},
|
|
304
|
+
"devDependencies": {
|
|
305
|
+
"@master/css.webpack": "^2.0.0-beta.55"
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
Run with the above setup:
|
|
312
|
+
|
|
313
|
+
```bash
|
|
314
|
+
aron pack --platform node
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
<img width="568" alt="exclude-externals-pack" src="https://user-images.githubusercontent.com/33840671/204489494-10854837-be15-49fd-a1c8-0e02fb3e174a.png">
|
|
318
|
+
|
|
319
|
+
`@master/css.webpack` is bundled into `dist/index.cjs`, except for `@master/css` and `@master/style-element.react`.
|
|
320
|
+
|
|
321
|
+
So if there is an external package that needs to be bundled, you just install it to `devDependencies` via `npm i <some-package> --save-dev`, then `aron pack` will not exclude it.
|
|
322
|
+
|
|
323
|
+
## Version
|
|
324
|
+
Smartly bump all workspace-dependent packages to specific versions.
|
|
325
|
+
|
|
326
|
+
```bash
|
|
327
|
+
aron version <version>
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
[Check out the available options here for now](https://github.com/1aron/aronrepo/blob/beta/packages/aronrepo/src/commands/version.ts#L16-L18)
|
|
331
|
+
|
|
332
|
+
The command automatically bumps the version of all packages by scanning all workspaces and analyzing `dependencies` and `peerDependencies` of `package.json`
|
|
333
|
+
|
|
334
|
+
```diff
|
|
335
|
+
.
|
|
336
|
+
├── package.json
|
|
337
|
+
└── packages
|
|
338
|
+
├─── a
|
|
339
|
+
| └─── package.json
|
|
340
|
+
├─── b
|
|
341
|
+
| └─── package.json
|
|
342
|
+
└─── c
|
|
343
|
+
└─── package.json
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
This command scans all workspaces for dependencies with unspecified versions `""` considered a project package, then replaces them with the next version.
|
|
347
|
+
|
|
348
|
+
Now bump all dependent and workspace packages to a specified version:
|
|
349
|
+
|
|
350
|
+
```
|
|
351
|
+
aron version 1.2.0
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
<img width="628" alt="version" src="https://user-images.githubusercontent.com/33840671/204528593-a7a982f1-2e62-4a8e-95c3-122963f2254c.png">
|
|
355
|
+
|
|
356
|
+
`packages/a/package.json`
|
|
357
|
+
|
|
358
|
+
```diff
|
|
359
|
+
{
|
|
360
|
+
"name": "a",
|
|
361
|
+
+ "version": "^1.2.0",
|
|
362
|
+
"dependencies": {
|
|
363
|
+
- "b": "",
|
|
364
|
+
+ "b": "^1.2.0"
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
`packages/b/package.json`
|
|
370
|
+
|
|
371
|
+
```diff
|
|
372
|
+
{
|
|
373
|
+
"name": "b",
|
|
374
|
+
+ "version": "^1.2.0"
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
`packages/c/package.json`
|
|
379
|
+
|
|
380
|
+
```diff
|
|
381
|
+
{
|
|
382
|
+
"name": "c",
|
|
383
|
+
+ "version": "^1.2.0",
|
|
384
|
+
"peerDependencies": {
|
|
385
|
+
- "a": "",
|
|
386
|
+
+ "b": "^1.2.0"
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
For version range, check out the [semver](https://github.com/npm/node-semver#versions)
|
|
392
|
+
|
|
393
|
+
Typically, you would use [Aron's semantic release](https://github.com/1aron/aronrepo/tree/beta/packages/semantic-release-config) with CI to automate the version and release commands.
|
|
394
|
+
|
|
395
|
+
## Build system for monorepo
|
|
396
|
+
|
|
397
|
+
Most workspace packages will pre-set script commands, such as `build`, `test`, and `lint`. Since features depend on each other, builds will be executed sequentially.
|
|
398
|
+
|
|
399
|
+
You can now use [Turborepo](https://turbo.build/repo) to easily build complex systems and run commands in one-linear.
|
|
400
|
+
|
|
401
|
+

|
|
402
|
+
|
|
403
|
+
Set up the `/turbo.json`:
|
|
404
|
+
|
|
405
|
+
```json
|
|
406
|
+
{
|
|
407
|
+
"$schema": "https://turbo.build/schema.json",
|
|
408
|
+
"pipeline": {
|
|
409
|
+
"dev": {
|
|
410
|
+
"cache": false,
|
|
411
|
+
"dependsOn": ["^build"]
|
|
412
|
+
},
|
|
413
|
+
"build": {
|
|
414
|
+
"dependsOn": ["^build"],
|
|
415
|
+
"outputs": ["dist/**"]
|
|
416
|
+
},
|
|
417
|
+
"test": {
|
|
418
|
+
"outputs": [],
|
|
419
|
+
"inputs": [
|
|
420
|
+
"src/**/*.tsx",
|
|
421
|
+
"src/**/*.ts",
|
|
422
|
+
"tests/**/*.ts"
|
|
423
|
+
]
|
|
424
|
+
},
|
|
425
|
+
"lint": {
|
|
426
|
+
"outputs": []
|
|
427
|
+
},
|
|
428
|
+
"type-check": {
|
|
429
|
+
"outputs": ["dist/**"]
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
Set up the scripts of `/package.json`:
|
|
436
|
+
```json
|
|
437
|
+
{
|
|
438
|
+
"scripts": {
|
|
439
|
+
"dev": "turbo run dev",
|
|
440
|
+
"build": "turbo run build",
|
|
441
|
+
"test": "turbo run test --parallel",
|
|
442
|
+
"lint": "turbo run lint --parallel",
|
|
443
|
+
"type-check": "turbo run type-check --parallel"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
In most cases, `dev` and `build` cannot add the `--parallel` flag, which breaks their dependencies.
|
|
448
|
+
|
|
449
|
+
Typical workspace scripts for authoring a package:
|
|
450
|
+
|
|
451
|
+
```json
|
|
452
|
+
{
|
|
453
|
+
"scripts": {
|
|
454
|
+
"build": "aron pack",
|
|
455
|
+
"dev": "npm run build -- --watch",
|
|
456
|
+
"test": "jest",
|
|
457
|
+
"type-check": "tsc --noEmit",
|
|
458
|
+
"lint": "eslint src"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
From now on, you only need to **run the command in the project root** after opening the project.
|
|
464
|
+
|
|
465
|
+
```bash
|
|
466
|
+
npm run dev
|
|
467
|
+
```
|
|
468
|
+
Build your application or package:
|
|
469
|
+
```bash
|
|
470
|
+
npm run build
|
|
471
|
+
```
|
|
472
|
+
Test your business logic or UI by running scripts:
|
|
473
|
+
```bash
|
|
474
|
+
npm run test
|
|
475
|
+
```
|
|
476
|
+
Find and fix problems in JavaScript code before building:
|
|
477
|
+
```bash
|
|
478
|
+
npm run lint
|
|
479
|
+
```
|
|
480
|
+
Improve reliability with TypeScript's type checking:
|
|
481
|
+
```bash
|
|
482
|
+
npm run type-check
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
### Continuous Integration
|
|
486
|
+
|
|
487
|
+
With the well-configured build system, almost all commands can be automated through CI, taking GitHub Actions as an example:
|
|
488
|
+
|
|
489
|
+
Build automated tests on the `beta`, the `main`, and the pull request stream:
|
|
490
|
+
```yml
|
|
491
|
+
name: Test
|
|
492
|
+
on:
|
|
493
|
+
push:
|
|
494
|
+
branches:
|
|
495
|
+
- main
|
|
496
|
+
- beta
|
|
497
|
+
pull_request_target:
|
|
498
|
+
types:
|
|
499
|
+
- opened
|
|
500
|
+
- synchronize
|
|
501
|
+
|
|
502
|
+
jobs:
|
|
503
|
+
version:
|
|
504
|
+
timeout-minutes: 15
|
|
505
|
+
runs-on: ubuntu-20.04
|
|
506
|
+
strategy:
|
|
507
|
+
matrix:
|
|
508
|
+
node-version: [18.12.1]
|
|
509
|
+
steps:
|
|
510
|
+
- uses: actions/checkout@v3
|
|
511
|
+
- uses: actions/setup-node@v3
|
|
512
|
+
with:
|
|
513
|
+
node-version: ${{ matrix.node-version }}
|
|
514
|
+
cache: 'npm'
|
|
515
|
+
- run: npm ci
|
|
516
|
+
- run: npm run build
|
|
517
|
+
- run: npm run test
|
|
518
|
+
```
|
|
519
|
+
The same goes for `lint` and `type-check`.
|
|
520
|
+
|
|
521
|
+
While the `build` command will work with `deploy` and `release`, aronrepo builds a complete package release workflow and the tools needed during it.
|
|
522
|
+
|
|
523
|
+
Next, check out the [Aron's semantic release](https://github.com/1aron/aronrepo/tree/beta/packages/semantic-release-config)
|
|
524
|
+
|
|
525
|
+
<br>
|
|
526
|
+
|
|
527
|
+
<a aria-label="overview" href="https://github.com/1aron/aronrepo#ecosystem">
|
|
528
|
+
<picture>
|
|
529
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://img.shields.io/badge/%E2%AC%85%20back%20to%20contents-%20?color=212022&style=for-the-badge">
|
|
530
|
+
<source media="(prefers-color-scheme: light)" srcset="https://img.shields.io/badge/%E2%AC%85%20back%20to%20contents-%20?color=f6f7f8&style=for-the-badge">
|
|
531
|
+
<img alt="NPM Version" src="https://img.shields.io/badge/%E2%AC%85%20back%20to%20contents-%20?color=f6f7f8&style=for-the-badge">
|
|
532
|
+
</picture>
|
|
533
|
+
</a>
|
package/dist/bin/index
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
var jn=Object.create;var Ae=Object.defineProperty;var $n=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var Rn=Object.getPrototypeOf,An=Object.prototype.hasOwnProperty;var S=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Bn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Nn(t))!An.call(e,o)&&o!==r&&Ae(e,o,{get:()=>t[o],enumerable:!(n=$n(t,o))||n.enumerable});return e};var m=(e,t,r)=>(r=e!=null?jn(Rn(e)):{},Bn(t||!e||!e.__esModule?Ae(r,"default",{value:e,enumerable:!0}):r,e));var He=S((fo,qe)=>{qe.exports=Ue;Ue.sync=Fn;var Fe=require("fs");function _n(e,t){var r=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var o=r[n].toLowerCase();if(o&&e.substr(-o.length).toLowerCase()===o)return!0}return!1}function De(e,t,r){return!e.isSymbolicLink()&&!e.isFile()?!1:_n(t,r)}function Ue(e,t,r){Fe.stat(e,function(n,o){r(n,n?!1:De(o,e,t))})}function Fn(e,t){return De(Fe.statSync(e),e,t)}});var Xe=S((lo,We)=>{We.exports=Ke;Ke.sync=Dn;var ze=require("fs");function Ke(e,t,r){ze.stat(e,function(n,o){r(n,n?!1:Ve(o,t))})}function Dn(e,t){return Ve(ze.statSync(e),t)}function Ve(e,t){return e.isFile()&&Un(e,t)}function Un(e,t){var r=e.mode,n=e.uid,o=e.gid,i=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),s=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),a=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=a|l,p=r&u||r&l&&o===s||r&a&&n===i||r&c&&i===0;return p}});var Ze=S((mo,Ye)=>{var po=require("fs"),z;process.platform==="win32"||global.TESTING_WINDOWS?z=He():z=Xe();Ye.exports=te;te.sync=qn;function te(e,t,r){if(typeof t=="function"&&(r=t,t={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,o){te(e,t||{},function(i,s){i?o(i):n(s)})})}z(e,t||{},function(n,o){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,o=!1),r(n,o)})}function qn(e,t){try{return z.sync(e,t||{})}catch(r){if(t&&t.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var ot=S((ho,rt)=>{var j=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",Je=require("path"),Hn=j?";":":",Qe=Ze(),et=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),tt=(e,t)=>{let r=t.colon||Hn,n=e.match(/\//)||j&&e.match(/\\/)?[""]:[...j?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(r)],o=j?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",i=j?o.split(r):[""];return j&&e.indexOf(".")!==-1&&i[0]!==""&&i.unshift(""),{pathEnv:n,pathExt:i,pathExtExe:o}},nt=(e,t,r)=>{typeof t=="function"&&(r=t,t={}),t||(t={});let{pathEnv:n,pathExt:o,pathExtExe:i}=tt(e,t),s=[],a=u=>new Promise((c,p)=>{if(u===n.length)return t.all&&s.length?c(s):p(et(e));let d=n[u],f=/^".*"$/.test(d)?d.slice(1,-1):d,g=Je.join(f,e),x=!f&&/^\.[\\\/]/.test(e)?e.slice(0,2)+g:g;c(l(x,u,0))}),l=(u,c,p)=>new Promise((d,f)=>{if(p===o.length)return d(a(c+1));let g=o[p];Qe(u+g,{pathExt:i},(x,y)=>{if(!x&&y)if(t.all)s.push(u+g);else return d(u+g);return d(l(u,c,p+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},zn=(e,t)=>{t=t||{};let{pathEnv:r,pathExt:n,pathExtExe:o}=tt(e,t),i=[];for(let s=0;s<r.length;s++){let a=r[s],l=/^".*"$/.test(a)?a.slice(1,-1):a,u=Je.join(l,e),c=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let p=0;p<n.length;p++){let d=c+n[p];try{if(Qe.sync(d,{pathExt:o}))if(t.all)i.push(d);else return d}catch{}}}if(t.all&&i.length)return i;if(t.nothrow)return null;throw et(e)};rt.exports=nt;nt.sync=zn});var st=S((go,ne)=>{"use strict";var it=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};ne.exports=it;ne.exports.default=it});var ft=S((yo,ut)=>{"use strict";var at=require("path"),Kn=ot(),Vn=st();function ct(e,t){let r=e.options.env||process.env,n=process.cwd(),o=e.options.cwd!=null,i=o&&process.chdir!==void 0&&!process.chdir.disabled;if(i)try{process.chdir(e.options.cwd)}catch{}let s;try{s=Kn.sync(e.command,{path:r[Vn({env:r})],pathExt:t?at.delimiter:void 0})}catch{}finally{i&&process.chdir(n)}return s&&(s=at.resolve(o?e.options.cwd:"",s)),s}function Wn(e){return ct(e)||ct(e,!0)}ut.exports=Wn});var lt=S((xo,oe)=>{"use strict";var re=/([()\][%!^"`<>&|;, *?])/g;function Xn(e){return e=e.replace(re,"^$1"),e}function Yn(e,t){return e=`${e}`,e=e.replace(/(\\*)"/g,'$1$1\\"'),e=e.replace(/(\\*)$/,"$1$1"),e=`"${e}"`,e=e.replace(re,"^$1"),t&&(e=e.replace(re,"^$1")),e}oe.exports.command=Xn;oe.exports.argument=Yn});var pt=S((So,dt)=>{"use strict";dt.exports=/^#!(.*)/});var ht=S((bo,mt)=>{"use strict";var Zn=pt();mt.exports=(e="")=>{let t=e.match(Zn);if(!t)return null;let[r,n]=t[0].replace(/#! ?/,"").split(" "),o=r.split("/").pop();return o==="env"?n:n?`${o} ${n}`:o}});var yt=S((wo,gt)=>{"use strict";var ie=require("fs"),Jn=ht();function Qn(e){let r=Buffer.alloc(150),n;try{n=ie.openSync(e,"r"),ie.readSync(n,r,0,150,0),ie.closeSync(n)}catch{}return Jn(r.toString())}gt.exports=Qn});var wt=S((Eo,bt)=>{"use strict";var er=require("path"),xt=ft(),St=lt(),tr=yt(),nr=process.platform==="win32",rr=/\.(?:com|exe)$/i,or=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function ir(e){e.file=xt(e);let t=e.file&&tr(e.file);return t?(e.args.unshift(e.file),e.command=t,xt(e)):e.file}function sr(e){if(!nr)return e;let t=ir(e),r=!rr.test(t);if(e.options.forceShell||r){let n=or.test(t);e.command=er.normalize(e.command),e.command=St.command(e.command),e.args=e.args.map(i=>St.argument(i,n));let o=[e.command].concat(e.args).join(" ");e.args=["/d","/s","/c",`"${o}"`],e.command=process.env.comspec||"cmd.exe",e.options.windowsVerbatimArguments=!0}return e}function ar(e,t,r){t&&!Array.isArray(t)&&(r=t,t=null),t=t?t.slice(0):[],r=Object.assign({},r);let n={command:e,args:t,options:r,file:void 0,original:{command:e,args:t}};return r.shell?n:sr(n)}bt.exports=ar});var Tt=S((Io,It)=>{"use strict";var se=process.platform==="win32";function ae(e,t){return Object.assign(new Error(`${t} ${e.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${t} ${e.command}`,path:e.command,spawnargs:e.args})}function cr(e,t){if(!se)return;let r=e.emit;e.emit=function(n,o){if(n==="exit"){let i=Et(o,t,"spawn");if(i)return r.call(e,"error",i)}return r.apply(e,arguments)}}function Et(e,t){return se&&e===1&&!t.file?ae(t.original,"spawn"):null}function ur(e,t){return se&&e===1&&!t.file?ae(t.original,"spawnSync"):null}It.exports={hookChildProcess:cr,verifyENOENT:Et,verifyENOENTSync:ur,notFoundError:ae}});var kt=S((To,$)=>{"use strict";var Pt=require("child_process"),ce=wt(),ue=Tt();function vt(e,t,r){let n=ce(e,t,r),o=Pt.spawn(n.command,n.args,n.options);return ue.hookChildProcess(o,n),o}function fr(e,t,r){let n=ce(e,t,r),o=Pt.spawnSync(n.command,n.args,n.options);return o.error=o.error||ue.verifyENOENTSync(o.status,n),o}$.exports=vt;$.exports.spawn=vt;$.exports.sync=fr;$.exports._parse=ce;$.exports._enoent=ue});var _t=S((Ho,X)=>{X.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&X.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&X.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var Ht=S((zo,B)=>{var h=global.process,O=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};O(h)?(Ft=require("assert"),R=_t(),Dt=/^win/i.test(h.platform),_=require("events"),typeof _!="function"&&(_=_.EventEmitter),h.__signal_exit_emitter__?E=h.__signal_exit_emitter__:(E=h.__signal_exit_emitter__=new _,E.count=0,E.emitted={}),E.infinite||(E.setMaxListeners(1/0),E.infinite=!0),B.exports=function(e,t){if(!O(global.process))return function(){};Ft.equal(typeof e,"function","a callback must be provided for exit handler"),A===!1&&he();var r="exit";t&&t.alwaysLast&&(r="afterexit");var n=function(){E.removeListener(r,e),E.listeners("exit").length===0&&E.listeners("afterexit").length===0&&Y()};return E.on(r,e),n},Y=function(){!A||!O(global.process)||(A=!1,R.forEach(function(t){try{h.removeListener(t,Z[t])}catch{}}),h.emit=J,h.reallyExit=ge,E.count-=1)},B.exports.unload=Y,C=function(t,r,n){E.emitted[t]||(E.emitted[t]=!0,E.emit(t,r,n))},Z={},R.forEach(function(e){Z[e]=function(){if(O(global.process)){var r=h.listeners(e);r.length===E.count&&(Y(),C("exit",null,e),C("afterexit",null,e),Dt&&e==="SIGHUP"&&(e="SIGINT"),h.kill(h.pid,e))}}}),B.exports.signals=function(){return R},A=!1,he=function(){A||!O(global.process)||(A=!0,E.count+=1,R=R.filter(function(t){try{return h.on(t,Z[t]),!0}catch{return!1}}),h.emit=qt,h.reallyExit=Ut)},B.exports.load=he,ge=h.reallyExit,Ut=function(t){O(global.process)&&(h.exitCode=t||0,C("exit",h.exitCode,null),C("afterexit",h.exitCode,null),ge.call(h,h.exitCode))},J=h.emit,qt=function(t,r){if(t==="exit"&&O(global.process)){r!==void 0&&(h.exitCode=r);var n=J.apply(this,arguments);return C("exit",h.exitCode,null),C("afterexit",h.exitCode,null),n}else return J.apply(this,arguments)}):B.exports=function(){return function(){}};var Ft,R,Dt,_,E,Y,C,Z,A,he,ge,Ut,J,qt});var en=S((Wo,Qt)=>{"use strict";var{PassThrough:Rr}=require("stream");Qt.exports=e=>{e={...e};let{array:t}=e,{encoding:r}=e,n=r==="buffer",o=!1;t?o=!(r||n):r=r||"utf8",n&&(r=null);let i=new Rr({objectMode:o});r&&i.setEncoding(r);let s=0,a=[];return i.on("data",l=>{a.push(l),o?s=a.length:s+=l.length}),i.getBufferedValue=()=>t?a:n?Buffer.concat(a,s):a.join(""),i.getBufferedLength=()=>s,i}});var tn=S((Xo,F)=>{"use strict";var{constants:Ar}=require("buffer"),Br=require("stream"),{promisify:Lr}=require("util"),Mr=en(),_r=Lr(Br.pipeline),Q=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function ye(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:r}=t,n=Mr(t);return await new Promise((o,i)=>{let s=a=>{a&&n.getBufferedLength()<=Ar.MAX_LENGTH&&(a.bufferedData=n.getBufferedValue()),i(a)};(async()=>{try{await _r(e,n),o()}catch(a){s(a)}})(),n.on("data",()=>{n.getBufferedLength()>r&&s(new Q)})}),n.getBufferedValue()}F.exports=ye;F.exports.buffer=(e,t)=>ye(e,{...t,encoding:"buffer"});F.exports.array=(e,t)=>ye(e,{...t,array:!0});F.exports.MaxBufferError=Q});var rn=S((Yo,nn)=>{"use strict";var{PassThrough:Fr}=require("stream");nn.exports=function(){var e=[],t=new Fr({objectMode:!0});return t.setMaxListeners(0),t.add=r,t.isEmpty=n,t.on("unpipe",o),Array.prototype.slice.call(arguments).forEach(r),t;function r(i){return Array.isArray(i)?(i.forEach(r),this):(e.push(i),i.once("end",o.bind(null,i)),i.once("error",t.emit.bind(t,"error")),i.pipe(t,{end:!1}),this)}function n(){return e.length==0}function o(i){e=e.filter(function(s){return s!==i}),!e.length&&t.readable&&t.end()}}});var Tn=S((vi,In)=>{In.exports=function(e,t){if(typeof e!="string")throw new TypeError("expected path to be a string");if(e==="\\"||e==="/")return"/";var r=e.length;if(r<=1)return e;var n="";if(r>4&&e[3]==="\\"){var o=e[2];(o==="?"||o===".")&&e.slice(0,2)==="\\\\"&&(e=e.slice(2),n="//")}var i=e.split(/[/\\]+/);return t!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")}});var Ne=require("commander"),Gn=m(require("path"));var Le=require("commander"),Me=m(require("fast-glob")),ee=m(require("fs-extra")),_e=m(require("path")),k=m(require("@techor/log"));var Be=m(require("fs-extra"));function G(e="./package.json"){return Be.default.readJSONSync(e,{throws:!1})||{}}var Ln=G(),Mn={workspaces:Ln.workspaces};Le.program.command("version <version>").description("Bump to specific version for workspace's packages").option("-p, --prefix <symbol>","version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ","^").option("-w, --workspaces <paths>","Specific your workspaces",Mn.workspaces).option("-ls, --list","List current bumpable dependency tree in workspaces",!1).action((e,{prefix:t,list:r,workspaces:n})=>{let o=t+e,i={},s={},a=n.map(c=>_e.default.join(c,"*package.json")),l=(c,p)=>{let d=!1;for(let f in c)f in s&&c[f]===""&&(c[f]=o,d=!0);return d};for(let c of Me.default.sync(a)){let p=ee.default.readJSONSync(c);p.private||(i[c]=p,s[p.name]=p,p.version=e)}for(let c in i){let p=i[c],{dependencies:d,peerDependencies:f}=i[c];d&&l(d,"dependencies"),f&&l(f,"peerDependencies"),r||ee.default.writeJSONSync(c,p)}let u={};for(let c in s){let{dependencies:p,peerDependencies:d}=s[c],f=u[(0,k.paint)("**"+c+"**")]={},g=(x,y)=>{if(x){f[y]={};for(let b in x)if(b in s){let w=x[b];f[y][(0,k.paint)("**"+b+"**")]=w===o?null:o}Object.keys(f[y]).length||delete f[y]}};g(p,"dependencies"),g(d,"peerDependencies")}k.default`📦`,k.default.tree(u),k.default.success`bump version to +${o}+ for +${Object.keys(s).length}+ packages in all workspace`});var Pn=require("commander"),vn=m(require("fast-glob"));var mn=require("node:buffer"),hn=m(require("node:path"),1),Ie=m(require("node:child_process"),1),D=m(require("node:process"),1),gn=m(kt(),1);function fe(e){let t=typeof e=="string"?`
|
|
3
|
+
`:`
|
|
4
|
+
`.charCodeAt(),r=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===r&&(e=e.slice(0,-1)),e}var M=m(require("node:process"),1),N=m(require("node:path"),1),Ot=m(require("node:url"),1);function K(e={}){let{env:t=process.env,platform:r=process.platform}=e;return r!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function lr(e={}){let{cwd:t=M.default.cwd(),path:r=M.default.env[K()],execPath:n=M.default.execPath}=e,o,i=t instanceof URL?Ot.default.fileURLToPath(t):t,s=N.default.resolve(i),a=[];for(;o!==s;)a.push(N.default.join(s,"node_modules/.bin")),o=s,s=N.default.resolve(s,"..");return a.push(N.default.resolve(i,n,"..")),[...a,r].join(N.default.delimiter)}function Ct({env:e=M.default.env,...t}={}){e={...e};let r=K({env:e});return t.path=e[r],e[r]=lr(t),e}var dr=(e,t,r,n)=>{if(r==="length"||r==="prototype"||r==="arguments"||r==="caller")return;let o=Object.getOwnPropertyDescriptor(e,r),i=Object.getOwnPropertyDescriptor(t,r);!pr(o,i)&&n||Object.defineProperty(e,r,i)},pr=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},mr=(e,t)=>{let r=Object.getPrototypeOf(t);r!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,r)},hr=(e,t)=>`/* Wrapped ${e}*/
|
|
5
|
+
${t}`,gr=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),yr=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),xr=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,o=hr.bind(null,n,t.toString());Object.defineProperty(o,"name",yr),Object.defineProperty(e,"toString",{...gr,value:o})};function le(e,t,{ignoreNonConfigurable:r=!1}={}){let{name:n}=e;for(let o of Reflect.ownKeys(t))dr(e,t,o,r);return mr(e,t),xr(e,t,n),e}var V=new WeakMap,Gt=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let r,n=0,o=e.displayName||e.name||"<anonymous>",i=function(...s){if(V.set(i,++n),n===1)r=e.apply(this,s),e=null;else if(t.throw===!0)throw new Error(`Function \`${o}\` can only be called once`);return r};return le(i,e),V.set(i,n),i};Gt.callCount=e=>{if(!V.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return V.get(e)};var jt=Gt;var Bt=require("os");var $t=function(){let e=de-Nt+1;return Array.from({length:e},Sr)},Sr=function(e,t){return{name:`SIGRT${t+1}`,number:Nt+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},Nt=34,de=64;var At=require("os");var Rt=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var pe=function(){let e=$t();return[...Rt,...e].map(br)},br=function({name:e,number:t,description:r,action:n,forced:o=!1,standard:i}){let{signals:{[e]:s}}=At.constants,a=s!==void 0;return{name:e,number:a?s:t,description:r,supported:a,action:n,forced:o,standard:i}};var wr=function(){return pe().reduce(Er,{})},Er=function(e,{name:t,number:r,description:n,supported:o,action:i,forced:s,standard:a}){return{...e,[t]:{name:t,number:r,description:n,supported:o,action:i,forced:s,standard:a}}},Lt=wr(),Ir=function(){let e=pe(),t=64+1,r=Array.from({length:t},(n,o)=>Tr(o,e));return Object.assign({},...r)},Tr=function(e,t){let r=Pr(e,t);if(r===void 0)return{};let{name:n,description:o,supported:i,action:s,forced:a,standard:l}=r;return{[e]:{name:n,number:e,description:o,supported:i,action:s,forced:a,standard:l}}},Pr=function(e,t){let r=t.find(({name:n})=>Bt.constants.signals[n]===e);return r!==void 0?r:t.find(n=>n.number===e)},_o=Ir();var vr=({timedOut:e,timeout:t,errorCode:r,signal:n,signalDescription:o,exitCode:i,isCanceled:s})=>e?`timed out after ${t} milliseconds`:s?"was canceled":r!==void 0?`failed with ${r}`:n!==void 0?`was killed with ${n} (${o})`:i!==void 0?`failed with exit code ${i}`:"failed",me=({stdout:e,stderr:t,all:r,error:n,signal:o,exitCode:i,command:s,escapedCommand:a,timedOut:l,isCanceled:u,killed:c,parsed:{options:{timeout:p}}})=>{i=i===null?void 0:i,o=o===null?void 0:o;let d=o===void 0?void 0:Lt[o].description,f=n&&n.code,x=`Command ${vr({timedOut:l,timeout:p,errorCode:f,signal:o,signalDescription:d,exitCode:i,isCanceled:u})}: ${s}`,y=Object.prototype.toString.call(n)==="[object Error]",b=y?`${x}
|
|
6
|
+
${n.message}`:x,w=[b,t,e].filter(Boolean).join(`
|
|
7
|
+
`);return y?(n.originalMessage=n.message,n.message=w):n=new Error(w),n.shortMessage=b,n.command=s,n.escapedCommand=a,n.exitCode=i,n.signal=o,n.signalDescription=d,n.stdout=e,n.stderr=t,r!==void 0&&(n.all=r),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=Boolean(l),n.isCanceled=u,n.killed=c&&!l,n};var W=["stdin","stdout","stderr"],kr=e=>W.some(t=>e[t]!==void 0),Mt=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return W.map(n=>e[n]);if(kr(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${W.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let r=Math.max(t.length,W.length);return Array.from({length:r},(n,o)=>t[o])};var zt=m(require("node:os"),1),Kt=m(Ht(),1),Or=1e3*5,Vt=(e,t="SIGTERM",r={})=>{let n=e(t);return Cr(e,t,r,n),n},Cr=(e,t,r,n)=>{if(!Gr(t,r,n))return;let o=$r(r),i=setTimeout(()=>{e("SIGKILL")},o);i.unref&&i.unref()},Gr=(e,{forceKillAfterTimeout:t},r)=>jr(e)&&t!==!1&&r,jr=e=>e===zt.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",$r=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return Or;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Wt=(e,t)=>{e.kill()&&(t.isCanceled=!0)},Nr=(e,t,r)=>{e.kill(t),r(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},Xt=(e,{timeout:t,killSignal:r="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let o,i=new Promise((a,l)=>{o=setTimeout(()=>{Nr(e,r,l)},t)}),s=n.finally(()=>{clearTimeout(o)});return Promise.race([i,s])},Yt=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Zt=async(e,{cleanup:t,detached:r},n)=>{if(!t||r)return n;let o=(0,Kt.default)(()=>{e.kill()});return n.finally(()=>{o()})};function Jt(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}var be=m(tn(),1),on=m(rn(),1),sn=(e,t)=>{t===void 0||e.stdin===void 0||(Jt(t)?t.pipe(e.stdin):e.stdin.end(t))},an=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let r=(0,on.default)();return e.stdout&&r.add(e.stdout),e.stderr&&r.add(e.stderr),r},xe=async(e,t)=>{if(e){e.destroy();try{return await t}catch(r){return r.bufferedData}}},Se=(e,{encoding:t,buffer:r,maxBuffer:n})=>{if(!(!e||!r))return t?(0,be.default)(e,{encoding:t,maxBuffer:n}):be.default.buffer(e,{maxBuffer:n})},cn=async({stdout:e,stderr:t,all:r},{encoding:n,buffer:o,maxBuffer:i},s)=>{let a=Se(e,{encoding:n,buffer:o,maxBuffer:i}),l=Se(t,{encoding:n,buffer:o,maxBuffer:i}),u=Se(r,{encoding:n,buffer:o,maxBuffer:i*2});try{return await Promise.all([s,a,l,u])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},xe(e,a),xe(t,l),xe(r,u)])}};var Dr=(async()=>{})().constructor.prototype,Ur=["then","catch","finally"].map(e=>[e,Reflect.getOwnPropertyDescriptor(Dr,e)]),we=(e,t)=>{for(let[r,n]of Ur){let o=typeof t=="function"?(...i)=>Reflect.apply(n.value,t(),i):n.value.bind(t);Reflect.defineProperty(e,r,{...n,value:o})}return e},un=e=>new Promise((t,r)=>{e.on("exit",(n,o)=>{t({exitCode:n,signal:o})}),e.on("error",n=>{r(n)}),e.stdin&&e.stdin.on("error",n=>{r(n)})});var fn=(e,t=[])=>Array.isArray(t)?[e,...t]:[e],qr=/^[\w.-]+$/,Hr=/"/g,zr=e=>typeof e!="string"||qr.test(e)?e:`"${e.replace(Hr,'\\"')}"`,ln=(e,t)=>fn(e,t).join(" "),dn=(e,t)=>fn(e,t).map(r=>zr(r)).join(" "),Kr=/ +/g,pn=e=>{let t=[];for(let r of e.trim().split(Kr)){let n=t[t.length-1];n&&n.endsWith("\\")?t[t.length-1]=`${n.slice(0,-1)} ${r}`:t.push(r)}return t};var Vr=1e3*1e3*100,Wr=({env:e,extendEnv:t,preferLocal:r,localDir:n,execPath:o})=>{let i=t?{...D.default.env,...e}:e;return r?Ct({env:i,cwd:n,execPath:o}):i},Xr=(e,t,r={})=>{let n=gn.default._parse(e,t,r);return e=n.command,t=n.args,r=n.options,r={maxBuffer:Vr,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:r.cwd||D.default.cwd(),execPath:D.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...r},r.env=Wr(r),r.stdio=Mt(r),D.default.platform==="win32"&&hn.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:r,parsed:n}},Ee=(e,t,r)=>typeof t!="string"&&!mn.Buffer.isBuffer(t)?r===void 0?void 0:"":e.stripFinalNewline?fe(t):t;function Yr(e,t,r){let n=Xr(e,t,r),o=ln(e,t),i=dn(e,t);Yt(n.options);let s;try{s=Ie.default.spawn(n.file,n.args,n.options)}catch(f){let g=new Ie.default.ChildProcess,x=Promise.reject(me({error:f,stdout:"",stderr:"",all:"",command:o,escapedCommand:i,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return we(g,x)}let a=un(s),l=Xt(s,n.options,a),u=Zt(s,n.options,l),c={isCanceled:!1};s.kill=Vt.bind(null,s.kill.bind(s)),s.cancel=Wt.bind(null,s,c);let d=jt(async()=>{let[{error:f,exitCode:g,signal:x,timedOut:y},b,w,I]=await cn(s,n.options,u),T=Ee(n.options,b),P=Ee(n.options,w),H=Ee(n.options,I);if(f||g!==0||x!==null){let Re=me({error:f,exitCode:g,signal:x,stdout:T,stderr:P,all:H,command:o,escapedCommand:i,parsed:n,timedOut:y,isCanceled:c.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:s.killed});if(!n.options.reject)return Re;throw Re}return{command:o,escapedCommand:i,exitCode:0,stdout:T,stderr:P,all:H,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return sn(s,n.options.input),s.all=an(s,n.options),we(s,d)}function yn(e,t){let[r,...n]=pn(e);return Yr(r,n,t)}var kn=require("esbuild");function Te(e,t=1,r={}){let{indent:n=" ",includeEmptyLines:o=!1}=r;if(typeof e!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof e}\``);if(typeof t!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof t}\``);if(t<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${t}\``);if(typeof n!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof n}\``);if(t===0)return e;let i=o?/^/gm:/^(?!\s*$)/gm;return e.replace(i,n.repeat(t))}var ve=m(require("os"),1);function Pe(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}var xn=/\s+at.*[(\s](.*)\)?/,Zr=/^(?:(?:(?:node|node:[\w/]+|(?:(?:node:)?internal\/[\w/]*|.*node_modules\/(?:babel-polyfill|pirates)\/.*)?\w+)(?:\.js)?:\d+:\d+)|native)/,Jr=typeof ve.default.homedir>"u"?"":ve.default.homedir().replace(/\\/g,"/");function ke(e,{pretty:t=!1,basePath:r}={}){let n=r&&new RegExp(`(at | \\()${Pe(r.replace(/\\/g,"/"))}`,"g");if(typeof e=="string")return e.replace(/\\/g,"/").split(`
|
|
8
|
+
`).filter(o=>{let i=o.match(xn);if(i===null||!i[1])return!0;let s=i[1];return s.includes(".app/Contents/Resources/electron.asar")||s.includes(".app/Contents/Resources/default_app.asar")||s.includes("node_modules/electron/dist/resources/electron.asar")||s.includes("node_modules/electron/dist/resources/default_app.asar")?!1:!Zr.test(s)}).filter(o=>o.trim()!=="").map(o=>(n&&(o=o.replace(n,"$1")),t&&(o=o.replace(xn,(i,s)=>i.replace(s,s.replace(Jr,"~")))),o)).join(`
|
|
9
|
+
`)}var Qr=e=>e.replace(/\s+at .*aggregate-error\/index.js:\d+:\d+\)?/g,""),U=class extends Error{#e;name="AggregateError";constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);t=t.map(n=>n instanceof Error?n:n!==null&&typeof n=="object"?Object.assign(new Error(n.message),n):new Error(n));let r=t.map(n=>typeof n.stack=="string"&&n.stack.length>0?Qr(ke(n.stack)):String(n)).join(`
|
|
10
|
+
`);r=`
|
|
11
|
+
`+Te(r,4),super(r),this.#e=t}get errors(){return this.#e.slice()}};var Oe=class extends Error{constructor(t){super(),this.name="AbortError",this.message=t}},Sn=e=>globalThis.DOMException===void 0?new Oe(e):new DOMException(e),bn=e=>{let t=e.reason===void 0?Sn("This operation was aborted."):e.reason;return t instanceof Error?t:Sn(t)};async function Ce(e,t,{concurrency:r=Number.POSITIVE_INFINITY,stopOnError:n=!0,signal:o}={}){return new Promise((i,s)=>{if(e[Symbol.iterator]===void 0&&e[Symbol.asyncIterator]===void 0)throw new TypeError(`Expected \`input\` to be either an \`Iterable\` or \`AsyncIterable\`, got (${typeof e})`);if(typeof t!="function")throw new TypeError("Mapper function is required");if(!((Number.isSafeInteger(r)||r===Number.POSITIVE_INFINITY)&&r>=1))throw new TypeError(`Expected \`concurrency\` to be an integer from 1 and up or \`Infinity\`, got \`${r}\` (${typeof r})`);let a=[],l=[],u=new Map,c=!1,p=!1,d=!1,f=0,g=0,x=e[Symbol.iterator]===void 0?e[Symbol.asyncIterator]():e[Symbol.iterator](),y=w=>{c=!0,p=!0,s(w)};o&&(o.aborted&&y(bn(o)),o.addEventListener("abort",()=>{y(bn(o))}));let b=async()=>{if(p)return;let w=await x.next(),I=g;if(g++,w.done){if(d=!0,f===0&&!p){if(!n&&l.length>0){y(new U(l));return}if(p=!0,u.size===0){i(a);return}let T=[];for(let[P,H]of a.entries())u.get(P)!==wn&&T.push(H);i(T)}return}f++,(async()=>{try{let T=await w.value;if(p)return;let P=await t(T,I);P===wn&&u.set(I,P),a[I]=P,f--,await b()}catch(T){if(n)y(T);else{l.push(T),f--;try{await b()}catch(P){y(P)}}}})()};(async()=>{for(let w=0;w<r;w++){try{await b()}catch(I){y(I);break}if(d||c)break}})()})}var wn=Symbol("skip");async function Ge(e,t){return Ce(e,r=>r(),t)}var v=m(require("@techor/log")),L=m(require("path"));var je=m(require("path"));function q(e,t,r){let n=je.default.parse(e);return je.default.join(t,n.name+r)}var On=m(require("@master/literal"));var eo=["B","kB","MB","GB","TB","PB","EB","ZB","YB"],to=["B","kiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],no=["b","kbit","Mbit","Gbit","Tbit","Pbit","Ebit","Zbit","Ybit"],ro=["b","kibit","Mibit","Gibit","Tibit","Pibit","Eibit","Zibit","Yibit"],En=(e,t,r)=>{let n=e;return typeof t=="string"||Array.isArray(t)?n=e.toLocaleString(t,r):(t===!0||r!==void 0)&&(n=e.toLocaleString(void 0,r)),n};function $e(e,t){if(!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,...t};let r=t.bits?t.binary?ro:no:t.binary?to:eo;if(t.signed&&e===0)return` 0 ${r[0]}`;let n=e<0,o=n?"-":t.signed?"+":"";n&&(e=-e);let i;if(t.minimumFractionDigits!==void 0&&(i={minimumFractionDigits:t.minimumFractionDigits}),t.maximumFractionDigits!==void 0&&(i={maximumFractionDigits:t.maximumFractionDigits,...i}),e<1){let u=En(e,t.locale,i);return o+u+" "+r[0]}let s=Math.min(Math.floor(t.binary?Math.log(e)/Math.log(1024):Math.log10(e)/3),r.length-1);e/=(t.binary?1024:1e3)**s,i||(e=e.toPrecision(3));let a=En(Number(e),t.locale,i),l=r[s];return o+a+" "+l}var Cn=m(Tn());Pn.program.command("pack [entryPaths...]").allowUnknownOption().option("-f, --format [formats...]","The output format for the generated JavaScript files `iife`, `cjs`, `esm`").option("-b, --bundle","To bundle a file means to inline any imported dependencies into the file itself").option("-m, --minify","The generated code will be minified instead of pretty-printed").option("-w, --watch","Rebuild whenever a file changes").option("-s, --sourcemap","Emit a source map").option("-p, --platform <node,browser,neutral>","Platform target").option("-t, --type","Emit typescript declarations").option("-o, --outdir <dir>","The output directory for the build operation").option("--srcdir <dir>","The source directory").action(async function(e){let t=G(),{dependencies:r,peerDependencies:n}=t,o=t.main||t.module||t.browser,i=[];r&&i.push(...Object.keys(r)),n&&i.push(...Object.keys(n));let s=Object.assign({format:"",watch:!1,minify:!0,bundle:!0,type:!!t.types,srcdir:"src",outdir:L.default.dirname(o)||"dist",externals:i},this.opts()),a=[],l=s.watch?"watching":"building",u=async(d,f,g)=>{let x=vn.default.sync([...new Set(d)].map(b=>(0,Cn.default)(b))),y=f==="css";x.length||(v.default.e`[${f}] Cannot find any entry file specified **${d}**`,process.exit()),a.push(async()=>{let{metafile:b}=await(0,kn.build)({entryPoints:x,outExtension:y?{".css":".css"}:{".js":g||{cjs:".cjs",esm:".mjs",iife:".js"}[f]},external:i,watch:s.watch?{onRebuild(w,I){}}:!1,logLevel:"silent",outdir:s.outdir,bundle:s.bundle,minify:s.minify,sourcemap:s.sourcemap,platform:s.platform,metafile:!0,format:y?void 0:f});if(b)for(let w in b.outputs){let I=b.outputs[w];v.default.i`[${f}] **${w}** ++${$e(I.bytes)}++ ..${Object.keys(I.inputs)?.length}.. ..inputs..`}})},c=[];e.length?e.find(f=>f.includes(".css"))?(u(e,"css"),c.push("css")):(c=(s.format||"cjs,esm").split(","),c.map(f=>u(e,f))):(t.style&&(u([q(t.main,s.srcdir,".css")],"css"),c.push("css")),t.main&&!t.main.endsWith(".css")&&(u([q(t.main,s.srcdir,".{tsx,ts}")],"cjs",L.default.extname(t.main)),c.push("cjs")),t.module&&(u([q(t.module,s.srcdir,".{tsx,ts}")],"esm",L.default.extname(t.module)),c.push("esm")),t.browser&&(u([q(t.browser,s.srcdir,".{tsx,ts}")],"iife",L.default.extname(t.browser)),c.push("iife")),a.length||(c=(s.format||"cjs,esm").split(","),c.map(d=>u([L.default.join(s.srcdir,"index.ts")],d)))),s.format=c.join(","),s.type&&a.push(()=>new Promise(d=>{s.watch&&v.default.i`[type] type declarations`,yn(On.default`
|
|
12
|
+
npx tsc --emitDeclarationOnly --preserveWatchOutput --declaration
|
|
13
|
+
--outDir ${s.outdir}
|
|
14
|
+
${s.watch&&"--watch"}
|
|
15
|
+
`,{stdio:"inherit",stripFinalNewline:!1}).catch(f=>{process.exit()}).finally(()=>{v.default.i`[type] type declarations`,d()})})),Object.keys(t).length&&v.default`📦 extract and merge options from +${t.name}+ **package.json**`,v.default.tree(s);let p=c.join(", ").toUpperCase()+(s.type?", Type Declarations":"");v.default.info`[${l}] ${s.watch?" ":p}`,await Ge(a),s.watch||(v.default.success`${p} ..${s.outdir}..`,console.log(""))});var{version:oo,name:io,description:so}=G(Gn.default.join(__dirname,"../../package.json"));Ne.program.name(io).description(so).version(oo);Ne.program.parse();
|
|
16
|
+
/*! Bundled license information:
|
|
17
|
+
|
|
18
|
+
normalize-path/index.js:
|
|
19
|
+
(*!
|
|
20
|
+
* normalize-path <https://github.com/jonschlinkert/normalize-path>
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
23
|
+
* Released under the MIT License.
|
|
24
|
+
*)
|
|
25
|
+
*/
|
|
26
|
+
//# sourceMappingURL=index.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../node_modules/isexe/windows.js", "../../../../node_modules/isexe/mode.js", "../../../../node_modules/isexe/index.js", "../../../../node_modules/which/which.js", "../../../../node_modules/path-key/index.js", "../../../../node_modules/cross-spawn/lib/util/resolveCommand.js", "../../../../node_modules/cross-spawn/lib/util/escape.js", "../../../../node_modules/shebang-regex/index.js", "../../../../node_modules/shebang-command/index.js", "../../../../node_modules/cross-spawn/lib/util/readShebang.js", "../../../../node_modules/cross-spawn/lib/parse.js", "../../../../node_modules/cross-spawn/lib/enoent.js", "../../../../node_modules/cross-spawn/index.js", "../../../../node_modules/signal-exit/signals.js", "../../../../node_modules/signal-exit/index.js", "../../node_modules/get-stream/buffer-stream.js", "../../node_modules/get-stream/index.js", "../../../../node_modules/merge-stream/index.js", "../../../../node_modules/normalize-path/index.js", "../../src/bin/index.ts", "../../src/commands/version.ts", "../../src/utils/read-package.ts", "../../src/commands/pack.ts", "../../node_modules/execa/index.js", "../../node_modules/strip-final-newline/index.js", "../../node_modules/npm-run-path/index.js", "../../node_modules/path-key/index.js", "../../node_modules/mimic-fn/index.js", "../../node_modules/onetime/index.js", "../../node_modules/human-signals/src/main.js", "../../node_modules/human-signals/src/realtime.js", "../../node_modules/human-signals/src/signals.js", "../../node_modules/human-signals/src/core.js", "../../node_modules/execa/lib/error.js", "../../node_modules/execa/lib/stdio.js", "../../node_modules/execa/lib/kill.js", "../../node_modules/is-stream/index.js", "../../node_modules/execa/lib/stream.js", "../../node_modules/execa/lib/promise.js", "../../node_modules/execa/lib/command.js", "../../../../node_modules/p-map/node_modules/indent-string/index.js", "../../../../node_modules/p-map/node_modules/clean-stack/index.js", "../../../../node_modules/p-map/node_modules/escape-string-regexp/index.js", "../../../../node_modules/p-map/node_modules/aggregate-error/index.js", "../../../../node_modules/p-map/index.js", "../../../../node_modules/p-all/index.js", "../../src/utils/change-file-path.ts", "../../../../node_modules/pretty-bytes/index.js"],
|
|
4
|
+
"sourcesContent": ["module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction checkPathExt (path, options) {\n var pathext = options.pathExt !== undefined ?\n options.pathExt : process.env.PATHEXT\n\n if (!pathext) {\n return true\n }\n\n pathext = pathext.split(';')\n if (pathext.indexOf('') !== -1) {\n return true\n }\n for (var i = 0; i < pathext.length; i++) {\n var p = pathext[i].toLowerCase()\n if (p && path.substr(-p.length).toLowerCase() === p) {\n return true\n }\n }\n return false\n}\n\nfunction checkStat (stat, path, options) {\n if (!stat.isSymbolicLink() && !stat.isFile()) {\n return false\n }\n return checkPathExt(path, options)\n}\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, path, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), path, options)\n}\n", "module.exports = isexe\nisexe.sync = sync\n\nvar fs = require('fs')\n\nfunction isexe (path, options, cb) {\n fs.stat(path, function (er, stat) {\n cb(er, er ? false : checkStat(stat, options))\n })\n}\n\nfunction sync (path, options) {\n return checkStat(fs.statSync(path), options)\n}\n\nfunction checkStat (stat, options) {\n return stat.isFile() && checkMode(stat, options)\n}\n\nfunction checkMode (stat, options) {\n var mod = stat.mode\n var uid = stat.uid\n var gid = stat.gid\n\n var myUid = options.uid !== undefined ?\n options.uid : process.getuid && process.getuid()\n var myGid = options.gid !== undefined ?\n options.gid : process.getgid && process.getgid()\n\n var u = parseInt('100', 8)\n var g = parseInt('010', 8)\n var o = parseInt('001', 8)\n var ug = u | g\n\n var ret = (mod & o) ||\n (mod & g) && gid === myGid ||\n (mod & u) && uid === myUid ||\n (mod & ug) && myUid === 0\n\n return ret\n}\n", "var fs = require('fs')\nvar core\nif (process.platform === 'win32' || global.TESTING_WINDOWS) {\n core = require('./windows.js')\n} else {\n core = require('./mode.js')\n}\n\nmodule.exports = isexe\nisexe.sync = sync\n\nfunction isexe (path, options, cb) {\n if (typeof options === 'function') {\n cb = options\n options = {}\n }\n\n if (!cb) {\n if (typeof Promise !== 'function') {\n throw new TypeError('callback not provided')\n }\n\n return new Promise(function (resolve, reject) {\n isexe(path, options || {}, function (er, is) {\n if (er) {\n reject(er)\n } else {\n resolve(is)\n }\n })\n })\n }\n\n core(path, options || {}, function (er, is) {\n // ignore EACCES because that just means we aren't allowed to run it\n if (er) {\n if (er.code === 'EACCES' || options && options.ignoreErrors) {\n er = null\n is = false\n }\n }\n cb(er, is)\n })\n}\n\nfunction sync (path, options) {\n // my kingdom for a filtered catch\n try {\n return core.sync(path, options || {})\n } catch (er) {\n if (options && options.ignoreErrors || er.code === 'EACCES') {\n return false\n } else {\n throw er\n }\n }\n}\n", "const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n", "'use strict';\n\nconst pathKey = (options = {}) => {\n\tconst environment = options.env || process.env;\n\tconst platform = options.platform || process.platform;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n};\n\nmodule.exports = pathKey;\n// TODO: Remove this for the next major release\nmodule.exports.default = pathKey;\n", "'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n", "'use strict';\n\n// See http://www.robvanderwoude.com/escapechars.php\nconst metaCharsRegExp = /([()\\][%!^\"`<>&|;, *?])/g;\n\nfunction escapeCommand(arg) {\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n return arg;\n}\n\nfunction escapeArgument(arg, doubleEscapeMetaChars) {\n // Convert to string\n arg = `${arg}`;\n\n // Algorithm below is based on https://qntm.org/cmd\n\n // Sequence of backslashes followed by a double quote:\n // double up all the backslashes and escape the double quote\n arg = arg.replace(/(\\\\*)\"/g, '$1$1\\\\\"');\n\n // Sequence of backslashes followed by the end of the string\n // (which will become a double quote later):\n // double up all the backslashes\n arg = arg.replace(/(\\\\*)$/, '$1$1');\n\n // All other backslashes occur literally\n\n // Quote the whole thing:\n arg = `\"${arg}\"`;\n\n // Escape meta chars\n arg = arg.replace(metaCharsRegExp, '^$1');\n\n // Double escape meta chars if necessary\n if (doubleEscapeMetaChars) {\n arg = arg.replace(metaCharsRegExp, '^$1');\n }\n\n return arg;\n}\n\nmodule.exports.command = escapeCommand;\nmodule.exports.argument = escapeArgument;\n", "'use strict';\nmodule.exports = /^#!(.*)/;\n", "'use strict';\nconst shebangRegex = require('shebang-regex');\n\nmodule.exports = (string = '') => {\n\tconst match = string.match(shebangRegex);\n\n\tif (!match) {\n\t\treturn null;\n\t}\n\n\tconst [path, argument] = match[0].replace(/#! ?/, '').split(' ');\n\tconst binary = path.split('/').pop();\n\n\tif (binary === 'env') {\n\t\treturn argument;\n\t}\n\n\treturn argument ? `${binary} ${argument}` : binary;\n};\n", "'use strict';\n\nconst fs = require('fs');\nconst shebangCommand = require('shebang-command');\n\nfunction readShebang(command) {\n // Read the first 150 bytes from the file\n const size = 150;\n const buffer = Buffer.alloc(size);\n\n let fd;\n\n try {\n fd = fs.openSync(command, 'r');\n fs.readSync(fd, buffer, 0, size, 0);\n fs.closeSync(fd);\n } catch (e) { /* Empty */ }\n\n // Attempt to extract shebang (null is returned if not a shebang)\n return shebangCommand(buffer.toString());\n}\n\nmodule.exports = readShebang;\n", "'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n", "'use strict';\n\nconst isWin = process.platform === 'win32';\n\nfunction notFoundError(original, syscall) {\n return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {\n code: 'ENOENT',\n errno: 'ENOENT',\n syscall: `${syscall} ${original.command}`,\n path: original.command,\n spawnargs: original.args,\n });\n}\n\nfunction hookChildProcess(cp, parsed) {\n if (!isWin) {\n return;\n }\n\n const originalEmit = cp.emit;\n\n cp.emit = function (name, arg1) {\n // If emitting \"exit\" event and exit code is 1, we need to check if\n // the command exists and emit an \"error\" instead\n // See https://github.com/IndigoUnited/node-cross-spawn/issues/16\n if (name === 'exit') {\n const err = verifyENOENT(arg1, parsed, 'spawn');\n\n if (err) {\n return originalEmit.call(cp, 'error', err);\n }\n }\n\n return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params\n };\n}\n\nfunction verifyENOENT(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawn');\n }\n\n return null;\n}\n\nfunction verifyENOENTSync(status, parsed) {\n if (isWin && status === 1 && !parsed.file) {\n return notFoundError(parsed.original, 'spawnSync');\n }\n\n return null;\n}\n\nmodule.exports = {\n hookChildProcess,\n verifyENOENT,\n verifyENOENTSync,\n notFoundError,\n};\n", "'use strict';\n\nconst cp = require('child_process');\nconst parse = require('./lib/parse');\nconst enoent = require('./lib/enoent');\n\nfunction spawn(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);\n\n // Hook into child process \"exit\" event to emit an error if the command\n // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n enoent.hookChildProcess(spawned, parsed);\n\n return spawned;\n}\n\nfunction spawnSync(command, args, options) {\n // Parse the arguments\n const parsed = parse(command, args, options);\n\n // Spawn the child process\n const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);\n\n // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16\n result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);\n\n return result;\n}\n\nmodule.exports = spawn;\nmodule.exports.spawn = spawn;\nmodule.exports.sync = spawnSync;\n\nmodule.exports._parse = parse;\nmodule.exports._enoent = enoent;\n", "// This is not the set of all possible signals.\n//\n// It IS, however, the set of all signals that trigger\n// an exit on either Linux or BSD systems. Linux is a\n// superset of the signal names supported on BSD, and\n// the unknown signals just fail to register, so we can\n// catch that easily enough.\n//\n// Don't bother with SIGKILL. It's uncatchable, which\n// means that we can't fire any callbacks anyway.\n//\n// If a user does happen to register a handler on a non-\n// fatal signal like SIGWINCH or something, and then\n// exit, it'll end up firing `process.emit('exit')`, so\n// the handler will be fired anyway.\n//\n// SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised\n// artificially, inherently leave the process in a\n// state from which it is not safe to try and enter JS\n// listeners.\nmodule.exports = [\n 'SIGABRT',\n 'SIGALRM',\n 'SIGHUP',\n 'SIGINT',\n 'SIGTERM'\n]\n\nif (process.platform !== 'win32') {\n module.exports.push(\n 'SIGVTALRM',\n 'SIGXCPU',\n 'SIGXFSZ',\n 'SIGUSR2',\n 'SIGTRAP',\n 'SIGSYS',\n 'SIGQUIT',\n 'SIGIOT'\n // should detect profiler and enable/disable accordingly.\n // see #21\n // 'SIGPROF'\n )\n}\n\nif (process.platform === 'linux') {\n module.exports.push(\n 'SIGIO',\n 'SIGPOLL',\n 'SIGPWR',\n 'SIGSTKFLT',\n 'SIGUNUSED'\n )\n}\n", "// Note: since nyc uses this module to output coverage, any lines\n// that are in the direct sync flow of nyc's outputCoverage are\n// ignored, since we can never get coverage for them.\n// grab a reference to node's real process object right away\nvar process = global.process\n\nconst processOk = function (process) {\n return process &&\n typeof process === 'object' &&\n typeof process.removeListener === 'function' &&\n typeof process.emit === 'function' &&\n typeof process.reallyExit === 'function' &&\n typeof process.listeners === 'function' &&\n typeof process.kill === 'function' &&\n typeof process.pid === 'number' &&\n typeof process.on === 'function'\n}\n\n// some kind of non-node environment, just no-op\n/* istanbul ignore if */\nif (!processOk(process)) {\n module.exports = function () {\n return function () {}\n }\n} else {\n var assert = require('assert')\n var signals = require('./signals.js')\n var isWin = /^win/i.test(process.platform)\n\n var EE = require('events')\n /* istanbul ignore if */\n if (typeof EE !== 'function') {\n EE = EE.EventEmitter\n }\n\n var emitter\n if (process.__signal_exit_emitter__) {\n emitter = process.__signal_exit_emitter__\n } else {\n emitter = process.__signal_exit_emitter__ = new EE()\n emitter.count = 0\n emitter.emitted = {}\n }\n\n // Because this emitter is a global, we have to check to see if a\n // previous version of this library failed to enable infinite listeners.\n // I know what you're about to say. But literally everything about\n // signal-exit is a compromise with evil. Get used to it.\n if (!emitter.infinite) {\n emitter.setMaxListeners(Infinity)\n emitter.infinite = true\n }\n\n module.exports = function (cb, opts) {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return function () {}\n }\n assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')\n\n if (loaded === false) {\n load()\n }\n\n var ev = 'exit'\n if (opts && opts.alwaysLast) {\n ev = 'afterexit'\n }\n\n var remove = function () {\n emitter.removeListener(ev, cb)\n if (emitter.listeners('exit').length === 0 &&\n emitter.listeners('afterexit').length === 0) {\n unload()\n }\n }\n emitter.on(ev, cb)\n\n return remove\n }\n\n var unload = function unload () {\n if (!loaded || !processOk(global.process)) {\n return\n }\n loaded = false\n\n signals.forEach(function (sig) {\n try {\n process.removeListener(sig, sigListeners[sig])\n } catch (er) {}\n })\n process.emit = originalProcessEmit\n process.reallyExit = originalProcessReallyExit\n emitter.count -= 1\n }\n module.exports.unload = unload\n\n var emit = function emit (event, code, signal) {\n /* istanbul ignore if */\n if (emitter.emitted[event]) {\n return\n }\n emitter.emitted[event] = true\n emitter.emit(event, code, signal)\n }\n\n // { <signal>: <listener fn>, ... }\n var sigListeners = {}\n signals.forEach(function (sig) {\n sigListeners[sig] = function listener () {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return\n }\n // If there are no other listeners, an exit is coming!\n // Simplest way: remove us and then re-send the signal.\n // We know that this will kill the process, so we can\n // safely emit now.\n var listeners = process.listeners(sig)\n if (listeners.length === emitter.count) {\n unload()\n emit('exit', null, sig)\n /* istanbul ignore next */\n emit('afterexit', null, sig)\n /* istanbul ignore next */\n if (isWin && sig === 'SIGHUP') {\n // \"SIGHUP\" throws an `ENOSYS` error on Windows,\n // so use a supported signal instead\n sig = 'SIGINT'\n }\n /* istanbul ignore next */\n process.kill(process.pid, sig)\n }\n }\n })\n\n module.exports.signals = function () {\n return signals\n }\n\n var loaded = false\n\n var load = function load () {\n if (loaded || !processOk(global.process)) {\n return\n }\n loaded = true\n\n // This is the number of onSignalExit's that are in play.\n // It's important so that we can count the correct number of\n // listeners on signals, and don't wait for the other one to\n // handle it instead of us.\n emitter.count += 1\n\n signals = signals.filter(function (sig) {\n try {\n process.on(sig, sigListeners[sig])\n return true\n } catch (er) {\n return false\n }\n })\n\n process.emit = processEmit\n process.reallyExit = processReallyExit\n }\n module.exports.load = load\n\n var originalProcessReallyExit = process.reallyExit\n var processReallyExit = function processReallyExit (code) {\n /* istanbul ignore if */\n if (!processOk(global.process)) {\n return\n }\n process.exitCode = code || /* istanbul ignore next */ 0\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n originalProcessReallyExit.call(process, process.exitCode)\n }\n\n var originalProcessEmit = process.emit\n var processEmit = function processEmit (ev, arg) {\n if (ev === 'exit' && processOk(global.process)) {\n /* istanbul ignore else */\n if (arg !== undefined) {\n process.exitCode = arg\n }\n var ret = originalProcessEmit.apply(this, arguments)\n /* istanbul ignore next */\n emit('exit', process.exitCode, null)\n /* istanbul ignore next */\n emit('afterexit', process.exitCode, null)\n /* istanbul ignore next */\n return ret\n } else {\n return originalProcessEmit.apply(this, arguments)\n }\n }\n}\n", "'use strict';\nconst {PassThrough: PassThroughStream} = require('stream');\n\nmodule.exports = options => {\n\toptions = {...options};\n\n\tconst {array} = options;\n\tlet {encoding} = options;\n\tconst isBuffer = encoding === 'buffer';\n\tlet objectMode = false;\n\n\tif (array) {\n\t\tobjectMode = !(encoding || isBuffer);\n\t} else {\n\t\tencoding = encoding || 'utf8';\n\t}\n\n\tif (isBuffer) {\n\t\tencoding = null;\n\t}\n\n\tconst stream = new PassThroughStream({objectMode});\n\n\tif (encoding) {\n\t\tstream.setEncoding(encoding);\n\t}\n\n\tlet length = 0;\n\tconst chunks = [];\n\n\tstream.on('data', chunk => {\n\t\tchunks.push(chunk);\n\n\t\tif (objectMode) {\n\t\t\tlength = chunks.length;\n\t\t} else {\n\t\t\tlength += chunk.length;\n\t\t}\n\t});\n\n\tstream.getBufferedValue = () => {\n\t\tif (array) {\n\t\t\treturn chunks;\n\t\t}\n\n\t\treturn isBuffer ? Buffer.concat(chunks, length) : chunks.join('');\n\t};\n\n\tstream.getBufferedLength = () => length;\n\n\treturn stream;\n};\n", "'use strict';\nconst {constants: BufferConstants} = require('buffer');\nconst stream = require('stream');\nconst {promisify} = require('util');\nconst bufferStream = require('./buffer-stream');\n\nconst streamPipelinePromisified = promisify(stream.pipeline);\n\nclass MaxBufferError extends Error {\n\tconstructor() {\n\t\tsuper('maxBuffer exceeded');\n\t\tthis.name = 'MaxBufferError';\n\t}\n}\n\nasync function getStream(inputStream, options) {\n\tif (!inputStream) {\n\t\tthrow new Error('Expected a stream');\n\t}\n\n\toptions = {\n\t\tmaxBuffer: Infinity,\n\t\t...options\n\t};\n\n\tconst {maxBuffer} = options;\n\tconst stream = bufferStream(options);\n\n\tawait new Promise((resolve, reject) => {\n\t\tconst rejectPromise = error => {\n\t\t\t// Don't retrieve an oversized buffer.\n\t\t\tif (error && stream.getBufferedLength() <= BufferConstants.MAX_LENGTH) {\n\t\t\t\terror.bufferedData = stream.getBufferedValue();\n\t\t\t}\n\n\t\t\treject(error);\n\t\t};\n\n\t\t(async () => {\n\t\t\ttry {\n\t\t\t\tawait streamPipelinePromisified(inputStream, stream);\n\t\t\t\tresolve();\n\t\t\t} catch (error) {\n\t\t\t\trejectPromise(error);\n\t\t\t}\n\t\t})();\n\n\t\tstream.on('data', () => {\n\t\t\tif (stream.getBufferedLength() > maxBuffer) {\n\t\t\t\trejectPromise(new MaxBufferError());\n\t\t\t}\n\t\t});\n\t});\n\n\treturn stream.getBufferedValue();\n}\n\nmodule.exports = getStream;\nmodule.exports.buffer = (stream, options) => getStream(stream, {...options, encoding: 'buffer'});\nmodule.exports.array = (stream, options) => getStream(stream, {...options, array: true});\nmodule.exports.MaxBufferError = MaxBufferError;\n", "'use strict';\n\nconst { PassThrough } = require('stream');\n\nmodule.exports = function (/*streams...*/) {\n var sources = []\n var output = new PassThrough({objectMode: true})\n\n output.setMaxListeners(0)\n\n output.add = add\n output.isEmpty = isEmpty\n\n output.on('unpipe', remove)\n\n Array.prototype.slice.call(arguments).forEach(add)\n\n return output\n\n function add (source) {\n if (Array.isArray(source)) {\n source.forEach(add)\n return this\n }\n\n sources.push(source);\n source.once('end', remove.bind(null, source))\n source.once('error', output.emit.bind(output, 'error'))\n source.pipe(output, {end: false})\n return this\n }\n\n function isEmpty () {\n return sources.length == 0;\n }\n\n function remove (source) {\n sources = sources.filter(function (it) { return it !== source })\n if (!sources.length && output.readable) { output.end() }\n }\n}\n", "/*!\n * normalize-path <https://github.com/jonschlinkert/normalize-path>\n *\n * Copyright (c) 2014-2018, Jon Schlinkert.\n * Released under the MIT License.\n */\n\nmodule.exports = function(path, stripTrailing) {\n if (typeof path !== 'string') {\n throw new TypeError('expected path to be a string');\n }\n\n if (path === '\\\\' || path === '/') return '/';\n\n var len = path.length;\n if (len <= 1) return path;\n\n // ensure that win32 namespaces has two leading slashes, so that the path is\n // handled properly by the win32 version of path.parse() after being normalized\n // https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces\n var prefix = '';\n if (len > 4 && path[3] === '\\\\') {\n var ch = path[2];\n if ((ch === '?' || ch === '.') && path.slice(0, 2) === '\\\\\\\\') {\n path = path.slice(2);\n prefix = '//';\n }\n }\n\n var segs = path.split(/[/\\\\]+/);\n if (stripTrailing !== false && segs[segs.length - 1] === '') {\n segs.pop();\n }\n return prefix + segs.join('/');\n};\n", "#!/usr/bin/env node\n\nimport { program } from 'commander'\nimport path from 'path'\nimport '../commands'\nimport { readPackage } from '../utils/read-package'\n\nconst { version, name, description } = readPackage(path.join(__dirname, '../../package.json'))\nprogram\n .name(name)\n .description(description)\n .version(version)\n\nprogram.parse()\n\n", "import { program } from 'commander'\nimport fg from 'fast-glob'\nimport fs from 'fs-extra'\nimport path from 'path'\nimport log, { paint } from '@techor/log'\nimport { readPackage } from '../utils/read-package'\n\nconst pkg = readPackage()\n\nconst defaults = {\n workspaces: pkg.workspaces\n}\n\nprogram.command('version <version>')\n .description('Bump to specific version for workspace\\'s packages')\n .option('-p, --prefix <symbol>', 'version prefix `^`, `~`, `>`, `>=`, `<`, `<=` ', '^')\n .option('-w, --workspaces <paths>', 'Specific your workspaces', defaults.workspaces)\n .option('-ls, --list', 'List current bumpable dependency tree in workspaces', false)\n .action((version, { prefix, list, workspaces }) => {\n const nextVersion = prefix + version\n const packagesOfPath = {}\n const packagesOfName = {}\n const workspacePackagePaths = workspaces.map((eachWorkspace) => path.join(eachWorkspace, '*package.json'))\n const updateDependencies = (dependencies, title) => {\n let updated = false\n for (const dependencyName in dependencies) {\n if (dependencyName in packagesOfName) {\n const dependencyVersion = dependencies[dependencyName]\n if (dependencyVersion === '') {\n dependencies[dependencyName] = nextVersion\n updated = true\n }\n }\n }\n return updated\n }\n\n // Read package.json by workspaces\n for (const eachPackagePath of fg.sync(workspacePackagePaths)) {\n const eachPackage = fs.readJSONSync(eachPackagePath)\n // Prevent version bumps of private package\n if (!eachPackage.private) {\n packagesOfPath[eachPackagePath] = eachPackage\n packagesOfName[eachPackage.name] = eachPackage\n // Bump to next verion\n eachPackage.version = version\n }\n }\n\n for (const eachPackagePath in packagesOfPath) {\n const eachPackage = packagesOfPath[eachPackagePath]\n const { dependencies, peerDependencies } = packagesOfPath[eachPackagePath]\n dependencies && updateDependencies(dependencies, 'dependencies')\n peerDependencies && updateDependencies(peerDependencies, 'peerDependencies')\n if (!list) {\n fs.writeJSONSync(eachPackagePath, eachPackage)\n }\n }\n\n const workspaceDepsTree = {}\n for (const name in packagesOfName) {\n const { dependencies, peerDependencies } = packagesOfName[name]\n const workspacePackage: any = workspaceDepsTree[paint('**' + name + '**')] = {}\n const analyzeDeps = (eachDeps, key: string) => {\n if (eachDeps) {\n workspacePackage[key] = {}\n for (const dependencyName in eachDeps) {\n if (dependencyName in packagesOfName) {\n const eachDependencyVersion = eachDeps[dependencyName]\n workspacePackage[key][paint('**' + dependencyName + '**')] =\n eachDependencyVersion === nextVersion ? null : nextVersion\n }\n }\n if (!Object.keys(workspacePackage[key]).length) {\n delete workspacePackage[key]\n }\n }\n }\n analyzeDeps(dependencies, 'dependencies')\n analyzeDeps(peerDependencies, 'peerDependencies')\n }\n log`\uD83D\uDCE6`\n log.tree(workspaceDepsTree)\n log.success`bump version to +${nextVersion}+ for +${Object.keys(packagesOfName).length}+ packages in all workspace`\n })\n\n", "import fs from 'fs-extra'\n\nexport function readPackage(pkgPath = './package.json') {\n return fs.readJSONSync(pkgPath, { throws: false }) || {}\n}", "import { program } from 'commander'\nimport fg from 'fast-glob'\nimport { execaCommand } from 'execa'\nimport { build, BuildOptions } from 'esbuild'\nimport pAll from 'p-all'\nimport log from '@techor/log'\nimport path from 'path'\nimport { readPackage } from '../utils/read-package'\nimport { changeFilePath } from '../utils/change-file-path'\nimport literal from '@master/literal'\nimport type { PackageJson } from 'pkg-types'\nimport prettyBytes from 'pretty-bytes'\nimport normalizePath from 'normalize-path'\n\nprogram.command('pack [entryPaths...]')\n .allowUnknownOption()\n .option('-f, --format [formats...]', 'The output format for the generated JavaScript files `iife`, `cjs`, `esm`')\n .option('-b, --bundle', 'To bundle a file means to inline any imported dependencies into the file itself')\n .option('-m, --minify', 'The generated code will be minified instead of pretty-printed')\n .option('-w, --watch', 'Rebuild whenever a file changes')\n .option('-s, --sourcemap', 'Emit a source map')\n .option('-p, --platform <node,browser,neutral>', 'Platform target')\n .option('-t, --type', 'Emit typescript declarations')\n .option('-o, --outdir <dir>', 'The output directory for the build operation')\n .option('--srcdir <dir>', 'The source directory')\n .action(async function (entries: string[]) {\n const pkg: PackageJson = readPackage()\n const { dependencies, peerDependencies } = pkg\n const pkgEntry = pkg.main || pkg.module || pkg.browser\n /** Extract external dependencies to prevent bundling */\n const externalDependencies = []\n dependencies && externalDependencies.push(...Object.keys(dependencies))\n peerDependencies && externalDependencies.push(...Object.keys(peerDependencies))\n const options = Object.assign({\n format: '',\n watch: false,\n minify: true,\n bundle: true,\n type: !!pkg.types,\n srcdir: 'src',\n outdir: path.dirname(pkgEntry) || 'dist',\n externals: externalDependencies\n }, this.opts())\n const tasks = []\n const event = options.watch ? 'watching' : 'building'\n const addBuildTask = async (eachEntries: string[], eachFormat: string, eachExt?: string) => {\n const eachEntryPoints = fg.sync(\n [...new Set(eachEntries)].map((eachEntry) => normalizePath(eachEntry))\n )\n const isCSSTask = eachFormat === 'css'\n if (!eachEntryPoints.length) {\n log.e`[${eachFormat}] Cannot find any entry file specified **${eachEntries}**`\n process.exit()\n }\n tasks.push(\n async () => {\n const { metafile } = await build({\n entryPoints: eachEntryPoints,\n outExtension: isCSSTask\n ? { '.css': '.css' }\n : {\n '.js': eachExt\n ? eachExt\n : { cjs: '.cjs', esm: '.mjs', iife: '.js' }[eachFormat]\n },\n external: externalDependencies,\n watch: options.watch ? {\n onRebuild(error, result) {\n // make esbuild log mute and depend on `tsx`\n }\n } : false,\n logLevel: 'silent',\n outdir: options.outdir,\n bundle: options.bundle,\n minify: options.minify,\n sourcemap: options.sourcemap,\n platform: options.platform,\n metafile: true,\n format: isCSSTask ? undefined : eachFormat\n } as BuildOptions)\n if (metafile) {\n for (const outputFilePath in metafile.outputs) {\n const eachOutput = metafile.outputs[outputFilePath]\n log.i`[${eachFormat}] **${outputFilePath}** ++${prettyBytes(eachOutput.bytes)}++ ..${Object.keys(eachOutput.inputs)?.length}.. ..inputs..`\n }\n }\n }\n )\n }\n let formats: string[] = []\n if (entries.length) {\n const isCSSEntry = entries.find((eachEntry) => eachEntry.includes('.css'))\n if (isCSSEntry) {\n addBuildTask(entries, 'css')\n formats.push('css')\n } else {\n formats = (options.format || 'cjs,esm').split(',')\n formats.map((eachFormat: string) => addBuildTask(entries, eachFormat))\n }\n } else {\n if (pkg.style) {\n addBuildTask([changeFilePath(pkg.main, options.srcdir, '.css')], 'css')\n formats.push('css')\n }\n if (pkg.main && !pkg.main.endsWith('.css')) {\n addBuildTask([changeFilePath(pkg.main, options.srcdir, '.{tsx,ts}')], 'cjs', path.extname(pkg.main))\n formats.push('cjs')\n }\n if (pkg.module) {\n addBuildTask([changeFilePath(pkg.module, options.srcdir, '.{tsx,ts}')], 'esm', path.extname(pkg.module))\n formats.push('esm')\n }\n if (pkg.browser) {\n addBuildTask([changeFilePath(pkg.browser, options.srcdir, '.{tsx,ts}')], 'iife', path.extname(pkg.browser))\n formats.push('iife')\n }\n if (!tasks.length) {\n formats = (options.format || 'cjs,esm').split(',')\n formats.map((eachFormat: string) => addBuildTask([path.join(options.srcdir, 'index.ts')], eachFormat))\n }\n }\n options.format = formats.join(',')\n if (options.type) {\n tasks.push(\n () => new Promise<void>((resolve) => {\n if (options.watch) {\n log.i`[type] type declarations`\n }\n execaCommand(literal`\n npx tsc --emitDeclarationOnly --preserveWatchOutput --declaration\n --outDir ${options.outdir}\n ${options.watch && '--watch'}\n `, {\n stdio: 'inherit',\n stripFinalNewline: false\n })\n .catch((reason) => {\n process.exit()\n })\n .finally(() => {\n log.i`[type] type declarations`\n resolve()\n })\n })\n )\n }\n if (Object.keys(pkg).length) {\n log`\uD83D\uDCE6 extract and merge options from +${pkg.name}+ **package.json**`\n }\n log.tree(options)\n const formatLogText = formats.join(', ').toUpperCase() + (options.type ? ', Type Declarations' : '')\n log.info`[${event}] ${options.watch ? ' ' : formatLogText}`\n await pAll(tasks)\n if (!options.watch) {\n log.success`${formatLogText} ..${options.outdir}..`\n console.log('')\n }\n })", "import {Buffer} from 'node:buffer';\nimport path from 'node:path';\nimport childProcess from 'node:child_process';\nimport process from 'node:process';\nimport crossSpawn from 'cross-spawn';\nimport stripFinalNewline from 'strip-final-newline';\nimport {npmRunPathEnv} from 'npm-run-path';\nimport onetime from 'onetime';\nimport {makeError} from './lib/error.js';\nimport {normalizeStdio, normalizeStdioNode} from './lib/stdio.js';\nimport {spawnedKill, spawnedCancel, setupTimeout, validateTimeout, setExitHandler} from './lib/kill.js';\nimport {handleInput, getSpawnedResult, makeAllStream, validateInputSync} from './lib/stream.js';\nimport {mergePromise, getSpawnedPromise} from './lib/promise.js';\nimport {joinCommand, parseCommand, getEscapedCommand} from './lib/command.js';\n\nconst DEFAULT_MAX_BUFFER = 1000 * 1000 * 100;\n\nconst getEnv = ({env: envOption, extendEnv, preferLocal, localDir, execPath}) => {\n\tconst env = extendEnv ? {...process.env, ...envOption} : envOption;\n\n\tif (preferLocal) {\n\t\treturn npmRunPathEnv({env, cwd: localDir, execPath});\n\t}\n\n\treturn env;\n};\n\nconst handleArguments = (file, args, options = {}) => {\n\tconst parsed = crossSpawn._parse(file, args, options);\n\tfile = parsed.command;\n\targs = parsed.args;\n\toptions = parsed.options;\n\n\toptions = {\n\t\tmaxBuffer: DEFAULT_MAX_BUFFER,\n\t\tbuffer: true,\n\t\tstripFinalNewline: true,\n\t\textendEnv: true,\n\t\tpreferLocal: false,\n\t\tlocalDir: options.cwd || process.cwd(),\n\t\texecPath: process.execPath,\n\t\tencoding: 'utf8',\n\t\treject: true,\n\t\tcleanup: true,\n\t\tall: false,\n\t\twindowsHide: true,\n\t\t...options,\n\t};\n\n\toptions.env = getEnv(options);\n\n\toptions.stdio = normalizeStdio(options);\n\n\tif (process.platform === 'win32' && path.basename(file, '.exe') === 'cmd') {\n\t\t// #116\n\t\targs.unshift('/q');\n\t}\n\n\treturn {file, args, options, parsed};\n};\n\nconst handleOutput = (options, value, error) => {\n\tif (typeof value !== 'string' && !Buffer.isBuffer(value)) {\n\t\t// When `execaSync()` errors, we normalize it to '' to mimic `execa()`\n\t\treturn error === undefined ? undefined : '';\n\t}\n\n\tif (options.stripFinalNewline) {\n\t\treturn stripFinalNewline(value);\n\t}\n\n\treturn value;\n};\n\nexport function execa(file, args, options) {\n\tconst parsed = handleArguments(file, args, options);\n\tconst command = joinCommand(file, args);\n\tconst escapedCommand = getEscapedCommand(file, args);\n\n\tvalidateTimeout(parsed.options);\n\n\tlet spawned;\n\ttry {\n\t\tspawned = childProcess.spawn(parsed.file, parsed.args, parsed.options);\n\t} catch (error) {\n\t\t// Ensure the returned error is always both a promise and a child process\n\t\tconst dummySpawned = new childProcess.ChildProcess();\n\t\tconst errorPromise = Promise.reject(makeError({\n\t\t\terror,\n\t\t\tstdout: '',\n\t\t\tstderr: '',\n\t\t\tall: '',\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tparsed,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false,\n\t\t}));\n\t\treturn mergePromise(dummySpawned, errorPromise);\n\t}\n\n\tconst spawnedPromise = getSpawnedPromise(spawned);\n\tconst timedPromise = setupTimeout(spawned, parsed.options, spawnedPromise);\n\tconst processDone = setExitHandler(spawned, parsed.options, timedPromise);\n\n\tconst context = {isCanceled: false};\n\n\tspawned.kill = spawnedKill.bind(null, spawned.kill.bind(spawned));\n\tspawned.cancel = spawnedCancel.bind(null, spawned, context);\n\n\tconst handlePromise = async () => {\n\t\tconst [{error, exitCode, signal, timedOut}, stdoutResult, stderrResult, allResult] = await getSpawnedResult(spawned, parsed.options, processDone);\n\t\tconst stdout = handleOutput(parsed.options, stdoutResult);\n\t\tconst stderr = handleOutput(parsed.options, stderrResult);\n\t\tconst all = handleOutput(parsed.options, allResult);\n\n\t\tif (error || exitCode !== 0 || signal !== null) {\n\t\t\tconst returnedError = makeError({\n\t\t\t\terror,\n\t\t\t\texitCode,\n\t\t\t\tsignal,\n\t\t\t\tstdout,\n\t\t\t\tstderr,\n\t\t\t\tall,\n\t\t\t\tcommand,\n\t\t\t\tescapedCommand,\n\t\t\t\tparsed,\n\t\t\t\ttimedOut,\n\t\t\t\tisCanceled: context.isCanceled || (parsed.options.signal ? parsed.options.signal.aborted : false),\n\t\t\t\tkilled: spawned.killed,\n\t\t\t});\n\n\t\t\tif (!parsed.options.reject) {\n\t\t\t\treturn returnedError;\n\t\t\t}\n\n\t\t\tthrow returnedError;\n\t\t}\n\n\t\treturn {\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\texitCode: 0,\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\tall,\n\t\t\tfailed: false,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false,\n\t\t};\n\t};\n\n\tconst handlePromiseOnce = onetime(handlePromise);\n\n\thandleInput(spawned, parsed.options.input);\n\n\tspawned.all = makeAllStream(spawned, parsed.options);\n\n\treturn mergePromise(spawned, handlePromiseOnce);\n}\n\nexport function execaSync(file, args, options) {\n\tconst parsed = handleArguments(file, args, options);\n\tconst command = joinCommand(file, args);\n\tconst escapedCommand = getEscapedCommand(file, args);\n\n\tvalidateInputSync(parsed.options);\n\n\tlet result;\n\ttry {\n\t\tresult = childProcess.spawnSync(parsed.file, parsed.args, parsed.options);\n\t} catch (error) {\n\t\tthrow makeError({\n\t\t\terror,\n\t\t\tstdout: '',\n\t\t\tstderr: '',\n\t\t\tall: '',\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tparsed,\n\t\t\ttimedOut: false,\n\t\t\tisCanceled: false,\n\t\t\tkilled: false,\n\t\t});\n\t}\n\n\tconst stdout = handleOutput(parsed.options, result.stdout, result.error);\n\tconst stderr = handleOutput(parsed.options, result.stderr, result.error);\n\n\tif (result.error || result.status !== 0 || result.signal !== null) {\n\t\tconst error = makeError({\n\t\t\tstdout,\n\t\t\tstderr,\n\t\t\terror: result.error,\n\t\t\tsignal: result.signal,\n\t\t\texitCode: result.status,\n\t\t\tcommand,\n\t\t\tescapedCommand,\n\t\t\tparsed,\n\t\t\ttimedOut: result.error && result.error.code === 'ETIMEDOUT',\n\t\t\tisCanceled: false,\n\t\t\tkilled: result.signal !== null,\n\t\t});\n\n\t\tif (!parsed.options.reject) {\n\t\t\treturn error;\n\t\t}\n\n\t\tthrow error;\n\t}\n\n\treturn {\n\t\tcommand,\n\t\tescapedCommand,\n\t\texitCode: 0,\n\t\tstdout,\n\t\tstderr,\n\t\tfailed: false,\n\t\ttimedOut: false,\n\t\tisCanceled: false,\n\t\tkilled: false,\n\t};\n}\n\nexport function execaCommand(command, options) {\n\tconst [file, ...args] = parseCommand(command);\n\treturn execa(file, args, options);\n}\n\nexport function execaCommandSync(command, options) {\n\tconst [file, ...args] = parseCommand(command);\n\treturn execaSync(file, args, options);\n}\n\nexport function execaNode(scriptPath, args, options = {}) {\n\tif (args && !Array.isArray(args) && typeof args === 'object') {\n\t\toptions = args;\n\t\targs = [];\n\t}\n\n\tconst stdio = normalizeStdioNode(options);\n\tconst defaultExecArgv = process.execArgv.filter(arg => !arg.startsWith('--inspect'));\n\n\tconst {\n\t\tnodePath = process.execPath,\n\t\tnodeOptions = defaultExecArgv,\n\t} = options;\n\n\treturn execa(\n\t\tnodePath,\n\t\t[\n\t\t\t...nodeOptions,\n\t\t\tscriptPath,\n\t\t\t...(Array.isArray(args) ? args : []),\n\t\t],\n\t\t{\n\t\t\t...options,\n\t\t\tstdin: undefined,\n\t\t\tstdout: undefined,\n\t\t\tstderr: undefined,\n\t\t\tstdio,\n\t\t\tshell: false,\n\t\t},\n\t);\n}\n", "export default function stripFinalNewline(input) {\n\tconst LF = typeof input === 'string' ? '\\n' : '\\n'.charCodeAt();\n\tconst CR = typeof input === 'string' ? '\\r' : '\\r'.charCodeAt();\n\n\tif (input[input.length - 1] === LF) {\n\t\tinput = input.slice(0, -1);\n\t}\n\n\tif (input[input.length - 1] === CR) {\n\t\tinput = input.slice(0, -1);\n\t}\n\n\treturn input;\n}\n", "import process from 'node:process';\nimport path from 'node:path';\nimport url from 'node:url';\nimport pathKey from 'path-key';\n\nexport function npmRunPath(options = {}) {\n\tconst {\n\t\tcwd = process.cwd(),\n\t\tpath: path_ = process.env[pathKey()],\n\t\texecPath = process.execPath,\n\t} = options;\n\n\tlet previous;\n\tconst cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd;\n\tlet cwdPath = path.resolve(cwdString);\n\tconst result = [];\n\n\twhile (previous !== cwdPath) {\n\t\tresult.push(path.join(cwdPath, 'node_modules/.bin'));\n\t\tprevious = cwdPath;\n\t\tcwdPath = path.resolve(cwdPath, '..');\n\t}\n\n\t// Ensure the running `node` binary is used.\n\tresult.push(path.resolve(cwdString, execPath, '..'));\n\n\treturn [...result, path_].join(path.delimiter);\n}\n\nexport function npmRunPathEnv({env = process.env, ...options} = {}) {\n\tenv = {...env};\n\n\tconst path = pathKey({env});\n\toptions.path = env[path];\n\tenv[path] = npmRunPath(options);\n\n\treturn env;\n}\n", "export default function pathKey(options = {}) {\n\tconst {\n\t\tenv = process.env,\n\t\tplatform = process.platform\n\t} = options;\n\n\tif (platform !== 'win32') {\n\t\treturn 'PATH';\n\t}\n\n\treturn Object.keys(env).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';\n}\n", "const copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\t// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.\n\tif (property === 'arguments' || property === 'caller') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable &&\n\t\ttoDescriptor.enumerable === fromDescriptor.enumerable &&\n\t\ttoDescriptor.configurable === fromDescriptor.configurable &&\n\t\t(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tObject.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});\n};\n\nexport default function mimicFunction(to, from, {ignoreNonConfigurable = false} = {}) {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n}\n", "import mimicFunction from 'mimic-fn';\n\nconst calledFunctions = new WeakMap();\n\nconst onetime = (function_, options = {}) => {\n\tif (typeof function_ !== 'function') {\n\t\tthrow new TypeError('Expected a function');\n\t}\n\n\tlet returnValue;\n\tlet callCount = 0;\n\tconst functionName = function_.displayName || function_.name || '<anonymous>';\n\n\tconst onetime = function (...arguments_) {\n\t\tcalledFunctions.set(onetime, ++callCount);\n\n\t\tif (callCount === 1) {\n\t\t\treturnValue = function_.apply(this, arguments_);\n\t\t\tfunction_ = null;\n\t\t} else if (options.throw === true) {\n\t\t\tthrow new Error(`Function \\`${functionName}\\` can only be called once`);\n\t\t}\n\n\t\treturn returnValue;\n\t};\n\n\tmimicFunction(onetime, function_);\n\tcalledFunctions.set(onetime, callCount);\n\n\treturn onetime;\n};\n\nonetime.callCount = function_ => {\n\tif (!calledFunctions.has(function_)) {\n\t\tthrow new Error(`The given function \\`${function_.name}\\` is not wrapped by the \\`onetime\\` package`);\n\t}\n\n\treturn calledFunctions.get(function_);\n};\n\nexport default onetime;\n", "import { constants } from 'os'\n\nimport { SIGRTMAX } from './realtime.js'\nimport { getSignals } from './signals.js'\n\n// Retrieve `signalsByName`, an object mapping signal name to signal properties.\n// We make sure the object is sorted by `number`.\nconst getSignalsByName = function () {\n const signals = getSignals()\n return signals.reduce(getSignalByName, {})\n}\n\nconst getSignalByName = function (\n signalByNameMemo,\n { name, number, description, supported, action, forced, standard },\n) {\n return {\n ...signalByNameMemo,\n [name]: { name, number, description, supported, action, forced, standard },\n }\n}\n\nexport const signalsByName = getSignalsByName()\n\n// Retrieve `signalsByNumber`, an object mapping signal number to signal\n// properties.\n// We make sure the object is sorted by `number`.\nconst getSignalsByNumber = function () {\n const signals = getSignals()\n const length = SIGRTMAX + 1\n const signalsA = Array.from({ length }, (value, number) =>\n getSignalByNumber(number, signals),\n )\n return Object.assign({}, ...signalsA)\n}\n\nconst getSignalByNumber = function (number, signals) {\n const signal = findSignalByNumber(number, signals)\n\n if (signal === undefined) {\n return {}\n }\n\n const { name, description, supported, action, forced, standard } = signal\n return {\n [number]: {\n name,\n number,\n description,\n supported,\n action,\n forced,\n standard,\n },\n }\n}\n\n// Several signals might end up sharing the same number because of OS-specific\n// numbers, in which case those prevail.\nconst findSignalByNumber = function (number, signals) {\n const signal = signals.find(({ name }) => constants.signals[name] === number)\n\n if (signal !== undefined) {\n return signal\n }\n\n return signals.find((signalA) => signalA.number === number)\n}\n\nexport const signalsByNumber = getSignalsByNumber()\n", "// List of realtime signals with information about them\nexport const getRealtimeSignals = function () {\n const length = SIGRTMAX - SIGRTMIN + 1\n return Array.from({ length }, getRealtimeSignal)\n}\n\nconst getRealtimeSignal = function (value, index) {\n return {\n name: `SIGRT${index + 1}`,\n number: SIGRTMIN + index,\n action: 'terminate',\n description: 'Application-specific signal (realtime)',\n standard: 'posix',\n }\n}\n\nconst SIGRTMIN = 34\nexport const SIGRTMAX = 64\n", "import { constants } from 'os'\n\nimport { SIGNALS } from './core.js'\nimport { getRealtimeSignals } from './realtime.js'\n\n// Retrieve list of know signals (including realtime) with information about\n// them\nexport const getSignals = function () {\n const realtimeSignals = getRealtimeSignals()\n const signals = [...SIGNALS, ...realtimeSignals].map(normalizeSignal)\n return signals\n}\n\n// Normalize signal:\n// - `number`: signal numbers are OS-specific. This is taken into account by\n// `os.constants.signals`. However we provide a default `number` since some\n// signals are not defined for some OS.\n// - `forced`: set default to `false`\n// - `supported`: set value\nconst normalizeSignal = function ({\n name,\n number: defaultNumber,\n description,\n action,\n forced = false,\n standard,\n}) {\n const {\n signals: { [name]: constantSignal },\n } = constants\n const supported = constantSignal !== undefined\n const number = supported ? constantSignal : defaultNumber\n return { name, number, description, supported, action, forced, standard }\n}\n", "/* eslint-disable max-lines */\n// List of known process signals with information about them\nexport const SIGNALS = [\n {\n name: 'SIGHUP',\n number: 1,\n action: 'terminate',\n description: 'Terminal closed',\n standard: 'posix',\n },\n {\n name: 'SIGINT',\n number: 2,\n action: 'terminate',\n description: 'User interruption with CTRL-C',\n standard: 'ansi',\n },\n {\n name: 'SIGQUIT',\n number: 3,\n action: 'core',\n description: 'User interruption with CTRL-\\\\',\n standard: 'posix',\n },\n {\n name: 'SIGILL',\n number: 4,\n action: 'core',\n description: 'Invalid machine instruction',\n standard: 'ansi',\n },\n {\n name: 'SIGTRAP',\n number: 5,\n action: 'core',\n description: 'Debugger breakpoint',\n standard: 'posix',\n },\n {\n name: 'SIGABRT',\n number: 6,\n action: 'core',\n description: 'Aborted',\n standard: 'ansi',\n },\n {\n name: 'SIGIOT',\n number: 6,\n action: 'core',\n description: 'Aborted',\n standard: 'bsd',\n },\n {\n name: 'SIGBUS',\n number: 7,\n action: 'core',\n description:\n 'Bus error due to misaligned, non-existing address or paging error',\n standard: 'bsd',\n },\n {\n name: 'SIGEMT',\n number: 7,\n action: 'terminate',\n description: 'Command should be emulated but is not implemented',\n standard: 'other',\n },\n {\n name: 'SIGFPE',\n number: 8,\n action: 'core',\n description: 'Floating point arithmetic error',\n standard: 'ansi',\n },\n {\n name: 'SIGKILL',\n number: 9,\n action: 'terminate',\n description: 'Forced termination',\n standard: 'posix',\n forced: true,\n },\n {\n name: 'SIGUSR1',\n number: 10,\n action: 'terminate',\n description: 'Application-specific signal',\n standard: 'posix',\n },\n {\n name: 'SIGSEGV',\n number: 11,\n action: 'core',\n description: 'Segmentation fault',\n standard: 'ansi',\n },\n {\n name: 'SIGUSR2',\n number: 12,\n action: 'terminate',\n description: 'Application-specific signal',\n standard: 'posix',\n },\n {\n name: 'SIGPIPE',\n number: 13,\n action: 'terminate',\n description: 'Broken pipe or socket',\n standard: 'posix',\n },\n {\n name: 'SIGALRM',\n number: 14,\n action: 'terminate',\n description: 'Timeout or timer',\n standard: 'posix',\n },\n {\n name: 'SIGTERM',\n number: 15,\n action: 'terminate',\n description: 'Termination',\n standard: 'ansi',\n },\n {\n name: 'SIGSTKFLT',\n number: 16,\n action: 'terminate',\n description: 'Stack is empty or overflowed',\n standard: 'other',\n },\n {\n name: 'SIGCHLD',\n number: 17,\n action: 'ignore',\n description: 'Child process terminated, paused or unpaused',\n standard: 'posix',\n },\n {\n name: 'SIGCLD',\n number: 17,\n action: 'ignore',\n description: 'Child process terminated, paused or unpaused',\n standard: 'other',\n },\n {\n name: 'SIGCONT',\n number: 18,\n action: 'unpause',\n description: 'Unpaused',\n standard: 'posix',\n forced: true,\n },\n {\n name: 'SIGSTOP',\n number: 19,\n action: 'pause',\n description: 'Paused',\n standard: 'posix',\n forced: true,\n },\n {\n name: 'SIGTSTP',\n number: 20,\n action: 'pause',\n description: 'Paused using CTRL-Z or \"suspend\"',\n standard: 'posix',\n },\n {\n name: 'SIGTTIN',\n number: 21,\n action: 'pause',\n description: 'Background process cannot read terminal input',\n standard: 'posix',\n },\n {\n name: 'SIGBREAK',\n number: 21,\n action: 'terminate',\n description: 'User interruption with CTRL-BREAK',\n standard: 'other',\n },\n {\n name: 'SIGTTOU',\n number: 22,\n action: 'pause',\n description: 'Background process cannot write to terminal output',\n standard: 'posix',\n },\n {\n name: 'SIGURG',\n number: 23,\n action: 'ignore',\n description: 'Socket received out-of-band data',\n standard: 'bsd',\n },\n {\n name: 'SIGXCPU',\n number: 24,\n action: 'core',\n description: 'Process timed out',\n standard: 'bsd',\n },\n {\n name: 'SIGXFSZ',\n number: 25,\n action: 'core',\n description: 'File too big',\n standard: 'bsd',\n },\n {\n name: 'SIGVTALRM',\n number: 26,\n action: 'terminate',\n description: 'Timeout or timer',\n standard: 'bsd',\n },\n {\n name: 'SIGPROF',\n number: 27,\n action: 'terminate',\n description: 'Timeout or timer',\n standard: 'bsd',\n },\n {\n name: 'SIGWINCH',\n number: 28,\n action: 'ignore',\n description: 'Terminal window size changed',\n standard: 'bsd',\n },\n {\n name: 'SIGIO',\n number: 29,\n action: 'terminate',\n description: 'I/O is available',\n standard: 'other',\n },\n {\n name: 'SIGPOLL',\n number: 29,\n action: 'terminate',\n description: 'Watched event',\n standard: 'other',\n },\n {\n name: 'SIGINFO',\n number: 29,\n action: 'ignore',\n description: 'Request for process information',\n standard: 'other',\n },\n {\n name: 'SIGPWR',\n number: 30,\n action: 'terminate',\n description: 'Device running out of power',\n standard: 'systemv',\n },\n {\n name: 'SIGSYS',\n number: 31,\n action: 'core',\n description: 'Invalid system call',\n standard: 'other',\n },\n {\n name: 'SIGUNUSED',\n number: 31,\n action: 'terminate',\n description: 'Invalid system call',\n standard: 'other',\n },\n]\n/* eslint-enable max-lines */\n", "import {signalsByName} from 'human-signals';\n\nconst getErrorPrefix = ({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled}) => {\n\tif (timedOut) {\n\t\treturn `timed out after ${timeout} milliseconds`;\n\t}\n\n\tif (isCanceled) {\n\t\treturn 'was canceled';\n\t}\n\n\tif (errorCode !== undefined) {\n\t\treturn `failed with ${errorCode}`;\n\t}\n\n\tif (signal !== undefined) {\n\t\treturn `was killed with ${signal} (${signalDescription})`;\n\t}\n\n\tif (exitCode !== undefined) {\n\t\treturn `failed with exit code ${exitCode}`;\n\t}\n\n\treturn 'failed';\n};\n\nexport const makeError = ({\n\tstdout,\n\tstderr,\n\tall,\n\terror,\n\tsignal,\n\texitCode,\n\tcommand,\n\tescapedCommand,\n\ttimedOut,\n\tisCanceled,\n\tkilled,\n\tparsed: {options: {timeout}},\n}) => {\n\t// `signal` and `exitCode` emitted on `spawned.on('exit')` event can be `null`.\n\t// We normalize them to `undefined`\n\texitCode = exitCode === null ? undefined : exitCode;\n\tsignal = signal === null ? undefined : signal;\n\tconst signalDescription = signal === undefined ? undefined : signalsByName[signal].description;\n\n\tconst errorCode = error && error.code;\n\n\tconst prefix = getErrorPrefix({timedOut, timeout, errorCode, signal, signalDescription, exitCode, isCanceled});\n\tconst execaMessage = `Command ${prefix}: ${command}`;\n\tconst isError = Object.prototype.toString.call(error) === '[object Error]';\n\tconst shortMessage = isError ? `${execaMessage}\\n${error.message}` : execaMessage;\n\tconst message = [shortMessage, stderr, stdout].filter(Boolean).join('\\n');\n\n\tif (isError) {\n\t\terror.originalMessage = error.message;\n\t\terror.message = message;\n\t} else {\n\t\terror = new Error(message);\n\t}\n\n\terror.shortMessage = shortMessage;\n\terror.command = command;\n\terror.escapedCommand = escapedCommand;\n\terror.exitCode = exitCode;\n\terror.signal = signal;\n\terror.signalDescription = signalDescription;\n\terror.stdout = stdout;\n\terror.stderr = stderr;\n\n\tif (all !== undefined) {\n\t\terror.all = all;\n\t}\n\n\tif ('bufferedData' in error) {\n\t\tdelete error.bufferedData;\n\t}\n\n\terror.failed = true;\n\terror.timedOut = Boolean(timedOut);\n\terror.isCanceled = isCanceled;\n\terror.killed = killed && !timedOut;\n\n\treturn error;\n};\n", "const aliases = ['stdin', 'stdout', 'stderr'];\n\nconst hasAlias = options => aliases.some(alias => options[alias] !== undefined);\n\nexport const normalizeStdio = options => {\n\tif (!options) {\n\t\treturn;\n\t}\n\n\tconst {stdio} = options;\n\n\tif (stdio === undefined) {\n\t\treturn aliases.map(alias => options[alias]);\n\t}\n\n\tif (hasAlias(options)) {\n\t\tthrow new Error(`It's not possible to provide \\`stdio\\` in combination with one of ${aliases.map(alias => `\\`${alias}\\``).join(', ')}`);\n\t}\n\n\tif (typeof stdio === 'string') {\n\t\treturn stdio;\n\t}\n\n\tif (!Array.isArray(stdio)) {\n\t\tthrow new TypeError(`Expected \\`stdio\\` to be of type \\`string\\` or \\`Array\\`, got \\`${typeof stdio}\\``);\n\t}\n\n\tconst length = Math.max(stdio.length, aliases.length);\n\treturn Array.from({length}, (value, index) => stdio[index]);\n};\n\n// `ipc` is pushed unless it is already present\nexport const normalizeStdioNode = options => {\n\tconst stdio = normalizeStdio(options);\n\n\tif (stdio === 'ipc') {\n\t\treturn 'ipc';\n\t}\n\n\tif (stdio === undefined || typeof stdio === 'string') {\n\t\treturn [stdio, stdio, stdio, 'ipc'];\n\t}\n\n\tif (stdio.includes('ipc')) {\n\t\treturn stdio;\n\t}\n\n\treturn [...stdio, 'ipc'];\n};\n", "import os from 'node:os';\nimport onExit from 'signal-exit';\n\nconst DEFAULT_FORCE_KILL_TIMEOUT = 1000 * 5;\n\n// Monkey-patches `childProcess.kill()` to add `forceKillAfterTimeout` behavior\nexport const spawnedKill = (kill, signal = 'SIGTERM', options = {}) => {\n\tconst killResult = kill(signal);\n\tsetKillTimeout(kill, signal, options, killResult);\n\treturn killResult;\n};\n\nconst setKillTimeout = (kill, signal, options, killResult) => {\n\tif (!shouldForceKill(signal, options, killResult)) {\n\t\treturn;\n\t}\n\n\tconst timeout = getForceKillAfterTimeout(options);\n\tconst t = setTimeout(() => {\n\t\tkill('SIGKILL');\n\t}, timeout);\n\n\t// Guarded because there's no `.unref()` when `execa` is used in the renderer\n\t// process in Electron. This cannot be tested since we don't run tests in\n\t// Electron.\n\t// istanbul ignore else\n\tif (t.unref) {\n\t\tt.unref();\n\t}\n};\n\nconst shouldForceKill = (signal, {forceKillAfterTimeout}, killResult) => isSigterm(signal) && forceKillAfterTimeout !== false && killResult;\n\nconst isSigterm = signal => signal === os.constants.signals.SIGTERM\n\t\t|| (typeof signal === 'string' && signal.toUpperCase() === 'SIGTERM');\n\nconst getForceKillAfterTimeout = ({forceKillAfterTimeout = true}) => {\n\tif (forceKillAfterTimeout === true) {\n\t\treturn DEFAULT_FORCE_KILL_TIMEOUT;\n\t}\n\n\tif (!Number.isFinite(forceKillAfterTimeout) || forceKillAfterTimeout < 0) {\n\t\tthrow new TypeError(`Expected the \\`forceKillAfterTimeout\\` option to be a non-negative integer, got \\`${forceKillAfterTimeout}\\` (${typeof forceKillAfterTimeout})`);\n\t}\n\n\treturn forceKillAfterTimeout;\n};\n\n// `childProcess.cancel()`\nexport const spawnedCancel = (spawned, context) => {\n\tconst killResult = spawned.kill();\n\n\tif (killResult) {\n\t\tcontext.isCanceled = true;\n\t}\n};\n\nconst timeoutKill = (spawned, signal, reject) => {\n\tspawned.kill(signal);\n\treject(Object.assign(new Error('Timed out'), {timedOut: true, signal}));\n};\n\n// `timeout` option handling\nexport const setupTimeout = (spawned, {timeout, killSignal = 'SIGTERM'}, spawnedPromise) => {\n\tif (timeout === 0 || timeout === undefined) {\n\t\treturn spawnedPromise;\n\t}\n\n\tlet timeoutId;\n\tconst timeoutPromise = new Promise((resolve, reject) => {\n\t\ttimeoutId = setTimeout(() => {\n\t\t\ttimeoutKill(spawned, killSignal, reject);\n\t\t}, timeout);\n\t});\n\n\tconst safeSpawnedPromise = spawnedPromise.finally(() => {\n\t\tclearTimeout(timeoutId);\n\t});\n\n\treturn Promise.race([timeoutPromise, safeSpawnedPromise]);\n};\n\nexport const validateTimeout = ({timeout}) => {\n\tif (timeout !== undefined && (!Number.isFinite(timeout) || timeout < 0)) {\n\t\tthrow new TypeError(`Expected the \\`timeout\\` option to be a non-negative integer, got \\`${timeout}\\` (${typeof timeout})`);\n\t}\n};\n\n// `cleanup` option handling\nexport const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => {\n\tif (!cleanup || detached) {\n\t\treturn timedPromise;\n\t}\n\n\tconst removeExitHandler = onExit(() => {\n\t\tspawned.kill();\n\t});\n\n\treturn timedPromise.finally(() => {\n\t\tremoveExitHandler();\n\t});\n};\n", "export function isStream(stream) {\n\treturn stream !== null\n\t\t&& typeof stream === 'object'\n\t\t&& typeof stream.pipe === 'function';\n}\n\nexport function isWritableStream(stream) {\n\treturn isStream(stream)\n\t\t&& stream.writable !== false\n\t\t&& typeof stream._write === 'function'\n\t\t&& typeof stream._writableState === 'object';\n}\n\nexport function isReadableStream(stream) {\n\treturn isStream(stream)\n\t\t&& stream.readable !== false\n\t\t&& typeof stream._read === 'function'\n\t\t&& typeof stream._readableState === 'object';\n}\n\nexport function isDuplexStream(stream) {\n\treturn isWritableStream(stream)\n\t\t&& isReadableStream(stream);\n}\n\nexport function isTransformStream(stream) {\n\treturn isDuplexStream(stream)\n\t\t&& typeof stream._transform === 'function';\n}\n", "import {isStream} from 'is-stream';\nimport getStream from 'get-stream';\nimport mergeStream from 'merge-stream';\n\n// `input` option\nexport const handleInput = (spawned, input) => {\n\t// Checking for stdin is workaround for https://github.com/nodejs/node/issues/26852\n\t// @todo remove `|| spawned.stdin === undefined` once we drop support for Node.js <=12.2.0\n\tif (input === undefined || spawned.stdin === undefined) {\n\t\treturn;\n\t}\n\n\tif (isStream(input)) {\n\t\tinput.pipe(spawned.stdin);\n\t} else {\n\t\tspawned.stdin.end(input);\n\t}\n};\n\n// `all` interleaves `stdout` and `stderr`\nexport const makeAllStream = (spawned, {all}) => {\n\tif (!all || (!spawned.stdout && !spawned.stderr)) {\n\t\treturn;\n\t}\n\n\tconst mixed = mergeStream();\n\n\tif (spawned.stdout) {\n\t\tmixed.add(spawned.stdout);\n\t}\n\n\tif (spawned.stderr) {\n\t\tmixed.add(spawned.stderr);\n\t}\n\n\treturn mixed;\n};\n\n// On failure, `result.stdout|stderr|all` should contain the currently buffered stream\nconst getBufferedData = async (stream, streamPromise) => {\n\tif (!stream) {\n\t\treturn;\n\t}\n\n\tstream.destroy();\n\n\ttry {\n\t\treturn await streamPromise;\n\t} catch (error) {\n\t\treturn error.bufferedData;\n\t}\n};\n\nconst getStreamPromise = (stream, {encoding, buffer, maxBuffer}) => {\n\tif (!stream || !buffer) {\n\t\treturn;\n\t}\n\n\tif (encoding) {\n\t\treturn getStream(stream, {encoding, maxBuffer});\n\t}\n\n\treturn getStream.buffer(stream, {maxBuffer});\n};\n\n// Retrieve result of child process: exit code, signal, error, streams (stdout/stderr/all)\nexport const getSpawnedResult = async ({stdout, stderr, all}, {encoding, buffer, maxBuffer}, processDone) => {\n\tconst stdoutPromise = getStreamPromise(stdout, {encoding, buffer, maxBuffer});\n\tconst stderrPromise = getStreamPromise(stderr, {encoding, buffer, maxBuffer});\n\tconst allPromise = getStreamPromise(all, {encoding, buffer, maxBuffer: maxBuffer * 2});\n\n\ttry {\n\t\treturn await Promise.all([processDone, stdoutPromise, stderrPromise, allPromise]);\n\t} catch (error) {\n\t\treturn Promise.all([\n\t\t\t{error, signal: error.signal, timedOut: error.timedOut},\n\t\t\tgetBufferedData(stdout, stdoutPromise),\n\t\t\tgetBufferedData(stderr, stderrPromise),\n\t\t\tgetBufferedData(all, allPromise),\n\t\t]);\n\t}\n};\n\nexport const validateInputSync = ({input}) => {\n\tif (isStream(input)) {\n\t\tthrow new TypeError('The `input` option cannot be a stream in sync mode');\n\t}\n};\n", "const nativePromisePrototype = (async () => {})().constructor.prototype;\nconst descriptors = ['then', 'catch', 'finally'].map(property => [\n\tproperty,\n\tReflect.getOwnPropertyDescriptor(nativePromisePrototype, property),\n]);\n\n// The return value is a mixin of `childProcess` and `Promise`\nexport const mergePromise = (spawned, promise) => {\n\tfor (const [property, descriptor] of descriptors) {\n\t\t// Starting the main `promise` is deferred to avoid consuming streams\n\t\tconst value = typeof promise === 'function'\n\t\t\t? (...args) => Reflect.apply(descriptor.value, promise(), args)\n\t\t\t: descriptor.value.bind(promise);\n\n\t\tReflect.defineProperty(spawned, property, {...descriptor, value});\n\t}\n\n\treturn spawned;\n};\n\n// Use promises instead of `child_process` events\nexport const getSpawnedPromise = spawned => new Promise((resolve, reject) => {\n\tspawned.on('exit', (exitCode, signal) => {\n\t\tresolve({exitCode, signal});\n\t});\n\n\tspawned.on('error', error => {\n\t\treject(error);\n\t});\n\n\tif (spawned.stdin) {\n\t\tspawned.stdin.on('error', error => {\n\t\t\treject(error);\n\t\t});\n\t}\n});\n", "const normalizeArgs = (file, args = []) => {\n\tif (!Array.isArray(args)) {\n\t\treturn [file];\n\t}\n\n\treturn [file, ...args];\n};\n\nconst NO_ESCAPE_REGEXP = /^[\\w.-]+$/;\nconst DOUBLE_QUOTES_REGEXP = /\"/g;\n\nconst escapeArg = arg => {\n\tif (typeof arg !== 'string' || NO_ESCAPE_REGEXP.test(arg)) {\n\t\treturn arg;\n\t}\n\n\treturn `\"${arg.replace(DOUBLE_QUOTES_REGEXP, '\\\\\"')}\"`;\n};\n\nexport const joinCommand = (file, args) => normalizeArgs(file, args).join(' ');\n\nexport const getEscapedCommand = (file, args) => normalizeArgs(file, args).map(arg => escapeArg(arg)).join(' ');\n\nconst SPACES_REGEXP = / +/g;\n\n// Handle `execaCommand()`\nexport const parseCommand = command => {\n\tconst tokens = [];\n\tfor (const token of command.trim().split(SPACES_REGEXP)) {\n\t\t// Allow spaces to be escaped by a backslash if not meant as a delimiter\n\t\tconst previousToken = tokens[tokens.length - 1];\n\t\tif (previousToken && previousToken.endsWith('\\\\')) {\n\t\t\t// Merge previous token with current one\n\t\t\ttokens[tokens.length - 1] = `${previousToken.slice(0, -1)} ${token}`;\n\t\t} else {\n\t\t\ttokens.push(token);\n\t\t}\n\t}\n\n\treturn tokens;\n};\n", "export default function indentString(string, count = 1, options = {}) {\n\tconst {\n\t\tindent = ' ',\n\t\tincludeEmptyLines = false\n\t} = options;\n\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`input\\` to be a \\`string\\`, got \\`${typeof string}\\``\n\t\t);\n\t}\n\n\tif (typeof count !== 'number') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`count\\` to be a \\`number\\`, got \\`${typeof count}\\``\n\t\t);\n\t}\n\n\tif (count < 0) {\n\t\tthrow new RangeError(\n\t\t\t`Expected \\`count\\` to be at least 0, got \\`${count}\\``\n\t\t);\n\t}\n\n\tif (typeof indent !== 'string') {\n\t\tthrow new TypeError(\n\t\t\t`Expected \\`options.indent\\` to be a \\`string\\`, got \\`${typeof indent}\\``\n\t\t);\n\t}\n\n\tif (count === 0) {\n\t\treturn string;\n\t}\n\n\tconst regex = includeEmptyLines ? /^/gm : /^(?!\\s*$)/gm;\n\n\treturn string.replace(regex, indent.repeat(count));\n}\n", "import os from 'os';\nimport escapeStringRegexp from 'escape-string-regexp';\n\nconst extractPathRegex = /\\s+at.*[(\\s](.*)\\)?/;\nconst pathRegex = /^(?:(?:(?:node|node:[\\w/]+|(?:(?:node:)?internal\\/[\\w/]*|.*node_modules\\/(?:babel-polyfill|pirates)\\/.*)?\\w+)(?:\\.js)?:\\d+:\\d+)|native)/;\nconst homeDir = typeof os.homedir === 'undefined' ? '' : os.homedir().replace(/\\\\/g, '/');\n\nexport default function cleanStack(stack, {pretty = false, basePath} = {}) {\n\tconst basePathRegex = basePath && new RegExp(`(at | \\\\()${escapeStringRegexp(basePath.replace(/\\\\/g, '/'))}`, 'g');\n\n\tif (typeof stack !== 'string') {\n\t\treturn undefined;\n\t}\n\n\treturn stack.replace(/\\\\/g, '/')\n\t\t.split('\\n')\n\t\t.filter(line => {\n\t\t\tconst pathMatches = line.match(extractPathRegex);\n\t\t\tif (pathMatches === null || !pathMatches[1]) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst match = pathMatches[1];\n\n\t\t\t// Electron\n\t\t\tif (\n\t\t\t\tmatch.includes('.app/Contents/Resources/electron.asar') ||\n\t\t\t\tmatch.includes('.app/Contents/Resources/default_app.asar') ||\n\t\t\t\tmatch.includes('node_modules/electron/dist/resources/electron.asar') ||\n\t\t\t\tmatch.includes('node_modules/electron/dist/resources/default_app.asar')\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn !pathRegex.test(match);\n\t\t})\n\t\t.filter(line => line.trim() !== '')\n\t\t.map(line => {\n\t\t\tif (basePathRegex) {\n\t\t\t\tline = line.replace(basePathRegex, '$1');\n\t\t\t}\n\n\t\t\tif (pretty) {\n\t\t\t\tline = line.replace(extractPathRegex, (m, p1) => m.replace(p1, p1.replace(homeDir, '~')));\n\t\t\t}\n\n\t\t\treturn line;\n\t\t})\n\t\t.join('\\n');\n}\n", "export default function escapeStringRegexp(string) {\n\tif (typeof string !== 'string') {\n\t\tthrow new TypeError('Expected a string');\n\t}\n\n\t// Escape characters with special meaning either inside or outside character sets.\n\t// Use a simple backslash escape when it\u2019s always valid, and a `\\xnn` escape when the simpler form would be disallowed by Unicode patterns\u2019 stricter grammar.\n\treturn string\n\t\t.replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&')\n\t\t.replace(/-/g, '\\\\x2d');\n}\n", "import indentString from 'indent-string';\nimport cleanStack from 'clean-stack';\n\nconst cleanInternalStack = stack => stack.replace(/\\s+at .*aggregate-error\\/index.js:\\d+:\\d+\\)?/g, '');\n\nexport default class AggregateError extends Error {\n\t#errors;\n\n\tname = 'AggregateError';\n\n\tconstructor(errors) {\n\t\tif (!Array.isArray(errors)) {\n\t\t\tthrow new TypeError(`Expected input to be an Array, got ${typeof errors}`);\n\t\t}\n\n\t\terrors = errors.map(error => {\n\t\t\tif (error instanceof Error) {\n\t\t\t\treturn error;\n\t\t\t}\n\n\t\t\tif (error !== null && typeof error === 'object') {\n\t\t\t\t// Handle plain error objects with message property and/or possibly other metadata\n\t\t\t\treturn Object.assign(new Error(error.message), error);\n\t\t\t}\n\n\t\t\treturn new Error(error);\n\t\t});\n\n\t\tlet message = errors\n\t\t\t.map(error => {\n\t\t\t\t// The `stack` property is not standardized, so we can't assume it exists\n\t\t\t\treturn typeof error.stack === 'string' && error.stack.length > 0 ? cleanInternalStack(cleanStack(error.stack)) : String(error);\n\t\t\t})\n\t\t\t.join('\\n');\n\t\tmessage = '\\n' + indentString(message, 4);\n\t\tsuper(message);\n\n\t\tthis.#errors = errors;\n\t}\n\n\tget errors() {\n\t\treturn this.#errors.slice();\n\t}\n}\n", "import AggregateError from 'aggregate-error';\n\n/**\nAn error to be thrown when the request is aborted by AbortController.\nDOMException is thrown instead of this Error when DOMException is available.\n*/\nexport class AbortError extends Error {\n\tconstructor(message) {\n\t\tsuper();\n\t\tthis.name = 'AbortError';\n\t\tthis.message = message;\n\t}\n}\n\n/**\nTODO: Remove AbortError and just throw DOMException when targeting Node 18.\n*/\nconst getDOMException = errorMessage => globalThis.DOMException === undefined\n\t? new AbortError(errorMessage)\n\t: new DOMException(errorMessage);\n\n/**\nTODO: Remove below function and just 'reject(signal.reason)' when targeting Node 18.\n*/\nconst getAbortedReason = signal => {\n\tconst reason = signal.reason === undefined\n\t\t? getDOMException('This operation was aborted.')\n\t\t: signal.reason;\n\n\treturn reason instanceof Error ? reason : getDOMException(reason);\n};\n\nexport default async function pMap(\n\titerable,\n\tmapper,\n\t{\n\t\tconcurrency = Number.POSITIVE_INFINITY,\n\t\tstopOnError = true,\n\t\tsignal,\n\t} = {},\n) {\n\treturn new Promise((resolve, reject_) => {\n\t\tif (iterable[Symbol.iterator] === undefined && iterable[Symbol.asyncIterator] === undefined) {\n\t\t\tthrow new TypeError(`Expected \\`input\\` to be either an \\`Iterable\\` or \\`AsyncIterable\\`, got (${typeof iterable})`);\n\t\t}\n\n\t\tif (typeof mapper !== 'function') {\n\t\t\tthrow new TypeError('Mapper function is required');\n\t\t}\n\n\t\tif (!((Number.isSafeInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency >= 1)) {\n\t\t\tthrow new TypeError(`Expected \\`concurrency\\` to be an integer from 1 and up or \\`Infinity\\`, got \\`${concurrency}\\` (${typeof concurrency})`);\n\t\t}\n\n\t\tconst result = [];\n\t\tconst errors = [];\n\t\tconst skippedIndexesMap = new Map();\n\t\tlet isRejected = false;\n\t\tlet isResolved = false;\n\t\tlet isIterableDone = false;\n\t\tlet resolvingCount = 0;\n\t\tlet currentIndex = 0;\n\t\tconst iterator = iterable[Symbol.iterator] === undefined ? iterable[Symbol.asyncIterator]() : iterable[Symbol.iterator]();\n\n\t\tconst reject = reason => {\n\t\t\tisRejected = true;\n\t\t\tisResolved = true;\n\t\t\treject_(reason);\n\t\t};\n\n\t\tif (signal) {\n\t\t\tif (signal.aborted) {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t}\n\n\t\t\tsignal.addEventListener('abort', () => {\n\t\t\t\treject(getAbortedReason(signal));\n\t\t\t});\n\t\t}\n\n\t\tconst next = async () => {\n\t\t\tif (isResolved) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextItem = await iterator.next();\n\n\t\t\tconst index = currentIndex;\n\t\t\tcurrentIndex++;\n\n\t\t\t// Note: `iterator.next()` can be called many times in parallel.\n\t\t\t// This can cause multiple calls to this `next()` function to\n\t\t\t// receive a `nextItem` with `done === true`.\n\t\t\t// The shutdown logic that rejects/resolves must be protected\n\t\t\t// so it runs only one time as the `skippedIndex` logic is\n\t\t\t// non-idempotent.\n\t\t\tif (nextItem.done) {\n\t\t\t\tisIterableDone = true;\n\n\t\t\t\tif (resolvingCount === 0 && !isResolved) {\n\t\t\t\t\tif (!stopOnError && errors.length > 0) {\n\t\t\t\t\t\treject(new AggregateError(errors));\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tisResolved = true;\n\n\t\t\t\t\tif (skippedIndexesMap.size === 0) {\n\t\t\t\t\t\tresolve(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst pureResult = [];\n\n\t\t\t\t\t// Support multiple `pMapSkip`'s.\n\t\t\t\t\tfor (const [index, value] of result.entries()) {\n\t\t\t\t\t\tif (skippedIndexesMap.get(index) === pMapSkip) {\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tpureResult.push(value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresolve(pureResult);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tresolvingCount++;\n\n\t\t\t// Intentionally detached\n\t\t\t(async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst element = await nextItem.value;\n\n\t\t\t\t\tif (isResolved) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst value = await mapper(element, index);\n\n\t\t\t\t\t// Use Map to stage the index of the element.\n\t\t\t\t\tif (value === pMapSkip) {\n\t\t\t\t\t\tskippedIndexesMap.set(index, value);\n\t\t\t\t\t}\n\n\t\t\t\t\tresult[index] = value;\n\n\t\t\t\t\tresolvingCount--;\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (stopOnError) {\n\t\t\t\t\t\treject(error);\n\t\t\t\t\t} else {\n\t\t\t\t\t\terrors.push(error);\n\t\t\t\t\t\tresolvingCount--;\n\n\t\t\t\t\t\t// In that case we can't really continue regardless of `stopOnError` state\n\t\t\t\t\t\t// since an iterable is likely to continue throwing after it throws once.\n\t\t\t\t\t\t// If we continue calling `next()` indefinitely we will likely end up\n\t\t\t\t\t\t// in an infinite loop of failed iteration.\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tawait next();\n\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\treject(error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})();\n\t\t};\n\n\t\t// Create the concurrent runners in a detached (non-awaited)\n\t\t// promise. We need this so we can await the `next()` calls\n\t\t// to stop creating runners before hitting the concurrency limit\n\t\t// if the iterable has already been marked as done.\n\t\t// NOTE: We *must* do this for async iterators otherwise we'll spin up\n\t\t// infinite `next()` calls by default and never start the event loop.\n\t\t(async () => {\n\t\t\tfor (let index = 0; index < concurrency; index++) {\n\t\t\t\ttry {\n\t\t\t\t\t// eslint-disable-next-line no-await-in-loop\n\t\t\t\t\tawait next();\n\t\t\t\t} catch (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tif (isIterableDone || isRejected) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t})();\n\t});\n}\n\nexport const pMapSkip = Symbol('skip');\n", "import pMap from 'p-map';\n\nexport default async function pAll(iterable, options) {\n\treturn pMap(iterable, element => element(), options);\n}\n", "import path from 'path'\n\nexport function changeFilePath(filePath: string, targetDir: string, targetExt: string) {\n const parsedFilePath = path.parse(filePath)\n return path.join(targetDir, parsedFilePath.name + targetExt)\n}", "const BYTE_UNITS = [\n\t'B',\n\t'kB',\n\t'MB',\n\t'GB',\n\t'TB',\n\t'PB',\n\t'EB',\n\t'ZB',\n\t'YB',\n];\n\nconst BIBYTE_UNITS = [\n\t'B',\n\t'kiB',\n\t'MiB',\n\t'GiB',\n\t'TiB',\n\t'PiB',\n\t'EiB',\n\t'ZiB',\n\t'YiB',\n];\n\nconst BIT_UNITS = [\n\t'b',\n\t'kbit',\n\t'Mbit',\n\t'Gbit',\n\t'Tbit',\n\t'Pbit',\n\t'Ebit',\n\t'Zbit',\n\t'Ybit',\n];\n\nconst BIBIT_UNITS = [\n\t'b',\n\t'kibit',\n\t'Mibit',\n\t'Gibit',\n\t'Tibit',\n\t'Pibit',\n\t'Eibit',\n\t'Zibit',\n\t'Yibit',\n];\n\n/*\nFormats the given number using `Number#toLocaleString`.\n- If locale is a string, the value is expected to be a locale-key (for example: `de`).\n- If locale is true, the system default locale is used for translation.\n- If no value for locale is specified, the number is returned unmodified.\n*/\nconst toLocaleString = (number, locale, options) => {\n\tlet result = number;\n\tif (typeof locale === 'string' || Array.isArray(locale)) {\n\t\tresult = number.toLocaleString(locale, options);\n\t} else if (locale === true || options !== undefined) {\n\t\tresult = number.toLocaleString(undefined, options);\n\t}\n\n\treturn result;\n};\n\nexport default function prettyBytes(number, options) {\n\tif (!Number.isFinite(number)) {\n\t\tthrow new TypeError(`Expected a finite number, got ${typeof number}: ${number}`);\n\t}\n\n\toptions = {\n\t\tbits: false,\n\t\tbinary: false,\n\t\t...options,\n\t};\n\n\tconst UNITS = options.bits\n\t\t? (options.binary ? BIBIT_UNITS : BIT_UNITS)\n\t\t: (options.binary ? BIBYTE_UNITS : BYTE_UNITS);\n\n\tif (options.signed && number === 0) {\n\t\treturn ` 0 ${UNITS[0]}`;\n\t}\n\n\tconst isNegative = number < 0;\n\tconst prefix = isNegative ? '-' : (options.signed ? '+' : '');\n\n\tif (isNegative) {\n\t\tnumber = -number;\n\t}\n\n\tlet localeOptions;\n\n\tif (options.minimumFractionDigits !== undefined) {\n\t\tlocaleOptions = {minimumFractionDigits: options.minimumFractionDigits};\n\t}\n\n\tif (options.maximumFractionDigits !== undefined) {\n\t\tlocaleOptions = {maximumFractionDigits: options.maximumFractionDigits, ...localeOptions};\n\t}\n\n\tif (number < 1) {\n\t\tconst numberString = toLocaleString(number, options.locale, localeOptions);\n\t\treturn prefix + numberString + ' ' + UNITS[0];\n\t}\n\n\tconst exponent = Math.min(Math.floor(options.binary ? Math.log(number) / Math.log(1024) : Math.log10(number) / 3), UNITS.length - 1);\n\tnumber /= (options.binary ? 1024 : 1000) ** exponent;\n\n\tif (!localeOptions) {\n\t\tnumber = number.toPrecision(3);\n\t}\n\n\tconst numberString = toLocaleString(Number(number), options.locale, localeOptions);\n\n\tconst unit = UNITS[exponent];\n\n\treturn prefix + numberString + ' ' + unit;\n}\n"],
|
|
5
|
+
"mappings": ";whBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,CAAAA,GAAO,QAAUC,GACjBA,GAAM,KAAOC,GAEb,IAAIC,GAAK,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oB,CAAC,EAC7F,WACK,KAAKH,EAAI,EACT,YAAYC,EAAW,EACvB,QAAQF,EAAO,EAEpB,WAAQ,MAAM",
|
|
6
|
+
"names": ["require_windows", "__commonJSMin", "exports", "module", "isexe", "sync", "fs", "checkPathExt", "path", "options", "pathext", "i", "p", "checkStat", "stat", "cb", "er", "require_mode", "__commonJSMin", "exports", "module", "isexe", "sync", "fs", "path", "options", "cb", "er", "stat", "checkStat", "checkMode", "mod", "uid", "gid", "myUid", "myGid", "u", "g", "o", "ug", "ret", "require_isexe", "__commonJSMin", "exports", "module", "fs", "core", "isexe", "sync", "path", "options", "cb", "resolve", "reject", "er", "is", "require_which", "__commonJSMin", "exports", "module", "isWindows", "path", "COLON", "isexe", "getNotFoundError", "cmd", "getPathInfo", "opt", "colon", "pathEnv", "pathExtExe", "pathExt", "which", "cb", "found", "step", "i", "resolve", "reject", "ppRaw", "pathPart", "pCmd", "p", "subStep", "ii", "ext", "er", "is", "res", "whichSync", "j", "cur", "require_path_key", "__commonJSMin", "exports", "module", "pathKey", "options", "environment", "key", "require_resolveCommand", "__commonJSMin", "exports", "module", "path", "which", "getPathKey", "resolveCommandAttempt", "parsed", "withoutPathExt", "env", "cwd", "hasCustomCwd", "shouldSwitchCwd", "resolved", "resolveCommand", "require_escape", "__commonJSMin", "exports", "module", "metaCharsRegExp", "escapeCommand", "arg", "escapeArgument", "doubleEscapeMetaChars", "require_shebang_regex", "__commonJSMin", "exports", "module", "require_shebang_command", "__commonJSMin", "exports", "module", "shebangRegex", "string", "match", "path", "argument", "binary", "require_readShebang", "__commonJSMin", "exports", "module", "fs", "shebangCommand", "readShebang", "command", "buffer", "fd", "require_parse", "__commonJSMin", "exports", "module", "path", "resolveCommand", "escape", "readShebang", "isWin", "isExecutableRegExp", "isCmdShimRegExp", "detectShebang", "parsed", "shebang", "parseNonShell", "commandFile", "needsShell", "needsDoubleEscapeMetaChars", "arg", "shellCommand", "parse", "command", "args", "options", "require_enoent", "__commonJSMin", "exports", "module", "isWin", "notFoundError", "original", "syscall", "hookChildProcess", "cp", "parsed", "originalEmit", "name", "arg1", "err", "verifyENOENT", "status", "verifyENOENTSync", "require_cross_spawn", "__commonJSMin", "exports", "module", "cp", "parse", "enoent", "spawn", "command", "args", "options", "parsed", "spawned", "spawnSync", "result", "require_signals", "__commonJSMin", "exports", "module", "require_signal_exit", "__commonJSMin", "exports", "module", "process", "processOk", "assert", "signals", "isWin", "EE", "emitter", "cb", "opts", "loaded", "load", "ev", "remove", "unload", "sig", "sigListeners", "originalProcessEmit", "originalProcessReallyExit", "emit", "event", "code", "signal", "listeners", "processEmit", "processReallyExit", "arg", "ret", "require_buffer_stream", "__commonJSMin", "exports", "module", "PassThroughStream", "options", "array", "encoding", "isBuffer", "objectMode", "stream", "length", "chunks", "chunk", "require_get_stream", "__commonJSMin", "exports", "module", "BufferConstants", "stream", "promisify", "bufferStream", "streamPipelinePromisified", "MaxBufferError", "getStream", "inputStream", "options", "maxBuffer", "resolve", "reject", "rejectPromise", "error", "require_merge_stream", "__commonJSMin", "exports", "module", "PassThrough", "sources", "output", "add", "isEmpty", "remove", "source", "it", "require_normalize_path", "__commonJSMin", "exports", "module", "path", "stripTrailing", "len", "prefix", "ch", "segs", "import_commander", "import_path", "import_commander", "import_fast_glob", "import_fs_extra", "import_path", "import_log", "import_fs_extra", "readPackage", "pkgPath", "fs", "pkg", "readPackage", "defaults", "version", "prefix", "list", "workspaces", "nextVersion", "packagesOfPath", "packagesOfName", "workspacePackagePaths", "eachWorkspace", "path", "updateDependencies", "dependencies", "title", "updated", "dependencyName", "eachPackagePath", "fg", "eachPackage", "fs", "peerDependencies", "workspaceDepsTree", "name", "workspacePackage", "analyzeDeps", "eachDeps", "key", "eachDependencyVersion", "log", "import_commander", "import_fast_glob", "import_node_buffer", "import_node_path", "import_node_child_process", "import_node_process", "import_cross_spawn", "stripFinalNewline", "input", "LF", "CR", "import_node_process", "import_node_path", "import_node_url", "pathKey", "options", "env", "platform", "key", "npmRunPath", "options", "cwd", "process", "path_", "pathKey", "execPath", "previous", "cwdString", "url", "cwdPath", "path", "result", "npmRunPathEnv", "env", "copyProperty", "to", "from", "property", "ignoreNonConfigurable", "toDescriptor", "fromDescriptor", "canCopyProperty", "changePrototype", "fromPrototype", "wrappedToString", "withName", "fromBody", "toStringDescriptor", "toStringName", "changeToString", "name", "newToString", "mimicFunction", "calledFunctions", "onetime", "function_", "options", "returnValue", "callCount", "functionName", "arguments_", "mimicFunction", "onetime_default", "import_os", "getRealtimeSignals", "length", "SIGRTMAX", "SIGRTMIN", "Array", "from", "getRealtimeSignal", "value", "index", "name", "number", "action", "description", "standard", "import_os", "SIGNALS", "name", "number", "action", "description", "standard", "forced", "getSignals", "realtimeSignals", "getRealtimeSignals", "SIGNALS", "map", "normalizeSignal", "name", "number", "defaultNumber", "description", "action", "forced", "standard", "signals", "constantSignal", "constants", "supported", "undefined", "getSignalsByName", "getSignals", "reduce", "getSignalByName", "signalByNameMemo", "name", "number", "description", "supported", "action", "forced", "standard", "signalsByName", "getSignalsByNumber", "signals", "length", "SIGRTMAX", "signalsA", "Array", "from", "value", "getSignalByNumber", "Object", "assign", "signal", "findSignalByNumber", "undefined", "find", "constants", "signalA", "signalsByNumber", "getErrorPrefix", "timedOut", "timeout", "errorCode", "signal", "signalDescription", "exitCode", "isCanceled", "makeError", "stdout", "stderr", "all", "error", "command", "escapedCommand", "killed", "signalsByName", "execaMessage", "isError", "shortMessage", "message", "aliases", "hasAlias", "options", "alias", "normalizeStdio", "stdio", "length", "value", "index", "import_node_os", "import_signal_exit", "DEFAULT_FORCE_KILL_TIMEOUT", "spawnedKill", "kill", "signal", "options", "killResult", "setKillTimeout", "shouldForceKill", "timeout", "getForceKillAfterTimeout", "t", "forceKillAfterTimeout", "isSigterm", "os", "spawnedCancel", "spawned", "context", "timeoutKill", "reject", "setupTimeout", "killSignal", "spawnedPromise", "timeoutId", "timeoutPromise", "resolve", "safeSpawnedPromise", "validateTimeout", "setExitHandler", "cleanup", "detached", "timedPromise", "removeExitHandler", "onExit", "isStream", "stream", "import_get_stream", "import_merge_stream", "handleInput", "spawned", "input", "isStream", "makeAllStream", "all", "mixed", "mergeStream", "getBufferedData", "stream", "streamPromise", "error", "getStreamPromise", "encoding", "buffer", "maxBuffer", "getStream", "getSpawnedResult", "stdout", "stderr", "processDone", "stdoutPromise", "stderrPromise", "allPromise", "nativePromisePrototype", "descriptors", "property", "mergePromise", "spawned", "promise", "descriptor", "value", "args", "getSpawnedPromise", "resolve", "reject", "exitCode", "signal", "error", "normalizeArgs", "file", "args", "NO_ESCAPE_REGEXP", "DOUBLE_QUOTES_REGEXP", "escapeArg", "arg", "joinCommand", "getEscapedCommand", "SPACES_REGEXP", "parseCommand", "command", "tokens", "token", "previousToken", "DEFAULT_MAX_BUFFER", "getEnv", "envOption", "extendEnv", "preferLocal", "localDir", "execPath", "env", "process", "npmRunPathEnv", "handleArguments", "file", "args", "options", "parsed", "crossSpawn", "normalizeStdio", "path", "handleOutput", "value", "error", "stripFinalNewline", "execa", "command", "joinCommand", "escapedCommand", "getEscapedCommand", "validateTimeout", "spawned", "childProcess", "dummySpawned", "errorPromise", "makeError", "mergePromise", "spawnedPromise", "getSpawnedPromise", "timedPromise", "setupTimeout", "processDone", "setExitHandler", "context", "spawnedKill", "spawnedCancel", "handlePromiseOnce", "onetime_default", "exitCode", "signal", "timedOut", "stdoutResult", "stderrResult", "allResult", "getSpawnedResult", "stdout", "stderr", "all", "returnedError", "handleInput", "makeAllStream", "execaCommand", "command", "options", "file", "args", "parseCommand", "execa", "import_esbuild", "indentString", "string", "count", "options", "indent", "includeEmptyLines", "regex", "import_os", "escapeStringRegexp", "string", "extractPathRegex", "pathRegex", "homeDir", "os", "cleanStack", "stack", "pretty", "basePath", "basePathRegex", "escapeStringRegexp", "line", "pathMatches", "match", "m", "p1", "cleanInternalStack", "stack", "AggregateError", "#errors", "errors", "error", "message", "cleanStack", "indentString", "AbortError", "message", "getDOMException", "errorMessage", "getAbortedReason", "signal", "reason", "pMap", "iterable", "mapper", "concurrency", "stopOnError", "resolve", "reject_", "result", "errors", "skippedIndexesMap", "isRejected", "isResolved", "isIterableDone", "resolvingCount", "currentIndex", "iterator", "reject", "next", "nextItem", "index", "AggregateError", "pureResult", "value", "pMapSkip", "element", "error", "pAll", "iterable", "options", "pMap", "element", "import_log", "import_path", "import_path", "changeFilePath", "filePath", "targetDir", "targetExt", "parsedFilePath", "path", "import_literal", "BYTE_UNITS", "BIBYTE_UNITS", "BIT_UNITS", "BIBIT_UNITS", "toLocaleString", "number", "locale", "options", "result", "prettyBytes", "UNITS", "isNegative", "prefix", "localeOptions", "numberString", "exponent", "unit", "import_normalize_path", "entries", "pkg", "readPackage", "dependencies", "peerDependencies", "pkgEntry", "externalDependencies", "options", "path", "tasks", "event", "addBuildTask", "eachEntries", "eachFormat", "eachExt", "eachEntryPoints", "fg", "eachEntry", "normalizePath", "isCSSTask", "log", "metafile", "error", "result", "outputFilePath", "eachOutput", "prettyBytes", "formats", "changeFilePath", "resolve", "execaCommand", "literal", "reason", "formatLogText", "pAll", "version", "name", "description", "readPackage", "path"]
|
|
7
|
+
}
|
package/package.json
CHANGED
|
@@ -1,36 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "aronrepo",
|
|
3
|
-
"license": "MIT",
|
|
4
|
-
"description": "Aron's monorepo ecosystem, integrated with first-class packages and conventional workflows 📦",
|
|
5
|
-
"author": {
|
|
6
|
-
"name": "Aron",
|
|
7
|
-
"email": "aron@master.co",
|
|
8
|
-
"url": "http://aron.tw"
|
|
9
|
-
},
|
|
10
|
-
"homepage": "https://aron.tw",
|
|
11
|
-
"bugs": {
|
|
12
|
-
"url": "https://github.com/1aron/repo/issues"
|
|
13
|
-
},
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "https://github.com/1aron/repo.git",
|
|
17
|
-
"directory": "packages/repo"
|
|
18
|
-
},
|
|
19
|
-
"peerDependencies": {
|
|
20
|
-
"@swc/core": "*",
|
|
21
|
-
"@swc/jest": "*",
|
|
22
|
-
"@types/jest": "*",
|
|
23
|
-
"@types/node": "*",
|
|
24
|
-
"esbuild": "*",
|
|
25
|
-
"jest": "*",
|
|
26
|
-
"turbo": "*",
|
|
27
|
-
"typescript": "*"
|
|
28
|
-
},
|
|
29
|
-
"dependencies": {
|
|
30
|
-
"eslint-config-aron": "*",
|
|
31
|
-
"commitlint-config-aron": "*",
|
|
32
|
-
"conventional-changelog-aron": "*",
|
|
33
|
-
"semantic-release-config-aron": "*"
|
|
34
|
-
},
|
|
35
|
-
"version": "1.0.0-beta.9"
|
|
36
|
-
}
|
|
1
|
+
{"name":"aronrepo","license":"MIT","scripts":{"build":"esbuild src/bin/index.ts --bundle --outfile=dist/bin/index --format=cjs --minify --sourcemap --platform=node --external:esbuild --external:@master/literal --external:@techor/log --external:commitlint-config-aron --external:conventional-changelog-aron --external:eslint-config-aron --external:fs-extra --external:semantic-release-config-aron --external:commander --external:fast-glob","dev":"conc 'npm:build -- --watch'","type-check":"tsc --noEmit","test":"jest","lint":"eslint src"},"description":"A monorepo ecosystem integrating first-class packages and build systems 📦","author":{"name":"Aron","email":"aron@master.co","url":"http://aron.tw"},"homepage":"https://aron.tw","bugs":{"url":"https://github.com/1aron/aronrepo/issues"},"repository":{"type":"git","url":"https://github.com/1aron/aronrepo.git","directory":"packages/aronrepo"},"bin":{"aron":"./dist/bin/index"},"files":["dist"],"peerDependencies":{"@types/node":"","esbuild":"","turbo":"","typescript":""},"dependencies":{"@techor/log":"","commitlint-config-aron":"^1.0.0","conventional-changelog-aron":"^1.0.0","eslint-config-aron":"^1.0.0","aron-jest":"^1.0.0","semantic-release-config-aron":"^1.0.0","@master/literal":"^1.0.11","commander":"^9.4.1","execa":"^6.1.0","fast-glob":"^3.2.12","fs-extra":"^10.1.0","normalize-path":"^3.0.0","p-all":"^4.0.0","pretty-bytes":"^6.0.0"},"devDependencies":{"dedent":"^0.7.0","pkg-types":"^1.0.1"},"version":"1.0.0"}
|