@avleon/cli 0.0.38 → 0.0.39
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/create.js +10 -10
- package/package.json +1 -1
package/dist/create.js
CHANGED
|
@@ -40,7 +40,7 @@ exports.createApplication = createApplication;
|
|
|
40
40
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
41
41
|
const paths_1 = require("./paths");
|
|
42
42
|
const prettier = __importStar(require("prettier"));
|
|
43
|
-
const
|
|
43
|
+
const path_1 = __importDefault(require("path"));
|
|
44
44
|
const os_1 = __importDefault(require("os"));
|
|
45
45
|
const inquirer_1 = __importDefault(require("inquirer"));
|
|
46
46
|
const child_process_1 = require("child_process");
|
|
@@ -122,7 +122,7 @@ export class HomeController{
|
|
|
122
122
|
singleAttributePerLine: true,
|
|
123
123
|
parser: "typescript",
|
|
124
124
|
});
|
|
125
|
-
await fs_extra_1.default.writeFile(
|
|
125
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.src, "home.controller.ts"), formatHomeController);
|
|
126
126
|
// main file
|
|
127
127
|
const mainFunc = `
|
|
128
128
|
import {
|
|
@@ -149,7 +149,7 @@ export default app;
|
|
|
149
149
|
singleAttributePerLine: true,
|
|
150
150
|
parser: "typescript",
|
|
151
151
|
});
|
|
152
|
-
await fs_extra_1.default.writeFile(
|
|
152
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.src, "app.ts"), formatMainFunc);
|
|
153
153
|
// create serve.ts
|
|
154
154
|
const serveFunc = `
|
|
155
155
|
import app from "./app";
|
|
@@ -165,7 +165,7 @@ start();
|
|
|
165
165
|
singleAttributePerLine: true,
|
|
166
166
|
parser: "typescript",
|
|
167
167
|
});
|
|
168
|
-
await fs_extra_1.default.writeFile(
|
|
168
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.src, "serve.ts"), formatServeFunc);
|
|
169
169
|
// create package.json
|
|
170
170
|
const packageJson = `
|
|
171
171
|
{
|
|
@@ -188,8 +188,8 @@ start();
|
|
|
188
188
|
"keywords": ["avleon","nodejs","typescript"],
|
|
189
189
|
"license": "ISC",
|
|
190
190
|
"dependencies": {
|
|
191
|
-
"@avleon/core": "^0.0.
|
|
192
|
-
"@avleon/cli": "^0.0.
|
|
191
|
+
"@avleon/core": "^0.0.36",
|
|
192
|
+
"@avleon/cli": "^0.0.39",
|
|
193
193
|
"class-transformer": "^0.5.1",
|
|
194
194
|
"class-validator": "^0.14.1",
|
|
195
195
|
"reflect-metadata": "^0.2.2"
|
|
@@ -218,7 +218,7 @@ start();
|
|
|
218
218
|
const formattedPackageJson = await prettier.format(packageJson, {
|
|
219
219
|
parser: "json",
|
|
220
220
|
});
|
|
221
|
-
await fs_extra_1.default.writeFile(
|
|
221
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.root, "package.json"), formattedPackageJson);
|
|
222
222
|
const tsconfigJson = await prettier.format(`{
|
|
223
223
|
"compilerOptions": {
|
|
224
224
|
"target": "ES2017",
|
|
@@ -235,7 +235,7 @@ start();
|
|
|
235
235
|
"include": ["src/**/*"],
|
|
236
236
|
"exclude": ["node_modules", "dist"]
|
|
237
237
|
}`, { parser: "json" });
|
|
238
|
-
await fs_extra_1.default.writeFile(
|
|
238
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.root, "tsconfig.json"), tsconfigJson);
|
|
239
239
|
// write e2e-test.json
|
|
240
240
|
const e2eJson = await prettier.format(`{
|
|
241
241
|
"moduleFileExtensions": [
|
|
@@ -250,8 +250,8 @@ start();
|
|
|
250
250
|
"^.+/\/\.(t|j)s$": "ts-jest"
|
|
251
251
|
}
|
|
252
252
|
}`, { parser: "json" });
|
|
253
|
-
await fs_extra_1.default.writeFile(
|
|
254
|
-
await fs_extra_1.default.writeFile(
|
|
253
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.root, "test/e2e-spec.json"), e2eJson);
|
|
254
|
+
await fs_extra_1.default.writeFile(path_1.default.join(appPaths.root, ".gitignore"), `node_modules/\ndist/\n.env`);
|
|
255
255
|
// create basic service
|
|
256
256
|
// create basic controller
|
|
257
257
|
// console.info("App created successfully. Run the following command to get start.");
|