@bemedev/dev-utils 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +83 -12
- package/lib/_virtual/_rolldown/runtime.cjs +1 -2
- package/lib/build-tests/addTarball.cjs +8 -3
- package/lib/build-tests/addTarball.cjs.map +1 -1
- package/lib/build-tests/addTarball.d.ts +7 -1
- package/lib/build-tests/addTarball.js +8 -3
- package/lib/build-tests/addTarball.js.map +1 -1
- package/lib/build-tests/buildPackageJson.cjs +9 -4
- package/lib/build-tests/buildPackageJson.cjs.map +1 -1
- package/lib/build-tests/buildPackageJson.d.ts +14 -2
- package/lib/build-tests/buildPackageJson.js +9 -4
- package/lib/build-tests/buildPackageJson.js.map +1 -1
- package/lib/build-tests/cleanup.cjs +5 -3
- package/lib/build-tests/cleanup.cjs.map +1 -1
- package/lib/build-tests/cleanup.d.ts +4 -1
- package/lib/build-tests/cleanup.js +5 -3
- package/lib/build-tests/cleanup.js.map +1 -1
- package/lib/build-tests/cli/cli.cjs +6 -4
- package/lib/build-tests/cli/cli.cjs.map +1 -1
- package/lib/build-tests/cli/cli.d.ts +3 -0
- package/lib/build-tests/cli/cli.js +6 -4
- package/lib/build-tests/cli/cli.js.map +1 -1
- package/lib/build-tests/cli/index.cjs +1 -2
- package/lib/build-tests/cli/index.cjs.map +1 -1
- package/lib/build-tests/cli/index.js +1 -2
- package/lib/build-tests/cli/post.cjs +5 -3
- package/lib/build-tests/cli/post.cjs.map +1 -1
- package/lib/build-tests/cli/post.d.ts +4 -1
- package/lib/build-tests/cli/post.js +5 -3
- package/lib/build-tests/cli/post.js.map +1 -1
- package/lib/build-tests/cli/pre.cjs +5 -3
- package/lib/build-tests/cli/pre.cjs.map +1 -1
- package/lib/build-tests/cli/pre.d.ts +4 -1
- package/lib/build-tests/cli/pre.js +5 -3
- package/lib/build-tests/cli/pre.js.map +1 -1
- package/lib/build-tests/cli/test.cjs +4 -2
- package/lib/build-tests/cli/test.cjs.map +1 -1
- package/lib/build-tests/cli/test.d.ts +3 -0
- package/lib/build-tests/cli/test.js +4 -2
- package/lib/build-tests/cli/test.js.map +1 -1
- package/lib/build-tests/constants.cjs +1 -2
- package/lib/build-tests/constants.js +1 -2
- package/lib/build-tests/getRelativePath.cjs +1 -2
- package/lib/build-tests/getRelativePath.d.ts +1 -1
- package/lib/build-tests/getRelativePath.js +1 -2
- package/lib/build-tests/getTypescriptOutdir.cjs +1 -2
- package/lib/build-tests/getTypescriptOutdir.d.ts +1 -1
- package/lib/build-tests/getTypescriptOutdir.js +1 -2
- package/lib/build-tests/import.cjs +1 -2
- package/lib/build-tests/import.js +1 -2
- package/lib/build-tests/imports/create.cjs +1 -2
- package/lib/build-tests/imports/create.js +1 -2
- package/lib/build-tests/imports/helper.cjs +1 -2
- package/lib/build-tests/imports/helper.js +1 -2
- package/lib/build-tests/imports/index.js +1 -2
- package/lib/build-tests/index.cjs +1 -1
- package/lib/build-tests/index.js +1 -1
- package/lib/build-tests/pack.cjs +2 -3
- package/lib/build-tests/pack.d.ts +1 -1
- package/lib/build-tests/pack.js +2 -3
- package/lib/pack/config.cjs +103 -0
- package/lib/pack/config.cjs.map +1 -0
- package/lib/pack/config.d.ts +21 -0
- package/lib/pack/config.js +102 -0
- package/lib/pack/config.js.map +1 -0
- package/lib/pack/constants.cjs +45 -0
- package/lib/pack/constants.cjs.map +1 -0
- package/lib/pack/constants.d.ts +23 -0
- package/lib/pack/constants.js +40 -0
- package/lib/pack/constants.js.map +1 -0
- package/lib/pack/index.cjs +17 -0
- package/lib/pack/index.d.ts +6 -0
- package/lib/pack/index.js +6 -0
- package/lib/pack/input.cjs +19 -0
- package/lib/pack/input.cjs.map +1 -0
- package/lib/pack/input.d.ts +10 -0
- package/lib/pack/input.js +18 -0
- package/lib/pack/input.js.map +1 -0
- package/lib/pack/output.cjs +26 -0
- package/lib/pack/output.cjs.map +1 -0
- package/lib/pack/output.d.ts +13 -0
- package/lib/pack/output.js +25 -0
- package/lib/pack/output.js.map +1 -0
- package/lib/pack/plugins/circulars.cjs +39 -0
- package/lib/pack/plugins/circulars.cjs.map +1 -0
- package/lib/pack/plugins/circulars.d.ts +18 -0
- package/lib/pack/plugins/circulars.js +38 -0
- package/lib/pack/plugins/circulars.js.map +1 -0
- package/lib/pack/plugins/index.cjs +22 -0
- package/lib/pack/plugins/index.cjs.map +1 -0
- package/lib/pack/plugins/index.d.ts +25 -0
- package/lib/pack/plugins/index.js +21 -0
- package/lib/pack/plugins/index.js.map +1 -0
- package/lib/pack/project.cjs +32 -0
- package/lib/pack/project.cjs.map +1 -0
- package/lib/pack/project.d.ts +9 -0
- package/lib/pack/project.js +31 -0
- package/lib/pack/project.js.map +1 -0
- package/lib/pack/types.d.ts +46 -0
- package/lib/plugins/hmr.cjs +3 -4
- package/lib/plugins/hmr.cjs.map +1 -1
- package/lib/plugins/hmr.d.ts +1 -1
- package/lib/plugins/hmr.js +2 -3
- package/lib/plugins/suppressWarnings.cjs +1 -2
- package/lib/plugins/suppressWarnings.js +1 -2
- package/lib/rolldown-config/config.cjs +3 -4
- package/lib/rolldown-config/config.cjs.map +1 -1
- package/lib/rolldown-config/config.js +3 -4
- package/lib/rolldown-config/config.js.map +1 -1
- package/lib/rolldown-config/constants.cjs +1 -2
- package/lib/rolldown-config/constants.js +1 -2
- package/lib/rolldown-config/helpers.cjs +1 -2
- package/lib/rolldown-config/helpers.js +1 -2
- package/lib/rolldown-config/index.cjs +1 -1
- package/lib/rolldown-config/index.js +1 -1
- package/lib/rolldown-config/input.cjs +1 -2
- package/lib/rolldown-config/input.js +1 -2
- package/lib/rolldown-config/output.cjs +1 -2
- package/lib/rolldown-config/output.js +1 -2
- package/lib/rolldown-config/plugins/circulars.cjs +1 -2
- package/lib/rolldown-config/plugins/circulars.js +1 -2
- package/lib/rolldown-config/plugins/clean.cjs +2 -3
- package/lib/rolldown-config/plugins/clean.js +2 -3
- package/lib/rolldown-config/plugins/externals.cjs +1 -2
- package/lib/rolldown-config/plugins/externals.js +1 -2
- package/lib/rolldown-config/plugins/index.cjs +1 -2
- package/lib/rolldown-config/plugins/index.js +1 -2
- package/lib/rolldown-config/plugins/typescript.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.config.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.config.js +1 -2
- package/lib/rolldown-config/plugins/typescript.fast.cjs +1 -2
- package/lib/rolldown-config/plugins/typescript.fast.js +1 -2
- package/lib/rolldown-config/plugins/typescript.js +1 -2
- package/lib/utils/array.cjs +1 -2
- package/lib/utils/array.js +1 -2
- package/lib/utils/bemedev/globals/types.d.ts +1 -0
- package/lib/utils/bemedev/globals/utils/_unknown.cjs +1 -2
- package/lib/utils/bemedev/globals/utils/_unknown.js +1 -2
- package/lib/utils/bemedev/globals/utils/expandFn.cjs +1 -2
- package/lib/utils/bemedev/globals/utils/expandFn.js +1 -2
- package/lib/utils/clamp.cjs +1 -2
- package/lib/utils/clamp.js +1 -2
- package/lib/utils/identity.cjs +1 -2
- package/lib/utils/identity.js +1 -2
- package/lib/utils/index.cjs +1 -1
- package/lib/utils/index.d.ts +1 -1
- package/lib/utils/index.js +1 -1
- package/lib/utils/sleep.cjs +1 -2
- package/lib/utils/sleep.js +1 -2
- package/lib/utils/types.d.ts +1 -1
- package/lib/vitest-exclude/constants.cjs +1 -2
- package/lib/vitest-exclude/constants.js +1 -2
- package/lib/vitest-exclude/index.js +1 -2
- package/lib/vitest-exclude/vitest.cjs +2 -3
- package/lib/vitest-exclude/vitest.js +2 -3
- package/lib/vitest-exclude/vitest.utils.cjs +1 -2
- package/lib/vitest-exclude/vitest.utils.js +1 -2
- package/lib/vitest-extended/acceptation.cjs +1 -2
- package/lib/vitest-extended/acceptation.js +1 -2
- package/lib/vitest-extended/createTests.cjs +2 -3
- package/lib/vitest-extended/createTests.js +2 -3
- package/lib/vitest-extended/done.cjs +1 -2
- package/lib/vitest-extended/done.js +1 -2
- package/lib/vitest-extended/each/error.cjs +2 -3
- package/lib/vitest-extended/each/error.js +2 -3
- package/lib/vitest-extended/each/pass.cjs +2 -3
- package/lib/vitest-extended/each/pass.js +2 -3
- package/lib/vitest-extended/fakeWaiter.cjs +1 -2
- package/lib/vitest-extended/fakeWaiter.js +1 -2
- package/lib/vitest-extended/fixtures/coverage.cjs +1 -2
- package/lib/vitest-extended/fixtures/coverage.js +1 -2
- package/lib/vitest-extended/fixtures/partialCall.cjs +1 -2
- package/lib/vitest-extended/fixtures/partialCall.js +1 -2
- package/lib/vitest-extended/fixtures/toUpper.cjs +1 -2
- package/lib/vitest-extended/fixtures/toUpper.js +1 -2
- package/lib/vitest-extended/fixtures/vitest.cjs +1 -2
- package/lib/vitest-extended/fixtures/vitest.js +1 -2
- package/lib/vitest-extended/fixtures/zod.cjs +1 -2
- package/lib/vitest-extended/fixtures/zod.js +1 -2
- package/lib/vitest-extended/identity.cjs +1 -2
- package/lib/vitest-extended/identity.js +1 -2
- package/lib/vitest-extended/index.cjs +2 -2
- package/lib/vitest-extended/index.js +2 -2
- package/lib/vitest-extended/isDefined.cjs +1 -2
- package/lib/vitest-extended/isDefined.js +1 -2
- package/lib/vitest-extended/isFunction.cjs +1 -2
- package/lib/vitest-extended/isFunction.js +1 -2
- package/lib/vitest-extended/project.cjs +9 -7
- package/lib/vitest-extended/project.cjs.map +1 -1
- package/lib/vitest-extended/project.d.ts +2 -2
- package/lib/vitest-extended/project.js +10 -8
- package/lib/vitest-extended/project.js.map +1 -1
- package/lib/vitest-extended/toArray.cjs +1 -2
- package/lib/vitest-extended/toArray.js +1 -2
- package/lib/vitest-extended/toStringFlat.cjs +1 -2
- package/lib/vitest-extended/toStringFlat.js +1 -2
- package/package.json +68 -59
package/README.md
CHANGED
|
@@ -9,14 +9,15 @@ utilities, and configuration management.
|
|
|
9
9
|
|
|
10
10
|
## Modules
|
|
11
11
|
|
|
12
|
-
| Module | Description
|
|
13
|
-
| ----------------------------------- |
|
|
14
|
-
| [`vitestExclude`](#vitestexclude) | Vitest plugin for glob-based include/exclude
|
|
15
|
-
| [`vitestExtended`](#vitestextended) | Extended test helpers for Vitest
|
|
16
|
-
| [`rolldownConfig`](#rolldownconfig) | Rolldown bundler configuration factory
|
|
17
|
-
| [`
|
|
18
|
-
| [`
|
|
19
|
-
| [`
|
|
12
|
+
| Module | Description |
|
|
13
|
+
| ----------------------------------- | ----------------------------------------------- |
|
|
14
|
+
| [`vitestExclude`](#vitestexclude) | Vitest plugin for glob-based include/exclude |
|
|
15
|
+
| [`vitestExtended`](#vitestextended) | Extended test helpers for Vitest |
|
|
16
|
+
| [`rolldownConfig`](#rolldownconfig) | Rolldown bundler configuration factory (legacy) |
|
|
17
|
+
| [`pack`](#pack) | Vite+ Pack configuration factory |
|
|
18
|
+
| [`buildTests`](#buildtests) | CLI tooling to build and test packages |
|
|
19
|
+
| [`plugins`](#plugins) | Vite development helper plugins |
|
|
20
|
+
| [`utils`](#utils) | Utility functions and helpers |
|
|
20
21
|
|
|
21
22
|
> **Note (v0.8.1):** The `./vitest-alias` export has been removed. Path alias
|
|
22
23
|
> resolution is now handled natively by Vite via `resolve.alias` with
|
|
@@ -24,6 +25,10 @@ utilities, and configuration management.
|
|
|
24
25
|
> `aliasTs()` / `createAlias()` usage and configure aliases directly in your `vite` /
|
|
25
26
|
> `vitest` config.
|
|
26
27
|
|
|
28
|
+
> **NB (next version):** The next version will use **Vite+ only**. The standalone
|
|
29
|
+
> `./rolldown` export (`@bemedev/dev-utils/rolldown`) will be dropped; migrate to the
|
|
30
|
+
> [`pack`](#pack) export before upgrading.
|
|
31
|
+
|
|
27
32
|
<br/>
|
|
28
33
|
|
|
29
34
|
## Installation
|
|
@@ -36,7 +41,9 @@ npm install @bemedev/dev-utils
|
|
|
36
41
|
yarn add @bemedev/dev-utils
|
|
37
42
|
```
|
|
38
43
|
|
|
39
|
-
**Peer dependencies:** `typescript ^5 || ^6`
|
|
44
|
+
**Peer dependencies:** `typescript ^5 || ^6`, `rolldown ^1.3.0`, `vitest 5.1.0`.
|
|
45
|
+
`vite-plus ^1.5.0` is an optional peer dependency, only required for the `pack`
|
|
46
|
+
export.
|
|
40
47
|
|
|
41
48
|
<br/>
|
|
42
49
|
|
|
@@ -46,12 +53,13 @@ Each module is available as a dedicated sub-path export — there is no root bar
|
|
|
46
53
|
export:
|
|
47
54
|
|
|
48
55
|
```typescript
|
|
49
|
-
import { exclude } from '@bemedev/dev-utils/vitest-exclude';
|
|
50
|
-
import { createTests, createFakeWaiter } from '@bemedev/dev-utils/vitest-extended';
|
|
51
|
-
import { defineConfig } from '@bemedev/dev-utils/rolldown';
|
|
52
56
|
import { addTarball, cleanup } from '@bemedev/dev-utils/build-tests';
|
|
57
|
+
import { defineConfig as definePackConfig } from '@bemedev/dev-utils/pack';
|
|
53
58
|
import { suppressWarnings, hmr } from '@bemedev/dev-utils/plugins';
|
|
59
|
+
import { defineConfig } from '@bemedev/dev-utils/rolldown';
|
|
54
60
|
import { clamp, toArray, identity, sleep } from '@bemedev/dev-utils/utils';
|
|
61
|
+
import { exclude } from '@bemedev/dev-utils/vitest-exclude';
|
|
62
|
+
import { createTests, createFakeWaiter } from '@bemedev/dev-utils/vitest-extended';
|
|
55
63
|
```
|
|
56
64
|
|
|
57
65
|
---
|
|
@@ -403,6 +411,9 @@ export default defineProject({
|
|
|
403
411
|
Rolldown bundler configuration factory with built-in plugins for TypeScript
|
|
404
412
|
declarations, circular dependency detection, and tree-shaking externals.
|
|
405
413
|
|
|
414
|
+
> **Deprecated:** This export will be dropped in the next version, which uses Vite+
|
|
415
|
+
> only. Migrate to the [`pack`](#pack) export.
|
|
416
|
+
|
|
406
417
|
### `defineConfig(additionals?)`
|
|
407
418
|
|
|
408
419
|
Shorthand for `defineConfig.default`.
|
|
@@ -514,6 +525,66 @@ defineConfig.default({ plugins: ['externals', 'typescript'] });
|
|
|
514
525
|
|
|
515
526
|
---
|
|
516
527
|
|
|
528
|
+
## `pack`
|
|
529
|
+
|
|
530
|
+
Vite+ Pack configuration factory that generates unbundled ESM distributions with
|
|
531
|
+
declaration files, circular dependency suppression and automatic cleanup.
|
|
532
|
+
|
|
533
|
+
> **Note:** this export requires the optional `vite-plus` peer dependency (`^1.5.0`).
|
|
534
|
+
|
|
535
|
+
### `defineConfig(additionals?)`
|
|
536
|
+
|
|
537
|
+
Shorthand for `defineConfig.default`.
|
|
538
|
+
|
|
539
|
+
### `defineConfig.default(params?)`
|
|
540
|
+
|
|
541
|
+
Produces a Vite+ Pack configuration with the default plugin pipeline:
|
|
542
|
+
|
|
543
|
+
1. **circulars** — suppresses warnings for known circular type files
|
|
544
|
+
2. **clean** — removes stale JS outputs for type-only entries
|
|
545
|
+
|
|
546
|
+
```typescript
|
|
547
|
+
import { defineConfig } from '@bemedev/dev-utils/pack';
|
|
548
|
+
// vite.config.ts
|
|
549
|
+
import { defineConfig as defineViteConfig } from 'vite-plus';
|
|
550
|
+
|
|
551
|
+
export default defineViteConfig({
|
|
552
|
+
pack: defineConfig.default({ dir: 'lib', sourcemap: true }),
|
|
553
|
+
});
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
`params` accepts `dir`, `sourcemap`, `declarationMap`, `excludesTS`, `circularDeps`,
|
|
557
|
+
`ignoresJS`, `externals`, `dts` and `plugins`, plus any remaining `PackUserConfig`
|
|
558
|
+
fields. Outputs are unbundled, with fixed extensions disabled and ESM as the target
|
|
559
|
+
format.
|
|
560
|
+
|
|
561
|
+
### `defineConfig.bemedev(params?)`
|
|
562
|
+
|
|
563
|
+
Opinionated preset that enables sourcemaps by default and merges `DEFAULT_EXCLUDE`
|
|
564
|
+
into `excludesTS` and `DEFAULT_CIRCULAR_DEPS` into `circularDeps`.
|
|
565
|
+
|
|
566
|
+
### `defineConfig.fast(params?)`
|
|
567
|
+
|
|
568
|
+
Preset that eagerly generates declarations with the `oxc` generator for faster
|
|
569
|
+
builds.
|
|
570
|
+
|
|
571
|
+
### `defineProject(config)`
|
|
572
|
+
|
|
573
|
+
Wrapper around Vite+'s `defineProject` that enables `tsconfigPaths`, `globals` and
|
|
574
|
+
sets `NODE_ENV` to `'test'` by default.
|
|
575
|
+
|
|
576
|
+
```typescript
|
|
577
|
+
import { defineProject } from '@bemedev/dev-utils/pack';
|
|
578
|
+
|
|
579
|
+
export default defineProject({
|
|
580
|
+
test: {
|
|
581
|
+
// your config here
|
|
582
|
+
},
|
|
583
|
+
});
|
|
584
|
+
```
|
|
585
|
+
|
|
586
|
+
---
|
|
587
|
+
|
|
517
588
|
## `buildTests`
|
|
518
589
|
|
|
519
590
|
CLI tooling that packs your built library as a local tarball, installs it under the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -19,5 +19,4 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
19
19
|
value: mod,
|
|
20
20
|
enumerable: true
|
|
21
21
|
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
22
|
exports.__toESM = __toESM;
|
|
@@ -8,9 +8,15 @@ let edit_json_file = require("edit-json-file");
|
|
|
8
8
|
edit_json_file = require_runtime.__toESM(edit_json_file, 1);
|
|
9
9
|
let sort_keys = require("sort-keys");
|
|
10
10
|
sort_keys = require_runtime.__toESM(sort_keys, 1);
|
|
11
|
-
|
|
11
|
+
// src/build-tests/addTarball.ts
|
|
12
12
|
/**
|
|
13
|
-
* Builds and installs a local tarball package as a temporary dev dependency
|
|
13
|
+
* Builds and installs a local tarball package as a temporary dev dependency
|
|
14
|
+
* for testing.
|
|
15
|
+
*
|
|
16
|
+
* Packs the current package through {@linkcode pack}, registers the resulting
|
|
17
|
+
* tarball in `devDependencies` and re-sorts the dependency keys.
|
|
18
|
+
*
|
|
19
|
+
* @returns Promise resolving once the temporary dependency is installed.
|
|
14
20
|
*/
|
|
15
21
|
const addTarball = async () => {
|
|
16
22
|
const _packed = await require_build_tests_pack.pack();
|
|
@@ -21,7 +27,6 @@ const addTarball = async () => {
|
|
|
21
27
|
file.set(require_build_tests_constants.devKey, devDeps);
|
|
22
28
|
file.save();
|
|
23
29
|
};
|
|
24
|
-
//#endregion
|
|
25
30
|
exports.addTarball = addTarball;
|
|
26
31
|
|
|
27
32
|
//# sourceMappingURL=addTarball.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTarball.cjs","names":["pack","FILE_ORIGIN","THIS1","editJsonFile","PACKAGE_PATH","sortKeys","devKey"],"sources":["../../src/build-tests/addTarball.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sh from 'shelljs';\nimport sortKeys from 'sort-keys';\n\nimport { devKey, FILE_ORIGIN, PACKAGE_PATH, THIS1 } from './constants';\nimport { pack } from './pack';\n\n/**\n * Builds and installs a local tarball package as a temporary dev dependency for testing.\n */\nexport const addTarball = async () => {\n // #region Install the tarball\n const _packed = await pack();\n const packed = `${FILE_ORIGIN}:${_packed}`;\n sh.exec(`pnpm add -D ${THIS1}@${packed}`);\n // #endregion\n\n const file = editJsonFile(PACKAGE_PATH);\n const devDeps = sortKeys(file.get(devKey));\n file.set(devKey, devDeps);\n file.save();\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"addTarball.cjs","names":["pack","FILE_ORIGIN","THIS1","editJsonFile","PACKAGE_PATH","sortKeys","devKey"],"sources":["../../src/build-tests/addTarball.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sh from 'shelljs';\nimport sortKeys from 'sort-keys';\n\nimport { devKey, FILE_ORIGIN, PACKAGE_PATH, THIS1 } from './constants';\nimport { pack } from './pack';\n\n/**\n * Builds and installs a local tarball package as a temporary dev dependency\n * for testing.\n *\n * Packs the current package through {@linkcode pack}, registers the resulting\n * tarball in `devDependencies` and re-sorts the dependency keys.\n *\n * @returns Promise resolving once the temporary dependency is installed.\n */\nexport const addTarball = async () => {\n // #region Install the tarball\n const _packed = await pack();\n const packed = `${FILE_ORIGIN}:${_packed}`;\n sh.exec(`pnpm add -D ${THIS1}@${packed}`);\n // #endregion\n\n const file = editJsonFile(PACKAGE_PATH);\n const devDeps = sortKeys(file.get(devKey));\n file.set(devKey, devDeps);\n file.save();\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,aAAa,YAAY;CAEpC,MAAM,UAAU,MAAMA,yBAAAA,KAAK;CAC3B,MAAM,SAAS,GAAGC,8BAAAA,YAAY,GAAG;CACjC,QAAA,QAAG,KAAK,eAAeC,8BAAAA,MAAM,GAAG,QAAQ;CAGxC,MAAM,QAAA,GAAOC,eAAAA,QAAAA,CAAaC,8BAAAA,YAAY;CACtC,MAAM,WAAA,GAAUC,UAAAA,QAAAA,CAAS,KAAK,IAAIC,8BAAAA,MAAM,CAAC;CACzC,KAAK,IAAIA,8BAAAA,QAAQ,OAAO;CACxB,KAAK,KAAK;AACZ"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Builds and installs a local tarball package as a temporary dev dependency
|
|
2
|
+
* Builds and installs a local tarball package as a temporary dev dependency
|
|
3
|
+
* for testing.
|
|
4
|
+
*
|
|
5
|
+
* Packs the current package through {@linkcode pack}, registers the resulting
|
|
6
|
+
* tarball in `devDependencies` and re-sorts the dependency keys.
|
|
7
|
+
*
|
|
8
|
+
* @returns Promise resolving once the temporary dependency is installed.
|
|
3
9
|
*/
|
|
4
10
|
export declare const addTarball: () => Promise<void>;
|
|
@@ -3,9 +3,15 @@ import { pack } from "./pack.js";
|
|
|
3
3
|
import sh from "shelljs";
|
|
4
4
|
import editJsonFile from "edit-json-file";
|
|
5
5
|
import sortKeys from "sort-keys";
|
|
6
|
-
|
|
6
|
+
// src/build-tests/addTarball.ts
|
|
7
7
|
/**
|
|
8
|
-
* Builds and installs a local tarball package as a temporary dev dependency
|
|
8
|
+
* Builds and installs a local tarball package as a temporary dev dependency
|
|
9
|
+
* for testing.
|
|
10
|
+
*
|
|
11
|
+
* Packs the current package through {@linkcode pack}, registers the resulting
|
|
12
|
+
* tarball in `devDependencies` and re-sorts the dependency keys.
|
|
13
|
+
*
|
|
14
|
+
* @returns Promise resolving once the temporary dependency is installed.
|
|
9
15
|
*/
|
|
10
16
|
const addTarball = async () => {
|
|
11
17
|
const _packed = await pack();
|
|
@@ -16,7 +22,6 @@ const addTarball = async () => {
|
|
|
16
22
|
file.set(devKey, devDeps);
|
|
17
23
|
file.save();
|
|
18
24
|
};
|
|
19
|
-
//#endregion
|
|
20
25
|
export { addTarball };
|
|
21
26
|
|
|
22
27
|
//# sourceMappingURL=addTarball.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"addTarball.js","names":[],"sources":["../../src/build-tests/addTarball.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sh from 'shelljs';\nimport sortKeys from 'sort-keys';\n\nimport { devKey, FILE_ORIGIN, PACKAGE_PATH, THIS1 } from './constants';\nimport { pack } from './pack';\n\n/**\n * Builds and installs a local tarball package as a temporary dev dependency for testing.\n */\nexport const addTarball = async () => {\n // #region Install the tarball\n const _packed = await pack();\n const packed = `${FILE_ORIGIN}:${_packed}`;\n sh.exec(`pnpm add -D ${THIS1}@${packed}`);\n // #endregion\n\n const file = editJsonFile(PACKAGE_PATH);\n const devDeps = sortKeys(file.get(devKey));\n file.set(devKey, devDeps);\n file.save();\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"addTarball.js","names":[],"sources":["../../src/build-tests/addTarball.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sh from 'shelljs';\nimport sortKeys from 'sort-keys';\n\nimport { devKey, FILE_ORIGIN, PACKAGE_PATH, THIS1 } from './constants';\nimport { pack } from './pack';\n\n/**\n * Builds and installs a local tarball package as a temporary dev dependency\n * for testing.\n *\n * Packs the current package through {@linkcode pack}, registers the resulting\n * tarball in `devDependencies` and re-sorts the dependency keys.\n *\n * @returns Promise resolving once the temporary dependency is installed.\n */\nexport const addTarball = async () => {\n // #region Install the tarball\n const _packed = await pack();\n const packed = `${FILE_ORIGIN}:${_packed}`;\n sh.exec(`pnpm add -D ${THIS1}@${packed}`);\n // #endregion\n\n const file = editJsonFile(PACKAGE_PATH);\n const devDeps = sortKeys(file.get(devKey));\n file.set(devKey, devDeps);\n file.save();\n};\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAa,aAAa,YAAY;CAEpC,MAAM,UAAU,MAAM,KAAK;CAC3B,MAAM,SAAS,GAAG,YAAY,GAAG;CACjC,GAAG,KAAK,eAAe,MAAM,GAAG,QAAQ;CAGxC,MAAM,OAAO,aAAa,YAAY;CACtC,MAAM,UAAU,SAAS,KAAK,IAAI,MAAM,CAAC;CACzC,KAAK,IAAI,QAAQ,OAAO;CACxB,KAAK,KAAK;AACZ"}
|
|
@@ -6,11 +6,17 @@ let edit_json_file = require("edit-json-file");
|
|
|
6
6
|
edit_json_file = require_runtime.__toESM(edit_json_file, 1);
|
|
7
7
|
let sort_keys = require("sort-keys");
|
|
8
8
|
sort_keys = require_runtime.__toESM(sort_keys, 1);
|
|
9
|
-
|
|
9
|
+
// src/build-tests/buildPackageJson.ts
|
|
10
10
|
/**
|
|
11
|
-
* Transforms `package.json` for packed distribution by adjusting paths and
|
|
11
|
+
* Transforms `package.json` for packed distribution by adjusting paths and
|
|
12
|
+
* removing internal fields.
|
|
12
13
|
*
|
|
13
|
-
* @
|
|
14
|
+
* Rewrites the {@linkcode EXPORT_KEYS} entries, the `exports` map and the
|
|
15
|
+
* `bin` field so that they point to the packed output, then removes
|
|
16
|
+
* `files`, `scripts` and `devDependencies`.
|
|
17
|
+
*
|
|
18
|
+
* @returns Object containing the modified `packageJson` and the `outDir`
|
|
19
|
+
* resolved by {@linkcode getTypescriptOutdir}.
|
|
14
20
|
*/
|
|
15
21
|
const buildPackageJson = () => {
|
|
16
22
|
const file = (0, edit_json_file.default)("./package.json");
|
|
@@ -58,7 +64,6 @@ const buildPackageJson = () => {
|
|
|
58
64
|
outDir
|
|
59
65
|
};
|
|
60
66
|
};
|
|
61
|
-
//#endregion
|
|
62
67
|
exports.buildPackageJson = buildPackageJson;
|
|
63
68
|
|
|
64
69
|
//# sourceMappingURL=buildPackageJson.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPackageJson.cjs","names":["editJsonFile","getTypescriptOutdir","EXPORT_KEY","sortKeys"],"sources":["../../src/build-tests/buildPackageJson.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sortKeys from 'sort-keys';\n\nimport type { Fn } from '#utils';\n\nimport { BIN_KEY, EXPORT_KEY, EXPORT_KEYS } from './constants';\nimport { getTypescriptOutdir } from './getTypescriptOutdir';\n\ntype BuldPackageJson_F = Fn<[], { packageJson: object; outDir: string }>;\n\n/**\n * Transforms `package.json` for packed distribution by adjusting paths and removing internal fields.\n *\n * @returns Object containing the modified `packageJson` and
|
|
1
|
+
{"version":3,"file":"buildPackageJson.cjs","names":["editJsonFile","getTypescriptOutdir","EXPORT_KEY","sortKeys"],"sources":["../../src/build-tests/buildPackageJson.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sortKeys from 'sort-keys';\n\nimport type { Fn } from '#utils';\n\nimport { BIN_KEY, EXPORT_KEY, EXPORT_KEYS } from './constants';\nimport { getTypescriptOutdir } from './getTypescriptOutdir';\n\n/**\n * Function type building the distribution `package.json` and resolving the\n * TypeScript output directory.\n *\n * @see -- type {@linkcode Fn}\n */\ntype BuldPackageJson_F = Fn<[], { packageJson: object; outDir: string }>;\n\n/**\n * Transforms `package.json` for packed distribution by adjusting paths and\n * removing internal fields.\n *\n * Rewrites the {@linkcode EXPORT_KEYS} entries, the `exports` map and the\n * `bin` field so that they point to the packed output, then removes\n * `files`, `scripts` and `devDependencies`.\n *\n * @returns Object containing the modified `packageJson` and the `outDir`\n * resolved by {@linkcode getTypescriptOutdir}.\n */\nexport const buildPackageJson: BuldPackageJson_F = () => {\n const file = editJsonFile('./package.json');\n const outDir = getTypescriptOutdir();\n const lib = `${outDir}/`;\n const replaceLib = (str: string) => str.replace(lib, '');\n\n // #region Set export values\n EXPORT_KEYS.forEach(key => {\n const value = file.get(key);\n if (value) {\n const transformed = replaceLib(value);\n file.set(key, transformed);\n }\n });\n // #endregion\n\n // #region Set Export key\n const valueExports = file.get(EXPORT_KEY);\n\n if (valueExports) {\n const transformedExports = Object.entries(valueExports).reduce(\n (acc, [key, value]) => {\n const entries = Object.entries(value as any);\n const _value = entries.reduce((acc, [key, value]) => {\n acc[key] = replaceLib(value as any);\n return acc;\n }, {} as any);\n acc[key] = key.includes('package.json') ? value : _value;\n return acc;\n },\n {} as any,\n );\n\n file.set(EXPORT_KEY, transformedExports);\n }\n // #endregion\n\n // #region Set bin\n const bin1 = file.get(BIN_KEY) as Record<string, string> | undefined | string;\n\n if (bin1) {\n if (typeof bin1 === 'string') {\n const bin2 = replaceLib(bin1);\n file.set(BIN_KEY, bin2);\n } else {\n const bin2 = Object.entries(bin1).reduce((acc, [key, value]) => {\n acc[key] = replaceLib(value);\n return acc;\n }, {} as any);\n\n const bin3 = sortKeys(bin2);\n file.set(BIN_KEY, bin3);\n }\n }\n // #endregion\n\n // #region Unset some props\n file.unset('files');\n file.unset('scripts');\n file.unset('devDependencies');\n // #endregion\n\n const packageJson = file.get();\n return { packageJson, outDir };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,yBAA4C;CACvD,MAAM,QAAA,GAAOA,eAAAA,QAAAA,CAAa,gBAAgB;CAC1C,MAAM,SAASC,wCAAAA,oBAAoB;CACnC,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,cAAc,QAAgB,IAAI,QAAQ,KAAK,EAAE;CAGvD,8BAAA,YAAY,SAAQ,QAAO;EACzB,MAAM,QAAQ,KAAK,IAAI,GAAG;EAC1B,IAAI,OAAO;GACT,MAAM,cAAc,WAAW,KAAK;GACpC,KAAK,IAAI,KAAK,WAAW;EAC3B;CACF,CAAC;CAID,MAAM,eAAe,KAAK,IAAIC,8BAAAA,UAAU;CAExC,IAAI,cAAc;EAChB,MAAM,qBAAqB,OAAO,QAAQ,YAAY,CAAC,CAAC,QACrD,KAAK,CAAC,KAAK,WAAW;GAErB,MAAM,SADU,OAAO,QAAQ,KACV,CAAC,CAAC,QAAQ,KAAK,CAAC,KAAK,WAAW;IACnD,IAAI,OAAO,WAAW,KAAY;IAClC,OAAO;GACT,GAAG,CAAC,CAAQ;GACZ,IAAI,OAAO,IAAI,SAAS,cAAc,IAAI,QAAQ;GAClD,OAAO;EACT,GACA,CAAC,CACH;EAEA,KAAK,IAAIA,8BAAAA,YAAY,kBAAkB;CACzC;CAIA,MAAM,OAAO,KAAK,IAAA,KAAW;CAE7B,IAAI,MAAM;EACR,IAAI,OAAO,SAAS,UAAU;GAC5B,MAAM,OAAO,WAAW,IAAI;GAC5B,KAAK,IAAA,OAAa,IAAI;EACxB,OAAO;GACL,MAAM,OAAO,OAAO,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,KAAK,WAAW;IAC9D,IAAI,OAAO,WAAW,KAAK;IAC3B,OAAO;GACT,GAAG,CAAC,CAAQ;GAEZ,MAAM,QAAA,GAAOC,UAAAA,QAAAA,CAAS,IAAI;GAC1B,KAAK,IAAA,OAAa,IAAI;EACxB;CACF;CAIA,KAAK,MAAM,OAAO;CAClB,KAAK,MAAM,SAAS;CACpB,KAAK,MAAM,iBAAiB;CAI5B,OAAO;EAAE,aADW,KAAK,IACN;EAAG;CAAO;AAC/B"}
|
|
@@ -1,12 +1,24 @@
|
|
|
1
1
|
import type { Fn } from '../utils/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Function type building the distribution `package.json` and resolving the
|
|
4
|
+
* TypeScript output directory.
|
|
5
|
+
*
|
|
6
|
+
* @see -- type {@linkcode Fn}
|
|
7
|
+
*/
|
|
2
8
|
type BuldPackageJson_F = Fn<[], {
|
|
3
9
|
packageJson: object;
|
|
4
10
|
outDir: string;
|
|
5
11
|
}>;
|
|
6
12
|
/**
|
|
7
|
-
* Transforms `package.json` for packed distribution by adjusting paths and
|
|
13
|
+
* Transforms `package.json` for packed distribution by adjusting paths and
|
|
14
|
+
* removing internal fields.
|
|
15
|
+
*
|
|
16
|
+
* Rewrites the {@linkcode EXPORT_KEYS} entries, the `exports` map and the
|
|
17
|
+
* `bin` field so that they point to the packed output, then removes
|
|
18
|
+
* `files`, `scripts` and `devDependencies`.
|
|
8
19
|
*
|
|
9
|
-
* @returns Object containing the modified `packageJson` and
|
|
20
|
+
* @returns Object containing the modified `packageJson` and the `outDir`
|
|
21
|
+
* resolved by {@linkcode getTypescriptOutdir}.
|
|
10
22
|
*/
|
|
11
23
|
export declare const buildPackageJson: BuldPackageJson_F;
|
|
12
24
|
export {};
|
|
@@ -2,11 +2,17 @@ import { EXPORT_KEY, EXPORT_KEYS } from "./constants.js";
|
|
|
2
2
|
import { getTypescriptOutdir } from "./getTypescriptOutdir.js";
|
|
3
3
|
import editJsonFile from "edit-json-file";
|
|
4
4
|
import sortKeys from "sort-keys";
|
|
5
|
-
|
|
5
|
+
// src/build-tests/buildPackageJson.ts
|
|
6
6
|
/**
|
|
7
|
-
* Transforms `package.json` for packed distribution by adjusting paths and
|
|
7
|
+
* Transforms `package.json` for packed distribution by adjusting paths and
|
|
8
|
+
* removing internal fields.
|
|
8
9
|
*
|
|
9
|
-
* @
|
|
10
|
+
* Rewrites the {@linkcode EXPORT_KEYS} entries, the `exports` map and the
|
|
11
|
+
* `bin` field so that they point to the packed output, then removes
|
|
12
|
+
* `files`, `scripts` and `devDependencies`.
|
|
13
|
+
*
|
|
14
|
+
* @returns Object containing the modified `packageJson` and the `outDir`
|
|
15
|
+
* resolved by {@linkcode getTypescriptOutdir}.
|
|
10
16
|
*/
|
|
11
17
|
const buildPackageJson = () => {
|
|
12
18
|
const file = editJsonFile("./package.json");
|
|
@@ -54,7 +60,6 @@ const buildPackageJson = () => {
|
|
|
54
60
|
outDir
|
|
55
61
|
};
|
|
56
62
|
};
|
|
57
|
-
//#endregion
|
|
58
63
|
export { buildPackageJson };
|
|
59
64
|
|
|
60
65
|
//# sourceMappingURL=buildPackageJson.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildPackageJson.js","names":[],"sources":["../../src/build-tests/buildPackageJson.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sortKeys from 'sort-keys';\n\nimport type { Fn } from '#utils';\n\nimport { BIN_KEY, EXPORT_KEY, EXPORT_KEYS } from './constants';\nimport { getTypescriptOutdir } from './getTypescriptOutdir';\n\ntype BuldPackageJson_F = Fn<[], { packageJson: object; outDir: string }>;\n\n/**\n * Transforms `package.json` for packed distribution by adjusting paths and removing internal fields.\n *\n * @returns Object containing the modified `packageJson` and
|
|
1
|
+
{"version":3,"file":"buildPackageJson.js","names":[],"sources":["../../src/build-tests/buildPackageJson.ts"],"sourcesContent":["import editJsonFile from 'edit-json-file';\nimport sortKeys from 'sort-keys';\n\nimport type { Fn } from '#utils';\n\nimport { BIN_KEY, EXPORT_KEY, EXPORT_KEYS } from './constants';\nimport { getTypescriptOutdir } from './getTypescriptOutdir';\n\n/**\n * Function type building the distribution `package.json` and resolving the\n * TypeScript output directory.\n *\n * @see -- type {@linkcode Fn}\n */\ntype BuldPackageJson_F = Fn<[], { packageJson: object; outDir: string }>;\n\n/**\n * Transforms `package.json` for packed distribution by adjusting paths and\n * removing internal fields.\n *\n * Rewrites the {@linkcode EXPORT_KEYS} entries, the `exports` map and the\n * `bin` field so that they point to the packed output, then removes\n * `files`, `scripts` and `devDependencies`.\n *\n * @returns Object containing the modified `packageJson` and the `outDir`\n * resolved by {@linkcode getTypescriptOutdir}.\n */\nexport const buildPackageJson: BuldPackageJson_F = () => {\n const file = editJsonFile('./package.json');\n const outDir = getTypescriptOutdir();\n const lib = `${outDir}/`;\n const replaceLib = (str: string) => str.replace(lib, '');\n\n // #region Set export values\n EXPORT_KEYS.forEach(key => {\n const value = file.get(key);\n if (value) {\n const transformed = replaceLib(value);\n file.set(key, transformed);\n }\n });\n // #endregion\n\n // #region Set Export key\n const valueExports = file.get(EXPORT_KEY);\n\n if (valueExports) {\n const transformedExports = Object.entries(valueExports).reduce(\n (acc, [key, value]) => {\n const entries = Object.entries(value as any);\n const _value = entries.reduce((acc, [key, value]) => {\n acc[key] = replaceLib(value as any);\n return acc;\n }, {} as any);\n acc[key] = key.includes('package.json') ? value : _value;\n return acc;\n },\n {} as any,\n );\n\n file.set(EXPORT_KEY, transformedExports);\n }\n // #endregion\n\n // #region Set bin\n const bin1 = file.get(BIN_KEY) as Record<string, string> | undefined | string;\n\n if (bin1) {\n if (typeof bin1 === 'string') {\n const bin2 = replaceLib(bin1);\n file.set(BIN_KEY, bin2);\n } else {\n const bin2 = Object.entries(bin1).reduce((acc, [key, value]) => {\n acc[key] = replaceLib(value);\n return acc;\n }, {} as any);\n\n const bin3 = sortKeys(bin2);\n file.set(BIN_KEY, bin3);\n }\n }\n // #endregion\n\n // #region Unset some props\n file.unset('files');\n file.unset('scripts');\n file.unset('devDependencies');\n // #endregion\n\n const packageJson = file.get();\n return { packageJson, outDir };\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA2BA,MAAa,yBAA4C;CACvD,MAAM,OAAO,aAAa,gBAAgB;CAC1C,MAAM,SAAS,oBAAoB;CACnC,MAAM,MAAM,GAAG,OAAO;CACtB,MAAM,cAAc,QAAgB,IAAI,QAAQ,KAAK,EAAE;CAGvD,YAAY,SAAQ,QAAO;EACzB,MAAM,QAAQ,KAAK,IAAI,GAAG;EAC1B,IAAI,OAAO;GACT,MAAM,cAAc,WAAW,KAAK;GACpC,KAAK,IAAI,KAAK,WAAW;EAC3B;CACF,CAAC;CAID,MAAM,eAAe,KAAK,IAAI,UAAU;CAExC,IAAI,cAAc;EAChB,MAAM,qBAAqB,OAAO,QAAQ,YAAY,CAAC,CAAC,QACrD,KAAK,CAAC,KAAK,WAAW;GAErB,MAAM,SADU,OAAO,QAAQ,KACV,CAAC,CAAC,QAAQ,KAAK,CAAC,KAAK,WAAW;IACnD,IAAI,OAAO,WAAW,KAAY;IAClC,OAAO;GACT,GAAG,CAAC,CAAQ;GACZ,IAAI,OAAO,IAAI,SAAS,cAAc,IAAI,QAAQ;GAClD,OAAO;EACT,GACA,CAAC,CACH;EAEA,KAAK,IAAI,YAAY,kBAAkB;CACzC;CAIA,MAAM,OAAO,KAAK,IAAA,KAAW;CAE7B,IAAI,MAAM;EACR,IAAI,OAAO,SAAS,UAAU;GAC5B,MAAM,OAAO,WAAW,IAAI;GAC5B,KAAK,IAAA,OAAa,IAAI;EACxB,OAAO;GACL,MAAM,OAAO,OAAO,QAAQ,IAAI,CAAC,CAAC,QAAQ,KAAK,CAAC,KAAK,WAAW;IAC9D,IAAI,OAAO,WAAW,KAAK;IAC3B,OAAO;GACT,GAAG,CAAC,CAAQ;GAEZ,MAAM,OAAO,SAAS,IAAI;GAC1B,KAAK,IAAA,OAAa,IAAI;EACxB;CACF;CAIA,KAAK,MAAM,OAAO;CAClB,KAAK,MAAM,SAAS;CACpB,KAAK,MAAM,iBAAiB;CAI5B,OAAO;EAAE,aADW,KAAK,IACN;EAAG;CAAO;AAC/B"}
|
|
@@ -3,16 +3,18 @@ const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
|
3
3
|
const require_build_tests_constants = require("./constants.cjs");
|
|
4
4
|
let shelljs = require("shelljs");
|
|
5
5
|
shelljs = require_runtime.__toESM(shelljs, 1);
|
|
6
|
-
|
|
6
|
+
// src/build-tests/cleanup.ts
|
|
7
7
|
/**
|
|
8
|
-
* Removes temporary packed directory and uninstalls temporary
|
|
8
|
+
* Removes the temporary packed directory and uninstalls temporary
|
|
9
|
+
* dependencies declared through {@linkcode TEARDOWN_COMMAND}.
|
|
10
|
+
*
|
|
11
|
+
* @returns Nothing.
|
|
9
12
|
*/
|
|
10
13
|
const cleanup = () => {
|
|
11
14
|
shelljs.default.rm("-Rf", ".pack");
|
|
12
15
|
shelljs.default.exec(require_build_tests_constants.TEARDOWN_COMMAND);
|
|
13
16
|
console.log("Cleanup done");
|
|
14
17
|
};
|
|
15
|
-
//#endregion
|
|
16
18
|
exports.cleanup = cleanup;
|
|
17
19
|
|
|
18
20
|
//# sourceMappingURL=cleanup.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.cjs","names":["TEARDOWN_COMMAND"],"sources":["../../src/build-tests/cleanup.ts"],"sourcesContent":["import sh from 'shelljs';\n\nimport { TEARDOWN_COMMAND } from './constants';\n\n/**\n * Removes temporary packed directory and uninstalls temporary dependencies.\n */\nexport const cleanup = () => {\n sh.rm('-Rf', '.pack');\n sh.exec(TEARDOWN_COMMAND);\n console.log('Cleanup done');\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cleanup.cjs","names":["TEARDOWN_COMMAND"],"sources":["../../src/build-tests/cleanup.ts"],"sourcesContent":["import sh from 'shelljs';\n\nimport { TEARDOWN_COMMAND } from './constants';\n\n/**\n * Removes the temporary packed directory and uninstalls temporary\n * dependencies declared through {@linkcode TEARDOWN_COMMAND}.\n *\n * @returns Nothing.\n */\nexport const cleanup = () => {\n sh.rm('-Rf', '.pack');\n sh.exec(TEARDOWN_COMMAND);\n console.log('Cleanup done');\n};\n"],"mappings":";;;;;;;;;;;;AAUA,MAAa,gBAAgB;CAC3B,QAAA,QAAG,GAAG,OAAO,OAAO;CACpB,QAAA,QAAG,KAAKA,8BAAAA,gBAAgB;CACxB,QAAQ,IAAI,cAAc;AAC5B"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Removes temporary packed directory and uninstalls temporary
|
|
2
|
+
* Removes the temporary packed directory and uninstalls temporary
|
|
3
|
+
* dependencies declared through {@linkcode TEARDOWN_COMMAND}.
|
|
4
|
+
*
|
|
5
|
+
* @returns Nothing.
|
|
3
6
|
*/
|
|
4
7
|
export declare const cleanup: () => void;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { TEARDOWN_COMMAND } from "./constants.js";
|
|
2
2
|
import sh from "shelljs";
|
|
3
|
-
|
|
3
|
+
// src/build-tests/cleanup.ts
|
|
4
4
|
/**
|
|
5
|
-
* Removes temporary packed directory and uninstalls temporary
|
|
5
|
+
* Removes the temporary packed directory and uninstalls temporary
|
|
6
|
+
* dependencies declared through {@linkcode TEARDOWN_COMMAND}.
|
|
7
|
+
*
|
|
8
|
+
* @returns Nothing.
|
|
6
9
|
*/
|
|
7
10
|
const cleanup = () => {
|
|
8
11
|
sh.rm("-Rf", ".pack");
|
|
9
12
|
sh.exec(TEARDOWN_COMMAND);
|
|
10
13
|
console.log("Cleanup done");
|
|
11
14
|
};
|
|
12
|
-
//#endregion
|
|
13
15
|
export { cleanup };
|
|
14
16
|
|
|
15
17
|
//# sourceMappingURL=cleanup.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleanup.js","names":[],"sources":["../../src/build-tests/cleanup.ts"],"sourcesContent":["import sh from 'shelljs';\n\nimport { TEARDOWN_COMMAND } from './constants';\n\n/**\n * Removes temporary packed directory and uninstalls temporary dependencies.\n */\nexport const cleanup = () => {\n sh.rm('-Rf', '.pack');\n sh.exec(TEARDOWN_COMMAND);\n console.log('Cleanup done');\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"cleanup.js","names":[],"sources":["../../src/build-tests/cleanup.ts"],"sourcesContent":["import sh from 'shelljs';\n\nimport { TEARDOWN_COMMAND } from './constants';\n\n/**\n * Removes the temporary packed directory and uninstalls temporary\n * dependencies declared through {@linkcode TEARDOWN_COMMAND}.\n *\n * @returns Nothing.\n */\nexport const cleanup = () => {\n sh.rm('-Rf', '.pack');\n sh.exec(TEARDOWN_COMMAND);\n console.log('Cleanup done');\n};\n"],"mappings":";;;;;;;;;AAUA,MAAa,gBAAgB;CAC3B,GAAG,GAAG,OAAO,OAAO;CACpB,GAAG,KAAK,gBAAgB;CACxB,QAAQ,IAAI,cAAc;AAC5B"}
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_build_tests_cli_test = require("./test.cjs");
|
|
3
|
-
const require_build_tests_cli_pre = require("./pre.cjs");
|
|
4
2
|
const require_build_tests_cli_post = require("./post.cjs");
|
|
3
|
+
const require_build_tests_cli_pre = require("./pre.cjs");
|
|
4
|
+
const require_build_tests_cli_test = require("./test.cjs");
|
|
5
5
|
let cmd_ts = require("cmd-ts");
|
|
6
|
-
|
|
6
|
+
// src/build-tests/cli/cli.ts
|
|
7
7
|
/**
|
|
8
8
|
* Binary command name for build tests.
|
|
9
9
|
*/
|
|
10
10
|
const BIN = "build-tests";
|
|
11
11
|
/**
|
|
12
12
|
* CLI definition for package building and test execution.
|
|
13
|
+
*
|
|
14
|
+
* Combines the {@linkcode posttest}, {@linkcode pretest} and
|
|
15
|
+
* {@linkcode test} subcommands under the {@linkcode BIN} binary name.
|
|
13
16
|
*/
|
|
14
17
|
const cli = (0, cmd_ts.subcommands)({
|
|
15
18
|
name: BIN,
|
|
@@ -21,7 +24,6 @@ const cli = (0, cmd_ts.subcommands)({
|
|
|
21
24
|
description: "Use it to build your package and testing the results",
|
|
22
25
|
version: "0.1.0"
|
|
23
26
|
});
|
|
24
|
-
//#endregion
|
|
25
27
|
exports.BIN = BIN;
|
|
26
28
|
exports.cli = cli;
|
|
27
29
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.cjs","names":["subcommands"],"sources":["../../../src/build-tests/cli/cli.ts"],"sourcesContent":["import { subcommands } from 'cmd-ts';\n\nimport { posttest } from './post';\nimport { pretest } from './pre';\nimport { test } from './test';\n\n/**\n * Binary command name for build tests.\n */\nexport const BIN = 'build-tests';\n\n/**\n * CLI definition for package building and test execution.\n */\nexport const cli = subcommands({\n name: BIN,\n cmds: { posttest, pretest, test },\n description: 'Use it to build your package and testing the results',\n version: '0.1.0',\n});\n"],"mappings":";;;;;;;;;AASA,MAAa,MAAM
|
|
1
|
+
{"version":3,"file":"cli.cjs","names":["subcommands"],"sources":["../../../src/build-tests/cli/cli.ts"],"sourcesContent":["import { subcommands } from 'cmd-ts';\n\nimport { posttest } from './post';\nimport { pretest } from './pre';\nimport { test } from './test';\n\n/**\n * Binary command name for build tests.\n */\nexport const BIN = 'build-tests';\n\n/**\n * CLI definition for package building and test execution.\n *\n * Combines the {@linkcode posttest}, {@linkcode pretest} and\n * {@linkcode test} subcommands under the {@linkcode BIN} binary name.\n */\nexport const cli = subcommands({\n name: BIN,\n cmds: { posttest, pretest, test },\n description: 'Use it to build your package and testing the results',\n version: '0.1.0',\n});\n"],"mappings":";;;;;;;;;AASA,MAAa,MAAM;;;;;;;AAQnB,MAAa,OAAA,GAAMA,OAAAA,YAAAA,CAAY;CAC7B,MAAM;CACN,MAAM;EAAE,UAAA,6BAAA;EAAU,SAAA,4BAAA;EAAS,MAAA,6BAAA;CAAK;CAChC,aAAa;CACb,SAAS;AACX,CAAC"}
|
|
@@ -4,6 +4,9 @@
|
|
|
4
4
|
export declare const BIN = "build-tests";
|
|
5
5
|
/**
|
|
6
6
|
* CLI definition for package building and test execution.
|
|
7
|
+
*
|
|
8
|
+
* Combines the {@linkcode posttest}, {@linkcode pretest} and
|
|
9
|
+
* {@linkcode test} subcommands under the {@linkcode BIN} binary name.
|
|
7
10
|
*/
|
|
8
11
|
export declare const cli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
9
12
|
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { test } from "./test.js";
|
|
2
|
-
import { pretest } from "./pre.js";
|
|
3
1
|
import { posttest } from "./post.js";
|
|
2
|
+
import { pretest } from "./pre.js";
|
|
3
|
+
import { test } from "./test.js";
|
|
4
4
|
import { subcommands } from "cmd-ts";
|
|
5
|
-
|
|
5
|
+
// src/build-tests/cli/cli.ts
|
|
6
6
|
/**
|
|
7
7
|
* Binary command name for build tests.
|
|
8
8
|
*/
|
|
9
9
|
const BIN = "build-tests";
|
|
10
10
|
/**
|
|
11
11
|
* CLI definition for package building and test execution.
|
|
12
|
+
*
|
|
13
|
+
* Combines the {@linkcode posttest}, {@linkcode pretest} and
|
|
14
|
+
* {@linkcode test} subcommands under the {@linkcode BIN} binary name.
|
|
12
15
|
*/
|
|
13
16
|
const cli = subcommands({
|
|
14
17
|
name: BIN,
|
|
@@ -20,7 +23,6 @@ const cli = subcommands({
|
|
|
20
23
|
description: "Use it to build your package and testing the results",
|
|
21
24
|
version: "0.1.0"
|
|
22
25
|
});
|
|
23
|
-
//#endregion
|
|
24
26
|
export { BIN, cli };
|
|
25
27
|
|
|
26
28
|
//# sourceMappingURL=cli.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../../../src/build-tests/cli/cli.ts"],"sourcesContent":["import { subcommands } from 'cmd-ts';\n\nimport { posttest } from './post';\nimport { pretest } from './pre';\nimport { test } from './test';\n\n/**\n * Binary command name for build tests.\n */\nexport const BIN = 'build-tests';\n\n/**\n * CLI definition for package building and test execution.\n */\nexport const cli = subcommands({\n name: BIN,\n cmds: { posttest, pretest, test },\n description: 'Use it to build your package and testing the results',\n version: '0.1.0',\n});\n"],"mappings":";;;;;;;;AASA,MAAa,MAAM
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../../../src/build-tests/cli/cli.ts"],"sourcesContent":["import { subcommands } from 'cmd-ts';\n\nimport { posttest } from './post';\nimport { pretest } from './pre';\nimport { test } from './test';\n\n/**\n * Binary command name for build tests.\n */\nexport const BIN = 'build-tests';\n\n/**\n * CLI definition for package building and test execution.\n *\n * Combines the {@linkcode posttest}, {@linkcode pretest} and\n * {@linkcode test} subcommands under the {@linkcode BIN} binary name.\n */\nexport const cli = subcommands({\n name: BIN,\n cmds: { posttest, pretest, test },\n description: 'Use it to build your package and testing the results',\n version: '0.1.0',\n});\n"],"mappings":";;;;;;;;AASA,MAAa,MAAM;;;;;;;AAQnB,MAAa,MAAM,YAAY;CAC7B,MAAM;CACN,MAAM;EAAE;EAAU;EAAS;CAAK;CAChC,aAAa;CACb,SAAS;AACX,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
const require_build_tests_cli_cli = require("./cli.cjs");
|
|
3
|
-
|
|
3
|
+
// src/build-tests/cli/index.ts
|
|
4
4
|
(0, require("cmd-ts").run)(require_build_tests_cli_cli.cli, process.argv.slice(2));
|
|
5
|
-
//#endregion
|
|
6
5
|
|
|
7
6
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["run","cli"],"sources":["../../../src/build-tests/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { run } from 'cmd-ts';\n\nimport { cli } from './cli';\n\nrun(cli, process.argv.slice(2));\n"],"mappings":";;;CAMAA,
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["run","cli"],"sources":["../../../src/build-tests/cli/index.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { run } from 'cmd-ts';\n\nimport { cli } from './cli';\n\nrun(cli, process.argv.slice(2));\n"],"mappings":";;;CAMAA,G,gBAAAA,CAAAA,CAAAA,IAAAA,CAAIC,4BAAAA,KAAK,QAAQ,KAAK,MAAM,CAAC,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_build_tests_cleanup = require("../cleanup.cjs");
|
|
3
|
-
|
|
3
|
+
// src/build-tests/cli/post.ts
|
|
4
4
|
/**
|
|
5
|
-
* CLI command to clean up generated test packages and restore
|
|
5
|
+
* CLI command to clean up generated test packages and restore
|
|
6
|
+
* `package.json`.
|
|
7
|
+
*
|
|
8
|
+
* Delegates to {@linkcode cleanup}.
|
|
6
9
|
*/
|
|
7
10
|
const posttest = (0, require("cmd-ts").command)({
|
|
8
11
|
name: "posttest",
|
|
@@ -14,7 +17,6 @@ const posttest = (0, require("cmd-ts").command)({
|
|
|
14
17
|
args: {},
|
|
15
18
|
handler: require_build_tests_cleanup.cleanup
|
|
16
19
|
});
|
|
17
|
-
//#endregion
|
|
18
20
|
exports.posttest = posttest;
|
|
19
21
|
|
|
20
22
|
//# sourceMappingURL=post.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.cjs","names":["command","cleanup"],"sources":["../../../src/build-tests/cli/post.ts"],"sourcesContent":["import { command } from 'cmd-ts';\n\nimport { cleanup } from '../cleanup';\n\n/**\n * CLI command to clean up generated test packages and restore package.json.\n */\nexport const posttest = command({\n name: 'posttest',\n aliases: ['post:test', 'post', 'post-test'],\n args: {},\n handler: cleanup,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"post.cjs","names":["command","cleanup"],"sources":["../../../src/build-tests/cli/post.ts"],"sourcesContent":["import { command } from 'cmd-ts';\n\nimport { cleanup } from '../cleanup';\n\n/**\n * CLI command to clean up generated test packages and restore\n * `package.json`.\n *\n * Delegates to {@linkcode cleanup}.\n */\nexport const posttest = command({\n name: 'posttest',\n aliases: ['post:test', 'post', 'post-test'],\n args: {},\n handler: cleanup,\n});\n"],"mappings":";;;;;;;;;AAUA,MAAa,YAAA,G,gBAAWA,CAAAA,CAAAA,QAAAA,CAAQ;CAC9B,MAAM;CACN,SAAS;EAAC;EAAa;EAAQ;CAAW;CAC1C,MAAM,CAAC;CACP,SAASC,4BAAAA;AACX,CAAC"}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* CLI command to clean up generated test packages and restore
|
|
2
|
+
* CLI command to clean up generated test packages and restore
|
|
3
|
+
* `package.json`.
|
|
4
|
+
*
|
|
5
|
+
* Delegates to {@linkcode cleanup}.
|
|
3
6
|
*/
|
|
4
7
|
export declare const posttest: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
5
8
|
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{}>>;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { cleanup } from "../cleanup.js";
|
|
2
2
|
import { command } from "cmd-ts";
|
|
3
|
-
|
|
3
|
+
// src/build-tests/cli/post.ts
|
|
4
4
|
/**
|
|
5
|
-
* CLI command to clean up generated test packages and restore
|
|
5
|
+
* CLI command to clean up generated test packages and restore
|
|
6
|
+
* `package.json`.
|
|
7
|
+
*
|
|
8
|
+
* Delegates to {@linkcode cleanup}.
|
|
6
9
|
*/
|
|
7
10
|
const posttest = command({
|
|
8
11
|
name: "posttest",
|
|
@@ -14,7 +17,6 @@ const posttest = command({
|
|
|
14
17
|
args: {},
|
|
15
18
|
handler: cleanup
|
|
16
19
|
});
|
|
17
|
-
//#endregion
|
|
18
20
|
export { posttest };
|
|
19
21
|
|
|
20
22
|
//# sourceMappingURL=post.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"post.js","names":[],"sources":["../../../src/build-tests/cli/post.ts"],"sourcesContent":["import { command } from 'cmd-ts';\n\nimport { cleanup } from '../cleanup';\n\n/**\n * CLI command to clean up generated test packages and restore package.json.\n */\nexport const posttest = command({\n name: 'posttest',\n aliases: ['post:test', 'post', 'post-test'],\n args: {},\n handler: cleanup,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"post.js","names":[],"sources":["../../../src/build-tests/cli/post.ts"],"sourcesContent":["import { command } from 'cmd-ts';\n\nimport { cleanup } from '../cleanup';\n\n/**\n * CLI command to clean up generated test packages and restore\n * `package.json`.\n *\n * Delegates to {@linkcode cleanup}.\n */\nexport const posttest = command({\n name: 'posttest',\n aliases: ['post:test', 'post', 'post-test'],\n args: {},\n handler: cleanup,\n});\n"],"mappings":";;;;;;;;;AAUA,MAAa,WAAW,QAAQ;CAC9B,MAAM;CACN,SAAS;EAAC;EAAa;EAAQ;CAAW;CAC1C,MAAM,CAAC;CACP,SAAS;AACX,CAAC"}
|