create-payload-app 0.3.10 → 0.3.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -159,7 +159,7 @@ function updatePayloadVersion(projectDir, betaFlag) {
159
159
  exports.updatePayloadVersion = updatePayloadVersion;
160
160
  function createProject(args, projectDir, template, packageManager) {
161
161
  return __awaiter(this, void 0, void 0, function () {
162
- var templateDir, emitter, err_2, msg, spinner, result;
162
+ var templateDir, emitter, src, dest, err_2, msg, spinner, result;
163
163
  return __generator(this, function (_a) {
164
164
  switch (_a.label) {
165
165
  case 0: return [4 /*yield*/, createProjectDir(projectDir)];
@@ -172,28 +172,36 @@ function createProject(args, projectDir, template, packageManager) {
172
172
  return [4 /*yield*/, emitter.clone(projectDir)];
173
173
  case 2:
174
174
  _a.sent();
175
- return [3 /*break*/, 6];
175
+ return [3 /*break*/, 8];
176
176
  case 3:
177
- _a.trys.push([3, 5, , 6]);
177
+ _a.trys.push([3, 7, , 8]);
178
178
  return [4 /*yield*/, fs_extra_1.default.copy(templateDir, projectDir, { recursive: true })];
179
179
  case 4:
180
180
  _a.sent();
181
- (0, log_1.success)('Project directory created');
182
- return [3 /*break*/, 6];
181
+ if (!(packageManager === 'npm')) return [3 /*break*/, 6];
182
+ src = path_1.default.resolve(templateDir, '..', 'npmrc.template');
183
+ dest = path_1.default.resolve(projectDir, '.npmrc');
184
+ return [4 /*yield*/, fs_extra_1.default.copy(src, dest)];
183
185
  case 5:
186
+ _a.sent();
187
+ _a.label = 6;
188
+ case 6:
189
+ (0, log_1.success)('Project directory created');
190
+ return [3 /*break*/, 8];
191
+ case 7:
184
192
  err_2 = _a.sent();
185
193
  msg = 'Unable to copy template files. Please check template name or directory permissions.';
186
194
  (0, log_1.error)(msg);
187
195
  process.exit(1);
188
- return [3 /*break*/, 6];
189
- case 6:
196
+ return [3 /*break*/, 8];
197
+ case 8:
190
198
  spinner = (0, ora_1.default)('Checking latest Payload version...').start();
191
199
  return [4 /*yield*/, updatePayloadVersion(projectDir, args['--beta'])];
192
- case 7:
200
+ case 9:
193
201
  _a.sent();
194
202
  spinner.text = 'Installing dependencies...';
195
203
  return [4 /*yield*/, installDeps(args, projectDir, packageManager)];
196
- case 8:
204
+ case 10:
197
205
  result = _a.sent();
198
206
  spinner.stop();
199
207
  spinner.clear();
@@ -0,0 +1 @@
1
+ legacy-peer-deps=true
package/package.json CHANGED
@@ -31,7 +31,7 @@
31
31
  "prompts": "^2.4.0",
32
32
  "terminal-link": "^2.1.1"
33
33
  },
34
- "version": "0.3.10",
34
+ "version": "0.3.11",
35
35
  "devDependencies": {
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/degit": "^2.8.3",