@modern-js/core 1.9.2 → 1.10.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/CHANGELOG.md +15 -0
- package/compiled/ajv-keywords/index.d.ts +1 -0
- package/compiled/ajv-keywords/package.json +1 -1
- package/compiled/better-ajv-errors/index.d.ts +1 -0
- package/compiled/better-ajv-errors/package.json +1 -1
- package/compiled/v8-compile-cache/index.d.ts +1 -0
- package/compiled/v8-compile-cache/package.json +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +19 -28
- package/dist/config/types/index.d.ts +36 -36
- package/dist/index.js +55 -60
- package/dist/initWatcher.js +3 -12
- package/package.json +7 -8
- package/tsconfig.json +1 -0
- package/compiled/ajv-keywords/ajv/dist/ajv.d.ts +0 -16
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/code.d.ts +0 -40
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/index.d.ts +0 -79
- package/compiled/ajv-keywords/ajv/dist/compile/codegen/scope.d.ts +0 -79
- package/compiled/ajv-keywords/ajv/dist/compile/errors.d.ts +0 -13
- package/compiled/ajv-keywords/ajv/dist/compile/index.d.ts +0 -80
- package/compiled/ajv-keywords/ajv/dist/compile/ref_error.d.ts +0 -6
- package/compiled/ajv-keywords/ajv/dist/compile/resolve.d.ts +0 -12
- package/compiled/ajv-keywords/ajv/dist/compile/rules.d.ts +0 -28
- package/compiled/ajv-keywords/ajv/dist/compile/util.d.ts +0 -40
- package/compiled/ajv-keywords/ajv/dist/compile/validate/index.d.ts +0 -42
- package/compiled/ajv-keywords/ajv/dist/compile/validate/subschema.d.ts +0 -47
- package/compiled/ajv-keywords/ajv/dist/core.d.ts +0 -173
- package/compiled/ajv-keywords/ajv/dist/runtime/validation_error.d.ts +0 -7
- package/compiled/ajv-keywords/ajv/dist/types/index.d.ts +0 -183
- package/compiled/ajv-keywords/ajv/dist/types/json-schema.d.ts +0 -124
- package/compiled/ajv-keywords/ajv/dist/types/jtd-schema.d.ts +0 -169
- package/compiled/ajv-keywords/dist/index.d.ts +0 -4
- package/compiled/ajv-keywords/uri-js/dist/es5/uri.all.d.ts +0 -59
- package/compiled/better-ajv-errors/ajv/dist/ajv.d.ts +0 -16
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/code.d.ts +0 -40
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/index.d.ts +0 -79
- package/compiled/better-ajv-errors/ajv/dist/compile/codegen/scope.d.ts +0 -79
- package/compiled/better-ajv-errors/ajv/dist/compile/errors.d.ts +0 -13
- package/compiled/better-ajv-errors/ajv/dist/compile/index.d.ts +0 -80
- package/compiled/better-ajv-errors/ajv/dist/compile/ref_error.d.ts +0 -6
- package/compiled/better-ajv-errors/ajv/dist/compile/resolve.d.ts +0 -12
- package/compiled/better-ajv-errors/ajv/dist/compile/rules.d.ts +0 -28
- package/compiled/better-ajv-errors/ajv/dist/compile/util.d.ts +0 -40
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/index.d.ts +0 -42
- package/compiled/better-ajv-errors/ajv/dist/compile/validate/subschema.d.ts +0 -47
- package/compiled/better-ajv-errors/ajv/dist/core.d.ts +0 -173
- package/compiled/better-ajv-errors/ajv/dist/runtime/validation_error.d.ts +0 -7
- package/compiled/better-ajv-errors/ajv/dist/types/index.d.ts +0 -183
- package/compiled/better-ajv-errors/ajv/dist/types/json-schema.d.ts +0 -124
- package/compiled/better-ajv-errors/ajv/dist/types/jtd-schema.d.ts +0 -169
- package/compiled/better-ajv-errors/typings.d.ts +0 -24
- package/compiled/better-ajv-errors/uri-js/dist/es5/uri.all.d.ts +0 -59
- package/dist/js/modern/cli.js +0 -29
- package/dist/js/modern/config/defaults.js +0 -103
- package/dist/js/modern/config/index.js +0 -115
- package/dist/js/modern/config/mergeConfig.js +0 -22
- package/dist/js/modern/config/schema/deploy.js +0 -17
- package/dist/js/modern/config/schema/index.js +0 -107
- package/dist/js/modern/config/schema/output.js +0 -147
- package/dist/js/modern/config/schema/server.js +0 -170
- package/dist/js/modern/config/schema/source.js +0 -59
- package/dist/js/modern/config/schema/tools.js +0 -36
- package/dist/js/modern/config/types/electron.js +0 -1
- package/dist/js/modern/config/types/index.js +0 -1
- package/dist/js/modern/config/types/less.js +0 -0
- package/dist/js/modern/config/types/sass.js +0 -0
- package/dist/js/modern/config/types/ssg.js +0 -0
- package/dist/js/modern/config/types/test.js +0 -0
- package/dist/js/modern/config/types/unbundle.js +0 -0
- package/dist/js/modern/context.js +0 -63
- package/dist/js/modern/index.js +0 -169
- package/dist/js/modern/initWatcher.js +0 -62
- package/dist/js/modern/loadEnv.js +0 -14
- package/dist/js/modern/loadPlugins.js +0 -122
- package/dist/js/modern/manager.js +0 -28
- package/dist/js/modern/pluginAPI.js +0 -11
- package/dist/js/modern/utils/commander.js +0 -19
- package/dist/js/modern/utils/repeatKeyWarning.js +0 -18
- package/dist/js/node/cli.js +0 -35
- package/dist/js/node/config/defaults.js +0 -110
- package/dist/js/node/config/index.js +0 -182
- package/dist/js/node/config/mergeConfig.js +0 -32
- package/dist/js/node/config/schema/deploy.js +0 -26
- package/dist/js/node/config/schema/index.js +0 -127
- package/dist/js/node/config/schema/output.js +0 -156
- package/dist/js/node/config/schema/server.js +0 -179
- package/dist/js/node/config/schema/source.js +0 -68
- package/dist/js/node/config/schema/tools.js +0 -43
- package/dist/js/node/config/types/electron.js +0 -5
- package/dist/js/node/config/types/index.js +0 -5
- package/dist/js/node/config/types/less.js +0 -0
- package/dist/js/node/config/types/sass.js +0 -0
- package/dist/js/node/config/types/ssg.js +0 -0
- package/dist/js/node/config/types/test.js +0 -0
- package/dist/js/node/config/types/unbundle.js +0 -0
- package/dist/js/node/context.js +0 -93
- package/dist/js/node/index.js +0 -329
- package/dist/js/node/initWatcher.js +0 -82
- package/dist/js/node/loadEnv.js +0 -30
- package/dist/js/node/loadPlugins.js +0 -134
- package/dist/js/node/manager.js +0 -45
- package/dist/js/node/pluginAPI.js +0 -54
- package/dist/js/node/utils/commander.js +0 -32
- package/dist/js/node/utils/repeatKeyWarning.js +0 -31
- package/dist/types/cli.d.ts +0 -1
- package/dist/types/config/defaults.d.ts +0 -28
- package/dist/types/config/index.d.ts +0 -12
- package/dist/types/config/mergeConfig.d.ts +0 -31
- package/dist/types/config/schema/deploy.d.ts +0 -16
- package/dist/types/config/schema/index.d.ts +0 -466
- package/dist/types/config/schema/output.d.ts +0 -146
- package/dist/types/config/schema/server.d.ts +0 -182
- package/dist/types/config/schema/source.d.ts +0 -58
- package/dist/types/config/schema/tools.d.ts +0 -36
- package/dist/types/config/types/electron.d.ts +0 -13
- package/dist/types/config/types/index.d.ts +0 -252
- package/dist/types/config/types/less.d.ts +0 -10
- package/dist/types/config/types/sass.d.ts +0 -8
- package/dist/types/config/types/ssg.d.ts +0 -13
- package/dist/types/config/types/test.d.ts +0 -15
- package/dist/types/config/types/unbundle.d.ts +0 -28
- package/dist/types/context.d.ts +0 -47
- package/dist/types/index.d.ts +0 -64
- package/dist/types/initWatcher.d.ts +0 -3
- package/dist/types/loadEnv.d.ts +0 -1
- package/dist/types/loadPlugins.d.ts +0 -44
- package/dist/types/manager.d.ts +0 -75
- package/dist/types/pluginAPI.d.ts +0 -13
- package/dist/types/utils/commander.d.ts +0 -4
- package/dist/types/utils/repeatKeyWarning.d.ts +0 -3
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import * as URI from '../../../uri-js';
|
|
2
|
-
import type { CodeGen, Code, Name, ScopeValueSets, ValueScopeName } from '../compile/codegen';
|
|
3
|
-
import type { SchemaEnv, SchemaCxt, SchemaObjCxt } from '../compile';
|
|
4
|
-
import type { JSONType } from '../compile/rules';
|
|
5
|
-
import type { KeywordCxt } from '../compile/validate';
|
|
6
|
-
import type Ajv from '../core';
|
|
7
|
-
interface _SchemaObject {
|
|
8
|
-
id?: string;
|
|
9
|
-
$id?: string;
|
|
10
|
-
$schema?: string;
|
|
11
|
-
[x: string]: any;
|
|
12
|
-
}
|
|
13
|
-
export interface SchemaObject extends _SchemaObject {
|
|
14
|
-
id?: string;
|
|
15
|
-
$id?: string;
|
|
16
|
-
$schema?: string;
|
|
17
|
-
$async?: false;
|
|
18
|
-
[x: string]: any;
|
|
19
|
-
}
|
|
20
|
-
export interface AsyncSchema extends _SchemaObject {
|
|
21
|
-
$async: true;
|
|
22
|
-
}
|
|
23
|
-
export declare type AnySchemaObject = SchemaObject | AsyncSchema;
|
|
24
|
-
export declare type Schema = SchemaObject | boolean;
|
|
25
|
-
export declare type AnySchema = Schema | AsyncSchema;
|
|
26
|
-
export declare type SchemaMap = {
|
|
27
|
-
[Key in string]?: AnySchema;
|
|
28
|
-
};
|
|
29
|
-
export interface SourceCode {
|
|
30
|
-
validateName: ValueScopeName;
|
|
31
|
-
validateCode: string;
|
|
32
|
-
scopeValues: ScopeValueSets;
|
|
33
|
-
evaluated?: Code;
|
|
34
|
-
}
|
|
35
|
-
export interface DataValidationCxt<T extends string | number = string | number> {
|
|
36
|
-
instancePath: string;
|
|
37
|
-
parentData: {
|
|
38
|
-
[K in T]: any;
|
|
39
|
-
};
|
|
40
|
-
parentDataProperty: T;
|
|
41
|
-
rootData: Record<string, any> | any[];
|
|
42
|
-
dynamicAnchors: {
|
|
43
|
-
[Ref in string]?: ValidateFunction;
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
export interface ValidateFunction<T = unknown> {
|
|
47
|
-
(this: Ajv | any, data: any, dataCxt?: DataValidationCxt): data is T;
|
|
48
|
-
errors?: null | ErrorObject[];
|
|
49
|
-
evaluated?: Evaluated;
|
|
50
|
-
schema: AnySchema;
|
|
51
|
-
schemaEnv: SchemaEnv;
|
|
52
|
-
source?: SourceCode;
|
|
53
|
-
}
|
|
54
|
-
export interface JTDParser<T = unknown> {
|
|
55
|
-
(json: string): T | undefined;
|
|
56
|
-
message?: string;
|
|
57
|
-
position?: number;
|
|
58
|
-
}
|
|
59
|
-
export declare type EvaluatedProperties = {
|
|
60
|
-
[K in string]?: true;
|
|
61
|
-
} | true;
|
|
62
|
-
export declare type EvaluatedItems = number | true;
|
|
63
|
-
export interface Evaluated {
|
|
64
|
-
props?: EvaluatedProperties;
|
|
65
|
-
items?: EvaluatedItems;
|
|
66
|
-
dynamicProps: boolean;
|
|
67
|
-
dynamicItems: boolean;
|
|
68
|
-
}
|
|
69
|
-
export interface AsyncValidateFunction<T = unknown> extends ValidateFunction<T> {
|
|
70
|
-
(...args: Parameters<ValidateFunction<T>>): Promise<T>;
|
|
71
|
-
$async: true;
|
|
72
|
-
}
|
|
73
|
-
export declare type AnyValidateFunction<T = any> = ValidateFunction<T> | AsyncValidateFunction<T>;
|
|
74
|
-
export interface ErrorObject<K extends string = string, P = Record<string, any>, S = unknown> {
|
|
75
|
-
keyword: K;
|
|
76
|
-
instancePath: string;
|
|
77
|
-
schemaPath: string;
|
|
78
|
-
params: P;
|
|
79
|
-
propertyName?: string;
|
|
80
|
-
message?: string;
|
|
81
|
-
schema?: S;
|
|
82
|
-
parentSchema?: AnySchemaObject;
|
|
83
|
-
data?: unknown;
|
|
84
|
-
}
|
|
85
|
-
export declare type ErrorNoParams<K extends string, S = unknown> = ErrorObject<K, Record<string, never>, S>;
|
|
86
|
-
interface _KeywordDef {
|
|
87
|
-
keyword: string | string[];
|
|
88
|
-
type?: JSONType | JSONType[];
|
|
89
|
-
schemaType?: JSONType | JSONType[];
|
|
90
|
-
allowUndefined?: boolean;
|
|
91
|
-
$data?: boolean;
|
|
92
|
-
implements?: string[];
|
|
93
|
-
before?: string;
|
|
94
|
-
post?: boolean;
|
|
95
|
-
metaSchema?: AnySchemaObject;
|
|
96
|
-
validateSchema?: AnyValidateFunction;
|
|
97
|
-
dependencies?: string[];
|
|
98
|
-
error?: KeywordErrorDefinition;
|
|
99
|
-
$dataError?: KeywordErrorDefinition;
|
|
100
|
-
}
|
|
101
|
-
export interface CodeKeywordDefinition extends _KeywordDef {
|
|
102
|
-
code: (cxt: KeywordCxt, ruleType?: string) => void;
|
|
103
|
-
trackErrors?: boolean;
|
|
104
|
-
}
|
|
105
|
-
export declare type MacroKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaCxt) => AnySchema;
|
|
106
|
-
export declare type CompileKeywordFunc = (schema: any, parentSchema: AnySchemaObject, it: SchemaObjCxt) => DataValidateFunction;
|
|
107
|
-
export interface DataValidateFunction {
|
|
108
|
-
(...args: Parameters<ValidateFunction>): boolean | Promise<any>;
|
|
109
|
-
errors?: Partial<ErrorObject>[];
|
|
110
|
-
}
|
|
111
|
-
export interface SchemaValidateFunction {
|
|
112
|
-
(schema: any, data: any, parentSchema?: AnySchemaObject, dataCxt?: DataValidationCxt): boolean | Promise<any>;
|
|
113
|
-
errors?: Partial<ErrorObject>[];
|
|
114
|
-
}
|
|
115
|
-
export interface FuncKeywordDefinition extends _KeywordDef {
|
|
116
|
-
validate?: SchemaValidateFunction | DataValidateFunction;
|
|
117
|
-
compile?: CompileKeywordFunc;
|
|
118
|
-
schema?: boolean;
|
|
119
|
-
modifying?: boolean;
|
|
120
|
-
async?: boolean;
|
|
121
|
-
valid?: boolean;
|
|
122
|
-
errors?: boolean | "full";
|
|
123
|
-
}
|
|
124
|
-
export interface MacroKeywordDefinition extends FuncKeywordDefinition {
|
|
125
|
-
macro: MacroKeywordFunc;
|
|
126
|
-
}
|
|
127
|
-
export declare type KeywordDefinition = CodeKeywordDefinition | FuncKeywordDefinition | MacroKeywordDefinition;
|
|
128
|
-
export declare type AddedKeywordDefinition = KeywordDefinition & {
|
|
129
|
-
type: JSONType[];
|
|
130
|
-
schemaType: JSONType[];
|
|
131
|
-
};
|
|
132
|
-
export interface KeywordErrorDefinition {
|
|
133
|
-
message: string | Code | ((cxt: KeywordErrorCxt) => string | Code);
|
|
134
|
-
params?: Code | ((cxt: KeywordErrorCxt) => Code);
|
|
135
|
-
}
|
|
136
|
-
export declare type Vocabulary = (KeywordDefinition | string)[];
|
|
137
|
-
export interface KeywordErrorCxt {
|
|
138
|
-
gen: CodeGen;
|
|
139
|
-
keyword: string;
|
|
140
|
-
data: Name;
|
|
141
|
-
$data?: string | false;
|
|
142
|
-
schema: any;
|
|
143
|
-
parentSchema?: AnySchemaObject;
|
|
144
|
-
schemaCode: Code | number | boolean;
|
|
145
|
-
schemaValue: Code | number | boolean;
|
|
146
|
-
schemaType?: JSONType[];
|
|
147
|
-
errsCount?: Name;
|
|
148
|
-
params: KeywordCxtParams;
|
|
149
|
-
it: SchemaCxt;
|
|
150
|
-
}
|
|
151
|
-
export declare type KeywordCxtParams = {
|
|
152
|
-
[P in string]?: Code | string | number;
|
|
153
|
-
};
|
|
154
|
-
export declare type FormatValidator<T extends string | number> = (data: T) => boolean;
|
|
155
|
-
export declare type FormatCompare<T extends string | number> = (data1: T, data2: T) => number | undefined;
|
|
156
|
-
export declare type AsyncFormatValidator<T extends string | number> = (data: T) => Promise<boolean>;
|
|
157
|
-
export interface FormatDefinition<T extends string | number> {
|
|
158
|
-
type?: T extends string ? "string" | undefined : "number";
|
|
159
|
-
validate: FormatValidator<T> | (T extends string ? string | RegExp : never);
|
|
160
|
-
async?: false | undefined;
|
|
161
|
-
compare?: FormatCompare<T>;
|
|
162
|
-
}
|
|
163
|
-
export interface AsyncFormatDefinition<T extends string | number> {
|
|
164
|
-
type?: T extends string ? "string" | undefined : "number";
|
|
165
|
-
validate: AsyncFormatValidator<T>;
|
|
166
|
-
async: true;
|
|
167
|
-
compare?: FormatCompare<T>;
|
|
168
|
-
}
|
|
169
|
-
export declare type AddedFormat = true | RegExp | FormatValidator<string> | FormatDefinition<string> | FormatDefinition<number> | AsyncFormatDefinition<string> | AsyncFormatDefinition<number>;
|
|
170
|
-
export declare type Format = AddedFormat | string;
|
|
171
|
-
export interface RegExpEngine {
|
|
172
|
-
(pattern: string, u: string): RegExpLike;
|
|
173
|
-
code: string;
|
|
174
|
-
}
|
|
175
|
-
export interface RegExpLike {
|
|
176
|
-
test: (s: string) => boolean;
|
|
177
|
-
}
|
|
178
|
-
export interface UriResolver {
|
|
179
|
-
parse(uri: string): URI.URIComponents;
|
|
180
|
-
resolve(base: string, path: string): string;
|
|
181
|
-
serialize(component: URI.URIComponents): string;
|
|
182
|
-
}
|
|
183
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
declare type StrictNullChecksWrapper<Name extends string, Type> = undefined extends null ? `strictNullChecks must be true in tsconfig to use ${Name}` : Type;
|
|
2
|
-
declare type UnionToIntersection<U> = (U extends any ? (_: U) => void : never) extends (_: infer I) => void ? I : never;
|
|
3
|
-
export declare type SomeJSONSchema = UncheckedJSONSchemaType<Known, true>;
|
|
4
|
-
declare type UncheckedPartialSchema<T> = Partial<UncheckedJSONSchemaType<T, true>>;
|
|
5
|
-
export declare type PartialSchema<T> = StrictNullChecksWrapper<"PartialSchema", UncheckedPartialSchema<T>>;
|
|
6
|
-
declare type JSONType<T extends string, IsPartial extends boolean> = IsPartial extends true ? T | undefined : T;
|
|
7
|
-
interface NumberKeywords {
|
|
8
|
-
minimum?: number;
|
|
9
|
-
maximum?: number;
|
|
10
|
-
exclusiveMinimum?: number;
|
|
11
|
-
exclusiveMaximum?: number;
|
|
12
|
-
multipleOf?: number;
|
|
13
|
-
format?: string;
|
|
14
|
-
}
|
|
15
|
-
interface StringKeywords {
|
|
16
|
-
minLength?: number;
|
|
17
|
-
maxLength?: number;
|
|
18
|
-
pattern?: string;
|
|
19
|
-
format?: string;
|
|
20
|
-
}
|
|
21
|
-
declare type UncheckedJSONSchemaType<T, IsPartial extends boolean> = (// these two unions allow arbitrary unions of types
|
|
22
|
-
{
|
|
23
|
-
anyOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
|
24
|
-
} | {
|
|
25
|
-
oneOf: readonly UncheckedJSONSchemaType<T, IsPartial>[];
|
|
26
|
-
} | ({
|
|
27
|
-
type: readonly (T extends number ? JSONType<"number" | "integer", IsPartial> : T extends string ? JSONType<"string", IsPartial> : T extends boolean ? JSONType<"boolean", IsPartial> : never)[];
|
|
28
|
-
} & UnionToIntersection<T extends number ? NumberKeywords : T extends string ? StringKeywords : T extends boolean ? {} : never>) | ((T extends number ? {
|
|
29
|
-
type: JSONType<"number" | "integer", IsPartial>;
|
|
30
|
-
} & NumberKeywords : T extends string ? {
|
|
31
|
-
type: JSONType<"string", IsPartial>;
|
|
32
|
-
} & StringKeywords : T extends boolean ? {
|
|
33
|
-
type: JSONType<"boolean", IsPartial>;
|
|
34
|
-
} : T extends readonly [any, ...any[]] ? {
|
|
35
|
-
type: JSONType<"array", IsPartial>;
|
|
36
|
-
items: {
|
|
37
|
-
readonly [K in keyof T]-?: UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>;
|
|
38
|
-
} & {
|
|
39
|
-
length: T["length"];
|
|
40
|
-
};
|
|
41
|
-
minItems: T["length"];
|
|
42
|
-
} & ({
|
|
43
|
-
maxItems: T["length"];
|
|
44
|
-
} | {
|
|
45
|
-
additionalItems: false;
|
|
46
|
-
}) : T extends readonly any[] ? {
|
|
47
|
-
type: JSONType<"array", IsPartial>;
|
|
48
|
-
items: UncheckedJSONSchemaType<T[0], false>;
|
|
49
|
-
contains?: UncheckedPartialSchema<T[0]>;
|
|
50
|
-
minItems?: number;
|
|
51
|
-
maxItems?: number;
|
|
52
|
-
minContains?: number;
|
|
53
|
-
maxContains?: number;
|
|
54
|
-
uniqueItems?: true;
|
|
55
|
-
additionalItems?: never;
|
|
56
|
-
} : T extends Record<string, any> ? {
|
|
57
|
-
type: JSONType<"object", IsPartial>;
|
|
58
|
-
additionalProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
|
|
59
|
-
unevaluatedProperties?: boolean | UncheckedJSONSchemaType<T[string], false>;
|
|
60
|
-
properties?: IsPartial extends true ? Partial<UncheckedPropertiesSchema<T>> : UncheckedPropertiesSchema<T>;
|
|
61
|
-
patternProperties?: Record<string, UncheckedJSONSchemaType<T[string], false>>;
|
|
62
|
-
propertyNames?: Omit<UncheckedJSONSchemaType<string, false>, "type"> & {
|
|
63
|
-
type?: "string";
|
|
64
|
-
};
|
|
65
|
-
dependencies?: {
|
|
66
|
-
[K in keyof T]?: Readonly<(keyof T)[]> | UncheckedPartialSchema<T>;
|
|
67
|
-
};
|
|
68
|
-
dependentRequired?: {
|
|
69
|
-
[K in keyof T]?: Readonly<(keyof T)[]>;
|
|
70
|
-
};
|
|
71
|
-
dependentSchemas?: {
|
|
72
|
-
[K in keyof T]?: UncheckedPartialSchema<T>;
|
|
73
|
-
};
|
|
74
|
-
minProperties?: number;
|
|
75
|
-
maxProperties?: number;
|
|
76
|
-
} & (IsPartial extends true ? {
|
|
77
|
-
required: Readonly<(keyof T)[]>;
|
|
78
|
-
} : [UncheckedRequiredMembers<T>] extends [never] ? {
|
|
79
|
-
required?: Readonly<UncheckedRequiredMembers<T>[]>;
|
|
80
|
-
} : {
|
|
81
|
-
required: Readonly<UncheckedRequiredMembers<T>[]>;
|
|
82
|
-
}) : T extends null ? {
|
|
83
|
-
type: JSONType<"null", IsPartial>;
|
|
84
|
-
nullable: true;
|
|
85
|
-
} : never) & {
|
|
86
|
-
allOf?: Readonly<UncheckedPartialSchema<T>[]>;
|
|
87
|
-
anyOf?: Readonly<UncheckedPartialSchema<T>[]>;
|
|
88
|
-
oneOf?: Readonly<UncheckedPartialSchema<T>[]>;
|
|
89
|
-
if?: UncheckedPartialSchema<T>;
|
|
90
|
-
then?: UncheckedPartialSchema<T>;
|
|
91
|
-
else?: UncheckedPartialSchema<T>;
|
|
92
|
-
not?: UncheckedPartialSchema<T>;
|
|
93
|
-
})) & {
|
|
94
|
-
[keyword: string]: any;
|
|
95
|
-
$id?: string;
|
|
96
|
-
$ref?: string;
|
|
97
|
-
$defs?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
|
98
|
-
definitions?: Record<string, UncheckedJSONSchemaType<Known, true>>;
|
|
99
|
-
};
|
|
100
|
-
export declare type JSONSchemaType<T> = StrictNullChecksWrapper<"JSONSchemaType", UncheckedJSONSchemaType<T, false>>;
|
|
101
|
-
declare type Known = {
|
|
102
|
-
[key: string]: Known;
|
|
103
|
-
} | [Known, ...Known[]] | Known[] | number | string | boolean | null;
|
|
104
|
-
declare type UncheckedPropertiesSchema<T> = {
|
|
105
|
-
[K in keyof T]-?: (UncheckedJSONSchemaType<T[K], false> & Nullable<T[K]>) | {
|
|
106
|
-
$ref: string;
|
|
107
|
-
};
|
|
108
|
-
};
|
|
109
|
-
export declare type PropertiesSchema<T> = StrictNullChecksWrapper<"PropertiesSchema", UncheckedPropertiesSchema<T>>;
|
|
110
|
-
declare type UncheckedRequiredMembers<T> = {
|
|
111
|
-
[K in keyof T]-?: undefined extends T[K] ? never : K;
|
|
112
|
-
}[keyof T];
|
|
113
|
-
export declare type RequiredMembers<T> = StrictNullChecksWrapper<"RequiredMembers", UncheckedRequiredMembers<T>>;
|
|
114
|
-
declare type Nullable<T> = undefined extends T ? {
|
|
115
|
-
nullable: true;
|
|
116
|
-
const?: null;
|
|
117
|
-
enum?: Readonly<(T | null)[]>;
|
|
118
|
-
default?: T | null;
|
|
119
|
-
} : {
|
|
120
|
-
const?: T;
|
|
121
|
-
enum?: Readonly<T[]>;
|
|
122
|
-
default?: T;
|
|
123
|
-
};
|
|
124
|
-
export {};
|
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/** numeric strings */
|
|
2
|
-
declare type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32";
|
|
3
|
-
/** string strings */
|
|
4
|
-
declare type StringType = "string" | "timestamp";
|
|
5
|
-
/** Generic JTD Schema without inference of the represented type */
|
|
6
|
-
export declare type SomeJTDSchemaType = (// ref
|
|
7
|
-
{
|
|
8
|
-
ref: string;
|
|
9
|
-
} | {
|
|
10
|
-
type: NumberType | StringType | "boolean";
|
|
11
|
-
} | {
|
|
12
|
-
enum: string[];
|
|
13
|
-
} | {
|
|
14
|
-
elements: SomeJTDSchemaType;
|
|
15
|
-
} | {
|
|
16
|
-
values: SomeJTDSchemaType;
|
|
17
|
-
} | {
|
|
18
|
-
properties: Record<string, SomeJTDSchemaType>;
|
|
19
|
-
optionalProperties?: Record<string, SomeJTDSchemaType>;
|
|
20
|
-
additionalProperties?: boolean;
|
|
21
|
-
} | {
|
|
22
|
-
properties?: Record<string, SomeJTDSchemaType>;
|
|
23
|
-
optionalProperties: Record<string, SomeJTDSchemaType>;
|
|
24
|
-
additionalProperties?: boolean;
|
|
25
|
-
} | {
|
|
26
|
-
discriminator: string;
|
|
27
|
-
mapping: Record<string, SomeJTDSchemaType>;
|
|
28
|
-
} | {}) & {
|
|
29
|
-
nullable?: boolean;
|
|
30
|
-
metadata?: Record<string, unknown>;
|
|
31
|
-
definitions?: Record<string, SomeJTDSchemaType>;
|
|
32
|
-
};
|
|
33
|
-
/** required keys of an object, not undefined */
|
|
34
|
-
declare type RequiredKeys<T> = {
|
|
35
|
-
[K in keyof T]-?: undefined extends T[K] ? never : K;
|
|
36
|
-
}[keyof T];
|
|
37
|
-
/** optional or undifined-able keys of an object */
|
|
38
|
-
declare type OptionalKeys<T> = {
|
|
39
|
-
[K in keyof T]-?: undefined extends T[K] ? K : never;
|
|
40
|
-
}[keyof T];
|
|
41
|
-
/** type is true if T is a union type */
|
|
42
|
-
declare type IsUnion_<T, U extends T = T> = false extends (T extends unknown ? ([U] extends [T] ? false : true) : never) ? false : true;
|
|
43
|
-
declare type IsUnion<T> = IsUnion_<T>;
|
|
44
|
-
/** type is true if T is identically E */
|
|
45
|
-
declare type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false;
|
|
46
|
-
/** type is true if T or null is identically E or null*/
|
|
47
|
-
declare type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>;
|
|
48
|
-
/** gets only the string literals of a type or null if a type isn't a string literal */
|
|
49
|
-
declare type EnumString<T> = [T] extends [never] ? null : T extends string ? string extends T ? null : T : null;
|
|
50
|
-
/** true if type is a union of string literals */
|
|
51
|
-
declare type IsEnum<T> = null extends EnumString<Exclude<T, null>> ? false : true;
|
|
52
|
-
/** true only if all types are array types (not tuples) */
|
|
53
|
-
declare type IsElements<T> = false extends IsUnion<T> ? [T] extends [readonly unknown[]] ? undefined extends T[0.5] ? false : true : false : false;
|
|
54
|
-
/** true if the the type is a values type */
|
|
55
|
-
declare type IsValues<T> = false extends IsUnion<Exclude<T, null>> ? TypeEquality<keyof Exclude<T, null>, string> : false;
|
|
56
|
-
/** true if type is a proeprties type and Union is false, or type is a discriminator type and Union is true */
|
|
57
|
-
declare type IsRecord<T, Union extends boolean> = Union extends IsUnion<Exclude<T, null>> ? null extends EnumString<keyof Exclude<T, null>> ? false : true : false;
|
|
58
|
-
/** actual schema */
|
|
59
|
-
export declare type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (// refs - where null wasn't specified, must match exactly
|
|
60
|
-
(null extends EnumString<keyof D> ? never : ({
|
|
61
|
-
[K in keyof D]: [T] extends [D[K]] ? {
|
|
62
|
-
ref: K;
|
|
63
|
-
} : never;
|
|
64
|
-
}[keyof D] & {
|
|
65
|
-
nullable?: false;
|
|
66
|
-
}) | (null extends T ? {
|
|
67
|
-
[K in keyof D]: [Exclude<T, null>] extends [Exclude<D[K], null>] ? {
|
|
68
|
-
ref: K;
|
|
69
|
-
} : never;
|
|
70
|
-
}[keyof D] & {
|
|
71
|
-
nullable: true;
|
|
72
|
-
} : never)) | (unknown extends T ? {
|
|
73
|
-
nullable?: boolean;
|
|
74
|
-
} : never) | ((true extends NullTypeEquality<T, number> ? {
|
|
75
|
-
type: NumberType;
|
|
76
|
-
} : true extends NullTypeEquality<T, boolean> ? {
|
|
77
|
-
type: "boolean";
|
|
78
|
-
} : true extends NullTypeEquality<T, string> ? {
|
|
79
|
-
type: StringType;
|
|
80
|
-
} : true extends NullTypeEquality<T, Date> ? {
|
|
81
|
-
type: "timestamp";
|
|
82
|
-
} : true extends IsEnum<T> ? {
|
|
83
|
-
enum: EnumString<Exclude<T, null>>[];
|
|
84
|
-
} : true extends IsElements<Exclude<T, null>> ? T extends readonly (infer E)[] ? {
|
|
85
|
-
elements: JTDSchemaType<E, D>;
|
|
86
|
-
} : never : true extends IsValues<T> ? T extends Record<string, infer V> ? {
|
|
87
|
-
values: JTDSchemaType<V, D>;
|
|
88
|
-
} : never : true extends IsRecord<T, false> ? ([RequiredKeys<Exclude<T, null>>] extends [never] ? {
|
|
89
|
-
properties?: Record<string, never>;
|
|
90
|
-
} : {
|
|
91
|
-
properties: {
|
|
92
|
-
[K in RequiredKeys<T>]: JTDSchemaType<T[K], D>;
|
|
93
|
-
};
|
|
94
|
-
}) & ([OptionalKeys<Exclude<T, null>>] extends [never] ? {
|
|
95
|
-
optionalProperties?: Record<string, never>;
|
|
96
|
-
} : {
|
|
97
|
-
optionalProperties: {
|
|
98
|
-
[K in OptionalKeys<T>]: JTDSchemaType<Exclude<T[K], undefined>, D>;
|
|
99
|
-
};
|
|
100
|
-
}) & {
|
|
101
|
-
additionalProperties?: boolean;
|
|
102
|
-
} : true extends IsRecord<T, true> ? {
|
|
103
|
-
[K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string ? {
|
|
104
|
-
discriminator: K;
|
|
105
|
-
mapping: {
|
|
106
|
-
[M in Exclude<T, null>[K]]: JTDSchemaType<Omit<T extends {
|
|
107
|
-
[C in K]: M;
|
|
108
|
-
} ? T : never, K>, D>;
|
|
109
|
-
};
|
|
110
|
-
} : never;
|
|
111
|
-
}[keyof Exclude<T, null>] : never) & (null extends T ? {
|
|
112
|
-
nullable: true;
|
|
113
|
-
} : {
|
|
114
|
-
nullable?: false;
|
|
115
|
-
}))) & {
|
|
116
|
-
metadata?: Record<string, unknown>;
|
|
117
|
-
definitions?: {
|
|
118
|
-
[K in keyof D]: JTDSchemaType<D[K], D>;
|
|
119
|
-
};
|
|
120
|
-
};
|
|
121
|
-
declare type JTDDataDef<S, D extends Record<string, unknown>> = // ref
|
|
122
|
-
(S extends {
|
|
123
|
-
ref: string;
|
|
124
|
-
} ? D extends {
|
|
125
|
-
[K in S["ref"]]: infer V;
|
|
126
|
-
} ? JTDDataDef<V, D> : never : S extends {
|
|
127
|
-
type: NumberType;
|
|
128
|
-
} ? number : S extends {
|
|
129
|
-
type: "boolean";
|
|
130
|
-
} ? boolean : S extends {
|
|
131
|
-
type: "string";
|
|
132
|
-
} ? string : S extends {
|
|
133
|
-
type: "timestamp";
|
|
134
|
-
} ? string | Date : S extends {
|
|
135
|
-
enum: readonly (infer E)[];
|
|
136
|
-
} ? string extends E ? never : [E] extends [string] ? E : never : S extends {
|
|
137
|
-
elements: infer E;
|
|
138
|
-
} ? JTDDataDef<E, D>[] : S extends {
|
|
139
|
-
properties: Record<string, unknown>;
|
|
140
|
-
optionalProperties?: Record<string, unknown>;
|
|
141
|
-
additionalProperties?: boolean;
|
|
142
|
-
} ? {
|
|
143
|
-
-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>;
|
|
144
|
-
} & {
|
|
145
|
-
-readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D>;
|
|
146
|
-
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
|
|
147
|
-
properties?: Record<string, unknown>;
|
|
148
|
-
optionalProperties: Record<string, unknown>;
|
|
149
|
-
additionalProperties?: boolean;
|
|
150
|
-
} ? {
|
|
151
|
-
-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>;
|
|
152
|
-
} & {
|
|
153
|
-
-readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<S["optionalProperties"][K], D>;
|
|
154
|
-
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown) : S extends {
|
|
155
|
-
values: infer V;
|
|
156
|
-
} ? Record<string, JTDDataDef<V, D>> : S extends {
|
|
157
|
-
discriminator: infer M;
|
|
158
|
-
mapping: Record<string, unknown>;
|
|
159
|
-
} ? [M] extends [string] ? {
|
|
160
|
-
[K in keyof S["mapping"]]: JTDDataDef<S["mapping"][K], D> & {
|
|
161
|
-
[KM in M]: K;
|
|
162
|
-
};
|
|
163
|
-
}[keyof S["mapping"]] : never : unknown) | (S extends {
|
|
164
|
-
nullable: true;
|
|
165
|
-
} ? null : never);
|
|
166
|
-
export declare type JTDDataType<S> = S extends {
|
|
167
|
-
definitions: Record<string, unknown>;
|
|
168
|
-
} ? JTDDataDef<S, S["definitions"]> : JTDDataDef<S, Record<string, never>>;
|
|
169
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { ErrorObject } from './ajv';
|
|
2
|
-
|
|
3
|
-
export interface IOutputError {
|
|
4
|
-
start: { line: number; column: number; offset: number };
|
|
5
|
-
// Optional for required
|
|
6
|
-
end?: { line: number; column: number; offset: number };
|
|
7
|
-
error: string;
|
|
8
|
-
suggestion?: string;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export interface IInputOptions {
|
|
12
|
-
format?: 'cli' | 'js';
|
|
13
|
-
indent?: number | null;
|
|
14
|
-
|
|
15
|
-
/** Raw JSON used when highlighting error location */
|
|
16
|
-
json?: string | null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export default function <S, T, Options extends IInputOptions>(
|
|
20
|
-
schema: S,
|
|
21
|
-
data: T,
|
|
22
|
-
errors: Array<ErrorObject>,
|
|
23
|
-
options?: Options
|
|
24
|
-
): Options extends { format: 'js' } ? Array<IOutputError> : string;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
export interface URIComponents {
|
|
2
|
-
scheme?: string;
|
|
3
|
-
userinfo?: string;
|
|
4
|
-
host?: string;
|
|
5
|
-
port?: number | string;
|
|
6
|
-
path?: string;
|
|
7
|
-
query?: string;
|
|
8
|
-
fragment?: string;
|
|
9
|
-
reference?: string;
|
|
10
|
-
error?: string;
|
|
11
|
-
}
|
|
12
|
-
export interface URIOptions {
|
|
13
|
-
scheme?: string;
|
|
14
|
-
reference?: string;
|
|
15
|
-
tolerant?: boolean;
|
|
16
|
-
absolutePath?: boolean;
|
|
17
|
-
iri?: boolean;
|
|
18
|
-
unicodeSupport?: boolean;
|
|
19
|
-
domainHost?: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {
|
|
22
|
-
scheme: string;
|
|
23
|
-
parse(components: ParentComponents, options: Options): Components;
|
|
24
|
-
serialize(components: Components, options: Options): ParentComponents;
|
|
25
|
-
unicodeSupport?: boolean;
|
|
26
|
-
domainHost?: boolean;
|
|
27
|
-
absolutePath?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface URIRegExps {
|
|
30
|
-
NOT_SCHEME: RegExp;
|
|
31
|
-
NOT_USERINFO: RegExp;
|
|
32
|
-
NOT_HOST: RegExp;
|
|
33
|
-
NOT_PATH: RegExp;
|
|
34
|
-
NOT_PATH_NOSCHEME: RegExp;
|
|
35
|
-
NOT_QUERY: RegExp;
|
|
36
|
-
NOT_FRAGMENT: RegExp;
|
|
37
|
-
ESCAPE: RegExp;
|
|
38
|
-
UNRESERVED: RegExp;
|
|
39
|
-
OTHER_CHARS: RegExp;
|
|
40
|
-
PCT_ENCODED: RegExp;
|
|
41
|
-
IPV4ADDRESS: RegExp;
|
|
42
|
-
IPV6ADDRESS: RegExp;
|
|
43
|
-
}
|
|
44
|
-
export declare const SCHEMES: {
|
|
45
|
-
[scheme: string]: URISchemeHandler;
|
|
46
|
-
};
|
|
47
|
-
export declare function pctEncChar(chr: string): string;
|
|
48
|
-
export declare function pctDecChars(str: string): string;
|
|
49
|
-
export declare function parse(uriString: string, options?: URIOptions): URIComponents;
|
|
50
|
-
export declare function removeDotSegments(input: string): string;
|
|
51
|
-
export declare function serialize(components: URIComponents, options?: URIOptions): string;
|
|
52
|
-
export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents;
|
|
53
|
-
export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string;
|
|
54
|
-
export declare function normalize(uri: string, options?: URIOptions): string;
|
|
55
|
-
export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents;
|
|
56
|
-
export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean;
|
|
57
|
-
export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean;
|
|
58
|
-
export declare function escapeComponent(str: string, options?: URIOptions): string;
|
|
59
|
-
export declare function unescapeComponent(str: string, options?: URIOptions): string;
|
package/dist/js/modern/cli.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// 这个文件跟 bin/modern-js.js 基本一样
|
|
2
|
-
// 在开发阶段,因为 package.json 的 exports['./bin']['jsnext:source'] 配置
|
|
3
|
-
// 了这个文件,所以需要保留, 后续如果找到更好的方式之后会移除这个文件
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import { cli } from ".";
|
|
6
|
-
|
|
7
|
-
const {
|
|
8
|
-
version
|
|
9
|
-
} = require("../../package.json"); // XXX: 通过这个方式去掉了 package.json 里面对于 @modern-js/module-tools 的 devDependencies 依赖
|
|
10
|
-
// 然后可以正常的执行 modern build
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const kModuleToolsCliPath = path.resolve(__dirname, '../../../solutions/module-tools/src/index.ts');
|
|
14
|
-
process.env.MODERN_JS_VERSION = version;
|
|
15
|
-
|
|
16
|
-
if (!process.env.NODE_ENV) {
|
|
17
|
-
process.env.NODE_ENV = // eslint-disable-next-line no-nested-ternary
|
|
18
|
-
['build', 'start', 'deploy'].includes(process.argv[2]) ? 'production' : process.argv[2] === 'test' ? 'test' : 'development';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
cli.run(process.argv.slice(2), {
|
|
22
|
-
plugins: {
|
|
23
|
-
'@modern-js/module-tools': {
|
|
24
|
-
cli: kModuleToolsCliPath,
|
|
25
|
-
// 是否需要强制加载这个组件,跳过 loadPlugins 里面 filter 的检测逻辑
|
|
26
|
-
forced: true
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
});
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
const sourceDefaults = {
|
|
2
|
-
entries: undefined,
|
|
3
|
-
disableDefaultEntries: false,
|
|
4
|
-
entriesDir: './src',
|
|
5
|
-
configDir: './config',
|
|
6
|
-
apiDir: './api',
|
|
7
|
-
envVars: [],
|
|
8
|
-
globalVars: undefined,
|
|
9
|
-
alias: undefined,
|
|
10
|
-
moduleScopes: undefined,
|
|
11
|
-
include: []
|
|
12
|
-
};
|
|
13
|
-
const outputDefaults = {
|
|
14
|
-
assetPrefix: '/',
|
|
15
|
-
htmlPath: 'html',
|
|
16
|
-
jsPath: 'static/js',
|
|
17
|
-
cssPath: 'static/css',
|
|
18
|
-
mediaPath: 'static/media',
|
|
19
|
-
path: 'dist',
|
|
20
|
-
title: '',
|
|
21
|
-
titleByEntries: undefined,
|
|
22
|
-
meta: {
|
|
23
|
-
charset: {
|
|
24
|
-
charset: 'utf-8'
|
|
25
|
-
},
|
|
26
|
-
viewport: 'width=device-width, initial-scale=1.0, shrink-to-fit=no, viewport-fit=cover, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no',
|
|
27
|
-
'http-equiv': {
|
|
28
|
-
'http-equiv': 'x-ua-compatible',
|
|
29
|
-
content: 'ie=edge'
|
|
30
|
-
},
|
|
31
|
-
renderer: 'webkit',
|
|
32
|
-
layoutmode: 'standard',
|
|
33
|
-
imagemode: 'force',
|
|
34
|
-
'wap-font-scale': 'no',
|
|
35
|
-
'format-detection': 'telephone=no'
|
|
36
|
-
},
|
|
37
|
-
metaByEntries: undefined,
|
|
38
|
-
inject: 'head',
|
|
39
|
-
injectByEntries: undefined,
|
|
40
|
-
mountId: 'root',
|
|
41
|
-
favicon: '',
|
|
42
|
-
faviconByEntries: undefined,
|
|
43
|
-
copy: undefined,
|
|
44
|
-
scriptExt: undefined,
|
|
45
|
-
disableHtmlFolder: false,
|
|
46
|
-
disableCssModuleExtension: false,
|
|
47
|
-
disableCssExtract: false,
|
|
48
|
-
enableCssModuleTSDeclaration: false,
|
|
49
|
-
disableMinimize: false,
|
|
50
|
-
enableInlineStyles: false,
|
|
51
|
-
enableInlineScripts: false,
|
|
52
|
-
disableSourceMap: false,
|
|
53
|
-
disableInlineRuntimeChunk: false,
|
|
54
|
-
disableAssetsCache: false,
|
|
55
|
-
enableLatestDecorators: false,
|
|
56
|
-
polyfill: 'entry',
|
|
57
|
-
dataUriLimit: 10000,
|
|
58
|
-
templateParameters: {},
|
|
59
|
-
templateParametersByEntries: undefined,
|
|
60
|
-
cssModuleLocalIdentName: '[name]__[local]--[hash:base64:5]',
|
|
61
|
-
enableModernMode: false,
|
|
62
|
-
federation: undefined,
|
|
63
|
-
disableNodePolyfill: false,
|
|
64
|
-
enableTsLoader: false
|
|
65
|
-
};
|
|
66
|
-
const serverDefaults = {
|
|
67
|
-
routes: undefined,
|
|
68
|
-
publicRoutes: undefined,
|
|
69
|
-
ssr: undefined,
|
|
70
|
-
ssrByEntries: undefined,
|
|
71
|
-
baseUrl: '/',
|
|
72
|
-
port: 8080
|
|
73
|
-
};
|
|
74
|
-
const devDefaults = {
|
|
75
|
-
assetPrefix: false,
|
|
76
|
-
https: false
|
|
77
|
-
};
|
|
78
|
-
const deployDefaults = {
|
|
79
|
-
domain: '',
|
|
80
|
-
domainByEntries: undefined
|
|
81
|
-
};
|
|
82
|
-
const toolsDefaults = {
|
|
83
|
-
webpack: undefined,
|
|
84
|
-
babel: undefined,
|
|
85
|
-
postcss: undefined,
|
|
86
|
-
autoprefixer: undefined,
|
|
87
|
-
lodash: undefined,
|
|
88
|
-
devServer: undefined,
|
|
89
|
-
tsLoader: undefined,
|
|
90
|
-
terser: undefined,
|
|
91
|
-
minifyCss: undefined
|
|
92
|
-
};
|
|
93
|
-
export const defaults = {
|
|
94
|
-
source: sourceDefaults,
|
|
95
|
-
output: outputDefaults,
|
|
96
|
-
server: serverDefaults,
|
|
97
|
-
dev: devDefaults,
|
|
98
|
-
deploy: deployDefaults,
|
|
99
|
-
tools: toolsDefaults,
|
|
100
|
-
plugins: [],
|
|
101
|
-
runtime: {},
|
|
102
|
-
runtimeByEntries: {}
|
|
103
|
-
};
|