@zerct/zerct 0.1.1 → 0.1.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.
- package/README.md +3 -3
- package/bin/zerct.js +9 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@ npx @zerct/zerct deploy
|
|
|
9
9
|
Target unscoped command, pending npm approval:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npx zerct init
|
|
13
|
-
npx zerct doctor
|
|
14
|
-
npx zerct deploy
|
|
12
|
+
npx @zerct/zerct init
|
|
13
|
+
npx @zerct/zerct doctor
|
|
14
|
+
npx @zerct/zerct deploy
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Zerct expects `Cargo.toml`, `Cargo.lock`, and `zerct.toml`. The app must listen
|
package/bin/zerct.js
CHANGED
|
@@ -4,7 +4,7 @@ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSy
|
|
|
4
4
|
import { homedir } from 'node:os'
|
|
5
5
|
import path from 'node:path'
|
|
6
6
|
|
|
7
|
-
const VERSION = '0.1.
|
|
7
|
+
const VERSION = '0.1.2'
|
|
8
8
|
const DEFAULT_API_URL = 'https://api.zerct.com'
|
|
9
9
|
const ARCHIVE_LIMIT_BYTES = 48 * 1024 * 1024
|
|
10
10
|
const SESSION_DIR = '.zerct'
|
|
@@ -119,7 +119,7 @@ async function main() {
|
|
|
119
119
|
await billing(cli)
|
|
120
120
|
break
|
|
121
121
|
default:
|
|
122
|
-
throw agentError('unknown_command', 'Unknown Zerct command.', 'Run `npx zerct --help` and retry with a supported command.', cli.json)
|
|
122
|
+
throw agentError('unknown_command', 'Unknown Zerct command.', 'Run `npx @zerct/zerct --help` and retry with a supported command.', cli.json)
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
|
|
@@ -234,7 +234,7 @@ function doctorProject(projectDir, json) {
|
|
|
234
234
|
|
|
235
235
|
if (!report.ok) {
|
|
236
236
|
const firstFailure = report.checks.find((check) => !check.ok)
|
|
237
|
-
throw agentError('doctor_failed', 'Zerct doctor failed.', firstFailure?.agent_instruction || 'Fix the failed checks and retry `npx zerct doctor`.', json)
|
|
237
|
+
throw agentError('doctor_failed', 'Zerct doctor failed.', firstFailure?.agent_instruction || 'Fix the failed checks and retry `npx @zerct/zerct doctor`.', json)
|
|
238
238
|
}
|
|
239
239
|
}
|
|
240
240
|
|
|
@@ -294,7 +294,7 @@ async function login(cli) {
|
|
|
294
294
|
const response = await apiRequest(cli, 'POST', '/v1/login/device', null, null)
|
|
295
295
|
openUrl(response.login_url)
|
|
296
296
|
console.log(`opened ${response.login_url}`)
|
|
297
|
-
console.log('After login, retry your deploy. If the CLI cannot finish automatically yet, set ZERCT_TOKEN or run `npx zerct login --token <token>`.')
|
|
297
|
+
console.log('After login, retry your deploy. If the CLI cannot finish automatically yet, set ZERCT_TOKEN or run `npx @zerct/zerct login --token <token>`.')
|
|
298
298
|
}
|
|
299
299
|
|
|
300
300
|
async function deploy(projectDir, cli) {
|
|
@@ -323,7 +323,7 @@ async function deploy(projectDir, cli) {
|
|
|
323
323
|
console.log(`queued ${response.build_job.id}`)
|
|
324
324
|
console.log(`app ${response.app.id}`)
|
|
325
325
|
console.log(`url ${response.app.url}`)
|
|
326
|
-
console.log(`next npx zerct logs --app ${response.app.id}`)
|
|
326
|
+
console.log(`next npx @zerct/zerct logs --app ${response.app.id}`)
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
async function logs(cli) {
|
|
@@ -354,7 +354,7 @@ async function database(cli) {
|
|
|
354
354
|
|
|
355
355
|
async function envCommand(cli) {
|
|
356
356
|
if (cli.args[0] !== 'set') {
|
|
357
|
-
throw agentError('unknown_command', 'Unknown env command.', 'Use `npx zerct env set --app <app_id> KEY=value`.', cli.json)
|
|
357
|
+
throw agentError('unknown_command', 'Unknown env command.', 'Use `npx @zerct/zerct env set --app <app_id> KEY=value`.', cli.json)
|
|
358
358
|
}
|
|
359
359
|
|
|
360
360
|
const assignment = cli.args[1] || ''
|
|
@@ -393,7 +393,7 @@ async function appGet(cli, kind) {
|
|
|
393
393
|
|
|
394
394
|
function requireApp(cli) {
|
|
395
395
|
if (!cli.app) {
|
|
396
|
-
throw agentError('missing_app', 'App id is required.', 'Pass `--app <app_id>`. Use the app id printed by `npx zerct deploy`.', cli.json)
|
|
396
|
+
throw agentError('missing_app', 'App id is required.', 'Pass `--app <app_id>`. Use the app id printed by `npx @zerct/zerct deploy`.', cli.json)
|
|
397
397
|
}
|
|
398
398
|
return cli.app
|
|
399
399
|
}
|
|
@@ -450,7 +450,7 @@ function createArchiveBase64(projectDir) {
|
|
|
450
450
|
})
|
|
451
451
|
|
|
452
452
|
if (tar.error) {
|
|
453
|
-
throw agentError('archive_failed', 'Could not create source archive.', 'Install `tar`, remove local build outputs, then retry `npx zerct deploy`.', false)
|
|
453
|
+
throw agentError('archive_failed', 'Could not create source archive.', 'Install `tar`, remove local build outputs, then retry `npx @zerct/zerct deploy`.', false)
|
|
454
454
|
}
|
|
455
455
|
if (tar.status !== 0) {
|
|
456
456
|
throw agentError('archive_failed', 'Could not create source archive.', String(tar.stderr || 'Check project files and retry.'), false)
|
|
@@ -489,7 +489,7 @@ function readToken(projectDir, cli) {
|
|
|
489
489
|
return readFileSync(homeToken, 'utf8').trim()
|
|
490
490
|
}
|
|
491
491
|
|
|
492
|
-
throw agentError('login_required', 'Zerct login is required.', 'Run `npx zerct login`, set `ZERCT_TOKEN`, or run `npx zerct login --token <token>`, then retry.', cli.json)
|
|
492
|
+
throw agentError('login_required', 'Zerct login is required.', 'Run `npx @zerct/zerct login`, set `ZERCT_TOKEN`, or run `npx @zerct/zerct login --token <token>`, then retry.', cli.json)
|
|
493
493
|
}
|
|
494
494
|
|
|
495
495
|
function writeSessionToken(projectDir, token) {
|