@nlabs/lex 2.0.3 → 2.0.4
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/CHANGELOG.md +21 -0
- package/MIGRATION_V2.md +331 -0
- package/README.md +73 -102
- package/config.json +4 -8
- package/docs/assets/lex-logo.png +0 -0
- package/examples/lex.config.js +7 -10
- package/lex.config.js +12 -11
- package/lib/commands/ai/ai.js +22 -6
- package/lib/commands/serverless-dev/serverless-dev.d.ts +8 -0
- package/lib/commands/serverless-dev/serverless-dev.js +42 -6
- package/lib/commands/storybook/storybook.js +2 -25
- package/lib/lex.js +7 -10
- package/lib/utils/vite/config.js +12 -1
- package/package.json +17 -16
- package/scripts/validate-docs.js +141 -0
package/README.md
CHANGED
|
@@ -10,24 +10,23 @@ Lex is the all-in-one development CLI that eliminates the complexity of modern R
|
|
|
10
10
|
|
|
11
11
|
[](https://www.npmjs.com/package/@nlabs/lex)
|
|
12
12
|
[](https://www.npmjs.com/package/@nlabs/lex)
|
|
13
|
-
[](http://opensource.org/licenses/MIT)
|
|
13
|
+
[](https://github.com/nitrogenlabs/lex/issues)
|
|
14
|
+
[](LICENSE)
|
|
16
15
|
[](https://discord.gg/nitrogenlabs)
|
|
17
16
|
|
|
18
17
|
## Why Lex?
|
|
19
18
|
|
|
20
19
|
### **Zero Configuration**
|
|
21
20
|
|
|
22
|
-
-
|
|
21
|
+
- Provides conventions and defaults for React 19 projects
|
|
23
22
|
- Vite-powered web builds with no required bundler config
|
|
24
23
|
- No testing setup to configure
|
|
25
24
|
- No build tools to manage
|
|
26
25
|
|
|
27
26
|
### **Lightning Fast**
|
|
28
27
|
|
|
29
|
-
- SWC-powered
|
|
30
|
-
-
|
|
28
|
+
- SWC-powered TypeScript and JavaScript compilation
|
|
29
|
+
- Fast Vite development server
|
|
31
30
|
- Optimized production builds
|
|
32
31
|
- Parallel test execution
|
|
33
32
|
|
|
@@ -47,6 +46,8 @@ Lex is the all-in-one development CLI that eliminates the complexity of modern R
|
|
|
47
46
|
|
|
48
47
|
## Quick Start
|
|
49
48
|
|
|
49
|
+
Lex 2 requires Node.js 22 or newer.
|
|
50
|
+
|
|
50
51
|
```bash
|
|
51
52
|
# Install Lex globally
|
|
52
53
|
npm install -g @nlabs/lex
|
|
@@ -71,15 +72,16 @@ lex build --mode production
|
|
|
71
72
|
|
|
72
73
|
Lex comes with everything you need for modern React development:
|
|
73
74
|
|
|
74
|
-
| Tool | Purpose |
|
|
75
|
-
|
|
76
|
-
| **SWC** |
|
|
77
|
-
| **Vitest** |
|
|
78
|
-
| **
|
|
79
|
-
| **
|
|
80
|
-
| **
|
|
81
|
-
| **
|
|
82
|
-
| **
|
|
75
|
+
| Tool | Purpose |
|
|
76
|
+
|------|---------|
|
|
77
|
+
| **SWC** | TypeScript/JavaScript compilation and Vite source transforms |
|
|
78
|
+
| **Vitest** | Unit and integration testing |
|
|
79
|
+
| **Playwright** | End-to-end testing |
|
|
80
|
+
| **TypeScript** | Type checking and declarations |
|
|
81
|
+
| **Vite** | Web development and production bundling |
|
|
82
|
+
| **Storybook** | React component development with Vite |
|
|
83
|
+
| **PostCSS and Tailwind CSS 4** | CSS processing |
|
|
84
|
+
| **ESLint** | Code linting |
|
|
83
85
|
|
|
84
86
|
## Commands Overview
|
|
85
87
|
|
|
@@ -87,59 +89,59 @@ Lex comes with everything you need for modern React development:
|
|
|
87
89
|
|
|
88
90
|
| Command | Description | Quick Example |
|
|
89
91
|
|---------|-------------|---------------|
|
|
90
|
-
| [`lex init`](
|
|
91
|
-
| [`lex create`](
|
|
92
|
-
| [`lex migrate`](
|
|
92
|
+
| [`lex init`](src/commands/init/init.docs.md) | Create new React applications | `lex init my-app --typescript` |
|
|
93
|
+
| [`lex create`](src/commands/create/create.docs.md) | Generate project assets | `lex create view --outputName Dashboard` |
|
|
94
|
+
| [`lex migrate`](src/commands/migrate/migrate.docs.md) | Remove conflicting toolchain packages and reinstall | `lex migrate` |
|
|
93
95
|
|
|
94
96
|
### **Development**
|
|
95
97
|
|
|
96
98
|
| Command | Description | Quick Example |
|
|
97
99
|
|---------|-------------|---------------|
|
|
98
|
-
| [`lex dev`](
|
|
99
|
-
| [`lex serverless-dev`](
|
|
100
|
-
| [`lex
|
|
101
|
-
| [`lex
|
|
100
|
+
| [`lex dev`](src/commands/dev/dev.docs.md) | Start the Vite development server | `lex dev --open` |
|
|
101
|
+
| [`lex serverless-dev`](src/commands/serverless-dev/serverless-dev.docs.md) | Start the local Lambda server | `lex serverless-dev --host 0.0.0.0` |
|
|
102
|
+
| [`lex serverless-deploy`](src/commands/serverless-deploy/serverless-deploy.docs.md) | Bundle and package a Lambda function | `lex serverless-deploy --entry src/handler.ts` |
|
|
103
|
+
| [`lex compile`](src/commands/compile/compile.docs.md) | Compile TypeScript/JavaScript with SWC | `lex compile --watch` |
|
|
104
|
+
| [`lex build`](src/commands/build/build.docs.md) | Build with Vite or SWC | `lex build --mode production` |
|
|
102
105
|
|
|
103
106
|
### **Testing & Quality**
|
|
104
107
|
|
|
105
108
|
| Command | Description | Quick Example |
|
|
106
109
|
|---------|-------------|---------------|
|
|
107
|
-
| [`lex test`](
|
|
108
|
-
| [`lex lint`](
|
|
109
|
-
| [`lex storybook`](
|
|
110
|
+
| [`lex test`](src/commands/test/test.docs.md) | Run Vitest and Playwright tests | `lex test --unit` |
|
|
111
|
+
| [`lex lint`](src/commands/lint/lint.docs.md) | Lint code with ESLint | `lex lint --fix` |
|
|
112
|
+
| [`lex storybook`](src/commands/storybook/storybook.docs.md) | Start Storybook with React Vite defaults | `lex storybook --open` |
|
|
110
113
|
|
|
111
114
|
### **AI-Powered Features**
|
|
112
115
|
|
|
113
116
|
| Command | Description | Quick Example |
|
|
114
117
|
|---------|-------------|---------------|
|
|
115
|
-
| [`lex ai`](
|
|
116
|
-
| [`lex test`](
|
|
117
|
-
| [`lex build`](
|
|
118
|
+
| [`lex ai`](src/commands/ai/ai.docs.md) | AI code assistance | `lex ai --task generate --prompt "Create a button component"` |
|
|
119
|
+
| [`lex test`](src/commands/test/test.docs.md) | AI test generation | `lex test --generate` |
|
|
120
|
+
| [`lex build`](src/commands/build/build.docs.md) | AI build assistance | `lex build --assist` |
|
|
118
121
|
|
|
119
122
|
### **Package Management**
|
|
120
123
|
|
|
121
124
|
| Command | Description | Quick Example |
|
|
122
125
|
|---------|-------------|---------------|
|
|
123
|
-
| [`lex update`](
|
|
124
|
-
| [`lex upgrade`](
|
|
125
|
-
| [`lex publish`](
|
|
126
|
+
| [`lex update`](src/commands/update/update.docs.md) | Update dependencies | `lex update --interactive` |
|
|
127
|
+
| [`lex upgrade`](src/commands/upgrade/upgrade.docs.md) | Upgrade Lex itself | `lex upgrade` |
|
|
128
|
+
| [`lex publish`](src/commands/publish/publish.docs.md) | Publish to npm | `lex publish --bump minor` |
|
|
126
129
|
|
|
127
130
|
### **Utilities**
|
|
128
131
|
|
|
129
132
|
| Command | Description | Quick Example |
|
|
130
133
|
|---------|-------------|---------------|
|
|
131
|
-
| [`lex clean`](
|
|
132
|
-
| [`lex
|
|
133
|
-
| [`lex
|
|
134
|
-
| [`lex
|
|
135
|
-
| [`lex link`](#link) | Check linked modules | `lex link` |
|
|
134
|
+
| [`lex clean`](src/commands/clean/clean.docs.md) | Clean project files | `lex clean` |
|
|
135
|
+
| [`lex config`](src/commands/config/config.docs.md) | Show resolved configurations | `lex config vite` |
|
|
136
|
+
| [`lex versions`](src/commands/versions/versions.docs.md) | Show tool versions | `lex versions` |
|
|
137
|
+
| [`lex linked`](src/commands/link/link.docs.md) | Check linked modules | `lex linked` |
|
|
136
138
|
|
|
137
139
|
## Core Features
|
|
138
140
|
|
|
139
141
|
### **Development Server**
|
|
140
142
|
|
|
141
143
|
```bash
|
|
142
|
-
# Start
|
|
144
|
+
# Start the Vite development server
|
|
143
145
|
lex dev --open
|
|
144
146
|
|
|
145
147
|
# With bundle analyzer
|
|
@@ -161,6 +163,8 @@ export default {
|
|
|
161
163
|
|
|
162
164
|
`--port` takes precedence over `dev.port`.
|
|
163
165
|
|
|
166
|
+
**Development Caching**: Lex sends `no-store` response headers and forces Vite to refresh optimized dependencies each time the development server starts. Projects can override these defaults with `vite.server.headers` and `vite.optimizeDeps.force`.
|
|
167
|
+
|
|
164
168
|
**Public IP Caching**: Lex automatically caches your public IP address for 1 week to reduce API calls. Use `--usePublicIp` to force refresh the cache when needed.
|
|
165
169
|
|
|
166
170
|
**Static Assets**: If your HTML template references static assets with absolute paths, ensure they exist in the configured static directory.
|
|
@@ -225,7 +229,7 @@ lex build --analyze
|
|
|
225
229
|
lex test
|
|
226
230
|
|
|
227
231
|
# Watch mode
|
|
228
|
-
lex test --watch
|
|
232
|
+
lex test --watch src
|
|
229
233
|
|
|
230
234
|
# Generate tests with AI
|
|
231
235
|
lex test --generate
|
|
@@ -241,7 +245,7 @@ lex test --config ./vitest.config.mjs
|
|
|
241
245
|
|
|
242
246
|
- **Smart Configuration Merging**: Automatically merges your project's Vitest config with Lex's optimized defaults
|
|
243
247
|
- **ESM Support**: Automatic detection and configuration for ES modules projects
|
|
244
|
-
- **
|
|
248
|
+
- **Setup Discovery**: Uses `vitest.setup.js` or a path supplied with `--setup` when present
|
|
245
249
|
- **React JSX Automatic Runtime**: No need to import React in your test files
|
|
246
250
|
- **TypeScript-First**: Optimized for TypeScript projects with specialized configs
|
|
247
251
|
|
|
@@ -268,31 +272,21 @@ lex ai --task generate --prompt "Create a user profile component"
|
|
|
268
272
|
lex ai --task explain --file src/components/Button.tsx
|
|
269
273
|
|
|
270
274
|
# Fix errors
|
|
271
|
-
lex ai --task
|
|
275
|
+
lex ai --task explain --prompt "Explain this TypeScript error and suggest a fix"
|
|
272
276
|
```
|
|
273
277
|
|
|
274
278
|
## Framework Support
|
|
275
279
|
|
|
276
|
-
Lex
|
|
277
|
-
|
|
278
|
-
- ✅ **Create React App** - Migrate existing CRA projects
|
|
279
|
-
- ✅ **Next.js** - Use Lex for testing and building
|
|
280
|
-
- ✅ **Gatsby** - Integrate Lex workflows
|
|
281
|
-
- ✅ **Vite** - Built-in web development and production bundling
|
|
282
|
-
- ✅ **TypeScript** - Full TypeScript support out of the box
|
|
283
|
-
- ✅ **Tailwind CSS** - Automatic Tailwind integration
|
|
284
|
-
- ✅ **Storybook** - Built-in Storybook support
|
|
285
|
-
- ✅ **Serverless** - Local AWS Lambda development with HTTP/WebSocket support
|
|
280
|
+
Lex's built-in web pipeline targets React 19 with Vite and Tailwind CSS 4. Lex also provides SWC compilation for Node, Lambda, and mobile targets; Vitest and Playwright test workflows; React Vite Storybook defaults; and local AWS Lambda HTTP, WebSocket, and GraphQL development.
|
|
286
281
|
|
|
287
282
|
## 🚀 Performance
|
|
288
283
|
|
|
289
284
|
Lex is designed for speed and efficiency:
|
|
290
285
|
|
|
291
|
-
- **
|
|
292
|
-
- **
|
|
293
|
-
- **Hot Reloading** - Instant feedback during development
|
|
286
|
+
- **Vite Development** - On-demand module transformation during development
|
|
287
|
+
- **SWC Compilation** - Fast non-web compilation and source transformation
|
|
294
288
|
- **Tree Shaking** - Automatic dead code elimination
|
|
295
|
-
- **Code Splitting** -
|
|
289
|
+
- **Code Splitting** - Native dynamic-import chunks for web production builds
|
|
296
290
|
|
|
297
291
|
## Configuration
|
|
298
292
|
|
|
@@ -311,7 +305,7 @@ export default {
|
|
|
311
305
|
// AI configuration
|
|
312
306
|
ai: {
|
|
313
307
|
provider: 'openai',
|
|
314
|
-
model: 'gpt-
|
|
308
|
+
model: 'gpt-4o'
|
|
315
309
|
},
|
|
316
310
|
|
|
317
311
|
// SWC configuration (defaults to ESM format)
|
|
@@ -348,7 +342,7 @@ Lex provides extensive configuration options through the `lex.config.js` file. H
|
|
|
348
342
|
| `dev.port` | `number` | `3000` | Default port used by `lex dev` when `--port` is not passed | `dev: { port: 4200 }` |
|
|
349
343
|
| `outputFile` | `string` | `undefined` | Specific output filename | `outputFile: 'bundle.js'` |
|
|
350
344
|
| `outputFullPath` | `string` | `path.resolve('./lib')` | Absolute output path for build artifacts and static files. | `outputFullPath: '/absolute/build'` |
|
|
351
|
-
| `outputHash` | `boolean` |
|
|
345
|
+
| `outputHash` | `boolean` | Production mode | Add hashes to output filenames | `outputHash: true` |
|
|
352
346
|
| `outputPath` | `string` | `'./lib'` | Output directory path | `outputPath: './build'` |
|
|
353
347
|
| `packageManager` | `'npm' \| 'yarn'` | `'npm'` | Package manager to use | `packageManager: 'yarn'` |
|
|
354
348
|
| `preset` | `'web' \| 'node' \| 'lambda' \| 'mobile'` | `'web'` | Project preset type | `preset: 'node'` |
|
|
@@ -365,7 +359,7 @@ Lex provides extensive configuration options through the `lex.config.js` file. H
|
|
|
365
359
|
|--------|------|---------|-------------|---------|
|
|
366
360
|
| `ai.apiKey` | `string` | `undefined` | API key for AI provider | `ai: { apiKey: 'sk-...' }` |
|
|
367
361
|
| `ai.maxTokens` | `number` | `4000` | Maximum tokens for AI responses | `ai: { maxTokens: 8000 }` |
|
|
368
|
-
| `ai.model` | `string` | `'gpt-4o'` |
|
|
362
|
+
| `ai.model` | `string` | `'gpt-4o'` | Model identifier passed to the provider | `ai: { model: 'gpt-4o' }` |
|
|
369
363
|
| `ai.provider` | `'cursor' \| 'copilot' \| 'openai' \| 'anthropic' \| 'none'` | `'none'` | AI service provider | `ai: { provider: 'openai' }` |
|
|
370
364
|
| `ai.temperature` | `number` | `0.1` | AI response creativity (0-1) | `ai: { temperature: 0.7 }` |
|
|
371
365
|
|
|
@@ -373,8 +367,7 @@ Lex provides extensive configuration options through the `lex.config.js` file. H
|
|
|
373
367
|
|
|
374
368
|
SWC (Speedy Web Compiler) powers non-web compilation and Lex's source transformation inside Vite. SWC provides:
|
|
375
369
|
|
|
376
|
-
- **
|
|
377
|
-
- **Faster than esbuild** for TypeScript compilation
|
|
370
|
+
- **Fast native compilation** for TypeScript and JavaScript
|
|
378
371
|
- **Zero configuration** - works out of the box
|
|
379
372
|
- **ESM by default** - modern module format
|
|
380
373
|
- **Automatic React JSX** transformation
|
|
@@ -385,7 +378,7 @@ SWC is automatically configured and doesn't require additional configuration in
|
|
|
385
378
|
| Feature | Description | Default |
|
|
386
379
|
|---------|-------------|---------|
|
|
387
380
|
| **Output Format** | JavaScript module format | `esm` |
|
|
388
|
-
| **Target** | JavaScript target version | `
|
|
381
|
+
| **Target** | JavaScript target version | `es2023` |
|
|
389
382
|
| **JSX Runtime** | React JSX transformation | `automatic` |
|
|
390
383
|
| **React Compiler** | Optional React Compiler SWC plugin | `false` |
|
|
391
384
|
| **Decorators** | TypeScript decorators support | `enabled` |
|
|
@@ -476,11 +469,11 @@ Lex also processes these conventional asset locations:
|
|
|
476
469
|
| Source | Output | Behavior |
|
|
477
470
|
|--------|--------|----------|
|
|
478
471
|
| `vite.staticPath` | Output root | Recursively copied |
|
|
479
|
-
|
|
|
480
|
-
|
|
|
481
|
-
|
|
|
482
|
-
|
|
|
483
|
-
|
|
|
472
|
+
| `<sourcePath>/images` | `images` | Copied and optimized |
|
|
473
|
+
| `<sourcePath>/fonts` | `fonts` | Copied |
|
|
474
|
+
| `<sourcePath>/docs` | `docs` | Copied |
|
|
475
|
+
| `<sourcePath>/icons/*.svg` | `icons/icons.svg` | Combined into an optimized SVG sprite |
|
|
476
|
+
| `<sourcePath>/images/logo.png` | Output root | Generates favicons, manifests, `open-graph.png`, and `twitter.png` |
|
|
484
477
|
|
|
485
478
|
Production builds optimize GIF, JPEG, PNG, SVG, and WebP assets. Compressible CSS, HTML, JavaScript, JSON, SVG, text, and XML files of at least 8 KiB receive a `.gz` sidecar.
|
|
486
479
|
|
|
@@ -488,18 +481,18 @@ Production builds optimize GIF, JPEG, PNG, SVG, and WebP assets. Compressible CS
|
|
|
488
481
|
|
|
489
482
|
Lex 2 is a breaking migration from Webpack to Vite for web projects. Non-web projects use SWC.
|
|
490
483
|
|
|
484
|
+
Follow the **[Lex 1 to Lex 2 migration guide](MIGRATION_V2.md)** for the complete upgrade process, including dependency cleanup, configuration mapping, dynamic imports, environment variables, polyfills, assets, Storybook, validation, and troubleshooting.
|
|
485
|
+
|
|
491
486
|
Update the configuration property:
|
|
492
487
|
|
|
493
488
|
```javascript
|
|
494
|
-
|
|
495
|
-
export default {
|
|
489
|
+
const lex1Config = {
|
|
496
490
|
webpack: {
|
|
497
491
|
staticPath: './src/static'
|
|
498
492
|
}
|
|
499
493
|
};
|
|
500
494
|
|
|
501
|
-
|
|
502
|
-
export default {
|
|
495
|
+
const lex2Config = {
|
|
503
496
|
vite: {
|
|
504
497
|
staticPath: './src/static'
|
|
505
498
|
}
|
|
@@ -524,7 +517,6 @@ export default {
|
|
|
524
517
|
|
|
525
518
|
| Option | Type | Default | Description | Example |
|
|
526
519
|
|--------|------|---------|-------------|---------|
|
|
527
|
-
| `configFiles` | `string[]` | `[]` | Additional config files to include | `configFiles: ['./config/custom.js']` |
|
|
528
520
|
| `copyFiles` | `string[]` | `[]` | Files to copy during build | `copyFiles: ['public/assets']` |
|
|
529
521
|
| `env` | `object` | `null` | Environment variables | `env: { NODE_ENV: 'development' }` |
|
|
530
522
|
| `gitUrl` | `string` | `undefined` | Git repository URL | `gitUrl: 'https://github.com/user/repo'` |
|
|
@@ -564,7 +556,7 @@ export default {
|
|
|
564
556
|
ai: {
|
|
565
557
|
provider: 'openai',
|
|
566
558
|
apiKey: process.env.OPENAI_API_KEY,
|
|
567
|
-
model: 'gpt-
|
|
559
|
+
model: 'gpt-4o',
|
|
568
560
|
maxTokens: 8000,
|
|
569
561
|
temperature: 0.3
|
|
570
562
|
},
|
|
@@ -634,10 +626,7 @@ export default {
|
|
|
634
626
|
|
|
635
627
|
If static assets return 404, verify that `vite.staticPath` exists and points to the intended directory.
|
|
636
628
|
|
|
637
|
-
**Solution**:
|
|
638
|
-
|
|
639
|
-
- Run `lex build` first to create the output directory
|
|
640
|
-
- Or ensure your `outputPath` configuration points to an existing directory
|
|
629
|
+
**Solution**: Put pass-through files in `vite.staticPath` (default: `src/static`) or use the conventional `images`, `fonts`, `docs`, and `icons` directories under `sourcePath`. Vite serves these source assets directly during development.
|
|
641
630
|
|
|
642
631
|
#### Port Already in Use
|
|
643
632
|
|
|
@@ -650,7 +639,7 @@ If you get an "address already in use" error, another process is using the defau
|
|
|
650
639
|
lsof -ti:3000 | xargs kill -9
|
|
651
640
|
|
|
652
641
|
# Or use a different port
|
|
653
|
-
lex dev --port
|
|
642
|
+
lex dev --port 3001
|
|
654
643
|
```
|
|
655
644
|
|
|
656
645
|
#### TypeScript Configuration Issues
|
|
@@ -672,35 +661,17 @@ If TypeScript compilation fails, ensure your `tsconfig.json` is properly configu
|
|
|
672
661
|
|
|
673
662
|
#### Missing Static Assets Error
|
|
674
663
|
|
|
675
|
-
If
|
|
676
|
-
|
|
677
|
-
**Solution**: Either create the missing files or update your HTML template to use relative paths:
|
|
678
|
-
|
|
679
|
-
```html
|
|
680
|
-
<!-- Instead of absolute paths -->
|
|
681
|
-
<link rel="icon" href="/favicon.ico" />
|
|
682
|
-
<link rel="manifest" href="/manifest.json" />
|
|
683
|
-
|
|
684
|
-
<!-- Use relative paths -->
|
|
685
|
-
<link rel="icon" href="favicon.ico" />
|
|
686
|
-
<link rel="manifest" href="manifest.json" />
|
|
687
|
-
```
|
|
688
|
-
|
|
689
|
-
Or create the missing files in your source directory:
|
|
690
|
-
|
|
691
|
-
```bash
|
|
692
|
-
touch src/favicon.ico
|
|
693
|
-
touch src/manifest.json
|
|
694
|
-
mkdir -p src/images && touch src/images/logo-icon-64.png
|
|
695
|
-
```
|
|
664
|
+
If an asset referenced by HTML is missing, verify its source location. Files in `vite.staticPath` are served from `/`, while conventional directories retain their output prefix—for example, `<sourcePath>/images/banner.png` becomes `/images/banner.png`. Add `<sourcePath>/images/logo.png` when Lex should generate favicon and social-image assets automatically.
|
|
696
665
|
|
|
697
666
|
## Documentation
|
|
698
667
|
|
|
699
|
-
-
|
|
700
|
-
-
|
|
701
|
-
-
|
|
702
|
-
-
|
|
703
|
-
-
|
|
668
|
+
- **[Lex 1 to Lex 2 migration guide](MIGRATION_V2.md)**
|
|
669
|
+
- **[Vite build](src/commands/build/build.docs.md)** and **[development server](src/commands/dev/dev.docs.md)**
|
|
670
|
+
- **[Configuration](src/commands/config/config.docs.md)**
|
|
671
|
+
- **[Testing](src/commands/test/test.docs.md)** and **[linting](src/commands/lint/lint.docs.md)**
|
|
672
|
+
- **[Storybook](src/commands/storybook/README.md)**
|
|
673
|
+
- **[Serverless development](src/commands/serverless-dev/serverless-dev.docs.md)** and **[deployment](src/commands/serverless-deploy/serverless-deploy.docs.md)**
|
|
674
|
+
- **[AI commands](src/commands/ai/ai.docs.md)**
|
|
704
675
|
|
|
705
676
|
## Contributing
|
|
706
677
|
|
package/config.json
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"syntax": "typescript",
|
|
20
20
|
"tsx": true
|
|
21
21
|
},
|
|
22
|
-
"target": "
|
|
22
|
+
"target": "es2023",
|
|
23
23
|
"transform": {
|
|
24
24
|
"react": {
|
|
25
25
|
"runtime": "automatic"
|
|
@@ -28,10 +28,7 @@
|
|
|
28
28
|
"externalHelpers": false,
|
|
29
29
|
"keepClassNames": false,
|
|
30
30
|
"loose": false,
|
|
31
|
-
"minify":
|
|
32
|
-
"compress": true,
|
|
33
|
-
"mangle": true
|
|
34
|
-
}
|
|
31
|
+
"minify": false
|
|
35
32
|
},
|
|
36
33
|
"module": {
|
|
37
34
|
"type": "es6",
|
|
@@ -40,8 +37,8 @@
|
|
|
40
37
|
"lazy": false,
|
|
41
38
|
"noInterop": false
|
|
42
39
|
},
|
|
43
|
-
"minify":
|
|
44
|
-
"sourceMaps":
|
|
40
|
+
"minify": false,
|
|
41
|
+
"sourceMaps": "inline",
|
|
45
42
|
"inlineSourcesContent": true,
|
|
46
43
|
"isModule": true
|
|
47
44
|
},
|
|
@@ -51,7 +48,6 @@
|
|
|
51
48
|
"vitest": {},
|
|
52
49
|
"outputHash": false,
|
|
53
50
|
"useGraphQl": false,
|
|
54
|
-
"configFiles": [],
|
|
55
51
|
"copyFiles": [],
|
|
56
52
|
"entryHTML": "index.html",
|
|
57
53
|
"entryJs": "index.js",
|
|
Binary file
|
package/examples/lex.config.js
CHANGED
|
@@ -19,16 +19,13 @@ export default {
|
|
|
19
19
|
// Use this section to configure AI features for lint --fix and ai commands
|
|
20
20
|
ai: {
|
|
21
21
|
// Available providers: 'cursor', 'copilot', 'openai', 'anthropic', 'none'
|
|
22
|
-
provider: '
|
|
22
|
+
provider: 'none',
|
|
23
23
|
|
|
24
24
|
// API key for external providers (recommended to use environment variables)
|
|
25
25
|
// apiKey: process.env.OPENAI_API_KEY,
|
|
26
26
|
|
|
27
|
-
// Model
|
|
28
|
-
model: '
|
|
29
|
-
// model: 'copilot-codex', // For GitHub Copilot
|
|
30
|
-
// model: 'gpt-4o', // For OpenAI
|
|
31
|
-
// model: 'claude-3-sonnet', // For Anthropic
|
|
27
|
+
// Model identifier passed to the selected provider
|
|
28
|
+
model: 'gpt-4o',
|
|
32
29
|
|
|
33
30
|
// Optional parameters
|
|
34
31
|
maxTokens: 4000,
|
|
@@ -57,7 +54,7 @@ export default {
|
|
|
57
54
|
},
|
|
58
55
|
|
|
59
56
|
// Target JavaScript version
|
|
60
|
-
target: '
|
|
57
|
+
target: 'es2023',
|
|
61
58
|
|
|
62
59
|
// Transform configuration
|
|
63
60
|
transform: {
|
|
@@ -95,7 +92,7 @@ export default {
|
|
|
95
92
|
|
|
96
93
|
// Environment configuration (optional)
|
|
97
94
|
// env: {
|
|
98
|
-
// targets: 'node >=
|
|
95
|
+
// targets: 'node >= 22', // Browser targets or Node.js version
|
|
99
96
|
// mode: 'usage', // 'usage' or 'entry'
|
|
100
97
|
// coreJs: '3', // Core-js version
|
|
101
98
|
// debug: false, // Debug mode
|
|
@@ -122,7 +119,7 @@ export default {
|
|
|
122
119
|
// useTypescript: true,
|
|
123
120
|
// swc: {
|
|
124
121
|
// jsc: {
|
|
125
|
-
// target: '
|
|
122
|
+
// target: 'es2023',
|
|
126
123
|
// parser: {
|
|
127
124
|
// syntax: 'typescript',
|
|
128
125
|
// tsx: true
|
|
@@ -136,7 +133,7 @@ export default {
|
|
|
136
133
|
// useTypescript: true,
|
|
137
134
|
// swc: {
|
|
138
135
|
// jsc: {
|
|
139
|
-
// target: '
|
|
136
|
+
// target: 'es2023',
|
|
140
137
|
// parser: {
|
|
141
138
|
// syntax: 'typescript',
|
|
142
139
|
// tsx: true,
|
package/lex.config.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
* Lex configuration file
|
|
3
3
|
* This file contains configuration options for the Lex CLI tool
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
* The 'swc' configuration section below replaces the old 'esbuild' configuration.
|
|
5
|
+
* Web projects build with Vite. Non-web projects compile with SWC.
|
|
7
6
|
*/
|
|
8
7
|
|
|
9
8
|
export default {
|
|
@@ -20,24 +19,26 @@ export default {
|
|
|
20
19
|
// Use this section to configure AI features for lint --fix and ai commands
|
|
21
20
|
ai: {
|
|
22
21
|
// Available providers: 'cursor', 'copilot', 'openai', 'anthropic', 'none'
|
|
23
|
-
provider: '
|
|
22
|
+
provider: 'none',
|
|
24
23
|
|
|
25
24
|
// API key for external providers (recommended to use environment variables)
|
|
26
25
|
// apiKey: process.env.OPENAI_API_KEY,
|
|
27
26
|
|
|
28
|
-
// Model
|
|
29
|
-
model: '
|
|
30
|
-
// model: 'copilot-codex', // For GitHub Copilot
|
|
31
|
-
// model: 'gpt-4o', // For OpenAI
|
|
32
|
-
// model: 'claude-3-sonnet', // For Anthropic
|
|
27
|
+
// Model identifier passed to the selected provider
|
|
28
|
+
model: 'gpt-4o',
|
|
33
29
|
|
|
34
30
|
// Optional parameters
|
|
35
31
|
maxTokens: 4000,
|
|
36
32
|
temperature: 0.1
|
|
37
33
|
},
|
|
38
34
|
|
|
39
|
-
//
|
|
40
|
-
|
|
35
|
+
// Vite configuration for web development and production builds
|
|
36
|
+
vite: {
|
|
37
|
+
base: '/',
|
|
38
|
+
staticPath: './src/static'
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
// SWC configuration for non-web compilation and Vite source transforms
|
|
41
42
|
swc: {
|
|
42
43
|
jsc: {
|
|
43
44
|
parser: {
|
|
@@ -46,7 +47,7 @@ export default {
|
|
|
46
47
|
decorators: true,
|
|
47
48
|
dynamicImport: true
|
|
48
49
|
},
|
|
49
|
-
target: '
|
|
50
|
+
target: 'es2023',
|
|
50
51
|
transform: {
|
|
51
52
|
react: {
|
|
52
53
|
runtime: 'automatic'
|