mirror of
https://github.com/wshobson/agents.git
synced 2026-03-18 09:37:15 +00:00
Update npx packages referenced in markdown files (#425)
* use correct npx package names in md files * fix: update remaining non-existent npm package references - Replace react-codemod with jscodeshift in deps-upgrade.md - Remove non-existent changelog-parser reference --------- Co-authored-by: Seth Hobson <wshobson@gmail.com>
This commit is contained in:
@@ -660,8 +660,8 @@ framework_upgrades = {
|
|||||||
'react': {
|
'react': {
|
||||||
'upgrade_command': 'npm install react@{version} react-dom@{version}',
|
'upgrade_command': 'npm install react@{version} react-dom@{version}',
|
||||||
'codemods': [
|
'codemods': [
|
||||||
'npx react-codemod rename-unsafe-lifecycles',
|
'npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js src/',
|
||||||
'npx react-codemod error-boundaries'
|
'npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/error-boundaries.js src/'
|
||||||
],
|
],
|
||||||
'verification': [
|
'verification': [
|
||||||
'npm run build',
|
'npm run build',
|
||||||
@@ -671,7 +671,7 @@ framework_upgrades = {
|
|||||||
},
|
},
|
||||||
'vue': {
|
'vue': {
|
||||||
'upgrade_command': 'npm install vue@{version}',
|
'upgrade_command': 'npm install vue@{version}',
|
||||||
'migration_tool': 'npx @vue/migration-tool',
|
'migration_tool': 'npx vue-codemod -t <transform> <path>',
|
||||||
'breaking_changes': {
|
'breaking_changes': {
|
||||||
'2_to_3': [
|
'2_to_3': [
|
||||||
'Composition API',
|
'Composition API',
|
||||||
|
|||||||
@@ -161,24 +161,24 @@ describe("Dependency Compatibility", () => {
|
|||||||
### Identifying Breaking Changes
|
### Identifying Breaking Changes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Use changelog parsers
|
# Check the changelog directly
|
||||||
npx changelog-parser react 16.0.0 17.0.0
|
curl https://raw.githubusercontent.com/facebook/react/master/CHANGELOG.md
|
||||||
|
|
||||||
# Or manually check
|
|
||||||
curl https://raw.githubusercontent.com/facebook/react/main/CHANGELOG.md
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Codemod for Automated Fixes
|
### Codemod for Automated Fixes
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# React upgrade codemods
|
# Run jscodeshift with transform URL
|
||||||
npx react-codeshift <transform> <path>
|
npx jscodeshift -t <transform-url> <path>
|
||||||
|
|
||||||
# Example: Update lifecycle methods
|
# Example: Rename unsafe lifecycle methods
|
||||||
npx react-codeshift \
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js src/
|
||||||
--parser tsx \
|
|
||||||
--transform react-codeshift/transforms/rename-unsafe-lifecycles.js \
|
# For TypeScript files
|
||||||
src/
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js --parser=tsx src/
|
||||||
|
|
||||||
|
# Dry run to preview changes
|
||||||
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js --dry src/
|
||||||
```
|
```
|
||||||
|
|
||||||
### Custom Migration Script
|
### Custom Migration Script
|
||||||
|
|||||||
@@ -327,21 +327,20 @@ function ProfileTimeline() {
|
|||||||
### Run React Codemods
|
### Run React Codemods
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Install jscodeshift
|
# Rename unsafe lifecycle methods
|
||||||
npm install -g jscodeshift
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js src/
|
||||||
|
|
||||||
# React 16.9 codemod (rename unsafe lifecycle methods)
|
# Update React imports (React 17+)
|
||||||
npx react-codeshift <transform> <path>
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/update-react-imports.js src/
|
||||||
|
|
||||||
# Example: Rename UNSAFE_ methods
|
# Add error boundaries
|
||||||
npx react-codeshift --parser=tsx \
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/error-boundaries.js src/
|
||||||
--transform=react-codeshift/transforms/rename-unsafe-lifecycles.js \
|
|
||||||
src/
|
|
||||||
|
|
||||||
# Update to new JSX Transform (React 17+)
|
# For TypeScript files
|
||||||
npx react-codeshift --parser=tsx \
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js --parser=tsx src/
|
||||||
--transform=react-codeshift/transforms/new-jsx-transform.js \
|
|
||||||
src/
|
# Dry run to preview changes
|
||||||
|
npx jscodeshift -t https://raw.githubusercontent.com/reactjs/react-codemod/master/transforms/rename-unsafe-lifecycles.js --dry --print src/
|
||||||
|
|
||||||
# Class to Hooks (third-party)
|
# Class to Hooks (third-party)
|
||||||
npx codemod react/hooks/convert-class-to-function src/
|
npx codemod react/hooks/convert-class-to-function src/
|
||||||
|
|||||||
Reference in New Issue
Block a user