
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
stackshifter
Advanced tools
A powerful CLI tool to effortlessly migrate your React applications to Next.js with automatic file restructuring, CSS Modules conversion, and routing transformation.
shiftto) or automatic (migrate) workflowsgit clone https://github.com/yourusername/stackshifter.git
cd stackshifter
npm install
npm link # Makes stackshifter command available globally
npm install -g stackshifter
StackShifter provides two powerful commands for different migration workflows:
shiftto - Manual MigrationCreates a migration-output folder that you manually copy to your Next.js project.
stackshifter shiftto nextjs -i ./my-react-app
stackshifter shiftto tsx -i ./component.jsx
migrate - Automatic MigrationCreates a complete Next.js 13+ app with your migrated code automatically integrated.
stackshifter migrate -s ./my-react-app -t ./output-directory -n my-nextjs-app
Options:
-s, --source <path>: React app source directory (default: current directory)-t, --target <path>: Directory where Next.js app will be created (required)-n, --name <name>: Name of the Next.js app (required)--no-start: Don't automatically start the development serverCopy Public Assets
Migrates public/ folder contents to maintain static assets
Handle Styles
Converts CSS files to CSS Modules (.module.css) with automatic class name updates
Process Source Files
Copies and processes src/pages/ and src/components/ with nested directory support
Normalize Pages
Converts React Router structure to Next.js pages with dynamic routes support
Fix Class Names
Updates JSX to use CSS Modules syntax (className={styles.className})
JSX Transformations
react-router-dom)<Link to="..."> to <Link href="..."><BrowserRouter>, <Routes>, <Route> wrappersLink importsCorrect Import Paths
Updates all import statements to match new file structure
Add "use client" Directives
Automatically detects and adds client directives for components using:
useState, useEffect, etc.)onClick, onChange, etc.)window, localStorage, etc.)my-react-app/
├── public/
│ ├── favicon.ico
│ └── images/
├── src/
│ ├── components/
│ │ ├── Header.jsx
│ │ └── Footer/
│ │ └── Footer.jsx
│ ├── pages/
│ │ ├── index.jsx # Homepage
│ │ ├── about.jsx # About page
│ │ └── blog/
│ │ ├── index.jsx # Blog homepage
│ │ └── [slug].jsx # Dynamic blog post
│ ├── styles/
│ │ ├── globals.css
│ │ └── components.css
│ └── App.jsx
└── package.json
my-nextjs-app/
├── public/ # ← Copied from React app
├── styles/ # ← CSS Modules (.module.css)
├── src/
│ ├── app/ # ← Next.js 13+ App Directory
│ │ ├── page.js # ← From pages/index.jsx
│ │ ├── layout.js # ← Auto-generated
│ │ ├── about/
│ │ │ └── page.js # ← From pages/about.jsx
│ │ └── blog/
│ │ ├── page.js # ← From pages/blog/index.jsx
│ │ └── [slug]/
│ │ └── page.js # ← From pages/blog/[slug].jsx
│ └── components/ # ← Processed components with CSS Modules
└── package.json
StackShifter automatically handles complex nested page structures:
// Input: src/pages/dashboard/analytics/reports.jsx
// Output: src/app/dashboard/analytics/reports/page.js
Supports all Next.js dynamic routing patterns:
[id].jsx → [id]/page.js (Single dynamic segment)[...slug].jsx → [...slug]/page.js (Catch-all routes)[[...slug]].jsx → [[...slug]]/page.js (Optional catch-all)Automatically converts and updates CSS usage:
// Before
import './Button.css';
<button className="primary-btn">Click me</button>
// After
import styles from '../../styles/Button.module.css';
<button className={styles.primaryBtn}>Click me</button>
StackShifter focuses on the core migration challenges that matter most - file structure, routing, styling, and component compatibility. Here's what we handle automatically and what you might need to fine-tune:
app/api/ - Next.js makes this super easyMost "limitations" are actually opportunities to modernize! Next.js 13+ provides better alternatives to many custom configurations, and our migration gives you a solid foundation to build upon.
Bottom Line: StackShifter handles the heavy lifting (90% of migration work), leaving you with minor adjustments that are often improvements to your codebase!
# Create migration output folder
stackshifter shiftto nextjs -i ./my-react-app
# Or create complete Next.js app
stackshifter migrate -s ./my-react-app -t ./projects -n awesome-nextjs-app
stackshifter shiftto tsx -i ./components/Button.jsx
# Creates: ./components/Button.tsx
stackshifter migrate \
-s ./complex-react-app \
-t ./output \
-n migrated-app \
--no-start
After migration, verify these key areas:
git clone https://github.com/Aditya0o7/stackshifter.git
cd stackshifter
npm install
npm link
npm test
Built with ❤️ using:
MIT © Aditya Sharma, Abhinav Verma
This project is licensed under the MIT License - see the LICENSE file for details
Happy migrating!
FAQs
Convert JSX to TSX and React to Next.js migrations
The npm package stackshifter receives a total of 1 weekly downloads. As such, stackshifter popularity was classified as not popular.
We found that stackshifter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.