@modern-js/plugin-testing 2.67.11 → 2.68.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.
@@ -85,7 +85,7 @@ const testingPlugin = () => {
85
85
  const appContext = api.useAppContext();
86
86
  testingExportsUtils = (0, import_utils.createRuntimeExportsUtils)(appContext.internalDirectory, "testing");
87
87
  return {
88
- source: {
88
+ resolve: {
89
89
  alias: {
90
90
  // The module-tools alias configuration is different and more specific than app-tools.
91
91
  // So for the time being, the @ alias is configured here.
@@ -101,13 +101,14 @@ const testingPlugin = () => {
101
101
  testingExportsUtils.addExport(`export * from '${testingPath}'`);
102
102
  },
103
103
  jestConfig: async (utils, next) => {
104
+ var _userConfig_resolve;
104
105
  const appContext = api.useAppContext();
105
106
  const userConfig = api.useResolvedConfigContext();
106
107
  const apiOnly = await (0, import_utils.isApiOnly)(appContext.appDirectory);
107
108
  if (apiOnly) {
108
109
  return next(utils);
109
110
  }
110
- const alias = (0, import_utils.mergeAlias)(userConfig.source.alias);
111
+ const alias = (0, import_utils.mergeAlias)(((_userConfig_resolve = userConfig.resolve) === null || _userConfig_resolve === void 0 ? void 0 : _userConfig_resolve.alias) || {});
111
112
  if (testingExportsUtils) {
112
113
  alias["@modern-js/runtime/testing"] = [
113
114
  testingExportsUtils.getPath()
@@ -66,7 +66,7 @@ var testingPlugin = function() {
66
66
  var appContext = api.useAppContext();
67
67
  testingExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "testing");
68
68
  return {
69
- source: {
69
+ resolve: {
70
70
  alias: {
71
71
  // The module-tools alias configuration is different and more specific than app-tools.
72
72
  // So for the time being, the @ alias is configured here.
@@ -83,7 +83,7 @@ var testingPlugin = function() {
83
83
  },
84
84
  jestConfig: function() {
85
85
  var _ref = _async_to_generator(function(utils, next) {
86
- var appContext, userConfig, apiOnly, alias;
86
+ var _userConfig_resolve, appContext, userConfig, apiOnly, alias;
87
87
  return _ts_generator(this, function(_state) {
88
88
  switch (_state.label) {
89
89
  case 0:
@@ -101,7 +101,7 @@ var testingPlugin = function() {
101
101
  next(utils)
102
102
  ];
103
103
  }
104
- alias = mergeAlias(userConfig.source.alias);
104
+ alias = mergeAlias(((_userConfig_resolve = userConfig.resolve) === null || _userConfig_resolve === void 0 ? void 0 : _userConfig_resolve.alias) || {});
105
105
  if (testingExportsUtils) {
106
106
  alias["@modern-js/runtime/testing"] = [
107
107
  testingExportsUtils.getPath()
@@ -49,7 +49,7 @@ const testingPlugin = () => {
49
49
  const appContext = api.useAppContext();
50
50
  testingExportsUtils = createRuntimeExportsUtils(appContext.internalDirectory, "testing");
51
51
  return {
52
- source: {
52
+ resolve: {
53
53
  alias: {
54
54
  // The module-tools alias configuration is different and more specific than app-tools.
55
55
  // So for the time being, the @ alias is configured here.
@@ -65,13 +65,14 @@ const testingPlugin = () => {
65
65
  testingExportsUtils.addExport(`export * from '${testingPath}'`);
66
66
  },
67
67
  jestConfig: async (utils, next) => {
68
+ var _userConfig_resolve;
68
69
  const appContext = api.useAppContext();
69
70
  const userConfig = api.useResolvedConfigContext();
70
71
  const apiOnly = await isApiOnly(appContext.appDirectory);
71
72
  if (apiOnly) {
72
73
  return next(utils);
73
74
  }
74
- const alias = mergeAlias(userConfig.source.alias);
75
+ const alias = mergeAlias(((_userConfig_resolve = userConfig.resolve) === null || _userConfig_resolve === void 0 ? void 0 : _userConfig_resolve.alias) || {});
75
76
  if (testingExportsUtils) {
76
77
  alias["@modern-js/runtime/testing"] = [
77
78
  testingExportsUtils.getPath()
@@ -12,6 +12,9 @@ export type UserConfig = {
12
12
  source?: {
13
13
  alias?: AliasOption;
14
14
  };
15
+ resolve?: {
16
+ alias?: AliasOption;
17
+ };
15
18
  testing?: TestConfig;
16
19
  tools?: {
17
20
  jest: JestConfig | ((config: JestConfig) => JestConfig);
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.67.11",
18
+ "version": "2.68.1",
19
19
  "jsnext:source": "./src/cli/index.ts",
20
20
  "types": "./dist/types/cli/index.d.ts",
21
21
  "main": "./dist/cjs/cli/index.js",
@@ -126,23 +126,23 @@
126
126
  "identity-obj-proxy": "^3.0.0",
127
127
  "jest": "^29",
128
128
  "jest-environment-jsdom": "^29.5.0",
129
- "path-to-regexp": "^6.2.0",
129
+ "path-to-regexp": "^6.3.0",
130
130
  "supertest": "^6.1.6",
131
131
  "ts-jest": "^29.1.0",
132
132
  "yargs": "^17.0.1",
133
- "@modern-js/babel-compiler": "2.67.11",
134
- "@modern-js/babel-preset": "2.67.11",
135
- "@modern-js/bff-core": "2.67.11",
136
- "@modern-js/plugin": "2.67.11",
137
- "@modern-js/prod-server": "2.67.11",
138
- "@modern-js/server-core": "2.67.11",
139
- "@modern-js/types": "2.67.11",
140
- "@modern-js/utils": "2.67.11"
133
+ "@modern-js/babel-compiler": "2.68.1",
134
+ "@modern-js/babel-preset": "2.68.1",
135
+ "@modern-js/bff-core": "2.68.1",
136
+ "@modern-js/plugin": "2.68.1",
137
+ "@modern-js/prod-server": "2.68.1",
138
+ "@modern-js/types": "2.68.1",
139
+ "@modern-js/server-core": "2.68.1",
140
+ "@modern-js/utils": "2.68.1"
141
141
  },
142
142
  "peerDependencies": {
143
143
  "react": ">=17",
144
144
  "react-dom": ">=17",
145
- "@modern-js/runtime": "^2.67.11"
145
+ "@modern-js/runtime": "^2.68.1"
146
146
  },
147
147
  "peerDependenciesMeta": {
148
148
  "@modern-js/runtime": {
@@ -159,8 +159,8 @@
159
159
  "react": "^18.3.1",
160
160
  "react-dom": "^18.3.1",
161
161
  "typescript": "^5",
162
- "@modern-js/core": "2.67.11",
163
- "@modern-js/runtime": "2.67.11",
162
+ "@modern-js/runtime": "2.68.1",
163
+ "@modern-js/core": "2.68.1",
164
164
  "@scripts/build": "2.66.0",
165
165
  "@scripts/jest-config": "2.66.0"
166
166
  },