@bemedev/dev-utils 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -11
- package/lib/build-tests/addTarball.d.ts +1 -1
- package/lib/build-tests/buildPackageJson.d.ts +3 -3
- package/lib/build-tests/cleanup.d.ts +1 -1
- package/lib/build-tests/cli/cli.d.ts +51 -1
- package/lib/build-tests/cli/index.d.ts +1 -0
- package/lib/build-tests/cli/post.d.ts +5 -1
- package/lib/build-tests/cli/pre.d.ts +5 -1
- package/lib/build-tests/cli/test.d.ts +15 -1
- package/lib/build-tests/constants.d.ts +1 -1
- package/lib/build-tests/getRelativePath.d.ts +1 -1
- package/lib/build-tests/getTypescriptOutdir.d.ts +1 -1
- package/lib/build-tests/import.d.ts +2 -2
- package/lib/build-tests/imports/create.d.ts +3 -3
- package/lib/build-tests/imports/helper.cjs.map +1 -1
- package/lib/build-tests/imports/helper.d.ts +7 -3
- package/lib/build-tests/imports/helper.js.map +1 -1
- package/lib/build-tests/imports/index.d.ts +1 -1
- package/lib/build-tests/index.d.ts +5 -5
- package/lib/build-tests/pack.d.ts +1 -1
- package/lib/rolldown-config/config.cjs +23 -2
- package/lib/rolldown-config/config.cjs.map +1 -1
- package/lib/rolldown-config/config.d.ts +1 -1
- package/lib/rolldown-config/config.js +23 -2
- package/lib/rolldown-config/config.js.map +1 -1
- package/lib/rolldown-config/constants.d.ts +5 -5
- package/lib/rolldown-config/helpers.d.ts +2 -2
- package/lib/rolldown-config/index.d.ts +3 -3
- package/lib/rolldown-config/input.d.ts +1 -1
- package/lib/rolldown-config/output.cjs +4 -2
- package/lib/rolldown-config/output.cjs.map +1 -1
- package/lib/rolldown-config/output.d.ts +15 -1
- package/lib/rolldown-config/output.js +4 -2
- package/lib/rolldown-config/output.js.map +1 -1
- package/lib/rolldown-config/plugins/circulars.d.ts +9 -9
- package/lib/rolldown-config/plugins/clean.cjs +4 -2
- package/lib/rolldown-config/plugins/clean.cjs.map +1 -1
- package/lib/rolldown-config/plugins/clean.d.ts +13 -4
- package/lib/rolldown-config/plugins/clean.js +4 -2
- package/lib/rolldown-config/plugins/clean.js.map +1 -1
- package/lib/rolldown-config/plugins/externals.d.ts +7 -7
- package/lib/rolldown-config/plugins/index.cjs +8 -8
- package/lib/rolldown-config/plugins/index.cjs.map +1 -1
- package/lib/rolldown-config/plugins/index.d.ts +31 -2
- package/lib/rolldown-config/plugins/index.js +6 -7
- package/lib/rolldown-config/plugins/index.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.cjs +29 -41
- package/lib/rolldown-config/plugins/typescript.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.config.cjs +51 -39
- package/lib/rolldown-config/plugins/typescript.config.cjs.map +1 -1
- package/lib/rolldown-config/plugins/typescript.config.d.ts +3 -4
- package/lib/rolldown-config/plugins/typescript.config.js +51 -41
- package/lib/rolldown-config/plugins/typescript.config.js.map +1 -1
- package/lib/rolldown-config/plugins/typescript.d.ts +6 -6
- package/lib/rolldown-config/plugins/typescript.fast.cjs +80 -0
- package/lib/rolldown-config/plugins/typescript.fast.cjs.map +1 -0
- package/lib/rolldown-config/plugins/typescript.fast.d.ts +9 -0
- package/lib/rolldown-config/plugins/typescript.fast.js +77 -0
- package/lib/rolldown-config/plugins/typescript.fast.js.map +1 -0
- package/lib/rolldown-config/plugins/typescript.js +29 -43
- package/lib/rolldown-config/plugins/typescript.js.map +1 -1
- package/lib/rolldown-config/types.d.ts +14 -13
- package/lib/utils/array.d.ts +1 -1
- package/lib/utils/bemedev/globals/types.d.ts +4 -0
- package/lib/{vitest-extended → utils}/bemedev/globals/utils/_unknown.cjs +1 -1
- package/lib/utils/bemedev/globals/utils/_unknown.cjs.map +1 -0
- package/lib/utils/bemedev/globals/utils/_unknown.d.ts +12 -0
- package/lib/{vitest-extended → utils}/bemedev/globals/utils/_unknown.js +1 -1
- package/lib/utils/bemedev/globals/utils/_unknown.js.map +1 -0
- package/lib/utils/bemedev/globals/utils/expandFn.cjs +11 -0
- package/lib/utils/bemedev/globals/utils/expandFn.cjs.map +1 -0
- package/lib/utils/bemedev/globals/utils/expandFn.d.ts +2 -0
- package/lib/utils/bemedev/globals/utils/expandFn.js +10 -0
- package/lib/utils/bemedev/globals/utils/expandFn.js.map +1 -0
- package/lib/utils/identity.d.ts +1 -1
- package/lib/utils/index.cjs +2 -0
- package/lib/utils/index.d.ts +5 -4
- package/lib/utils/index.js +2 -1
- package/lib/utils/sleep.d.ts +1 -1
- package/lib/utils/types.d.ts +1 -4
- package/lib/vitest-exclude/index.d.ts +1 -1
- package/lib/vitest-exclude/types.d.ts +11 -8
- package/lib/vitest-exclude/vitest.cjs +0 -2
- package/lib/vitest-exclude/vitest.cjs.map +1 -1
- package/lib/vitest-exclude/vitest.d.ts +27 -15
- package/lib/vitest-exclude/vitest.js +0 -2
- package/lib/vitest-exclude/vitest.js.map +1 -1
- package/lib/vitest-exclude/vitest.utils.d.ts +2 -2
- package/lib/vitest-extended/acceptation.cjs.map +1 -1
- package/lib/vitest-extended/acceptation.d.ts +3 -2
- package/lib/vitest-extended/acceptation.js.map +1 -1
- package/lib/vitest-extended/createTests.cjs.map +1 -1
- package/lib/vitest-extended/createTests.d.ts +55 -34
- package/lib/vitest-extended/createTests.js.map +1 -1
- package/lib/vitest-extended/createTests.types.d.ts +6 -10
- package/lib/vitest-extended/done.d.ts +14 -8
- package/lib/vitest-extended/each/error.d.ts +1 -1
- package/lib/vitest-extended/each/error.types.d.ts +4 -10
- package/lib/vitest-extended/each/index.d.ts +2 -2
- package/lib/vitest-extended/each/pass.d.ts +26 -26
- package/lib/vitest-extended/each/pass.types.d.ts +6 -18
- package/lib/vitest-extended/fakeWaiter.d.ts +3 -3
- package/lib/vitest-extended/identity.d.ts +2 -2
- package/lib/vitest-extended/index.cjs +2 -0
- package/lib/vitest-extended/index.d.ts +7 -6
- package/lib/vitest-extended/index.js +2 -1
- package/lib/vitest-extended/isDefined.cjs.map +1 -1
- package/lib/vitest-extended/isDefined.d.ts +1 -1
- package/lib/vitest-extended/isDefined.js.map +1 -1
- package/lib/vitest-extended/isFunction.d.ts +1 -1
- package/lib/vitest-extended/project.cjs +23 -0
- package/lib/vitest-extended/project.cjs.map +1 -0
- package/lib/vitest-extended/project.d.ts +2 -0
- package/lib/vitest-extended/project.js +22 -0
- package/lib/vitest-extended/project.js.map +1 -0
- package/lib/vitest-extended/toArray.d.ts +1 -1
- package/lib/vitest-extended/toStringFlat.cjs.map +1 -1
- package/lib/vitest-extended/toStringFlat.d.ts +1 -1
- package/lib/vitest-extended/toStringFlat.js.map +1 -1
- package/lib/vitest-extended/types.d.ts +38 -40
- package/package.json +4 -8
- package/lib/vitest-extended/bemedev/globals/types.d.ts +0 -6
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.cjs.map +0 -1
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.d.ts +0 -12
- package/lib/vitest-extended/bemedev/globals/utils/_unknown.js.map +0 -1
package/README.md
CHANGED
|
@@ -3,6 +3,11 @@
|
|
|
3
3
|
A collection of utilities for Node.js development, including build tools,
|
|
4
4
|
testing utilities, and configuration management.
|
|
5
5
|
|
|
6
|
+
## HOTFIX fix for version 1.0.*
|
|
7
|
+
|
|
8
|
+
> It doesn't type declarations well, if you're not put directly the output
|
|
9
|
+
> type
|
|
10
|
+
|
|
6
11
|
## Modules
|
|
7
12
|
|
|
8
13
|
| Module | Description |
|
|
@@ -365,6 +370,29 @@ vitestExtended.useTFA(myFunction, 'myFunction');
|
|
|
365
370
|
|
|
366
371
|
---
|
|
367
372
|
|
|
373
|
+
### `defineProject(config)`
|
|
374
|
+
|
|
375
|
+
A wrapper around Vitest's `defineProject` / `defineConfig` that injects
|
|
376
|
+
default configurations.
|
|
377
|
+
|
|
378
|
+
> [!IMPORTANT] **HOT FIX**: Use this instead of standard `defineProject`
|
|
379
|
+
> from `vitest/config` to automatically resolve path aliases (via
|
|
380
|
+
> `tsconfigPaths: true`), set `globals: true`, configure
|
|
381
|
+
> `logHeapUsage: false`, and set the `NODE_ENV` environment variable to
|
|
382
|
+
> `'test'` by default.
|
|
383
|
+
|
|
384
|
+
```typescript
|
|
385
|
+
import { defineProject } from '@bemedev/dev-utils/vitest-extended';
|
|
386
|
+
|
|
387
|
+
export default defineProject({
|
|
388
|
+
test: {
|
|
389
|
+
// your config here
|
|
390
|
+
},
|
|
391
|
+
});
|
|
392
|
+
```
|
|
393
|
+
|
|
394
|
+
---
|
|
395
|
+
|
|
368
396
|
### Utility helpers
|
|
369
397
|
|
|
370
398
|
| Export | Signature | Description |
|
|
@@ -379,8 +407,7 @@ vitestExtended.useTFA(myFunction, 'myFunction');
|
|
|
379
407
|
## `rolldownConfig`
|
|
380
408
|
|
|
381
409
|
Rolldown bundler configuration factory with built-in plugins for TypeScript
|
|
382
|
-
declarations, circular dependency detection, and
|
|
383
|
-
tree-shaking externals.
|
|
410
|
+
declarations, circular dependency detection, and tree-shaking externals.
|
|
384
411
|
|
|
385
412
|
### `defineConfig(additionals?)`
|
|
386
413
|
|
|
@@ -455,24 +482,45 @@ export default defineConfig.bemedev({
|
|
|
455
482
|
|
|
456
483
|
---
|
|
457
484
|
|
|
485
|
+
### `defineConfig.fast(params?)`
|
|
486
|
+
|
|
487
|
+
A fast build configuration preset that optimizes TypeScript declaration
|
|
488
|
+
emitting. It uses the `fast` (`typescriptFast`) plugin wrapping
|
|
489
|
+
`oxc-transform` instead of the standard compiler API.
|
|
490
|
+
|
|
491
|
+
It runs the following plugin pipeline:
|
|
492
|
+
|
|
493
|
+
1. **circulars** — warns on circular dependencies
|
|
494
|
+
2. **externals** — marks `dependencies` and `peerDependencies` as external
|
|
495
|
+
3. **esm** — injects ESM external require helpers
|
|
496
|
+
(`esmExternalRequirePlugin`)
|
|
497
|
+
4. **fast** — generates `.d.ts` files quickly using `oxc-transform`
|
|
498
|
+
5. **clean** — removes empty JS chunks
|
|
499
|
+
|
|
500
|
+
```typescript
|
|
501
|
+
export default defineConfig.fast({ excludesTS: ['src/my-fixtures/**'] });
|
|
502
|
+
```
|
|
503
|
+
|
|
504
|
+
---
|
|
505
|
+
|
|
458
506
|
### Plugin builders (`PLUGIN_BUILDERS`)
|
|
459
507
|
|
|
460
508
|
Individual plugin factories are available for custom pipeline assembly:
|
|
461
509
|
|
|
462
|
-
| Key | Function | Wraps
|
|
463
|
-
| ------------ | ---------------------- |
|
|
464
|
-
| `circulars` | `circulars(options?)` | `rollup-plugin-circular-dependency`
|
|
465
|
-
| `externals` | `externals(options?)` | `rollup-plugin-node-externals`
|
|
466
|
-
| `
|
|
467
|
-
| `
|
|
510
|
+
| Key | Function | Wraps |
|
|
511
|
+
| ------------ | ---------------------- | ------------------------------------------------------------------------------------------ |
|
|
512
|
+
| `circulars` | `circulars(options?)` | `rollup-plugin-circular-dependency` |
|
|
513
|
+
| `externals` | `externals(options?)` | `rollup-plugin-node-externals` |
|
|
514
|
+
| `esm` | `esm` | `esmExternalRequirePlugin` from Rolldown |
|
|
515
|
+
| `typescript` | `typescript(options?)` | TypeScript compiler API + `tsc-alias` |
|
|
516
|
+
| `fast` | `fast(options?)` | `oxc-transform` + `tsc-alias`, for ONLY compilerOptions.isolatedDeclarations set to `true` |
|
|
517
|
+
| `clean` | `clean(options?)` | Custom post-build JS cleanup |
|
|
468
518
|
|
|
469
519
|
Pass plugin keys as strings in the `plugins` array to reorder or subset
|
|
470
520
|
them:
|
|
471
521
|
|
|
472
522
|
```typescript
|
|
473
|
-
defineConfig.default({
|
|
474
|
-
plugins: ['externals', 'typescript'],
|
|
475
|
-
});
|
|
523
|
+
defineConfig.default({ plugins: ['externals', 'typescript'] });
|
|
476
524
|
```
|
|
477
525
|
|
|
478
526
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const addTarball:
|
|
1
|
+
export declare const addTarball: () => Promise<void>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { Fn } from
|
|
1
|
+
import type { Fn } from '../utils/index.js';
|
|
2
2
|
type BuldPackageJson_F = Fn<[], {
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
packageJson: object;
|
|
4
|
+
outDir: string;
|
|
5
5
|
}>;
|
|
6
6
|
export declare const buildPackageJson: BuldPackageJson_F;
|
|
7
7
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const cleanup:
|
|
1
|
+
export declare const cleanup: () => void;
|
|
@@ -1,2 +1,52 @@
|
|
|
1
1
|
export declare const BIN = "build-tests";
|
|
2
|
-
export declare const cli:
|
|
2
|
+
export declare const cli: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
3
|
+
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
4
|
+
command: "posttest";
|
|
5
|
+
args: {};
|
|
6
|
+
} | {
|
|
7
|
+
command: "pretest";
|
|
8
|
+
args: {};
|
|
9
|
+
} | {
|
|
10
|
+
command: "test";
|
|
11
|
+
args: {
|
|
12
|
+
pretest: boolean;
|
|
13
|
+
posttest: boolean;
|
|
14
|
+
pre: boolean;
|
|
15
|
+
post: boolean;
|
|
16
|
+
};
|
|
17
|
+
}>>;
|
|
18
|
+
} & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
|
|
19
|
+
command: "posttest";
|
|
20
|
+
args: {};
|
|
21
|
+
} | {
|
|
22
|
+
command: "pretest";
|
|
23
|
+
args: {};
|
|
24
|
+
} | {
|
|
25
|
+
command: "test";
|
|
26
|
+
args: {
|
|
27
|
+
pretest: boolean;
|
|
28
|
+
posttest: boolean;
|
|
29
|
+
pre: boolean;
|
|
30
|
+
post: boolean;
|
|
31
|
+
};
|
|
32
|
+
}, {
|
|
33
|
+
command: "posttest";
|
|
34
|
+
value: void;
|
|
35
|
+
} | {
|
|
36
|
+
command: "pretest";
|
|
37
|
+
value: Promise<void>;
|
|
38
|
+
} | {
|
|
39
|
+
command: "test";
|
|
40
|
+
value: Promise<void>;
|
|
41
|
+
}> & {
|
|
42
|
+
run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
43
|
+
command: "posttest";
|
|
44
|
+
value: void;
|
|
45
|
+
} | {
|
|
46
|
+
command: "pretest";
|
|
47
|
+
value: Promise<void>;
|
|
48
|
+
} | {
|
|
49
|
+
command: "test";
|
|
50
|
+
value: Promise<void>;
|
|
51
|
+
}>>;
|
|
52
|
+
};
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const posttest:
|
|
1
|
+
export declare const posttest: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{}>>;
|
|
3
|
+
} & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{}, void> & {
|
|
4
|
+
run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<void>>;
|
|
5
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
|
|
@@ -1 +1,5 @@
|
|
|
1
|
-
export declare const pretest:
|
|
1
|
+
export declare const pretest: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{}>>;
|
|
3
|
+
} & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{}, Promise<void>> & {
|
|
4
|
+
run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<Promise<void>>>;
|
|
5
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
export declare const test:
|
|
1
|
+
export declare const test: Partial<import("cmd-ts/dist/cjs/argparser").Register> & {
|
|
2
|
+
parse(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<{
|
|
3
|
+
pretest: boolean;
|
|
4
|
+
posttest: boolean;
|
|
5
|
+
pre: boolean;
|
|
6
|
+
post: boolean;
|
|
7
|
+
}>>;
|
|
8
|
+
} & import("cmd-ts/dist/cjs/helpdoc").PrintHelp & import("cmd-ts/dist/cjs/helpdoc").ProvidesHelp & import("cmd-ts/dist/cjs/helpdoc").Named & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned> & import("cmd-ts/dist/cjs/argparser").Register & import("cmd-ts/dist/cjs/runner").Handling<{
|
|
9
|
+
pretest: boolean;
|
|
10
|
+
posttest: boolean;
|
|
11
|
+
pre: boolean;
|
|
12
|
+
post: boolean;
|
|
13
|
+
}, Promise<void>> & {
|
|
14
|
+
run(context: import("cmd-ts/dist/cjs/argparser").ParseContext): Promise<import("cmd-ts/dist/cjs/argparser").ParsingResult<Promise<void>>>;
|
|
15
|
+
} & Partial<import("cmd-ts/dist/cjs/helpdoc").Versioned & import("cmd-ts/dist/cjs/helpdoc").Descriptive & import("cmd-ts/dist/cjs/helpdoc").Aliased>;
|
|
@@ -10,5 +10,5 @@ export declare const TS_PATH = "./tsconfig.json";
|
|
|
10
10
|
export declare const PACKAGE_PATH = "./package.json";
|
|
11
11
|
export declare const TARBALL_FOLDER = ".pack";
|
|
12
12
|
export declare const TARBALL_EXTENSION = ".tgz";
|
|
13
|
-
export declare const TEARDOWN_COMMAND
|
|
13
|
+
export declare const TEARDOWN_COMMAND = "pnpm remove this-gen-1";
|
|
14
14
|
export declare const DEFAULT_OUT_DIR = "./lib";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type ImportArgs = {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
path?: string;
|
|
3
|
+
FAILS?: string[];
|
|
4
|
+
SUCCESS: string[];
|
|
5
5
|
};
|
|
6
6
|
export type CreateImportTest_F = (args: ImportArgs) => readonly [string, () => void];
|
|
7
7
|
export declare const createImportFnTests: CreateImportTest_F;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.cjs","names":["customImport"],"sources":["../../../src/build-tests/imports/helper.ts"],"sourcesContent":["import { expect } from 'vitest';\n\nimport type { Fn } from '../../
|
|
1
|
+
{"version":3,"file":"helper.cjs","names":["customImport"],"sources":["../../../src/build-tests/imports/helper.ts"],"sourcesContent":["import { expect } from 'vitest';\n\nimport type { Fn } from '../../utils/bemedev/globals/types';\nimport { customImport } from '../import';\n\nexport type Helper_F = (args: {\n path?: string;\n fn: string;\n}) => Promise<void>;\n\nexport const helperFn = async <T extends Fn = Fn>({\n path,\n fn,\n}: {\n path?: string;\n fn: string;\n}) => {\n const _fn = await customImport<T>({ path, fn: m => m[fn] });\n expect(_fn).toBeDefined();\n expect(_fn).toBeTypeOf('function');\n};\n"],"mappings":";;;;AAUA,MAAa,WAAW,OAA0B,EAChD,MACA,SAII;CACJ,MAAM,MAAM,MAAMA,2BAAAA,aAAgB;EAAE;EAAM,KAAI,MAAK,EAAE;CAAI,CAAC;CAC1D,CAAA,GAAA,OAAA,OAAA,CAAO,GAAG,CAAC,CAAC,YAAY;CACxB,CAAA,GAAA,OAAA,OAAA,CAAO,GAAG,CAAC,CAAC,WAAW,UAAU;AACnC"}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import type { Fn } from '../../utils/bemedev/globals/types';
|
|
1
2
|
export type Helper_F = (args: {
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
path?: string;
|
|
4
|
+
fn: string;
|
|
5
|
+
}) => Promise<void>;
|
|
6
|
+
export declare const helperFn: <T extends Fn = Fn>({ path, fn, }: {
|
|
7
|
+
path?: string;
|
|
8
|
+
fn: string;
|
|
4
9
|
}) => Promise<void>;
|
|
5
|
-
export declare const helperFn: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.js","names":[],"sources":["../../../src/build-tests/imports/helper.ts"],"sourcesContent":["import { expect } from 'vitest';\n\nimport type { Fn } from '../../
|
|
1
|
+
{"version":3,"file":"helper.js","names":[],"sources":["../../../src/build-tests/imports/helper.ts"],"sourcesContent":["import { expect } from 'vitest';\n\nimport type { Fn } from '../../utils/bemedev/globals/types';\nimport { customImport } from '../import';\n\nexport type Helper_F = (args: {\n path?: string;\n fn: string;\n}) => Promise<void>;\n\nexport const helperFn = async <T extends Fn = Fn>({\n path,\n fn,\n}: {\n path?: string;\n fn: string;\n}) => {\n const _fn = await customImport<T>({ path, fn: m => m[fn] });\n expect(_fn).toBeDefined();\n expect(_fn).toBeTypeOf('function');\n};\n"],"mappings":";;;AAUA,MAAa,WAAW,OAA0B,EAChD,MACA,SAII;CACJ,MAAM,MAAM,MAAM,aAAgB;EAAE;EAAM,KAAI,MAAK,EAAE;CAAI,CAAC;CAC1D,OAAO,GAAG,CAAC,CAAC,YAAY;CACxB,OAAO,GAAG,CAAC,CAAC,WAAW,UAAU;AACnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from
|
|
1
|
+
export * from './create';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export { THIS1 } from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
1
|
+
export * from './addTarball';
|
|
2
|
+
export * from './cleanup';
|
|
3
|
+
export { THIS1 } from './constants';
|
|
4
|
+
export * from './import';
|
|
5
|
+
export * from './imports';
|
|
@@ -30,12 +30,21 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
30
30
|
ignoresJS,
|
|
31
31
|
sourcemap,
|
|
32
32
|
dir
|
|
33
|
-
})
|
|
33
|
+
}),
|
|
34
|
+
fast: () => {
|
|
35
|
+
return require_rolldown_config_plugins_index.PLUGIN_BUILDERS.fast({
|
|
36
|
+
include,
|
|
37
|
+
exclude,
|
|
38
|
+
declarationMap,
|
|
39
|
+
dir
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
esm: rolldown_plugins.esmExternalRequirePlugin
|
|
34
43
|
};
|
|
35
44
|
const defaultOrdered = () => [
|
|
36
45
|
unordered.circulars(),
|
|
37
46
|
unordered.externals(),
|
|
38
|
-
|
|
47
|
+
unordered.esm(),
|
|
39
48
|
unordered.typescript(),
|
|
40
49
|
unordered.clean()
|
|
41
50
|
];
|
|
@@ -60,6 +69,18 @@ defineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {
|
|
|
60
69
|
platform: "node"
|
|
61
70
|
});
|
|
62
71
|
};
|
|
72
|
+
defineConfig.fast = (rest) => {
|
|
73
|
+
return defineConfig.default({
|
|
74
|
+
...rest,
|
|
75
|
+
plugins: [
|
|
76
|
+
"circulars",
|
|
77
|
+
"externals",
|
|
78
|
+
"esm",
|
|
79
|
+
"fast",
|
|
80
|
+
"clean"
|
|
81
|
+
]
|
|
82
|
+
});
|
|
83
|
+
};
|
|
63
84
|
defineConfig.bemedev = (additionals) => {
|
|
64
85
|
const circularDeps = require_rolldown_config_constants.DEFAULT_CIRCULAR_DEPS.concat(require_utils_array.toArray(additionals?.circularDeps));
|
|
65
86
|
const ignoresJS = require_utils_array.toArray(additionals?.ignoresJS).concat(require_rolldown_config_constants.DEFAULT_CIRCULAR_DEPS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","buildOutput","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n
|
|
1
|
+
{"version":3,"file":"config.cjs","names":["buildInput","toArray","DEFAULT_EXCLUDE","PLUGIN_BUILDERS","esmExternalRequirePlugin","buildOutput","DEFAULT_CIRCULAR_DEPS"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({\n include,\n exclude,\n declarationMap,\n dir,\n });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({\n input,\n plugins,\n external,\n output,\n platform: 'node',\n });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;;AAWA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAUA,8BAAAA,WAAW,GAAGC,oBAAAA,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAUC,kCAAAA,gBAAgB,OAAOD,oBAAAA,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACEE,sCAAAA,gBAAgB,WAAW;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,iBAAiBA,sCAAAA,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACEA,sCAAAA,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAaA,sCAAAA,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAOA,sCAAAA,gBAAgB,KAAK;IAC1B;IACA;IACA;IACA;GACF,CAAC;EACH;EACA,KAAKC,iBAAAA;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQJ,8BAAAA,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAASK,+BAAAA,YAAY,KAAK,SAAS;CAIzC,QAAA,GAAA,SAAA,aAAA,CAAqB;EACnB;EACA,SAJc,eAAe;GAAE;GAAK;GAAW,GAAG;EAAK,CAIjD;EACN;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAeC,kCAAAA,sBAAsB,OACzCL,oBAAAA,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAYA,oBAAAA,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChDK,kCAAAA,qBACF;CAEA,MAAM,aAAaJ,kCAAAA,gBAAgB,OACjCD,oBAAAA,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Config_F } from
|
|
1
|
+
import type { Config_F } from './types';
|
|
2
2
|
export declare const defineConfig: Config_F;
|
|
@@ -29,12 +29,21 @@ const producePlugins = ({ circularDeps, ignoresJS, dir, sourcemap = false, exclu
|
|
|
29
29
|
ignoresJS,
|
|
30
30
|
sourcemap,
|
|
31
31
|
dir
|
|
32
|
-
})
|
|
32
|
+
}),
|
|
33
|
+
fast: () => {
|
|
34
|
+
return PLUGIN_BUILDERS.fast({
|
|
35
|
+
include,
|
|
36
|
+
exclude,
|
|
37
|
+
declarationMap,
|
|
38
|
+
dir
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
esm: esmExternalRequirePlugin
|
|
33
42
|
};
|
|
34
43
|
const defaultOrdered = () => [
|
|
35
44
|
unordered.circulars(),
|
|
36
45
|
unordered.externals(),
|
|
37
|
-
|
|
46
|
+
unordered.esm(),
|
|
38
47
|
unordered.typescript(),
|
|
39
48
|
unordered.clean()
|
|
40
49
|
];
|
|
@@ -59,6 +68,18 @@ defineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {
|
|
|
59
68
|
platform: "node"
|
|
60
69
|
});
|
|
61
70
|
};
|
|
71
|
+
defineConfig.fast = (rest) => {
|
|
72
|
+
return defineConfig.default({
|
|
73
|
+
...rest,
|
|
74
|
+
plugins: [
|
|
75
|
+
"circulars",
|
|
76
|
+
"externals",
|
|
77
|
+
"esm",
|
|
78
|
+
"fast",
|
|
79
|
+
"clean"
|
|
80
|
+
]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
62
83
|
defineConfig.bemedev = (additionals) => {
|
|
63
84
|
const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(toArray(additionals?.circularDeps));
|
|
64
85
|
const ignoresJS = toArray(additionals?.ignoresJS).concat(DEFAULT_CIRCULAR_DEPS);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","names":["_defineConfig"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n
|
|
1
|
+
{"version":3,"file":"config.js","names":["_defineConfig"],"sources":["../../src/rolldown-config/config.ts"],"sourcesContent":["import { defineConfig as _defineConfig } from 'rolldown';\nimport { esmExternalRequirePlugin } from 'rolldown/plugins';\n\nimport { toArray } from '#utils';\n\nimport { DEFAULT_CIRCULAR_DEPS, DEFAULT_EXCLUDE } from './constants';\nimport { buildInput } from './input';\nimport { buildOutput } from './output';\nimport { PLUGIN_BUILDERS } from './plugins';\nimport type { Config_F, Params } from './types';\n\nexport const defineConfig: Config_F = additionals => {\n return defineConfig.default(additionals);\n};\n\nconst producePlugins = ({\n circularDeps,\n ignoresJS,\n dir,\n sourcemap = false,\n excludesTS,\n declarationMap,\n plugins,\n}: Params = {}) => {\n const include = buildInput(...toArray(excludesTS));\n const exclude = DEFAULT_EXCLUDE.concat(toArray(excludesTS));\n const unordered = {\n typescript: () =>\n PLUGIN_BUILDERS.typescript({\n include,\n exclude,\n declarationMap,\n dir,\n }),\n circulars: () => PLUGIN_BUILDERS.circulars({ exclude: circularDeps }),\n externals: () =>\n PLUGIN_BUILDERS.externals({\n // exclude peerDependencies and dependencies\n optDeps: false,\n builtinsPrefix: 'strip',\n include: excludesTS,\n }),\n clean: () => PLUGIN_BUILDERS.clean({ ignoresJS, sourcemap, dir }),\n fast: () => {\n return PLUGIN_BUILDERS.fast({\n include,\n exclude,\n declarationMap,\n dir,\n });\n },\n esm: esmExternalRequirePlugin,\n };\n\n const defaultOrdered = () => [\n unordered.circulars(),\n unordered.externals(),\n unordered.esm(),\n unordered.typescript(),\n unordered.clean(),\n ];\n\n return plugins\n ? plugins\n .map(p => {\n if (typeof p === 'string') return unordered[p]();\n return p;\n })\n .filter(p => !!p)\n : defaultOrdered();\n};\n\ndefineConfig.default = ({ dir, sourcemap = false, ...rest } = {}) => {\n const input = buildInput();\n const external = rest.externals;\n const output = buildOutput(dir, sourcemap);\n\n const plugins = producePlugins({ dir, sourcemap, ...rest });\n\n return _defineConfig({\n input,\n plugins,\n external,\n output,\n platform: 'node',\n });\n};\n\ndefineConfig.fast = rest => {\n return defineConfig.default({\n ...rest,\n plugins: ['circulars', 'externals', 'esm', 'fast', 'clean'],\n });\n};\n\ndefineConfig.bemedev = additionals => {\n // #region constants\n const circularDeps = DEFAULT_CIRCULAR_DEPS.concat(\n toArray(additionals?.circularDeps),\n );\n const ignoresJS = toArray(additionals?.ignoresJS).concat(\n DEFAULT_CIRCULAR_DEPS,\n );\n\n const excludesTS = DEFAULT_EXCLUDE.concat(\n toArray(additionals?.excludesTS),\n );\n const _sourcemap = additionals?.sourcemap;\n const sourcemap = _sourcemap === undefined || _sourcemap === true;\n // #endregion\n\n return defineConfig.default({\n ...additionals,\n circularDeps,\n excludesTS,\n ignoresJS,\n sourcemap,\n });\n};\n"],"mappings":";;;;;;;;AAWA,MAAa,gBAAyB,gBAAe;CACnD,OAAO,aAAa,QAAQ,WAAW;AACzC;AAEA,MAAM,kBAAkB,EACtB,cACA,WACA,KACA,YAAY,OACZ,YACA,gBACA,YACU,CAAC,MAAM;CACjB,MAAM,UAAU,WAAW,GAAG,QAAQ,UAAU,CAAC;CACjD,MAAM,UAAU,gBAAgB,OAAO,QAAQ,UAAU,CAAC;CAC1D,MAAM,YAAY;EAChB,kBACE,gBAAgB,WAAW;GACzB;GACA;GACA;GACA;EACF,CAAC;EACH,iBAAiB,gBAAgB,UAAU,EAAE,SAAS,aAAa,CAAC;EACpE,iBACE,gBAAgB,UAAU;GAExB,SAAS;GACT,gBAAgB;GAChB,SAAS;EACX,CAAC;EACH,aAAa,gBAAgB,MAAM;GAAE;GAAW;GAAW;EAAI,CAAC;EAChE,YAAY;GACV,OAAO,gBAAgB,KAAK;IAC1B;IACA;IACA;IACA;GACF,CAAC;EACH;EACA,KAAK;CACP;CAEA,MAAM,uBAAuB;EAC3B,UAAU,UAAU;EACpB,UAAU,UAAU;EACpB,UAAU,IAAI;EACd,UAAU,WAAW;EACrB,UAAU,MAAM;CAClB;CAEA,OAAO,UACH,QACG,KAAI,MAAK;EACR,IAAI,OAAO,MAAM,UAAU,OAAO,UAAU,EAAE,CAAC;EAC/C,OAAO;CACT,CAAC,CAAC,CACD,QAAO,MAAK,CAAC,CAAC,CAAC,IAClB,eAAe;AACrB;AAEA,aAAa,WAAW,EAAE,KAAK,YAAY,OAAO,GAAG,SAAS,CAAC,MAAM;CACnE,MAAM,QAAQ,WAAW;CACzB,MAAM,WAAW,KAAK;CACtB,MAAM,SAAS,YAAY,KAAK,SAAS;CAIzC,OAAOA,eAAc;EACnB;EACA,SAJc,eAAe;GAAE;GAAK;GAAW,GAAG;EAAK,CAIjD;EACN;EACA;EACA,UAAU;CACZ,CAAC;AACH;AAEA,aAAa,QAAO,SAAQ;CAC1B,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH,SAAS;GAAC;GAAa;GAAa;GAAO;GAAQ;EAAO;CAC5D,CAAC;AACH;AAEA,aAAa,WAAU,gBAAe;CAEpC,MAAM,eAAe,sBAAsB,OACzC,QAAQ,aAAa,YAAY,CACnC;CACA,MAAM,YAAY,QAAQ,aAAa,SAAS,CAAC,CAAC,OAChD,qBACF;CAEA,MAAM,aAAa,gBAAgB,OACjC,QAAQ,aAAa,UAAU,CACjC;CACA,MAAM,aAAa,aAAa;CAChC,MAAM,YAAY,eAAe,KAAA,KAAa,eAAe;CAG7D,OAAO,aAAa,QAAQ;EAC1B,GAAG;EACH;EACA;EACA;EACA;CACF,CAAC;AACH"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export declare const DEFAULT_EXCLUDE:
|
|
2
|
-
export declare const DEFAULT_CIRCULAR_DEPS:
|
|
3
|
-
export declare const IGNORE:
|
|
1
|
+
export declare const DEFAULT_EXCLUDE: string[];
|
|
2
|
+
export declare const DEFAULT_CIRCULAR_DEPS: string[];
|
|
3
|
+
export declare const IGNORE: string[];
|
|
4
4
|
export declare const DEFAULT_DIR = "lib";
|
|
5
5
|
export declare const WARNING_CODES: {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
EMPTY_BUNDLE: string;
|
|
7
|
+
CIRCULAR_DEPENDENCY: string;
|
|
8
8
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const withoutExtension:
|
|
2
|
-
export declare const cleanupJS:
|
|
1
|
+
export declare const withoutExtension: (file: string) => string;
|
|
2
|
+
export declare const cleanupJS: (files: Set<string>, dir: string, sourcemap: boolean) => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
1
|
+
export * from './config';
|
|
2
|
+
export * from './plugins';
|
|
3
|
+
export * from './types';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { BuildInput_F } from
|
|
1
|
+
import type { BuildInput_F } from './types';
|
|
2
2
|
export declare const buildInput: BuildInput_F;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
require("./constants.cjs");
|
|
3
|
+
const require_rolldown_config_plugins_typescript_config = require("./plugins/typescript.config.cjs");
|
|
3
4
|
//#region src/rolldown-config/output.ts
|
|
4
5
|
const buildOutput = (dir = "lib", sourcemap) => {
|
|
6
|
+
const outDir = require_rolldown_config_plugins_typescript_config.getConfig(process.cwd()).options.outDir ?? dir ?? "lib";
|
|
5
7
|
return [{
|
|
6
8
|
format: "es",
|
|
7
9
|
sourcemap,
|
|
8
10
|
preserveModulesRoot: "src",
|
|
9
|
-
dir,
|
|
11
|
+
dir: outDir,
|
|
10
12
|
preserveModules: true,
|
|
11
13
|
entryFileNames: "[name].js"
|
|
12
14
|
}, {
|
|
13
15
|
format: "cjs",
|
|
14
16
|
sourcemap,
|
|
15
17
|
preserveModulesRoot: "src",
|
|
16
|
-
dir,
|
|
18
|
+
dir: outDir,
|
|
17
19
|
preserveModules: true,
|
|
18
20
|
entryFileNames: "[name].cjs"
|
|
19
21
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.cjs","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.cjs","names":["getConfig"],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\nimport { getConfig } from './plugins/typescript.config';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n const config = getConfig(process.cwd());\n const outDir = config.options.outDir ?? dir ?? DEFAULT_DIR;\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;;AAKA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CAEpE,MAAM,SADSA,kDAAAA,UAAU,QAAQ,IAAI,CACjB,CAAC,CAAC,QAAQ,UAAU,OAAA;CACxC,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
|
|
@@ -1 +1,15 @@
|
|
|
1
|
-
export declare const buildOutput:
|
|
1
|
+
export declare const buildOutput: (dir: string | undefined, sourcemap: boolean) => [{
|
|
2
|
+
readonly format: "es";
|
|
3
|
+
readonly sourcemap: boolean;
|
|
4
|
+
readonly preserveModulesRoot: "src";
|
|
5
|
+
readonly dir: string;
|
|
6
|
+
readonly preserveModules: true;
|
|
7
|
+
readonly entryFileNames: "[name].js";
|
|
8
|
+
}, {
|
|
9
|
+
readonly format: "cjs";
|
|
10
|
+
readonly sourcemap: boolean;
|
|
11
|
+
readonly preserveModulesRoot: "src";
|
|
12
|
+
readonly dir: string;
|
|
13
|
+
readonly preserveModules: true;
|
|
14
|
+
readonly entryFileNames: "[name].cjs";
|
|
15
|
+
}];
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import "./constants.js";
|
|
2
|
+
import { getConfig } from "./plugins/typescript.config.js";
|
|
2
3
|
//#region src/rolldown-config/output.ts
|
|
3
4
|
const buildOutput = (dir = "lib", sourcemap) => {
|
|
5
|
+
const outDir = getConfig(process.cwd()).options.outDir ?? dir ?? "lib";
|
|
4
6
|
return [{
|
|
5
7
|
format: "es",
|
|
6
8
|
sourcemap,
|
|
7
9
|
preserveModulesRoot: "src",
|
|
8
|
-
dir,
|
|
10
|
+
dir: outDir,
|
|
9
11
|
preserveModules: true,
|
|
10
12
|
entryFileNames: "[name].js"
|
|
11
13
|
}, {
|
|
12
14
|
format: "cjs",
|
|
13
15
|
sourcemap,
|
|
14
16
|
preserveModulesRoot: "src",
|
|
15
|
-
dir,
|
|
17
|
+
dir: outDir,
|
|
16
18
|
preserveModules: true,
|
|
17
19
|
entryFileNames: "[name].cjs"
|
|
18
20
|
}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"output.js","names":[],"sources":["../../src/rolldown-config/output.ts"],"sourcesContent":["import type { OutputOptions } from 'rolldown';\n\nimport { DEFAULT_DIR } from './constants';\nimport { getConfig } from './plugins/typescript.config';\n\nexport const buildOutput = (dir = DEFAULT_DIR, sourcemap: boolean) => {\n const config = getConfig(process.cwd());\n const outDir = config.options.outDir ?? dir ?? DEFAULT_DIR;\n return [\n {\n format: 'es',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].js',\n },\n {\n format: 'cjs',\n sourcemap,\n preserveModulesRoot: 'src',\n dir: outDir,\n preserveModules: true,\n entryFileNames: '[name].cjs',\n },\n ] as const satisfies OutputOptions[];\n};\n"],"mappings":";;;AAKA,MAAa,eAAe,MAAA,OAAmB,cAAuB;CAEpE,MAAM,SADS,UAAU,QAAQ,IAAI,CACjB,CAAC,CAAC,QAAQ,UAAU,OAAA;CACxC,OAAO,CACL;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,GACA;EACE,QAAQ;EACR;EACA,qBAAqB;EACrB,KAAK;EACL,iBAAiB;EACjB,gBAAgB;CAClB,CACF;AACF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { RolldownPluginOption } from
|
|
2
|
-
import { circularDependencies } from
|
|
1
|
+
import type { RolldownPluginOption } from 'rolldown';
|
|
2
|
+
import { circularDependencies } from 'rollup-plugin-circular-dependencies';
|
|
3
3
|
export type CircularDependenciesOptions = Parameters<typeof circularDependencies>[0] & {
|
|
4
|
-
|
|
4
|
+
exclude?: string | string[];
|
|
5
5
|
};
|
|
6
6
|
/**
|
|
7
|
-
* Creates a configured circular dependencies plugin instance
|
|
8
|
-
*
|
|
9
|
-
* @param options - Configuration options for circular dependencies
|
|
10
|
-
* detection
|
|
11
|
-
* @returns Rolldown plugin
|
|
12
|
-
*/
|
|
7
|
+
* Creates a configured circular dependencies plugin instance
|
|
8
|
+
*
|
|
9
|
+
* @param options - Configuration options for circular dependencies
|
|
10
|
+
* detection
|
|
11
|
+
* @returns Rolldown plugin
|
|
12
|
+
*/
|
|
13
13
|
export declare function circulars(options?: CircularDependenciesOptions): RolldownPluginOption;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_utils_array = require("../../utils/array.cjs");
|
|
3
3
|
const require_rolldown_config_constants = require("../constants.cjs");
|
|
4
|
-
const require_rolldown_config_helpers = require("../helpers.cjs");
|
|
5
4
|
const require_rolldown_config_plugins_typescript_config = require("./typescript.config.cjs");
|
|
5
|
+
const require_rolldown_config_helpers = require("../helpers.cjs");
|
|
6
|
+
let fs = require("fs");
|
|
6
7
|
let path = require("path");
|
|
7
8
|
let glob = require("glob");
|
|
9
|
+
let _typescript_typescript6 = require("@typescript/typescript6");
|
|
8
10
|
//#region src/rolldown-config/plugins/clean.ts
|
|
9
11
|
const clean = (options) => {
|
|
10
12
|
const { ignoresJS, sourcemap = false, dir } = options;
|
|
@@ -25,7 +27,7 @@ const clean = (options) => {
|
|
|
25
27
|
closeBundle: {
|
|
26
28
|
order: "post",
|
|
27
29
|
handler: () => {
|
|
28
|
-
const outDir = require_rolldown_config_plugins_typescript_config.readTsConfig(
|
|
30
|
+
const outDir = require_rolldown_config_plugins_typescript_config.readTsConfig((0, _typescript_typescript6.findConfigFile)(process.cwd(), fs.existsSync, "tsconfig.json")).options.outDir ?? dir ?? "lib";
|
|
29
31
|
if (_ignoresJS.length > 0) try {
|
|
30
32
|
const files = /* @__PURE__ */ new Set();
|
|
31
33
|
_ignoresJS.forEach((pat) => {
|