Skip to content

Commit

Permalink
fix(msw): make sure to not double import value and type (orval-labs#1799
Browse files Browse the repository at this point in the history
)

* fix(msw): make sure to not double import value and type

* fix: filter instead of splice

* fix: don't overwrite variable

* fix: lockfile
  • Loading branch information
AllieJonsson authored Jan 10, 2025
1 parent c78fbfd commit cb58fb0
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 30 deletions.
6 changes: 5 additions & 1 deletion packages/core/src/generators/imports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,15 @@ export const addDependency = ({
}

if (types) {
let uniqueTypes = types;
if (values) {
uniqueTypes = types.filter(
(t) => !values.some((v) => v.name === t.name),
);
dep += '\n';
}
dep += generateDependency({
deps: types,
deps: uniqueTypes,
isAllowSyntheticDefaultImports,
dependency,
specsName,
Expand Down
58 changes: 29 additions & 29 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1253,23 +1253,23 @@ __metadata:
languageName: node
linkType: hard

"@orval/angular@npm:7.4.0, @orval/angular@workspace:packages/angular":
"@orval/angular@npm:7.4.1, @orval/angular@workspace:packages/angular":
version: 0.0.0-use.local
resolution: "@orval/angular@workspace:packages/angular"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
languageName: unknown
linkType: soft

"@orval/axios@npm:7.4.0, @orval/axios@workspace:packages/axios":
"@orval/axios@npm:7.4.1, @orval/axios@workspace:packages/axios":
version: 0.0.0-use.local
resolution: "@orval/axios@workspace:packages/axios"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
languageName: unknown
linkType: soft

"@orval/core@npm:7.4.0, @orval/core@workspace:packages/core":
"@orval/core@npm:7.4.1, @orval/core@workspace:packages/core":
version: 0.0.0-use.local
resolution: "@orval/core@workspace:packages/core"
dependencies:
Expand Down Expand Up @@ -1308,62 +1308,62 @@ __metadata:
languageName: unknown
linkType: soft

"@orval/fetch@npm:7.4.0, @orval/fetch@workspace:packages/fetch":
"@orval/fetch@npm:7.4.1, @orval/fetch@workspace:packages/fetch":
version: 0.0.0-use.local
resolution: "@orval/fetch@workspace:packages/fetch"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
languageName: unknown
linkType: soft

"@orval/hono@npm:7.4.0, @orval/hono@workspace:packages/hono":
"@orval/hono@npm:7.4.1, @orval/hono@workspace:packages/hono":
version: 0.0.0-use.local
resolution: "@orval/hono@workspace:packages/hono"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/zod": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
"@orval/zod": "npm:7.4.1"
"@types/lodash.uniq": "npm:^4.5.7"
lodash.uniq: "npm:^4.5.0"
languageName: unknown
linkType: soft

"@orval/mock@npm:7.4.0, @orval/mock@workspace:packages/mock":
"@orval/mock@npm:7.4.1, @orval/mock@workspace:packages/mock":
version: 0.0.0-use.local
resolution: "@orval/mock@workspace:packages/mock"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
lodash.get: "npm:^4.4.2"
lodash.omit: "npm:^4.5.0"
openapi3-ts: "npm:^4.2.2"
languageName: unknown
linkType: soft

"@orval/query@npm:7.4.0, @orval/query@workspace:packages/query":
"@orval/query@npm:7.4.1, @orval/query@workspace:packages/query":
version: 0.0.0-use.local
resolution: "@orval/query@workspace:packages/query"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/fetch": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
"@orval/fetch": "npm:7.4.1"
"@types/lodash.omitby": "npm:^4.6.7"
lodash.omitby: "npm:^4.6.0"
vitest: "npm:^0.34.6"
languageName: unknown
linkType: soft

"@orval/swr@npm:7.4.0, @orval/swr@workspace:packages/swr":
"@orval/swr@npm:7.4.1, @orval/swr@workspace:packages/swr":
version: 0.0.0-use.local
resolution: "@orval/swr@workspace:packages/swr"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/fetch": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
"@orval/fetch": "npm:7.4.1"
languageName: unknown
linkType: soft

"@orval/zod@npm:7.4.0, @orval/zod@workspace:packages/zod":
"@orval/zod@npm:7.4.1, @orval/zod@workspace:packages/zod":
version: 0.0.0-use.local
resolution: "@orval/zod@workspace:packages/zod"
dependencies:
"@orval/core": "npm:7.4.0"
"@orval/core": "npm:7.4.1"
"@types/lodash.uniq": "npm:^4.5.7"
lodash.uniq: "npm:^4.5.0"
languageName: unknown
Expand Down Expand Up @@ -7578,15 +7578,15 @@ __metadata:
resolution: "orval@workspace:packages/orval"
dependencies:
"@apidevtools/swagger-parser": "npm:^10.1.0"
"@orval/angular": "npm:7.4.0"
"@orval/axios": "npm:7.4.0"
"@orval/core": "npm:7.4.0"
"@orval/fetch": "npm:7.4.0"
"@orval/hono": "npm:7.4.0"
"@orval/mock": "npm:7.4.0"
"@orval/query": "npm:7.4.0"
"@orval/swr": "npm:7.4.0"
"@orval/zod": "npm:7.4.0"
"@orval/angular": "npm:7.4.1"
"@orval/axios": "npm:7.4.1"
"@orval/core": "npm:7.4.1"
"@orval/fetch": "npm:7.4.1"
"@orval/hono": "npm:7.4.1"
"@orval/mock": "npm:7.4.1"
"@orval/query": "npm:7.4.1"
"@orval/swr": "npm:7.4.1"
"@orval/zod": "npm:7.4.1"
"@types/inquirer": "npm:^9.0.6"
"@types/js-yaml": "npm:^4.0.8"
"@types/lodash.uniq": "npm:^4.5.8"
Expand Down

0 comments on commit cb58fb0

Please sign in to comment.