react-client 1.0.6 → 1.0.8
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 +163 -84
- package/dist/cli/commands/build.js +30 -47
- package/dist/cli/commands/build.ssr.js +31 -54
- package/dist/cli/commands/dev.js +205 -6
- package/dist/cli/commands/init.js +80 -30
- package/dist/cli/commands/preview.js +44 -16
- package/dist/cli/index.js +104 -18
- package/dist/utils/loadConfig.js +111 -0
- package/package.json +68 -34
- package/templates/react/index.html +1 -0
- package/templates/react/package.json +14 -0
- package/templates/react/src/App.jsx +1 -0
- package/templates/react/src/main.jsx +1 -0
- package/templates/react-ssr/index.html +1 -0
- package/templates/react-ssr/package.json +14 -0
- package/templates/react-ssr/src/entry-client.jsx +1 -0
- package/templates/react-ssr/src/entry-server.jsx +1 -0
- package/templates/react-ssr/src/pages/index.jsx +1 -0
- package/templates/react-ssr-ts/index.html +1 -0
- package/templates/react-ssr-ts/package.json +21 -0
- package/templates/react-ssr-ts/src/entry-client.js +5 -0
- package/templates/react-ssr-ts/src/entry-client.tsx +6 -0
- package/templates/react-ssr-ts/src/entry-server.js +4 -0
- package/templates/react-ssr-ts/src/entry-server.tsx +5 -0
- package/templates/react-ssr-ts/src/pages/index.js +2 -0
- package/templates/react-ssr-ts/src/pages/index.tsx +3 -0
- package/templates/react-ssr-ts/tsconfig.json +15 -0
- package/templates/react-tailwind/index.html +1 -0
- package/templates/react-tailwind/package.json +20 -0
- package/templates/react-tailwind/postcss.config.cjs +1 -0
- package/templates/react-tailwind/src/App.jsx +1 -0
- package/templates/react-tailwind/src/main.jsx +1 -0
- package/templates/react-tailwind/tailwind.config.cjs +1 -0
- package/templates/react-tailwind-ts/index.html +1 -0
- package/templates/react-tailwind-ts/package.json +24 -0
- package/templates/react-tailwind-ts/postcss.config.cjs +1 -0
- package/templates/react-tailwind-ts/src/App.js +2 -0
- package/templates/react-tailwind-ts/src/App.tsx +2 -0
- package/templates/react-tailwind-ts/src/index.css +1 -0
- package/templates/react-tailwind-ts/src/main.js +7 -0
- package/templates/react-tailwind-ts/src/main.tsx +8 -0
- package/templates/react-tailwind-ts/tailwind.config.cjs +1 -0
- package/templates/react-tailwind-ts/tsconfig.json +14 -0
- package/templates/react-ts/index.html +1 -0
- package/templates/react-ts/package.json +20 -0
- package/templates/react-ts/src/App.tsx +1 -0
- package/templates/react-ts/src/main.tsx +1 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.loadReactClientConfig = loadReactClientConfig;
|
|
40
|
+
const path_1 = __importDefault(require("path"));
|
|
41
|
+
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
42
|
+
const url_1 = require("url");
|
|
43
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
44
|
+
/**
|
|
45
|
+
* Dynamically load react-client.config.(js|mjs|ts)
|
|
46
|
+
* from the user project, not the CLI’s own folder.
|
|
47
|
+
*/
|
|
48
|
+
async function loadReactClientConfig(cwd) {
|
|
49
|
+
let projectRoot = cwd;
|
|
50
|
+
try {
|
|
51
|
+
// 🧭 Detect if running inside react-client source repo
|
|
52
|
+
const pkgPath = path_1.default.join(cwd, 'package.json');
|
|
53
|
+
if (fs_extra_1.default.existsSync(pkgPath)) {
|
|
54
|
+
const pkgJson = JSON.parse(await fs_extra_1.default.readFile(pkgPath, 'utf8'));
|
|
55
|
+
if (pkgJson.name === 'react-client') {
|
|
56
|
+
// Running CLI locally — auto-switch into example project (if found)
|
|
57
|
+
const myappPath = path_1.default.join(cwd, 'myapp');
|
|
58
|
+
if (fs_extra_1.default.existsSync(myappPath)) {
|
|
59
|
+
console.log(chalk_1.default.gray('🧩 Detected local CLI environment, using ./myapp as root.'));
|
|
60
|
+
projectRoot = myappPath;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// 🔍 Possible config file names (prefer .js for Node compatibility)
|
|
65
|
+
const filenames = [
|
|
66
|
+
'react-client.config.js',
|
|
67
|
+
'react-client.config.mjs',
|
|
68
|
+
'react-client.config.ts',
|
|
69
|
+
];
|
|
70
|
+
let configFile = null;
|
|
71
|
+
for (const name of filenames) {
|
|
72
|
+
const file = path_1.default.join(projectRoot, name);
|
|
73
|
+
if (fs_extra_1.default.existsSync(file)) {
|
|
74
|
+
configFile = file;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!configFile) {
|
|
79
|
+
console.log(chalk_1.default.gray('ℹ️ No react-client.config.js found, using defaults.'));
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
// 🧩 Import dynamically using file://
|
|
83
|
+
const fileUrl = (0, url_1.pathToFileURL)(configFile).href;
|
|
84
|
+
// If TypeScript file, try to compile it temporarily using esbuild
|
|
85
|
+
if (configFile.endsWith('.ts')) {
|
|
86
|
+
const esbuild = await Promise.resolve().then(() => __importStar(require('esbuild')));
|
|
87
|
+
const outFile = path_1.default.join(projectRoot, '.react-client.temp.config.js');
|
|
88
|
+
await esbuild.build({
|
|
89
|
+
entryPoints: [configFile],
|
|
90
|
+
outfile: outFile,
|
|
91
|
+
format: 'esm',
|
|
92
|
+
platform: 'node',
|
|
93
|
+
bundle: true,
|
|
94
|
+
write: true,
|
|
95
|
+
});
|
|
96
|
+
const mod = await Promise.resolve(`${(0, url_1.pathToFileURL)(outFile).href}`).then(s => __importStar(require(s)));
|
|
97
|
+
await fs_extra_1.default.remove(outFile);
|
|
98
|
+
console.log(chalk_1.default.green(`🧩 Loaded config from ${path_1.default.basename(configFile)}`));
|
|
99
|
+
return mod.default || mod;
|
|
100
|
+
}
|
|
101
|
+
// Normal .js or .mjs import
|
|
102
|
+
const mod = await Promise.resolve(`${fileUrl}`).then(s => __importStar(require(s)));
|
|
103
|
+
console.log(chalk_1.default.green(`🧩 Loaded config from ${path_1.default.basename(configFile)}`));
|
|
104
|
+
return mod.default || mod;
|
|
105
|
+
}
|
|
106
|
+
catch (err) {
|
|
107
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
108
|
+
console.error(chalk_1.default.red(`❌ Failed to load react-client.config: ${msg}`));
|
|
109
|
+
return {};
|
|
110
|
+
}
|
|
111
|
+
}
|
package/package.json
CHANGED
|
@@ -1,43 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-client",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "react-client is a lightweight CLI and runtime for building React apps with fast iteration.
|
|
3
|
+
"version": "1.0.8",
|
|
4
|
+
"description": "react-client is a lightweight CLI and runtime for building React apps with fast iteration. Esbuild-based, Node-native, and modular like Vite/Next.js with SSR, HMR, Tailwind, CSS Modules, and generators.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Venkatesh Sundaram",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/venkateshsundaram/react-client.git"
|
|
10
|
+
},
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/venkateshsundaram/react-client/issues"
|
|
13
|
+
},
|
|
5
14
|
"main": "dist/index.js",
|
|
6
15
|
"types": "dist/index.d.ts",
|
|
7
|
-
"sideEffects": false,
|
|
8
|
-
"files": [
|
|
9
|
-
"dist"
|
|
10
|
-
],
|
|
11
16
|
"bin": {
|
|
12
17
|
"react-client": "dist/cli/index.js"
|
|
13
18
|
},
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./config": {
|
|
26
|
+
"import": "./dist/config.js",
|
|
27
|
+
"require": "./dist/config.js",
|
|
28
|
+
"types": "./dist/config.d.ts"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"typesVersions": {
|
|
32
|
+
"*": {
|
|
33
|
+
"config": [
|
|
34
|
+
"dist/config.d.ts"
|
|
35
|
+
]
|
|
36
|
+
}
|
|
17
37
|
},
|
|
38
|
+
"sideEffects": false,
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"templates"
|
|
42
|
+
],
|
|
43
|
+
"workspaces": [
|
|
44
|
+
"templates/*"
|
|
45
|
+
],
|
|
18
46
|
"keywords": [
|
|
19
47
|
"react",
|
|
20
|
-
"javascript",
|
|
21
48
|
"typescript",
|
|
22
49
|
"cli",
|
|
23
50
|
"react-cli",
|
|
24
|
-
"
|
|
51
|
+
"framework",
|
|
52
|
+
"hmr",
|
|
25
53
|
"ssr",
|
|
26
54
|
"esbuild",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"framework",
|
|
31
|
-
"tooling"
|
|
55
|
+
"tooling",
|
|
56
|
+
"vite-alternative",
|
|
57
|
+
"fast-refresh"
|
|
32
58
|
],
|
|
33
|
-
"author": "venkateshsundaram",
|
|
34
|
-
"license": "MIT",
|
|
35
|
-
"workspaces": [
|
|
36
|
-
"templates/*"
|
|
37
|
-
],
|
|
38
|
-
"bugs": {
|
|
39
|
-
"url": "https://github.com/venkateshsundaram/react-client/issues"
|
|
40
|
-
},
|
|
41
59
|
"scripts": {
|
|
42
60
|
"clean": "rm -rf dist",
|
|
43
61
|
"compile": "tsc -p tsconfig.build.json",
|
|
@@ -46,6 +64,7 @@
|
|
|
46
64
|
"build:ssr": "node dist/cli/index.js build:ssr",
|
|
47
65
|
"dev": "node dist/cli/index.js dev",
|
|
48
66
|
"prepare": "npm run compile",
|
|
67
|
+
"precommit": "lint-staged",
|
|
49
68
|
"lint": "eslint . --ext .ts",
|
|
50
69
|
"format": "prettier --write \"src/**/*.ts\"",
|
|
51
70
|
"format:check": "prettier --check \"src/**/*.ts\"",
|
|
@@ -55,29 +74,49 @@
|
|
|
55
74
|
"test": "jest",
|
|
56
75
|
"typecheck": "tsc --noEmit"
|
|
57
76
|
},
|
|
58
|
-
"husky": {
|
|
59
|
-
"hooks": {
|
|
60
|
-
"pre-commit": "lint-staged"
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
77
|
"lint-staged": {
|
|
64
78
|
"*.ts": [
|
|
65
79
|
"eslint --fix",
|
|
66
80
|
"prettier --write"
|
|
67
81
|
]
|
|
68
82
|
},
|
|
83
|
+
"husky": {
|
|
84
|
+
"hooks": {
|
|
85
|
+
"pre-commit": "lint-staged"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
69
88
|
"commitlint": {
|
|
70
89
|
"extends": [
|
|
71
90
|
"@commitlint/config-conventional"
|
|
72
91
|
]
|
|
73
92
|
},
|
|
93
|
+
"dependencies": {
|
|
94
|
+
"@jridgewell/trace-mapping": "^0.3.31",
|
|
95
|
+
"chalk": "^4.1.2",
|
|
96
|
+
"chokidar": "^4.0.3",
|
|
97
|
+
"commander": "^14.0.2",
|
|
98
|
+
"connect": "^3.7.0",
|
|
99
|
+
"detect-port": "^2.1.0",
|
|
100
|
+
"esbuild": "^0.25.12",
|
|
101
|
+
"fs-extra": "^11.3.2",
|
|
102
|
+
"open": "^8.4.2",
|
|
103
|
+
"prismjs": "^1.30.0",
|
|
104
|
+
"prompts": "^2.4.2",
|
|
105
|
+
"react-refresh": "^0.14.0",
|
|
106
|
+
"serve-static": "^1.15.0",
|
|
107
|
+
"ws": "^8.18.3"
|
|
108
|
+
},
|
|
74
109
|
"devDependencies": {
|
|
75
110
|
"@commitlint/cli": "^19.8.0",
|
|
76
111
|
"@commitlint/config-conventional": "^19.8.0",
|
|
77
112
|
"@types/commander": "^2.12.0",
|
|
113
|
+
"@types/connect": "^3.4.38",
|
|
78
114
|
"@types/fs-extra": "^9.0.13",
|
|
79
115
|
"@types/jest": "^29.0.0",
|
|
80
116
|
"@types/node": "^18.0.0",
|
|
117
|
+
"@types/prompts": "^2.4.9",
|
|
118
|
+
"@types/serve-static": "^1.15.5",
|
|
119
|
+
"@types/ws": "^8.18.1",
|
|
81
120
|
"@typescript-eslint/eslint-plugin": "^8.46.3",
|
|
82
121
|
"@typescript-eslint/parser": "^8.46.3",
|
|
83
122
|
"eslint": "^8.0.0",
|
|
@@ -91,10 +130,5 @@
|
|
|
91
130
|
"standard-version": "^9.5.0",
|
|
92
131
|
"ts-jest": "^29.0.0",
|
|
93
132
|
"typescript": "^5.3.0"
|
|
94
|
-
},
|
|
95
|
-
"dependencies": {
|
|
96
|
-
"commander": "^14.0.2",
|
|
97
|
-
"fs-extra": "^11.1.1",
|
|
98
|
-
"esbuild": "^0.25.12"
|
|
99
133
|
}
|
|
100
134
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset='utf-8'></head><body><div id='root'></div><script type='module' src='/client/bundle.js'></script></body></html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-react",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "react-client dev",
|
|
7
|
+
"build": "react-client build",
|
|
8
|
+
"preview": "react-client preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-dom": "^18.2.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default ()=> <div>Hello React</div>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';import { createRoot } from 'react-dom/client';import App from './App';const root = createRoot(document.getElementById('root'));root.render(<App/>);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset='utf-8'></head><body><div id='root'></div><script type='module' src='/client/bundle.js'></script></body></html>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-react-ssr",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "react-client dev",
|
|
7
|
+
"build": "react-client build:ssr",
|
|
8
|
+
"preview": "react-client preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-dom": "^18.2.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';import { hydrateRoot } from 'react-dom/client';import Home from './pages/index';hydrateRoot(document.getElementById('root'), React.createElement(Home));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';import { renderToString } from 'react-dom/server';import Home from './pages/index';exports.render = function(url){ const Page = Home; return Promise.resolve(renderToString(React.createElement(Page))); };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';export default function Home(){ return <div>Home SSR</div>; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset='utf-8' /></head><body><div id='root'></div><script type='module' src='/client/bundle.js'></script></body></html>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "my-react-ssr-ts-app",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "react-client dev",
|
|
7
|
+
"build": "react-client build:ssr",
|
|
8
|
+
"preview": "react-client preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-dom": "^18.2.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/react": "^18.0.0",
|
|
16
|
+
"@types/react-dom": "^18.0.0",
|
|
17
|
+
"esbuild": "^0.25.12",
|
|
18
|
+
"react-refresh": "^0.14.0",
|
|
19
|
+
"typescript": "^5.0.0"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset='utf-8'></head><body><div id='root'></div><script type='module' src='/client/bundle.js'></script></body></html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-react-tailwind",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "react-client dev",
|
|
7
|
+
"build": "react-client build",
|
|
8
|
+
"preview": "react-client preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-dom": "^18.2.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"autoprefixer": "^10.0.0",
|
|
16
|
+
"esbuild": "^0.25.12",
|
|
17
|
+
"postcss": "^8.0.0",
|
|
18
|
+
"tailwindcss": "^3.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {} } };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default ()=> <div className='p-8'><h1 className='text-2xl'>Tailwind</h1></div>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';import { createRoot } from 'react-dom/client';import App from './App';import './index.css';const root = createRoot(document.getElementById('root'));root.render(<App/>);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { content: ['./index.html','./src/**/*.{js,jsx,ts,tsx}'], theme: { extend: {} }, plugins: [] };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset='utf-8'></head><body><div id='root'></div><script type='module' src='/client/bundle.js'></script></body></html>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-react-tailwind-ts",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "react-client dev",
|
|
7
|
+
"build": "react-client build",
|
|
8
|
+
"preview": "react-client preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-dom": "^18.2.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/react": "^18.0.0",
|
|
16
|
+
"@types/react-dom": "^18.0.0",
|
|
17
|
+
"autoprefixer": "^10.0.0",
|
|
18
|
+
"esbuild": "^0.25.12",
|
|
19
|
+
"postcss": "^8.0.0",
|
|
20
|
+
"react-refresh": "^0.14.0",
|
|
21
|
+
"tailwindcss": "^3.0.0",
|
|
22
|
+
"typescript": "^5.0.0"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { plugins: { tailwindcss: {}, autoprefixer: {} } };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export default function App() { return _jsxs("div", { className: 'p-8', children: [_jsx("h1", { className: 'text-2xl font-bold', children: "Tailwind TS" }), _jsx("p", { children: "Welcome to react-tailwind-ts template." })] }); }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@tailwind base;@tailwind components;@tailwind utilities;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import '/@react-refresh-shim';
|
|
3
|
+
import { createRoot } from 'react-dom/client';
|
|
4
|
+
import App from './App';
|
|
5
|
+
import './index.css';
|
|
6
|
+
const root = createRoot(document.getElementById('root'));
|
|
7
|
+
root.render(_jsx(App, {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
module.exports = { content: ['./index.html','./src/**/*.{js,jsx,ts,tsx}'], theme: { extend:{} }, plugins: [] };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<!doctype html><html><head><meta charset='utf-8'></head><body><div id='root'></div><script type='module' src='/client/bundle.js'></script></body></html>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "template-react-ts",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "react-client dev",
|
|
7
|
+
"build": "react-client build",
|
|
8
|
+
"preview": "react-client preview"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"react": "^18.2.0",
|
|
12
|
+
"react-dom": "^18.2.0"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@types/react": "^18.0.0",
|
|
16
|
+
"@types/react-dom": "^18.0.0",
|
|
17
|
+
"esbuild": "^0.25.12",
|
|
18
|
+
"typescript": "^5.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function App(){ return <div>Hello React TS</div>; }
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import React from 'react';import { createRoot } from 'react-dom/client';import App from './App';const root = createRoot(document.getElementById('root')!);root.render(<App/>);
|