@onreza/nrz 0.32.4 → 0.33.0-beta.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 CHANGED
@@ -6,6 +6,7 @@ ONREZA platform CLI — dev, build, deploy.
6
6
 
7
7
  ```bash
8
8
  npm install -g @onreza/nrz
9
+ npm install -g @onreza/nrz@beta # prerelease channel
9
10
  ```
10
11
 
11
12
  After installation the `nrz` binary is available in your `$PATH`.
@@ -17,6 +18,7 @@ nrz dev # Start dev server with ONREZA runtime emulation
17
18
  nrz build # Validate build output and manifest
18
19
  nrz deploy # Deploy to ONREZA platform
19
20
  nrz upgrade # Self-update to the latest version
21
+ nrz upgrade --channel beta
20
22
  ```
21
23
 
22
24
  ## Supported platforms
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@onreza/nrz",
3
- "version": "0.32.4",
3
+ "version": "0.33.0-beta.2",
4
4
  "private": false,
5
- "description": "ONREZA platform CLI — dev, build, deploy",
5
+ "type": "module",
6
+ "description": "ONREZA platform CLI - dev, build, deploy",
6
7
  "files": [
7
8
  "bin",
8
9
  "scripts",
@@ -21,5 +22,8 @@
21
22
  "repository": {
22
23
  "type": "git",
23
24
  "url": "https://github.com/ONREZA/nrz-cli"
25
+ },
26
+ "publishConfig": {
27
+ "tag": "beta"
24
28
  }
25
29
  }
@@ -13,30 +13,27 @@ const __dirname = dirname(__filename);
13
13
 
14
14
  const MANIFEST = {
15
15
  "assets": {
16
- "linux-x64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.32.4/nrz-linux-x64.tar.gz",
17
- "darwin-x64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.32.4/nrz-darwin-x64.tar.gz",
18
- "darwin-arm64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.32.4/nrz-darwin-arm64.tar.gz",
19
- "win32-x64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.32.4/nrz-win32-x64.tar.gz"
16
+ "linux-x64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.33.0-beta.2/nrz-linux-x64.tar.gz",
17
+ "darwin-x64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.33.0-beta.2/nrz-darwin-x64.tar.gz",
18
+ "darwin-arm64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.33.0-beta.2/nrz-darwin-arm64.tar.gz",
19
+ "win32-x64": "https://github.com/ONREZA/nrz-cli/releases/download/v0.33.0-beta.2/nrz-win32-x64.tar.gz"
20
20
  },
21
21
  "binName": "nrz",
22
- "version": "0.32.4"
22
+ "version": "0.33.0-beta.2"
23
23
  };
24
24
 
25
25
  const platformKey = `${platform}-${arch}`;
26
26
  const downloadUrl = MANIFEST.assets[platformKey];
27
27
 
28
28
  if (!downloadUrl) {
29
- console.warn(`⚠️ No binary available for ${platformKey}, skipping installation`);
30
- console.warn(` Supported platforms: ${Object.keys(MANIFEST.assets).join(", ")}`);
31
- process.exit(0);
29
+ console.error(`No binary available for ${platformKey}`);
30
+ console.error(`Supported platforms: ${Object.keys(MANIFEST.assets).join(", ")}`);
31
+ process.exit(1);
32
32
  }
33
33
 
34
34
  const binDir = join(__dirname, "..", "bin");
35
35
  mkdirSync(binDir, { recursive: true });
36
36
 
37
- /**
38
- * Downloads and extracts a tar.gz archive
39
- */
40
37
  function download(url, redirectCount = 0) {
41
38
  if (redirectCount > 5) {
42
39
  return Promise.reject(new Error("Too many redirects"));
@@ -46,8 +43,7 @@ function download(url, redirectCount = 0) {
46
43
  const protocol = url.startsWith("https") ? https : http;
47
44
 
48
45
  const request = protocol.get(url, (res) => {
49
- // Handle redirects
50
- if (res.statusCode === 301 || res.statusCode === 302 || res.statusCode === 307 || res.statusCode === 308) {
46
+ if ([301, 302, 307, 308].includes(res.statusCode)) {
51
47
  const location = res.headers.location;
52
48
  if (!location) {
53
49
  reject(new Error("Redirect without location header"));
@@ -62,7 +58,6 @@ function download(url, redirectCount = 0) {
62
58
  return;
63
59
  }
64
60
 
65
- // Extract with strip: 1 to remove the first directory level (e.g., linux-x64/)
66
61
  res
67
62
  .pipe(createGunzip())
68
63
  .pipe(tar.extract({ cwd: binDir, strip: 1 }))
@@ -78,7 +73,7 @@ function download(url, redirectCount = 0) {
78
73
  });
79
74
  }
80
75
 
81
- console.log(`📦 Installing ${MANIFEST.binName} for ${platformKey}...`);
76
+ console.log(`Installing ${MANIFEST.binName} for ${platformKey}...`);
82
77
 
83
78
  download(downloadUrl)
84
79
  .then(() => {
@@ -87,23 +82,20 @@ download(downloadUrl)
87
82
  const sourcePath = join(binDir, sourceName + ext);
88
83
  const targetPath = join(binDir, MANIFEST.binName + ext);
89
84
 
90
- // Rename binary if sourceBinName differs from binName
91
85
  if (sourceName !== MANIFEST.binName && existsSync(sourcePath)) {
92
86
  renameSync(sourcePath, targetPath);
93
87
  }
94
88
 
95
- // Make binary executable on Unix
96
89
  if (platform !== "win32") {
97
90
  try {
98
91
  chmodSync(targetPath, 0o755);
99
- } catch (e) {
100
- // Ignore chmod errors on some platforms
92
+ } catch {
101
93
  }
102
94
  }
103
- console.log(`✅ Installed ${MANIFEST.binName} v${MANIFEST.version}`);
95
+ console.log(`Installed ${MANIFEST.binName} v${MANIFEST.version}`);
104
96
  })
105
97
  .catch((err) => {
106
- console.error(`❌ Failed to install binary: ${err.message}`);
107
- console.error(` URL: ${downloadUrl}`);
98
+ console.error(`Failed to install binary: ${err.message}`);
99
+ console.error(`URL: ${downloadUrl}`);
108
100
  process.exit(1);
109
101
  });
package/README.md.bak DELETED
@@ -1,133 +0,0 @@
1
- # nrz - ONREZA Platform CLI
2
-
3
- [![CI](https://github.com/ONREZA/nrz-cli/actions/workflows/release.yml/badge.svg)](https://github.com/ONREZA/nrz-cli/actions)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
5
-
6
- `nrz` is a Rust CLI for ONREZA project lifecycle: detect, dev, build, deploy, database, KV, env vars, domains, and releases.
7
-
8
- ## Installation
9
-
10
- ### Linux/macOS
11
- ```bash
12
- curl -fsSL https://raw.githubusercontent.com/onreza/nrz-cli/main/install.sh | bash
13
- ```
14
-
15
- ### Windows (PowerShell 7+)
16
- ```powershell
17
- iwr -useb https://raw.githubusercontent.com/onreza/nrz-cli/main/install.ps1 | iex
18
- ```
19
-
20
- ### npm
21
- ```bash
22
- npm install -g @onreza/nrz
23
- ```
24
-
25
- ### From source
26
- ```bash
27
- cargo install --git https://github.com/onreza/nrz-cli
28
- ```
29
-
30
- ## Quick Start
31
-
32
- ```bash
33
- # 1) Authenticate (or pass --token / NRZ_TOKEN in CI)
34
- nrz login
35
-
36
- # 2) Create local scaffold and optionally link/create platform project
37
- nrz init
38
- # alternatives:
39
- # nrz init --local
40
- # nrz init --create --name my-app
41
- # nrz init --project-id proj_abc123
42
-
43
- # 3) Detect framework and persist it to onreza.toml
44
- nrz detect --save
45
-
46
- # Explain what build/deploy config the CLI will use
47
- nrz config explain --json
48
- # Local-only explanation without fetching server project settings:
49
- # nrz config explain --local --json
50
-
51
- # 4) Local development with ONREZA emulation (KV + DB)
52
- nrz dev
53
-
54
- # 5) Validate build output
55
- nrz build
56
-
57
- # 6) Deploy
58
- nrz deploy --prod
59
- ```
60
-
61
- ## Core Commands
62
-
63
- | Area | Commands |
64
- |------|----------|
65
- | Project | `nrz init`, `nrz link`, `nrz projects list`, `nrz projects create --name <slug>` |
66
- | Build/Deploy | `nrz detect`, `nrz build`, `nrz deploy`, `nrz rollback` |
67
- | Runtime | `nrz deployments`, `nrz logs` |
68
- | Database | `nrz db shell`, `nrz db execute "<sql>"`, `nrz db migrate create <name>`, `nrz db migrate apply` |
69
- | KV | `nrz kv get <key>`, `nrz kv set <key> <value> --ttl 60`, `nrz kv list --prefix app_` |
70
- | Environment | `nrz env list`, `nrz env pull`, `nrz env push .env.local --declared-only`, `nrz env validate` |
71
- | Domains | `nrz domains list`, `nrz domains add example.com`, `nrz domains verify <domain_id>` |
72
- | Account | `nrz whoami`, `nrz workspace list`, `nrz workspace switch <slug>`, `nrz upgrade` |
73
-
74
- ## Agent Skills
75
-
76
- This repository includes reusable skills for AI coding assistants in `skills/`:
77
- - `nrz-cli-deploy`
78
- - `nrz-cli-ci-automation`
79
- - `nrz-cli-env-db-kv`
80
- - `nrz-cli-project-bootstrap`
81
-
82
- Install from Context7:
83
- ```bash
84
- npx ctx7 skills install /onreza/nrz-cli nrz-cli-deploy
85
- npx ctx7 skills install /onreza/nrz-cli nrz-cli-ci-automation
86
- npx ctx7 skills install /onreza/nrz-cli nrz-cli-env-db-kv
87
- npx ctx7 skills install /onreza/nrz-cli nrz-cli-project-bootstrap
88
- ```
89
-
90
- ## Automation and JSON Mode
91
-
92
- The CLI is designed for both human and machine usage:
93
- - Global flags: `--json`, `--token`, `--workspace`, `--env`.
94
- - Env vars: `NRZ_JSON`, `NRZ_TOKEN`, `NRZ_WORKSPACE`, `NRZ_ENV`.
95
- - In JSON mode, commands return structured output in `stdout`; errors are JSON with exit code `1`.
96
-
97
- Example:
98
- ```bash
99
- nrz deploy --json --token "$NRZ_TOKEN" --workspace my-team --env production
100
- ```
101
-
102
- ## Configuration
103
-
104
- Project configuration is stored in `onreza.toml` (committed to git). Local runtime state is stored in `.onreza/` (must stay gitignored).
105
-
106
- Reference:
107
- - [`docs/onreza-toml.md`](docs/onreza-toml.md)
108
- - [`onreza.schema.json`](onreza.schema.json)
109
-
110
- ## Development
111
-
112
- ```bash
113
- npm run prepare # install git hooks (lefthook)
114
- cargo fmt # format Rust code
115
- cargo clippy -- -D warnings # strict lint
116
- cargo test # all tests
117
- cargo build --release # release build
118
- ```
119
-
120
- Commit messages are validated with Conventional Commits via `commitlint` + `lefthook`, format: `type(scope): subject`.
121
-
122
- ## Supported Binary Targets
123
-
124
- | Target |
125
- |--------|
126
- | `linux-x64` |
127
- | `darwin-x64` |
128
- | `darwin-arm64` |
129
- | `win32-x64` |
130
-
131
- ## License
132
-
133
- MIT