@solidactions/cli 1.18.0 → 1.20.0
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/commands/deploy.js
CHANGED
|
@@ -135,9 +135,10 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
135
135
|
process.exit(1);
|
|
136
136
|
}
|
|
137
137
|
// -------------------------------------------------------------------------
|
|
138
|
-
//
|
|
139
|
-
//
|
|
140
|
-
//
|
|
138
|
+
// First-deploy check — must happen BEFORE we apply any env default so that
|
|
139
|
+
// first-time deploys without -e get a helpful error prompting a deliberate
|
|
140
|
+
// environment choice, instead of silently defaulting. (Any environment can
|
|
141
|
+
// stand alone — production is not required to exist first.)
|
|
141
142
|
// -------------------------------------------------------------------------
|
|
142
143
|
let productionExists = null; // null = unknown (error path)
|
|
143
144
|
let productionSlug = null;
|
|
@@ -164,14 +165,15 @@ async function deploy(projectName, sourcePath, options = {}) {
|
|
|
164
165
|
process.exit(1);
|
|
165
166
|
}
|
|
166
167
|
}
|
|
167
|
-
// Decision: if
|
|
168
|
-
//
|
|
168
|
+
// Decision: if this is the first deploy (project doesn't exist yet) and no -e
|
|
169
|
+
// flag was given, prompt the user to choose an environment explicitly so the
|
|
170
|
+
// first deploy is deliberate. Any environment can be the first one.
|
|
169
171
|
if (productionExists === false && explicitEnv === undefined) {
|
|
170
172
|
console.error(chalk_1.default.red(`\nThis is the first deploy of "${projectName}" — please pick an environment explicitly:\n`));
|
|
171
173
|
console.error(` solidactions project deploy ${projectName} <path> -e production # most projects start here`);
|
|
172
|
-
console.error(` solidactions project deploy ${projectName} <path> -e dev # dev
|
|
173
|
-
console.error(` solidactions project deploy ${projectName} <path> -e staging # staging
|
|
174
|
-
console.error(chalk_1.default.gray('\nTip:
|
|
174
|
+
console.error(` solidactions project deploy ${projectName} <path> -e dev # start in dev (no production required first)`);
|
|
175
|
+
console.error(` solidactions project deploy ${projectName} <path> -e staging # start in staging`);
|
|
176
|
+
console.error(chalk_1.default.gray('\nTip: production is the usual default, but any environment can stand alone — pick whichever you want this project to start with.'));
|
|
175
177
|
process.exit(1);
|
|
176
178
|
}
|
|
177
179
|
// Apply default: if production already exists and the user didn't pass -e,
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
* solidactions project create <name> [-e <environment>]
|
|
4
4
|
*
|
|
5
5
|
* Creates a project + environment via POST /api/v1/projects WITHOUT uploading
|
|
6
|
-
* any source or triggering a build. This is the empty-project path
|
|
7
|
-
*
|
|
6
|
+
* any source or triggering a build. This is the empty-project path the web UI
|
|
7
|
+
* already offers; `project deploy` creates-on-demand but always builds.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
9
|
+
* `-e` defaults to `production`. Non-production environments are created
|
|
10
|
+
* standalone — the server links to an existing production root if one exists
|
|
11
|
+
* but no longer auto-creates one (#312).
|
|
12
12
|
*/
|
|
13
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|