@dawudesign/node-hexa-cli 0.1.4 → 0.1.5

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,45 @@
1
+ Proprietary License
2
+
3
+ Copyright (c) 2026 Dawudesign. All rights reserved.
4
+
5
+ TERMS AND CONDITIONS
6
+
7
+ 1. GRANT OF USE
8
+ A valid license purchased from the copyright holder grants the end user
9
+ the right to install and use this software solely for their own internal
10
+ purposes. No other rights are granted.
11
+
12
+ 2. RESTRICTIONS
13
+ You may NOT, without prior written permission from the copyright holder:
14
+ a. Copy, reproduce, or duplicate this software or any part thereof;
15
+ b. Distribute, publish, transmit, or otherwise make this software
16
+ available to any third party, whether for free or for a fee;
17
+ c. Sublicense, sell, resell, rent, lease, or lend this software;
18
+ d. Modify, adapt, translate, reverse-engineer, decompile, or create
19
+ derivative works based on this software;
20
+ e. Remove or alter any copyright notices or license terms contained
21
+ in this software.
22
+
23
+ 3. OWNERSHIP
24
+ This software and all copies thereof are proprietary to Dawud and
25
+ title thereto remains in Dawud. All rights reserved. Dawud is the
26
+ sole authorized distributor and seller of this software.
27
+
28
+ 4. NO WARRANTY
29
+ THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
30
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
31
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
32
+ NON-INFRINGEMENT.
33
+
34
+ 5. LIMITATION OF LIABILITY
35
+ IN NO EVENT SHALL DAWUD BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER
36
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE,
37
+ ARISING FROM, OUT OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE
38
+ OR OTHER DEALINGS IN THE SOFTWARE.
39
+
40
+ 6. TERMINATION
41
+ Any breach of these terms automatically terminates your right to use
42
+ this software. Upon termination, you must destroy all copies in your
43
+ possession.
44
+
45
+ For licensing inquiries, contact the copyright holder.
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.5",
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"