Skip to content

Commit

Permalink
Move codemods/ into scripts/, to declutter top-level directories. (#7675
Browse files Browse the repository at this point in the history
)
  • Loading branch information
benjamn committed Feb 9, 2021
1 parent 7fae522 commit 748e79f
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## Apollo Client 3.3.10 (not yet released)

### Improvements

- The `codemods/` top-level directory has been moved into the `scripts/` directory. <br/>
[@benjamn](https://github.com/benjamn) in [#7675](https://github.com/apollographql/apollo-client/pull/7675)

## Apollo Client 3.3.9

### Bug Fixes
Expand Down Expand Up @@ -314,7 +321,7 @@
- Implement `useReactiveVar` hook for consuming reactive variables in React components. <br/>
[@benjamn](https://github.com/benjamn) in [#6867](https://github.com/apollographql/apollo-client/pull/6867)

- Move `apollo-link-persisted-queries` implementation to `@apollo/client/link/persisted-queries`. Try running our [automated imports transform](https://github.com/apollographql/apollo-client/tree/main/codemods/ac2-to-ac3) to handle this conversion, if you're using `apollo-link-persisted-queries`. <br/>
- Move `apollo-link-persisted-queries` implementation to `@apollo/client/link/persisted-queries`. Try running our [automated imports transform](https://github.com/apollographql/apollo-client/tree/main/scripts/codemods/ac2-to-ac3) to handle this conversion, if you're using `apollo-link-persisted-queries`. <br/>
[@hwillson](https://github.com/hwillson) in [#6837](https://github.com/apollographql/apollo-client/pull/6837)

- Disable feud-stopping logic after any `cache.evict` or `cache.modify` operation. <br/>
Expand Down Expand Up @@ -368,7 +375,7 @@

### Improvements

- Provide [jscodeshift](https://www.npmjs.com/package/jscodeshift) transform for automatically converting Apollo Client 2.x `import` declarations to use Apollo Client 3.x packages. [Instructions](https://github.com/apollographql/apollo-client/tree/main/codemods/ac2-to-ac3). <br/>
- Provide [jscodeshift](https://www.npmjs.com/package/jscodeshift) transform for automatically converting Apollo Client 2.x `import` declarations to use Apollo Client 3.x packages. [Instructions](https://github.com/apollographql/apollo-client/tree/main/scripts/codemods/ac2-to-ac3). <br/>
[@dminkovsky](https://github.com/dminkovsky) and [@jcreighton](https://github.com/jcreighton) in [#6486](https://github.com/apollographql/apollo-client/pull/6486)

## Apollo Client 3.1.2
Expand Down
2 changes: 1 addition & 1 deletion docs/source/migrating/apollo-client-3-migration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ If you’re installing Apollo Client 3.0 in a project that already uses an earli

The `@apollo/client` library includes functionality that previously required installing additional packages. As part of migrating to Apollo Client 3.0, follow the instructions below for each library your application currently uses.

> To simplify the process of converting your `import` declarations from older packages to `@apollo/client`, we provide an automated [transform](https://github.com/apollographql/apollo-client/tree/main/codemods/ac2-to-ac3) based on [`jscodeshift`](https://www.npmjs.com/package/jscodeshift). Note that this transform merely moves `import` specifiers between `import` declarations, without checking for proper usage of the imported values. Since the transform cannot take care of everything, pay close attention to any errors produced by TypeScript or your bundling tools, and be sure to verify all changes made by the transform. A more detailed list of caveats can be found in the [`README.md`](https://github.com/apollographql/apollo-client/tree/main/codemods/ac2-to-ac3#known-limitations).
> To simplify the process of converting your `import` declarations from older packages to `@apollo/client`, we provide an automated [transform](https://github.com/apollographql/apollo-client/tree/main/scripts/codemods/ac2-to-ac3) based on [`jscodeshift`](https://www.npmjs.com/package/jscodeshift). Note that this transform merely moves `import` specifiers between `import` declarations, without checking for proper usage of the imported values. Since the transform cannot take care of everything, pay close attention to any errors produced by TypeScript or your bundling tools, and be sure to verify all changes made by the transform. A more detailed list of caveats can be found in the [`README.md`](https://github.com/apollographql/apollo-client/tree/main/scripts/codemods/ac2-to-ac3#known-limitations).
### @apollo/react-hoc and @apollo/react-components

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ following commands to run, depending on the types of files you have:
```sh
# To transform all .js files:
npx jscodeshift \
-t apollo-client/codemods/ac2-to-ac3/imports.js \
-t apollo-client/scripts/codemods/ac2-to-ac3/imports.js \
--extensions js \
source-directory

# To transform all .ts files:
npx jscodeshift \
-t apollo-client/codemods/ac2-to-ac3/imports.js \
-t apollo-client/scripts/codemods/ac2-to-ac3/imports.js \
--extensions ts --parser ts \
source-directory

# To transform all .tsx files:
npx jscodeshift \
-t apollo-client/codemods/ac2-to-ac3/imports.js \
-t apollo-client/scripts/codemods/ac2-to-ac3/imports.js \
--extensions tsx --parser tsx \
source-directory
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 748e79f

Please sign in to comment.