@nlabs/lex 1.49.5 → 1.50.1

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 (52) hide show
  1. package/.swcrc +35 -0
  2. package/README.md +43 -59
  3. package/config.json +32 -8
  4. package/examples/lex.config.js +110 -10
  5. package/lex.config.js +34 -7
  6. package/lib/Button.stories.js +99 -0
  7. package/lib/LexConfig.d.ts +60 -22
  8. package/lib/LexConfig.js +285 -244
  9. package/lib/commands/ai/ai.js +287 -288
  10. package/lib/commands/ai/index.js +8 -7
  11. package/lib/commands/build/build.d.ts +2 -2
  12. package/lib/commands/build/build.js +349 -458
  13. package/lib/commands/clean/clean.js +45 -33
  14. package/lib/commands/compile/compile.js +214 -228
  15. package/lib/commands/config/config.js +46 -42
  16. package/lib/commands/copy/copy.js +36 -35
  17. package/lib/commands/create/create.js +200 -121
  18. package/lib/commands/dev/dev.d.ts +1 -0
  19. package/lib/commands/dev/dev.js +261 -259
  20. package/lib/commands/init/init.js +108 -88
  21. package/lib/commands/link/link.js +18 -14
  22. package/lib/commands/lint/lint.js +735 -742
  23. package/lib/commands/migrate/migrate.js +49 -36
  24. package/lib/commands/publish/publish.js +116 -96
  25. package/lib/commands/serverless/serverless.js +611 -585
  26. package/lib/commands/storybook/storybook.js +242 -238
  27. package/lib/commands/test/test.js +381 -409
  28. package/lib/commands/update/update.js +141 -120
  29. package/lib/commands/upgrade/upgrade.js +51 -44
  30. package/lib/commands/versions/versions.d.ts +1 -1
  31. package/lib/commands/versions/versions.js +36 -38
  32. package/lib/create/changelog.js +136 -125
  33. package/lib/index.js +40 -38
  34. package/lib/lex.js +95 -68
  35. package/lib/storybook/index.js +6 -1
  36. package/lib/test-react/index.js +7 -84
  37. package/lib/types.d.ts +1 -1
  38. package/lib/types.js +7 -1
  39. package/lib/utils/aiService.js +240 -227
  40. package/lib/utils/app.js +274 -273
  41. package/lib/utils/deepMerge.js +37 -23
  42. package/lib/utils/file.js +218 -215
  43. package/lib/utils/log.js +29 -27
  44. package/lib/utils/reactShim.js +7 -85
  45. package/lib/utils/translations.js +92 -82
  46. package/package.json +59 -60
  47. package/templates/typescript/DataLayer.js.txt +218 -0
  48. package/templates/typescript/DataLayer.test.js.txt +268 -0
  49. package/templates/typescript/DataLayer.test.ts.txt +269 -0
  50. package/templates/typescript/DataLayer.ts.txt +227 -0
  51. package/webpack.config.js +38 -28
  52. package/lib/commands/lint/autofix.d.ts +0 -2
@@ -1,24 +1,4 @@
1
1
  import type { Linter } from 'eslint';
2
- export interface EsbuildConfig {
3
- [key: string]: unknown;
4
- entryPoints?: string[];
5
- outdir?: string;
6
- platform?: 'node' | 'browser';
7
- target?: string;
8
- format?: 'cjs' | 'esm';
9
- minify?: boolean;
10
- treeShaking?: boolean;
11
- drop?: string[];
12
- pure?: string[];
13
- external?: string[];
14
- splitting?: boolean;
15
- metafile?: boolean;
16
- sourcemap?: boolean | 'inline' | 'external';
17
- legalComments?: 'none' | 'inline' | 'eof' | 'linked' | 'separate';
18
- banner?: Record<string, string>;
19
- footer?: Record<string, string>;
20
- define?: Record<string, string>;
21
- }
22
2
  export interface JestConfig {
23
3
  [key: string]: unknown;
24
4
  roots?: string[];
@@ -35,7 +15,7 @@ export interface WebpackConfig {
35
15
  output?: Record<string, unknown>;
36
16
  module?: Record<string, unknown>;
37
17
  plugins?: unknown[];
38
- publicPath?: string;
18
+ staticPath?: string;
39
19
  }
40
20
  export interface AIConfig {
41
21
  provider?: 'cursor' | 'copilot' | 'openai' | 'anthropic' | 'none';
@@ -49,6 +29,64 @@ export interface ESLintConfig {
49
29
  extends?: string[];
50
30
  rules?: Linter.RulesRecord;
51
31
  }
32
+ export interface SWCConfig {
33
+ jsc?: {
34
+ parser?: {
35
+ syntax?: 'typescript' | 'ecmascript';
36
+ tsx?: boolean;
37
+ decorators?: boolean;
38
+ dynamicImport?: boolean;
39
+ };
40
+ target?: 'es3' | 'es5' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023';
41
+ transform?: {
42
+ react?: {
43
+ runtime?: 'automatic' | 'classic';
44
+ pragma?: string;
45
+ pragmaFrag?: string;
46
+ throwIfNamespace?: boolean;
47
+ development?: boolean;
48
+ useBuiltins?: boolean;
49
+ refresh?: boolean;
50
+ };
51
+ };
52
+ externalHelpers?: boolean;
53
+ keepClassNames?: boolean;
54
+ loose?: boolean;
55
+ minify?: {
56
+ compress?: boolean;
57
+ mangle?: boolean;
58
+ };
59
+ };
60
+ module?: {
61
+ type?: 'es6' | 'commonjs' | 'amd' | 'umd' | 'systemjs';
62
+ strict?: boolean;
63
+ strictMode?: boolean;
64
+ lazy?: boolean;
65
+ noInterop?: boolean;
66
+ };
67
+ minify?: boolean;
68
+ sourceMaps?: boolean | 'inline';
69
+ inlineSourcesContent?: boolean;
70
+ isModule?: boolean;
71
+ filename?: string;
72
+ configFile?: string;
73
+ swcrc?: boolean;
74
+ env?: {
75
+ targets?: string | string[] | Record<string, string>;
76
+ mode?: 'usage' | 'entry';
77
+ coreJs?: string;
78
+ path?: string;
79
+ debug?: boolean;
80
+ dynamicImport?: boolean;
81
+ loose?: boolean;
82
+ bugfixes?: boolean;
83
+ include?: string[];
84
+ exclude?: string[];
85
+ forceAllTransforms?: boolean;
86
+ modules?: 'amd' | 'umd' | 'systemjs' | 'auto' | false;
87
+ shippedProposals?: boolean;
88
+ };
89
+ }
52
90
  export interface LexConfigType {
53
91
  ai?: AIConfig;
54
92
  configFiles?: string[];
@@ -56,7 +94,6 @@ export interface LexConfigType {
56
94
  entryHTML?: string;
57
95
  entryJs?: string;
58
96
  env?: object;
59
- esbuild?: EsbuildConfig;
60
97
  eslint?: ESLintConfig;
61
98
  gitUrl?: string;
62
99
  jest?: JestConfig;
@@ -70,6 +107,7 @@ export interface LexConfigType {
70
107
  preset?: 'web' | 'node' | 'lambda' | 'mobile';
71
108
  sourceFullPath?: string;
72
109
  sourcePath?: string;
110
+ swc?: SWCConfig;
73
111
  targetEnvironment?: 'node' | 'web';
74
112
  useGraphQl?: boolean;
75
113
  useTypescript?: boolean;