@modern-js/utils 0.0.0-runtime-20211121141552 → 0.0.0-runtime-2021112115358

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @modern-js/utils
2
2
 
3
- ## 0.0.0-runtime-20211121141552
3
+ ## 0.0.0-runtime-2021112115358
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 8698465e: fix: dependence version
7
+ - a1795c10: feat: add exclude plugin
8
8
 
9
9
  ## 1.1.4
10
10
 
@@ -14,9 +14,10 @@ export const isDepExists = (appDirectory, name) => {
14
14
 
15
15
  const {
16
16
  dependencies = {},
17
- devDependencies = {}
17
+ devDependencies = {},
18
+ excludePlugin = {}
18
19
  } = json;
19
- return dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name);
20
+ return (dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)) && !excludePlugin.hasOwnProperty(name);
20
21
  };
21
22
  /**
22
23
  * Is typescript project.
@@ -73,9 +73,10 @@ const isDepExists = (appDirectory, name) => {
73
73
 
74
74
  const {
75
75
  dependencies = {},
76
- devDependencies = {}
76
+ devDependencies = {},
77
+ excludePlugin = {}
77
78
  } = json;
78
- return dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name);
79
+ return (dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)) && !excludePlugin.hasOwnProperty(name);
79
80
  };
80
81
  /**
81
82
  * Is typescript project.
@@ -15,8 +15,10 @@ export var isDepExists = function isDepExists(appDirectory, name) {
15
15
  var _json$dependencies = json.dependencies,
16
16
  dependencies = _json$dependencies === void 0 ? {} : _json$dependencies,
17
17
  _json$devDependencies = json.devDependencies,
18
- devDependencies = _json$devDependencies === void 0 ? {} : _json$devDependencies;
19
- return dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name);
18
+ devDependencies = _json$devDependencies === void 0 ? {} : _json$devDependencies,
19
+ _json$excludePlugin = json.excludePlugin,
20
+ excludePlugin = _json$excludePlugin === void 0 ? {} : _json$excludePlugin;
21
+ return (dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)) && !excludePlugin.hasOwnProperty(name);
20
22
  };
21
23
  /**
22
24
  * Is typescript project.
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "0.0.0-runtime-20211121141552",
14
+ "version": "0.0.0-runtime-2021112115358",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/js/node/index.js",
@@ -63,13 +63,13 @@
63
63
  "@types/jest": "^26",
64
64
  "@types/node": "^14",
65
65
  "@types/recursive-readdir": "^2.2.0",
66
- "typescript": "^4.4.4",
66
+ "typescript": "^4",
67
67
  "webpack": "^5.54.0",
68
- "@modern-js/plugin-testing": "^0.0.0-runtime-20211121141552",
69
- "@modern-js/module-tools": "^0.0.0-runtime-20211121141552"
68
+ "@modern-js/plugin-testing": "^1.1.1",
69
+ "@modern-js/module-tools": "^1.1.2"
70
70
  },
71
71
  "peerDependencies": {
72
- "typescript": "^4.4.4"
72
+ "typescript": "^4.4.3"
73
73
  },
74
74
  "sideEffects": false,
75
75
  "publishConfig": {
package/src/is/index.ts CHANGED
@@ -12,10 +12,12 @@ import { isDev } from './node-env';
12
12
  export const isDepExists = (appDirectory: string, name: string): boolean => {
13
13
  const json = require(path.resolve(appDirectory, './package.json'));
14
14
 
15
- const { dependencies = {}, devDependencies = {} } = json;
15
+ const { dependencies = {}, devDependencies = {}, excludePlugin = {} } = json;
16
16
 
17
17
  return (
18
- dependencies.hasOwnProperty(name) || devDependencies.hasOwnProperty(name)
18
+ (dependencies.hasOwnProperty(name) ||
19
+ devDependencies.hasOwnProperty(name)) &&
20
+ !excludePlugin.hasOwnProperty(name)
19
21
  );
20
22
  };
21
23