@modern-js/core 2.22.1 → 2.23.1

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,40 @@
1
1
  # @modern-js/core
2
2
 
3
+ ## 2.23.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [f08bbfc]
8
+ - Updated dependencies [a6b313a]
9
+ - Updated dependencies [8f2cab0]
10
+ - @modern-js/utils@2.23.1
11
+ - @modern-js/node-bundle-require@2.23.1
12
+ - @modern-js/plugin@2.23.1
13
+
14
+ ## 2.23.0
15
+
16
+ ### Patch Changes
17
+
18
+ - 7e6fb5f: chore: publishConfig add provenance config
19
+
20
+ chore: publishConfig 增加 provenance 配置
21
+
22
+ - b593040: fix(app-tools): incorrect tools.tailwindcss schema
23
+
24
+ fix(app-tools): 修复 tools.tailwindcss schema 错误
25
+
26
+ - c3216b5: chore: split the scheme into the plugin
27
+
28
+ chore: 拆分 scheme 到插件内部
29
+
30
+ - Updated dependencies [7e6fb5f]
31
+ - Updated dependencies [a7a7ad7]
32
+ - Updated dependencies [6dec7c2]
33
+ - Updated dependencies [c3216b5]
34
+ - @modern-js/node-bundle-require@2.23.0
35
+ - @modern-js/plugin@2.23.0
36
+ - @modern-js/utils@2.23.0
37
+
3
38
  ## 2.22.1
4
39
 
5
40
  ### 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 = showAdditionalPropertiesError) => {
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
- await onSchemaError(validate === null || validate === void 0 ? void 0 : validate.errors[0]);
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/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "modern",
15
15
  "modern.js"
16
16
  ],
17
- "version": "2.22.1",
17
+ "version": "2.23.1",
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.22.1",
73
- "@modern-js/plugin": "2.22.1",
74
- "@modern-js/utils": "2.22.1"
72
+ "@modern-js/node-bundle-require": "2.23.1",
73
+ "@modern-js/plugin": "2.23.1",
74
+ "@modern-js/utils": "2.23.1"
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.22.1",
83
- "@modern-js/types": "2.22.1",
84
- "@scripts/jest-config": "2.22.1",
85
- "@scripts/build": "2.22.1"
82
+ "@modern-js/builder-shared": "2.23.1",
83
+ "@modern-js/types": "2.23.1",
84
+ "@scripts/build": "2.23.1",
85
+ "@scripts/jest-config": "2.23.1"
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",
@@ -1,9 +0,0 @@
1
- export declare const source: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- designSystem: {
6
- type: string;
7
- };
8
- };
9
- };
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.source = void 0;
4
- exports.source = {
5
- type: 'object',
6
- additionalProperties: false,
7
- properties: {
8
- designSystem: { type: 'object' },
9
- },
10
- };