@commitlint/config-lerna-scopes 17.4.2 → 17.6.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.
Files changed (2) hide show
  1. package/index.js +11 -2
  2. package/package.json +4 -4
package/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  const glob = require('glob');
2
2
  const Path = require('path');
3
3
  const importFrom = require('import-from');
4
- const resolvePkg = require('resolve-pkg');
5
4
  const semver = require('semver');
6
5
 
7
6
  module.exports = {
@@ -54,5 +53,15 @@ function getPackages(context) {
54
53
  }
55
54
 
56
55
  function getLernaVersion(cwd) {
57
- return require(Path.join(resolvePkg('lerna', {cwd}), 'package.json')).version;
56
+ const moduleEntrypoint = require.resolve('lerna', {
57
+ paths: [cwd],
58
+ });
59
+ const moduleDir = Path.join(
60
+ moduleEntrypoint.slice(0, moduleEntrypoint.lastIndexOf('node_modules')),
61
+ 'node_modules',
62
+ 'lerna'
63
+ );
64
+ const modulePackageJson = Path.join(moduleDir, 'package.json');
65
+
66
+ return require(modulePackageJson).version;
58
67
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commitlint/config-lerna-scopes",
3
- "version": "17.4.2",
3
+ "version": "17.6.3",
4
4
  "description": "Shareable commitlint config enforcing lerna package and workspace names as scopes",
5
5
  "files": [
6
6
  "index.js"
@@ -38,14 +38,14 @@
38
38
  "node": ">=v14"
39
39
  },
40
40
  "dependencies": {
41
+ "@lerna/project": "^6.0.0",
41
42
  "glob": "^8.0.3",
42
43
  "import-from": "4.0.0",
43
- "resolve-pkg": "2.0.0",
44
- "semver": "7.3.8"
44
+ "semver": "7.5.0"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@commitlint/test": "^17.4.2",
48
48
  "@commitlint/utils": "^17.4.0"
49
49
  },
50
- "gitHead": "3c691ad507293db4ecb7ddd3559afca871c1e0bc"
50
+ "gitHead": "79897098cc356387555f42c63e22c2810e5b61f6"
51
51
  }