@taujs/create-taujs 0.1.4 → 0.1.5
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/dist/index.js +8 -13
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -160,7 +160,7 @@ async function generateFiles(targetDir, config) {
|
|
|
160
160
|
);
|
|
161
161
|
await fs.writeFile(
|
|
162
162
|
path.join(targetDir, "src/client/index.html"),
|
|
163
|
-
generateIndexHtml(
|
|
163
|
+
generateIndexHtml()
|
|
164
164
|
);
|
|
165
165
|
await fs.writeFile(
|
|
166
166
|
path.join(targetDir, "src/client/App.tsx"),
|
|
@@ -214,7 +214,7 @@ function generatePackageJson(projectName, packageManager) {
|
|
|
214
214
|
"build:client": "tsx build.ts",
|
|
215
215
|
"build:entry-server": "BUILD_MODE=ssr tsx build.ts",
|
|
216
216
|
"build:server": "esbuild src/server/index.ts --bundle --platform=node --format=esm --outfile=dist/server/index.js --external:fastify --external:@taujs/server --external:@taujs/react",
|
|
217
|
-
build: "
|
|
217
|
+
build: "tsx build.ts && BUILD_MODE=ssr tsx build.ts && esbuild src/server/index.ts --bundle --platform=node --format=esm --outfile=dist/server/index.js --external:fastify --external:@taujs/server --external:@taujs/react",
|
|
218
218
|
start: "NODE_ENV=production node dist/server/index.js",
|
|
219
219
|
lint: "tsc --noEmit"
|
|
220
220
|
},
|
|
@@ -239,7 +239,7 @@ function generatePackageJson(projectName, packageManager) {
|
|
|
239
239
|
function generateBuildTs() {
|
|
240
240
|
return `import path from "node:path";
|
|
241
241
|
import { taujsBuild } from "@taujs/server";
|
|
242
|
-
import config from "./taujs.config.
|
|
242
|
+
import config from "./taujs.config.ts";
|
|
243
243
|
|
|
244
244
|
await taujsBuild({
|
|
245
245
|
clientBaseDir: path.resolve(process.cwd(), "src/client"),
|
|
@@ -442,16 +442,13 @@ ${projectName}/
|
|
|
442
442
|
MIT
|
|
443
443
|
`;
|
|
444
444
|
}
|
|
445
|
-
function generateIndexHtml(
|
|
445
|
+
function generateIndexHtml() {
|
|
446
446
|
return `<!DOCTYPE html>
|
|
447
447
|
<html lang="en">
|
|
448
448
|
<head>
|
|
449
449
|
<meta charset="UTF-8" />
|
|
450
450
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
451
|
-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
|
|
452
|
-
<link rel="stylesheet" href="/styles.css" />
|
|
453
451
|
<!--ssr-head-->
|
|
454
|
-
<title>${title}</title>
|
|
455
452
|
</head>
|
|
456
453
|
<body>
|
|
457
454
|
<main id="root"><!--ssr-html--></main>
|
|
@@ -463,6 +460,8 @@ function generateAppComponent() {
|
|
|
463
460
|
return `import { Suspense } from 'react';
|
|
464
461
|
import { useSSRStore } from '@taujs/react';
|
|
465
462
|
|
|
463
|
+
import "./styles.css";
|
|
464
|
+
|
|
466
465
|
type GreetingData = {
|
|
467
466
|
message: string;
|
|
468
467
|
timestamp: string;
|
|
@@ -646,7 +645,7 @@ code {
|
|
|
646
645
|
}
|
|
647
646
|
|
|
648
647
|
.app-title::before {
|
|
649
|
-
background: url("favicon.svg") no-repeat;
|
|
648
|
+
background: url("/favicon.svg") no-repeat;
|
|
650
649
|
background-size: 50px 50px;
|
|
651
650
|
content: "";
|
|
652
651
|
border-radius: 4px;
|
|
@@ -785,11 +784,7 @@ import { App } from './App';
|
|
|
785
784
|
export const { renderSSR, renderStream } = createRenderer({
|
|
786
785
|
appComponent: () => <App />,
|
|
787
786
|
headContent: ({ data }) => \`
|
|
788
|
-
<meta
|
|
789
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
790
|
-
<meta name="description" content="A \u03C4js template application">
|
|
791
|
-
<title>\${data?.message || "\u03C4js - Composing systems, not just apps"}</title>
|
|
792
|
-
<link rel="icon" href="/favicon.svg" type="image/svg+xml"/>
|
|
787
|
+
<meta name="description" content="\${data?.message || "\u03C4js - Composing systems, not just apps"}">
|
|
793
788
|
\`,
|
|
794
789
|
enableDebug: process.env.NODE_ENV === "development",
|
|
795
790
|
});
|