create-express-react-mongo 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.
Files changed (50) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +10 -0
  3. package/bin/index.ts +60 -0
  4. package/dist/index.js +42 -0
  5. package/package.json +36 -0
  6. package/templates/default/client/README.md +1 -0
  7. package/templates/default/client/eslint.config.js +28 -0
  8. package/templates/default/client/index.html +15 -0
  9. package/templates/default/client/package-lock.json +4159 -0
  10. package/templates/default/client/package.json +32 -0
  11. package/templates/default/client/public/vite.svg +1 -0
  12. package/templates/default/client/src/App.css +4 -0
  13. package/templates/default/client/src/App.d.ts +4 -0
  14. package/templates/default/client/src/App.d.ts.map +1 -0
  15. package/templates/default/client/src/App.js +17 -0
  16. package/templates/default/client/src/App.js.map +1 -0
  17. package/templates/default/client/src/App.tsx +28 -0
  18. package/templates/default/client/src/components/index.d.ts +5 -0
  19. package/templates/default/client/src/components/index.d.ts.map +1 -0
  20. package/templates/default/client/src/components/index.js +7 -0
  21. package/templates/default/client/src/components/index.js.map +1 -0
  22. package/templates/default/client/src/components/index.tsx +12 -0
  23. package/templates/default/client/src/index.css +19 -0
  24. package/templates/default/client/src/main.d.ts +2 -0
  25. package/templates/default/client/src/main.d.ts.map +1 -0
  26. package/templates/default/client/src/main.js +7 -0
  27. package/templates/default/client/src/main.js.map +1 -0
  28. package/templates/default/client/src/main.tsx +10 -0
  29. package/templates/default/client/src/services/initialContent.d.ts +6 -0
  30. package/templates/default/client/src/services/initialContent.d.ts.map +1 -0
  31. package/templates/default/client/src/services/initialContent.js +30 -0
  32. package/templates/default/client/src/services/initialContent.js.map +1 -0
  33. package/templates/default/client/src/services/initialContent.ts +30 -0
  34. package/templates/default/client/src/vite-env.d.ts +3 -0
  35. package/templates/default/client/tsconfig.json +24 -0
  36. package/templates/default/client/tsconfig.node.json +10 -0
  37. package/templates/default/client/vite.config.d.ts +3 -0
  38. package/templates/default/client/vite.config.d.ts.map +1 -0
  39. package/templates/default/client/vite.config.js +7 -0
  40. package/templates/default/client/vite.config.js.map +1 -0
  41. package/templates/default/client/vite.config.ts +7 -0
  42. package/templates/default/server/README.md +1 -0
  43. package/templates/default/server/package-lock.json +2379 -0
  44. package/templates/default/server/package.json +28 -0
  45. package/templates/default/server/src/index.d.ts +2 -0
  46. package/templates/default/server/src/index.d.ts.map +1 -0
  47. package/templates/default/server/src/index.js +56 -0
  48. package/templates/default/server/src/index.js.map +1 -0
  49. package/templates/default/server/src/index.ts +66 -0
  50. package/templates/default/server/tsconfig.json +49 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nimisha Jain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,10 @@
1
+ # react-express-mongo
2
+
3
+
4
+ | Package | Purpose |
5
+ | -------- | ----------------------- |
6
+ | fs-extra | Copy files easily |
7
+ | chalk | Colored terminal output |
8
+ | ora | Spinner |
9
+ | prompts | CLI questions |
10
+ | execa | Run shell commands |
package/bin/index.ts ADDED
@@ -0,0 +1,60 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from "fs-extra";
4
+ import path from "node:path";
5
+ import chalk from "chalk";
6
+ import prompts from "prompts";
7
+ import { execa } from "execa";
8
+ import { fileURLToPath } from "node:url";
9
+
10
+ const __filename = fileURLToPath(import.meta.url);
11
+ const __dirname = path.dirname(__filename);
12
+
13
+ console.log("CLI CREATED!!")
14
+
15
+ async function main() {
16
+ console.log(
17
+ chalk.green("\n Creating Express-React-Mongo app\n")
18
+ );
19
+
20
+ const response = await prompts({
21
+ type: "text",
22
+ name: "projectName",
23
+ message: "Project name:",
24
+ initial: "my-app"
25
+ });
26
+
27
+ const projectName = response.projectName;
28
+
29
+ const targetDir = path.join(process.cwd(), projectName);
30
+
31
+ // Copy template
32
+ const templateDir = path.join(
33
+ __dirname,
34
+ "../templates/default"
35
+ );
36
+
37
+ await fs.copy(templateDir, targetDir);
38
+
39
+ console.log(chalk.blue("\n Installing dependencies...\n"));
40
+
41
+ // Install dependencies
42
+ await execa("npm", ["install"], {
43
+ cwd: targetDir,
44
+ stdio: "inherit"
45
+ });
46
+
47
+ console.log(chalk.green("\n Project created successfully!\n"));
48
+
49
+ console.log(`
50
+ Next steps:
51
+
52
+ cd ${projectName}
53
+ npm run dev
54
+ `);
55
+ }
56
+
57
+ main().catch((err) => {
58
+ console.error(err);
59
+ process.exit(1);
60
+ });
package/dist/index.js ADDED
@@ -0,0 +1,42 @@
1
+ #!/usr/bin/env node
2
+ import fs from "fs-extra";
3
+ import path from "node:path";
4
+ import chalk from "chalk";
5
+ import prompts from "prompts";
6
+ import { execa } from "execa";
7
+ import { fileURLToPath } from "node:url";
8
+ const __filename = fileURLToPath(import.meta.url);
9
+ const __dirname = path.dirname(__filename);
10
+ console.log("CLI CREATED!!");
11
+ async function main() {
12
+ console.log(chalk.green("\n Creating Express-React-Mongo app\n"));
13
+ const response = await prompts({
14
+ type: "text",
15
+ name: "projectName",
16
+ message: "Project name:",
17
+ initial: "my-app"
18
+ });
19
+ const projectName = response.projectName;
20
+ const targetDir = path.join(process.cwd(), projectName);
21
+ // Copy template
22
+ const templateDir = path.join(__dirname, "../templates/default");
23
+ await fs.copy(templateDir, targetDir);
24
+ console.log(chalk.blue("\n Installing dependencies...\n"));
25
+ // Install dependencies
26
+ await execa("npm", ["install"], {
27
+ cwd: targetDir,
28
+ stdio: "inherit"
29
+ });
30
+ console.log(chalk.green("\n Project created successfully!\n"));
31
+ console.log(`
32
+ Next steps:
33
+
34
+ cd ${projectName}
35
+ npm run dev
36
+ `);
37
+ }
38
+ main().catch((err) => {
39
+ console.error(err);
40
+ process.exit(1);
41
+ });
42
+ //# sourceMappingURL=index.js.map
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "create-express-react-mongo",
3
+ "version": "1.0.0",
4
+ "type": "module",
5
+ "bin": {
6
+ "create-express-react-mongo": "./dist/index.js"
7
+ },
8
+ "scripts": {
9
+ "build": "tsc"
10
+ },
11
+ "files": [
12
+ "bin",
13
+ "templates"
14
+ ],
15
+ "keywords": [
16
+ "express",
17
+ "react",
18
+ "mongodb",
19
+ "mern",
20
+ "scaffold"
21
+ ],
22
+ "license": "ISC",
23
+ "dependencies": {
24
+ "chalk": "^5.6.2",
25
+ "execa": "^9.6.1",
26
+ "fs-extra": "^11.3.5",
27
+ "ora": "^9.4.0",
28
+ "prompts": "^2.4.2"
29
+ },
30
+ "devDependencies": {
31
+ "@types/fs-extra": "^11.0.4",
32
+ "@types/node": "^25.9.1",
33
+ "@types/prompts": "^2.4.9",
34
+ "typescript": "^6.0.3"
35
+ }
36
+ }
@@ -0,0 +1 @@
1
+ # react-express-mongo client
@@ -0,0 +1,28 @@
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import tseslint from 'typescript-eslint'
6
+
7
+ export default tseslint.config(
8
+ { ignores: ['dist'] },
9
+ {
10
+ extends: [js.configs.recommended, ...tseslint.configs.recommended],
11
+ files: ['**/*.{ts,tsx}'],
12
+ languageOptions: {
13
+ ecmaVersion: 2020,
14
+ globals: globals.browser,
15
+ },
16
+ plugins: {
17
+ 'react-hooks': reactHooks,
18
+ 'react-refresh': reactRefresh,
19
+ },
20
+ rules: {
21
+ ...reactHooks.configs.recommended.rules,
22
+ 'react-refresh/only-export-components': [
23
+ 'warn',
24
+ { allowConstantExport: true },
25
+ ],
26
+ },
27
+ },
28
+ )
@@ -0,0 +1,15 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <link rel="preconnect" href="https://fonts.googleapis.com">
7
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
8
+ <meta name="viewport" content="initial-scale=1, width=device-width" />
9
+ <title>Express-React-Mongo</title>
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ <script type="module" src="/src/main.tsx"></script>
14
+ </body>
15
+ </html>