@commitlint/config-lerna-scopes 18.6.1 → 19.5.0

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 (3) hide show
  1. package/index.js +10 -7
  2. package/package.json +10 -7
  3. package/readme.md +6 -6
package/index.js CHANGED
@@ -1,9 +1,13 @@
1
- const glob = require('glob');
2
- const Path = require('path');
3
- const importFrom = require('import-from');
4
- const semver = require('semver');
1
+ import {createRequire} from 'module';
2
+ import Path from 'path';
5
3
 
6
- module.exports = {
4
+ import {globSync} from 'glob';
5
+ import importFrom from 'import-from';
6
+ import semver from 'semver';
7
+
8
+ const require = createRequire(import.meta.url);
9
+
10
+ export default {
7
11
  utils: {getPackages},
8
12
  rules: {
9
13
  'scope-enum': (ctx) =>
@@ -23,7 +27,7 @@ function getPackages(context) {
23
27
 
24
28
  const wsGlobs = workspaces.flatMap((ws) => {
25
29
  const path = Path.posix.join(ws, 'package.json');
26
- return glob.sync(path, {cwd, ignore: ['**/node_modules/**']});
30
+ return globSync(path, {cwd, ignore: ['**/node_modules/**']});
27
31
  });
28
32
 
29
33
  return wsGlobs.map((pJson) => require(Path.join(cwd, pJson)));
@@ -62,6 +66,5 @@ function getLernaVersion(cwd) {
62
66
  'lerna'
63
67
  );
64
68
  const modulePackageJson = Path.join(moduleDir, 'package.json');
65
-
66
69
  return require(modulePackageJson).version;
67
70
  }
package/package.json CHANGED
@@ -1,7 +1,9 @@
1
1
  {
2
2
  "name": "@commitlint/config-lerna-scopes",
3
- "version": "18.6.1",
3
+ "type": "module",
4
+ "version": "19.5.0",
4
5
  "description": "Shareable commitlint config enforcing lerna package and workspace names as scopes",
6
+ "main": "index.js",
5
7
  "files": [
6
8
  "index.js"
7
9
  ],
@@ -39,13 +41,14 @@
39
41
  },
40
42
  "dependencies": {
41
43
  "@lerna/project": "^6.0.0",
42
- "glob": "^8.0.3",
43
- "import-from": "4.0.0",
44
- "semver": "7.6.0"
44
+ "glob": "^10.3.10",
45
+ "import-from": "^4.0.0",
46
+ "semver": "^7.6.0"
45
47
  },
46
48
  "devDependencies": {
47
- "@commitlint/test": "^18.0.0",
48
- "@commitlint/utils": "^18.6.1"
49
+ "@commitlint/test": "^19.5.0",
50
+ "@commitlint/utils": "^19.5.0",
51
+ "@types/glob": "^8.1.0"
49
52
  },
50
- "gitHead": "89f5bf91d1c11b1f457a6f0d99b8ea34583a9311"
53
+ "gitHead": "7e79af18b7500cda0e38f35944ee08b0b312c006"
51
54
  }
package/readme.md CHANGED
@@ -1,20 +1,20 @@
1
- > Lint your lerna project commits
2
-
3
1
  # @commitlint/config-lerna-scopes
4
2
 
3
+ Lint your lerna project commits
4
+
5
5
  Shareable `commitlint` config enforcing lerna package and workspace names as scopes.
6
6
  Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).
7
7
 
8
8
  ## Getting started
9
9
 
10
- ```
10
+ ```sh
11
11
  npm install --save-dev @commitlint/config-lerna-scopes @commitlint/cli
12
- echo "module.exports = {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
12
+ echo "export default {extends: ['@commitlint/config-lerna-scopes']};" > commitlint.config.js
13
13
  ```
14
14
 
15
15
  ## Examples
16
16
 
17
- ```
17
+ ```text
18
18
  ❯ cat commitlint.config.js
19
19
  {
20
20
  extends: ['@commitlint/config-lerna-scopes']
@@ -41,4 +41,4 @@ packages
41
41
  ✔ found 0 problems, 0 warnings
42
42
  ```
43
43
 
44
- Consult [docs/rules](https://conventional-changelog.github.io/commitlint/#/reference-rules) for a list of available rules.
44
+ Consult [Rules reference](https://commitlint.js.org/reference/rules) for a list of available rules.