@nlabs/lex 1.47.0 → 1.47.2
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/dist/LexConfig.d.ts +79 -0
- package/dist/LexConfig.js +13 -3
- package/dist/commands/ai/ai.d.ts +17 -0
- package/dist/commands/ai/ai.js +10 -10
- package/dist/commands/ai/index.d.ts +8 -0
- package/dist/commands/ai/index.js +1 -1
- package/dist/commands/build/build.cli.test.d.ts +5 -0
- package/dist/commands/build/build.d.ts +18 -0
- package/dist/commands/build/build.integration.test.d.ts +1 -0
- package/dist/commands/build/build.js +58 -8
- package/dist/commands/build/build.options.test.d.ts +5 -0
- package/dist/commands/clean/clean.cli.test.d.ts +1 -0
- package/dist/commands/clean/clean.d.ts +7 -0
- package/dist/commands/clean/clean.integration.test.d.ts +1 -0
- package/dist/commands/clean/clean.options.test.d.ts +1 -0
- package/dist/commands/compile/compile.cli.test.d.ts +1 -0
- package/dist/commands/compile/compile.d.ts +2 -0
- package/dist/commands/compile/compile.integration.test.d.ts +1 -0
- package/dist/commands/compile/compile.js +50 -6
- package/dist/commands/compile/compile.options.test.d.ts +1 -0
- package/dist/commands/config/config.cli.test.d.ts +1 -0
- package/dist/commands/config/config.d.ts +7 -0
- package/dist/commands/config/config.integration.test.d.ts +1 -0
- package/dist/commands/config/config.options.test.d.ts +1 -0
- package/dist/commands/copy/copy.cli.test.d.ts +1 -0
- package/dist/commands/copy/copy.d.ts +6 -0
- package/dist/commands/copy/copy.integration.test.d.ts +1 -0
- package/dist/commands/copy/copy.options.test.d.ts +1 -0
- package/dist/commands/create/create.cli.test.d.ts +1 -0
- package/dist/commands/create/create.d.ts +8 -0
- package/dist/commands/create/create.integration.test.d.ts +1 -0
- package/dist/commands/create/create.options.test.d.ts +1 -0
- package/dist/commands/dev/dev.cli.test.d.ts +1 -0
- package/dist/commands/dev/dev.d.ts +11 -0
- package/dist/commands/dev/dev.integration.test.d.ts +1 -0
- package/dist/commands/dev/dev.options.test.d.ts +1 -0
- package/dist/commands/init/init.cli.test.d.ts +1 -0
- package/dist/commands/init/init.d.ts +9 -0
- package/dist/commands/init/init.integration.test.d.ts +1 -0
- package/dist/commands/init/init.options.test.d.ts +1 -0
- package/dist/commands/link/link.cli.test.d.ts +1 -0
- package/dist/commands/link/link.d.ts +6 -0
- package/dist/commands/link/link.integration.test.d.ts +1 -0
- package/dist/commands/link/link.options.test.d.ts +1 -0
- package/dist/commands/lint/autofix.d.ts +2 -0
- package/dist/commands/lint/lint.cli.test.d.ts +1 -0
- package/dist/commands/lint/lint.d.ts +39 -0
- package/dist/commands/lint/lint.integration.test.d.ts +1 -0
- package/dist/commands/lint/lint.js +198 -34
- package/dist/commands/lint/lint.options.test.d.ts +1 -0
- package/dist/commands/migrate/migrate.cli.test.d.ts +1 -0
- package/dist/commands/migrate/migrate.d.ts +7 -0
- package/dist/commands/migrate/migrate.integration.test.d.ts +1 -0
- package/dist/commands/migrate/migrate.options.test.d.ts +1 -0
- package/dist/commands/publish/publish.cli.test.d.ts +1 -0
- package/dist/commands/publish/publish.d.ts +12 -0
- package/dist/commands/publish/publish.integration.test.d.ts +1 -0
- package/dist/commands/publish/publish.options.test.d.ts +1 -0
- package/dist/commands/test/test.cli.test.d.ts +1 -0
- package/dist/commands/test/test.d.ts +50 -0
- package/dist/commands/test/test.integration.test.d.ts +1 -0
- package/dist/commands/test/test.js +5 -5
- package/dist/commands/test/test.options.test.d.ts +1 -0
- package/dist/commands/test/test.test.d.ts +1 -0
- package/dist/commands/update/update.cli.test.d.ts +1 -0
- package/dist/commands/update/update.d.ts +9 -0
- package/dist/commands/update/update.integration.test.d.ts +1 -0
- package/dist/commands/update/update.js +92 -23
- package/dist/commands/update/update.options.test.d.ts +1 -0
- package/dist/commands/upgrade/upgrade.cli.test.d.ts +1 -0
- package/dist/commands/upgrade/upgrade.d.ts +7 -0
- package/dist/commands/upgrade/upgrade.integration.test.d.ts +1 -0
- package/dist/commands/upgrade/upgrade.options.test.d.ts +1 -0
- package/dist/commands/versions/versions.cli.test.d.ts +1 -0
- package/dist/commands/versions/versions.d.ts +13 -0
- package/dist/commands/versions/versions.integration.test.d.ts +1 -0
- package/dist/commands/versions/versions.options.test.d.ts +1 -0
- package/dist/create/changelog.d.ts +6 -0
- package/dist/index.d.ts +31 -0
- package/dist/lex.d.ts +2 -0
- package/dist/types.d.ts +5 -0
- package/dist/utils/aiService.d.ts +9 -0
- package/dist/utils/aiService.js +17 -8
- package/dist/utils/app.d.ts +41 -0
- package/dist/utils/app.js +51 -1
- package/dist/utils/file.d.ts +3 -0
- package/dist/utils/file.js +18 -3
- package/dist/utils/log.d.ts +1 -0
- package/dist/utils/reactShim.d.ts +2 -0
- package/eslint.config.js +1 -6
- package/jest.config.lex.js +22 -26
- package/package.json +22 -19
- package/resolver.cjs +125 -14
- /package/{dist/jest.config.lex.d.ts → jest.config.lex.d.ts} +0 -0
- /package/{dist/webpack.config.d.ts → webpack.config.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlabs/lex",
|
|
3
|
-
"version": "1.47.
|
|
3
|
+
"version": "1.47.2",
|
|
4
4
|
"description": "Lex",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -56,38 +56,41 @@
|
|
|
56
56
|
"watch": "NODE_ENV=development rm -rf dist && npm run compile -w"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@babel/core": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
59
|
+
"@babel/core": "^7.28.0",
|
|
60
|
+
"@babel/preset-env": "^7.28.0",
|
|
61
61
|
"@babel/preset-typescript": "7.27.1",
|
|
62
62
|
"@luckycatfactory/esbuild-graphql-loader": "^3.8.1",
|
|
63
63
|
"@nlabs/execa-mock": "*",
|
|
64
64
|
"@nlabs/webpack-plugin-static-site": "*",
|
|
65
|
-
"@tailwindcss/postcss": "4.1.
|
|
65
|
+
"@tailwindcss/postcss": "4.1.11",
|
|
66
66
|
"@testing-library/jest-dom": "^6.6.3",
|
|
67
67
|
"acorn": "^8.15.0",
|
|
68
68
|
"ajv": "^8.17.1",
|
|
69
69
|
"assert": "^2.1.0",
|
|
70
70
|
"autoprefixer": "^10.4.21",
|
|
71
|
-
"babel-jest": "^30.0.
|
|
71
|
+
"babel-jest": "^30.0.4",
|
|
72
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
72
73
|
"boxen": "8.0.1",
|
|
73
74
|
"buffer": "^6.0.3",
|
|
74
|
-
"caniuse-lite": "1.0.
|
|
75
|
+
"caniuse-lite": "1.0.30001727",
|
|
75
76
|
"chalk": "^5.4.1",
|
|
76
77
|
"commander": "^14.0.0",
|
|
77
78
|
"compare-versions": "^6.1.1",
|
|
78
79
|
"compression-webpack-plugin": "^11.1.0",
|
|
79
80
|
"config-webpack-plugin": "^1.1.0",
|
|
80
81
|
"copy-webpack-plugin": "^13.0.0",
|
|
81
|
-
"core-js": "^3.
|
|
82
|
+
"core-js": "^3.44.0",
|
|
82
83
|
"crypto-browserify": "^3.12.1",
|
|
83
84
|
"css-loader": "^7.1.2",
|
|
84
85
|
"cssnano": "^7.0.7",
|
|
85
|
-
"dotenv-webpack": "^8.1.
|
|
86
|
+
"dotenv-webpack": "^8.1.1",
|
|
86
87
|
"download-npm-package": "^3.1.12",
|
|
87
|
-
"esbuild": "0.25.
|
|
88
|
+
"esbuild": "0.25.6",
|
|
88
89
|
"esbuild-loader": "4.3.0",
|
|
89
|
-
"eslint": "9.
|
|
90
|
-
"eslint-
|
|
90
|
+
"eslint": "9.30.1",
|
|
91
|
+
"@typescript-eslint/eslint-plugin": "^8.36.0",
|
|
92
|
+
"@typescript-eslint/parser": "^8.36.0",
|
|
93
|
+
"eslint-config-styleguidejs": "^4.0.16",
|
|
91
94
|
"execa": "9.6.0",
|
|
92
95
|
"exports-loader": "^5.0.0",
|
|
93
96
|
"favicons-webpack-plugin": "^6.0.1",
|
|
@@ -100,10 +103,10 @@
|
|
|
100
103
|
"html-webpack-plugin": "^5.6.3",
|
|
101
104
|
"https-browserify": "^1.0.0",
|
|
102
105
|
"imports-loader": "^5.0.0",
|
|
103
|
-
"jest": "30.0.
|
|
104
|
-
"jest-circus": "30.0.
|
|
105
|
-
"jest-cli": "30.0.
|
|
106
|
-
"jest-environment-jsdom": "30.0.
|
|
106
|
+
"jest": "30.0.4",
|
|
107
|
+
"jest-circus": "30.0.4",
|
|
108
|
+
"jest-cli": "30.0.4",
|
|
109
|
+
"jest-environment-jsdom": "30.0.4",
|
|
107
110
|
"jest-transform-graphql": "2.1.0",
|
|
108
111
|
"json-d-ts": "1.0.1",
|
|
109
112
|
"latest-version": "9.0.0",
|
|
@@ -111,7 +114,7 @@
|
|
|
111
114
|
"luxon": "^3.6.1",
|
|
112
115
|
"net": "^1.0.2",
|
|
113
116
|
"npm-check-updates": "^18.0.1",
|
|
114
|
-
"openai": "^5.
|
|
117
|
+
"openai": "^5.8.3",
|
|
115
118
|
"ora": "8.2.0",
|
|
116
119
|
"os-browserify": "^0.3.0",
|
|
117
120
|
"path-browserify": "^1.0.1",
|
|
@@ -125,7 +128,7 @@
|
|
|
125
128
|
"postcss-loader": "^8.1.1",
|
|
126
129
|
"postcss-nesting": "^13.0.2",
|
|
127
130
|
"postcss-percentage": "^0.0.0",
|
|
128
|
-
"postcss-preset-env": "^10.2.
|
|
131
|
+
"postcss-preset-env": "^10.2.4",
|
|
129
132
|
"postcss-simple-vars": "^7.0.1",
|
|
130
133
|
"postcss-svgo": "7.0.2",
|
|
131
134
|
"postcss-url": "10.1.3",
|
|
@@ -162,12 +165,12 @@
|
|
|
162
165
|
"webpack-plugin-serve": "^1.6.0"
|
|
163
166
|
},
|
|
164
167
|
"devDependencies": {
|
|
165
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
168
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
166
169
|
"@babel/preset-react": "^7.27.1",
|
|
167
170
|
"@nlabs/execa-mock": "^1.41.0",
|
|
168
171
|
"@types/jest": "^30.0.0",
|
|
169
172
|
"@types/luxon": "^3.6.2",
|
|
170
|
-
"@types/node": "^24.0.
|
|
173
|
+
"@types/node": "^24.0.10",
|
|
171
174
|
"@types/ora": "^3.2.0",
|
|
172
175
|
"@types/react": "^19.1.8",
|
|
173
176
|
"@types/webpack": "^5.28.5",
|
package/resolver.cjs
CHANGED
|
@@ -6,6 +6,66 @@ const {existsSync} = require('fs');
|
|
|
6
6
|
const {extname: pathExtname, resolve: pathResolve} = require('path');
|
|
7
7
|
const resolveSync = require('resolve/sync');
|
|
8
8
|
|
|
9
|
+
// Simple fallback for Jest's internal module resolution
|
|
10
|
+
const resolveJestInternal = (moduleName) => {
|
|
11
|
+
// For Jest's internal requests, be more permissive
|
|
12
|
+
if (moduleName === 'index') {
|
|
13
|
+
// Jest might be looking for an index file in the current context
|
|
14
|
+
const possibleIndexFiles = [
|
|
15
|
+
pathResolve(process.cwd(), 'index.js'),
|
|
16
|
+
pathResolve(process.cwd(), 'index.ts'),
|
|
17
|
+
pathResolve(process.cwd(), 'index.cjs'),
|
|
18
|
+
pathResolve(__dirname, '../index.js'),
|
|
19
|
+
pathResolve(__dirname, '../index.ts'),
|
|
20
|
+
pathResolve(__dirname, '../index.cjs')
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
for (const indexFile of possibleIndexFiles) {
|
|
24
|
+
if (existsSync(indexFile)) {
|
|
25
|
+
return indexFile;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// For other bare module names, try Node.js resolution
|
|
31
|
+
try {
|
|
32
|
+
return require.resolve(moduleName);
|
|
33
|
+
} catch (e) {
|
|
34
|
+
// If that fails, try to find it in node_modules
|
|
35
|
+
const possiblePaths = [
|
|
36
|
+
pathResolve(process.cwd(), 'node_modules', moduleName),
|
|
37
|
+
pathResolve(__dirname, '../node_modules', moduleName),
|
|
38
|
+
pathResolve(__dirname, '../../node_modules', moduleName)
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
for (const possiblePath of possiblePaths) {
|
|
42
|
+
if (existsSync(possiblePath)) {
|
|
43
|
+
// Check for package.json to get the main entry point
|
|
44
|
+
const packageJsonPath = pathResolve(possiblePath, 'package.json');
|
|
45
|
+
if (existsSync(packageJsonPath)) {
|
|
46
|
+
try {
|
|
47
|
+
const packageJson = require(packageJsonPath);
|
|
48
|
+
const mainFile = packageJson.main || 'index.js';
|
|
49
|
+
const mainPath = pathResolve(possiblePath, mainFile);
|
|
50
|
+
if (existsSync(mainPath)) {
|
|
51
|
+
return mainPath;
|
|
52
|
+
}
|
|
53
|
+
} catch (e) {
|
|
54
|
+
// Continue to next path
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
// If no package.json or main file, try index.js
|
|
58
|
+
const indexPath = pathResolve(possiblePath, 'index.js');
|
|
59
|
+
if (existsSync(indexPath)) {
|
|
60
|
+
return indexPath;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return null;
|
|
67
|
+
};
|
|
68
|
+
|
|
9
69
|
const getFullPath = (basedir, name, extensions) => {
|
|
10
70
|
let fileName = name;
|
|
11
71
|
|
|
@@ -42,45 +102,96 @@ module.exports = (value, options) => {
|
|
|
42
102
|
}
|
|
43
103
|
|
|
44
104
|
const isSequencer = fileName.startsWith('jest-sequencer-');
|
|
45
|
-
|
|
46
105
|
if(isSequencer) {
|
|
47
106
|
fileName = fileName.replace('jest-sequencer-', '');
|
|
48
107
|
}
|
|
49
108
|
|
|
50
|
-
const {basedir, extensions = ['.js', '.ts']} = options;
|
|
109
|
+
const {basedir, extensions = ['.js', '.ts', '.tsx', '.cjs']} = options;
|
|
51
110
|
const existingExt = pathExtname(fileName) || '';
|
|
52
111
|
const hasExtension = existingExt !== '' && extensions.includes(existingExt);
|
|
53
112
|
const isAbsolute = fileName.indexOf('/') === 0;
|
|
54
113
|
|
|
114
|
+
// For Jest's internal modules and transformers, use lex node_modules
|
|
115
|
+
if (fileName.includes('babel-jest') ||
|
|
116
|
+
fileName.includes('ts-jest') ||
|
|
117
|
+
fileName.includes('jest-transform-graphql') ||
|
|
118
|
+
fileName.includes('core-js') ||
|
|
119
|
+
fileName.includes('regenerator-runtime') ||
|
|
120
|
+
fileName.includes('jest-circus') ||
|
|
121
|
+
fileName.includes('@jest/') ||
|
|
122
|
+
fileName.includes('jest-sequencer-')) {
|
|
123
|
+
try {
|
|
124
|
+
const result = resolveSync(fileName, {basedir: pathResolve(__dirname, '../'), extensions});
|
|
125
|
+
return result;
|
|
126
|
+
} catch(error) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// For internal node_modules imports (like core-js internal imports), use default resolution
|
|
132
|
+
if (basedir && basedir.includes('node_modules') && (fileName.startsWith('./') || fileName.startsWith('../'))) {
|
|
133
|
+
try {
|
|
134
|
+
const result = resolveSync(fileName, {basedir, extensions});
|
|
135
|
+
return result;
|
|
136
|
+
} catch(error) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
55
141
|
if(isAbsolute) {
|
|
56
142
|
if(hasExtension) {
|
|
57
|
-
|
|
143
|
+
const result = existsSync(fileName) ? fileName : null;
|
|
144
|
+
return result;
|
|
58
145
|
}
|
|
59
|
-
|
|
60
|
-
return
|
|
146
|
+
const result = pathResolve(fileName, 'index');
|
|
147
|
+
return result;
|
|
61
148
|
}
|
|
62
149
|
|
|
63
150
|
if(fileName === '..') {
|
|
64
|
-
|
|
151
|
+
const result = pathResolve(basedir, '..');
|
|
152
|
+
return result;
|
|
65
153
|
}
|
|
66
154
|
|
|
67
155
|
const hasBase = fileName.indexOf('./') >= 0 || fileName.indexOf('../') >= 0;
|
|
68
|
-
|
|
69
156
|
if(hasBase) {
|
|
70
157
|
if(hasExtension) {
|
|
71
|
-
|
|
158
|
+
const result = pathResolve(basedir, fileName);
|
|
159
|
+
return result;
|
|
72
160
|
}
|
|
73
161
|
|
|
74
|
-
|
|
162
|
+
// For relative paths without extension, try to resolve with extensions
|
|
163
|
+
try {
|
|
164
|
+
const result = resolveSync(fileName, {basedir, extensions});
|
|
165
|
+
return result;
|
|
166
|
+
} catch(error) {
|
|
167
|
+
// If resolveSync fails, try the old method
|
|
168
|
+
const result = pathResolve(basedir, fileName);
|
|
169
|
+
|
|
170
|
+
// Check if the result is a directory and append index.js if needed
|
|
171
|
+
if (existsSync(result) && !existsSync(result + '.js') && !existsSync(result + '.ts') && !existsSync(result + '.cjs')) {
|
|
172
|
+
const stats = require('fs').statSync(result);
|
|
173
|
+
if (stats.isDirectory()) {
|
|
174
|
+
const indexResult = pathResolve(result, 'index.js');
|
|
175
|
+
return indexResult;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
return result;
|
|
180
|
+
}
|
|
75
181
|
}
|
|
76
182
|
|
|
183
|
+
// For bare module names (like @nlabs/utils), try our custom resolution
|
|
77
184
|
try {
|
|
78
|
-
|
|
79
|
-
|
|
185
|
+
const result = resolveSync(fileName, {basedir: process.cwd(), extensions});
|
|
186
|
+
return result;
|
|
187
|
+
} catch(projectError) {
|
|
188
|
+
// If not found, try to resolve from the Lex package's directory
|
|
80
189
|
try {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
190
|
+
const result = resolveSync(fileName, {basedir: pathResolve(__dirname, '../'), extensions});
|
|
191
|
+
return result;
|
|
192
|
+
} catch(lexError) {
|
|
193
|
+
// If still not found, throw the original error
|
|
194
|
+
throw projectError;
|
|
84
195
|
}
|
|
85
196
|
}
|
|
86
197
|
};
|
|
File without changes
|
|
File without changes
|