create-payload-app 0.3.25 → 0.3.26

Sign up to get free protection for your applications and to get access to all the features.
@@ -83,7 +83,6 @@ describe('createProject', function () {
83
83
  expect(packageJson.name).toEqual(path_1.default.basename(projectDir));
84
84
  expect(packageJson.description).toContain(templateName);
85
85
  // Check all common files are create
86
- assertProjectFileExists('.npmrc');
87
86
  assertProjectFileExists('.gitignore');
88
87
  assertProjectFileExists('nodemon.json');
89
88
  assertProjectFileExists('README.md');
@@ -45,27 +45,20 @@ var fs_extra_1 = __importDefault(require("fs-extra"));
45
45
  var handlebars_1 = __importDefault(require("handlebars"));
46
46
  function writeCommonFiles(projectDir, template, packageManager) {
47
47
  return __awaiter(this, void 0, void 0, function () {
48
- var commonFilesDir, npmrc, npmrcDest, gi, giDest, packageJsonTemplate, packageJson, nodemon, nodemonDest, readmeTemplate, readme, tsconfig, tsconfigDest, dockerComposeTemplate, dockerCompose, dockerfileTemplate, dockerfile;
48
+ var commonFilesDir, gi, giDest, packageJsonTemplate, packageJson, nodemon, nodemonDest, readmeTemplate, readme, tsconfig, tsconfigDest, dockerComposeTemplate, dockerCompose, dockerfileTemplate, dockerfile;
49
49
  return __generator(this, function (_a) {
50
50
  switch (_a.label) {
51
51
  case 0:
52
52
  commonFilesDir = path_1.default.resolve(__dirname, 'common-files');
53
- npmrc = path_1.default.resolve(commonFilesDir, 'npmrc.template');
54
- npmrcDest = path_1.default.resolve(projectDir, '.npmrc');
55
- return [4 /*yield*/, fs_extra_1.default.copy(npmrc, npmrcDest)
56
- // .gitignore
57
- ];
58
- case 1:
59
- _a.sent();
60
53
  gi = path_1.default.resolve(commonFilesDir, 'gitignore.template');
61
54
  giDest = path_1.default.resolve(projectDir, '.gitignore');
62
55
  return [4 /*yield*/, fs_extra_1.default.copy(gi, giDest)
63
56
  // package.json
64
57
  ];
65
- case 2:
58
+ case 1:
66
59
  _a.sent();
67
60
  return [4 /*yield*/, fs_extra_1.default.readFile(path_1.default.resolve(commonFilesDir, 'package.template.json'), 'utf8')];
68
- case 3:
61
+ case 2:
69
62
  packageJsonTemplate = _a.sent();
70
63
  packageJson = handlebars_1.default.compile(packageJsonTemplate)({
71
64
  projectName: path_1.default.basename(projectDir),
@@ -75,17 +68,17 @@ function writeCommonFiles(projectDir, template, packageManager) {
75
68
  return [4 /*yield*/, fs_extra_1.default.writeFile(path_1.default.resolve(projectDir, 'package.json'), packageJson)
76
69
  // nodemon.json
77
70
  ];
78
- case 4:
71
+ case 3:
79
72
  _a.sent();
80
73
  nodemon = path_1.default.resolve(commonFilesDir, 'nodemon.json');
81
74
  nodemonDest = path_1.default.resolve(projectDir, 'nodemon.json');
82
75
  return [4 /*yield*/, fs_extra_1.default.copy(nodemon, nodemonDest)
83
76
  // README.md
84
77
  ];
85
- case 5:
78
+ case 4:
86
79
  _a.sent();
87
80
  return [4 /*yield*/, fs_extra_1.default.readFile(path_1.default.resolve(commonFilesDir, 'README.template.md'), 'utf8')];
88
- case 6:
81
+ case 5:
89
82
  readmeTemplate = _a.sent();
90
83
  readme = handlebars_1.default.compile(readmeTemplate)({
91
84
  projectName: path_1.default.basename(projectDir),
@@ -94,17 +87,17 @@ function writeCommonFiles(projectDir, template, packageManager) {
94
87
  return [4 /*yield*/, fs_extra_1.default.writeFile(path_1.default.resolve(projectDir, 'README.md'), readme)
95
88
  // tsconfig.json
96
89
  ];
97
- case 7:
90
+ case 6:
98
91
  _a.sent();
99
92
  tsconfig = path_1.default.resolve(commonFilesDir, 'tsconfig.json');
100
93
  tsconfigDest = path_1.default.resolve(projectDir, 'tsconfig.json');
101
94
  return [4 /*yield*/, fs_extra_1.default.copy(tsconfig, tsconfigDest)
102
95
  // docker-compose.yml
103
96
  ];
104
- case 8:
97
+ case 7:
105
98
  _a.sent();
106
99
  return [4 /*yield*/, fs_extra_1.default.readFile(path_1.default.resolve(commonFilesDir, 'docker-compose.template.yml'), 'utf8')];
107
- case 9:
100
+ case 8:
108
101
  dockerComposeTemplate = _a.sent();
109
102
  dockerCompose = handlebars_1.default.compile(dockerComposeTemplate)(packageManager === 'yarn'
110
103
  ? { installCmd: 'yarn install', devCmd: 'yarn dev' }
@@ -112,16 +105,16 @@ function writeCommonFiles(projectDir, template, packageManager) {
112
105
  return [4 /*yield*/, fs_extra_1.default.writeFile(path_1.default.resolve(projectDir, 'docker-compose.yml'), dockerCompose)
113
106
  // Dockerfile
114
107
  ];
115
- case 10:
108
+ case 9:
116
109
  _a.sent();
117
110
  return [4 /*yield*/, fs_extra_1.default.readFile(path_1.default.resolve(commonFilesDir, 'Dockerfile.template'), 'utf8')];
118
- case 11:
111
+ case 10:
119
112
  dockerfileTemplate = _a.sent();
120
113
  dockerfile = handlebars_1.default.compile(dockerfileTemplate)(packageManager === 'yarn'
121
114
  ? { installCmd: 'yarn install', buildCmd: 'yarn build' }
122
115
  : { installCmd: 'npm install', buildCmd: 'npm run build' });
123
116
  return [4 /*yield*/, fs_extra_1.default.writeFile(path_1.default.resolve(projectDir, 'Dockerfile'), dockerfile)];
124
- case 12:
117
+ case 11:
125
118
  _a.sent();
126
119
  return [2 /*return*/];
127
120
  }
package/package.json CHANGED
@@ -37,7 +37,7 @@
37
37
  "prompts": "^2.4.0",
38
38
  "terminal-link": "^2.1.1"
39
39
  },
40
- "version": "0.3.25",
40
+ "version": "0.3.26",
41
41
  "devDependencies": {
42
42
  "@types/command-exists": "^1.2.0",
43
43
  "@types/degit": "^2.8.3",
@@ -1 +0,0 @@
1
- legacy-peer-deps=true