ikramhussainsiyam-create-my-project 1.0.1 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. package/cli.js +17 -4
  2. package/package.json +1 -1
  3. package/templates/NextJS/JavaScript/.eslintrc.json +3 -0
  4. package/templates/NextJS/JavaScript/README.md +36 -0
  5. package/templates/NextJS/JavaScript/gitignore-template +38 -0
  6. package/templates/NextJS/JavaScript/jsconfig.json +7 -0
  7. package/templates/NextJS/JavaScript/next.config.mjs +4 -0
  8. package/templates/{ViteJS/TypeScript → NextJS/JavaScript}/package-lock.json +3099 -2165
  9. package/templates/NextJS/JavaScript/package.json +30 -0
  10. package/templates/NextJS/JavaScript/postcss.config.mjs +8 -0
  11. package/templates/NextJS/JavaScript/src/app/favicon.ico +0 -0
  12. package/templates/{ViteJS/TypeScript/src/index.css → NextJS/JavaScript/src/app/globals.css} +7 -2
  13. package/templates/NextJS/JavaScript/src/app/layout.jsx +26 -0
  14. package/templates/NextJS/JavaScript/src/app/page.jsx +3 -0
  15. package/templates/NextJS/JavaScript/src/components/Navlink.jsx +28 -0
  16. package/templates/NextJS/JavaScript/src/components/ToastContainer.jsx +84 -0
  17. package/templates/NextJS/JavaScript/src/components/ui/Alert.jsx +48 -0
  18. package/templates/NextJS/JavaScript/src/components/ui/Button.jsx +58 -0
  19. package/templates/NextJS/JavaScript/src/components/ui/Skeleton.jsx +14 -0
  20. package/templates/NextJS/JavaScript/src/lib/utils.js +24 -0
  21. package/templates/NextJS/JavaScript/tailwind.config.js +20 -0
  22. package/templates/ViteJS/JavaScript/README.md +3 -0
  23. package/templates/ViteJS/JavaScript/eslint.config.js +1 -4
  24. package/templates/ViteJS/JavaScript/gitignore-template +1 -0
  25. package/templates/ViteJS/JavaScript/package.json +7 -2
  26. package/templates/ViteJS/JavaScript/src/index.css +15 -1
  27. package/templates/ViteJS/JavaScript/src/lib/utils.js +10 -0
  28. package/templates/ViteJS/JavaScript/tailwind.config.js +8 -3
  29. package/templates/ViteJS/JavaScript/src/components/Button.jsx +0 -5
  30. package/templates/ViteJS/TypeScript/README.md +0 -50
  31. package/templates/ViteJS/TypeScript/eslint.config.js +0 -35
  32. package/templates/ViteJS/TypeScript/gitignore-template +0 -24
  33. package/templates/ViteJS/TypeScript/index.html +0 -13
  34. package/templates/ViteJS/TypeScript/package.json +0 -33
  35. package/templates/ViteJS/TypeScript/postcss.config.js +0 -6
  36. package/templates/ViteJS/TypeScript/public/vite.svg +0 -1
  37. package/templates/ViteJS/TypeScript/src/App.tsx +0 -5
  38. package/templates/ViteJS/TypeScript/src/components/Button.tsx +0 -3
  39. package/templates/ViteJS/TypeScript/src/main.tsx +0 -10
  40. package/templates/ViteJS/TypeScript/src/vite-env.d.ts +0 -1
  41. package/templates/ViteJS/TypeScript/tailwind.config.js +0 -13
  42. package/templates/ViteJS/TypeScript/tsconfig.app.json +0 -25
  43. package/templates/ViteJS/TypeScript/tsconfig.json +0 -7
  44. package/templates/ViteJS/TypeScript/tsconfig.node.json +0 -23
  45. package/templates/ViteJS/TypeScript/vite.config.ts +0 -7
package/cli.js CHANGED
@@ -1,4 +1,6 @@
1
- #!/usr/bin/env node
1
+ #!/usr/bin/env node
2
+
3
+ // TODO (for later): update in `package.json` deps from `react-toastify` to `sonner`.
2
4
 
3
5
  import { execSync } from "child_process";
4
6
  import fs from "fs-extra";
@@ -10,7 +12,11 @@ const __filename = fileURLToPath(import.meta.url);
10
12
  const __dirname = path.dirname(__filename);
11
13
 
12
14
  async function main() {
13
- const { framework, language, projectName } = await inquirer.prompt([
15
+ const {
16
+ framework,
17
+ language,
18
+ projectName: rawProjectName,
19
+ } = await inquirer.prompt([
14
20
  { type: "input", name: "projectName", message: "Enter project name:" },
15
21
  {
16
22
  type: "list",
@@ -22,17 +28,24 @@ async function main() {
22
28
  type: "list",
23
29
  name: "language",
24
30
  message: "Choose your language:",
25
- choices: ["JavaScript", "TypeScript"],
31
+ choices: ["JavaScript"],
26
32
  },
27
33
  ]);
28
34
 
35
+ // Determine the actual project name
36
+ const projectName =
37
+ rawProjectName === "." ? path.basename(process.cwd()) : rawProjectName;
38
+
29
39
  const templatePath = path.join(
30
40
  __dirname,
31
41
  "templates",
32
42
  `${framework}JS`,
33
43
  language
34
44
  );
35
- const targetPath = path.join(process.cwd(), projectName);
45
+ const targetPath = path.join(
46
+ process.cwd(),
47
+ rawProjectName === "." ? "" : projectName
48
+ );
36
49
 
37
50
  try {
38
51
  // Copy template files to the new project directory
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "ikramhussainsiyam-create-my-project",
4
- "version": "1.0.1",
4
+ "version": "1.3.1",
5
5
  "description": "Most used React/Next JS/TS settings and configs as a template.",
6
6
  "main": "cli.js",
7
7
  "bin": {
@@ -0,0 +1,3 @@
1
+ {
2
+ "extends": "next/core-web-vitals"
3
+ }
@@ -0,0 +1,36 @@
1
+ This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2
+
3
+ ## Getting Started
4
+
5
+ First, run the development server:
6
+
7
+ ```bash
8
+ npm run dev
9
+ # or
10
+ yarn dev
11
+ # or
12
+ pnpm dev
13
+ # or
14
+ bun dev
15
+ ```
16
+
17
+ Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
18
+
19
+ You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
20
+
21
+ This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
22
+
23
+ ## Learn More
24
+
25
+ To learn more about Next.js, take a look at the following resources:
26
+
27
+ - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
28
+ - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
29
+
30
+ You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
31
+
32
+ ## Deploy on Vercel
33
+
34
+ The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
35
+
36
+ Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
@@ -0,0 +1,38 @@
1
+ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2
+
3
+ # dependencies
4
+ /node_modules
5
+ /.pnp
6
+ .pnp.js
7
+ .yarn/install-state.gz
8
+
9
+ # testing
10
+ /coverage
11
+
12
+ # next.js
13
+ /.next/
14
+ /out/
15
+
16
+ # production
17
+ /build
18
+
19
+ # misc
20
+ .DS_Store
21
+ *.pem
22
+
23
+ # debug
24
+ npm-debug.log*
25
+ yarn-debug.log*
26
+ yarn-error.log*
27
+ html_template
28
+ server
29
+
30
+ # local env files
31
+ .env*.local
32
+
33
+ # vercel
34
+ .vercel
35
+
36
+ # typescript
37
+ *.tsbuildinfo
38
+ next-env.d.ts
@@ -0,0 +1,7 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {
4
+ "@/*": ["./src/*"]
5
+ }
6
+ }
7
+ }
@@ -0,0 +1,4 @@
1
+ /** @type {import('next').NextConfig} */
2
+ const nextConfig = {};
3
+
4
+ export default nextConfig;