@nlabs/lex 1.47.2 → 1.48.0

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 (124) hide show
  1. package/.gitattributes +1 -0
  2. package/.storybook/main.ts +86 -0
  3. package/.storybook/preview.ts +15 -0
  4. package/.vscode/settings.json +83 -0
  5. package/CHANGELOG.md +1 -0
  6. package/TYPESCRIPT_CONFIGS.md +103 -0
  7. package/__mocks__/LexConfig.js +17 -2
  8. package/__mocks__/execa.js +9 -7
  9. package/__mocks__/file.js +50 -0
  10. package/__mocks__/ora.js +10 -1
  11. package/config.json +33 -0
  12. package/dist/LexConfig.js +93 -5
  13. package/dist/commands/ai/ai.js +1 -1
  14. package/dist/commands/build/build.js +15 -11
  15. package/dist/commands/clean/clean.js +10 -4
  16. package/dist/commands/compile/compile.js +29 -34
  17. package/dist/commands/create/create.js +5 -5
  18. package/dist/commands/dev/dev.js +11 -7
  19. package/dist/commands/init/init.js +5 -5
  20. package/dist/commands/lint/lint.js +55 -64
  21. package/dist/commands/migrate/migrate.js +2 -2
  22. package/dist/commands/storybook/storybook.js +174 -0
  23. package/dist/commands/test/test.js +51 -13
  24. package/dist/commands/update/update.js +3 -2
  25. package/dist/commands/upgrade/upgrade.js +3 -3
  26. package/dist/commands/versions/versions.js +3 -3
  27. package/dist/create/changelog.js +1 -1
  28. package/dist/dist/LexConfig.d.ts +119 -0
  29. package/dist/dist/utils/file.d.ts +7 -0
  30. package/dist/dist/utils/log.d.ts +1 -0
  31. package/dist/index.js +4 -3
  32. package/dist/lex.js +14 -1
  33. package/dist/utils/aiService.js +2 -2
  34. package/dist/utils/app.js +3 -3
  35. package/dist/utils/file.js +78 -4
  36. package/eslint.config.js +5 -3
  37. package/examples/lex.config.js +50 -0
  38. package/jest.config.cjs +14 -14
  39. package/jest.setup.js +30 -4
  40. package/package.json +40 -23
  41. package/tsconfig.build.json +38 -5
  42. package/tsconfig.json +28 -1
  43. package/tsconfig.lint.json +44 -0
  44. package/tsconfig.test.json +48 -0
  45. package/webpack.config.js +14 -13
  46. package/dist/LexConfig.d.ts +0 -79
  47. package/dist/commands/ai/ai.d.ts +0 -17
  48. package/dist/commands/ai/index.d.ts +0 -8
  49. package/dist/commands/build/build.cli.test.d.ts +0 -5
  50. package/dist/commands/build/build.d.ts +0 -18
  51. package/dist/commands/build/build.integration.test.d.ts +0 -1
  52. package/dist/commands/build/build.options.test.d.ts +0 -5
  53. package/dist/commands/clean/clean.cli.test.d.ts +0 -1
  54. package/dist/commands/clean/clean.d.ts +0 -7
  55. package/dist/commands/clean/clean.integration.test.d.ts +0 -1
  56. package/dist/commands/clean/clean.options.test.d.ts +0 -1
  57. package/dist/commands/compile/compile.cli.test.d.ts +0 -1
  58. package/dist/commands/compile/compile.d.ts +0 -2
  59. package/dist/commands/compile/compile.integration.test.d.ts +0 -1
  60. package/dist/commands/compile/compile.options.test.d.ts +0 -1
  61. package/dist/commands/config/config.cli.test.d.ts +0 -1
  62. package/dist/commands/config/config.d.ts +0 -7
  63. package/dist/commands/config/config.integration.test.d.ts +0 -1
  64. package/dist/commands/config/config.options.test.d.ts +0 -1
  65. package/dist/commands/copy/copy.cli.test.d.ts +0 -1
  66. package/dist/commands/copy/copy.d.ts +0 -6
  67. package/dist/commands/copy/copy.integration.test.d.ts +0 -1
  68. package/dist/commands/copy/copy.options.test.d.ts +0 -1
  69. package/dist/commands/create/create.cli.test.d.ts +0 -1
  70. package/dist/commands/create/create.d.ts +0 -8
  71. package/dist/commands/create/create.integration.test.d.ts +0 -1
  72. package/dist/commands/create/create.options.test.d.ts +0 -1
  73. package/dist/commands/dev/dev.cli.test.d.ts +0 -1
  74. package/dist/commands/dev/dev.d.ts +0 -11
  75. package/dist/commands/dev/dev.integration.test.d.ts +0 -1
  76. package/dist/commands/dev/dev.options.test.d.ts +0 -1
  77. package/dist/commands/init/init.cli.test.d.ts +0 -1
  78. package/dist/commands/init/init.d.ts +0 -9
  79. package/dist/commands/init/init.integration.test.d.ts +0 -1
  80. package/dist/commands/init/init.options.test.d.ts +0 -1
  81. package/dist/commands/link/link.cli.test.d.ts +0 -1
  82. package/dist/commands/link/link.d.ts +0 -6
  83. package/dist/commands/link/link.integration.test.d.ts +0 -1
  84. package/dist/commands/link/link.options.test.d.ts +0 -1
  85. package/dist/commands/lint/autofix.d.ts +0 -2
  86. package/dist/commands/lint/lint.cli.test.d.ts +0 -1
  87. package/dist/commands/lint/lint.d.ts +0 -39
  88. package/dist/commands/lint/lint.integration.test.d.ts +0 -1
  89. package/dist/commands/lint/lint.options.test.d.ts +0 -1
  90. package/dist/commands/migrate/migrate.cli.test.d.ts +0 -1
  91. package/dist/commands/migrate/migrate.d.ts +0 -7
  92. package/dist/commands/migrate/migrate.integration.test.d.ts +0 -1
  93. package/dist/commands/migrate/migrate.options.test.d.ts +0 -1
  94. package/dist/commands/publish/publish.cli.test.d.ts +0 -1
  95. package/dist/commands/publish/publish.d.ts +0 -12
  96. package/dist/commands/publish/publish.integration.test.d.ts +0 -1
  97. package/dist/commands/publish/publish.options.test.d.ts +0 -1
  98. package/dist/commands/test/test.cli.test.d.ts +0 -1
  99. package/dist/commands/test/test.d.ts +0 -50
  100. package/dist/commands/test/test.integration.test.d.ts +0 -1
  101. package/dist/commands/test/test.options.test.d.ts +0 -1
  102. package/dist/commands/test/test.test.d.ts +0 -1
  103. package/dist/commands/update/update.cli.test.d.ts +0 -1
  104. package/dist/commands/update/update.d.ts +0 -9
  105. package/dist/commands/update/update.integration.test.d.ts +0 -1
  106. package/dist/commands/update/update.options.test.d.ts +0 -1
  107. package/dist/commands/upgrade/upgrade.cli.test.d.ts +0 -1
  108. package/dist/commands/upgrade/upgrade.d.ts +0 -7
  109. package/dist/commands/upgrade/upgrade.integration.test.d.ts +0 -1
  110. package/dist/commands/upgrade/upgrade.options.test.d.ts +0 -1
  111. package/dist/commands/versions/versions.cli.test.d.ts +0 -1
  112. package/dist/commands/versions/versions.d.ts +0 -13
  113. package/dist/commands/versions/versions.integration.test.d.ts +0 -1
  114. package/dist/commands/versions/versions.options.test.d.ts +0 -1
  115. package/dist/create/changelog.d.ts +0 -6
  116. package/dist/index.d.ts +0 -31
  117. package/dist/lex.d.ts +0 -2
  118. package/dist/types.d.ts +0 -5
  119. package/dist/utils/aiService.d.ts +0 -9
  120. package/dist/utils/app.d.ts +0 -41
  121. package/dist/utils/file.d.ts +0 -3
  122. package/dist/utils/log.d.ts +0 -1
  123. package/dist/utils/reactShim.d.ts +0 -2
  124. /package/{jest.config.lex.d.ts → dist/jest.config.lex.d.ts} +0 -0
package/dist/types.d.ts DELETED
@@ -1,5 +0,0 @@
1
- /**
2
- * Copyright (c) 2018-Present, Nitrogen Labs, Inc.
3
- * Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
4
- */
5
- export type { AIConfig, Config, EsbuildConfig, JestConfig, LexConfigType, WebpackConfig } from './LexConfig.js';
@@ -1,9 +0,0 @@
1
- import { AIConfig } from '../LexConfig.js';
2
- export declare const callCursorAI: (prompt: string, options: AIConfig) => Promise<string>;
3
- export declare const callOpenAIAI: (prompt: string, options: AIConfig) => Promise<string>;
4
- export declare const callAnthropicAI: (prompt: string, options: AIConfig) => Promise<string>;
5
- export declare const callCopilotAI: (prompt: string, options: AIConfig) => Promise<string>;
6
- export declare const promptForAIProvider: (quiet?: boolean) => Promise<"cursor" | "copilot" | "openai" | "anthropic" | "none">;
7
- export declare const promptForAPIKey: (provider: string, quiet?: boolean) => Promise<string>;
8
- export declare const getAIService: (provider: string, options: AIConfig) => (prompt: string, options: AIConfig) => Promise<string>;
9
- export declare const callAIService: (prompt: string, quiet?: boolean) => Promise<string>;
@@ -1,41 +0,0 @@
1
- import type { LexConfigType } from '../LexConfig.js';
2
- export declare const cwd: string;
3
- export interface GetFilenamesProps {
4
- readonly callback?: (status: number) => void;
5
- readonly cliName?: string;
6
- readonly name?: string;
7
- readonly quiet?: boolean;
8
- readonly type?: string;
9
- readonly useTypescript?: boolean;
10
- }
11
- interface FilenamesResult {
12
- nameCaps: string;
13
- templateExt: string;
14
- templatePath: string;
15
- templateReact: string;
16
- }
17
- export declare const getFilenames: (props: GetFilenamesProps) => FilenamesResult | void;
18
- export interface Spinner {
19
- fail: (text?: string) => void;
20
- start: (text?: string) => void;
21
- succeed: (text?: string) => void;
22
- }
23
- export declare const createSpinner: (quiet?: boolean) => Spinner;
24
- export declare const copyFiles: (files: string[], typeName: string, spinner: any, config: LexConfigType) => Promise<void>;
25
- export declare const copyConfiguredFiles: (spinner: any, config: LexConfigType, quiet: boolean) => Promise<void>;
26
- export declare const copyFileSync: (source: string, target: string) => void;
27
- export declare const copyFolderRecursiveSync: (source: string, target: string) => void;
28
- export declare const getPackageJson: (packagePath?: string) => any;
29
- export declare const getFilesByExt: (ext: string, config: LexConfigType) => string[];
30
- export declare const removeConflictModules: (moduleList: object) => object;
31
- export declare const removeFiles: (fileName: string, isRelative?: boolean) => Promise<unknown>;
32
- export declare const removeModules: () => Promise<unknown>;
33
- export declare const setPackageJson: (json: any, packagePath?: string) => void;
34
- export interface LinkedModuleType {
35
- readonly name: string;
36
- readonly path: string;
37
- }
38
- export declare const linkedModules: (startPath?: string) => LinkedModuleType[];
39
- export declare const checkLinkedModules: () => void;
40
- export declare const updateTemplateName: (filePath: string, replace: string, replaceCaps: string) => void;
41
- export {};
@@ -1,3 +0,0 @@
1
- export declare const relativeFilePath: (filename: string, dirPath?: string, backUp?: number) => string;
2
- export declare const relativeNodePath: (filename: string, dirPath?: string, backUp?: number) => string;
3
- export declare const getNodePath: (moduleName: string) => string;
@@ -1 +0,0 @@
1
- export declare const log: (message: string, type?: string, quiet?: boolean) => void;
@@ -1,2 +0,0 @@
1
- import * as react from 'react';
2
- export { react };