@modern-js/core 2.30.0 → 2.31.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,20 @@
1
1
  # @modern-js/core
2
2
 
3
+ ## 2.31.0
4
+
5
+ ### Patch Changes
6
+
7
+ - 2361ce8: feat: support partials html in Document
8
+ feat: 支持 partials html 在 Document 中也生效
9
+ - 4c03d9a: fix(core): remove testing config type and schema
10
+
11
+ fix(core): 移除 testing 配置类型和 schema
12
+
13
+ - Updated dependencies [1882366]
14
+ - @modern-js/utils@2.31.0
15
+ - @modern-js/node-bundle-require@2.31.0
16
+ - @modern-js/plugin@2.31.0
17
+
3
18
  ## 2.30.0
4
19
 
5
20
  ### Patch Changes
@@ -1,19 +1,5 @@
1
1
  import { PluginValidateSchema } from '../types';
2
2
  export declare const patchSchema: (pluginSchemas: Array<PluginValidateSchema | PluginValidateSchema[]>) => {
3
3
  type: string;
4
- properties: {
5
- testing: {
6
- type: string;
7
- additionalProperties: boolean;
8
- properties: {
9
- transformer: {
10
- type: string;
11
- enum: string[];
12
- };
13
- jest: {
14
- typeof: string[];
15
- };
16
- };
17
- };
18
- };
4
+ properties: {};
19
5
  };
@@ -10,15 +10,12 @@ Object.defineProperty(exports, "patchSchema", {
10
10
  });
11
11
  const _utils = require("@modern-js/utils");
12
12
  const _lodash = require("@modern-js/utils/lodash");
13
- const _testing = require("./testing");
14
13
  const debug = (0, _utils.createDebugger)("validate-schema");
15
14
  const patchSchema = (pluginSchemas) => {
16
- const finalSchema = (0, _lodash.cloneDeep)({
15
+ const finalSchema = {
17
16
  type: "object",
18
- properties: {
19
- testing: _testing.testing
20
- }
21
- });
17
+ properties: {}
18
+ };
22
19
  const findTargetNode = (props) => {
23
20
  let node = finalSchema.properties;
24
21
  for (const prop of props) {
@@ -1,16 +1,11 @@
1
1
  import { PluginConfig } from '../plugin';
2
- import type { BaseTestingNormalizedConfig, BaseTestingUserConfig } from './testing';
3
- export type { Jest as JestConfig, BaseTestingUserConfig as TestConfig } from './testing';
4
- type DropUndefined<T> = T extends undefined ? never : T;
5
2
  export type UserConfig<Extends extends {
6
3
  hooks?: ExtendHooks;
7
4
  userConfig?: ExtendUserConfig;
8
5
  normalizedConfig?: ExtendNormalizedConfig;
9
6
  } = {}, ExtendHooks extends Record<string, any> = {}, ExtendUserConfig extends {
10
- testing?: Record<string, any>;
11
7
  [property: string]: any;
12
8
  } = {}, ExtendNormalizedConfig extends Record<string, any> = {}> = {
13
- testing?: BaseTestingUserConfig<DropUndefined<Extends['userConfig']>['testing']>;
14
9
  plugins?: PluginConfig<any>;
15
10
  /**
16
11
  * auto load plugin that exist in the package.json
@@ -18,24 +13,22 @@ export type UserConfig<Extends extends {
18
13
  * **default: `false`**
19
14
  */
20
15
  autoLoadPlugins?: boolean;
21
- } & Omit<Extends['userConfig'], 'plugins' | 'testing'>;
16
+ } & Omit<Extends['userConfig'], 'plugins'>;
22
17
  export type NormalizedConfig<Extends extends {
23
18
  hooks?: ExtendHooks;
24
19
  userConfig?: ExtendUserConfig;
25
20
  normalizedConfig?: ExtendNormalizedConfig;
26
21
  } = {}, ExtendHooks extends Record<string, any> = {}, ExtendUserConfig extends Record<string, any> = {}, ExtendNormalizedConfig extends {
27
- testing?: Record<string, any>;
28
22
  [property: string]: any;
29
23
  } = {}> = {
30
24
  plugins: PluginConfig<any>;
31
- testing: BaseTestingNormalizedConfig<DropUndefined<Extends['normalizedConfig']>['testing']>;
32
25
  /**
33
26
  * Auto load plugin that exist in the package.json
34
27
  *
35
28
  * **default: `false`**
36
29
  */
37
30
  autoLoadPlugins: boolean;
38
- } & Omit<Extends['normalizedConfig'], 'plugins' | 'testing'>;
31
+ } & Omit<Extends['normalizedConfig'], 'plugins'>;
39
32
  export type LoadedConfig<Extends extends {
40
33
  hooks?: ExtendHooks;
41
34
  userConfig?: ExtendUserConfig;
@@ -1,4 +1,4 @@
1
- import { Entrypoint, InternalPlugins, ServerRoute, HtmlTemplates } from '@modern-js/types';
1
+ import { Entrypoint, InternalPlugins, ServerRoute, HtmlTemplates, HtmlPartials } from '@modern-js/types';
2
2
  import { BuilderInstance } from '@modern-js/builder-shared';
3
3
  export type ToolsType = 'app-tools' | 'module-tools' | 'doc-tools' | 'monorepo-tools';
4
4
  export interface IAppContext {
@@ -28,4 +28,5 @@ export interface IAppContext {
28
28
  internalSrcAlias: string;
29
29
  builder?: BuilderInstance;
30
30
  bundlerType?: 'webpack' | 'rspack' | 'esbuild';
31
+ partialsByEntrypoint?: Record<string, HtmlPartials>;
31
32
  }
package/package.json CHANGED
@@ -14,7 +14,7 @@
14
14
  "modern",
15
15
  "modern.js"
16
16
  ],
17
- "version": "2.30.0",
17
+ "version": "2.31.0",
18
18
  "jsnext:source": "./src/index.ts",
19
19
  "types": "./dist/index.d.ts",
20
20
  "main": "./dist/index.js",
@@ -70,9 +70,9 @@
70
70
  },
71
71
  "dependencies": {
72
72
  "@swc/helpers": "0.5.1",
73
- "@modern-js/node-bundle-require": "2.30.0",
74
- "@modern-js/plugin": "2.30.0",
75
- "@modern-js/utils": "2.30.0"
73
+ "@modern-js/node-bundle-require": "2.31.0",
74
+ "@modern-js/plugin": "2.31.0",
75
+ "@modern-js/utils": "2.31.0"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@types/jest": "^29",
@@ -80,10 +80,10 @@
80
80
  "tsm": "2.3.0",
81
81
  "jest": "^29",
82
82
  "typescript": "^5",
83
- "@modern-js/builder-shared": "2.30.0",
84
- "@modern-js/types": "2.30.0",
85
- "@scripts/build": "2.30.0",
86
- "@scripts/jest-config": "2.30.0"
83
+ "@modern-js/builder-shared": "2.31.0",
84
+ "@modern-js/types": "2.31.0",
85
+ "@scripts/build": "2.31.0",
86
+ "@scripts/jest-config": "2.31.0"
87
87
  },
88
88
  "sideEffects": false,
89
89
  "publishConfig": {
@@ -1,13 +0,0 @@
1
- export declare const testing: {
2
- type: string;
3
- additionalProperties: boolean;
4
- properties: {
5
- transformer: {
6
- type: string;
7
- enum: string[];
8
- };
9
- jest: {
10
- typeof: string[];
11
- };
12
- };
13
- };
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });
5
- Object.defineProperty(exports, "testing", {
6
- enumerable: true,
7
- get: function() {
8
- return testing;
9
- }
10
- });
11
- const testing = {
12
- type: "object",
13
- additionalProperties: false,
14
- properties: {
15
- transformer: {
16
- type: "string",
17
- enum: [
18
- "babel-jest",
19
- "ts-jest"
20
- ]
21
- },
22
- jest: {
23
- typeof: [
24
- "object",
25
- "function"
26
- ]
27
- }
28
- }
29
- };
@@ -1,15 +0,0 @@
1
- import type { JestConfigTypes, Merge } from '@modern-js/types';
2
- export type Jest = JestConfigTypes.InitialOptions;
3
- export type BaseTestingUserConfig<ExtendTestingUserConfig = {}> = Merge<{
4
- /**
5
- * Decide which transformer will be used to compile file
6
- * Default: babel-jest
7
- */
8
- transformer?: 'babel-jest' | 'ts-jest';
9
- /**
10
- * Original jest config
11
- * Doc: https://jestjs.io/docs/configuration
12
- */
13
- jest?: Jest | ((jestConfig: Jest) => Jest);
14
- }, ExtendTestingUserConfig>;
15
- export type BaseTestingNormalizedConfig<ExtendTestingNormalizedConfig = {}> = BaseTestingUserConfig<ExtendTestingNormalizedConfig>;
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });