@valbuild/cli 0.86.0 → 0.86.2
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.
|
@@ -13,7 +13,6 @@ var ts = require('typescript');
|
|
|
13
13
|
var z = require('zod');
|
|
14
14
|
var node_module = require('node:module');
|
|
15
15
|
var fs$1 = require('fs');
|
|
16
|
-
var child_process = require('child_process');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
19
18
|
|
|
@@ -585,6 +584,7 @@ async function connect(options) {
|
|
|
585
584
|
const maybeGitRemote = await tryGetGitRemote(projectRoot);
|
|
586
585
|
const maybeGitOwnerAndRepo = maybeGitRemote !== null ? getGitHubOwnerAndRepo(maybeGitRemote) : null;
|
|
587
586
|
const params = new URLSearchParams();
|
|
587
|
+
params.set("step", "create-project");
|
|
588
588
|
if (maybeProject) {
|
|
589
589
|
params.set("org", maybeProject.orgName);
|
|
590
590
|
params.set("project", maybeProject.projectName);
|
|
@@ -593,20 +593,7 @@ async function connect(options) {
|
|
|
593
593
|
params.set("github_repo", [maybeGitOwnerAndRepo.owner, maybeGitOwnerAndRepo.repo].join("/"));
|
|
594
594
|
}
|
|
595
595
|
const url = `${host$1}/connect?${params.toString()}`;
|
|
596
|
-
|
|
597
|
-
// Open url in default browser and show fallback instructions:
|
|
598
|
-
console.log(picocolors__default["default"].cyan("\nStarting connect process in browser...\n"));
|
|
599
|
-
console.log(picocolors__default["default"].dim(`\nIf the browser does not open, please visit:\n${url}\n`));
|
|
600
|
-
if (process.platform === "win32") {
|
|
601
|
-
// Windows
|
|
602
|
-
child_process.exec(`start ${url}`);
|
|
603
|
-
} else if (process.platform === "darwin") {
|
|
604
|
-
// macOS
|
|
605
|
-
child_process.exec(`open ${url}`);
|
|
606
|
-
} else {
|
|
607
|
-
// Linux and others
|
|
608
|
-
child_process.exec(`xdg-open ${url}`);
|
|
609
|
-
}
|
|
596
|
+
console.log(picocolors__default["default"].dim(`\nFollow the instructions in your browser to complete the setup:\n${picocolors__default["default"].cyan(url)}\n`));
|
|
610
597
|
}
|
|
611
598
|
async function tryGetProject(projectRoot) {
|
|
612
599
|
const valConfigFile = (await evalValConfigFile(projectRoot, "val.config.ts")) || (await evalValConfigFile(projectRoot, "val.config.js"));
|
|
@@ -13,7 +13,6 @@ var ts = require('typescript');
|
|
|
13
13
|
var z = require('zod');
|
|
14
14
|
var node_module = require('node:module');
|
|
15
15
|
var fs$1 = require('fs');
|
|
16
|
-
var child_process = require('child_process');
|
|
17
16
|
|
|
18
17
|
function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
|
|
19
18
|
|
|
@@ -585,6 +584,7 @@ async function connect(options) {
|
|
|
585
584
|
const maybeGitRemote = await tryGetGitRemote(projectRoot);
|
|
586
585
|
const maybeGitOwnerAndRepo = maybeGitRemote !== null ? getGitHubOwnerAndRepo(maybeGitRemote) : null;
|
|
587
586
|
const params = new URLSearchParams();
|
|
587
|
+
params.set("step", "create-project");
|
|
588
588
|
if (maybeProject) {
|
|
589
589
|
params.set("org", maybeProject.orgName);
|
|
590
590
|
params.set("project", maybeProject.projectName);
|
|
@@ -593,20 +593,7 @@ async function connect(options) {
|
|
|
593
593
|
params.set("github_repo", [maybeGitOwnerAndRepo.owner, maybeGitOwnerAndRepo.repo].join("/"));
|
|
594
594
|
}
|
|
595
595
|
const url = `${host$1}/connect?${params.toString()}`;
|
|
596
|
-
|
|
597
|
-
// Open url in default browser and show fallback instructions:
|
|
598
|
-
console.log(picocolors__default["default"].cyan("\nStarting connect process in browser...\n"));
|
|
599
|
-
console.log(picocolors__default["default"].dim(`\nIf the browser does not open, please visit:\n${url}\n`));
|
|
600
|
-
if (process.platform === "win32") {
|
|
601
|
-
// Windows
|
|
602
|
-
child_process.exec(`start ${url}`);
|
|
603
|
-
} else if (process.platform === "darwin") {
|
|
604
|
-
// macOS
|
|
605
|
-
child_process.exec(`open ${url}`);
|
|
606
|
-
} else {
|
|
607
|
-
// Linux and others
|
|
608
|
-
child_process.exec(`xdg-open ${url}`);
|
|
609
|
-
}
|
|
596
|
+
console.log(picocolors__default["default"].dim(`\nFollow the instructions in your browser to complete the setup:\n${picocolors__default["default"].cyan(url)}\n`));
|
|
610
597
|
}
|
|
611
598
|
async function tryGetProject(projectRoot) {
|
|
612
599
|
const valConfigFile = (await evalValConfigFile(projectRoot, "val.config.ts")) || (await evalValConfigFile(projectRoot, "val.config.js"));
|
|
@@ -11,7 +11,6 @@ import ts from 'typescript';
|
|
|
11
11
|
import z from 'zod';
|
|
12
12
|
import { createRequire } from 'node:module';
|
|
13
13
|
import fs$1 from 'fs';
|
|
14
|
-
import { exec } from 'child_process';
|
|
15
14
|
|
|
16
15
|
function error(message) {
|
|
17
16
|
console.error(chalk.red("❌Error: ") + message);
|
|
@@ -553,6 +552,7 @@ async function connect(options) {
|
|
|
553
552
|
const maybeGitRemote = await tryGetGitRemote(projectRoot);
|
|
554
553
|
const maybeGitOwnerAndRepo = maybeGitRemote !== null ? getGitHubOwnerAndRepo(maybeGitRemote) : null;
|
|
555
554
|
const params = new URLSearchParams();
|
|
555
|
+
params.set("step", "create-project");
|
|
556
556
|
if (maybeProject) {
|
|
557
557
|
params.set("org", maybeProject.orgName);
|
|
558
558
|
params.set("project", maybeProject.projectName);
|
|
@@ -561,20 +561,7 @@ async function connect(options) {
|
|
|
561
561
|
params.set("github_repo", [maybeGitOwnerAndRepo.owner, maybeGitOwnerAndRepo.repo].join("/"));
|
|
562
562
|
}
|
|
563
563
|
const url = `${host$1}/connect?${params.toString()}`;
|
|
564
|
-
|
|
565
|
-
// Open url in default browser and show fallback instructions:
|
|
566
|
-
console.log(picocolors.cyan("\nStarting connect process in browser...\n"));
|
|
567
|
-
console.log(picocolors.dim(`\nIf the browser does not open, please visit:\n${url}\n`));
|
|
568
|
-
if (process.platform === "win32") {
|
|
569
|
-
// Windows
|
|
570
|
-
exec(`start ${url}`);
|
|
571
|
-
} else if (process.platform === "darwin") {
|
|
572
|
-
// macOS
|
|
573
|
-
exec(`open ${url}`);
|
|
574
|
-
} else {
|
|
575
|
-
// Linux and others
|
|
576
|
-
exec(`xdg-open ${url}`);
|
|
577
|
-
}
|
|
564
|
+
console.log(picocolors.dim(`\nFollow the instructions in your browser to complete the setup:\n${picocolors.cyan(url)}\n`));
|
|
578
565
|
}
|
|
579
566
|
async function tryGetProject(projectRoot) {
|
|
580
567
|
const valConfigFile = (await evalValConfigFile(projectRoot, "val.config.ts")) || (await evalValConfigFile(projectRoot, "val.config.js"));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/cli",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.86.
|
|
4
|
+
"version": "0.86.2",
|
|
5
5
|
"description": "Val CLI tools",
|
|
6
6
|
"bin": {
|
|
7
7
|
"val": "./bin.js"
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@inquirer/confirm": "^2.0.15",
|
|
22
22
|
"@inquirer/prompts": "^3.0.2",
|
|
23
|
-
"@valbuild/core": "~0.86.
|
|
24
|
-
"@valbuild/eslint-plugin": "~0.86.
|
|
25
|
-
"@valbuild/server": "~0.86.
|
|
23
|
+
"@valbuild/core": "~0.86.2",
|
|
24
|
+
"@valbuild/eslint-plugin": "~0.86.2",
|
|
25
|
+
"@valbuild/server": "~0.86.2",
|
|
26
26
|
"chalk": "^4.1.2",
|
|
27
27
|
"cors": "^2.8.5",
|
|
28
28
|
"express": "^4.18.2",
|
package/src/connect.ts
CHANGED
|
@@ -2,7 +2,6 @@ import pc from "picocolors";
|
|
|
2
2
|
import fs from "fs";
|
|
3
3
|
import path from "path";
|
|
4
4
|
import { evalValConfigFile } from "./utils/evalValConfigFile";
|
|
5
|
-
import { exec } from "child_process";
|
|
6
5
|
|
|
7
6
|
const host = process.env.VAL_BUILD_URL || "https://admin.val.build";
|
|
8
7
|
|
|
@@ -16,6 +15,7 @@ export async function connect(options: { root?: string }) {
|
|
|
16
15
|
maybeGitRemote !== null ? getGitHubOwnerAndRepo(maybeGitRemote) : null;
|
|
17
16
|
|
|
18
17
|
const params = new URLSearchParams();
|
|
18
|
+
params.set("step", "create-project");
|
|
19
19
|
if (maybeProject) {
|
|
20
20
|
params.set("org", maybeProject.orgName);
|
|
21
21
|
params.set("project", maybeProject.projectName);
|
|
@@ -28,22 +28,11 @@ export async function connect(options: { root?: string }) {
|
|
|
28
28
|
}
|
|
29
29
|
const url = `${host}/connect?${params.toString()}`;
|
|
30
30
|
|
|
31
|
-
// Open url in default browser and show fallback instructions:
|
|
32
|
-
console.log(pc.cyan("\nStarting connect process in browser...\n"));
|
|
33
31
|
console.log(
|
|
34
|
-
pc.dim(
|
|
32
|
+
pc.dim(
|
|
33
|
+
`\nFollow the instructions in your browser to complete the setup:\n${pc.cyan(url)}\n`,
|
|
34
|
+
),
|
|
35
35
|
);
|
|
36
|
-
|
|
37
|
-
if (process.platform === "win32") {
|
|
38
|
-
// Windows
|
|
39
|
-
exec(`start ${url}`);
|
|
40
|
-
} else if (process.platform === "darwin") {
|
|
41
|
-
// macOS
|
|
42
|
-
exec(`open ${url}`);
|
|
43
|
-
} else {
|
|
44
|
-
// Linux and others
|
|
45
|
-
exec(`xdg-open ${url}`);
|
|
46
|
-
}
|
|
47
36
|
}
|
|
48
37
|
|
|
49
38
|
async function tryGetProject(projectRoot: string): Promise<{
|