@modern-js/plugin-testing 1.3.0 → 1.3.3
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 +44 -0
- package/dist/js/modern/cli/plugins/modern.js +29 -48
- package/dist/js/modern/cli/plugins/modern.test.js +1 -13
- package/dist/js/modern/cli/resolver.js +1 -1
- package/dist/js/modern/cli/test.js +25 -9
- package/dist/js/modern/runtime-testing/base.js +3 -0
- package/dist/js/modern/runtime-testing/index.js +2 -4
- package/dist/js/node/cli/plugins/modern.js +29 -56
- package/dist/js/node/cli/plugins/modern.test.js +0 -12
- package/dist/js/node/cli/resolver.js +1 -1
- package/dist/js/node/cli/test.js +25 -9
- package/dist/js/node/runtime-testing/base.js +41 -0
- package/dist/js/node/runtime-testing/index.js +5 -29
- package/dist/js/treeshaking/cli/plugins/modern.js +4 -27
- package/dist/js/treeshaking/cli/plugins/modern.test.js +1 -13
- package/dist/js/treeshaking/cli/resolver.js +1 -1
- package/dist/js/treeshaking/cli/test.js +35 -15
- package/dist/js/treeshaking/runtime-testing/base.js +3 -0
- package/dist/js/treeshaking/runtime-testing/index.js +2 -4
- package/dist/types/cli/plugins/modern.d.ts +0 -1
- package/{src/runtime-testing/index.ts → dist/types/runtime-testing/base.d.ts} +1 -2
- package/dist/types/runtime-testing/index.d.ts +2 -4
- package/package.json +20 -12
- package/tests/.eslintrc.js +6 -0
- package/tests/resolver.test.ts +30 -0
- package/tests/tsconfig.json +13 -0
- package/type.d.ts +5 -1
- package/src/.eslintrc.json +0 -3
- package/src/cli/index.ts +0 -48
- package/src/cli/plugins/modern.test.ts +0 -68
- package/src/cli/plugins/modern.ts +0 -83
- package/src/cli/resolver.ts +0 -16
- package/src/cli/test.ts +0 -77
- package/src/constant.ts +0 -1
- package/src/index.ts +0 -4
- package/src/runtime-testing/app.ts +0 -48
- package/src/runtime-testing/customRender.ts +0 -11
- package/src/runtime-testing/reduck.ts +0 -38
- package/src/runtime-testing/resolvePlugins.ts +0 -23
@@ -1,23 +0,0 @@
|
|
1
|
-
import { NormalizedConfig } from '@modern-js/core';
|
2
|
-
|
3
|
-
const allowedFeatures = ['router', 'state'];
|
4
|
-
|
5
|
-
export default function resolvePlugins(features: NormalizedConfig['runtime']) {
|
6
|
-
const plugins: any[] = [];
|
7
|
-
|
8
|
-
if (!features) {
|
9
|
-
return plugins;
|
10
|
-
}
|
11
|
-
|
12
|
-
Object.keys(features).forEach(feature => {
|
13
|
-
if (allowedFeatures.includes(feature)) {
|
14
|
-
const curPluginRes = require(`@modern-js/runtime/plugins`)[feature]({
|
15
|
-
...features[feature],
|
16
|
-
});
|
17
|
-
|
18
|
-
plugins.push(curPluginRes);
|
19
|
-
}
|
20
|
-
});
|
21
|
-
|
22
|
-
return plugins;
|
23
|
-
}
|