@modern-js/app-tools 1.1.6-canary-1640875965779 → 1.3.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,74 @@
1
1
  # @modern-js/app-tools
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 823809c6: fix: remove plugin-polyfill from app-tools
8
+ - Updated dependencies [e2d3a575]
9
+ - Updated dependencies [823809c6]
10
+ - Updated dependencies [823809c6]
11
+ - Updated dependencies [4584cc04]
12
+ - Updated dependencies [7c19fd94]
13
+ - Updated dependencies [e2d3a575]
14
+ - @modern-js/server@1.3.1
15
+ - @modern-js/utils@1.2.1
16
+ - @modern-js/core@1.3.1
17
+
18
+ ## 1.3.0
19
+
20
+ ### Minor Changes
21
+
22
+ - cfe11628: Make Modern.js self bootstraping
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [2da09c69]
27
+ - Updated dependencies [e2464fe5]
28
+ - Updated dependencies [5597289b]
29
+ - Updated dependencies [fc71e36f]
30
+ - Updated dependencies [4a85378c]
31
+ - Updated dependencies [146dcd85]
32
+ - Updated dependencies [e453e421]
33
+ - Updated dependencies [2c049918]
34
+ - Updated dependencies [c3d46ee4]
35
+ - Updated dependencies [cfe11628]
36
+ - Updated dependencies [1ebc7ee2]
37
+ - Updated dependencies [146dcd85]
38
+ - Updated dependencies [146dcd85]
39
+ - Updated dependencies [1ebc7ee2]
40
+ - @modern-js/utils@1.2.0
41
+ - @modern-js/types@1.2.0
42
+ - @modern-js/webpack@1.2.0
43
+ - @modern-js/core@1.3.0
44
+ - @modern-js/server@1.3.0
45
+ - @modern-js/new-action@1.3.0
46
+ - @modern-js/i18n-cli-language-detector@1.2.0
47
+ - @modern-js/plugin-analyze@1.2.0
48
+ - @modern-js/plugin-fast-refresh@1.2.0
49
+ - @modern-js/plugin-i18n@1.2.0
50
+ - @modern-js/plugin-polyfill@1.2.0
51
+ - @modern-js/plugin@1.2.0
52
+
53
+ ## 1.2.0
54
+
55
+ ### Minor Changes
56
+
57
+ - 212f749f: fix(app-tools): app-tools exported types
58
+
59
+ ### Patch Changes
60
+
61
+ - Updated dependencies [e51b1db3]
62
+ - Updated dependencies [5e3de7d8]
63
+ - Updated dependencies [4819a3c7]
64
+ - Updated dependencies [b7fb82ec]
65
+ - Updated dependencies [81d93503]
66
+ - @modern-js/server@1.2.1
67
+ - @modern-js/types@1.1.5
68
+ - @modern-js/plugin-i18n@1.1.2
69
+ - @modern-js/new-action@1.2.2
70
+ - @modern-js/utils@1.1.6
71
+
3
72
  ## 1.1.5
4
73
 
5
74
  ### Patch Changes
@@ -12,7 +12,7 @@ import { start } from "./commands/start";
12
12
  import { dev } from "./commands/dev";
13
13
  export { defineConfig }; // eslint-disable-next-line react-hooks/rules-of-hooks
14
14
 
15
- usePlugins([require.resolve('@modern-js/plugin-analyze/cli'), require.resolve('@modern-js/plugin-fast-refresh/cli'), require.resolve('@modern-js/plugin-polyfill/cli')]);
15
+ usePlugins([require.resolve('@modern-js/plugin-analyze/cli'), require.resolve('@modern-js/plugin-fast-refresh/cli')]);
16
16
  export default createPlugin(() => {
17
17
  const locale = getLocaleLanguage();
18
18
  i18n.changeLanguage({
@@ -66,7 +66,8 @@ export const createCompiler = async ({
66
66
  } catch (err) {
67
67
  logger.log(chalk.red(`Failed to compile.`));
68
68
  logger.log();
69
- logger.log(err); // eslint-disable-next-line no-process-exit
69
+ logger.log(err); // FIXME: 这里最好抛出异常,执行 process.exit 的地方尽可能少或者控制在几个统一的地方比较合适
70
+ // eslint-disable-next-line no-process-exit
70
71
 
71
72
  process.exit(1);
72
73
  }
@@ -34,7 +34,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
34
34
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
35
35
 
36
36
  // eslint-disable-next-line react-hooks/rules-of-hooks
37
- (0, _core.usePlugins)([require.resolve('@modern-js/plugin-analyze/cli'), require.resolve('@modern-js/plugin-fast-refresh/cli'), require.resolve('@modern-js/plugin-polyfill/cli')]);
37
+ (0, _core.usePlugins)([require.resolve('@modern-js/plugin-analyze/cli'), require.resolve('@modern-js/plugin-fast-refresh/cli')]);
38
38
 
39
39
  var _default = (0, _core.createPlugin)(() => {
40
40
  const locale = (0, _language.getLocaleLanguage)();
@@ -85,7 +85,8 @@ const createCompiler = async ({
85
85
 
86
86
  _utils.logger.log();
87
87
 
88
- _utils.logger.log(err); // eslint-disable-next-line no-process-exit
88
+ _utils.logger.log(err); // FIXME: 这里最好抛出异常,执行 process.exit 的地方尽可能少或者控制在几个统一的地方比较合适
89
+ // eslint-disable-next-line no-process-exit
89
90
 
90
91
 
91
92
  process.exit(1);
package/jest.config.js ADDED
@@ -0,0 +1,8 @@
1
+ const sharedConfig = require('@scripts/jest-config');
2
+
3
+ /** @type {import('@jest/types').Config.InitialOptions} */
4
+ module.exports = {
5
+ // eslint-disable-next-line node/no-unsupported-features/es-syntax
6
+ ...sharedConfig,
7
+ rootDir: __dirname,
8
+ };
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "1.1.6-canary-1640875965779",
14
+ "version": "1.3.1",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -20,20 +20,27 @@
20
20
  "exports": {
21
21
  ".": {
22
22
  "node": {
23
+ "jsnext:source": "./src/index.ts",
23
24
  "import": "./dist/js/modern/index.js",
24
25
  "require": "./dist/js/node/index.js"
25
26
  },
26
27
  "default": "./dist/js/treeshaking/index.js"
27
28
  },
28
- "./cli": "./dist/js/node/index.js",
29
- "./type": "./lib/types.d.ts"
29
+ "./cli": {
30
+ "jsnext:source": "./src/index.ts",
31
+ "default": "./dist/js/node/index.js"
32
+ },
33
+ "./type": {
34
+ "jsnext:source": "./lib/types.d.ts",
35
+ "default": "./lib/types.d.ts"
36
+ }
30
37
  },
31
38
  "typesVersions": {
32
39
  "*": {
33
40
  ".": [
34
41
  "./dist/types/index.d.ts"
35
42
  ],
36
- "type": [
43
+ "types": [
37
44
  "./lib/types.d.ts"
38
45
  ]
39
46
  }
@@ -41,27 +48,19 @@
41
48
  "bin": {
42
49
  "modern": "./bin/modern.js"
43
50
  },
44
- "scripts": {
45
- "prepare": "pnpm build",
46
- "prepublishOnly": "pnpm build -- --platform",
47
- "new": "modern new",
48
- "build": "modern build",
49
- "test": "modern test --passWithNoTests"
50
- },
51
51
  "dependencies": {
52
52
  "@babel/runtime": "^7",
53
- "@modern-js/core": "workspace:^1.1.4",
54
- "@modern-js/types": "workspace:^1.1.3",
55
- "@modern-js/i18n-cli-language-detector": "workspace:^1.1.1",
56
- "@modern-js/new-action": "workspace:^1.1.5",
57
- "@modern-js/plugin": "workspace:^1.1.2",
58
- "@modern-js/plugin-analyze": "workspace:^1.1.1",
59
- "@modern-js/plugin-fast-refresh": "workspace:^1.1.1",
60
- "@modern-js/plugin-i18n": "workspace:^1.1.1",
61
- "@modern-js/plugin-polyfill": "workspace:^1.1.1",
62
- "@modern-js/server": "workspace:^1.1.4",
63
- "@modern-js/utils": "workspace:^1.1.4",
64
- "@modern-js/webpack": "workspace:^1.1.3",
53
+ "@modern-js/core": "^1.3.1",
54
+ "@modern-js/types": "^1.2.0",
55
+ "@modern-js/i18n-cli-language-detector": "^1.2.0",
56
+ "@modern-js/new-action": "^1.3.0",
57
+ "@modern-js/plugin": "^1.2.0",
58
+ "@modern-js/plugin-analyze": "^1.2.0",
59
+ "@modern-js/plugin-fast-refresh": "^1.2.0",
60
+ "@modern-js/plugin-i18n": "^1.2.0",
61
+ "@modern-js/server": "^1.3.1",
62
+ "@modern-js/utils": "^1.2.1",
63
+ "@modern-js/webpack": "^1.2.0",
65
64
  "webpack": "^5.54.0"
66
65
  },
67
66
  "devDependencies": {
@@ -70,8 +69,9 @@
70
69
  "@types/react": "^17",
71
70
  "@types/react-dom": "^17",
72
71
  "typescript": "^4",
73
- "@modern-js/plugin-testing": "^1.1.1",
74
- "@modern-js/module-tools": "^1.1.2"
72
+ "@scripts/build": "0.0.0",
73
+ "jest": "^27",
74
+ "@scripts/jest-config": "0.0.0"
75
75
  },
76
76
  "sideEffects": false,
77
77
  "modernConfig": {
@@ -81,6 +81,13 @@
81
81
  },
82
82
  "publishConfig": {
83
83
  "registry": "https://registry.npmjs.org/",
84
- "access": "public"
85
- }
86
- }
84
+ "access": "public",
85
+ "types": "./dist/types/index.d.ts"
86
+ },
87
+ "scripts": {
88
+ "new": "modern new",
89
+ "build": "modern build",
90
+ "test": "jest --passWithNoTests"
91
+ },
92
+ "readme": "\n<p align=\"center\">\n <a href=\"https://modernjs.dev\" target=\"blank\"><img src=\"https://lf3-static.bytednsdoc.com/obj/eden-cn/ylaelkeh7nuhfnuhf/modernjs-cover.png\" width=\"300\" alt=\"Modern.js Logo\" /></a>\n</p>\n<p align=\"center\">\n现代 Web 工程体系\n <br/>\n <a href=\"https://modernjs.dev\" target=\"blank\">\n modernjs.dev\n </a>\n</p>\n<p align=\"center\">\n The meta-framework suite designed from scratch for frontend-focused modern web development\n</p>\n\n# Introduction\n\n> The doc site ([modernjs.dev](https://modernjs.dev)) and articles are only available in Chinese for now, we are planning to add English versions soon.\n\n- [Modern.js: Hello, World!](https://zhuanlan.zhihu.com/p/426707646)\n\n## Getting Started\n\n- [Quick Start](https://modernjs.dev/docs/start)\n- [Guides](https://modernjs.dev/docs/guides)\n- [API References](https://modernjs.dev/docs/apis)\n\n## Contributing\n\n- [Contributing Guide](https://github.com/modern-js-dev/modern.js/blob/main/CONTRIBUTING.md)\n"
93
+ }
package/src/index.ts CHANGED
@@ -11,7 +11,6 @@ export { defineConfig };
11
11
  usePlugins([
12
12
  require.resolve('@modern-js/plugin-analyze/cli'),
13
13
  require.resolve('@modern-js/plugin-fast-refresh/cli'),
14
- require.resolve('@modern-js/plugin-polyfill/cli'),
15
14
  ]);
16
15
 
17
16
  export default createPlugin(
@@ -74,6 +74,7 @@ export const createCompiler = async ({
74
74
  logger.log(chalk.red(`Failed to compile.`));
75
75
  logger.log();
76
76
  logger.log(err as any);
77
+ // FIXME: 这里最好抛出异常,执行 process.exit 的地方尽可能少或者控制在几个统一的地方比较合适
77
78
  // eslint-disable-next-line no-process-exit
78
79
  process.exit(1);
79
80
  }
@@ -0,0 +1,7 @@
1
+ import plugin from '../src';
2
+
3
+ describe('app-tools', () => {
4
+ it('default', () => {
5
+ expect(plugin).toBeDefined();
6
+ });
7
+ });
package/tsconfig.json CHANGED
@@ -8,9 +8,7 @@
8
8
  "baseUrl": "./",
9
9
  "skipLibCheck": true,
10
10
  "isolatedModules": true,
11
- "paths": {
12
- "@/*": ["./src/*"]
13
- }
11
+ "paths": {}
14
12
  },
15
13
  "include": ["src"]
16
14
  }