checkpoint-cli 0.1.0 → 0.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/dist/config.d.ts +1 -1
- package/dist/config.js +1 -1
- package/dist/index.js +22 -6
- package/package.json +11 -2
package/dist/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const SUPABASE_URL = "https://uxunzukbuaffsnavvxub.supabase.co";
|
|
2
2
|
export declare const SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV4dW56dWtidWFmZnNuYXZ2eHViIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzA5MTE3NzMsImV4cCI6MjA4NjQ4Nzc3M30.XYQNXTfqClvcr9jwdH2e8ySiG5Ue85YQAoWd1c7CxVk";
|
|
3
3
|
/** Default app URL — can be overridden per environment */
|
|
4
|
-
export declare const DEFAULT_APP_URL = "https://checkpoint.build";
|
|
4
|
+
export declare const DEFAULT_APP_URL = "https://app.checkpoint.build";
|
|
5
5
|
export interface StoredConfig {
|
|
6
6
|
access_token: string;
|
|
7
7
|
refresh_token: string;
|
package/dist/config.js
CHANGED
|
@@ -15,7 +15,7 @@ const os_1 = __importDefault(require("os"));
|
|
|
15
15
|
exports.SUPABASE_URL = 'https://uxunzukbuaffsnavvxub.supabase.co';
|
|
16
16
|
exports.SUPABASE_ANON_KEY = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InV4dW56dWtidWFmZnNuYXZ2eHViIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NzA5MTE3NzMsImV4cCI6MjA4NjQ4Nzc3M30.XYQNXTfqClvcr9jwdH2e8ySiG5Ue85YQAoWd1c7CxVk';
|
|
17
17
|
/** Default app URL — can be overridden per environment */
|
|
18
|
-
exports.DEFAULT_APP_URL = 'https://checkpoint.build';
|
|
18
|
+
exports.DEFAULT_APP_URL = 'https://app.checkpoint.build';
|
|
19
19
|
/* ── Local token storage (~/.checkpoint/config.json) ── */
|
|
20
20
|
const CONFIG_DIR = path_1.default.join(os_1.default.homedir(), '.checkpoint');
|
|
21
21
|
const CONFIG_FILE = path_1.default.join(CONFIG_DIR, 'config.json');
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
7
7
|
const commander_1 = require("commander");
|
|
8
8
|
const child_process_1 = require("child_process");
|
|
9
9
|
const http_1 = __importDefault(require("http"));
|
|
10
|
+
const readline_1 = __importDefault(require("readline"));
|
|
10
11
|
const chalk_1 = __importDefault(require("chalk"));
|
|
11
12
|
const supabase_js_1 = require("@supabase/supabase-js");
|
|
12
13
|
const config_js_1 = require("./config.js");
|
|
@@ -327,6 +328,16 @@ function startHeartbeat(sb, tunnelId) {
|
|
|
327
328
|
}, 30000);
|
|
328
329
|
}
|
|
329
330
|
/* ── Browser-based Login Flow ── */
|
|
331
|
+
function prompt(question, defaultValue) {
|
|
332
|
+
const rl = readline_1.default.createInterface({ input: process.stdin, output: process.stdout });
|
|
333
|
+
const suffix = defaultValue ? chalk_1.default.gray(` (${defaultValue})`) : '';
|
|
334
|
+
return new Promise((resolve) => {
|
|
335
|
+
rl.question(` ${question}${suffix}: `, (answer) => {
|
|
336
|
+
rl.close();
|
|
337
|
+
resolve(answer.trim() || defaultValue || '');
|
|
338
|
+
});
|
|
339
|
+
});
|
|
340
|
+
}
|
|
330
341
|
function openBrowser(url) {
|
|
331
342
|
const cmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
332
343
|
(0, child_process_1.spawn)(cmd, [url], { stdio: 'ignore', detached: true }).unref();
|
|
@@ -408,7 +419,7 @@ program
|
|
|
408
419
|
.description('Authenticate with Checkpoint via the browser')
|
|
409
420
|
.action(async () => {
|
|
410
421
|
console.log('');
|
|
411
|
-
console.log(chalk_1.default.blue.bold('
|
|
422
|
+
console.log(chalk_1.default.blue.bold(' ⟐ Checkpoint'));
|
|
412
423
|
console.log('');
|
|
413
424
|
// Check if already logged in
|
|
414
425
|
const existing = (0, config_js_1.loadConfig)();
|
|
@@ -454,7 +465,7 @@ program
|
|
|
454
465
|
.description('Sign out and remove stored credentials')
|
|
455
466
|
.action(() => {
|
|
456
467
|
console.log('');
|
|
457
|
-
console.log(chalk_1.default.blue.bold('
|
|
468
|
+
console.log(chalk_1.default.blue.bold(' ⟐ Checkpoint'));
|
|
458
469
|
console.log('');
|
|
459
470
|
(0, config_js_1.clearConfig)();
|
|
460
471
|
console.log(chalk_1.default.green(' ✓ Logged out'));
|
|
@@ -465,14 +476,19 @@ program
|
|
|
465
476
|
.command('start')
|
|
466
477
|
.description('Tunnel a local port and create a Checkpoint share link')
|
|
467
478
|
.requiredOption('-p, --port <port>', 'Local port to tunnel', '3000')
|
|
468
|
-
.option('-n, --name <name>', 'Name for this tunnel'
|
|
479
|
+
.option('-n, --name <name>', 'Name for this tunnel')
|
|
469
480
|
.option('--provider <provider>', 'Tunnel provider: cloudflared (default) or ngrok')
|
|
470
481
|
.action(async (opts) => {
|
|
471
482
|
requireAuth();
|
|
472
483
|
const port = parseInt(opts.port, 10);
|
|
473
484
|
console.log('');
|
|
474
|
-
console.log(chalk_1.default.blue.bold('
|
|
485
|
+
console.log(chalk_1.default.blue.bold(' ⟐ Checkpoint'));
|
|
475
486
|
console.log('');
|
|
487
|
+
// Prompt for tunnel name if not provided
|
|
488
|
+
if (!opts.name) {
|
|
489
|
+
opts.name = await prompt('Give this tunnel a name', 'My Tunnel');
|
|
490
|
+
console.log('');
|
|
491
|
+
}
|
|
476
492
|
// Authenticate
|
|
477
493
|
const sb = await getAuthenticatedClient();
|
|
478
494
|
if (!sb) {
|
|
@@ -549,7 +565,7 @@ program
|
|
|
549
565
|
.action(async (opts) => {
|
|
550
566
|
requireAuth();
|
|
551
567
|
console.log('');
|
|
552
|
-
console.log(chalk_1.default.blue.bold('
|
|
568
|
+
console.log(chalk_1.default.blue.bold(' ⟐ Checkpoint'));
|
|
553
569
|
console.log('');
|
|
554
570
|
const sb = await getAuthenticatedClient();
|
|
555
571
|
if (!sb) {
|
|
@@ -607,7 +623,7 @@ program
|
|
|
607
623
|
.description('Check setup status')
|
|
608
624
|
.action(async () => {
|
|
609
625
|
console.log('');
|
|
610
|
-
console.log(chalk_1.default.blue.bold('
|
|
626
|
+
console.log(chalk_1.default.blue.bold(' ⟐ Checkpoint — Status'));
|
|
611
627
|
console.log('');
|
|
612
628
|
// Auth status
|
|
613
629
|
const config = (0, config_js_1.loadConfig)();
|
package/package.json
CHANGED
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "checkpoint-cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Share your localhost with reviewers — get visual feedback directly on the page",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"checkpoint",
|
|
7
|
+
"tunnel",
|
|
8
|
+
"localhost",
|
|
9
|
+
"share",
|
|
10
|
+
"feedback",
|
|
11
|
+
"review",
|
|
12
|
+
"cloudflare",
|
|
13
|
+
"ngrok"
|
|
14
|
+
],
|
|
6
15
|
"license": "MIT",
|
|
7
16
|
"bin": {
|
|
8
17
|
"checkpoint": "./dist/index.js"
|