@modern-js/core 0.0.0-windows-20211056953 → 0.0.1-20221226

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.
Files changed (130) hide show
  1. package/CHANGELOG.md +1164 -6
  2. package/dist/bin.d.ts +2 -0
  3. package/dist/bin.js +5 -0
  4. package/dist/config/createDefaultConfig.d.ts +2 -0
  5. package/dist/config/createDefaultConfig.js +9 -0
  6. package/dist/config/createLoadedConfig.d.ts +6 -0
  7. package/dist/config/createLoadedConfig.js +35 -0
  8. package/dist/config/createResolvedConfig.d.ts +3 -0
  9. package/dist/config/createResolvedConfig.js +92 -0
  10. package/dist/config/index.d.ts +3 -0
  11. package/dist/config/index.js +19 -0
  12. package/dist/context.d.ts +35 -0
  13. package/dist/context.js +61 -0
  14. package/dist/index.d.ts +73 -0
  15. package/dist/index.js +150 -0
  16. package/dist/load-configs/index.d.ts +34 -0
  17. package/dist/load-configs/index.js +124 -0
  18. package/dist/{types/loadEnv.d.ts → loadEnv.d.ts} +1 -1
  19. package/dist/loadEnv.js +21 -0
  20. package/dist/loadPlugins.d.ts +18 -0
  21. package/dist/loadPlugins.js +65 -0
  22. package/dist/manager.d.ts +87 -0
  23. package/dist/manager.js +24 -0
  24. package/dist/runBin.d.ts +5 -0
  25. package/dist/runBin.js +51 -0
  26. package/dist/schema/patchSchema.d.ts +19 -0
  27. package/dist/schema/patchSchema.js +57 -0
  28. package/dist/schema/source.d.ts +9 -0
  29. package/dist/schema/source.js +10 -0
  30. package/dist/schema/testing.d.ts +13 -0
  31. package/dist/schema/testing.js +11 -0
  32. package/dist/schema/traverseSchema.d.ts +2 -0
  33. package/dist/schema/traverseSchema.js +20 -0
  34. package/dist/types/config/index.d.ts +49 -125
  35. package/dist/types/config/index.js +2 -0
  36. package/dist/types/config/testing.d.ts +15 -0
  37. package/dist/types/config/testing.js +2 -0
  38. package/dist/types/context.d.ts +28 -14
  39. package/dist/types/context.js +2 -0
  40. package/dist/types/hooks.d.ts +44 -0
  41. package/dist/types/hooks.js +2 -0
  42. package/dist/types/index.d.ts +9 -87
  43. package/dist/types/index.js +21 -0
  44. package/dist/types/plugin.d.ts +26 -0
  45. package/dist/types/plugin.js +2 -0
  46. package/dist/types/pluginAPI.d.ts +18 -0
  47. package/dist/types/pluginAPI.js +2 -0
  48. package/dist/utils/commander.d.ts +4 -0
  49. package/dist/utils/commander.js +20 -0
  50. package/dist/utils/mergeConfig.d.ts +2 -0
  51. package/dist/utils/mergeConfig.js +32 -0
  52. package/dist/utils/repeatKeyWarning.d.ts +3 -0
  53. package/dist/utils/repeatKeyWarning.js +22 -0
  54. package/package.json +52 -48
  55. package/bin/modern-js.js +0 -18
  56. package/dist/js/modern/config/defaults.js +0 -100
  57. package/dist/js/modern/config/index.js +0 -104
  58. package/dist/js/modern/config/mergeConfig.js +0 -20
  59. package/dist/js/modern/config/schema/deploy.js +0 -20
  60. package/dist/js/modern/config/schema/index.js +0 -107
  61. package/dist/js/modern/config/schema/output.js +0 -147
  62. package/dist/js/modern/config/schema/server.js +0 -170
  63. package/dist/js/modern/config/schema/source.js +0 -59
  64. package/dist/js/modern/config/schema/tools.js +0 -33
  65. package/dist/js/modern/context.js +0 -25
  66. package/dist/js/modern/index.js +0 -142
  67. package/dist/js/modern/initWatcher.js +0 -46
  68. package/dist/js/modern/loadEnv.js +0 -12
  69. package/dist/js/modern/loadPlugins.js +0 -66
  70. package/dist/js/modern/utils/commander.js +0 -19
  71. package/dist/js/modern/utils/repeatKeyWarning.js +0 -18
  72. package/dist/js/node/config/defaults.js +0 -107
  73. package/dist/js/node/config/index.js +0 -142
  74. package/dist/js/node/config/mergeConfig.js +0 -32
  75. package/dist/js/node/config/schema/deploy.js +0 -29
  76. package/dist/js/node/config/schema/index.js +0 -129
  77. package/dist/js/node/config/schema/output.js +0 -156
  78. package/dist/js/node/config/schema/server.js +0 -179
  79. package/dist/js/node/config/schema/source.js +0 -68
  80. package/dist/js/node/config/schema/tools.js +0 -40
  81. package/dist/js/node/context.js +0 -52
  82. package/dist/js/node/index.js +0 -247
  83. package/dist/js/node/initWatcher.js +0 -67
  84. package/dist/js/node/loadEnv.js +0 -28
  85. package/dist/js/node/loadPlugins.js +0 -76
  86. package/dist/js/node/utils/commander.js +0 -35
  87. package/dist/js/node/utils/repeatKeyWarning.js +0 -31
  88. package/dist/types/config/defaults.d.ts +0 -25
  89. package/dist/types/config/mergeConfig.d.ts +0 -29
  90. package/dist/types/config/schema/deploy.d.ts +0 -19
  91. package/dist/types/config/schema/index.d.ts +0 -466
  92. package/dist/types/config/schema/output.d.ts +0 -146
  93. package/dist/types/config/schema/server.d.ts +0 -182
  94. package/dist/types/config/schema/source.d.ts +0 -58
  95. package/dist/types/config/schema/tools.d.ts +0 -33
  96. package/dist/types/initWatcher.d.ts +0 -3
  97. package/dist/types/loadPlugins.d.ts +0 -16
  98. package/dist/types/utils/commander.d.ts +0 -7
  99. package/dist/types/utils/repeatKeyWarning.d.ts +0 -3
  100. package/modern.config.js +0 -13
  101. package/src/config/defaults.ts +0 -101
  102. package/src/config/index.ts +0 -296
  103. package/src/config/mergeConfig.ts +0 -68
  104. package/src/config/schema/deploy.ts +0 -17
  105. package/src/config/schema/index.ts +0 -116
  106. package/src/config/schema/output.ts +0 -66
  107. package/src/config/schema/server.ts +0 -106
  108. package/src/config/schema/source.ts +0 -34
  109. package/src/config/schema/tools.ts +0 -15
  110. package/src/context.ts +0 -46
  111. package/src/index.ts +0 -247
  112. package/src/initWatcher.ts +0 -77
  113. package/src/loadEnv.ts +0 -21
  114. package/src/loadPlugins.ts +0 -81
  115. package/src/types.d.ts +0 -0
  116. package/src/utils/commander.ts +0 -22
  117. package/src/utils/repeatKeyWarning.ts +0 -29
  118. package/tests/.eslintrc.js +0 -6
  119. package/tests/fixtures/load-plugin/not-found/package.json +0 -3
  120. package/tests/fixtures/load-plugin/not-found/test-plugin-a.js +0 -1
  121. package/tests/fixtures/load-plugin/user-plugins/package.json +0 -3
  122. package/tests/fixtures/load-plugin/user-plugins/test-plugin-a.js +0 -1
  123. package/tests/fixtures/load-plugin/user-plugins/test-plugin-b.js +0 -3
  124. package/tests/loadEnv.test.ts +0 -100
  125. package/tests/loadPlugin.test.ts +0 -29
  126. package/tests/mergeConfig.test.ts +0 -78
  127. package/tests/repeatKeyWarning.test.ts +0 -68
  128. package/tests/schema.test.ts +0 -109
  129. package/tests/tsconfig.json +0 -13
  130. package/tsconfig.json +0 -14
@@ -1,182 +0,0 @@
1
- export declare const server: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- port: {
6
- type: string;
7
- };
8
- ssr: {
9
- if: {
10
- type: string;
11
- };
12
- then: {
13
- properties: {
14
- disableLoadable: {
15
- type: string;
16
- };
17
- disableHelmet: {
18
- type: string;
19
- };
20
- disableRedirect: {
21
- type: string;
22
- };
23
- enableAsyncData: {
24
- type: string;
25
- };
26
- enableProductWarning: {
27
- type: string;
28
- };
29
- timeout: {
30
- type: string;
31
- };
32
- asyncDataTimeout: {
33
- type: string;
34
- };
35
- };
36
- };
37
- else: {
38
- type: string;
39
- };
40
- };
41
- ssrByEntries: {
42
- type: string;
43
- patternProperties: {
44
- "^[a-zA-Z0-9_-]+$": {
45
- if: {
46
- type: string;
47
- };
48
- then: {
49
- properties: {
50
- disableLoadable: {
51
- type: string;
52
- };
53
- disableHelmet: {
54
- type: string;
55
- };
56
- disableRedirect: {
57
- type: string;
58
- };
59
- enableProductWarning: {
60
- type: string;
61
- };
62
- enableAsyncData: {
63
- type: string;
64
- };
65
- timeout: {
66
- type: string;
67
- };
68
- asyncDataTimeout: {
69
- type: string;
70
- };
71
- };
72
- additionalProperties: boolean;
73
- };
74
- else: {
75
- type: string;
76
- };
77
- };
78
- };
79
- };
80
- routes: {
81
- type: string;
82
- patternProperties: {
83
- "^[a-zA-Z0-9_-]+$": {
84
- if: {
85
- type: string;
86
- };
87
- then: {
88
- properties: {
89
- route: {
90
- oneOf: ({
91
- type: string;
92
- properties: {
93
- path: {
94
- type: string;
95
- };
96
- headers: {
97
- type: string;
98
- };
99
- };
100
- additionalProperties: boolean;
101
- } | {
102
- type: string;
103
- items?: undefined;
104
- } | {
105
- type: string;
106
- items: {
107
- oneOf: ({
108
- type: string;
109
- properties: {
110
- path: {
111
- type: string;
112
- };
113
- headers: {
114
- type: string;
115
- };
116
- };
117
- additionalProperties: boolean;
118
- } | {
119
- type: string;
120
- })[];
121
- };
122
- })[];
123
- };
124
- disableSpa: {
125
- type: string;
126
- };
127
- };
128
- additionalProperties: boolean;
129
- };
130
- else: {
131
- oneOf: ({
132
- type: string;
133
- items?: undefined;
134
- } | {
135
- type: string;
136
- items: {
137
- type: string;
138
- };
139
- })[];
140
- };
141
- };
142
- };
143
- };
144
- publicRoutes: {
145
- type: string;
146
- patternProperties: {
147
- "^[a-zA-Z0-9_-]+$": {
148
- type: string[];
149
- };
150
- };
151
- };
152
- baseUrl: {
153
- oneOf: ({
154
- type: string;
155
- items?: undefined;
156
- } | {
157
- type: string;
158
- items: {
159
- type: string;
160
- }[];
161
- })[];
162
- };
163
- middleware: {
164
- instanceof: string[];
165
- };
166
- renderHook: {
167
- instanceof: string;
168
- };
169
- logger: {
170
- type: string;
171
- };
172
- measure: {
173
- type: string;
174
- };
175
- proxy: {
176
- type: string;
177
- };
178
- enableMicroFrontendDebug: {
179
- type: string;
180
- };
181
- };
182
- };
@@ -1,58 +0,0 @@
1
- export declare const source: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- entries: {
6
- type: string;
7
- patternProperties: {
8
- "^[a-zA-Z0-9_-]+$": {
9
- if: {
10
- type: string;
11
- };
12
- then: {
13
- required: string[];
14
- properties: {
15
- entry: {
16
- type: string[];
17
- };
18
- disableMount: {
19
- type: string;
20
- };
21
- enableFileSystemRoutes: {
22
- type: string;
23
- };
24
- };
25
- additionalProperties: boolean;
26
- };
27
- else: {
28
- type: string[];
29
- };
30
- };
31
- };
32
- };
33
- alias: {
34
- typeof: string[];
35
- };
36
- disableDefaultEntries: {
37
- type: string;
38
- };
39
- envVars: {
40
- type: string;
41
- };
42
- globalVars: {
43
- type: string;
44
- };
45
- moduleScopes: {
46
- instanceof: string[];
47
- };
48
- entriesDir: {
49
- type: string;
50
- };
51
- configDir: {
52
- type: string;
53
- };
54
- include: {
55
- type: string[];
56
- };
57
- };
58
- };
@@ -1,33 +0,0 @@
1
- export declare const tools: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- webpack: {
6
- typeof: string[];
7
- };
8
- babel: {
9
- typeof: string[];
10
- };
11
- postcss: {
12
- typeof: string[];
13
- };
14
- lodash: {
15
- typeof: string[];
16
- };
17
- devServer: {
18
- type: string;
19
- };
20
- tsLoader: {
21
- typeof: string[];
22
- };
23
- autoprefixer: {
24
- typeof: string[];
25
- };
26
- terser: {
27
- typeof: string[];
28
- };
29
- minifyCss: {
30
- typeof: string[];
31
- };
32
- };
33
- };
@@ -1,3 +0,0 @@
1
- import { LoadedConfig } from './config';
2
- import { HooksRunner } from '.';
3
- export declare const initWatcher: (loaded: LoadedConfig, appDirectory: string, configDir: string | undefined, hooksRunner: HooksRunner, argv: string[]) => Promise<void>;
@@ -1,16 +0,0 @@
1
- export interface PluginConfigItem {
2
- cli?: string;
3
- server?: string;
4
- }
5
- export declare type PluginConfig = Array<PluginConfigItem>;
6
- /**
7
- * Load internal plugins which in @modern-js scope and user's custom plugins.
8
- * @param appDirectory - Application root directory.
9
- * @param pluginsConfig - Plugins declared in the user configuration.
10
- * @returns Plugin Objects has been required.
11
- */
12
-
13
- export declare const loadPlugins: (appDirectory: string, pluginConfig: PluginConfig) => {
14
- cli: any;
15
- server: any;
16
- }[];
@@ -1,7 +0,0 @@
1
- import { program, Command } from 'commander';
2
- declare module 'commander' {
3
- interface Command {
4
- commandsMap: Map<string, Command>;
5
- }
6
- }
7
- export { program, Command };
@@ -1,3 +0,0 @@
1
- import { UserConfig } from '../config';
2
- export declare const deepGet: (obj: any, key: string) => any;
3
- export declare const repeatKeyWarning: (schema: any, jsConfig: UserConfig, pkgConfig: UserConfig) => void;
package/modern.config.js DELETED
@@ -1,13 +0,0 @@
1
- /** @type {import('@modern-js/module-tools').UserConfig} */
2
- module.exports = {
3
- output: {
4
- disableSourceMap: true,
5
- },
6
- testing: {
7
- jest: {
8
- collectCoverage: true,
9
- collectCoverageFrom: ['src/**/*.ts'],
10
- coveragePathIgnorePatterns: ['/node_modules/'],
11
- },
12
- },
13
- };
@@ -1,101 +0,0 @@
1
- import { OutputConfig, ServerConfig, SourceConfig } from '.';
2
-
3
- const sourceDefaults: SourceConfig = {
4
- entries: undefined,
5
- disableDefaultEntries: false,
6
- entriesDir: './src',
7
- configDir: './config',
8
- apiDir: './api',
9
- envVars: [],
10
- globalVars: undefined,
11
- alias: undefined,
12
- moduleScopes: undefined,
13
- include: [],
14
- };
15
-
16
- const outputDefaults: OutputConfig = {
17
- assetPrefix: '/',
18
- htmlPath: 'html',
19
- jsPath: 'static/js',
20
- cssPath: 'static/css',
21
- mediaPath: 'static/media',
22
- path: 'dist',
23
- title: '',
24
- titleByEntries: undefined,
25
- meta: {
26
- charset: { charset: 'utf-8' },
27
- viewport:
28
- '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',
29
- 'http-equiv': { 'http-equiv': 'x-ua-compatible', content: 'ie=edge' },
30
- renderer: 'webkit',
31
- layoutmode: 'standard',
32
- imagemode: 'force',
33
- 'wap-font-scale': 'no',
34
- 'format-detection': 'telephone=no',
35
- },
36
- metaByEntries: undefined,
37
- inject: 'head',
38
- injectByEntries: undefined,
39
- mountId: 'root',
40
- favicon: '',
41
- faviconByEntries: undefined,
42
- copy: undefined,
43
- scriptExt: undefined,
44
- disableHtmlFolder: false,
45
- disableCssModuleExtension: false,
46
- disableCssExtract: false,
47
- enableCssModuleTSDeclaration: false,
48
- disableMinimize: false,
49
- enableInlineStyles: false,
50
- enableInlineScripts: false,
51
- disableSourceMap: false,
52
- disableInlineRuntimeChunk: false,
53
- disableAssetsCache: false,
54
- enableLatestDecorators: false,
55
- polyfill: 'entry',
56
- dataUriLimit: 10000,
57
- templateParameters: {},
58
- templateParametersByEntries: undefined,
59
- cssModuleLocalIdentName: '[name]__[local]--[hash:base64:5]',
60
- enableModernMode: false,
61
- federation: undefined,
62
- disableNodePolyfill: false,
63
- enableTsLoader: false,
64
- };
65
-
66
- const serverDefaults: ServerConfig = {
67
- routes: undefined,
68
- publicRoutes: undefined,
69
- ssr: undefined,
70
- ssrByEntries: undefined,
71
- baseUrl: '/',
72
- port: 8080,
73
- };
74
-
75
- const devDefaults = { assetPrefix: false, https: false };
76
-
77
- const deployDefaults = {
78
- domain: '',
79
- domainByEntries: undefined,
80
- };
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
-
94
- export const defaults = {
95
- source: sourceDefaults,
96
- output: outputDefaults,
97
- server: serverDefaults,
98
- dev: devDefaults,
99
- deploy: deployDefaults,
100
- tools: toolsDefaults,
101
- };