Skip to content

Commit

Permalink
fix(cli): peer dependency incorrectly met
Browse files Browse the repository at this point in the history
  • Loading branch information
P0lip committed Oct 24, 2022
1 parent f3fb425 commit 44a0b22
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 103 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@
"@swc/jest": "^0.2.21",
"@types/file-entry-cache": "^5.0.2",
"@types/jest": "^28.1.6",
"@types/jest-when": "^2.7.3",
"@types/karma": "^6.3.3",
"@types/lodash": "^4.14.176",
"@types/node": "^15.12.4",
Expand All @@ -93,7 +92,6 @@
"husky": "^7.0.4",
"jest": "^28.1.3",
"jest-mock": "^27.5.1",
"jest-when": "^3.4.2",
"karma": "^6.4.0",
"karma-chrome-launcher": "^3.1.1",
"karma-jasmine": "^5.1.0",
Expand Down
16 changes: 7 additions & 9 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,16 @@
"release": "semantic-release -e semantic-release-monorepo"
},
"dependencies": {
"@rollup/plugin-commonjs": "^20.0.0",
"@stoplight/json": "3.17.0",
"@stoplight/json": "~3.20.1",
"@stoplight/path": "1.3.2",
"@stoplight/spectral-core": "^1.5.1",
"@stoplight/spectral-parsers": "^1.0.1",
"@stoplight/spectral-core": "^1.14.1",
"@stoplight/spectral-parsers": "^1.0.2",
"@stoplight/spectral-ref-resolver": "1.0.2",
"@stoplight/spectral-ruleset-bundler": "^1.0.0",
"@stoplight/spectral-ruleset-migrator": "^1.5.0",
"@stoplight/spectral-ruleset-bundler": "^1.4.0",
"@stoplight/spectral-ruleset-migrator": "^1.9.0",
"@stoplight/spectral-rulesets": ">=1",
"@stoplight/spectral-runtime": "^1.1.0",
"@stoplight/types": "12.3.0",
"@stoplight/spectral-runtime": "^1.1.2",
"@stoplight/types": "^13.6.0",
"chalk": "4.1.2",
"cliui": "7.0.4",
"eol": "0.9.1",
Expand All @@ -63,7 +62,6 @@
"@types/yargs": "^17.0.8",
"copyfiles": "^2.4.1",
"es-aggregate-error": "^1.0.7",
"jest-when": "^3.4.2",
"nock": "^13.1.3",
"node-html-parser": "^4.1.5",
"pkg": "^5.4.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as path from '@stoplight/path';
import * as fg from 'fast-glob';
import { when } from 'jest-when';
import { listFiles } from '../listFiles';

jest.mock('fast-glob', () => jest.fn(async () => []));
Expand All @@ -25,11 +24,13 @@ describe('listFiles CLI util', () => {
it('given disabled ignoredUnmatchedGlobs, reports unmatched patterns', async () => {
const list = [path.join(__dirname, 'foo/a.json'), path.join(__dirname, 'foo/b.json')];

when(fg as unknown as jest.Mock)
.calledWith('./foo/*.json', expect.any(Object))
.mockResolvedValueOnce([...list])
.calledWith('bar/**/baz*.yaml', expect.any(Object))
.mockResolvedValueOnce([]);
(fg as unknown as jest.Mock).mockImplementation(async pattern => {
if (pattern === './foo/*.json') {
return list;
}

return [];
});

expect(await listFiles(['./foo/*.json', 'bar/**/baz*.yaml'], false)).toEqual([list, ['bar/**/baz*.yaml']]);
});
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/services/linter/utils/getRuleset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { fetch } from '@stoplight/spectral-runtime';
import { migrateRuleset } from '@stoplight/spectral-ruleset-migrator';
import { bundleRuleset } from '@stoplight/spectral-ruleset-bundler';
import { node } from '@stoplight/spectral-ruleset-bundler/presets/node';
import { commonjs } from '@stoplight/spectral-ruleset-bundler/plugins/commonjs';
import { stdin } from '@stoplight/spectral-ruleset-bundler/plugins/stdin';
import { builtins } from '@stoplight/spectral-ruleset-bundler/plugins/builtins';
import { isError, isObject } from 'lodash';
import commonjs from '@rollup/plugin-commonjs';
import { CLIError } from '../../../errors';

async function getDefaultRulesetFile(): Promise<Optional<string>> {
Expand Down
120 changes: 35 additions & 85 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2218,23 +2218,6 @@ __metadata:
languageName: node
linkType: hard

"@rollup/plugin-commonjs@npm:^20.0.0":
version: 20.0.0
resolution: "@rollup/plugin-commonjs@npm:20.0.0"
dependencies:
"@rollup/pluginutils": ^3.1.0
commondir: ^1.0.1
estree-walker: ^2.0.1
glob: ^7.1.6
is-reference: ^1.2.1
magic-string: ^0.25.7
resolve: ^1.17.0
peerDependencies:
rollup: ^2.38.3
checksum: fefc4b5ab1509ff64e26dfee3eca2f23cea204bf20f3dc76c616d3aa3faf4b1035166287518a64ba07faaaea1621a0af5b94b8f8199371ca67db905562e7e619
languageName: node
linkType: hard

"@rollup/plugin-commonjs@npm:~22.0.2":
version: 22.0.2
resolution: "@rollup/plugin-commonjs@npm:22.0.2"
Expand Down Expand Up @@ -2462,19 +2445,6 @@ __metadata:
languageName: node
linkType: hard

"@stoplight/json@npm:3.17.0":
version: 3.17.0
resolution: "@stoplight/json@npm:3.17.0"
dependencies:
"@stoplight/ordered-object-literal": ^1.0.2
"@stoplight/types": ^12.3.0
jsonc-parser: ~2.2.1
lodash: ^4.17.21
safe-stable-stringify: ^1.1
checksum: 452bb6963d35196420d1214320223c38d3c7858a0420ad222d347c6bcaf69a5897add288ae7305f6cf46ff1f078c037f4c9deb42911f8f0907bcfbd97dcfbd62
languageName: node
linkType: hard

"@stoplight/json@npm:^3.17.0, @stoplight/json@npm:^3.17.1, @stoplight/json@npm:^3.20.1, @stoplight/json@npm:~3.20.1":
version: 3.20.1
resolution: "@stoplight/json@npm:3.20.1"
Expand All @@ -2489,7 +2459,7 @@ __metadata:
languageName: node
linkType: hard

"@stoplight/ordered-object-literal@npm:^1.0.1, @stoplight/ordered-object-literal@npm:^1.0.2, @stoplight/ordered-object-literal@npm:^1.0.3, @stoplight/ordered-object-literal@npm:~1.0.4":
"@stoplight/ordered-object-literal@npm:^1.0.1, @stoplight/ordered-object-literal@npm:^1.0.3, @stoplight/ordered-object-literal@npm:~1.0.4":
version: 1.0.4
resolution: "@stoplight/ordered-object-literal@npm:1.0.4"
checksum: 81afa24943880b0a213af3728a9fe0a28bd01d4840b9583d448f7823ced5b6e673628698b59d201cef50afebcbd89256e133714a174968d11b624d943e0c2c2f
Expand All @@ -2507,17 +2477,16 @@ __metadata:
version: 0.0.0-use.local
resolution: "@stoplight/spectral-cli@workspace:packages/cli"
dependencies:
"@rollup/plugin-commonjs": ^20.0.0
"@stoplight/json": 3.17.0
"@stoplight/json": ~3.20.1
"@stoplight/path": 1.3.2
"@stoplight/spectral-core": ^1.5.1
"@stoplight/spectral-parsers": ^1.0.1
"@stoplight/spectral-core": ^1.14.1
"@stoplight/spectral-parsers": ^1.0.2
"@stoplight/spectral-ref-resolver": 1.0.2
"@stoplight/spectral-ruleset-bundler": ^1.0.0
"@stoplight/spectral-ruleset-migrator": ^1.5.0
"@stoplight/spectral-ruleset-bundler": ^1.4.0
"@stoplight/spectral-ruleset-migrator": ^1.9.0
"@stoplight/spectral-rulesets": ">=1"
"@stoplight/spectral-runtime": ^1.1.0
"@stoplight/types": 12.3.0
"@stoplight/spectral-runtime": ^1.1.2
"@stoplight/types": ^13.6.0
"@types/es-aggregate-error": ^1.0.2
"@types/xml2js": ^0.4.9
"@types/yargs": ^17.0.8
Expand All @@ -2527,7 +2496,6 @@ __metadata:
eol: 0.9.1
es-aggregate-error: ^1.0.7
fast-glob: 3.2.7
jest-when: ^3.4.2
lodash: ~4.17.21
nock: ^13.1.3
node-html-parser: ^4.1.5
Expand All @@ -2545,7 +2513,7 @@ __metadata:
languageName: unknown
linkType: soft

"@stoplight/spectral-core@*, @stoplight/spectral-core@>=1, @stoplight/spectral-core@^1.5.1, @stoplight/spectral-core@^1.7.0, @stoplight/spectral-core@^1.8.0, @stoplight/spectral-core@^1.8.1, @stoplight/spectral-core@workspace:packages/core":
"@stoplight/spectral-core@*, @stoplight/spectral-core@>=1, @stoplight/spectral-core@^1.14.1, @stoplight/spectral-core@^1.7.0, @stoplight/spectral-core@^1.8.0, @stoplight/spectral-core@^1.8.1, @stoplight/spectral-core@workspace:packages/core":
version: 0.0.0-use.local
resolution: "@stoplight/spectral-core@workspace:packages/core"
dependencies:
Expand Down Expand Up @@ -2610,7 +2578,7 @@ __metadata:
languageName: unknown
linkType: soft

"@stoplight/spectral-parsers@*, @stoplight/spectral-parsers@>=1, @stoplight/spectral-parsers@^1.0.1, @stoplight/spectral-parsers@workspace:packages/parsers":
"@stoplight/spectral-parsers@*, @stoplight/spectral-parsers@>=1, @stoplight/spectral-parsers@^1.0.2, @stoplight/spectral-parsers@workspace:packages/parsers":
version: 0.0.0-use.local
resolution: "@stoplight/spectral-parsers@workspace:packages/parsers"
dependencies:
Expand All @@ -2633,7 +2601,7 @@ __metadata:
languageName: unknown
linkType: soft

"@stoplight/spectral-ruleset-bundler@^1.0.0, @stoplight/spectral-ruleset-bundler@workspace:packages/ruleset-bundler":
"@stoplight/spectral-ruleset-bundler@^1.4.0, @stoplight/spectral-ruleset-bundler@workspace:packages/ruleset-bundler":
version: 0.0.0-use.local
resolution: "@stoplight/spectral-ruleset-bundler@workspace:packages/ruleset-bundler"
dependencies:
Expand All @@ -2660,7 +2628,7 @@ __metadata:
languageName: unknown
linkType: soft

"@stoplight/spectral-ruleset-migrator@^1.5.0, @stoplight/spectral-ruleset-migrator@^1.7.4, @stoplight/spectral-ruleset-migrator@workspace:packages/ruleset-migrator":
"@stoplight/spectral-ruleset-migrator@^1.7.4, @stoplight/spectral-ruleset-migrator@workspace:packages/ruleset-migrator":
version: 0.0.0-use.local
resolution: "@stoplight/spectral-ruleset-migrator@workspace:packages/ruleset-migrator"
dependencies:
Expand All @@ -2687,6 +2655,28 @@ __metadata:
languageName: unknown
linkType: soft

"@stoplight/spectral-ruleset-migrator@npm:^1.9.0":
version: 1.9.0
resolution: "@stoplight/spectral-ruleset-migrator@npm:1.9.0"
dependencies:
"@stoplight/json": ~3.20.1
"@stoplight/ordered-object-literal": ~1.0.4
"@stoplight/path": 1.3.2
"@stoplight/spectral-functions": ^1.0.0
"@stoplight/spectral-runtime": ^1.1.0
"@stoplight/types": ^13.6.0
"@stoplight/yaml": ~4.2.3
"@types/node": "*"
ajv: ^8.6.0
ast-types: 0.14.2
astring: ^1.7.5
reserved: 0.1.2
tslib: ^2.3.1
validate-npm-package-name: 3.0.0
checksum: 155d881922356f59079c8eb6fc59e9d196e6fc00dc7242329b0a87a13d432c5c208c52cda967fb551bfc7cba94e26eebd8e4471bd6b7d0a3f2046439fcfa89be
languageName: node
linkType: hard

"@stoplight/spectral-rulesets@*, @stoplight/spectral-rulesets@>=1, @stoplight/spectral-rulesets@workspace:packages/rulesets":
version: 0.0.0-use.local
resolution: "@stoplight/spectral-rulesets@workspace:packages/rulesets"
Expand Down Expand Up @@ -2726,26 +2716,6 @@ __metadata:
languageName: unknown
linkType: soft

"@stoplight/types@npm:12.3.0":
version: 12.3.0
resolution: "@stoplight/types@npm:12.3.0"
dependencies:
"@types/json-schema": ^7.0.4
utility-types: ^3.10.0
checksum: 28065540d2d30743bfaa4ab09df3dc1e2a216f14962f78e27d8e53eda7f293f64eba8703be53b8d179dff403f54764e0823baa578fa85f78280d21b0ae22e773
languageName: node
linkType: hard

"@stoplight/types@npm:^12.3.0":
version: 12.5.0
resolution: "@stoplight/types@npm:12.5.0"
dependencies:
"@types/json-schema": ^7.0.4
utility-types: ^3.10.0
checksum: fe4a09df6e1c2f0cdb53f474b180cc7b8184e814e1ac4427d199642f10958335f597060530a908c0e5800ba2569d077afe124a51deaee466255ce942e1e03941
languageName: node
linkType: hard

"@stoplight/types@npm:^12.3.0 || ^13.0.0, @stoplight/types@npm:^13.0.0, @stoplight/types@npm:^13.6.0":
version: 13.7.0
resolution: "@stoplight/types@npm:13.7.0"
Expand Down Expand Up @@ -3117,16 +3087,7 @@ __metadata:
languageName: node
linkType: hard

"@types/jest-when@npm:^2.7.3":
version: 2.7.4
resolution: "@types/jest-when@npm:2.7.4"
dependencies:
"@types/jest": "*"
checksum: fea5f5c9b882ee5191ef47dfbbe71ce7935d4ede7ac12c2bf7dbceead3da066930aa492fc534f8b53ef6694f30313b5669b87cb45e36ddbece42c6ff27b01364
languageName: node
linkType: hard

"@types/jest@npm:*, @types/jest@npm:^28.1.6":
"@types/jest@npm:^28.1.6":
version: 28.1.7
resolution: "@types/jest@npm:28.1.7"
dependencies:
Expand Down Expand Up @@ -8209,15 +8170,6 @@ __metadata:
languageName: node
linkType: hard

"jest-when@npm:^3.4.2":
version: 3.5.1
resolution: "jest-when@npm:3.5.1"
peerDependencies:
jest: ">= 25"
checksum: 1efb9f497f7c846fe8b0f4125d5f449c4a4d78d5d0afa910d134b301ae4c119ea52c9465db38d2146269d42808afe8f3a4328d1d656878a9a69458ee653f6499
languageName: node
linkType: hard

"jest-worker@npm:^28.1.3":
version: 28.1.3
resolution: "jest-worker@npm:28.1.3"
Expand Down Expand Up @@ -11547,7 +11499,6 @@ __metadata:
"@swc/jest": ^0.2.21
"@types/file-entry-cache": ^5.0.2
"@types/jest": ^28.1.6
"@types/jest-when": ^2.7.3
"@types/karma": ^6.3.3
"@types/lodash": ^4.14.176
"@types/node": ^15.12.4
Expand All @@ -11567,7 +11518,6 @@ __metadata:
husky: ^7.0.4
jest: ^28.1.3
jest-mock: ^27.5.1
jest-when: ^3.4.2
karma: ^6.4.0
karma-chrome-launcher: ^3.1.1
karma-jasmine: ^5.1.0
Expand Down

0 comments on commit 44a0b22

Please sign in to comment.