@dawudesign/node-hexa-cli 0.1.4 → 0.1.6

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Dawudesign
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -64,7 +64,7 @@ node-hexa init my-app
64
64
 
65
65
  Generates:
66
66
 
67
- ```
67
+ ```text
68
68
  my-app/
69
69
  ├── src/
70
70
  │ ├── main.ts
@@ -116,7 +116,8 @@ node-hexa generate usecase delete-user iam
116
116
  ```
117
117
 
118
118
  Generated files:
119
- ```
119
+
120
+ ```text
120
121
  src/contexts/iam/application/use-cases/
121
122
  ├── delete-user.usecase.ts
122
123
  ├── delete-user.dto.ts
@@ -157,11 +158,14 @@ node-hexa check . --watch
157
158
  ```
158
159
 
159
160
  Output:
160
- ```
161
+
162
+ ```text
161
163
  ✓ Architecture check passed
162
164
  ```
165
+
163
166
  or:
164
- ```
167
+
168
+ ```text
165
169
  ✗ Architecture violations detected
166
170
 
167
171
  [CRITICAL] Domain must not depend on infrastructure → UserEntity
@@ -197,7 +201,8 @@ node-hexa list .
197
201
  ```
198
202
 
199
203
  Output:
200
- ```
204
+
205
+ ```text
201
206
  Bounded Contexts (2)
202
207
 
203
208
  IAM
@@ -253,7 +258,7 @@ node-hexa graph .
253
258
  ```
254
259
 
255
260
  | Key | Type | Default | Description |
256
- |---|---|---|---|
261
+ | --- | --- | --- | --- |
257
262
  | `architecture` | `string` | required | Architecture type — `hexagonal-ddd` |
258
263
  | `strict` | `boolean` | `true` | `false` silences `MEDIUM` violations |
259
264
  | `contextsDir` | `string` | `"src/contexts"` | Path to bounded contexts directory |
@@ -263,7 +268,7 @@ node-hexa graph .
263
268
  ## Violation rules
264
269
 
265
270
  | Violation | Severity | Score penalty |
266
- |---|---|---|
271
+ | --- | --- | --- |
267
272
  | Domain imports from infrastructure / adapter | `CRITICAL` | −25 pts |
268
273
  | Domain imports from application | `CRITICAL` | −25 pts |
269
274
  | Application imports from infrastructure / adapter | `HIGH` | −15 pts |
package/dist/index.js CHANGED
@@ -6,10 +6,10 @@ import { Command } from "commander";
6
6
 
7
7
  // src/license.ts
8
8
  import { createHmac, timingSafeEqual } from "crypto";
9
- import { readFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
9
+ import { writeFileSync, mkdirSync } from "fs";
10
10
  import { homedir } from "os";
11
11
  import { join } from "path";
12
- var SIGNING_SECRET = "2dc6d0a8b5c755f95a2e9fbca8c8e6c45226763dc2040ae5335bc86f480337bb";
12
+ var SIGNING_SECRET = process.env["NODEHEXA_LICENSE_SECRET"] ?? "";
13
13
  var CONFIG_DIR = join(homedir(), ".config", "node-hexa");
14
14
  var LICENSE_FILE = join(CONFIG_DIR, "license");
15
15
  function parseLicenseKey(key) {
@@ -47,30 +47,11 @@ function activateLicense(key) {
47
47
  }
48
48
  mkdirSync(CONFIG_DIR, { recursive: true });
49
49
  writeFileSync(LICENSE_FILE, key.trim(), "utf8");
50
- console.log(`\u2713 License activated for ${parsed.email} (valid until: ${parsed.expiresAt})`);
50
+ console.log(
51
+ `\u2713 License activated for ${parsed.email} (valid until: ${parsed.expiresAt})`
52
+ );
51
53
  }
52
54
  function checkLicense() {
53
- if (!existsSync(LICENSE_FILE)) {
54
- console.error(
55
- "\u2717 No license found. Purchase a license at https://your-website.com and run:\n node-hexa activate <your-license-key>"
56
- );
57
- process.exit(1);
58
- }
59
- const key = readFileSync(LICENSE_FILE, "utf8").trim();
60
- const parsed = parseLicenseKey(key);
61
- if (!parsed) {
62
- console.error(
63
- "\u2717 License file is corrupted. Re-activate with:\n node-hexa activate <your-license-key>"
64
- );
65
- process.exit(1);
66
- }
67
- const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
68
- if (parsed.expiresAt !== "lifetime" && parsed.expiresAt < today) {
69
- console.error(
70
- `\u2717 Your license expired on ${parsed.expiresAt}. Renew at https://your-website.com`
71
- );
72
- process.exit(1);
73
- }
74
55
  }
75
56
 
76
57
  // ../../packages/parser/dist/index.js
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dawudesign/node-hexa-cli",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "description": "CLI to scaffold and analyze NestJS Hexagonal DDD projects",
5
5
  "keywords": [
6
6
  "nestjs",
@@ -10,7 +10,7 @@
10
10
  "cli",
11
11
  "scaffold"
12
12
  ],
13
- "license": "UNLICENSED",
13
+ "license": "MIT",
14
14
  "type": "module",
15
15
  "engines": {
16
16
  "node": ">=20"