|
| 1 | +--- |
| 2 | +description: Migrating to 5.0.0. What has changed? How to migrate? What are the new features? |
| 3 | +--- |
| 4 | + |
| 5 | +import { Tabs, Tab } from '@theguild/components' |
| 6 | + |
| 7 | +# Migration to 5.0.0 |
| 8 | + |
| 9 | +## What has changed? |
| 10 | + |
| 11 | +There was an outstanding issue with `@parcel/watcher` which prevented it to be installed in certain environments, or needed an extra amount of dependencies to be built. |
| 12 | +This release focuses on improving the usage of `@graphql-codegen/cli` in those environments by making it an optional peer dependency. |
| 13 | +NPM (or Yarn) will not emit errors when an optional peer dependency is missing. |
| 14 | + |
| 15 | +## How to migrate? |
| 16 | + |
| 17 | +To use `@graphql-codegen/cli`'s watch mode (based on @parcel/watcher) you need to provide it in a package that uses `@graphql-codegen/cli` from now on. |
| 18 | + |
| 19 | +Start by updating your package.json |
| 20 | + |
| 21 | +<Tabs items={['Before', 'After']}> |
| 22 | +<Tab> |
| 23 | +```json filename="package.json" |
| 24 | +{ |
| 25 | + "devDependencies": { |
| 26 | + "@graphql-codegen/cli": "^1.0.0", |
| 27 | + "@graphql-codegen/typescript": "^1.0.0", |
| 28 | + "@graphql-codegen/typescript-operations": "^1.0.0" |
| 29 | + } |
| 30 | +} |
| 31 | +``` |
| 32 | +</Tab> |
| 33 | + |
| 34 | +<Tab> |
| 35 | +```json filename="package.json" |
| 36 | +{ |
| 37 | + "devDependencies": { |
| 38 | + "@graphql-codegen/cli": "^1.0.0", |
| 39 | + "@graphql-codegen/typescript": "^1.0.0", |
| 40 | + "@graphql-codegen/typescript-operations": "^1.0.0", |
| 41 | + "@parcel/watcher": "^2.1.0" |
| 42 | + } |
| 43 | +} |
| 44 | +``` |
| 45 | +</Tab> |
| 46 | +</Tabs> |
| 47 | + |
| 48 | +If you had issues with `@parcel/watcher` previously, you can make NPM and Yarn silently discard any build errors, by using `optionalDependencies` instead: |
| 49 | + |
| 50 | +<Tabs items={['Before', 'After', 'After (Alternative)']}> |
| 51 | +<Tab> |
| 52 | +```json filename="package.json" |
| 53 | +{ |
| 54 | + "devDependencies": { |
| 55 | + "@graphql-codegen/cli": "^1.0.0", |
| 56 | + "@graphql-codegen/typescript": "^1.0.0", |
| 57 | + "@graphql-codegen/typescript-operations": "^1.0.0" |
| 58 | + } |
| 59 | +} |
| 60 | +``` |
| 61 | +</Tab> |
| 62 | + |
| 63 | +<Tab> |
| 64 | +```json filename="package.json" |
| 65 | +{ |
| 66 | + "devDependencies": { |
| 67 | + "@graphql-codegen/cli": "^1.0.0", |
| 68 | + "@graphql-codegen/typescript": "^1.0.0", |
| 69 | + "@graphql-codegen/typescript-operations": "^1.0.0" |
| 70 | + }, |
| 71 | + "optionalDependencies": { |
| 72 | + "@parcel/watcher": "^2.1.0" |
| 73 | + } |
| 74 | +} |
| 75 | +``` |
| 76 | +</Tab> |
| 77 | + |
| 78 | +<Tab> |
| 79 | +```json filename="package.json" |
| 80 | +{ |
| 81 | + "devDependencies": { |
| 82 | + "@graphql-codegen/cli": "^1.0.0", |
| 83 | + "@graphql-codegen/typescript": "^1.0.0", |
| 84 | + "@graphql-codegen/typescript-operations": "^1.0.0", |
| 85 | + "@parcel/watcher": "^2.1.0" |
| 86 | + }, |
| 87 | + "dependenciesMeta": { |
| 88 | + "@parcel/watcher": { |
| 89 | + "optional": true |
| 90 | + } |
| 91 | + } |
| 92 | +} |
| 93 | +``` |
| 94 | +</Tab> |
| 95 | +</Tabs> |
0 commit comments