create-enchilada 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 (111) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -0
  3. package/dist/index.js +123 -0
  4. package/index.js +3 -0
  5. package/package.json +79 -0
  6. package/templates/node-express/.prettierrc.json +9 -0
  7. package/templates/node-express/.sequelizerc +6 -0
  8. package/templates/node-express/env-example +8 -0
  9. package/templates/node-express/eslint.config.mjs +15 -0
  10. package/templates/node-express/jest.config.js +13 -0
  11. package/templates/node-express/jest.config.unit.js +17 -0
  12. package/templates/node-express/package.json +47 -0
  13. package/templates/node-express/src/auth/index.js +1 -0
  14. package/templates/node-express/src/config/index.js +13 -0
  15. package/templates/node-express/src/db/index.js +16 -0
  16. package/templates/node-express/src/dtos/index.js +1 -0
  17. package/templates/node-express/src/index.js +24 -0
  18. package/templates/node-express/src/libs/sequelize.js +23 -0
  19. package/templates/node-express/src/middlewares/index.js +1 -0
  20. package/templates/node-express/src/routes/index.js +1 -0
  21. package/templates/node-express/src/services/index.js +1 -0
  22. package/templates/node-express/unit/fake.unit.test.js +5 -0
  23. package/templates/react/_gitignore +89 -0
  24. package/templates/react/index.html +13 -0
  25. package/templates/react/package.json +21 -0
  26. package/templates/react/src/App.css +3 -0
  27. package/templates/react/src/App.jsx +19 -0
  28. package/templates/react/src/index.css +57 -0
  29. package/templates/react/src/main.jsx +10 -0
  30. package/templates/react/vite.config.js +7 -0
  31. package/templates/react-dev/.babelrc +7 -0
  32. package/templates/react-dev/__tests__/App.test.jsx +9 -0
  33. package/templates/react-dev/_gitignore +89 -0
  34. package/templates/react-dev/eslint.config.js +27 -0
  35. package/templates/react-dev/index.html +13 -0
  36. package/templates/react-dev/jest.config.cjs +13 -0
  37. package/templates/react-dev/jest.setup.js +1 -0
  38. package/templates/react-dev/package.json +41 -0
  39. package/templates/react-dev/postcss.config.mjs +5 -0
  40. package/templates/react-dev/src/App.jsx +22 -0
  41. package/templates/react-dev/src/index.css +1 -0
  42. package/templates/react-dev/src/main.jsx +10 -0
  43. package/templates/react-dev/vite.config.js +7 -0
  44. package/templates/react-dev-typescript/.babelrc +11 -0
  45. package/templates/react-dev-typescript/__tests__/App.test.tsx +11 -0
  46. package/templates/react-dev-typescript/_gitignore +89 -0
  47. package/templates/react-dev-typescript/eslint.config.js +29 -0
  48. package/templates/react-dev-typescript/index.html +13 -0
  49. package/templates/react-dev-typescript/jest.config.cjs +13 -0
  50. package/templates/react-dev-typescript/jest.setup.js +1 -0
  51. package/templates/react-dev-typescript/package.json +44 -0
  52. package/templates/react-dev-typescript/postcss.config.mjs +5 -0
  53. package/templates/react-dev-typescript/src/App.tsx +21 -0
  54. package/templates/react-dev-typescript/src/index.css +1 -0
  55. package/templates/react-dev-typescript/src/main.tsx +10 -0
  56. package/templates/react-dev-typescript/src/vite-env.d.ts +1 -0
  57. package/templates/react-dev-typescript/tsconfig.app.json +27 -0
  58. package/templates/react-dev-typescript/tsconfig.json +11 -0
  59. package/templates/react-dev-typescript/tsconfig.node.json +13 -0
  60. package/templates/react-dev-typescript/vite.config.ts +7 -0
  61. package/templates/react-dev-webpack/.babelrc +7 -0
  62. package/templates/react-dev-webpack/__tests__/App.test.jsx +9 -0
  63. package/templates/react-dev-webpack/_gitignore +89 -0
  64. package/templates/react-dev-webpack/eslint.config.js +27 -0
  65. package/templates/react-dev-webpack/index.html +13 -0
  66. package/templates/react-dev-webpack/jest.config.cjs +13 -0
  67. package/templates/react-dev-webpack/jest.setup.js +1 -0
  68. package/templates/react-dev-webpack/package.json +45 -0
  69. package/templates/react-dev-webpack/postcss.config.mjs +5 -0
  70. package/templates/react-dev-webpack/src/App.jsx +22 -0
  71. package/templates/react-dev-webpack/src/index.css +1 -0
  72. package/templates/react-dev-webpack/src/main.jsx +10 -0
  73. package/templates/react-dev-webpack/webpack.config.cjs +43 -0
  74. package/templates/react-experimental/_gitignore +89 -0
  75. package/templates/react-experimental/farm.config.ts +5 -0
  76. package/templates/react-experimental/index.html +12 -0
  77. package/templates/react-experimental/oxlintrc.json +12 -0
  78. package/templates/react-experimental/package.json +28 -0
  79. package/templates/react-experimental/src/App.css +3 -0
  80. package/templates/react-experimental/src/App.jsx +20 -0
  81. package/templates/react-experimental/src/index.css +57 -0
  82. package/templates/react-experimental/src/main.jsx +10 -0
  83. package/templates/react-experimental/tsconfig.json +25 -0
  84. package/templates/react-experimental/tsconfig.node.json +11 -0
  85. package/templates/react-typescript/_gitignore +89 -0
  86. package/templates/react-typescript/eslint.config.js +26 -0
  87. package/templates/react-typescript/index.html +13 -0
  88. package/templates/react-typescript/package.json +29 -0
  89. package/templates/react-typescript/src/App.css +3 -0
  90. package/templates/react-typescript/src/App.tsx +18 -0
  91. package/templates/react-typescript/src/index.css +57 -0
  92. package/templates/react-typescript/src/main.tsx +10 -0
  93. package/templates/react-typescript/src/vite-env.d.ts +1 -0
  94. package/templates/react-typescript/tsconfig.app.json +27 -0
  95. package/templates/react-typescript/tsconfig.json +11 -0
  96. package/templates/react-typescript/tsconfig.node.json +13 -0
  97. package/templates/react-typescript/vite.config.ts +7 -0
  98. package/templates/react-webpack/.babelrc +6 -0
  99. package/templates/react-webpack/_gitignore +89 -0
  100. package/templates/react-webpack/index.html +13 -0
  101. package/templates/react-webpack/package.json +25 -0
  102. package/templates/react-webpack/src/App.css +3 -0
  103. package/templates/react-webpack/src/App.jsx +19 -0
  104. package/templates/react-webpack/src/index.css +57 -0
  105. package/templates/react-webpack/src/main.jsx +10 -0
  106. package/templates/react-webpack/webpack.config.js +43 -0
  107. package/templates/vanilla-js/_gitignore +89 -0
  108. package/templates/vanilla-js/index.html +17 -0
  109. package/templates/vanilla-js/index.js +11 -0
  110. package/templates/vanilla-js/package.json +14 -0
  111. package/templates/vanilla-js/style.css +60 -0
@@ -0,0 +1,89 @@
1
+ # compiled output
2
+ /dist
3
+ /tmp
4
+ /out-tsc
5
+
6
+ # Runtime data
7
+ pids
8
+ *.pid
9
+ *.seed
10
+ *.pid.lock
11
+
12
+ # Directory for instrumented libs generated by jscoverage/JSCover
13
+ lib-cov
14
+
15
+ # Coverage directory used by tools like istanbul
16
+ coverage
17
+
18
+ # nyc test coverage
19
+ .nyc_output
20
+
21
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22
+ .grunt
23
+
24
+ # Bower dependency directory (https://bower.io/)
25
+ bower_components
26
+
27
+ # node-waf configuration
28
+ .lock-wscript
29
+
30
+ # IDEs and editors
31
+ .idea
32
+ .project
33
+ .classpath
34
+ .c9/
35
+ *.launch
36
+ .settings/
37
+ *.sublime-workspace
38
+
39
+ # IDE - VSCode
40
+ .vscode/*
41
+ !.vscode/settings.json
42
+ !.vscode/tasks.json
43
+ !.vscode/launch.json
44
+ !.vscode/extensions.json
45
+
46
+ # misc
47
+ .sass-cache
48
+ connect.lock
49
+ typings
50
+
51
+ # Logs
52
+ logs
53
+ *.log
54
+ npm-debug.log*
55
+ yarn-debug.log*
56
+ yarn-error.log*
57
+
58
+
59
+ # Dependency directories
60
+ node_modules/
61
+ jspm_packages/
62
+
63
+ # Optional npm cache directory
64
+ .npm
65
+
66
+ # Optional eslint cache
67
+ .eslintcache
68
+
69
+ # Optional REPL history
70
+ .node_repl_history
71
+
72
+ # Output of 'npm pack'
73
+ *.tgz
74
+
75
+ # Yarn Integrity file
76
+ .yarn-integrity
77
+
78
+ # dotenv environment variables file
79
+ .env
80
+
81
+ # next.js build output
82
+ .next
83
+
84
+ # Lerna
85
+ lerna-debug.log
86
+
87
+ # System Files
88
+ .DS_Store
89
+ Thumbs.db
@@ -0,0 +1,29 @@
1
+ import js from "@eslint/js";
2
+ import globals from "globals";
3
+ import tseslint from "typescript-eslint";
4
+ import pluginReact from "eslint-plugin-react";
5
+ import pluginJest from 'eslint-plugin-jest';
6
+ import { defineConfig, globalIgnores } from "eslint/config";
7
+
8
+ export default defineConfig([
9
+ { plugins: { jest: pluginJest }, },
10
+ { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], plugins: { js }, extends: ["js/recommended"] },
11
+ { files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"], languageOptions: { globals: { ...globals.browser, ...globals.jest } } },
12
+ tseslint.configs.recommended,
13
+ pluginReact.configs.flat.recommended,
14
+ {
15
+ rules: {
16
+ ...pluginJest.configs.recommended.rules,
17
+ "react/react-in-jsx-scope": 0,
18
+ "react/jsx-uses-react": 0
19
+ },
20
+ },
21
+ {
22
+ settings: {
23
+ react: {
24
+ version: "detect",
25
+ },
26
+ },
27
+ },
28
+ globalIgnores(["**/coverage/**", "**/dist/**", "**/*.cjs"]),
29
+ ]);
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="#" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>React TypeScript</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.tsx"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,13 @@
1
+ /** @type {import('jest').Config} */
2
+ const config = {
3
+ verbose: true,
4
+ transform: {"\\.[jt]sx?$": "babel-jest"},
5
+ collectCoverage: true,
6
+ collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
7
+ coverageDirectory: 'coverage',
8
+ testEnvironment: 'jest-environment-jsdom',
9
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
10
+ testMatch: ['**/__tests__/**/?(*.)+(spec|test).[jt]s?(x)']
11
+ };
12
+
13
+ module.exports = config;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "react-ts-tw-lint-test",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "tsc -b && vite build",
9
+ "preview": "vite preview",
10
+ "lint": "eslint .",
11
+ "typecheck": "tsc -b",
12
+ "test": "jest"
13
+ },
14
+ "dependencies": {
15
+ "react": "^19.1.0",
16
+ "react-dom": "^19.1.0"
17
+ },
18
+ "devDependencies": {
19
+ "@babel/plugin-transform-runtime": "^7.24.7",
20
+ "@babel/preset-env": "^7.24.7",
21
+ "@babel/preset-react": "^7.24.7",
22
+ "@babel/preset-typescript": "^7.24.7",
23
+ "@eslint/js": "^9.26.0",
24
+ "@tailwindcss/postcss": "^4.1.5",
25
+ "@testing-library/dom": "^10.3.1",
26
+ "@testing-library/jest-dom": "^6.4.6",
27
+ "@testing-library/react": "^16.0.0",
28
+ "@types/jest": "^29.5.12",
29
+ "@types/react": "^19.1.2",
30
+ "@types/react-dom": "^19.1.3",
31
+ "@vitejs/plugin-react-oxc": "^0.2.2",
32
+ "eslint": "^9.26.0",
33
+ "eslint-plugin-jest": "^28.11.0",
34
+ "eslint-plugin-react": "^7.37.5",
35
+ "globals": "^15.15.0",
36
+ "jest": "^30.0.0",
37
+ "jest-environment-jsdom": "^30.0.0",
38
+ "postcss": "^8.5.3",
39
+ "tailwindcss": "^4.1.5",
40
+ "typescript": "5.2.2",
41
+ "typescript-eslint": "^8.31.1",
42
+ "vite": "npm:rolldown-vite@latest"
43
+ }
44
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ },
5
+ };
@@ -0,0 +1,21 @@
1
+ import { useState } from 'react'
2
+
3
+ function App() {
4
+ const [count, setCount] = useState(0)
5
+ return (
6
+ <div className="flex flex-col justify-center items-center h-screen bg-neutral-800">
7
+ <h1 className="text-5xl text-blue-400 text-center">React</h1>
8
+ <div className="p-8">
9
+ <button
10
+ className="bg-slate-950 px-4 py-2 rounded-lg text-slate-200"
11
+ onClick={() => setCount((counter) => counter + 1)}
12
+ type="button"
13
+ >
14
+ {`count is ${count}`}
15
+ </button>
16
+ </div>
17
+ </div>
18
+ )
19
+ }
20
+
21
+ export default App
@@ -0,0 +1 @@
1
+ @import "tailwindcss";
@@ -0,0 +1,10 @@
1
+ import React from 'react'
2
+ import ReactDOM from 'react-dom/client'
3
+ import App from './App.js'
4
+ import './index.css'
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')!).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ )
@@ -0,0 +1 @@
1
+ /// <reference types="vite/client" />
@@ -0,0 +1,27 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
5
+ "target": "ES2020",
6
+ "useDefineForClassFields": true,
7
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
8
+ "module": "ESNext",
9
+ "skipLibCheck": true,
10
+
11
+ /* Bundler mode */
12
+ "moduleResolution": "bundler",
13
+ "allowImportingTsExtensions": true,
14
+ "resolveJsonModule": true,
15
+ "isolatedModules": true,
16
+ "moduleDetection": "force",
17
+ "noEmit": true,
18
+ "jsx": "react-jsx",
19
+
20
+ /* Linting */
21
+ "strict": true,
22
+ "noUnusedLocals": true,
23
+ "noUnusedParameters": true,
24
+ "noFallthroughCasesInSwitch": true
25
+ },
26
+ "include": ["src"]
27
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "files": [],
3
+ "references": [
4
+ {
5
+ "path": "./tsconfig.app.json"
6
+ },
7
+ {
8
+ "path": "./tsconfig.node.json"
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
5
+ "skipLibCheck": true,
6
+ "module": "ESNext",
7
+ "moduleResolution": "bundler",
8
+ "allowSyntheticDefaultImports": true,
9
+ "strict": true,
10
+ "noEmit": true
11
+ },
12
+ "include": ["vite.config.ts"]
13
+ }
@@ -0,0 +1,7 @@
1
+ import { defineConfig } from 'vite'
2
+ import react from '@vitejs/plugin-react-oxc';
3
+
4
+ // https://vitejs.dev/config/
5
+ export default defineConfig({
6
+ plugins: [react()],
7
+ })
@@ -0,0 +1,7 @@
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ ["@babel/preset-react", {"runtime": "automatic"}]
5
+ ],
6
+ "plugins": ["@babel/plugin-transform-runtime"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import '@testing-library/jest-dom';
3
+ import App from '../src/App';
4
+
5
+ test('App component render', async () => {
6
+ render(<App />);
7
+
8
+ expect(screen.getByRole('button')).toHaveTextContent('count');
9
+ });
@@ -0,0 +1,89 @@
1
+ # compiled output
2
+ /dist
3
+ /tmp
4
+ /out-tsc
5
+
6
+ # Runtime data
7
+ pids
8
+ *.pid
9
+ *.seed
10
+ *.pid.lock
11
+
12
+ # Directory for instrumented libs generated by jscoverage/JSCover
13
+ lib-cov
14
+
15
+ # Coverage directory used by tools like istanbul
16
+ coverage
17
+
18
+ # nyc test coverage
19
+ .nyc_output
20
+
21
+ # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
22
+ .grunt
23
+
24
+ # Bower dependency directory (https://bower.io/)
25
+ bower_components
26
+
27
+ # node-waf configuration
28
+ .lock-wscript
29
+
30
+ # IDEs and editors
31
+ .idea
32
+ .project
33
+ .classpath
34
+ .c9/
35
+ *.launch
36
+ .settings/
37
+ *.sublime-workspace
38
+
39
+ # IDE - VSCode
40
+ .vscode/*
41
+ !.vscode/settings.json
42
+ !.vscode/tasks.json
43
+ !.vscode/launch.json
44
+ !.vscode/extensions.json
45
+
46
+ # misc
47
+ .sass-cache
48
+ connect.lock
49
+ typings
50
+
51
+ # Logs
52
+ logs
53
+ *.log
54
+ npm-debug.log*
55
+ yarn-debug.log*
56
+ yarn-error.log*
57
+
58
+
59
+ # Dependency directories
60
+ node_modules/
61
+ jspm_packages/
62
+
63
+ # Optional npm cache directory
64
+ .npm
65
+
66
+ # Optional eslint cache
67
+ .eslintcache
68
+
69
+ # Optional REPL history
70
+ .node_repl_history
71
+
72
+ # Output of 'npm pack'
73
+ *.tgz
74
+
75
+ # Yarn Integrity file
76
+ .yarn-integrity
77
+
78
+ # dotenv environment variables file
79
+ .env
80
+
81
+ # next.js build output
82
+ .next
83
+
84
+ # Lerna
85
+ lerna-debug.log
86
+
87
+ # System Files
88
+ .DS_Store
89
+ Thumbs.db
@@ -0,0 +1,27 @@
1
+ import js from "@eslint/js";
2
+ import globals from "globals";
3
+ import pluginReact from "eslint-plugin-react";
4
+ import pluginJest from 'eslint-plugin-jest';
5
+ import { defineConfig, globalIgnores } from "eslint/config";
6
+
7
+ export default defineConfig([
8
+ { plugins: { jest: pluginJest }, },
9
+ { files: ["**/*.{js,mjs,cjs,jsx}"], plugins: { js }, extends: ["js/recommended"] },
10
+ { files: ["**/*.{js,mjs,cjs,jsx}"], languageOptions: { globals: { ...globals.browser, ...globals.jest } } },
11
+ pluginReact.configs.flat.recommended,
12
+ {
13
+ rules: {
14
+ ...pluginJest.configs.recommended.rules,
15
+ "react/react-in-jsx-scope": 0,
16
+ "react/jsx-uses-react": 0
17
+ },
18
+ },
19
+ {
20
+ settings: {
21
+ react: {
22
+ version: "detect",
23
+ },
24
+ },
25
+ },
26
+ globalIgnores(["**/coverage/**", "**/dist/**", "**/webpack.config.cjs"]),
27
+ ]);
@@ -0,0 +1,13 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="#" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>React App</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="main.js"></script>
12
+ </body>
13
+ </html>
@@ -0,0 +1,13 @@
1
+ /** @type {import('jest').Config} */
2
+ const config = {
3
+ verbose: true,
4
+ transform: {"\\.[jt]sx?$": "babel-jest"},
5
+ collectCoverage: true,
6
+ collectCoverageFrom: ['src/**/*.{js,jsx}'],
7
+ coverageDirectory: 'coverage',
8
+ testEnvironment: 'jest-environment-jsdom',
9
+ setupFilesAfterEnv: ['<rootDir>/jest.setup.js'],
10
+ testMatch: ['**/__tests__/**/?(*.)+(spec|test).[j]s?(x)']
11
+ };
12
+
13
+ module.exports = config;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,45 @@
1
+ {
2
+ "name": "react-dev-webpack",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "webpack-dev-server",
8
+ "build": "webpack",
9
+ "lint": "eslint .",
10
+ "test": "jest"
11
+ },
12
+ "dependencies": {
13
+ "react": "^19.1.0",
14
+ "react-dom": "^19.1.0"
15
+ },
16
+ "devDependencies": {
17
+ "@babel/core": "^7.24.7",
18
+ "@babel/plugin-transform-runtime": "^7.24.7",
19
+ "@babel/preset-env": "^7.24.7",
20
+ "@babel/preset-react": "^7.24.7",
21
+ "@eslint/js": "^9.26.0",
22
+ "@tailwindcss/postcss": "^4.1.5",
23
+ "@testing-library/dom": "^10.3.1",
24
+ "@testing-library/jest-dom": "^6.4.6",
25
+ "@testing-library/react": "^16.0.0",
26
+ "babel-jest": "^30.0.0",
27
+ "babel-loader": "^9.1.3",
28
+ "css-loader": "^7.1.2",
29
+ "eslint": "^9.26.0",
30
+ "eslint-plugin-jest": "^28.11.0",
31
+ "eslint-plugin-react": "^7.37.5",
32
+ "globals": "^15.15.0",
33
+ "html-webpack-plugin": "^5.6.0",
34
+ "jest": "^30.0.0",
35
+ "jest-environment-jsdom": "^30.0.0",
36
+ "postcss": "^8.5.3",
37
+ "postcss-loader": "^8.1.1",
38
+ "postcss-preset-env": "^9.6.0",
39
+ "style-loader": "^4.0.0",
40
+ "tailwindcss": "^4.1.5",
41
+ "webpack": "^5.99.7",
42
+ "webpack-cli": "^6.0.1",
43
+ "webpack-dev-server": "^5.2.1"
44
+ }
45
+ }
@@ -0,0 +1,5 @@
1
+ export default {
2
+ plugins: {
3
+ '@tailwindcss/postcss': {},
4
+ },
5
+ };
@@ -0,0 +1,22 @@
1
+ import { useState } from 'react';
2
+
3
+ function App() {
4
+ const [count, setCount] = useState(0);
5
+
6
+ return (
7
+ <div className="flex flex-col justify-center items-center h-screen bg-neutral-800">
8
+ <h1 className="text-5xl text-blue-400 text-center">React</h1>
9
+ <div className="p-8">
10
+ <button
11
+ className="bg-slate-950 px-4 py-2 rounded-lg text-slate-200"
12
+ onClick={() => setCount((counter) => counter + 1)}
13
+ type="button"
14
+ >
15
+ {`count is ${count}`}
16
+ </button>
17
+ </div>
18
+ </div>
19
+ );
20
+ }
21
+
22
+ export default App;
@@ -0,0 +1 @@
1
+ @import "tailwindcss";
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import ReactDOM from 'react-dom/client';
3
+ import App from './App';
4
+ import './index.css';
5
+
6
+ ReactDOM.createRoot(document.getElementById('root')).render(
7
+ <React.StrictMode>
8
+ <App />
9
+ </React.StrictMode>,
10
+ );
@@ -0,0 +1,43 @@
1
+ const path = require('path');
2
+ const HtmlWebPackPlugin = require('html-webpack-plugin');
3
+
4
+ const htmlPlugin = new HtmlWebPackPlugin({
5
+ template: './index.html',
6
+ filename: 'index.html',
7
+ });
8
+
9
+ module.exports = {
10
+ mode: 'development',
11
+ entry: './src/main.jsx',
12
+ output: {
13
+ path: path.resolve(__dirname, 'dist'),
14
+ filename: 'main.js',
15
+ },
16
+ target: 'web',
17
+ devServer: {
18
+ port: '3000',
19
+ static: ['./dist'],
20
+ open: true,
21
+ hot: true,
22
+ liveReload: true,
23
+ },
24
+ resolve: {
25
+ extensions: ['.js', '.json', '.jsx'],
26
+ },
27
+ module: {
28
+ rules: [
29
+ {
30
+ test: /\.(js|jsx)$/,
31
+ exclude: /node_modules/,
32
+ use: 'babel-loader',
33
+ },
34
+ {
35
+ test: /\.css$/i,
36
+ use: ['style-loader', 'css-loader', 'postcss-loader'],
37
+ },
38
+ ],
39
+ },
40
+ plugins: [
41
+ htmlPlugin,
42
+ ],
43
+ };