Skip to content

Commit

Permalink
perf(package): up deps & tech release
Browse files Browse the repository at this point in the history
  • Loading branch information
antongolub committed Jan 19, 2020
1 parent 4dfbabe commit bf00b41
Show file tree
Hide file tree
Showing 5 changed files with 462 additions and 316 deletions.
13 changes: 8 additions & 5 deletions lib/getWorkspacesYarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ function getWorkspacesYarn(cwd) {
throw new TypeError("package.json: workspaces: Must be non-empty array of string");

// Turn workspaces into list of package.json files.
const workspaces = glob.sync(manifest.workspaces.map(p => p.replace(/\/?$/, "/package.json")), {
cwd: cwd,
realpath: true,
ignore: "**/node_modules/**"
});
const workspaces = glob.sync(
manifest.workspaces.map(p => p.replace(/\/?$/, "/package.json")),
{
cwd: cwd,
realpath: true,
ignore: "**/node_modules/**"
}
);

// Must have at least one workspace.
if (!workspaces.length) throw new TypeError("package.json: workspaces: Must contain one or more workspaces");
Expand Down
34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,33 +49,33 @@
},
"dependencies": {
"bash-glob": "^2.0.0",
"blork": "^9.2.1",
"blork": "^9.2.2",
"cosmiconfig": "^6.0.0",
"execa": "^3.2.0",
"execa": "^4.0.0",
"get-stream": "^5.1.0",
"git-log-parser": "^1.2.0",
"require-in-the-middle": "^5.0.0",
"semantic-release": "^15.13.30",
"semver": "^6.3.0",
"require-in-the-middle": "^5.0.2",
"semantic-release": "^16.0.2",
"semver": "^7.1.1",
"signale": "^1.4.0",
"stream-buffers": "^3.0.2",
"tempy": "^0.3.0"
},
"devDependencies": {
"@commitlint/config-conventional": "^8.2.0",
"@semantic-release/changelog": "^3.0.5",
"@semantic-release/git": "^7.0.17",
"@semantic-release/github": "^5.5.5",
"@semantic-release/npm": "^5.3.2",
"commitlint": "^8.2.0",
"eslint": "^6.6.0",
"eslint-config-prettier": "^6.5.0",
"eslint-plugin-prettier": "^3.1.1",
"@commitlint/config-conventional": "^8.3.4",
"@semantic-release/changelog": "^3.0.6",
"@semantic-release/git": "^8.0.0",
"@semantic-release/github": "^6.0.1",
"@semantic-release/npm": "^6.0.0",
"commitlint": "^8.3.5",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.9.0",
"eslint-plugin-prettier": "^3.1.2",
"file-url": "^3.0.0",
"husky": "^3.0.9",
"husky": "^4.0.10",
"jest": "^24.9.0",
"prettier": "^1.18.2",
"coveralls": "^3.0.7",
"prettier": "^1.19.1",
"coveralls": "^3.0.9",
"codeclimate-test-reporter": "^0.5.1"
},
"release": {
Expand Down
25 changes: 20 additions & 5 deletions test/lib/hasChangedDeep.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,20 @@ describe("hasChangedDeep()", () => {
const pkgs3 = [
{
_nextType: undefined,
_localDeps: [{ _nextType: false, _localDeps: [] }, { _nextType: false, _localDeps: [] }]
_localDeps: [
{ _nextType: false, _localDeps: [] },
{ _nextType: false, _localDeps: [] }
]
}
];
expect(hasChangedDeep(pkgs3)).toBe(false);
const pkgs4 = [
{
_nextType: undefined,
_localDeps: [{ _nextType: "patch", _localDeps: [] }, { _nextType: false, _localDeps: [] }]
_localDeps: [
{ _nextType: "patch", _localDeps: [] },
{ _nextType: false, _localDeps: [] }
]
}
];
expect(hasChangedDeep(pkgs4)).toBe(true);
Expand All @@ -30,7 +36,10 @@ describe("hasChangedDeep()", () => {
_localDeps: [
{
_nextType: false,
_localDeps: [{ _nextType: false, _localDeps: [] }, { _nextType: false, _localDeps: [] }]
_localDeps: [
{ _nextType: false, _localDeps: [] },
{ _nextType: false, _localDeps: [] }
]
}
]
}
Expand Down Expand Up @@ -63,15 +72,21 @@ describe("hasChangedDeep()", () => {
const pkgs3 = [
{
_nextType: undefined,
_localDeps: [{ _nextType: false, _localDeps: [] }, { _nextType: false, _localDeps: [] }]
_localDeps: [
{ _nextType: false, _localDeps: [] },
{ _nextType: false, _localDeps: [] }
]
}
];
pkgs3[0]._localDeps[0]._localDeps.push(pkgs3[0]._localDeps[0]);
expect(hasChangedDeep(pkgs3)).toBe(false);
const pkgs4 = [
{
_nextType: undefined,
_localDeps: [{ _nextType: "patch", _localDeps: [] }, { _nextType: false, _localDeps: [] }]
_localDeps: [
{ _nextType: "patch", _localDeps: [] },
{ _nextType: false, _localDeps: [] }
]
}
];
pkgs4[0]._localDeps[0]._localDeps.push(pkgs4[0]._localDeps[0]);
Expand Down
4 changes: 4 additions & 0 deletions test/lib/multiSemanticRelease.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,10 @@ describe("multiSemanticRelease()", () => {
// B.
expect(result[2].name).toBe("msr-test-b");
expect(result[2].result.lastRelease).toEqual({
channels: [null],
gitHead: sha1,
gitTag: "msr-test-b@1.0.0",
name: "msr-test-b@1.0.0",
version: "1.0.0"
});
expect(result[2].result.nextRelease).toMatchObject({
Expand All @@ -284,8 +286,10 @@ describe("multiSemanticRelease()", () => {
// C.
expect(result[0].name).toBe("msr-test-c");
expect(result[0].result.lastRelease).toEqual({
channels: [null],
gitHead: sha1,
gitTag: "msr-test-c@1.0.0",
name: "msr-test-c@1.0.0",
version: "1.0.0"
});
expect(result[0].result.nextRelease).toMatchObject({
Expand Down

0 comments on commit bf00b41

Please sign in to comment.