weapp-vite 5.1.8 → 5.2.0-alpha.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/dist/auto-import-components/resolvers.cjs +9 -10
- package/dist/auto-import-components/resolvers.mjs +5 -6
- package/dist/{chunk-25P7FHKE.mjs → chunk-7MAZ2JUY.mjs} +2 -4
- package/dist/chunk-BT7FLFCC.cjs +29 -0
- package/dist/{chunk-HZDUFKUQ.cjs → chunk-DVVMF6ND.cjs} +2 -4
- package/dist/chunk-FUOZYLBR.mjs +29 -0
- package/dist/{chunk-CFXQW5Z6.mjs → chunk-HVMR6H5Z.mjs} +1 -3
- package/dist/chunk-NANSUN4W.mjs +6 -0
- package/dist/{chunk-PGL7ZN2W.cjs → chunk-OS76JPG2.cjs} +4 -6
- package/dist/{chunk-V5JUVPYM.mjs → chunk-Q43Q3Z2L.mjs} +10622 -20717
- package/dist/chunk-U5ERJUOU.cjs +6 -0
- package/dist/{chunk-TBCCIJBL.cjs → chunk-Y6PWETW7.cjs} +24244 -34339
- package/dist/cli.cjs +131 -128
- package/dist/cli.mjs +113 -110
- package/dist/{config-D8_I48lF.d.cts → config-DZ6sLDPC.d.cts} +188 -181
- package/dist/{config-bZQG-PcY.d.ts → config-jn9VVQXs.d.ts} +188 -181
- package/dist/config.cjs +4 -4
- package/dist/config.d.cts +3 -5
- package/dist/config.d.ts +3 -5
- package/dist/config.mjs +3 -3
- package/dist/index.cjs +7 -9
- package/dist/index.d.cts +6 -8
- package/dist/index.d.ts +6 -8
- package/dist/index.mjs +6 -8
- package/dist/json.cjs +3 -3
- package/dist/json.d.cts +3 -5
- package/dist/json.d.ts +3 -5
- package/dist/json.mjs +2 -2
- package/dist/types.cjs +8 -7
- package/dist/types.d.cts +7 -9
- package/dist/types.d.ts +7 -9
- package/dist/types.mjs +2 -1
- package/dist/volar.cjs +2 -2
- package/dist/volar.mjs +1 -1
- package/package.json +15 -17
- package/dist/chunk-AIYQXRJY.mjs +0 -30
- package/dist/chunk-O47EPGAL.cjs +0 -30
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import { InlineConfig, UserConfig as UserConfig$1, UserConfigFnObject, UserConfigExport } from 'vite';
|
|
2
|
-
import
|
|
2
|
+
import { GenerateType, Component, Theme, Sitemap, App, Page, Plugin } from '@weapp-core/schematics';
|
|
3
3
|
import { InputOption, RolldownOutput, RolldownWatcher } from 'rolldown';
|
|
4
4
|
import { Options } from 'tsdown';
|
|
5
5
|
import { WrapPluginOptions } from 'vite-plugin-performance';
|
|
6
6
|
import { PluginOptions } from 'vite-tsconfig-paths';
|
|
7
7
|
import { R as Resolver, a as ResolvedValue } from './types-D7SAXpSN.js';
|
|
8
|
-
import
|
|
8
|
+
import PQueue from 'p-queue';
|
|
9
9
|
import { DetectResult } from 'package-manager-detector';
|
|
10
10
|
import { PackageJson } from 'pkg-types';
|
|
11
|
-
import { LRUCache } from 'lru-cache';
|
|
12
|
-
import * as node_modules_rolldown_dist_shared_binding_aYdpw2Yk_mjs from 'node_modules/rolldown/dist/shared/binding-aYdpw2Yk.mjs';
|
|
13
|
-
import * as node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs from 'node_modules/rolldown/dist/shared/define-config-DMtLQsA0.mjs';
|
|
14
|
-
import PQueue from 'p-queue';
|
|
15
11
|
import { Buffer } from 'node:buffer';
|
|
12
|
+
import { LRUCache } from 'lru-cache';
|
|
16
13
|
|
|
17
14
|
interface Alias {
|
|
18
15
|
find: string | RegExp;
|
|
@@ -74,6 +71,27 @@ type GenerateFilenamesOptions = Partial<{
|
|
|
74
71
|
page: string;
|
|
75
72
|
component: string;
|
|
76
73
|
}>;
|
|
74
|
+
type GenerateFileType = 'js' | 'json' | 'wxml' | 'wxss';
|
|
75
|
+
interface GenerateTemplateContext {
|
|
76
|
+
type: GenerateType;
|
|
77
|
+
fileType: GenerateFileType;
|
|
78
|
+
fileName: string;
|
|
79
|
+
outDir: string;
|
|
80
|
+
extension: string;
|
|
81
|
+
cwd: string;
|
|
82
|
+
defaultCode?: string;
|
|
83
|
+
}
|
|
84
|
+
interface GenerateTemplateFileSource {
|
|
85
|
+
path: string;
|
|
86
|
+
}
|
|
87
|
+
interface GenerateTemplateInlineSource {
|
|
88
|
+
content: string;
|
|
89
|
+
}
|
|
90
|
+
type GenerateTemplateFactory = (context: GenerateTemplateContext) => string | Promise<string> | undefined;
|
|
91
|
+
type GenerateTemplate = string | GenerateTemplateFileSource | GenerateTemplateInlineSource | GenerateTemplateFactory;
|
|
92
|
+
type GenerateTemplateEntry = Partial<Record<GenerateFileType, GenerateTemplate>>;
|
|
93
|
+
type GenerateTemplateScope = GenerateType | 'shared';
|
|
94
|
+
type GenerateTemplatesConfig = Partial<Record<GenerateTemplateScope, GenerateTemplateEntry>>;
|
|
77
95
|
interface GenerateOptions {
|
|
78
96
|
/**
|
|
79
97
|
* 生成文件的扩展名
|
|
@@ -87,6 +105,10 @@ interface GenerateOptions {
|
|
|
87
105
|
* 默认生成文件的名称
|
|
88
106
|
*/
|
|
89
107
|
filenames?: GenerateFilenamesOptions;
|
|
108
|
+
/**
|
|
109
|
+
* 自定义模板
|
|
110
|
+
*/
|
|
111
|
+
templates?: GenerateTemplatesConfig;
|
|
90
112
|
}
|
|
91
113
|
interface CopyOptions {
|
|
92
114
|
include?: CopyGlobs;
|
|
@@ -296,51 +318,12 @@ interface ComponentEntry extends BaseEntry {
|
|
|
296
318
|
}
|
|
297
319
|
type EntryJsonFragment = Omit<BaseEntry, 'path' | 'type'>;
|
|
298
320
|
|
|
299
|
-
declare class AutoImportService {
|
|
300
|
-
private readonly configService;
|
|
301
|
-
private readonly jsonService;
|
|
302
|
-
potentialComponentMap: Map<string, {
|
|
303
|
-
entry: Entry;
|
|
304
|
-
value: ResolvedValue;
|
|
305
|
-
}>;
|
|
306
|
-
constructor(configService: ConfigService, jsonService: JsonService);
|
|
307
|
-
scanPotentialComponentEntries(filePath: string): Promise<void>;
|
|
308
|
-
filter(id: string, _meta?: SubPackageMetaValue): boolean;
|
|
309
|
-
}
|
|
310
|
-
|
|
311
321
|
interface BuildOptions {
|
|
312
322
|
skipNpm?: boolean;
|
|
313
323
|
}
|
|
314
|
-
|
|
315
|
-
readonly configService: ConfigService;
|
|
316
|
-
readonly watcherService: WatcherService;
|
|
317
|
-
readonly npmService: NpmService;
|
|
318
|
-
readonly scanService: ScanService;
|
|
324
|
+
interface BuildService {
|
|
319
325
|
queue: PQueue;
|
|
320
|
-
|
|
321
|
-
checkWorkersOptions(): this is this & {
|
|
322
|
-
scanService: {
|
|
323
|
-
workersDir: string;
|
|
324
|
-
};
|
|
325
|
-
};
|
|
326
|
-
devWorkers(): Promise<void>;
|
|
327
|
-
buildWorkers(): Promise<void>;
|
|
328
|
-
get sharedBuildConfig(): Partial<InlineConfig>;
|
|
329
|
-
private runDev;
|
|
330
|
-
private runProd;
|
|
331
|
-
build(options?: BuildOptions): Promise<{
|
|
332
|
-
listeners: Map<"close" | "change" | "event" | "restart", Array<(...parameters: any[]) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>>>;
|
|
333
|
-
timer: any;
|
|
334
|
-
on(event: "change", listener: (id: string, change: {
|
|
335
|
-
event: "delete" | "update" | "create";
|
|
336
|
-
}) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
337
|
-
on(event: "event", listener: (data: rolldown.RolldownWatcherEvent) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
338
|
-
on(event: "restart" | "close", listener: () => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
339
|
-
off(event: "close" | "change" | "event" | "restart", listener: (...parameters: any[]) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
340
|
-
clear(event: "close" | "change" | "event" | "restart"): void;
|
|
341
|
-
onEvent(event: node_modules_rolldown_dist_shared_binding_aYdpw2Yk_mjs.BindingWatcherEvent): Promise<void>;
|
|
342
|
-
close(): Promise<void>;
|
|
343
|
-
} | RolldownOutput | RolldownOutput[]>;
|
|
326
|
+
build: (options?: BuildOptions) => Promise<RolldownOutput | RolldownOutput[] | RolldownWatcher>;
|
|
344
327
|
}
|
|
345
328
|
|
|
346
329
|
interface OutputExtensions {
|
|
@@ -372,6 +355,7 @@ interface LoadConfigResult {
|
|
|
372
355
|
packageJsonPath: string;
|
|
373
356
|
platform: MpPlatform;
|
|
374
357
|
srcRoot: string;
|
|
358
|
+
currentSubPackageRoot?: string;
|
|
375
359
|
}
|
|
376
360
|
interface PackageInfo {
|
|
377
361
|
name: string;
|
|
@@ -380,147 +364,88 @@ interface PackageInfo {
|
|
|
380
364
|
packageJsonPath: string;
|
|
381
365
|
packageJson: PackageJson;
|
|
382
366
|
}
|
|
383
|
-
|
|
367
|
+
interface ConfigService {
|
|
384
368
|
options: LoadConfigResult;
|
|
385
369
|
outputExtensions: OutputExtensions;
|
|
386
|
-
/**
|
|
387
|
-
* esbuild 定义的环境变量
|
|
388
|
-
*/
|
|
389
370
|
defineEnv: Record<string, any>;
|
|
390
371
|
packageManager: DetectResult;
|
|
391
372
|
packageInfo: PackageInfo;
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
get weappViteConfig(): WeappViteConfig | undefined;
|
|
417
|
-
get packageJson(): PackageJson;
|
|
418
|
-
get projectConfig(): Record<string, any>;
|
|
419
|
-
get srcRoot(): string;
|
|
420
|
-
get pluginRoot(): string | undefined;
|
|
421
|
-
get absolutePluginRoot(): string | undefined;
|
|
422
|
-
get absoluteSrcRoot(): string;
|
|
423
|
-
get mode(): string;
|
|
424
|
-
get aliasEntries(): ResolvedAlias[];
|
|
425
|
-
get platform(): MpPlatform;
|
|
426
|
-
relativeCwd(p: string): string;
|
|
427
|
-
relativeSrcRoot(p: string): string;
|
|
428
|
-
relativeAbsoluteSrcRoot(p: string): string;
|
|
429
|
-
mergeWorkers(...configs: Partial<InlineConfig>[]): InlineConfig;
|
|
430
|
-
merge(subPackageMeta?: SubPackageMetaValue, ...configs: Partial<InlineConfig | undefined>[]): InlineConfig;
|
|
373
|
+
setDefineEnv: (key: string, value: any) => void;
|
|
374
|
+
load: (options?: Partial<LoadConfigOptions>) => Promise<LoadConfigResult>;
|
|
375
|
+
mergeWorkers: (...configs: Partial<InlineConfig>[]) => InlineConfig;
|
|
376
|
+
merge: (subPackageMeta?: SubPackageMetaValue, ...configs: Partial<InlineConfig | undefined>[]) => InlineConfig;
|
|
377
|
+
readonly defineImportMetaEnv: Record<string, any>;
|
|
378
|
+
readonly cwd: string;
|
|
379
|
+
readonly isDev: boolean;
|
|
380
|
+
readonly mpDistRoot: string;
|
|
381
|
+
readonly outDir: string;
|
|
382
|
+
readonly inlineConfig: InlineConfig;
|
|
383
|
+
readonly weappViteConfig: NonNullable<InlineConfig['weapp']>;
|
|
384
|
+
readonly packageJson: PackageJson;
|
|
385
|
+
readonly projectConfig: Record<string, any>;
|
|
386
|
+
readonly srcRoot: string;
|
|
387
|
+
readonly pluginRoot: string | undefined;
|
|
388
|
+
readonly absolutePluginRoot: string | undefined;
|
|
389
|
+
readonly absoluteSrcRoot: string;
|
|
390
|
+
readonly mode: string;
|
|
391
|
+
readonly aliasEntries: ResolvedAlias[];
|
|
392
|
+
readonly platform: MpPlatform;
|
|
393
|
+
relativeCwd: (p: string) => string;
|
|
394
|
+
relativeSrcRoot: (p: string) => string;
|
|
395
|
+
relativeAbsoluteSrcRoot: (p: string) => string;
|
|
396
|
+
readonly currentSubPackageRoot?: string;
|
|
431
397
|
}
|
|
432
398
|
|
|
399
|
+
type HashInput = string | Buffer;
|
|
433
400
|
declare class FileCache<T extends object> {
|
|
434
401
|
cache: LRUCache<string, T>;
|
|
435
402
|
mtimeMap: Map<string, number>;
|
|
403
|
+
signatureMap: Map<string, string>;
|
|
436
404
|
constructor(max?: number);
|
|
437
405
|
get(id: string): T | undefined;
|
|
438
406
|
set(id: string, content: T): LRUCache<string, T, unknown>;
|
|
439
407
|
delete(id: string): boolean;
|
|
440
|
-
isInvalidate(id: string
|
|
408
|
+
isInvalidate(id: string, options?: {
|
|
409
|
+
content?: HashInput;
|
|
410
|
+
}): Promise<boolean>;
|
|
441
411
|
}
|
|
442
412
|
|
|
443
|
-
|
|
444
|
-
|
|
413
|
+
interface JsonService {
|
|
414
|
+
read: (filepath: string) => Promise<any>;
|
|
415
|
+
resolve: (entry: Partial<Pick<Entry, 'json' | 'jsonPath' | 'type'>>) => string | undefined;
|
|
445
416
|
cache: FileCache<any>;
|
|
446
|
-
constructor(configService: ConfigService);
|
|
447
|
-
read(filepath: string): Promise<any>;
|
|
448
|
-
resolve(entry: Partial<Pick<Entry, 'json' | 'jsonPath' | 'type'>>): string | undefined;
|
|
449
417
|
}
|
|
450
418
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
readDependenciesCache(root?: string): Promise<any>;
|
|
461
|
-
checkDependenciesCacheOutdate(root?: string): Promise<boolean>;
|
|
462
|
-
bundleBuild({ entry, name, options, outDir }: {
|
|
419
|
+
interface NpmService {
|
|
420
|
+
getDependenciesCacheFilePath: (key?: string) => string;
|
|
421
|
+
readonly dependenciesCacheHash: string;
|
|
422
|
+
isMiniprogramPackage: (pkg: PackageJson) => boolean;
|
|
423
|
+
shouldSkipBuild: (outDir: string, isOutdated: boolean) => Promise<boolean>;
|
|
424
|
+
writeDependenciesCache: (root?: string) => Promise<void>;
|
|
425
|
+
readDependenciesCache: (root?: string) => Promise<any>;
|
|
426
|
+
checkDependenciesCacheOutdate: (root?: string) => Promise<boolean>;
|
|
427
|
+
bundleBuild: (args: {
|
|
463
428
|
entry: InputOption;
|
|
464
429
|
name: string;
|
|
465
430
|
options?: Options;
|
|
466
431
|
outDir: string;
|
|
467
|
-
})
|
|
468
|
-
copyBuild(
|
|
432
|
+
}) => Promise<void>;
|
|
433
|
+
copyBuild: (args: {
|
|
469
434
|
from: string;
|
|
470
435
|
to: string;
|
|
471
436
|
name: string;
|
|
472
|
-
})
|
|
473
|
-
buildPackage(
|
|
437
|
+
}) => Promise<void>;
|
|
438
|
+
buildPackage: (args: {
|
|
474
439
|
dep: string;
|
|
475
440
|
outDir: string;
|
|
476
441
|
options?: Options;
|
|
477
442
|
isDependenciesCacheOutdate: boolean;
|
|
478
|
-
})
|
|
479
|
-
getPackNpmRelationList()
|
|
443
|
+
}) => Promise<void>;
|
|
444
|
+
getPackNpmRelationList: () => {
|
|
480
445
|
packageJsonPath: string;
|
|
481
446
|
miniprogramNpmDistDir: string;
|
|
482
447
|
}[];
|
|
483
|
-
build(options?: Options)
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
declare class ScanService {
|
|
487
|
-
private readonly configService;
|
|
488
|
-
private readonly jsonService;
|
|
489
|
-
appEntry?: AppEntry;
|
|
490
|
-
subPackageMap: Map<string, SubPackageMetaValue>;
|
|
491
|
-
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
492
|
-
pluginJson?: Plugin;
|
|
493
|
-
constructor(configService: ConfigService, jsonService: JsonService);
|
|
494
|
-
loadAppEntry(): Promise<AppEntry>;
|
|
495
|
-
loadSubPackages(): SubPackageMetaValue[];
|
|
496
|
-
isMainPackageFileName(fileName: string): boolean;
|
|
497
|
-
get workersOptions(): string | {
|
|
498
|
-
[k: string]: unknown;
|
|
499
|
-
path?: string;
|
|
500
|
-
isSubpackage?: boolean;
|
|
501
|
-
} | undefined;
|
|
502
|
-
get workersDir(): string | undefined;
|
|
503
|
-
}
|
|
504
|
-
|
|
505
|
-
declare class WatcherService {
|
|
506
|
-
rollupWatcherMap: Map<string, RolldownWatcher>;
|
|
507
|
-
constructor();
|
|
508
|
-
getRollupWatcher(root?: string): {
|
|
509
|
-
listeners: Map<"close" | "change" | "event" | "restart", Array<(...parameters: any[]) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>>>;
|
|
510
|
-
timer: any;
|
|
511
|
-
on(event: "change", listener: (id: string, change: {
|
|
512
|
-
event: "delete" | "update" | "create";
|
|
513
|
-
}) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
514
|
-
on(event: "event", listener: (data: rolldown.RolldownWatcherEvent) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
515
|
-
on(event: "restart" | "close", listener: () => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
516
|
-
off(event: "close" | "change" | "event" | "restart", listener: (...parameters: any[]) => node_modules_rolldown_dist_shared_define_config_DMtLQsA0_mjs.MaybePromise<void>): /*elided*/ any;
|
|
517
|
-
clear(event: "close" | "change" | "event" | "restart"): void;
|
|
518
|
-
onEvent(event: node_modules_rolldown_dist_shared_binding_aYdpw2Yk_mjs.BindingWatcherEvent): Promise<void>;
|
|
519
|
-
close(): Promise<void>;
|
|
520
|
-
} | undefined;
|
|
521
|
-
setRollupWatcher(watcher: RolldownWatcher, root?: string): void;
|
|
522
|
-
closeAll(): void;
|
|
523
|
-
close(root?: string): void;
|
|
448
|
+
build: (options?: Options) => Promise<void>;
|
|
524
449
|
}
|
|
525
450
|
|
|
526
451
|
interface Token {
|
|
@@ -529,11 +454,14 @@ interface Token {
|
|
|
529
454
|
value: string;
|
|
530
455
|
}
|
|
531
456
|
|
|
457
|
+
interface RemovalRange {
|
|
458
|
+
start: number;
|
|
459
|
+
end: number;
|
|
460
|
+
}
|
|
532
461
|
interface WxmlToken {
|
|
533
462
|
components: ComponentsMap;
|
|
534
463
|
deps: WxmlDep[];
|
|
535
|
-
|
|
536
|
-
removeEndStack: number[];
|
|
464
|
+
removalRanges: RemovalRange[];
|
|
537
465
|
commentTokens: Token[];
|
|
538
466
|
inlineWxsTokens: Token[];
|
|
539
467
|
wxsImportNormalizeTokens: Token[];
|
|
@@ -544,34 +472,113 @@ interface WxmlToken {
|
|
|
544
472
|
declare function scanWxml(wxml: string | Buffer, options?: ScanWxmlOptions): WxmlToken;
|
|
545
473
|
type ScanWxmlResult = ReturnType<typeof scanWxml>;
|
|
546
474
|
|
|
547
|
-
|
|
548
|
-
|
|
475
|
+
interface LocalAutoImportMatch {
|
|
476
|
+
kind: 'local';
|
|
477
|
+
entry: ComponentEntry;
|
|
478
|
+
value: ResolvedValue;
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
interface WatcherInstance {
|
|
482
|
+
close: () => void | Promise<void>;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
interface RuntimeState {
|
|
486
|
+
autoImport: {
|
|
487
|
+
registry: Map<string, LocalAutoImportMatch>;
|
|
488
|
+
matcher?: (input: string) => boolean;
|
|
489
|
+
matcherKey: string;
|
|
490
|
+
};
|
|
491
|
+
build: {
|
|
492
|
+
queue: PQueue;
|
|
493
|
+
npmBuilt: boolean;
|
|
494
|
+
};
|
|
495
|
+
json: {
|
|
496
|
+
cache: FileCache<any>;
|
|
497
|
+
};
|
|
498
|
+
watcher: {
|
|
499
|
+
rollupWatcherMap: Map<string, WatcherInstance>;
|
|
500
|
+
};
|
|
501
|
+
wxml: {
|
|
502
|
+
depsMap: Map<string, Set<string>>;
|
|
503
|
+
tokenMap: Map<string, ScanWxmlResult>;
|
|
504
|
+
componentsMap: Map<string, ComponentsMap>;
|
|
505
|
+
cache: FileCache<ScanWxmlResult>;
|
|
506
|
+
};
|
|
507
|
+
scan: {
|
|
508
|
+
subPackageMap: Map<string, SubPackageMetaValue>;
|
|
509
|
+
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
510
|
+
appEntry?: AppEntry;
|
|
511
|
+
pluginJson?: Plugin;
|
|
512
|
+
isDirty: boolean;
|
|
513
|
+
independentDirtyRoots: Set<string>;
|
|
514
|
+
};
|
|
515
|
+
config: {
|
|
516
|
+
packageInfo: PackageInfo;
|
|
517
|
+
defineEnv: Record<string, any>;
|
|
518
|
+
packageManager: DetectResult;
|
|
519
|
+
options: LoadConfigResult;
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
interface ScanService {
|
|
524
|
+
appEntry?: AppEntry;
|
|
525
|
+
pluginJson?: Plugin;
|
|
526
|
+
subPackageMap: Map<string, SubPackageMetaValue>;
|
|
527
|
+
independentSubPackageMap: Map<string, SubPackageMetaValue>;
|
|
528
|
+
loadAppEntry: () => Promise<AppEntry>;
|
|
529
|
+
loadSubPackages: () => SubPackageMetaValue[];
|
|
530
|
+
isMainPackageFileName: (fileName: string) => boolean;
|
|
531
|
+
readonly workersOptions: App['workers'] | undefined;
|
|
532
|
+
readonly workersDir: string | undefined;
|
|
533
|
+
markDirty: () => void;
|
|
534
|
+
markIndependentDirty: (root: string) => void;
|
|
535
|
+
drainIndependentDirtyRoots: () => string[];
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
interface WatcherService {
|
|
539
|
+
rollupWatcherMap: Map<string, WatcherInstance>;
|
|
540
|
+
getRollupWatcher: (root?: string) => WatcherInstance | undefined;
|
|
541
|
+
setRollupWatcher: (watcher: WatcherInstance, root?: string) => void;
|
|
542
|
+
close: (root?: string) => void;
|
|
543
|
+
closeAll: () => void;
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
interface WxmlService {
|
|
549
547
|
depsMap: Map<string, Set<string>>;
|
|
550
548
|
tokenMap: Map<string, ScanWxmlResult>;
|
|
551
549
|
wxmlComponentsMap: Map<string, ComponentsMap>;
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
setWxmlComponentsMap(absPath: string, components: ComponentsMap): void;
|
|
550
|
+
addDeps: (filepath: string, deps?: string[]) => Promise<void>;
|
|
551
|
+
getAllDeps: () => Set<string>;
|
|
552
|
+
clearAll: () => void;
|
|
553
|
+
analyze: (wxml: string) => ScanWxmlResult;
|
|
554
|
+
scan: (filepath: string) => Promise<ScanWxmlResult | undefined>;
|
|
555
|
+
setWxmlComponentsMap: (absPath: string, components: ComponentsMap) => void;
|
|
559
556
|
}
|
|
560
557
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
558
|
+
interface ResolverAutoImportMatch {
|
|
559
|
+
kind: 'resolver';
|
|
560
|
+
value: ResolvedValue;
|
|
561
|
+
}
|
|
562
|
+
type AutoImportMatch = LocalAutoImportMatch | ResolverAutoImportMatch;
|
|
563
|
+
interface AutoImportService {
|
|
564
|
+
reset: () => void;
|
|
565
|
+
registerPotentialComponent: (filePath: string) => Promise<void>;
|
|
566
|
+
removePotentialComponent: (filePath: string) => void;
|
|
567
|
+
resolve: (componentName: string, importerBaseName?: string) => AutoImportMatch | undefined;
|
|
568
|
+
filter: (id: string, meta?: SubPackageMetaValue) => boolean;
|
|
569
|
+
getRegisteredLocalComponents: () => LocalAutoImportMatch[];
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
interface CompilerContext {
|
|
573
|
+
runtimeState: RuntimeState;
|
|
574
|
+
configService: ConfigService;
|
|
575
|
+
npmService: NpmService;
|
|
576
|
+
wxmlService: WxmlService;
|
|
577
|
+
jsonService: JsonService;
|
|
578
|
+
watcherService: WatcherService;
|
|
579
|
+
autoImportService: AutoImportService;
|
|
580
|
+
buildService: BuildService;
|
|
581
|
+
scanService: ScanService;
|
|
575
582
|
}
|
|
576
583
|
|
|
577
584
|
type ReturnSelf<T> = (config: T) => T;
|
|
@@ -593,4 +600,4 @@ declare function defineConfig(config: Promise<UserConfig$1>): Promise<UserConfig
|
|
|
593
600
|
declare function defineConfig(config: UserConfigFnObject): UserConfigFnObject;
|
|
594
601
|
declare function defineConfig(config: UserConfigExport): UserConfigExport;
|
|
595
602
|
|
|
596
|
-
export { type Alias as A, type BuildNpmPackageMeta as B, CompilerContext as C, type EnhanceWxmlOptions as E, type GenerateExtensionsOptions as G, type HandleWxmlOptions as H, type LoadConfigOptions as L, type MpPlatform as M, type ProjectConfig as P, type ResolvedAlias as R, type SubPackage as S, type UserConfig as U, type WeappViteConfig as W, defineAppJson as a, definePageJson as b, defineComponentJson as c, defineConfig as d, defineSitemapJson as e, defineThemeJson as f, type AliasOptions as g, type GenerateDirsOptions as h, type GenerateFilenamesOptions as i, type
|
|
603
|
+
export { type Alias as A, type BuildNpmPackageMeta as B, type CompilerContext as C, type ScanComponentItem as D, type EnhanceWxmlOptions as E, type ComponentsMap as F, type GenerateExtensionsOptions as G, type HandleWxmlOptions as H, type BaseEntry as I, type Entry as J, type AppEntry as K, type LoadConfigOptions as L, type MpPlatform as M, type PageEntry as N, type ComponentEntry as O, type ProjectConfig as P, type EntryJsonFragment as Q, type ResolvedAlias as R, type SubPackage as S, type UserConfig as U, type WeappViteConfig as W, defineAppJson as a, definePageJson as b, defineComponentJson as c, defineConfig as d, defineSitemapJson as e, defineThemeJson as f, type AliasOptions as g, type GenerateDirsOptions as h, type GenerateFilenamesOptions as i, type GenerateFileType as j, type GenerateTemplateContext as k, type GenerateTemplateFileSource as l, type GenerateTemplateInlineSource as m, type GenerateTemplateFactory as n, type GenerateTemplate as o, type GenerateTemplateEntry as p, type GenerateTemplateScope as q, type GenerateTemplatesConfig as r, type GenerateOptions as s, type CopyOptions as t, type CopyGlobs as u, type AutoImportComponents as v, type ScanWxmlOptions as w, type EnhanceOptions as x, type SubPackageMetaValue as y, type WxmlDep as z };
|
package/dist/config.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkDVVMF6NDcjs = require('./chunk-DVVMF6ND.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
11
|
-
require('./chunk-
|
|
10
|
+
var _chunkBT7FLFCCcjs = require('./chunk-BT7FLFCC.cjs');
|
|
11
|
+
require('./chunk-OS76JPG2.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
|
|
@@ -16,4 +16,4 @@ require('./chunk-PGL7ZN2W.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
exports.defineAppJson =
|
|
19
|
+
exports.defineAppJson = _chunkBT7FLFCCcjs.defineAppJson; exports.defineComponentJson = _chunkBT7FLFCCcjs.defineComponentJson; exports.defineConfig = _chunkDVVMF6NDcjs.defineConfig; exports.definePageJson = _chunkBT7FLFCCcjs.definePageJson; exports.defineSitemapJson = _chunkBT7FLFCCcjs.defineSitemapJson; exports.defineThemeJson = _chunkBT7FLFCCcjs.defineThemeJson;
|
package/dist/config.d.cts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
|
|
2
|
-
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
2
|
+
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DZ6sLDPC.cjs';
|
|
3
3
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
4
4
|
import 'rolldown';
|
|
5
5
|
import 'tsdown';
|
|
6
6
|
import 'vite-plugin-performance';
|
|
7
7
|
import 'vite-tsconfig-paths';
|
|
8
8
|
import './types-D7SAXpSN.cjs';
|
|
9
|
+
import 'p-queue';
|
|
9
10
|
import 'package-manager-detector';
|
|
10
11
|
import 'pkg-types';
|
|
11
|
-
import 'lru-cache';
|
|
12
|
-
import 'node_modules/rolldown/dist/shared/binding-aYdpw2Yk.mjs';
|
|
13
|
-
import 'node_modules/rolldown/dist/shared/define-config-DMtLQsA0.mjs';
|
|
14
|
-
import 'p-queue';
|
|
15
12
|
import 'node:buffer';
|
|
13
|
+
import 'lru-cache';
|
package/dist/config.d.ts
CHANGED
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
|
|
2
|
-
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
2
|
+
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-jn9VVQXs.js';
|
|
3
3
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
4
4
|
import 'rolldown';
|
|
5
5
|
import 'tsdown';
|
|
6
6
|
import 'vite-plugin-performance';
|
|
7
7
|
import 'vite-tsconfig-paths';
|
|
8
8
|
import './types-D7SAXpSN.js';
|
|
9
|
+
import 'p-queue';
|
|
9
10
|
import 'package-manager-detector';
|
|
10
11
|
import 'pkg-types';
|
|
11
|
-
import 'lru-cache';
|
|
12
|
-
import 'node_modules/rolldown/dist/shared/binding-aYdpw2Yk.mjs';
|
|
13
|
-
import 'node_modules/rolldown/dist/shared/define-config-DMtLQsA0.mjs';
|
|
14
|
-
import 'p-queue';
|
|
15
12
|
import 'node:buffer';
|
|
13
|
+
import 'lru-cache';
|
package/dist/config.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defineConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-HVMR6H5Z.mjs";
|
|
4
4
|
import {
|
|
5
5
|
defineAppJson,
|
|
6
6
|
defineComponentJson,
|
|
7
7
|
definePageJson,
|
|
8
8
|
defineSitemapJson,
|
|
9
9
|
defineThemeJson
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-FUOZYLBR.mjs";
|
|
11
|
+
import "./chunk-7MAZ2JUY.mjs";
|
|
12
12
|
export {
|
|
13
13
|
defineAppJson,
|
|
14
14
|
defineComponentJson,
|
package/dist/index.cjs
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
+
var _chunkY6PWETW7cjs = require('./chunk-Y6PWETW7.cjs');
|
|
3
4
|
|
|
4
|
-
var _chunkTBCCIJBLcjs = require('./chunk-TBCCIJBL.cjs');
|
|
5
5
|
|
|
6
|
+
var _chunkDVVMF6NDcjs = require('./chunk-DVVMF6ND.cjs');
|
|
6
7
|
|
|
7
|
-
var _chunkHZDUFKUQcjs = require('./chunk-HZDUFKUQ.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
+
var _chunkBT7FLFCCcjs = require('./chunk-BT7FLFCC.cjs');
|
|
14
|
+
require('./chunk-U5ERJUOU.cjs');
|
|
13
15
|
|
|
14
|
-
var _chunkO47EPGALcjs = require('./chunk-O47EPGAL.cjs');
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
var _chunkPGL7ZN2Wcjs = require('./chunk-PGL7ZN2W.cjs');
|
|
17
|
+
var _chunkOS76JPG2cjs = require('./chunk-OS76JPG2.cjs');
|
|
19
18
|
|
|
20
19
|
// src/index.ts
|
|
21
|
-
|
|
22
|
-
var import_reflect_metadata = _chunkPGL7ZN2Wcjs.__toESM.call(void 0, _chunkTBCCIJBLcjs.require_Reflect.call(void 0, ), 1);
|
|
20
|
+
_chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
|
|
23
21
|
|
|
24
22
|
|
|
25
23
|
|
|
@@ -28,4 +26,4 @@ var import_reflect_metadata = _chunkPGL7ZN2Wcjs.__toESM.call(void 0, _chunkTBCCI
|
|
|
28
26
|
|
|
29
27
|
|
|
30
28
|
|
|
31
|
-
exports.createCompilerContext =
|
|
29
|
+
exports.createCompilerContext = _chunkY6PWETW7cjs.createCompilerContext; exports.defineAppJson = _chunkBT7FLFCCcjs.defineAppJson; exports.defineComponentJson = _chunkBT7FLFCCcjs.defineComponentJson; exports.defineConfig = _chunkDVVMF6NDcjs.defineConfig; exports.definePageJson = _chunkBT7FLFCCcjs.definePageJson; exports.defineSitemapJson = _chunkBT7FLFCCcjs.defineSitemapJson; exports.defineThemeJson = _chunkBT7FLFCCcjs.defineThemeJson;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { L as LoadConfigOptions, C as CompilerContext } from './config-
|
|
2
|
-
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
1
|
+
import { L as LoadConfigOptions, C as CompilerContext } from './config-DZ6sLDPC.cjs';
|
|
2
|
+
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-DZ6sLDPC.cjs';
|
|
3
|
+
export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
|
|
4
|
+
export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFnObject, ViteDevServer } from 'vite';
|
|
3
5
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
4
|
-
export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
|
|
5
|
-
import 'rolldown';
|
|
6
6
|
import 'tsdown';
|
|
7
7
|
import 'vite-plugin-performance';
|
|
8
8
|
import 'vite-tsconfig-paths';
|
|
9
9
|
import './types-D7SAXpSN.cjs';
|
|
10
|
+
import 'p-queue';
|
|
10
11
|
import 'package-manager-detector';
|
|
11
12
|
import 'pkg-types';
|
|
12
|
-
import 'lru-cache';
|
|
13
|
-
import 'node_modules/rolldown/dist/shared/binding-aYdpw2Yk.mjs';
|
|
14
|
-
import 'node_modules/rolldown/dist/shared/define-config-DMtLQsA0.mjs';
|
|
15
|
-
import 'p-queue';
|
|
16
13
|
import 'node:buffer';
|
|
14
|
+
import 'lru-cache';
|
|
17
15
|
|
|
18
16
|
declare function createCompilerContext(options?: Partial<LoadConfigOptions & {
|
|
19
17
|
key?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import { L as LoadConfigOptions, C as CompilerContext } from './config-
|
|
2
|
-
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-
|
|
1
|
+
import { L as LoadConfigOptions, C as CompilerContext } from './config-jn9VVQXs.js';
|
|
2
|
+
export { a as defineAppJson, c as defineComponentJson, d as defineConfig, b as definePageJson, e as defineSitemapJson, f as defineThemeJson } from './config-jn9VVQXs.js';
|
|
3
|
+
export { RolldownBuild, RolldownOptions, RolldownOutput, RolldownPlugin, RolldownPluginOption, WatchOptions as RolldownWatchOptions, RolldownWatcher } from 'rolldown';
|
|
4
|
+
export { ConfigEnv, InlineConfig, Plugin, PluginOption, ResolvedConfig, UserConfig, UserConfigExport, UserConfigFnObject, ViteDevServer } from 'vite';
|
|
3
5
|
export { App, Component, Page, Sitemap, Theme } from '@weapp-core/schematics';
|
|
4
|
-
export { UserConfig, UserConfigExport, UserConfigFnObject } from 'vite';
|
|
5
|
-
import 'rolldown';
|
|
6
6
|
import 'tsdown';
|
|
7
7
|
import 'vite-plugin-performance';
|
|
8
8
|
import 'vite-tsconfig-paths';
|
|
9
9
|
import './types-D7SAXpSN.js';
|
|
10
|
+
import 'p-queue';
|
|
10
11
|
import 'package-manager-detector';
|
|
11
12
|
import 'pkg-types';
|
|
12
|
-
import 'lru-cache';
|
|
13
|
-
import 'node_modules/rolldown/dist/shared/binding-aYdpw2Yk.mjs';
|
|
14
|
-
import 'node_modules/rolldown/dist/shared/define-config-DMtLQsA0.mjs';
|
|
15
|
-
import 'p-queue';
|
|
16
13
|
import 'node:buffer';
|
|
14
|
+
import 'lru-cache';
|
|
17
15
|
|
|
18
16
|
declare function createCompilerContext(options?: Partial<LoadConfigOptions & {
|
|
19
17
|
key?: string;
|