Skip to content

Commit

Permalink
feat: add printOnlyFailed flag, update deps (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
oljekechoro authored Dec 17, 2021
1 parent 4d247f4 commit 4906133
Show file tree
Hide file tree
Showing 17 changed files with 3,289 additions and 3,349 deletions.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
"postupdate:local": "yarn postupdate && say postupdate succeeded || say postupdate failed"
},
"devDependencies": {
"@types/jest": "^26.0.20",
"@types/node": "^14.14.28",
"coveralls": "^3.1.0",
"@types/jest": "^27.0.3",
"@types/node": "^17.0.0",
"coveralls": "^3.1.1",
"find-git-root": "^1.0.4",
"jest": "^26.6.3",
"lerna": "^3.22.1",
"jest": "^27.4.5",
"lerna": "^4.0.0",
"snazzy": "^9.0.0"
},
"repository": {
Expand Down
12 changes: 6 additions & 6 deletions packages/cli-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,21 @@
"build:es6": "mkdirp target/es6 && tsc -p tsconfig.es6.json",
"build:ts": "cpy src/main/ts/ target/ts/",
"build:libdef": "libdefkit --tsconfig=tsconfig.es5.json --tsconfig=tsconfig.es6.json",
"docs": "typedoc src/main",
"docs": "typedoc",
"uglify": "for f in $(find target -name '*.js'); do short=${f%.js}; terser -c -m -o $short.js -- $f; done",
"postupdate": "yarn && yarn build && yarn test",
"format": "prettier --write 'src/**/*.ts'"
},
"dependencies": {
"@qiwi/deep-proxy": "^1.8.1",
"@qiwi/deep-proxy": "^1.8.3",
"@qiwi/npm-batch-client": "2.0.0",
"@qiwi/substrate": "^1.20.1",
"push-it-to-the-limit": "^1.17.1",
"tslib": "^2.1.0"
"@qiwi/substrate": "^1.20.11",
"push-it-to-the-limit": "^1.17.3",
"tslib": "^2.3.1"
},
"devDependencies": {
"@qiwi/npm-batch-client-infra": "1.2.1",
"nock": "^13.0.7"
"nock": "^13.2.1"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-api/src/main/ts/executors/deprecate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export const performDeprecation: TActionPerformer = async (

if (config.batch?.jsonOutput) {
printResultsJson({
successfulResults,
successfulResults: config.batch?.printOnlyFailed ? undefined : successfulResults,
failedResults
})
return
}

printResults(
successfulResults,
config.batch?.printOnlyFailed ? [] : successfulResults,
failedResults,
['packageName', 'version', 'message'],
['packageName', 'version', 'message', 'error'],
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-api/src/main/ts/executors/get.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const performGet = async (

if (config.batch?.jsonOutput) {
printResultsJson({
successfulPackages,
successfulPackages: config.batch?.printOnlyFailed ? undefined : successfulPackages,
failedPackages,
packuments
})
Expand All @@ -37,7 +37,7 @@ export const performGet = async (
writeToFile(config.batch?.path as string, packuments)

printResults(
successfulPackages,
config.batch?.printOnlyFailed ? [] : successfulPackages,
failedPackages,
['name'],
['name', 'reason'],
Expand Down
7 changes: 5 additions & 2 deletions packages/cli-api/src/main/ts/executors/publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,15 @@ export const performPublish: TActionPerformer = async (
const failedPackages = failed.map(item => ({ ...item.opts, reason: item.reason }))

if (config.batch?.jsonOutput) {
printResultsJson({ successfulPackages, failedPackages })
printResultsJson({
successfulPackages: config.batch?.printOnlyFailed ? undefined : successfulPackages,
failedPackages,
})
return
}

printResults(
successfulPackages,
config.batch?.printOnlyFailed ? [] : successfulPackages,
failedPackages,
['name', 'version', 'filePath', 'access'],
['name', 'version', 'filePath', 'access', 'error'],
Expand Down
7 changes: 5 additions & 2 deletions packages/cli-api/src/main/ts/executors/setLatest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,15 @@ export const performSetLatest: TActionPerformer = async (
const failedPackages = failed.map(item => ({ ...item.opts, reason: item.reason }))

if (config.batch?.jsonOutput) {
printResultsJson({ successfulPackages, failedPackages })
printResultsJson({
successfulPackages: config.batch?.printOnlyFailed ? undefined : successfulPackages,
failedPackages
})
return
}

printResults(
successfulPackages,
config.batch?.printOnlyFailed ? [] : successfulPackages,
failedPackages,
['name', 'version'],
['name', 'version', 'reason'],
Expand Down
3 changes: 2 additions & 1 deletion packages/cli-api/src/main/ts/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export interface IBaseConfig<T = any> {
ratelimit?: TRateLimit,
skipErrors?: boolean,
jsonOutput?: boolean,
path?: string
path?: string,
printOnlyFailed?: boolean,
},
data: T,
}
Expand Down
5 changes: 3 additions & 2 deletions packages/cli-api/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@qiwi/npm-batch-cli-api",
"out": "./docs",
"exclude": ["src/test", "**/node_modules/**"],
"entryPoints": ["src/main/ts"],
"exclude": ["src/test", "**/node_modules/**", "paralleljs"],
"externalPattern": ["**/node_modules/**"],
"excludePrivate": false,
"hideGenerator": true,
"readme": "README.md",
"theme": "minimal",
"theme": "default",
"tsconfig": "./tsconfig.es5.json"
}
4 changes: 1 addition & 3 deletions packages/cli-pipe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,11 @@
"lint:fix": "yarn lint --fix",
"clean": "rimraf target typings flow-typed buildcache coverage docs buildstamp.json",
"prebuild": "buildstamp --git --out.path buildstamp.json",
"build": "yarn build:es5 && yarn build:es6 && yarn build:ts && yarn build:libdef && yarn docs",
"build": "yarn build:es5 && yarn build:es6 && yarn build:ts",
"build:es5": "mkdirp target/es5 && tsc -p tsconfig.es5.json",
"build:es6": "mkdirp target/es6 && tsc -p tsconfig.es6.json",
"build:ts": "cpy src/main/ts/ target/ts/",
"build:libdef": "libdefkit --tsconfig=tsconfig.es5.json --tsconfig=tsconfig.es6.json",
"build:local": "yarn build:es5 && chmod +x target/es5/index.js",
"docs": "typedoc src/main",
"uglify": "for f in $(find target -name '*.js'); do short=${f%.js}; terser -c -m -o $short.js -- $f; done",
"postupdate": "yarn && yarn build && yarn test",
"format": "prettier --write 'src/**/*.ts'"
Expand Down
11 changes: 0 additions & 11 deletions packages/cli-pipe/typedoc.json

This file was deleted.

10 changes: 10 additions & 0 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,13 @@ Flag `jsonOutput` prints result in JSON format.
...
}
```
Flag `printOnlyFailed` prints only info about failed packages
```text
{
...
"batch": {
"printOnlyFailed": true
},
...
}
```
4 changes: 1 addition & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,11 @@
"lint:fix": "yarn lint --fix",
"clean": "rimraf target typings flow-typed buildcache coverage docs buildstamp.json",
"prebuild": "buildstamp --git --out.path buildstamp.json",
"build": "yarn build:es5 && yarn build:es6 && yarn build:ts && yarn build:libdef && yarn docs",
"build": "yarn build:es5 && yarn build:es6 && yarn build:ts",
"build:es5": "mkdirp target/es5 && tsc -p tsconfig.es5.json",
"build:es6": "mkdirp target/es6 && tsc -p tsconfig.es6.json",
"build:ts": "cpy src/main/ts/ target/ts/",
"build:libdef": "libdefkit --tsconfig=tsconfig.es5.json --tsconfig=tsconfig.es6.json",
"build:local": "yarn build:es5 && chmod +x target/es5/index.js",
"docs": "typedoc src/main",
"uglify": "for f in $(find target -name '*.js'); do short=${f%.js}; terser -c -m -o $short.js -- $f; done",
"postupdate": "yarn && yarn build && yarn test",
"format": "prettier --write 'src/**/*.ts'"
Expand Down
11 changes: 0 additions & 11 deletions packages/cli/typedoc.json

This file was deleted.

14 changes: 7 additions & 7 deletions packages/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,23 @@
"build:es6": "mkdirp target/es6 && tsc -p tsconfig.es6.json",
"build:ts": "cpy src/main/ts/ target/ts/",
"build:libdef": "libdefkit --tsconfig=tsconfig.es5.json --tsconfig=tsconfig.es6.json",
"docs": "typedoc src/main",
"docs": "typedoc",
"uglify": "for f in $(find target -name '*.js'); do short=${f%.js}; terser -c -m -o $short.js -- $f; done",
"postupdate": "yarn && yarn build && yarn test",
"postupdate:local": "yarn postupdate && say postupdate succeeded || say postupdate failed",
"format": "prettier --write 'src/**/*.ts'"
},
"dependencies": {
"@qiwi/npm-registry-client": "^8.9.0",
"@qiwi/npm-types": "^1.0.2",
"@qiwi/substrate": "^1.20.6",
"@qiwi/npm-registry-client": "^8.9.1",
"@qiwi/npm-types": "^1.0.3",
"@qiwi/substrate": "^1.20.11",
"semver": "^7.3.5",
"tslib": "^2.1.0"
"tslib": "^2.3.1"
},
"devDependencies": {
"@qiwi/npm-batch-client-infra": "1.2.1",
"@types/semver": "^7.3.4",
"nock": "^13.0.11"
"@types/semver": "^7.3.9",
"nock": "^13.2.1"
},
"repository": {
"type": "git",
Expand Down
5 changes: 3 additions & 2 deletions packages/client/typedoc.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@qiwi/npm-batch-client",
"out": "./docs",
"exclude": ["src/test", "**/node_modules/**"],
"entryPoints": ["src/main/ts"],
"exclude": ["src/test", "**/node_modules/**", "paralleljs"],
"externalPattern": ["**/node_modules/**"],
"excludePrivate": false,
"hideGenerator": true,
"readme": "README.md",
"theme": "minimal",
"theme": "default",
"tsconfig": "./tsconfig.es5.json"
}
32 changes: 16 additions & 16 deletions packages/infra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,27 +24,27 @@
"postupdate": "yarn"
},
"dependencies": {
"@qiwi/substrate": "^1.20.1",
"tslib": "^2.1.0"
"@qiwi/substrate": "^1.20.11",
"tslib": "^2.3.1"
},
"devDependencies": {
"@qiwi/libdefkit": "^2.1.6",
"@swissquote/crafty-preset-jest": "^1.13.7",
"@types/jest": "^26.0.20",
"buildstamp": "^1.4.1",
"@qiwi/libdefkit": "^3.1.2",
"@swissquote/crafty-preset-jest": "^1.17.2",
"@types/jest": "^27.0.3",
"buildstamp": "^1.4.3",
"cpy-cli": "^3.1.1",
"eslint": "^7.20.0",
"eslint-config-prettier": "^7.2.0",
"eslint-config-qiwi": "^1.10.6",
"jest": "^26.6.3",
"eslint": "^8.4.1",
"eslint-config-prettier": "^8.3.0",
"eslint-config-qiwi": "^1.15.2",
"jest": "^27.4.5",
"mkdirp": "^1.0.4",
"prettier": "^2.2.1",
"prettier-config-qiwi": "^1.3.2",
"prettier": "^2.5.1",
"prettier-config-qiwi": "^1.5.0",
"rimraf": "^3.0.2",
"terser": "^5.6.0",
"ts-jest": "^26.5.1",
"typedoc": "^0.20.25",
"typescript": "^4.1.5"
"terser": "^5.10.0",
"ts-jest": "^27.1.2",
"typedoc": "^0.22.10",
"typescript": "^4.5.4"
},
"license": "MIT",
"author": "Anton Golub <[email protected]>",
Expand Down
Loading

0 comments on commit 4906133

Please sign in to comment.