@modern-js/core 2.22.0 → 2.23.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
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# @modern-js/core
|
|
2
2
|
|
|
3
|
+
## 2.23.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7e6fb5f: chore: publishConfig add provenance config
|
|
8
|
+
|
|
9
|
+
chore: publishConfig 增加 provenance 配置
|
|
10
|
+
|
|
11
|
+
- b593040: fix(app-tools): incorrect tools.tailwindcss schema
|
|
12
|
+
|
|
13
|
+
fix(app-tools): 修复 tools.tailwindcss schema 错误
|
|
14
|
+
|
|
15
|
+
- c3216b5: chore: split the scheme into the plugin
|
|
16
|
+
|
|
17
|
+
chore: 拆分 scheme 到插件内部
|
|
18
|
+
|
|
19
|
+
- Updated dependencies [7e6fb5f]
|
|
20
|
+
- Updated dependencies [a7a7ad7]
|
|
21
|
+
- Updated dependencies [6dec7c2]
|
|
22
|
+
- Updated dependencies [c3216b5]
|
|
23
|
+
- @modern-js/node-bundle-require@2.23.0
|
|
24
|
+
- @modern-js/plugin@2.23.0
|
|
25
|
+
- @modern-js/utils@2.23.0
|
|
26
|
+
|
|
27
|
+
## 2.22.1
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 1f02cd2: chore: fix some eslint issues
|
|
32
|
+
|
|
33
|
+
chore: 修复一些 eslint issues
|
|
34
|
+
|
|
35
|
+
- Updated dependencies [e2848a2]
|
|
36
|
+
- Updated dependencies [d4045ed]
|
|
37
|
+
- @modern-js/utils@2.22.1
|
|
38
|
+
- @modern-js/node-bundle-require@2.22.1
|
|
39
|
+
- @modern-js/plugin@2.22.1
|
|
40
|
+
|
|
3
41
|
## 2.22.0
|
|
4
42
|
|
|
5
43
|
### Patch Changes
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { ErrorObject } from '@modern-js/utils/ajv';
|
|
2
2
|
import type { UserConfig, NormalizedConfig, LoadedConfig, PluginValidateSchema } from '../types';
|
|
3
|
-
export declare const createResolveConfig: (loaded: LoadedConfig<{}>, configs: UserConfig[], schemas: PluginValidateSchema[], onSchemaError?: (error: ErrorObject) => void | Promise<void>) => Promise<NormalizedConfig>;
|
|
3
|
+
export declare const createResolveConfig: (loaded: LoadedConfig<{}>, configs: UserConfig[], schemas: PluginValidateSchema[], onSchemaError?: ((error: ErrorObject) => void | Promise<void>) | undefined) => Promise<NormalizedConfig>;
|
|
@@ -30,25 +30,9 @@ const repeatKeyWarning_1 = require("../utils/repeatKeyWarning");
|
|
|
30
30
|
const mergeConfig_1 = require("../utils/mergeConfig");
|
|
31
31
|
const createDefaultConfig_1 = require("./createDefaultConfig");
|
|
32
32
|
const debug = (0, utils_1.createDebugger)('resolve-config');
|
|
33
|
-
const showAdditionalPropertiesError = async (error) => {
|
|
34
|
-
if (error.keyword === 'additionalProperties' &&
|
|
35
|
-
error.params.additionalProperty) {
|
|
36
|
-
const target = [
|
|
37
|
-
error.instancePath.slice(1),
|
|
38
|
-
error.params.additionalProperty,
|
|
39
|
-
]
|
|
40
|
-
.filter(Boolean)
|
|
41
|
-
.join('.');
|
|
42
|
-
const name = Object.keys(utils_1.PLUGIN_SCHEMAS).find(key => utils_1.PLUGIN_SCHEMAS[key].some((schemaItem) => schemaItem.target === target));
|
|
43
|
-
if (name) {
|
|
44
|
-
const packageManager = await (0, utils_1.getPackageManager)();
|
|
45
|
-
utils_1.logger.warn(`The configuration of ${utils_1.chalk.bold(target)} is provided by plugin ${utils_1.chalk.bold(name)}. Please use ${utils_1.chalk.bold(`${packageManager} run new`)} to enable the corresponding capability.\n`);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
33
|
const createResolveConfig = async (
|
|
50
34
|
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
51
|
-
loaded, configs, schemas, onSchemaError
|
|
35
|
+
loaded, configs, schemas, onSchemaError) => {
|
|
52
36
|
var _a;
|
|
53
37
|
const { default: Ajv } = await Promise.resolve().then(() => __importStar(require('@modern-js/utils/ajv')));
|
|
54
38
|
const { default: ajvKeywords } = await Promise.resolve().then(() => __importStar(require('@modern-js/utils/ajv-keywords')));
|
|
@@ -71,7 +55,9 @@ loaded, configs, schemas, onSchemaError = showAdditionalPropertiesError) => {
|
|
|
71
55
|
});
|
|
72
56
|
};
|
|
73
57
|
if (!valid && ((_a = validate.errors) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
74
|
-
|
|
58
|
+
if (onSchemaError) {
|
|
59
|
+
await onSchemaError(validate === null || validate === void 0 ? void 0 : validate.errors[0]);
|
|
60
|
+
}
|
|
75
61
|
const errors = formatValidateError(userConfig);
|
|
76
62
|
utils_1.logger.log(errors);
|
|
77
63
|
throw new Error(`Validate configuration error`);
|
package/dist/createCli.js
CHANGED
|
@@ -84,11 +84,12 @@ const createCli = () => {
|
|
|
84
84
|
};
|
|
85
85
|
};
|
|
86
86
|
async function run(options) {
|
|
87
|
+
var _a;
|
|
87
88
|
const { appContext } = await init(options);
|
|
88
89
|
await hooksRunner.commands({ program: utils_1.program });
|
|
89
90
|
await (0, utils_2.createFileWatcher)(appContext, hooksRunner);
|
|
90
91
|
utils_1.program.parse(process.argv);
|
|
91
|
-
if (!utils_1.program.commands ||
|
|
92
|
+
if (!((_a = utils_1.program.commands) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
92
93
|
utils_1.logger.warn('No command found, please make sure you have registered plugins correctly.');
|
|
93
94
|
}
|
|
94
95
|
}
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"modern",
|
|
15
15
|
"modern.js"
|
|
16
16
|
],
|
|
17
|
-
"version": "2.
|
|
17
|
+
"version": "2.23.0",
|
|
18
18
|
"jsnext:source": "./src/index.ts",
|
|
19
19
|
"types": "./dist/index.d.ts",
|
|
20
20
|
"main": "./dist/index.js",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@modern-js/node-bundle-require": "2.
|
|
73
|
-
"@modern-js/plugin": "2.
|
|
74
|
-
"@modern-js/utils": "2.
|
|
72
|
+
"@modern-js/node-bundle-require": "2.23.0",
|
|
73
|
+
"@modern-js/plugin": "2.23.0",
|
|
74
|
+
"@modern-js/utils": "2.23.0"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/jest": "^29",
|
|
@@ -79,15 +79,16 @@
|
|
|
79
79
|
"tsm": "2.3.0",
|
|
80
80
|
"jest": "^29",
|
|
81
81
|
"typescript": "^5",
|
|
82
|
-
"@modern-js/builder-shared": "2.
|
|
83
|
-
"@modern-js/types": "2.
|
|
84
|
-
"@scripts/
|
|
85
|
-
"@scripts/
|
|
82
|
+
"@modern-js/builder-shared": "2.23.0",
|
|
83
|
+
"@modern-js/types": "2.23.0",
|
|
84
|
+
"@scripts/build": "2.23.0",
|
|
85
|
+
"@scripts/jest-config": "2.23.0"
|
|
86
86
|
},
|
|
87
87
|
"sideEffects": false,
|
|
88
88
|
"publishConfig": {
|
|
89
89
|
"registry": "https://registry.npmjs.org/",
|
|
90
|
-
"access": "public"
|
|
90
|
+
"access": "public",
|
|
91
|
+
"provenance": true
|
|
91
92
|
},
|
|
92
93
|
"scripts": {
|
|
93
94
|
"new": "modern-lib new",
|
package/dist/schema/source.d.ts
DELETED
package/dist/schema/source.js
DELETED