@modern-js/module-tools 2.39.2 → 2.40.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.
@@ -1,360 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var schema_exports = {};
20
- __export(schema_exports, {
21
- buildConfig: () => buildConfig,
22
- buildPreset: () => buildPreset,
23
- legacy: () => legacy,
24
- legacySchema: () => import_legacySchema.legacySchema,
25
- presets: () => presets,
26
- schema: () => schema,
27
- targets: () => targets
28
- });
29
- module.exports = __toCommonJS(schema_exports);
30
- var import_legacySchema = require("./legacySchema");
31
- const targets = [
32
- "es5",
33
- "es6",
34
- "es2015",
35
- "es2016",
36
- "es2017",
37
- "es2018",
38
- "es2019",
39
- "es2020",
40
- "es2021",
41
- "es2022",
42
- // The default target is esnext which means that by default, assume all of the latest JavaScript and CSS features are supported.
43
- "esnext"
44
- ];
45
- const presets = [
46
- "npm-library",
47
- "npm-library-with-umd",
48
- "npm-component",
49
- "npm-component-with-umd",
50
- ...[
51
- "npm-library",
52
- "npm-library-with-umd",
53
- "npm-component",
54
- "npm-component-with-umd"
55
- ].reduce((ret, crt) => {
56
- return [
57
- ...ret,
58
- ...targets.map((t) => `${crt}-${t}`)
59
- ];
60
- }, []),
61
- "modern-js-node",
62
- "modern-js-universal"
63
- ];
64
- const buildConfigProperties = {
65
- alias: {
66
- typeof: [
67
- "object",
68
- "function"
69
- ]
70
- },
71
- hooks: {
72
- // TODO: improve it
73
- type: "array"
74
- },
75
- resolve: {
76
- // TODO: add properties
77
- type: "object"
78
- },
79
- banner: {
80
- // TODO: add properties
81
- type: "object"
82
- },
83
- asset: {
84
- type: "object"
85
- },
86
- autoExternal: {
87
- if: {
88
- type: "object"
89
- },
90
- then: {
91
- properties: {
92
- dependencies: {
93
- type: "boolean"
94
- },
95
- peerDependencies: {
96
- type: "boolean"
97
- }
98
- }
99
- },
100
- else: {
101
- type: "boolean"
102
- }
103
- },
104
- buildType: {
105
- enum: [
106
- "bundle",
107
- "bundleless"
108
- ]
109
- },
110
- copy: {
111
- type: "object",
112
- properties: {
113
- patterns: {
114
- type: "array",
115
- items: {
116
- type: "object",
117
- properties: {
118
- from: {
119
- type: "string"
120
- },
121
- to: {
122
- type: "string"
123
- },
124
- context: {
125
- type: "string"
126
- },
127
- globOptions: {
128
- type: "object"
129
- }
130
- }
131
- }
132
- },
133
- options: {
134
- type: "object",
135
- properties: {
136
- concurrency: {
137
- type: "number"
138
- }
139
- }
140
- }
141
- }
142
- },
143
- define: {
144
- typeof: "object"
145
- },
146
- dts: {
147
- if: {
148
- type: "object"
149
- },
150
- then: {
151
- properties: {
152
- distPath: {
153
- type: "string"
154
- },
155
- tsconfigPath: {
156
- type: "string"
157
- },
158
- abortOnError: {
159
- type: "boolean"
160
- },
161
- respectExternal: {
162
- type: "boolean"
163
- }
164
- }
165
- },
166
- else: {
167
- type: "boolean"
168
- }
169
- },
170
- autoExtension: {
171
- type: "boolean"
172
- },
173
- externals: {
174
- type: "array",
175
- items: {
176
- anyOf: [
177
- {
178
- instanceof: "RegExp"
179
- },
180
- {
181
- typeof: "string"
182
- }
183
- ]
184
- }
185
- },
186
- format: {
187
- enum: [
188
- "cjs",
189
- "esm",
190
- "iife",
191
- "umd"
192
- ]
193
- },
194
- input: {
195
- type: [
196
- "array",
197
- "object"
198
- ]
199
- },
200
- jsx: {
201
- enum: [
202
- "automatic",
203
- "transform",
204
- "preserve"
205
- ]
206
- },
207
- minify: {
208
- if: {
209
- type: "object"
210
- },
211
- else: {
212
- enum: [
213
- "esbuild",
214
- "terser",
215
- false
216
- ]
217
- }
218
- },
219
- outDir: {
220
- type: "string"
221
- },
222
- platform: {
223
- enum: [
224
- "node",
225
- "browser"
226
- ]
227
- },
228
- sourceDir: {
229
- typeof: "string"
230
- },
231
- sourceMap: {
232
- enum: [
233
- true,
234
- false,
235
- "inline",
236
- "external"
237
- ]
238
- },
239
- splitting: {
240
- type: "boolean"
241
- },
242
- style: {
243
- // TODO: add properties
244
- type: "object"
245
- },
246
- redirect: {
247
- type: "object"
248
- },
249
- target: {
250
- enum: targets
251
- },
252
- umdGlobals: {
253
- type: "object"
254
- },
255
- esbuildOpitons: {
256
- instanceof: "Function"
257
- },
258
- umdModuleName: {
259
- anyOf: [
260
- {
261
- instanceof: "Function"
262
- },
263
- {
264
- typeof: "string"
265
- }
266
- ]
267
- },
268
- shims: {
269
- type: "boolean"
270
- },
271
- sideEffects: {
272
- anyOf: [
273
- {
274
- type: "array",
275
- items: {
276
- instanceof: "RegExp"
277
- }
278
- },
279
- {
280
- type: "boolean"
281
- },
282
- {
283
- instanceof: "Function"
284
- }
285
- ]
286
- },
287
- externalHelpers: {
288
- type: "boolean"
289
- },
290
- tsconfig: {
291
- type: "string"
292
- },
293
- transformImport: {
294
- type: "array"
295
- },
296
- transformLodash: {
297
- type: "boolean"
298
- },
299
- sourceType: {
300
- enum: [
301
- "commonjs",
302
- "module"
303
- ]
304
- }
305
- };
306
- const buildConfig = {
307
- target: "buildConfig",
308
- schema: {
309
- if: {
310
- type: "array"
311
- },
312
- then: {
313
- items: [
314
- {
315
- type: "object",
316
- properties: buildConfigProperties
317
- }
318
- ]
319
- },
320
- else: {
321
- type: "object",
322
- properties: buildConfigProperties
323
- }
324
- }
325
- };
326
- const buildPreset = {
327
- target: "buildPreset",
328
- schema: {
329
- if: {
330
- type: "string"
331
- },
332
- then: {
333
- enum: presets
334
- },
335
- else: {
336
- typeof: "function"
337
- }
338
- }
339
- };
340
- const legacy = {
341
- target: "legacy",
342
- schema: {
343
- type: "boolean"
344
- }
345
- };
346
- const schema = [
347
- buildConfig,
348
- buildPreset,
349
- legacy
350
- ];
351
- // Annotate the CommonJS export names for ESM import in node:
352
- 0 && (module.exports = {
353
- buildConfig,
354
- buildPreset,
355
- legacy,
356
- legacySchema,
357
- presets,
358
- schema,
359
- targets
360
- });