@hazeljs/cli 0.2.0-beta.47 → 0.2.0-beta.49

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.
@@ -17,13 +17,18 @@
17
17
  "reflect-metadata": "^0.2.2"
18
18
  },
19
19
  "devDependencies": {
20
- "@types/node": "^20.0.0",
21
- "typescript": "^5.3.3",
22
- "ts-node-dev": "^2.0.0",
23
20
  "@types/jest": "^29.5.12",
21
+ "@types/node": "^20.0.0",
22
+ "@typescript-eslint/eslint-plugin": "^8.18.2",
23
+ "@typescript-eslint/parser": "^8.18.2",
24
+ "eslint": "^8.56.0",
25
+ "eslint-config-prettier": "^9.1.0",
26
+ "eslint-plugin-prettier": "^5.1.3",
24
27
  "jest": "^29.7.0",
28
+ "prettier": "^3.2.5",
25
29
  "ts-jest": "^29.1.2",
26
- "prettier": "^3.2.5"
30
+ "ts-node-dev": "^2.0.0",
31
+ "typescript": "^5.3.3"
27
32
  },
28
33
  "author": "",
29
34
  "license": "Apache-2.0"
@@ -1,30 +1,25 @@
1
1
  {
2
2
  "compilerOptions": {
3
- "target": "es2017",
3
+ "target": "ES2020",
4
4
  "module": "commonjs",
5
- "lib": ["ES2020", "DOM"],
5
+ "lib": ["ES2020"],
6
6
  "declaration": true,
7
7
  "outDir": "./dist",
8
- "rootDir": "..",
8
+ "rootDir": "./src",
9
9
  "strict": true,
10
+ "strictNullChecks": true,
10
11
  "esModuleInterop": true,
11
12
  "skipLibCheck": true,
12
- "forceConsistentCasingInFileNames": false,
13
+ "forceConsistentCasingInFileNames": true,
13
14
  "experimentalDecorators": true,
14
15
  "emitDecoratorMetadata": true,
15
16
  "resolveJsonModule": true,
16
- "removeComments": true,
17
17
  "sourceMap": true,
18
18
  "baseUrl": "./",
19
- "incremental": true,
20
- "strictNullChecks": false,
21
- "noImplicitAny": false,
22
- "strictBindCallApply": false,
23
- "noFallthroughCasesInSwitch": false,
24
19
  "paths": {
25
20
  "@/*": ["src/*"]
26
21
  }
27
22
  },
28
23
  "include": ["src/**/*"],
29
24
  "exclude": ["node_modules", "dist"]
30
- }
25
+ }
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @hazeljs/cli
2
2
 
3
- **Command-Line Interface for HazelJS**
3
+ **From zero to CRUD in one command.**
4
4
 
5
- Scaffold applications and generate components with a powerful CLI tool for rapid development.
5
+ Generate controllers, services, modules, DTOs or a full CRUD resource. Interactive project setup, package management, and code that follows best practices. Stop copy-pasting, start shipping.
6
6
 
7
7
  [![npm version](https://img.shields.io/npm/v/@hazeljs/cli.svg)](https://www.npmjs.com/package/@hazeljs/cli)
8
8
  [![npm downloads](https://img.shields.io/npm/dm/@hazeljs/cli)](https://www.npmjs.com/package/@hazeljs/cli)
@@ -20,6 +20,10 @@ const HAZEL_PACKAGES = {
20
20
  npm: '@hazeljs/auth',
21
21
  hint: 'import { JwtModule } from "@hazeljs/auth";\n // JwtModule.forRoot({ secret: "your-secret", expiresIn: "1d" })',
22
22
  },
23
+ oauth: {
24
+ npm: '@hazeljs/oauth',
25
+ hint: 'import { OAuthModule } from "@hazeljs/oauth";\n // OAuthModule.forRoot({ providers: { google: {...}, microsoft: {...}, github: {...} } })',
26
+ },
23
27
  cache: {
24
28
  npm: '@hazeljs/cache',
25
29
  hint: 'import { CacheModule } from "@hazeljs/cache";',
@@ -32,18 +36,58 @@ const HAZEL_PACKAGES = {
32
36
  npm: '@hazeljs/cron',
33
37
  hint: 'import { CronModule } from "@hazeljs/cron";',
34
38
  },
39
+ data: {
40
+ npm: '@hazeljs/data',
41
+ hint: 'import { DataModule } from "@hazeljs/data";',
42
+ },
35
43
  discovery: {
36
44
  npm: '@hazeljs/discovery',
37
45
  hint: 'import { ServiceRegistry, DiscoveryClient } from "@hazeljs/discovery";',
38
46
  },
47
+ 'event-emitter': {
48
+ npm: '@hazeljs/event-emitter',
49
+ hint: 'import { EventEmitterModule } from "@hazeljs/event-emitter";',
50
+ },
51
+ gateway: {
52
+ npm: '@hazeljs/gateway',
53
+ hint: 'import { GatewayModule } from "@hazeljs/gateway";',
54
+ },
55
+ graphql: {
56
+ npm: '@hazeljs/graphql',
57
+ hint: 'import { GraphQLModule } from "@hazeljs/graphql";',
58
+ },
59
+ grpc: {
60
+ npm: '@hazeljs/grpc',
61
+ hint: 'import { GrpcModule } from "@hazeljs/grpc";',
62
+ },
63
+ kafka: {
64
+ npm: '@hazeljs/kafka',
65
+ hint: 'import { KafkaModule } from "@hazeljs/kafka";',
66
+ },
67
+ messaging: {
68
+ npm: '@hazeljs/messaging',
69
+ hint: 'import { MessagingModule } from "@hazeljs/messaging";',
70
+ },
71
+ ml: {
72
+ npm: '@hazeljs/ml',
73
+ hint: 'import { MLModule } from "@hazeljs/ml";',
74
+ },
39
75
  prisma: {
40
76
  npm: '@hazeljs/prisma',
41
77
  hint: 'import { PrismaModule } from "@hazeljs/prisma";',
42
78
  },
79
+ queue: {
80
+ npm: '@hazeljs/queue',
81
+ hint: 'import { QueueModule } from "@hazeljs/queue";',
82
+ },
43
83
  rag: {
44
84
  npm: '@hazeljs/rag',
45
85
  hint: 'import { RAGPipeline } from "@hazeljs/rag";',
46
86
  },
87
+ resilience: {
88
+ npm: '@hazeljs/resilience',
89
+ hint: 'import { CircuitBreaker, WithRetry, WithTimeout } from "@hazeljs/resilience";',
90
+ },
47
91
  'pdf-to-audio': {
48
92
  npm: '@hazeljs/pdf-to-audio',
49
93
  hint: 'import { PdfToAudioModule } from "@hazeljs/pdf-to-audio";\n // PdfToAudioModule converts PDFs to audio via TTS',
@@ -63,6 +63,10 @@ function scaffoldPackageBoilerplate(destPath, packages) {
63
63
  imports.push("import { JwtModule } from '@hazeljs/auth';");
64
64
  moduleImports.push("JwtModule.forRoot({ secret: process.env.JWT_SECRET || 'change-me', expiresIn: '1d' })");
65
65
  }
66
+ if (packages.includes('@hazeljs/oauth')) {
67
+ imports.push("import { OAuthModule } from '@hazeljs/oauth';");
68
+ moduleImports.push("OAuthModule.forRoot({ providers: { google: { clientId: process.env.GOOGLE_CLIENT_ID!, clientSecret: process.env.GOOGLE_CLIENT_SECRET!, redirectUri: process.env.OAUTH_REDIRECT_URI! } } })");
69
+ }
66
70
  if (packages.includes('@hazeljs/cache')) {
67
71
  imports.push("import { CacheModule } from '@hazeljs/cache';");
68
72
  moduleImports.push('CacheModule');
@@ -75,6 +79,65 @@ function scaffoldPackageBoilerplate(destPath, packages) {
75
79
  imports.push("import { WebSocketModule } from '@hazeljs/websocket';");
76
80
  moduleImports.push('WebSocketModule');
77
81
  }
82
+ if (packages.includes('@hazeljs/ai')) {
83
+ imports.push("import { AIModule } from '@hazeljs/ai';");
84
+ moduleImports.push('AIModule');
85
+ }
86
+ if (packages.includes('@hazeljs/agent')) {
87
+ imports.push("import { AgentModule } from '@hazeljs/agent';");
88
+ moduleImports.push('AgentModule');
89
+ }
90
+ if (packages.includes('@hazeljs/rag')) {
91
+ imports.push("import { RAGModule } from '@hazeljs/rag';");
92
+ moduleImports.push('RAGModule');
93
+ }
94
+ if (packages.includes('@hazeljs/discovery')) {
95
+ // Discovery uses ServiceRegistry/DiscoveryClient programmatically - no module import
96
+ }
97
+ if (packages.includes('@hazeljs/pdf-to-audio')) {
98
+ imports.push("import { PdfToAudioModule } from '@hazeljs/pdf-to-audio';");
99
+ moduleImports.push('PdfToAudioModule');
100
+ }
101
+ if (packages.includes('@hazeljs/data')) {
102
+ imports.push("import { DataModule } from '@hazeljs/data';");
103
+ moduleImports.push('DataModule.forRoot()');
104
+ }
105
+ if (packages.includes('@hazeljs/event-emitter')) {
106
+ imports.push("import { EventEmitterModule } from '@hazeljs/event-emitter';");
107
+ moduleImports.push('EventEmitterModule.forRoot()');
108
+ }
109
+ if (packages.includes('@hazeljs/gateway')) {
110
+ imports.push("import { GatewayModule } from '@hazeljs/gateway';");
111
+ moduleImports.push('GatewayModule');
112
+ }
113
+ if (packages.includes('@hazeljs/graphql')) {
114
+ imports.push("import { GraphQLModule } from '@hazeljs/graphql';");
115
+ moduleImports.push('GraphQLModule');
116
+ }
117
+ if (packages.includes('@hazeljs/grpc')) {
118
+ imports.push("import { GrpcModule } from '@hazeljs/grpc';");
119
+ moduleImports.push('GrpcModule');
120
+ }
121
+ if (packages.includes('@hazeljs/kafka')) {
122
+ imports.push("import { KafkaModule } from '@hazeljs/kafka';");
123
+ moduleImports.push('KafkaModule');
124
+ }
125
+ if (packages.includes('@hazeljs/messaging')) {
126
+ imports.push("import { MessagingModule } from '@hazeljs/messaging';");
127
+ moduleImports.push('MessagingModule');
128
+ }
129
+ if (packages.includes('@hazeljs/ml')) {
130
+ imports.push("import { MLModule } from '@hazeljs/ml';");
131
+ moduleImports.push('MLModule.forRoot()');
132
+ }
133
+ if (packages.includes('@hazeljs/queue')) {
134
+ imports.push("import { QueueModule } from '@hazeljs/queue';");
135
+ moduleImports.push('QueueModule');
136
+ }
137
+ if (packages.includes('@hazeljs/resilience')) {
138
+ // Resilience is a library of decorators, not a module - no import needed in app.module
139
+ // User can import { CircuitBreaker, WithRetry } in their services
140
+ }
78
141
  // Generate the enhanced app.module.ts
79
142
  const importsSection = moduleImports.length > 0
80
143
  ? `\n imports: [\n ${moduleImports.join(',\n ')},\n ],`
@@ -161,18 +224,30 @@ function generateApp(program) {
161
224
  name: 'packages',
162
225
  message: 'Select additional HazelJS packages to install:',
163
226
  choices: [
227
+ { name: 'AI Integration (@hazeljs/ai)', value: '@hazeljs/ai' },
228
+ { name: 'AI Agents (@hazeljs/agent)', value: '@hazeljs/agent' },
164
229
  { name: 'Authentication (@hazeljs/auth)', value: '@hazeljs/auth' },
165
- { name: 'Configuration (@hazeljs/config)', value: '@hazeljs/config' },
166
- { name: 'Swagger/OpenAPI (@hazeljs/swagger)', value: '@hazeljs/swagger' },
167
- { name: 'Prisma ORM (@hazeljs/prisma)', value: '@hazeljs/prisma' },
230
+ { name: 'OAuth - Google/Microsoft/GitHub (@hazeljs/oauth)', value: '@hazeljs/oauth' },
168
231
  { name: 'Caching (@hazeljs/cache)', value: '@hazeljs/cache' },
232
+ { name: 'Configuration (@hazeljs/config)', value: '@hazeljs/config' },
169
233
  { name: 'Cron Jobs (@hazeljs/cron)', value: '@hazeljs/cron' },
170
- { name: 'WebSocket (@hazeljs/websocket)', value: '@hazeljs/websocket' },
171
- { name: 'AI Integration (@hazeljs/ai)', value: '@hazeljs/ai' },
172
- { name: 'AI Agents (@hazeljs/agent)', value: '@hazeljs/agent' },
234
+ { name: 'Data/ETL (@hazeljs/data)', value: '@hazeljs/data' },
235
+ { name: 'Service Discovery (@hazeljs/discovery)', value: '@hazeljs/discovery' },
236
+ { name: 'Event Emitter (@hazeljs/event-emitter)', value: '@hazeljs/event-emitter' },
237
+ { name: 'API Gateway (@hazeljs/gateway)', value: '@hazeljs/gateway' },
238
+ { name: 'GraphQL (@hazeljs/graphql)', value: '@hazeljs/graphql' },
239
+ { name: 'gRPC (@hazeljs/grpc)', value: '@hazeljs/grpc' },
240
+ { name: 'Kafka (@hazeljs/kafka)', value: '@hazeljs/kafka' },
241
+ { name: 'Messaging - WhatsApp/Telegram (@hazeljs/messaging)', value: '@hazeljs/messaging' },
242
+ { name: 'Machine Learning (@hazeljs/ml)', value: '@hazeljs/ml' },
243
+ { name: 'PDF to Audio (@hazeljs/pdf-to-audio)', value: '@hazeljs/pdf-to-audio' },
244
+ { name: 'Prisma ORM (@hazeljs/prisma)', value: '@hazeljs/prisma' },
245
+ { name: 'Queue/BullMQ (@hazeljs/queue)', value: '@hazeljs/queue' },
173
246
  { name: 'RAG/Vector Search (@hazeljs/rag)', value: '@hazeljs/rag' },
247
+ { name: 'Resilience - Circuit Breaker (@hazeljs/resilience)', value: '@hazeljs/resilience' },
174
248
  { name: 'Serverless (@hazeljs/serverless)', value: '@hazeljs/serverless' },
175
- { name: 'Service Discovery (@hazeljs/discovery)', value: '@hazeljs/discovery' },
249
+ { name: 'Swagger/OpenAPI (@hazeljs/swagger)', value: '@hazeljs/swagger' },
250
+ { name: 'WebSocket (@hazeljs/websocket)', value: '@hazeljs/websocket' },
176
251
  ],
177
252
  },
178
253
  ]);
@@ -221,13 +296,18 @@ function generateApp(program) {
221
296
  'reflect-metadata': '^0.2.2',
222
297
  },
223
298
  devDependencies: {
224
- '@types/node': '^20.0.0',
225
- 'typescript': '^5.3.3',
226
- 'ts-node-dev': '^2.0.0',
227
299
  '@types/jest': '^29.5.12',
300
+ '@types/node': '^20.0.0',
301
+ '@typescript-eslint/eslint-plugin': '^8.18.2',
302
+ '@typescript-eslint/parser': '^8.18.2',
303
+ 'eslint': '^8.56.0',
304
+ 'eslint-config-prettier': '^9.1.0',
305
+ 'eslint-plugin-prettier': '^5.1.3',
228
306
  'jest': '^29.7.0',
229
- 'ts-jest': '^29.1.2',
230
307
  'prettier': '^3.2.5',
308
+ 'ts-jest': '^29.1.2',
309
+ 'ts-node-dev': '^2.0.0',
310
+ 'typescript': '^5.3.3',
231
311
  },
232
312
  author: projectConfig.author,
233
313
  license: projectConfig.license,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hazeljs/cli",
3
- "version": "0.2.0-beta.47",
3
+ "version": "0.2.0-beta.49",
4
4
  "description": "Command-line interface for scaffolding and generating HazelJS applications and components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -69,5 +69,5 @@
69
69
  "type": "opencollective",
70
70
  "url": "https://opencollective.com/hazeljs"
71
71
  },
72
- "gitHead": "93a93baf214ccbe94b4703efc8b066b34c3c43c0"
72
+ "gitHead": "263b1f8c87ad9008ae21b6472860eb1b6cf1a6ce"
73
73
  }