create-payload-app 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -95,14 +95,20 @@ function installDeps(args, dir, packageManager) {
95
95
  });
96
96
  });
97
97
  }
98
- function getLatestPayloadVersion() {
98
+ function getLatestPayloadVersion(betaFlag) {
99
+ if (betaFlag === void 0) { betaFlag = false; }
99
100
  return __awaiter(this, void 0, void 0, function () {
100
- var stdout, error_2;
101
+ var packageWithTag, stdout, error_2;
101
102
  return __generator(this, function (_a) {
102
103
  switch (_a.label) {
103
104
  case 0:
104
105
  _a.trys.push([0, 2, , 3]);
105
- return [4 /*yield*/, execa_1.default('npm info payload version', [], { shell: true })];
106
+ packageWithTag = 'payload';
107
+ if (betaFlag)
108
+ packageWithTag += '@beta';
109
+ return [4 /*yield*/, execa_1.default("npm info " + packageWithTag + " version", [], {
110
+ shell: true,
111
+ })];
106
112
  case 1:
107
113
  stdout = (_a.sent()).stdout;
108
114
  return [2 /*return*/, "^" + stdout];
@@ -115,12 +121,13 @@ function getLatestPayloadVersion() {
115
121
  });
116
122
  }
117
123
  exports.getLatestPayloadVersion = getLatestPayloadVersion;
118
- function updatePayloadVersion(projectDir) {
124
+ function updatePayloadVersion(projectDir, betaFlag) {
125
+ if (betaFlag === void 0) { betaFlag = false; }
119
126
  return __awaiter(this, void 0, void 0, function () {
120
127
  var payloadVersion, packageJsonPath, packageObj, err_1;
121
128
  return __generator(this, function (_a) {
122
129
  switch (_a.label) {
123
- case 0: return [4 /*yield*/, getLatestPayloadVersion()];
130
+ case 0: return [4 /*yield*/, getLatestPayloadVersion(betaFlag)];
124
131
  case 1:
125
132
  payloadVersion = _a.sent();
126
133
  if (!payloadVersion) {
@@ -181,7 +188,7 @@ function createProject(args, projectDir, template, packageManager) {
181
188
  return [3 /*break*/, 6];
182
189
  case 6:
183
190
  spinner = ora_1.default('Checking latest Payload version...').start();
184
- return [4 /*yield*/, updatePayloadVersion(projectDir)];
191
+ return [4 /*yield*/, updatePayloadVersion(projectDir, args['--beta'])];
185
192
  case 7:
186
193
  _a.sent();
187
194
  spinner.text = 'Installing dependencies...';
package/dist/main.js CHANGED
@@ -65,6 +65,7 @@ var Main = /** @class */ (function () {
65
65
  '--use-npm': Boolean,
66
66
  '--no-deps': Boolean,
67
67
  '--dry-run': Boolean,
68
+ '--beta': Boolean,
68
69
  '-h': '--help',
69
70
  '-n': '--name',
70
71
  '-t': '--template',
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.3",
34
+ "version": "0.3.4",
35
35
  "devDependencies": {
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/degit": "^2.8.3",