Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
feat(config-lerna-scopes): support yarn workspaces
  • Loading branch information
sergioramos committed Dec 15, 2020
commit 65085100313d092a826be1320dfdcfeb3af42981
6 changes: 3 additions & 3 deletions @commitlint/config-lerna-scopes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ function getPackages(context) {
if (Array.isArray(workspaces) && workspaces.length) {
// use yarn workspaces
return Globby(
workspaces.map((ws) =>
Path.join(ws.replace(/\//, Path.sep), 'package.json')
),
workspaces.map((ws) => {
return Path.posix.join(ws, 'package.json');
}),
{cwd}
).then((pJsons = []) => {
return pJsons.map((pJson) => require(Path.join(cwd, pJson)));
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,5 @@ test('returns expected value for yarn workspaces', async () => {
const {'scope-enum': fn} = config.rules;
const cwd = Path.join(__dirname, 'fixtures', 'yarn');
const [, , value] = await fn({cwd});
expect(value).toEqual(['a', 'b']);
expect(value.sort()).toEqual(['a', 'b']);
});
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@commitlint/config-lerna-scopes",
"version": "11.0.0",
"description": "Shareable commitlint config enforcing lerna package names as scopes",
"description": "Shareable commitlint config enforcing lerna package and workspace names as scopes",
"files": [
"index.js"
],
Expand Down
2 changes: 1 addition & 1 deletion @commitlint/config-lerna-scopes/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# @commitlint/config-lerna-scopes

Shareable `commitlint` config enforcing lerna/yarn package/workspace names as scopes.
Shareable `commitlint` config enforcing lerna package and workspace names as scopes.
Use with [@commitlint/cli](../cli) and [@commitlint/prompt-cli](../prompt-cli).

## Getting started
Expand Down
17 changes: 1 addition & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7156,26 +7156,11 @@ lodash.uniq@^4.5.0:
resolved "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=

[email protected]:
version "4.17.15"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==

lodash@^3.3.1:
version "3.10.1"
resolved "https://registry.npmjs.org/lodash/-/lodash-3.10.1.tgz#5bf45e8e49ba4189e17d482789dfd15bd140b7b6"
integrity sha1-W/Rejkm6QYnhfUgnid/RW9FAt7Y=

lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.2.1, lodash@^4.5.1:
[email protected], lodash@^3.3.1, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.2.1, lodash@^4.5.1:
version "4.17.19"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz#e48ddedbe30b3321783c5b4301fbd353bc1e4a4b"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==

lodash@^4.17.20:
version "4.17.20"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==

log-symbols@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920"
Expand Down