@imksh/create 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -0
- package/bin/index.js +3 -0
- package/package.json +43 -0
- package/src/commands/create.js +90 -0
- package/src/index.js +41 -0
- package/src/utils/askTemplate.js +25 -0
- package/src/utils/copyTemplate.js +36 -0
- package/src/utils/installPackages.js +25 -0
- package/src/utils/logger.js +17 -0
- package/src/utils/runGit.js +11 -0
- package/templates/mern/_gitignore +2 -0
- package/templates/mern/client/_gitignore +24 -0
- package/templates/mern/client/index.html +14 -0
- package/templates/mern/client/package.json +39 -0
- package/templates/mern/client/public/_redirects +1 -0
- package/templates/mern/client/public/favicon.ico +0 -0
- package/templates/mern/client/public/favicon.svg +1 -0
- package/templates/mern/client/public/logo.png +0 -0
- package/templates/mern/client/public/manifest.json +24 -0
- package/templates/mern/client/public/sw.js +56 -0
- package/templates/mern/client/src/App.jsx +68 -0
- package/templates/mern/client/src/assets/animations/loading.json +1 -0
- package/templates/mern/client/src/assets/data/navigation.js +29 -0
- package/templates/mern/client/src/assets/images/logo.png +0 -0
- package/templates/mern/client/src/components/common/Breadcrumbs.jsx +27 -0
- package/templates/mern/client/src/components/common/Loading.jsx +19 -0
- package/templates/mern/client/src/components/common/LottieIcon.jsx +36 -0
- package/templates/mern/client/src/components/common/NotFound.jsx +78 -0
- package/templates/mern/client/src/components/common/PwaInstallPrompt.jsx +72 -0
- package/templates/mern/client/src/components/common/SEO.jsx +67 -0
- package/templates/mern/client/src/components/common/Scroll.jsx +25 -0
- package/templates/mern/client/src/components/common/Table.jsx +110 -0
- package/templates/mern/client/src/components/common/ToggleSwitch.jsx +38 -0
- package/templates/mern/client/src/components/common/Unauthorized.jsx +76 -0
- package/templates/mern/client/src/components/layout/ProtectedRoute.jsx +17 -0
- package/templates/mern/client/src/components/layout/PublicLayout.jsx +13 -0
- package/templates/mern/client/src/components/layout/SidebarLayout.jsx +37 -0
- package/templates/mern/client/src/components/modals/ConfirmModal.jsx +135 -0
- package/templates/mern/client/src/components/modals/Modal.jsx +94 -0
- package/templates/mern/client/src/components/skeletons/common/CardSkeleton.jsx +23 -0
- package/templates/mern/client/src/components/skeletons/common/DashboardSkeleton.jsx +19 -0
- package/templates/mern/client/src/components/skeletons/common/ListSkeleton.jsx +24 -0
- package/templates/mern/client/src/components/skeletons/common/PageSkeleton.jsx +26 -0
- package/templates/mern/client/src/components/skeletons/common/ProfileSkeleton.jsx +23 -0
- package/templates/mern/client/src/components/skeletons/common/Skeleton.jsx +18 -0
- package/templates/mern/client/src/components/skeletons/common/TableSkeleton.jsx +33 -0
- package/templates/mern/client/src/components/ui/Header.jsx +230 -0
- package/templates/mern/client/src/components/ui/SidebarHeader.jsx +27 -0
- package/templates/mern/client/src/components/ui/sidebar.jsx +152 -0
- package/templates/mern/client/src/config/api.js +22 -0
- package/templates/mern/client/src/config/appConfig.js +44 -0
- package/templates/mern/client/src/config/navigation.js +14 -0
- package/templates/mern/client/src/hooks/useLenis.js +28 -0
- package/templates/mern/client/src/hooks/usePwaInstall.js +45 -0
- package/templates/mern/client/src/hooks/useWindowSize.js +25 -0
- package/templates/mern/client/src/index.css +158 -0
- package/templates/mern/client/src/main.jsx +24 -0
- package/templates/mern/client/src/pages/Home.jsx +154 -0
- package/templates/mern/client/src/pages/Login.jsx +196 -0
- package/templates/mern/client/src/pages/Profile.jsx +9 -0
- package/templates/mern/client/src/services/authService.js +16 -0
- package/templates/mern/client/src/store/useAuthStore.js +98 -0
- package/templates/mern/client/src/store/useUiStore.js +54 -0
- package/templates/mern/client/src/utils/getInitials.js +10 -0
- package/templates/mern/client/vite.config.js +8 -0
- package/templates/mern/package.json +18 -0
- package/templates/mern/server/.env.example +62 -0
- package/templates/mern/server/README.md +65 -0
- package/templates/mern/server/_gitignore +24 -0
- package/templates/mern/server/package.json +32 -0
- package/templates/mern/server/src/app.js +42 -0
- package/templates/mern/server/src/config/cloudinary.js +9 -0
- package/templates/mern/server/src/config/db.js +14 -0
- package/templates/mern/server/src/config/dotenv.js +2 -0
- package/templates/mern/server/src/config/email.js +30 -0
- package/templates/mern/server/src/config/socket.js +54 -0
- package/templates/mern/server/src/config/webPush.js +9 -0
- package/templates/mern/server/src/controllers/auth.controller.js +153 -0
- package/templates/mern/server/src/controllers/upload.controller.js +26 -0
- package/templates/mern/server/src/index.js +24 -0
- package/templates/mern/server/src/middleware/auth.middleware.js +43 -0
- package/templates/mern/server/src/middleware/errorHandler.js +22 -0
- package/templates/mern/server/src/middleware/multer.js +21 -0
- package/templates/mern/server/src/middleware/rateLimiter.js +57 -0
- package/templates/mern/server/src/models/otp.model.js +21 -0
- package/templates/mern/server/src/models/pushSubscription.model.js +32 -0
- package/templates/mern/server/src/models/user.model.js +43 -0
- package/templates/mern/server/src/routes/auth.route.js +22 -0
- package/templates/mern/server/src/routes/index.js +10 -0
- package/templates/mern/server/src/routes/upload.route.js +12 -0
- package/templates/mern/server/src/services/auth.service.js +162 -0
- package/templates/mern/server/src/services/auth.service.ts +0 -0
- package/templates/mern/server/src/utils/authToken.js +26 -0
- package/templates/mern/server/src/utils/cloudinary.js +27 -0
- package/templates/mern/server/src/utils/cloudinaryUpload.js +87 -0
- package/templates/mern/server/src/utils/emailOtp.js +190 -0
- package/templates/mern/server/src/utils/genOtpToken.js +20 -0
- package/templates/mern/server/src/utils/generateVapidKeys.js +12 -0
- package/templates/mern/server/src/utils/jwt.js +25 -0
- package/templates/mern/server/src/utils/logger.js +25 -0
- package/templates/mern-ts/_gitignore +2 -0
- package/templates/mern-ts/client/_gitignore +24 -0
- package/templates/mern-ts/client/index.html +14 -0
- package/templates/mern-ts/client/package.json +45 -0
- package/templates/mern-ts/client/public/_redirects +1 -0
- package/templates/mern-ts/client/public/favicon.ico +0 -0
- package/templates/mern-ts/client/public/favicon.svg +1 -0
- package/templates/mern-ts/client/public/logo.png +0 -0
- package/templates/mern-ts/client/public/manifest.json +24 -0
- package/templates/mern-ts/client/public/sw.js +56 -0
- package/templates/mern-ts/client/src/App.tsx +68 -0
- package/templates/mern-ts/client/src/assets/animations/loading.json +1 -0
- package/templates/mern-ts/client/src/assets/data/navigation.ts +29 -0
- package/templates/mern-ts/client/src/assets/images/logo.png +0 -0
- package/templates/mern-ts/client/src/components/common/Breadcrumbs.tsx +27 -0
- package/templates/mern-ts/client/src/components/common/Loading.tsx +19 -0
- package/templates/mern-ts/client/src/components/common/LottieIcon.tsx +36 -0
- package/templates/mern-ts/client/src/components/common/NotFound.tsx +78 -0
- package/templates/mern-ts/client/src/components/common/PwaInstallPrompt.tsx +72 -0
- package/templates/mern-ts/client/src/components/common/SEO.tsx +67 -0
- package/templates/mern-ts/client/src/components/common/Scroll.tsx +25 -0
- package/templates/mern-ts/client/src/components/common/Table.tsx +118 -0
- package/templates/mern-ts/client/src/components/common/ToggleSwitch.tsx +38 -0
- package/templates/mern-ts/client/src/components/common/Unauthorized.tsx +76 -0
- package/templates/mern-ts/client/src/components/layout/ProtectedRoute.tsx +23 -0
- package/templates/mern-ts/client/src/components/layout/PublicLayout.tsx +13 -0
- package/templates/mern-ts/client/src/components/layout/SidebarLayout.tsx +37 -0
- package/templates/mern-ts/client/src/components/modals/ConfirmModal.tsx +135 -0
- package/templates/mern-ts/client/src/components/modals/Modal.tsx +94 -0
- package/templates/mern-ts/client/src/components/skeletons/common/CardSkeleton.tsx +23 -0
- package/templates/mern-ts/client/src/components/skeletons/common/DashboardSkeleton.tsx +19 -0
- package/templates/mern-ts/client/src/components/skeletons/common/ListSkeleton.tsx +24 -0
- package/templates/mern-ts/client/src/components/skeletons/common/PageSkeleton.tsx +26 -0
- package/templates/mern-ts/client/src/components/skeletons/common/ProfileSkeleton.tsx +23 -0
- package/templates/mern-ts/client/src/components/skeletons/common/Skeleton.tsx +18 -0
- package/templates/mern-ts/client/src/components/skeletons/common/TableSkeleton.tsx +33 -0
- package/templates/mern-ts/client/src/components/ui/Header.tsx +230 -0
- package/templates/mern-ts/client/src/components/ui/SidebarHeader.tsx +27 -0
- package/templates/mern-ts/client/src/components/ui/sidebar.tsx +152 -0
- package/templates/mern-ts/client/src/config/api.ts +22 -0
- package/templates/mern-ts/client/src/config/appConfig.ts +44 -0
- package/templates/mern-ts/client/src/config/navigation.ts +14 -0
- package/templates/mern-ts/client/src/hooks/useLenis.ts +28 -0
- package/templates/mern-ts/client/src/hooks/usePwaInstall.ts +45 -0
- package/templates/mern-ts/client/src/hooks/useWindowSize.ts +25 -0
- package/templates/mern-ts/client/src/index.css +158 -0
- package/templates/mern-ts/client/src/main.tsx +24 -0
- package/templates/mern-ts/client/src/pages/Home.tsx +154 -0
- package/templates/mern-ts/client/src/pages/Login.tsx +196 -0
- package/templates/mern-ts/client/src/pages/Profile.tsx +9 -0
- package/templates/mern-ts/client/src/services/authService.ts +16 -0
- package/templates/mern-ts/client/src/store/useAuthStore.ts +98 -0
- package/templates/mern-ts/client/src/store/useUiStore.ts +54 -0
- package/templates/mern-ts/client/src/utils/getInitials.ts +10 -0
- package/templates/mern-ts/client/tsconfig.json +25 -0
- package/templates/mern-ts/client/tsconfig.node.json +10 -0
- package/templates/mern-ts/client/vite.config.ts +8 -0
- package/templates/mern-ts/package.json +19 -0
- package/templates/mern-ts/server/.env.example +62 -0
- package/templates/mern-ts/server/README.md +69 -0
- package/templates/mern-ts/server/_gitignore +24 -0
- package/templates/mern-ts/server/package.json +47 -0
- package/templates/mern-ts/server/src/app.ts +36 -0
- package/templates/mern-ts/server/src/config/cloudinary.ts +9 -0
- package/templates/mern-ts/server/src/config/db.ts +15 -0
- package/templates/mern-ts/server/src/config/dotenv.ts +2 -0
- package/templates/mern-ts/server/src/config/email.ts +28 -0
- package/templates/mern-ts/server/src/config/socket.ts +54 -0
- package/templates/mern-ts/server/src/config/webPush.ts +9 -0
- package/templates/mern-ts/server/src/controllers/auth.controller.ts +126 -0
- package/templates/mern-ts/server/src/controllers/upload.controller.ts +22 -0
- package/templates/mern-ts/server/src/index.ts +17 -0
- package/templates/mern-ts/server/src/middleware/auth.middleware.ts +38 -0
- package/templates/mern-ts/server/src/middleware/errorHandler.ts +16 -0
- package/templates/mern-ts/server/src/middleware/multer.ts +20 -0
- package/templates/mern-ts/server/src/middleware/rateLimiter.ts +53 -0
- package/templates/mern-ts/server/src/models/otp.model.ts +21 -0
- package/templates/mern-ts/server/src/models/pushSubscription.model.ts +32 -0
- package/templates/mern-ts/server/src/models/user.model.ts +43 -0
- package/templates/mern-ts/server/src/routes/auth.route.ts +22 -0
- package/templates/mern-ts/server/src/routes/index.ts +10 -0
- package/templates/mern-ts/server/src/routes/upload.route.ts +11 -0
- package/templates/mern-ts/server/src/services/auth.service.ts +115 -0
- package/templates/mern-ts/server/src/types/express.d.ts +10 -0
- package/templates/mern-ts/server/src/utils/cloudinaryUpload.ts +44 -0
- package/templates/mern-ts/server/src/utils/emailOtp.ts +30 -0
- package/templates/mern-ts/server/src/utils/genOtpToken.ts +22 -0
- package/templates/mern-ts/server/src/utils/generateVapidKeys.ts +12 -0
- package/templates/mern-ts/server/src/utils/jwt.ts +27 -0
- package/templates/mern-ts/server/src/utils/logger.ts +27 -0
- package/templates/mern-ts/server/tsconfig.json +14 -0
- package/templates/next/_gitignore +24 -0
- package/templates/next/package.json +20 -0
- package/templates/next/src/app/layout.js +7 -0
- package/templates/next/src/app/page.js +218 -0
- package/templates/next-ts/_gitignore +24 -0
- package/templates/next-ts/package.json +24 -0
- package/templates/next-ts/src/app/layout.tsx +9 -0
- package/templates/next-ts/src/app/page.tsx +218 -0
- package/templates/next-ts/tsconfig.json +27 -0
- package/templates/node/.env.example +62 -0
- package/templates/node/README.md +65 -0
- package/templates/node/_gitignore +24 -0
- package/templates/node/package.json +32 -0
- package/templates/node/src/app.js +42 -0
- package/templates/node/src/config/cloudinary.js +9 -0
- package/templates/node/src/config/db.js +14 -0
- package/templates/node/src/config/dotenv.js +2 -0
- package/templates/node/src/config/email.js +30 -0
- package/templates/node/src/config/socket.js +54 -0
- package/templates/node/src/config/webPush.js +9 -0
- package/templates/node/src/controllers/auth.controller.js +153 -0
- package/templates/node/src/controllers/upload.controller.js +26 -0
- package/templates/node/src/index.js +24 -0
- package/templates/node/src/middleware/auth.middleware.js +43 -0
- package/templates/node/src/middleware/errorHandler.js +22 -0
- package/templates/node/src/middleware/multer.js +21 -0
- package/templates/node/src/middleware/rateLimiter.js +57 -0
- package/templates/node/src/models/otp.model.js +21 -0
- package/templates/node/src/models/pushSubscription.model.js +32 -0
- package/templates/node/src/models/user.model.js +43 -0
- package/templates/node/src/routes/auth.route.js +22 -0
- package/templates/node/src/routes/index.js +10 -0
- package/templates/node/src/routes/upload.route.js +12 -0
- package/templates/node/src/services/auth.service.js +162 -0
- package/templates/node/src/services/auth.service.ts +0 -0
- package/templates/node/src/utils/authToken.js +26 -0
- package/templates/node/src/utils/cloudinary.js +27 -0
- package/templates/node/src/utils/cloudinaryUpload.js +87 -0
- package/templates/node/src/utils/emailOtp.js +190 -0
- package/templates/node/src/utils/genOtpToken.js +20 -0
- package/templates/node/src/utils/generateVapidKeys.js +12 -0
- package/templates/node/src/utils/jwt.js +25 -0
- package/templates/node/src/utils/logger.js +25 -0
- package/templates/node-prisma/.env.example +63 -0
- package/templates/node-prisma/README.md +69 -0
- package/templates/node-prisma/_gitignore +24 -0
- package/templates/node-prisma/package.json +35 -0
- package/templates/node-prisma/prisma/schema.prisma +41 -0
- package/templates/node-prisma/src/app.js +42 -0
- package/templates/node-prisma/src/config/cloudinary.js +9 -0
- package/templates/node-prisma/src/config/db.js +16 -0
- package/templates/node-prisma/src/config/dotenv.js +2 -0
- package/templates/node-prisma/src/config/email.js +30 -0
- package/templates/node-prisma/src/config/socket.js +54 -0
- package/templates/node-prisma/src/config/webPush.js +9 -0
- package/templates/node-prisma/src/controllers/auth.controller.js +146 -0
- package/templates/node-prisma/src/controllers/upload.controller.js +26 -0
- package/templates/node-prisma/src/index.js +24 -0
- package/templates/node-prisma/src/middleware/auth.middleware.js +44 -0
- package/templates/node-prisma/src/middleware/errorHandler.js +22 -0
- package/templates/node-prisma/src/middleware/multer.js +21 -0
- package/templates/node-prisma/src/middleware/rateLimiter.js +57 -0
- package/templates/node-prisma/src/routes/auth.route.js +22 -0
- package/templates/node-prisma/src/routes/index.js +10 -0
- package/templates/node-prisma/src/routes/upload.route.js +12 -0
- package/templates/node-prisma/src/services/auth.service.js +163 -0
- package/templates/node-prisma/src/services/auth.service.ts +0 -0
- package/templates/node-prisma/src/utils/authToken.js +26 -0
- package/templates/node-prisma/src/utils/cloudinary.js +27 -0
- package/templates/node-prisma/src/utils/cloudinaryUpload.js +87 -0
- package/templates/node-prisma/src/utils/emailOtp.js +190 -0
- package/templates/node-prisma/src/utils/genOtpToken.js +20 -0
- package/templates/node-prisma/src/utils/generateVapidKeys.js +12 -0
- package/templates/node-prisma/src/utils/jwt.js +25 -0
- package/templates/node-prisma/src/utils/logger.js +25 -0
- package/templates/node-prisma-ts/.env.example +63 -0
- package/templates/node-prisma-ts/README.md +73 -0
- package/templates/node-prisma-ts/_gitignore +24 -0
- package/templates/node-prisma-ts/package.json +48 -0
- package/templates/node-prisma-ts/prisma/schema.prisma +41 -0
- package/templates/node-prisma-ts/src/app.ts +36 -0
- package/templates/node-prisma-ts/src/config/cloudinary.ts +9 -0
- package/templates/node-prisma-ts/src/config/db.ts +16 -0
- package/templates/node-prisma-ts/src/config/dotenv.ts +2 -0
- package/templates/node-prisma-ts/src/config/email.ts +28 -0
- package/templates/node-prisma-ts/src/config/socket.ts +54 -0
- package/templates/node-prisma-ts/src/config/webPush.ts +9 -0
- package/templates/node-prisma-ts/src/controllers/auth.controller.ts +124 -0
- package/templates/node-prisma-ts/src/controllers/upload.controller.ts +22 -0
- package/templates/node-prisma-ts/src/index.ts +17 -0
- package/templates/node-prisma-ts/src/middleware/auth.middleware.ts +45 -0
- package/templates/node-prisma-ts/src/middleware/errorHandler.ts +16 -0
- package/templates/node-prisma-ts/src/middleware/multer.ts +20 -0
- package/templates/node-prisma-ts/src/middleware/rateLimiter.ts +53 -0
- package/templates/node-prisma-ts/src/routes/auth.route.ts +22 -0
- package/templates/node-prisma-ts/src/routes/index.ts +10 -0
- package/templates/node-prisma-ts/src/routes/upload.route.ts +11 -0
- package/templates/node-prisma-ts/src/services/auth.service.ts +163 -0
- package/templates/node-prisma-ts/src/types/express.d.ts +10 -0
- package/templates/node-prisma-ts/src/utils/cloudinaryUpload.ts +44 -0
- package/templates/node-prisma-ts/src/utils/emailOtp.ts +30 -0
- package/templates/node-prisma-ts/src/utils/genOtpToken.ts +22 -0
- package/templates/node-prisma-ts/src/utils/generateVapidKeys.ts +12 -0
- package/templates/node-prisma-ts/src/utils/jwt.ts +27 -0
- package/templates/node-prisma-ts/src/utils/logger.ts +27 -0
- package/templates/node-prisma-ts/tsconfig.json +14 -0
- package/templates/node-ts/.env.example +62 -0
- package/templates/node-ts/README.md +69 -0
- package/templates/node-ts/_gitignore +24 -0
- package/templates/node-ts/package.json +47 -0
- package/templates/node-ts/src/app.ts +36 -0
- package/templates/node-ts/src/config/cloudinary.ts +9 -0
- package/templates/node-ts/src/config/db.ts +15 -0
- package/templates/node-ts/src/config/dotenv.ts +2 -0
- package/templates/node-ts/src/config/email.ts +28 -0
- package/templates/node-ts/src/config/socket.ts +54 -0
- package/templates/node-ts/src/config/webPush.ts +9 -0
- package/templates/node-ts/src/controllers/auth.controller.ts +126 -0
- package/templates/node-ts/src/controllers/upload.controller.ts +22 -0
- package/templates/node-ts/src/index.ts +17 -0
- package/templates/node-ts/src/middleware/auth.middleware.ts +38 -0
- package/templates/node-ts/src/middleware/errorHandler.ts +16 -0
- package/templates/node-ts/src/middleware/multer.ts +20 -0
- package/templates/node-ts/src/middleware/rateLimiter.ts +53 -0
- package/templates/node-ts/src/models/otp.model.ts +21 -0
- package/templates/node-ts/src/models/pushSubscription.model.ts +32 -0
- package/templates/node-ts/src/models/user.model.ts +43 -0
- package/templates/node-ts/src/routes/auth.route.ts +22 -0
- package/templates/node-ts/src/routes/index.ts +10 -0
- package/templates/node-ts/src/routes/upload.route.ts +11 -0
- package/templates/node-ts/src/services/auth.service.ts +115 -0
- package/templates/node-ts/src/types/express.d.ts +10 -0
- package/templates/node-ts/src/utils/cloudinaryUpload.ts +44 -0
- package/templates/node-ts/src/utils/emailOtp.ts +30 -0
- package/templates/node-ts/src/utils/genOtpToken.ts +22 -0
- package/templates/node-ts/src/utils/generateVapidKeys.ts +12 -0
- package/templates/node-ts/src/utils/jwt.ts +27 -0
- package/templates/node-ts/src/utils/logger.ts +27 -0
- package/templates/node-ts/tsconfig.json +18 -0
- package/templates/react/.env.example +1 -0
- package/templates/react/_gitignore +24 -0
- package/templates/react/index.html +14 -0
- package/templates/react/package.json +39 -0
- package/templates/react/public/_redirects +1 -0
- package/templates/react/public/favicon.ico +0 -0
- package/templates/react/public/favicon.svg +1 -0
- package/templates/react/public/logo.png +0 -0
- package/templates/react/public/manifest.json +24 -0
- package/templates/react/public/sw.js +56 -0
- package/templates/react/src/App.jsx +68 -0
- package/templates/react/src/assets/animations/loading.json +1 -0
- package/templates/react/src/assets/data/navigation.js +29 -0
- package/templates/react/src/assets/images/logo.png +0 -0
- package/templates/react/src/components/common/Breadcrumbs.jsx +27 -0
- package/templates/react/src/components/common/Loading.jsx +19 -0
- package/templates/react/src/components/common/LottieIcon.jsx +36 -0
- package/templates/react/src/components/common/NotFound.jsx +78 -0
- package/templates/react/src/components/common/PwaInstallPrompt.jsx +72 -0
- package/templates/react/src/components/common/SEO.jsx +67 -0
- package/templates/react/src/components/common/Scroll.jsx +25 -0
- package/templates/react/src/components/common/Table.jsx +110 -0
- package/templates/react/src/components/common/ToggleSwitch.jsx +38 -0
- package/templates/react/src/components/common/Unauthorized.jsx +76 -0
- package/templates/react/src/components/layout/ProtectedRoute.jsx +17 -0
- package/templates/react/src/components/layout/PublicLayout.jsx +13 -0
- package/templates/react/src/components/layout/SidebarLayout.jsx +37 -0
- package/templates/react/src/components/modals/ConfirmModal.jsx +135 -0
- package/templates/react/src/components/modals/Modal.jsx +94 -0
- package/templates/react/src/components/skeletons/common/CardSkeleton.jsx +23 -0
- package/templates/react/src/components/skeletons/common/DashboardSkeleton.jsx +19 -0
- package/templates/react/src/components/skeletons/common/ListSkeleton.jsx +24 -0
- package/templates/react/src/components/skeletons/common/PageSkeleton.jsx +26 -0
- package/templates/react/src/components/skeletons/common/ProfileSkeleton.jsx +23 -0
- package/templates/react/src/components/skeletons/common/Skeleton.jsx +18 -0
- package/templates/react/src/components/skeletons/common/TableSkeleton.jsx +33 -0
- package/templates/react/src/components/ui/Header.jsx +230 -0
- package/templates/react/src/components/ui/SidebarHeader.jsx +27 -0
- package/templates/react/src/components/ui/sidebar.jsx +152 -0
- package/templates/react/src/config/api.js +22 -0
- package/templates/react/src/config/appConfig.js +44 -0
- package/templates/react/src/config/navigation.js +14 -0
- package/templates/react/src/hooks/useLenis.js +28 -0
- package/templates/react/src/hooks/usePwaInstall.js +45 -0
- package/templates/react/src/hooks/useWindowSize.js +25 -0
- package/templates/react/src/index.css +158 -0
- package/templates/react/src/main.jsx +24 -0
- package/templates/react/src/pages/Home.jsx +154 -0
- package/templates/react/src/pages/Login.jsx +196 -0
- package/templates/react/src/pages/Profile.jsx +9 -0
- package/templates/react/src/services/authService.js +16 -0
- package/templates/react/src/store/useAuthStore.js +98 -0
- package/templates/react/src/store/useUiStore.js +54 -0
- package/templates/react/src/utils/getInitials.js +10 -0
- package/templates/react/vite.config.js +8 -0
- package/templates/react-ts/_gitignore +24 -0
- package/templates/react-ts/index.html +14 -0
- package/templates/react-ts/package.json +45 -0
- package/templates/react-ts/public/_redirects +1 -0
- package/templates/react-ts/public/favicon.ico +0 -0
- package/templates/react-ts/public/favicon.svg +1 -0
- package/templates/react-ts/public/logo.png +0 -0
- package/templates/react-ts/public/manifest.json +24 -0
- package/templates/react-ts/public/sw.js +56 -0
- package/templates/react-ts/src/App.tsx +68 -0
- package/templates/react-ts/src/assets/animations/loading.json +1 -0
- package/templates/react-ts/src/assets/data/navigation.ts +29 -0
- package/templates/react-ts/src/assets/images/logo.png +0 -0
- package/templates/react-ts/src/components/common/Breadcrumbs.tsx +27 -0
- package/templates/react-ts/src/components/common/Loading.tsx +19 -0
- package/templates/react-ts/src/components/common/LottieIcon.tsx +36 -0
- package/templates/react-ts/src/components/common/NotFound.tsx +78 -0
- package/templates/react-ts/src/components/common/PwaInstallPrompt.tsx +72 -0
- package/templates/react-ts/src/components/common/SEO.tsx +67 -0
- package/templates/react-ts/src/components/common/Scroll.tsx +25 -0
- package/templates/react-ts/src/components/common/Table.tsx +118 -0
- package/templates/react-ts/src/components/common/ToggleSwitch.tsx +38 -0
- package/templates/react-ts/src/components/common/Unauthorized.tsx +76 -0
- package/templates/react-ts/src/components/layout/ProtectedRoute.tsx +23 -0
- package/templates/react-ts/src/components/layout/PublicLayout.tsx +13 -0
- package/templates/react-ts/src/components/layout/SidebarLayout.tsx +37 -0
- package/templates/react-ts/src/components/modals/ConfirmModal.tsx +135 -0
- package/templates/react-ts/src/components/modals/Modal.tsx +94 -0
- package/templates/react-ts/src/components/skeletons/common/CardSkeleton.tsx +23 -0
- package/templates/react-ts/src/components/skeletons/common/DashboardSkeleton.tsx +19 -0
- package/templates/react-ts/src/components/skeletons/common/ListSkeleton.tsx +24 -0
- package/templates/react-ts/src/components/skeletons/common/PageSkeleton.tsx +26 -0
- package/templates/react-ts/src/components/skeletons/common/ProfileSkeleton.tsx +23 -0
- package/templates/react-ts/src/components/skeletons/common/Skeleton.tsx +18 -0
- package/templates/react-ts/src/components/skeletons/common/TableSkeleton.tsx +33 -0
- package/templates/react-ts/src/components/ui/Header.tsx +230 -0
- package/templates/react-ts/src/components/ui/SidebarHeader.tsx +27 -0
- package/templates/react-ts/src/components/ui/sidebar.tsx +152 -0
- package/templates/react-ts/src/config/api.ts +22 -0
- package/templates/react-ts/src/config/appConfig.ts +44 -0
- package/templates/react-ts/src/config/navigation.ts +14 -0
- package/templates/react-ts/src/hooks/useLenis.ts +28 -0
- package/templates/react-ts/src/hooks/usePwaInstall.ts +45 -0
- package/templates/react-ts/src/hooks/useWindowSize.ts +25 -0
- package/templates/react-ts/src/index.css +158 -0
- package/templates/react-ts/src/main.tsx +24 -0
- package/templates/react-ts/src/pages/Home.tsx +154 -0
- package/templates/react-ts/src/pages/Login.tsx +196 -0
- package/templates/react-ts/src/pages/Profile.tsx +9 -0
- package/templates/react-ts/src/services/authService.ts +16 -0
- package/templates/react-ts/src/store/useAuthStore.ts +98 -0
- package/templates/react-ts/src/store/useUiStore.ts +54 -0
- package/templates/react-ts/src/utils/getInitials.ts +10 -0
- package/templates/react-ts/tsconfig.json +25 -0
- package/templates/react-ts/tsconfig.node.json +10 -0
- package/templates/react-ts/vite.config.ts +8 -0
package/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# @imksh/create
|
|
2
|
+
|
|
3
|
+
A production-ready Node.js CLI tool to scaffold modern applications quickly. Built with ES Modules, Commander, Inquirer, Chalk, and Ora.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
You can use the CLI directly without installing via `npx` (or `pnpm dlx` / `yarn create`):
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx @imksh/create create my-app
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Or you can install it globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @imksh/create
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
Create a new project using the interactive prompt:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
imksh create my-app
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Options
|
|
28
|
+
|
|
29
|
+
- `--template <template-name>`: Bypass the interactive prompt and specify the template directly.
|
|
30
|
+
- `--skip-install`: Skip the automatic installation of dependencies.
|
|
31
|
+
- `--no-git`: Skip initializing a git repository.
|
|
32
|
+
- `--yes`: Use default options for everything without prompting.
|
|
33
|
+
|
|
34
|
+
### Examples
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
# Interactive mode
|
|
38
|
+
imksh create my-app
|
|
39
|
+
|
|
40
|
+
# Specify template directly
|
|
41
|
+
imksh create my-app --template react-ts
|
|
42
|
+
|
|
43
|
+
# Skip installing dependencies
|
|
44
|
+
imksh create my-app --template next --skip-install
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Available Templates
|
|
48
|
+
|
|
49
|
+
- `react`: Vite, React, React Router, Axios, TailwindCSS, Lucide.
|
|
50
|
+
- `react-ts`: Same as `react`, but with TypeScript.
|
|
51
|
+
- `node`: Express, security middlewares, separated `app.js`/`index.js` architecture, custom colorized logger, JWT, Rate Limiter, Socket.io scaffolding, web-push subscriptions, SMTP OTP mailer, and Cloudinary uploads.
|
|
52
|
+
- `node-ts`: Same as `node`, but with TypeScript, global request type extensions (`src/types/express.d.ts`), and powered by `tsx` (TypeScript Execute) runtime.
|
|
53
|
+
- `node-prisma`: Node.js template with Prisma ORM setup, mapping relational models for Users, OTPs, and push subscriptions.
|
|
54
|
+
- `node-prisma-ts`: Same as `node-prisma`, but with TypeScript and `tsx` configuration.
|
|
55
|
+
- `mern`: Full-stack React client + Express/Node server incorporating the new modular structure.
|
|
56
|
+
- `mern-ts`: Full-stack React client (TS) + Express/Node server (TS) incorporating the new modular structure.
|
|
57
|
+
- `next`: Next.js App Router boilerplate.
|
|
58
|
+
- `next-ts`: Next.js App Router boilerplate with TypeScript.
|
|
59
|
+
|
|
60
|
+
## Adding Templates
|
|
61
|
+
|
|
62
|
+
To add a new template, simply create a new folder under `templates/` with your template name and populate it with the complete boilerplate. The CLI automatically copies it when selected.
|
|
63
|
+
|
|
64
|
+
## Folder Structure
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
@imksh/create/
|
|
68
|
+
├── bin/ # Executable entry
|
|
69
|
+
├── src/ # Core CLI logic
|
|
70
|
+
│ ├── commands/ # CLI Commands (create, etc.)
|
|
71
|
+
│ └── utils/ # Helper functions
|
|
72
|
+
└── templates/ # Project boilerplate templates
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Publishing to npm
|
|
76
|
+
|
|
77
|
+
To publish this package to npm:
|
|
78
|
+
|
|
79
|
+
1. Create an npm account and log in via terminal:
|
|
80
|
+
```bash
|
|
81
|
+
npm login
|
|
82
|
+
```
|
|
83
|
+
2. Make sure you are a member of the `@imksh` organization or it's your username.
|
|
84
|
+
3. Run the publish command:
|
|
85
|
+
```bash
|
|
86
|
+
npm publish --access public
|
|
87
|
+
```
|
|
88
|
+
4. To update future versions, update the version in `package.json` (or use `npm version patch/minor/major`) and run `npm publish --access public` again.
|
package/bin/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@imksh/create",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "A production-ready create for scaffolding modern applications.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"imksh": "./bin/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"bin",
|
|
14
|
+
"src",
|
|
15
|
+
"templates"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"create",
|
|
19
|
+
"create-app",
|
|
20
|
+
"scaffold",
|
|
21
|
+
"react",
|
|
22
|
+
"next",
|
|
23
|
+
"node",
|
|
24
|
+
"prisma",
|
|
25
|
+
"mern",
|
|
26
|
+
"imksh"
|
|
27
|
+
],
|
|
28
|
+
"author": "imksh",
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/imksh/create.git"
|
|
33
|
+
},
|
|
34
|
+
"homepage": "https://github.com/imksh/create#readme",
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"chalk": "^5.3.0",
|
|
37
|
+
"commander": "^12.0.0",
|
|
38
|
+
"execa": "^8.0.1",
|
|
39
|
+
"fs-extra": "^11.2.0",
|
|
40
|
+
"inquirer": "^9.2.16",
|
|
41
|
+
"ora": "^8.0.1"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { info, success, error } from '../utils/logger.js';
|
|
4
|
+
import { askTemplate } from '../utils/askTemplate.js';
|
|
5
|
+
import { copyTemplate } from '../utils/copyTemplate.js';
|
|
6
|
+
import { installPackages } from '../utils/installPackages.js';
|
|
7
|
+
import { runGit } from '../utils/runGit.js';
|
|
8
|
+
import ora from 'ora';
|
|
9
|
+
|
|
10
|
+
export default async function createCommand(projectName, options) {
|
|
11
|
+
const targetDir = path.resolve(process.cwd(), projectName);
|
|
12
|
+
|
|
13
|
+
if (fs.existsSync(targetDir)) {
|
|
14
|
+
throw new Error(`Folder ${projectName} already exists. Please choose a different name or delete the folder.`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
let template = options.template;
|
|
18
|
+
|
|
19
|
+
if (!template) {
|
|
20
|
+
if (options.yes) {
|
|
21
|
+
template = 'react';
|
|
22
|
+
} else {
|
|
23
|
+
template = await askTemplate();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const validTemplates = [
|
|
28
|
+
'react',
|
|
29
|
+
'react-ts',
|
|
30
|
+
'node',
|
|
31
|
+
'node-ts',
|
|
32
|
+
'node-prisma',
|
|
33
|
+
'node-prisma-ts',
|
|
34
|
+
'mern',
|
|
35
|
+
'mern-ts',
|
|
36
|
+
'next',
|
|
37
|
+
'next-ts'
|
|
38
|
+
];
|
|
39
|
+
if (!validTemplates.includes(template)) {
|
|
40
|
+
throw new Error(`Invalid template "${template}". Valid templates are: ${validTemplates.join(', ')}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
info(`\nCreating project in ${targetDir}...`);
|
|
44
|
+
const copySpinner = ora('Copying template...').start();
|
|
45
|
+
try {
|
|
46
|
+
await copyTemplate(template, targetDir, projectName);
|
|
47
|
+
copySpinner.succeed('Template copied successfully.');
|
|
48
|
+
} catch (err) {
|
|
49
|
+
copySpinner.fail('Failed to copy template.');
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
if (!options.skipInstall) {
|
|
54
|
+
const installSpinner = ora('Installing dependencies...').start();
|
|
55
|
+
try {
|
|
56
|
+
await installPackages(targetDir);
|
|
57
|
+
installSpinner.succeed('Dependencies installed successfully.');
|
|
58
|
+
} catch (err) {
|
|
59
|
+
installSpinner.fail('Failed to install dependencies.');
|
|
60
|
+
error(err.message);
|
|
61
|
+
}
|
|
62
|
+
} else {
|
|
63
|
+
info('Skipping dependency installation.');
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (options.git !== false) {
|
|
67
|
+
const gitSpinner = ora('Initializing git...').start();
|
|
68
|
+
try {
|
|
69
|
+
await runGit(targetDir);
|
|
70
|
+
gitSpinner.succeed('Git initialized successfully.');
|
|
71
|
+
} catch (err) {
|
|
72
|
+
gitSpinner.warn('Failed to initialize git (is git installed?)');
|
|
73
|
+
}
|
|
74
|
+
} else {
|
|
75
|
+
info('Skipping git initialization.');
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
success(`\nProject ${projectName} created successfully!`);
|
|
79
|
+
info(`\nTo get started:\n`);
|
|
80
|
+
info(` cd ${projectName}`);
|
|
81
|
+
if (options.skipInstall) {
|
|
82
|
+
info(` npm install`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (template === 'mern') {
|
|
86
|
+
info(` npm run dev (or follow README in the generated project)\n`);
|
|
87
|
+
} else {
|
|
88
|
+
info(` npm run dev\n`);
|
|
89
|
+
}
|
|
90
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import fs from "fs-extra";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
import createCommand from "./commands/create.js";
|
|
6
|
+
import { error } from "./utils/logger.js";
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
const packageJsonPath = path.join(__dirname, "../package.json");
|
|
12
|
+
const packageJson = fs.readJsonSync(packageJsonPath);
|
|
13
|
+
|
|
14
|
+
const program = new Command();
|
|
15
|
+
|
|
16
|
+
program
|
|
17
|
+
.name("imksh")
|
|
18
|
+
.description("A production-ready CLI for scaffolding modern applications.")
|
|
19
|
+
.version(packageJson.version);
|
|
20
|
+
|
|
21
|
+
program
|
|
22
|
+
.command("create")
|
|
23
|
+
.description("Create a new project")
|
|
24
|
+
.argument("<project-name>", "Name of the project")
|
|
25
|
+
.option(
|
|
26
|
+
"-t, --template <template>",
|
|
27
|
+
"Template to use (react, react-ts, node, node-ts, node-prisma, node-prisma-ts, mern, mern-ts, next, next-ts)",
|
|
28
|
+
)
|
|
29
|
+
.option("--skip-install", "Skip installing dependencies")
|
|
30
|
+
.option("--no-git", "Skip initializing a git repository")
|
|
31
|
+
.option("-y, --yes", "Use default options")
|
|
32
|
+
.action(async (projectName, options) => {
|
|
33
|
+
try {
|
|
34
|
+
await createCommand(projectName, options);
|
|
35
|
+
} catch (err) {
|
|
36
|
+
error(`Error: ${err.message}`);
|
|
37
|
+
process.exit(1);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
program.parse(process.argv);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import inquirer from 'inquirer';
|
|
2
|
+
|
|
3
|
+
export async function askTemplate() {
|
|
4
|
+
const { template } = await inquirer.prompt([
|
|
5
|
+
{
|
|
6
|
+
type: 'list',
|
|
7
|
+
name: 'template',
|
|
8
|
+
message: 'Which template would you like to use?',
|
|
9
|
+
choices: [
|
|
10
|
+
{ name: 'React (JS)', value: 'react' },
|
|
11
|
+
{ name: 'React (TS)', value: 'react-ts' },
|
|
12
|
+
{ name: 'Node (JS)', value: 'node' },
|
|
13
|
+
{ name: 'Node (TS)', value: 'node-ts' },
|
|
14
|
+
{ name: 'Node + Prisma (JS)', value: 'node-prisma' },
|
|
15
|
+
{ name: 'Node + Prisma (TS)', value: 'node-prisma-ts' },
|
|
16
|
+
{ name: 'MERN (JS)', value: 'mern' },
|
|
17
|
+
{ name: 'MERN (TS)', value: 'mern-ts' },
|
|
18
|
+
{ name: 'Next.js (JS)', value: 'next' },
|
|
19
|
+
{ name: 'Next.js (TS)', value: 'next-ts' },
|
|
20
|
+
],
|
|
21
|
+
},
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
return template;
|
|
25
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import fs from 'fs-extra';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
export async function copyTemplate(templateName, targetDir, projectName) {
|
|
9
|
+
const templateDir = path.resolve(__dirname, '../../templates', templateName);
|
|
10
|
+
|
|
11
|
+
if (!fs.existsSync(templateDir)) {
|
|
12
|
+
throw new Error(`Template directory not found: ${templateDir}`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
// Copy template files
|
|
16
|
+
await fs.copy(templateDir, targetDir, {
|
|
17
|
+
filter: (src) => {
|
|
18
|
+
// Exclude node_modules if they accidentally exist in template
|
|
19
|
+
return !src.includes('node_modules');
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// Rename package.json project name
|
|
24
|
+
const packageJsonPath = path.join(targetDir, 'package.json');
|
|
25
|
+
if (fs.existsSync(packageJsonPath)) {
|
|
26
|
+
const pkg = await fs.readJson(packageJsonPath);
|
|
27
|
+
pkg.name = projectName;
|
|
28
|
+
await fs.writeJson(packageJsonPath, pkg, { spaces: 2 });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Rename _gitignore to .gitignore
|
|
32
|
+
const gitignorePath = path.join(targetDir, '_gitignore');
|
|
33
|
+
if (fs.existsSync(gitignorePath)) {
|
|
34
|
+
await fs.rename(gitignorePath, path.join(targetDir, '.gitignore'));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
|
|
3
|
+
export async function installPackages(targetDir) {
|
|
4
|
+
// Detect package manager based on process.env.npm_config_user_agent
|
|
5
|
+
let pm = 'npm';
|
|
6
|
+
const userAgent = process.env.npm_config_user_agent;
|
|
7
|
+
|
|
8
|
+
if (userAgent) {
|
|
9
|
+
if (userAgent.startsWith('yarn')) {
|
|
10
|
+
pm = 'yarn';
|
|
11
|
+
} else if (userAgent.startsWith('pnpm')) {
|
|
12
|
+
pm = 'pnpm';
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// Handle mern template differently (it might need install in root, or client/server separately)
|
|
17
|
+
// Our mern template will be designed such that 'npm install' at root installs everything
|
|
18
|
+
// using workspaces or postinstall scripts.
|
|
19
|
+
|
|
20
|
+
await execa(`${pm} install`, {
|
|
21
|
+
cwd: targetDir,
|
|
22
|
+
stdio: 'ignore',
|
|
23
|
+
shell: true
|
|
24
|
+
});
|
|
25
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
|
|
3
|
+
export function info(message) {
|
|
4
|
+
console.log(chalk.blue(message));
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function success(message) {
|
|
8
|
+
console.log(chalk.green(message));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function warning(message) {
|
|
12
|
+
console.log(chalk.yellow(message));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function error(message) {
|
|
16
|
+
console.error(chalk.red(message));
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { execa } from 'execa';
|
|
2
|
+
|
|
3
|
+
export async function runGit(targetDir) {
|
|
4
|
+
try {
|
|
5
|
+
await execa('git init', { cwd: targetDir, stdio: 'ignore', shell: true });
|
|
6
|
+
await execa('git add .', { cwd: targetDir, stdio: 'ignore', shell: true });
|
|
7
|
+
await execa('git commit -m "Initial commit from @imksh/cli"', { cwd: targetDir, stdio: 'ignore', shell: true });
|
|
8
|
+
} catch (err) {
|
|
9
|
+
throw new Error('Git initialization failed');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Logs
|
|
2
|
+
logs
|
|
3
|
+
*.log
|
|
4
|
+
npm-debug.log*
|
|
5
|
+
yarn-debug.log*
|
|
6
|
+
yarn-error.log*
|
|
7
|
+
pnpm-debug.log*
|
|
8
|
+
lerna-debug.log*
|
|
9
|
+
|
|
10
|
+
node_modules
|
|
11
|
+
dist
|
|
12
|
+
dist-ssr
|
|
13
|
+
*.local
|
|
14
|
+
|
|
15
|
+
# Editor directories and files
|
|
16
|
+
.vscode/*
|
|
17
|
+
!.vscode/extensions.json
|
|
18
|
+
.idea
|
|
19
|
+
.DS_Store
|
|
20
|
+
*.suo
|
|
21
|
+
*.ntvs*
|
|
22
|
+
*.njsproj
|
|
23
|
+
*.sln
|
|
24
|
+
*.sw?
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" href="/favicon.svg" type="image/svg+xml" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<link rel="manifest" href="/manifest.json" />
|
|
8
|
+
<title>React App</title>
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<div id="root"></div>
|
|
12
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
13
|
+
</body>
|
|
14
|
+
</html>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-template",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vite",
|
|
8
|
+
"build": "vite build",
|
|
9
|
+
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
|
|
10
|
+
"preview": "vite preview"
|
|
11
|
+
},
|
|
12
|
+
"dependencies": {
|
|
13
|
+
"@tailwindcss/vite": "^4.3.2",
|
|
14
|
+
"axios": "^1.6.0",
|
|
15
|
+
"flyonui": "^2.4.1",
|
|
16
|
+
"framer-motion": "^11.0.0",
|
|
17
|
+
"lenis": "^1.1.3",
|
|
18
|
+
"lottie-react": "^2.4.0",
|
|
19
|
+
"lucide-react": "^0.292.0",
|
|
20
|
+
"react": "^18.2.0",
|
|
21
|
+
"react-dom": "^18.2.0",
|
|
22
|
+
"react-hot-toast": "^2.4.1",
|
|
23
|
+
"react-icons": "^4.11.0",
|
|
24
|
+
"react-router-dom": "^6.18.0",
|
|
25
|
+
"tailwindcss": "^4.3.2",
|
|
26
|
+
"zustand": "^4.5.2"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "^18.2.37",
|
|
30
|
+
"@types/react-dom": "^18.2.15",
|
|
31
|
+
"@vitejs/plugin-react": "^4.2.0",
|
|
32
|
+
"autoprefixer": "^10.4.19",
|
|
33
|
+
"eslint": "^8.53.0",
|
|
34
|
+
"eslint-plugin-react": "^7.33.2",
|
|
35
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
36
|
+
"eslint-plugin-react-refresh": "^0.4.4",
|
|
37
|
+
"vite": "^5.0.0"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/* /index.html 200
|
|
Binary file
|