@modern-js/module-tools 2.45.0-beta.0 → 2.46.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/compiled/@rollup/plugin-json/index.js +1 -1
- package/compiled/@rollup/plugin-json/rollup/dist/rollup.d.ts +63 -16
- package/compiled/rollup/{249.index.js → 846.index.js} +6 -5
- package/compiled/rollup/fsevents.node +0 -0
- package/compiled/rollup/index.js +20 -20
- package/compiled/rollup/package.json +1 -1
- package/compiled/rollup/types/rollup.d.ts +63 -16
- package/compiled/rollup-plugin-dts/{dist/rollup-plugin-dts.d.ts → index.d.ts} +1 -1
- package/compiled/rollup-plugin-dts/index.js +1 -1
- package/compiled/rollup-plugin-dts/package.json +1 -1
- package/compiled/rollup-plugin-dts/{rollup/dist/rollup.d.ts → rollup.d.ts} +63 -16
- package/dist/builder/build.js +4 -0
- package/dist/builder/esbuild/index.js +8 -0
- package/dist/error.d.ts +0 -1
- package/dist/error.js +4 -9
- package/dist/types/config/index.d.ts +1 -1
- package/dist/types/config/transform-import.d.ts +13 -0
- package/dist/types/config/transform-import.js +16 -0
- package/package.json +16 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"rollup","author":"Rich Harris","version":"3.
|
|
1
|
+
{"name":"rollup","author":"Rich Harris","version":"3.29.4","license":"MIT","types":"types/rollup.d.ts"}
|
|
@@ -32,15 +32,19 @@ export interface RollupLog {
|
|
|
32
32
|
line: number;
|
|
33
33
|
};
|
|
34
34
|
message: string;
|
|
35
|
+
meta?: any;
|
|
35
36
|
names?: string[];
|
|
36
37
|
plugin?: string;
|
|
37
|
-
pluginCode?:
|
|
38
|
+
pluginCode?: unknown;
|
|
38
39
|
pos?: number;
|
|
39
40
|
reexporter?: string;
|
|
40
41
|
stack?: string;
|
|
41
42
|
url?: string;
|
|
42
43
|
}
|
|
43
44
|
|
|
45
|
+
export type LogLevel = 'warn' | 'info' | 'debug';
|
|
46
|
+
export type LogLevelOption = LogLevel | 'silent';
|
|
47
|
+
|
|
44
48
|
export type SourceMapSegment =
|
|
45
49
|
| [number]
|
|
46
50
|
| [number, number, number, number]
|
|
@@ -48,7 +52,7 @@ export type SourceMapSegment =
|
|
|
48
52
|
|
|
49
53
|
export interface ExistingDecodedSourceMap {
|
|
50
54
|
file?: string;
|
|
51
|
-
mappings: SourceMapSegment[][];
|
|
55
|
+
readonly mappings: SourceMapSegment[][];
|
|
52
56
|
names: string[];
|
|
53
57
|
sourceRoot?: string;
|
|
54
58
|
sources: string[];
|
|
@@ -70,11 +74,10 @@ export interface ExistingRawSourceMap {
|
|
|
70
74
|
|
|
71
75
|
export type DecodedSourceMapOrMissing =
|
|
72
76
|
| {
|
|
73
|
-
mappings?: never;
|
|
74
77
|
missing: true;
|
|
75
78
|
plugin: string;
|
|
76
79
|
}
|
|
77
|
-
| ExistingDecodedSourceMap;
|
|
80
|
+
| (ExistingDecodedSourceMap & { missing?: false });
|
|
78
81
|
|
|
79
82
|
export interface SourceMap {
|
|
80
83
|
file: string;
|
|
@@ -128,8 +131,14 @@ export interface PluginCache {
|
|
|
128
131
|
set<T = any>(id: string, value: T): void;
|
|
129
132
|
}
|
|
130
133
|
|
|
134
|
+
export type LoggingFunction = (log: RollupLog | string | (() => RollupLog | string)) => void;
|
|
135
|
+
|
|
131
136
|
export interface MinimalPluginContext {
|
|
137
|
+
debug: LoggingFunction;
|
|
138
|
+
error: (error: RollupError | string) => never;
|
|
139
|
+
info: LoggingFunction;
|
|
132
140
|
meta: PluginContextMeta;
|
|
141
|
+
warn: LoggingFunction;
|
|
133
142
|
}
|
|
134
143
|
|
|
135
144
|
export interface EmittedAsset {
|
|
@@ -155,6 +164,7 @@ export interface EmittedPrebuiltChunk {
|
|
|
155
164
|
exports?: string[];
|
|
156
165
|
fileName: string;
|
|
157
166
|
map?: SourceMap;
|
|
167
|
+
sourcemapFileName?: string;
|
|
158
168
|
type: 'prebuilt-chunk';
|
|
159
169
|
}
|
|
160
170
|
|
|
@@ -190,15 +200,22 @@ export interface CustomPluginOptions {
|
|
|
190
200
|
[plugin: string]: any;
|
|
191
201
|
}
|
|
192
202
|
|
|
203
|
+
type LoggingFunctionWithPosition = (
|
|
204
|
+
log: RollupLog | string | (() => RollupLog | string),
|
|
205
|
+
pos?: number | { column: number; line: number }
|
|
206
|
+
) => void;
|
|
207
|
+
|
|
193
208
|
export interface PluginContext extends MinimalPluginContext {
|
|
194
209
|
addWatchFile: (id: string) => void;
|
|
195
210
|
cache: PluginCache;
|
|
211
|
+
debug: LoggingFunction;
|
|
196
212
|
emitFile: EmitFile;
|
|
197
|
-
error: (error: RollupError | string
|
|
213
|
+
error: (error: RollupError | string) => never;
|
|
198
214
|
getFileName: (fileReferenceId: string) => string;
|
|
199
215
|
getModuleIds: () => IterableIterator<string>;
|
|
200
216
|
getModuleInfo: GetModuleInfo;
|
|
201
217
|
getWatchFiles: () => string[];
|
|
218
|
+
info: LoggingFunction;
|
|
202
219
|
load: (
|
|
203
220
|
options: { id: string; resolveDependencies?: boolean } & Partial<PartialNull<ModuleOptions>>
|
|
204
221
|
) => Promise<ModuleInfo>;
|
|
@@ -216,7 +233,7 @@ export interface PluginContext extends MinimalPluginContext {
|
|
|
216
233
|
}
|
|
217
234
|
) => Promise<ResolvedId | null>;
|
|
218
235
|
setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void;
|
|
219
|
-
warn:
|
|
236
|
+
warn: LoggingFunction;
|
|
220
237
|
}
|
|
221
238
|
|
|
222
239
|
export interface PluginContextMeta {
|
|
@@ -279,7 +296,11 @@ export type LoadResult = SourceDescription | string | NullValue;
|
|
|
279
296
|
export type LoadHook = (this: PluginContext, id: string) => LoadResult;
|
|
280
297
|
|
|
281
298
|
export interface TransformPluginContext extends PluginContext {
|
|
299
|
+
debug: LoggingFunctionWithPosition;
|
|
300
|
+
error: (error: RollupError | string, pos?: number | { column: number; line: number }) => never;
|
|
282
301
|
getCombinedSourcemap: () => SourceMap;
|
|
302
|
+
info: LoggingFunctionWithPosition;
|
|
303
|
+
warn: LoggingFunctionWithPosition;
|
|
283
304
|
}
|
|
284
305
|
|
|
285
306
|
export type TransformResult = string | NullValue | Partial<SourceDescription>;
|
|
@@ -349,7 +370,7 @@ export type WatchChangeHook = (
|
|
|
349
370
|
* ```
|
|
350
371
|
*/
|
|
351
372
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
352
|
-
export type PluginImpl<O extends object = object> = (options?: O) => Plugin
|
|
373
|
+
export type PluginImpl<O extends object = object, A = any> = (options?: O) => Plugin<A>;
|
|
353
374
|
|
|
354
375
|
export interface OutputBundle {
|
|
355
376
|
[fileName: string]: OutputAsset | OutputChunk;
|
|
@@ -369,6 +390,7 @@ export interface FunctionPluginHooks {
|
|
|
369
390
|
) => void;
|
|
370
391
|
load: LoadHook;
|
|
371
392
|
moduleParsed: ModuleParsedHook;
|
|
393
|
+
onLog: (this: MinimalPluginContext, level: LogLevel, log: RollupLog) => boolean | NullValue;
|
|
372
394
|
options: (this: MinimalPluginContext, options: InputOptions) => InputOptions | NullValue;
|
|
373
395
|
outputOptions: (this: PluginContext, options: OutputOptions) => OutputOptions | NullValue;
|
|
374
396
|
renderChunk: RenderChunkHook;
|
|
@@ -417,6 +439,7 @@ export type InputPluginHooks = Exclude<keyof FunctionPluginHooks, OutputPluginHo
|
|
|
417
439
|
|
|
418
440
|
export type SyncPluginHooks =
|
|
419
441
|
| 'augmentChunkHash'
|
|
442
|
+
| 'onLog'
|
|
420
443
|
| 'outputOptions'
|
|
421
444
|
| 'renderDynamicImport'
|
|
422
445
|
| 'resolveFileUrl'
|
|
@@ -436,6 +459,7 @@ export type FirstPluginHooks =
|
|
|
436
459
|
export type SequentialPluginHooks =
|
|
437
460
|
| 'augmentChunkHash'
|
|
438
461
|
| 'generateBundle'
|
|
462
|
+
| 'onLog'
|
|
439
463
|
| 'options'
|
|
440
464
|
| 'outputOptions'
|
|
441
465
|
| 'renderChunk'
|
|
@@ -474,12 +498,12 @@ export interface OutputPlugin
|
|
|
474
498
|
version?: string;
|
|
475
499
|
}
|
|
476
500
|
|
|
477
|
-
export interface Plugin extends OutputPlugin, Partial<PluginHooks> {
|
|
501
|
+
export interface Plugin<A = any> extends OutputPlugin, Partial<PluginHooks> {
|
|
478
502
|
// for inter-plugin communication
|
|
479
|
-
api?:
|
|
503
|
+
api?: A;
|
|
480
504
|
}
|
|
481
505
|
|
|
482
|
-
type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
|
506
|
+
export type TreeshakingPreset = 'smallest' | 'safest' | 'recommended';
|
|
483
507
|
|
|
484
508
|
export interface NormalizedTreeshakingOptions {
|
|
485
509
|
annotations: boolean;
|
|
@@ -508,16 +532,32 @@ export type ExternalOption =
|
|
|
508
532
|
| string
|
|
509
533
|
| RegExp
|
|
510
534
|
| ((source: string, importer: string | undefined, isResolved: boolean) => boolean | NullValue);
|
|
511
|
-
|
|
535
|
+
|
|
512
536
|
export type GlobalsOption = { [name: string]: string } | ((name: string) => string);
|
|
537
|
+
|
|
513
538
|
export type InputOption = string | string[] | { [entryAlias: string]: string };
|
|
539
|
+
|
|
514
540
|
export type ManualChunksOption = { [chunkAlias: string]: string[] } | GetManualChunk;
|
|
541
|
+
|
|
542
|
+
export type LogHandlerWithDefault = (
|
|
543
|
+
level: LogLevel,
|
|
544
|
+
log: RollupLog,
|
|
545
|
+
defaultHandler: LogOrStringHandler
|
|
546
|
+
) => void;
|
|
547
|
+
|
|
548
|
+
export type LogOrStringHandler = (level: LogLevel | 'error', log: RollupLog | string) => void;
|
|
549
|
+
|
|
550
|
+
export type LogHandler = (level: LogLevel, log: RollupLog) => void;
|
|
551
|
+
|
|
515
552
|
export type ModuleSideEffectsOption = boolean | 'no-external' | string[] | HasModuleSideEffects;
|
|
553
|
+
|
|
516
554
|
export type PreserveEntrySignaturesOption = false | 'strict' | 'allow-extension' | 'exports-only';
|
|
555
|
+
|
|
517
556
|
export type SourcemapPathTransformOption = (
|
|
518
557
|
relativeSourcePath: string,
|
|
519
558
|
sourcemapPath: string
|
|
520
559
|
) => string;
|
|
560
|
+
|
|
521
561
|
export type SourcemapIgnoreListOption = (
|
|
522
562
|
relativeSourcePath: string,
|
|
523
563
|
sourcemapPath: string
|
|
@@ -536,6 +576,7 @@ export interface InputOptions {
|
|
|
536
576
|
/** @deprecated Use the "inlineDynamicImports" output option instead. */
|
|
537
577
|
inlineDynamicImports?: boolean;
|
|
538
578
|
input?: InputOption;
|
|
579
|
+
logLevel?: LogLevelOption;
|
|
539
580
|
makeAbsoluteExternalsRelative?: boolean | 'ifRelativeSource';
|
|
540
581
|
/** @deprecated Use the "manualChunks" output option instead. */
|
|
541
582
|
manualChunks?: ManualChunksOption;
|
|
@@ -543,6 +584,7 @@ export interface InputOptions {
|
|
|
543
584
|
/** @deprecated Use the "maxParallelFileOps" option instead. */
|
|
544
585
|
maxParallelFileReads?: number;
|
|
545
586
|
moduleContext?: ((id: string) => string | NullValue) | { [id: string]: string };
|
|
587
|
+
onLog?: LogHandlerWithDefault;
|
|
546
588
|
onwarn?: WarningHandlerWithDefault;
|
|
547
589
|
perf?: boolean;
|
|
548
590
|
plugins?: InputPluginOption;
|
|
@@ -571,6 +613,7 @@ export interface NormalizedInputOptions {
|
|
|
571
613
|
/** @deprecated Use the "inlineDynamicImports" output option instead. */
|
|
572
614
|
inlineDynamicImports: boolean | undefined;
|
|
573
615
|
input: string[] | { [entryAlias: string]: string };
|
|
616
|
+
logLevel: LogLevelOption;
|
|
574
617
|
makeAbsoluteExternalsRelative: boolean | 'ifRelativeSource';
|
|
575
618
|
/** @deprecated Use the "manualChunks" output option instead. */
|
|
576
619
|
manualChunks: ManualChunksOption | undefined;
|
|
@@ -578,7 +621,8 @@ export interface NormalizedInputOptions {
|
|
|
578
621
|
/** @deprecated Use the "maxParallelFileOps" option instead. */
|
|
579
622
|
maxParallelFileReads: number;
|
|
580
623
|
moduleContext: (id: string) => string;
|
|
581
|
-
|
|
624
|
+
onLog: LogHandler;
|
|
625
|
+
onwarn: (warning: RollupLog) => void;
|
|
582
626
|
perf: boolean;
|
|
583
627
|
plugins: Plugin[];
|
|
584
628
|
preserveEntrySignatures: PreserveEntrySignaturesOption;
|
|
@@ -701,6 +745,7 @@ export interface OutputOptions {
|
|
|
701
745
|
sourcemapBaseUrl?: string;
|
|
702
746
|
sourcemapExcludeSources?: boolean;
|
|
703
747
|
sourcemapFile?: string;
|
|
748
|
+
sourcemapFileNames?: string | ((chunkInfo: PreRenderedChunk) => string);
|
|
704
749
|
sourcemapIgnoreList?: boolean | SourcemapIgnoreListOption;
|
|
705
750
|
sourcemapPathTransform?: SourcemapPathTransformOption;
|
|
706
751
|
strict?: boolean;
|
|
@@ -756,6 +801,7 @@ export interface NormalizedOutputOptions {
|
|
|
756
801
|
sourcemapBaseUrl: string | undefined;
|
|
757
802
|
sourcemapExcludeSources: boolean;
|
|
758
803
|
sourcemapFile: string | undefined;
|
|
804
|
+
sourcemapFileNames: string | ((chunkInfo: PreRenderedChunk) => string) | undefined;
|
|
759
805
|
sourcemapIgnoreList: SourcemapIgnoreListOption;
|
|
760
806
|
sourcemapPathTransform: SourcemapPathTransformOption | undefined;
|
|
761
807
|
strict: boolean;
|
|
@@ -764,10 +810,9 @@ export interface NormalizedOutputOptions {
|
|
|
764
810
|
}
|
|
765
811
|
|
|
766
812
|
export type WarningHandlerWithDefault = (
|
|
767
|
-
warning:
|
|
768
|
-
defaultHandler:
|
|
813
|
+
warning: RollupLog,
|
|
814
|
+
defaultHandler: LoggingFunction
|
|
769
815
|
) => void;
|
|
770
|
-
export type WarningHandler = (warning: RollupWarning) => void;
|
|
771
816
|
|
|
772
817
|
export interface SerializedTimings {
|
|
773
818
|
[label: string]: [number, number, number];
|
|
@@ -785,7 +830,7 @@ export interface OutputAsset extends PreRenderedAsset {
|
|
|
785
830
|
}
|
|
786
831
|
|
|
787
832
|
export interface RenderedModule {
|
|
788
|
-
code: string | null;
|
|
833
|
+
readonly code: string | null;
|
|
789
834
|
originalLength: number;
|
|
790
835
|
removedExports: string[];
|
|
791
836
|
renderedExports: string[];
|
|
@@ -820,6 +865,8 @@ export interface RenderedChunk extends PreRenderedChunk {
|
|
|
820
865
|
export interface OutputChunk extends RenderedChunk {
|
|
821
866
|
code: string;
|
|
822
867
|
map: SourceMap | null;
|
|
868
|
+
sourcemapFileName: string | null;
|
|
869
|
+
preliminaryFileName: string;
|
|
823
870
|
}
|
|
824
871
|
|
|
825
872
|
export interface SerializablePluginCache {
|