nukebase 2.1.0 → 2.1.1

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/bin/nukebase.js CHANGED
@@ -24,7 +24,7 @@ if (!(args.has('version') && !args.command)) {
24
24
  const ACCOUNT_COMMANDS = ['login', 'logout', 'accounts', 'use', 'whoami', 'create', 'link'];
25
25
  const PROJECT_COMMANDS = [
26
26
  'push', 'pull', 'update', 'rollback', 'restorepoints', 'restore-points', 'backup', 'env',
27
- 'pause', 'restart', 'start', 'resume', 'delete', 'domain', 'logs', 'download',
27
+ 'pause', 'restart', 'resume', 'delete', 'domain', 'logs', 'download',
28
28
  'regiontransfer', 'region-transfer'
29
29
  ];
30
30
 
@@ -49,8 +49,7 @@ Accounts
49
49
  whoami who owns this project, and are you signed in
50
50
 
51
51
  New projects
52
- start [name] [size] outside a project: sign in if needed, then create
53
- (inside a project, start = restart)
52
+ start [name] [size] sign in if needed, then create and download
54
53
  create <name> [size] [email]
55
54
  make a project and download it, e.g.
56
55
  nukebase create demoapp123 256mb you@example.com
@@ -73,7 +72,7 @@ In a project folder (runs as the account that owns the project)
73
72
  then; discards writes since
74
73
  rollback list show restore points (also: restorepoints)
75
74
  pause stop the project (base fee + disk still accrue)
76
- restart | start | resume restart it; also resumes a paused project
75
+ restart | resume restart it; also resumes a paused project
77
76
  delete delete it on the server; asks for the name
78
77
  domain connect a custom domain, step by step
79
78
  domain <name> [--email e] connect in one go (DNS already set)
@@ -101,9 +100,20 @@ section of its package.json.`);
101
100
 
102
101
  let command = args.command;
103
102
 
104
- // `start` means two things: inside a project it restarts the app (as it always
105
- // has); anywhere else it is the new-user setup (sign in, create, download).
106
- if (command === 'start' && !require('../lib/project').findProject(process.cwd())) command = 'setup';
103
+ // `start` is the new-user setup (sign in, create, download). It used to double
104
+ // as a restart alias inside a project; now it stops there instead of guessing,
105
+ // so the same words do the same thing in every folder.
106
+ if (command === 'start') {
107
+ const here = require('../lib/project').findProject(process.cwd());
108
+ if (here) {
109
+ const { project } = require('../lib/project').readConfig(here);
110
+ console.error(`This folder is already the NukeBase project "${project}".`);
111
+ console.error(' nukebase restart restart it (resumes a paused project)');
112
+ console.error(' nukebase create <name> make a new project (run it elsewhere)');
113
+ process.exit(1);
114
+ }
115
+ command = 'setup';
116
+ }
107
117
 
108
118
  if (args.has('version') && !command) {
109
119
  console.log(version);
@@ -1,5 +1,5 @@
1
1
  // Commands that act on the project in the current folder: push, pull, update,
2
- // rollback, backup, env, pause/restart/delete, domain, logs, download and
2
+ // rollback, backup, env, pause/restart/resume/delete, domain, logs, download and
3
3
  // regiontransfer. Loaded by bin/nukebase.js, which runs the command named in
4
4
  // process.argv when this module is required.
5
5
  const { existsSync, readdirSync, statSync, lstatSync, readlinkSync, symlinkSync, readFileSync, writeFileSync, mkdirSync, unlinkSync, rmdirSync } = require('fs');
@@ -828,7 +828,7 @@ async function pauseProject() {
828
828
  async function restartProject() {
829
829
  await connectAndLogin();
830
830
  await projectPost('/restart', {}, { label: command });
831
- console.log(command === 'restart' ? `🔄 Restarting ${project}...` : `▶️ Starting ${project}...`);
831
+ console.log(command === 'restart' ? `🔄 Restarting ${project}...` : `▶️ Resuming ${project}...`);
832
832
  if (AUTO_YES) { await tailLogsUntilSettled(); process.exit(0); }
833
833
  watchLogs();
834
834
  }
@@ -2343,9 +2343,9 @@ if (command === 'push' && args.positional[0] === 'env') {
2343
2343
  run(backup);
2344
2344
  } else if (command === 'pause') {
2345
2345
  run(pauseProject);
2346
- } else if (command === 'restart' || command === 'start' || command === 'resume') {
2346
+ } else if (command === 'restart' || command === 'resume') {
2347
2347
  // One endpoint: /restart launches a stopped unit and bounces a running one,
2348
- // so start/resume are the same call under the name the user reaches for.
2348
+ // so resume is the same call under the name the user reaches for.
2349
2349
  run(restartProject);
2350
2350
  } else if (command === 'delete') {
2351
2351
  run(deleteProject);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nukebase",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "NukeBase CLI: create, deploy and manage NukeBase projects",
5
5
  "bin": {
6
6
  "nukebase": "bin/nukebase.js"