@modern-js/utils 2.0.2 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 8a9482c: feat(builder): add new option `html.tags` & `html.tagsByEntries`
8
+
9
+ feat(builder): 添加新的配置项 `html.tags` 和 `html.tagsByEntries`
10
+
11
+ ### Patch Changes
12
+
13
+ - 837620c: fix: Disable detect tsconfig.json
14
+ fix: 禁用探测 tsconfig.json
15
+
3
16
  ## 2.0.2
4
17
 
5
18
  ## 2.0.1
package/dist/chainId.d.ts CHANGED
@@ -161,6 +161,8 @@ export declare const CHAIN_ID: {
161
161
  readonly HTML_ASYNC_CHUNK: "html-async-chunk";
162
162
  /** SWC_POLYFILL_CHECKER */
163
163
  readonly SWC_POLYFILL_CHECKER: "swc-polyfill-checker-plugin";
164
+ /** HtmlTagsPlugin */
165
+ readonly HTML_TAGS: "html-tags";
164
166
  };
165
167
  /** Predefined minimizers */
166
168
  readonly MINIMIZER: {
package/dist/chainId.js CHANGED
@@ -164,6 +164,8 @@ exports.CHAIN_ID = {
164
164
  HTML_ASYNC_CHUNK: 'html-async-chunk',
165
165
  /** SWC_POLYFILL_CHECKER */
166
166
  SWC_POLYFILL_CHECKER: 'swc-polyfill-checker-plugin',
167
+ /** HtmlTagsPlugin */
168
+ HTML_TAGS: 'html-tags',
167
169
  },
168
170
  /** Predefined minimizers */
169
171
  MINIMIZER: {
package/dist/index.d.ts CHANGED
@@ -40,3 +40,4 @@ export * from './plugin';
40
40
  export * from './routes';
41
41
  export * from './test-utils';
42
42
  export * from './getCoreJsVersion';
43
+ export * from './react';
package/dist/index.js CHANGED
@@ -56,3 +56,4 @@ __exportStar(require("./plugin"), exports);
56
56
  __exportStar(require("./routes"), exports);
57
57
  __exportStar(require("./test-utils"), exports);
58
58
  __exportStar(require("./getCoreJsVersion"), exports);
59
+ __exportStar(require("./react"), exports);
@@ -0,0 +1 @@
1
+ export declare const isBeyondReact17: (cwd: string) => boolean;
package/dist/react.js ADDED
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.isBeyondReact17 = void 0;
7
+ const path_1 = __importDefault(require("path"));
8
+ const _1 = require(".");
9
+ const isBeyondReact17 = (cwd) => {
10
+ const pkgPath = path_1.default.join(cwd, 'package.json');
11
+ if (!_1.fs.existsSync(pkgPath)) {
12
+ return false;
13
+ }
14
+ const pkgInfo = JSON.parse(_1.fs.readFileSync(pkgPath, 'utf8'));
15
+ const deps = {
16
+ ...pkgInfo.devDependencies,
17
+ ...pkgInfo.dependencies,
18
+ };
19
+ if (typeof deps.react !== 'string') {
20
+ return false;
21
+ }
22
+ return _1.semver.satisfies(_1.semver.minVersion(deps.react), '>=17.0.0');
23
+ };
24
+ exports.isBeyondReact17 = isBeyondReact17;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.0.2",
14
+ "version": "2.1.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",
@@ -134,9 +134,9 @@
134
134
  "jest": "^27",
135
135
  "typescript": "^4",
136
136
  "webpack": "^5.75.0",
137
- "@modern-js/types": "2.0.2",
138
- "@scripts/jest-config": "2.0.2",
139
- "@scripts/build": "2.0.2"
137
+ "@modern-js/types": "2.1.0",
138
+ "@scripts/jest-config": "2.1.0",
139
+ "@scripts/build": "2.1.0"
140
140
  },
141
141
  "sideEffects": false,
142
142
  "scripts": {