create-nxpress-app 1.0.5 → 1.0.6
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 +16 -13
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -6,10 +6,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
6
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
7
|
const prompts_1 = require("@clack/prompts");
|
|
8
8
|
const chalk_1 = __importDefault(require("chalk"));
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
9
10
|
const commander_1 = require("commander");
|
|
10
11
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
11
12
|
const path_1 = __importDefault(require("path"));
|
|
12
|
-
const child_process_1 = require("child_process");
|
|
13
13
|
const util_1 = require("util");
|
|
14
14
|
const execAsync = (0, util_1.promisify)(child_process_1.exec);
|
|
15
15
|
const program = new commander_1.Command();
|
|
@@ -198,7 +198,7 @@ program
|
|
|
198
198
|
// Index page
|
|
199
199
|
const indexPageContent = engine === "handlebars"
|
|
200
200
|
? `<div class="max-w-4xl mx-auto px-4 py-16 text-center">
|
|
201
|
-
<h1 class="text-5xl font-bold mb-4 bg-
|
|
201
|
+
<h1 class="text-5xl font-bold mb-4 bg-linear-to-r from-blue-400 to-indigo-500 bg-clip-text text-transparent">
|
|
202
202
|
Welcome to {{title}}
|
|
203
203
|
</h1>
|
|
204
204
|
<p class="text-xl text-slate-400 mb-8">{{description}}</p>
|
|
@@ -208,7 +208,7 @@ program
|
|
|
208
208
|
</div>`
|
|
209
209
|
: engine === "ejs"
|
|
210
210
|
? `<div class="max-w-4xl mx-auto px-4 py-16 text-center">
|
|
211
|
-
<h1 class="text-5xl font-bold mb-4 bg-
|
|
211
|
+
<h1 class="text-5xl font-bold mb-4 bg-linear-to-r from-blue-400 to-indigo-500 bg-clip-text text-transparent">
|
|
212
212
|
Welcome to <%= title %>
|
|
213
213
|
</h1>
|
|
214
214
|
<p class="text-xl text-slate-400 mb-8"><%= description %></p>
|
|
@@ -217,14 +217,14 @@ program
|
|
|
217
217
|
</div>
|
|
218
218
|
</div>`
|
|
219
219
|
: `<div class="max-w-4xl mx-auto px-4 py-16 text-center">
|
|
220
|
-
<h1 class="text-5xl font-bold mb-4 bg-
|
|
220
|
+
<h1 class="text-5xl font-bold mb-4 bg-linear-to-r from-blue-400 to-indigo-500 bg-clip-text text-transparent">
|
|
221
221
|
Welcome to Nxpress
|
|
222
222
|
</h1>
|
|
223
223
|
<p class="text-xl text-slate-400 mb-8">Express.js with Next.js developer experience</p>
|
|
224
224
|
</div>`;
|
|
225
225
|
fs_extra_1.default.writeFileSync(path_1.default.join(appDir, `index.${ext}`), indexPageContent);
|
|
226
226
|
// Data loader for index page
|
|
227
|
-
const indexTsContent = `import
|
|
227
|
+
const indexTsContent = `import { Request, Response } from "express";
|
|
228
228
|
|
|
229
229
|
export async function props(req: Request, res: Response) {
|
|
230
230
|
return {
|
|
@@ -235,7 +235,7 @@ export async function props(req: Request, res: Response) {
|
|
|
235
235
|
`;
|
|
236
236
|
fs_extra_1.default.writeFileSync(path_1.default.join(appDir, "index.ts"), indexTsContent);
|
|
237
237
|
// App CSS for Tailwind v4
|
|
238
|
-
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "app.css"), `@import "tailwindcss";\n`);
|
|
238
|
+
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "app.css"), `@import "tailwindcss";\n@import "tailwindcss/preflight";\n@tailwind utilities;\n`);
|
|
239
239
|
// Server file
|
|
240
240
|
const serverTsContent = `import { nxpress } from '@nxpress/core';
|
|
241
241
|
|
|
@@ -249,7 +249,7 @@ app.listen(PORT, () => {
|
|
|
249
249
|
});
|
|
250
250
|
`;
|
|
251
251
|
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "server.ts"), serverTsContent);
|
|
252
|
-
const pkgVersion = "1.0.
|
|
252
|
+
const pkgVersion = "1.0.5";
|
|
253
253
|
// nxpress.config.json
|
|
254
254
|
const nxConfig = {
|
|
255
255
|
$schema: `https://unpkg.com/@nxpress/core@${pkgVersion}/schema.json`,
|
|
@@ -274,22 +274,25 @@ app.listen(PORT, () => {
|
|
|
274
274
|
"@nxpress/core": `^${pkgVersion}`,
|
|
275
275
|
},
|
|
276
276
|
devDependencies: {
|
|
277
|
-
|
|
278
|
-
"@types/node": "^
|
|
277
|
+
"@types/express": "^5.0.6",
|
|
278
|
+
"@types/node": "^26.1.1",
|
|
279
|
+
typescript: "^7.0.2",
|
|
279
280
|
},
|
|
280
281
|
};
|
|
281
282
|
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "package.json"), JSON.stringify(projectPkgJson, null, 2));
|
|
282
283
|
// tsconfig.json for target project
|
|
283
284
|
const projectTsConfig = {
|
|
284
285
|
compilerOptions: {
|
|
285
|
-
target: "
|
|
286
|
-
module: "
|
|
287
|
-
moduleResolution: "
|
|
286
|
+
target: "esnext",
|
|
287
|
+
module: "nodenext",
|
|
288
|
+
moduleResolution: "nodenext",
|
|
288
289
|
strict: true,
|
|
289
290
|
esModuleInterop: true,
|
|
290
291
|
skipLibCheck: true,
|
|
292
|
+
types: ["node", "express"],
|
|
291
293
|
},
|
|
292
|
-
include: ["
|
|
294
|
+
include: ["**/*.ts"],
|
|
295
|
+
exclude: ["node_modules", "dist"],
|
|
293
296
|
};
|
|
294
297
|
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "tsconfig.json"), JSON.stringify(projectTsConfig, null, 2));
|
|
295
298
|
// .gitignore
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-nxpress-app",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "CLI tool to create Nxpress applications",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -22,15 +22,15 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@clack/prompts": "^
|
|
26
|
-
"chalk": "^
|
|
27
|
-
"commander": "^
|
|
28
|
-
"fs-extra": "^11.
|
|
25
|
+
"@clack/prompts": "^1.7.0",
|
|
26
|
+
"chalk": "^6.0.0",
|
|
27
|
+
"commander": "^15.0.0",
|
|
28
|
+
"fs-extra": "^11.4.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/fs-extra": "^11.0.4",
|
|
32
|
-
"@types/node": "^
|
|
33
|
-
"typescript": "^
|
|
32
|
+
"@types/node": "^26.1.1",
|
|
33
|
+
"typescript": "^7.0.2"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsc",
|