create-nxpress-app 1.0.3 → 1.0.4
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 +5 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -85,9 +85,9 @@ program
|
|
|
85
85
|
}
|
|
86
86
|
port = parseInt(portRes, 10);
|
|
87
87
|
}
|
|
88
|
-
let appDirName = options.appDir;
|
|
89
|
-
let componentsDirName = options.componentsDir;
|
|
90
|
-
let publicDirName = options.publicDir;
|
|
88
|
+
let appDirName = options.appDir || "app";
|
|
89
|
+
let componentsDirName = options.componentsDir || "components";
|
|
90
|
+
let publicDirName = options.publicDir || "public";
|
|
91
91
|
if (process.stdin.isTTY &&
|
|
92
92
|
!options.appDir &&
|
|
93
93
|
!options.componentsDir &&
|
|
@@ -225,7 +225,7 @@ program
|
|
|
225
225
|
</div>`;
|
|
226
226
|
fs_extra_1.default.writeFileSync(path_1.default.join(appDir, `index.${ext}`), indexPageContent);
|
|
227
227
|
// Data loader for index page
|
|
228
|
-
const indexTsContent = `import { Request, Response } from '
|
|
228
|
+
const indexTsContent = `import type { Request, Response } from '@nxpress/core';
|
|
229
229
|
|
|
230
230
|
export async function props(req: Request, res: Response) {
|
|
231
231
|
return {
|
|
@@ -250,7 +250,7 @@ app.listen(PORT, () => {
|
|
|
250
250
|
});
|
|
251
251
|
`;
|
|
252
252
|
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "server.ts"), serverTsContent);
|
|
253
|
-
const pkgVersion = "1.0.
|
|
253
|
+
const pkgVersion = "1.0.4";
|
|
254
254
|
// nxpress.config.json
|
|
255
255
|
const nxConfig = {
|
|
256
256
|
$schema: `https://unpkg.com/@nxpress/core@${pkgVersion}/schema.json`,
|
|
@@ -273,13 +273,10 @@ app.listen(PORT, () => {
|
|
|
273
273
|
},
|
|
274
274
|
dependencies: {
|
|
275
275
|
"@nxpress/core": `^${pkgVersion}`,
|
|
276
|
-
...(engine === "handlebars" ? { hbs: "^4.2.0" } : {}),
|
|
277
|
-
...(engine === "ejs" ? { ejs: "^3.1.10" } : {}),
|
|
278
276
|
},
|
|
279
277
|
devDependencies: {
|
|
280
278
|
typescript: "^5.3.3",
|
|
281
279
|
"@types/node": "^20.11.24",
|
|
282
|
-
"@types/express": "^4.17.21",
|
|
283
280
|
},
|
|
284
281
|
};
|
|
285
282
|
fs_extra_1.default.writeFileSync(path_1.default.join(targetPath, "package.json"), JSON.stringify(projectPkgJson, null, 2));
|