@apso/cli 0.25.0 → 0.26.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/dist/commands/link.js +9 -4
- package/dist/commands/login.js +24 -4
- package/dist/commands/use.js +2 -1
- package/npm-shrinkwrap.json +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
package/dist/commands/link.js
CHANGED
|
@@ -88,12 +88,17 @@ class Link extends base_command_1.default {
|
|
|
88
88
|
else {
|
|
89
89
|
const servicesResponse = await services_1.servicesApi.list(workspace.id);
|
|
90
90
|
const services = servicesResponse.data;
|
|
91
|
+
// "+ Create new service" first so it's always visible, not buried under a
|
|
92
|
+
// long list of existing services.
|
|
93
|
+
const serviceChoices = services.map((svc) => ({
|
|
94
|
+
name: `${svc.name} (${svc.slug})`,
|
|
95
|
+
value: svc,
|
|
96
|
+
}));
|
|
91
97
|
const choices = [
|
|
92
|
-
...services.map((svc) => ({
|
|
93
|
-
name: `${svc.name} (${svc.slug})`,
|
|
94
|
-
value: svc,
|
|
95
|
-
})),
|
|
96
98
|
{ name: "+ Create new service", value: null },
|
|
99
|
+
...(serviceChoices.length > 0
|
|
100
|
+
? [new inquirer_1.default.Separator(), ...serviceChoices]
|
|
101
|
+
: []),
|
|
97
102
|
];
|
|
98
103
|
const { selectedService } = await inquirer_1.default.prompt([
|
|
99
104
|
{
|
package/dist/commands/login.js
CHANGED
|
@@ -297,10 +297,30 @@ class Login extends base_command_1.default {
|
|
|
297
297
|
this.log("");
|
|
298
298
|
this.log(`Successfully logged in as ${tokenResponse.user.email}`);
|
|
299
299
|
this.log("");
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
300
|
+
// Brand-new users have no workspace yet. Workspaces are created in the web
|
|
301
|
+
// app (not the CLI), so guide them there explicitly and offer to open it —
|
|
302
|
+
// otherwise a first-timer hits a bare "No workspaces found" later with no
|
|
303
|
+
// idea what to do.
|
|
304
|
+
const workspaces = await services_1.workspacesApi.list().catch(() => []);
|
|
305
|
+
if (workspaces.length === 0) {
|
|
306
|
+
const onboardingUrl = `${config_1.globalConfig.read().webUrl}/onboarding/workspace`;
|
|
307
|
+
this.log("You don't have a workspace yet.");
|
|
308
|
+
this.log("Workspaces are created in the Apso web app:");
|
|
309
|
+
this.log(` ${onboardingUrl}`);
|
|
310
|
+
this.log("");
|
|
311
|
+
this.log("Opening it in your browser...");
|
|
312
|
+
await openBrowser(onboardingUrl).catch(() => {
|
|
313
|
+
this.log("(Could not open the browser — visit the URL above.)");
|
|
314
|
+
});
|
|
315
|
+
this.log("");
|
|
316
|
+
this.log("Once your workspace exists, run 'apso use' to select it.");
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
this.log("Next steps:");
|
|
320
|
+
this.log(" apso use - Select your workspace");
|
|
321
|
+
this.log(" apso whoami - View your account + workspace");
|
|
322
|
+
this.log(" apso projects - List services in a workspace");
|
|
323
|
+
}
|
|
304
324
|
}
|
|
305
325
|
catch (error) {
|
|
306
326
|
if (error instanceof Error) {
|
package/dist/commands/use.js
CHANGED
|
@@ -19,7 +19,8 @@ class Use extends base_command_1.default {
|
|
|
19
19
|
}
|
|
20
20
|
const workspaces = await services_1.workspacesApi.list();
|
|
21
21
|
if (workspaces.length === 0) {
|
|
22
|
-
|
|
22
|
+
const onboardingUrl = `${config_1.globalConfig.read().webUrl}/onboarding/workspace`;
|
|
23
|
+
this.error(`You don't have a workspace yet. Workspaces are created in the Apso web app:\n ${onboardingUrl}\nThen run 'apso use' again to select it.`);
|
|
23
24
|
}
|
|
24
25
|
let ws;
|
|
25
26
|
if (args.workspace) {
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apso/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@apso/cli",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.26.1",
|
|
10
10
|
"license": "Apache-2.0",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@biomejs/biome": "^1.9.4",
|
package/oclif.manifest.json
CHANGED