@avora-labs/cli 1.1.20 → 1.2.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.
Files changed (3) hide show
  1. package/README.md +47 -175
  2. package/bin/avora.mjs +0 -0
  3. package/package.json +9 -9
package/README.md CHANGED
@@ -1,218 +1,90 @@
1
- # @avora/cli
1
+ <div align="center">
2
+ <h1>@avora-labs/cli</h1>
3
+ <p><strong>The Official Command-Line Interface for the AvoraMetaForge Ecosystem.</strong></p>
4
+
5
+ <p>
6
+ <a href="https://www.npmjs.com/package/@avora-labs/cli"><img src="https://img.shields.io/npm/v/@avora-labs/cli?color=blue&style=flat-square" alt="NPM Version"></a>
7
+ <img src="https://img.shields.io/badge/License-Proprietary-red.svg?style=flat-square" alt="License: Proprietary">
8
+ <img src="https://img.shields.io/badge/Node.js-%3E%3D18.0.0-339933.svg?style=flat-square&logo=nodedotjs" alt="Node.js">
9
+ </p>
10
+ </div>
2
11
 
3
- > Official CLI for the **AvoraMetaForge** Angular meta-framework ecosystem.
12
+ <hr/>
4
13
 
5
- [![Node.js ≥18](https://img.shields.io/badge/node-%3E%3D18-brightgreen)](https://nodejs.org)
6
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.8-blue)](https://www.typescriptlang.org/)
7
- [![ESM Only](https://img.shields.io/badge/module-ESM-yellow)](https://nodejs.org/api/esm.html)
8
- [![License: UNLICENSED](https://img.shields.io/badge/license-UNLICENSED-red)]()
14
+ ## ✨ What is the Avora CLI?
9
15
 
10
- ---
11
-
12
- ## Overview
13
-
14
- `@avora/cli` is the developer toolchain for the `@avora/meta-forge` Angular library — a meta-driven framework that generates entire pages, forms, tables, and navigation from TypeScript configuration objects (`AppMeta`).
15
-
16
- The CLI automates the entire authoring lifecycle:
16
+ The **Avora CLI** is the ultimate companion tool for building next-generation Angular applications with the **@avora-labs/meta-forge** engine.
17
17
 
18
- - **Scaffold** new AMF applications (`avora new`)
19
- - **Generate** meta-driven pages, forms, tables, APIs, and nav items with AST-safe patching
20
- - **Install** private `@avora/*` packages from GitHub Package Registry
21
- - **Manage** workspace configuration (`avora.json`)
22
- - **Create** plugin packages for the ecosystem
18
+ Instead of spending hours wiring up modules, configuring routes, and writing structural boilerplate, the CLI allows you to instantly scaffold beautifully architected, meta-driven Angular components right from your terminal.
23
19
 
24
20
  ---
25
21
 
26
- ## Installation
22
+ ## 📦 Installation
27
23
 
28
- ```bash
29
- # From the GitHub Package Registry (private)
30
- npm install -g @avora/cli --registry https://npm.pkg.github.com
31
-
32
- # Or link locally during development
33
- cd projects/avora-cli
34
- npm install
35
- npm run link:cli # builds + npm link → makes `avora` available globally
36
- ```
24
+ Install the CLI globally using NPM to make the `avora` command available anywhere on your machine.
37
25
 
38
- ---
39
-
40
- ## Quick Start
41
-
42
- ### New project
43
26
  ```bash
44
- avora new my-portal # interactive wizard
45
- avora new my-portal --layout vertical --auth-type jwt
27
+ npm install -g @avora-labs/cli@latest
46
28
  ```
47
29
 
48
- ### Existing Angular workspace
30
+ Verify the installation by running:
49
31
  ```bash
50
- cd my-angular-workspace
51
- avora init # detects projects, creates avora.json
52
- avora info # verify workspace diagnostics
32
+ avora info
53
33
  ```
54
34
 
55
- ### Generate schematics
56
- ```bash
57
- # Page (with nav + table section)
58
- avora generate page products \
59
- --section page-header \
60
- --section table \
61
- --guard \
62
- --nav-group Features \
63
- --nav-icon package
64
-
65
- # Form
66
- avora generate form create-product --layout grid --columns 2
67
-
68
- # Table
69
- avora generate table users --columns "name,email,status,createdAt"
35
+ ---
70
36
 
71
- # API endpoint
72
- avora generate api list-products --method GET --path /api/products --mock
37
+ ## 🚀 Quick Start Commands
73
38
 
74
- # Nav item only
75
- avora generate nav-item --label Reports --route /reports --icon bar-chart-2 --group Main
76
- ```
39
+ ### Initialize a New Project
40
+ Run this command inside any existing Angular v17+ workspace. The CLI will automatically install `@avora-labs/meta-forge`, wire up the providers in `app.config.ts`, patch your styles, and inject the layout shell into your `app.component.ts`.
77
41
 
78
- All `generate` commands support `--dry-run` to preview changes before writing:
79
42
  ```bash
80
- avora generate page reports --section table --dry-run
43
+ avora init
81
44
  ```
82
45
 
83
- ### Install private packages
46
+ ### Scaffold a Page
47
+ Generate an entirely new meta-driven route, complete with metadata configuration files, automatically wired into your `app.routes.ts`.
48
+
84
49
  ```bash
85
- avora add @avora/plugin-charts # prompts for GitHub PAT if not set
86
- # Set token via env var for CI/CD:
87
- AVORA_REGISTRY_TOKEN=ghp_... avora add @avora/plugin-charts
50
+ avora generate page dashboard
88
51
  ```
89
52
 
90
- ### Configuration
53
+ **Advanced scaffolding flags:**
91
54
  ```bash
92
- avora config # list all config
93
- avora config defaultLayout horizontal
94
- avora config registry.url https://npm.pkg.github.com
55
+ # Create a page with a horizontal layout, a page header, a data table, and an auth guard!
56
+ avora generate page users --layout horizontal --section page-header --section table --guard
95
57
  ```
96
58
 
97
- ### Workspace info
59
+ ### Scaffold UI Renderers
60
+ Need a quick form or table metadata structure? Let the CLI write the boilerplate for you.
61
+
98
62
  ```bash
99
- avora info
100
- # ┌────────────────────────────────────────────────┐
101
- # │ AvoraMetaForge Workspace Info │
102
- # ├────────────────────────────────────────────────┤
103
- # │ CLI Version: 1.0.0 │
104
- # │ Pages registered: 12 │
105
- # │ API endpoints: 8 │
106
- # │ Navigation items: 11 │
107
- # └────────────────────────────────────────────────┘
63
+ avora generate form login-form
64
+ avora generate table users-table
108
65
  ```
109
66
 
110
67
  ---
111
68
 
112
- ## Commands
113
-
114
- | Command | Description |
115
- |---|---|
116
- | `avora new <name>` | Scaffold a new AMF application |
117
- | `avora init` | Initialize AMF in an existing Angular workspace |
118
- | `avora generate\|g page [name]` | Generate a meta-driven page |
119
- | `avora generate\|g form [name]` | Generate a standalone FormMeta |
120
- | `avora generate\|g table [name]` | Generate a standalone TableMeta |
121
- | `avora generate\|g api [id]` | Add an API endpoint to `app.meta.ts` |
122
- | `avora generate\|g nav-item` | Add a navigation item |
123
- | `avora add <package>` | Install a private `@avora/*` package |
124
- | `avora config [key] [value]` | Read/write `avora.json` |
125
- | `avora plugin create [name]` | Scaffold a new plugin package |
126
- | `avora plugin list` | List registered plugins |
127
- | `avora info` | Display workspace diagnostics |
69
+ ## 🛠️ Ecosystem
128
70
 
129
- ---
130
-
131
- ## Architecture
132
-
133
- ```
134
- src/
135
- ├── cli.ts # Root Commander program
136
- ├── types/cli.types.ts # All interfaces & option types
137
- ├── registry/
138
- │ ├── meta-registry.ts # ts-morph AST patcher for app.meta.ts
139
- │ └── amf-config.ts # avora.json read/write + workspace detection
140
- ├── schematics/
141
- │ ├── app/ # avora new
142
- │ ├── page/ # avora generate page
143
- │ ├── form/ # avora generate form
144
- │ └── table/ # avora generate table
145
- ├── commands/ # One file per command
146
- └── utils/
147
- ├── transaction.ts # Atomic file writes with rollback
148
- ├── credentials.ts # AES-256-GCM token store (~/.avora/)
149
- ├── diff.ts # Colored unified diff for --dry-run
150
- ├── logger.ts # Angular CLI-style output
151
- ├── prompt.ts # @inquirer/prompts wrappers
152
- ├── template-engine.ts # EJS template renderer
153
- └── file-utils.ts # Naming convention converters
154
- templates/
155
- ├── app/ # avora new scaffold templates
156
- ├── page/page.meta.ts.ejs # PageMeta — all section types
157
- ├── form/form.meta.ts.ejs # FormMeta — stepper, grid, actions
158
- └── table/table.meta.ts.ejs # TableMeta — columns, actions, pagination
159
- ```
160
-
161
- ### Key design decisions
162
-
163
- - **Full ESM** — `"type": "module"`, `moduleResolution: NodeNext`, `@inquirer/prompts`
164
- - **AST patching** — `ts-morph` manipulates `app.meta.ts` instead of regex replace. CRLF-aware, single-quote style, trailing-comma aware.
165
- - **Atomic writes** — `FileTransaction` snapshots each file before writing; any failure triggers automatic rollback.
166
- - **Dry-run everywhere** — All generate commands show a colored unified diff before touching any file.
167
- - **CI-friendly** — Every interactive prompt has a flag equivalent; `AVORA_REGISTRY_TOKEN` env var skips credential prompts.
71
+ * **[@avora-labs/meta-forge](https://www.npmjs.com/package/@avora-labs/meta-forge)** — The core Angular rendering engine.
72
+ * **[@avora-labs/cli](https://www.npmjs.com/package/@avora-labs/cli)** — This companion tooling for generating metadata.
168
73
 
169
74
  ---
170
75
 
171
- ## Development
76
+ ## 🤝 Maintainer & Author
172
77
 
173
- ```bash
174
- npm install
175
- npm run build # tsc → dist/
176
- npm run build:watch # watch mode
177
- npm run link:cli # build + npm link (makes `avora` global)
178
-
179
- # Test against the workspace
180
- npm run test:info
181
- npm run test:dry-run
182
- ```
78
+ The Avora CLI is built and maintained by:
183
79
 
184
- ---
80
+ **Dileesha Ekanayake**
81
+ 📧 [dileesha.r.ekanayake@gmail.com](mailto:dileesha.r.ekanayake@gmail.com)
185
82
 
186
- ## Workspace config (`avora.json`)
187
-
188
- Created at the workspace root by `avora new` or `avora init`:
189
-
190
- ```json
191
- {
192
- "version": "1.0.0",
193
- "projectType": "application",
194
- "library": "@avora/meta-forge",
195
- "libraryVersion": "1.0.0",
196
- "paths": {
197
- "metaFile": "src/app/app.meta.ts",
198
- "pagesDir": "src/app/pages",
199
- "appConfig": "src/app/app.config.ts",
200
- "appRoutesFile": "src/app/app.routes.ts"
201
- },
202
- "defaultLayout": "vertical",
203
- "registry": {
204
- "type": "github",
205
- "org": "AvoraLabs",
206
- "scope": "@avora",
207
- "url": "https://npm.pkg.github.com",
208
- "privateRepo": true
209
- },
210
- "plugins": []
211
- }
212
- ```
83
+ Feel free to reach out for support, enterprise inquiries, or just to say hi!
213
84
 
214
85
  ---
215
86
 
216
- ## License
87
+ ## 📄 License
217
88
 
218
- UNLICENSED Private, AvoraLabs internal tooling.
89
+ This software is **UNLICENSED** and proprietary.
90
+ While anyone is free to download and use the compiled bundle from NPM for building applications, the source code remains private and may not be copied, modified, or redistributed.
package/bin/avora.mjs CHANGED
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avora-labs/cli",
3
- "version": "1.1.20",
3
+ "version": "1.2.2",
4
4
  "description": "Official CLI for the AvoraMetaForge ecosystem",
5
5
  "repository": {
6
6
  "type": "git",
@@ -23,13 +23,13 @@
23
23
  "templates"
24
24
  ],
25
25
  "scripts": {
26
- "build": "tsc",
27
- "build:watch": "tsc --watch",
28
- "dev": "tsx src/cli.ts",
29
- "clean": "node -e \"require('fs').rmSync('./dist', { recursive: true, force: true })\"",
30
- "link:cli": "npm run build && npm link",
31
- "test:info": "node bin/avora.mjs info",
32
- "test:dry-run": "node bin/avora.mjs generate page test-page --layout vertical --section page-header --section table --guard --nav-group Main --dry-run"
26
+ "build": "tsc",
27
+ "build:watch": "tsc --watch",
28
+ "dev": "tsx src/cli.ts",
29
+ "clean": "node -e \"require('fs').rmSync('./dist', { recursive: true, force: true })\"",
30
+ "link:cli": "npm run build && npm link",
31
+ "test:info": "node bin/avora.mjs info",
32
+ "test:dry-run": "node bin/avora.mjs generate page test-page --layout vertical --section page-header --section table --guard --nav-group Main --dry-run"
33
33
  },
34
34
  "dependencies": {
35
35
  "@inquirer/prompts": "^6.0.0",
@@ -61,6 +61,6 @@
61
61
  "scaffold",
62
62
  "meta-driven"
63
63
  ],
64
- "author": "AvoraLabs",
64
+ "author": "Dileesha Ekanayake <dileesha.r.ekanayake@gmail.com>",
65
65
  "license": "UNLICENSED"
66
66
  }