@nlabs/lex 1.46.2 → 1.47.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.
- package/__mocks__/LexConfig.js +20 -0
- package/__mocks__/boxen.js +7 -0
- package/__mocks__/build.js +16 -0
- package/__mocks__/chalk.js +23 -0
- package/__mocks__/compile.js +8 -0
- package/__mocks__/execa.js +21 -0
- package/__mocks__/ora.js +17 -0
- package/__mocks__/versions.js +12 -0
- package/dist/LexConfig.d.ts +79 -0
- package/dist/LexConfig.js +83 -15
- package/dist/commands/ai/ai.d.ts +17 -0
- package/dist/commands/ai/ai.js +303 -0
- package/dist/commands/ai/index.d.ts +8 -0
- package/dist/commands/ai/index.js +7 -0
- 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 +400 -0
- 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.js +31 -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 +239 -0
- 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.js +43 -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.js +38 -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.js +124 -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.js +70 -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.js +93 -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.js +15 -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 +820 -0
- 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.js +37 -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.js +104 -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 +327 -0
- 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 +131 -0
- 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.js +47 -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.js +41 -0
- package/dist/commands/versions/versions.options.test.d.ts +1 -0
- package/dist/create/changelog.d.ts +6 -0
- package/dist/create/changelog.js +3 -3
- package/dist/index.d.ts +31 -0
- package/dist/index.js +35 -0
- package/dist/lex.d.ts +2 -0
- package/dist/lex.js +25 -22
- package/dist/types.d.ts +5 -0
- package/dist/types.js +1 -0
- package/dist/utils/aiService.d.ts +9 -0
- package/dist/utils/aiService.js +299 -0
- package/dist/utils/app.d.ts +41 -0
- package/dist/utils/app.js +53 -3
- 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/log.js +2 -1
- package/dist/utils/reactShim.d.ts +2 -0
- package/dist/utils/reactShim.js +3 -3
- package/eslint.config.js +5 -0
- package/index.cjs +20 -0
- package/jest.config.cjs +31 -27
- package/jest.config.lex.d.ts +2 -0
- package/jest.config.lex.js +86 -38
- package/jest.setup.js +5 -0
- package/lex.config.js +50 -0
- package/package.json +73 -53
- package/{.postcssrc.js → postcss.config.js} +21 -9
- package/resolver.cjs +125 -14
- package/tsconfig.json +2 -1
- package/webpack.config.d.ts +2 -0
- package/webpack.config.js +27 -11
- package/dist/commands/build.js +0 -265
- package/dist/commands/bulid.test.js +0 -317
- package/dist/commands/clean.js +0 -31
- package/dist/commands/clean.test.js +0 -63
- package/dist/commands/compile.js +0 -195
- package/dist/commands/compile.test.js +0 -93
- package/dist/commands/config.js +0 -43
- package/dist/commands/copy.js +0 -38
- package/dist/commands/create.js +0 -120
- package/dist/commands/dev.js +0 -70
- package/dist/commands/init.js +0 -93
- package/dist/commands/link.js +0 -15
- package/dist/commands/lint.js +0 -179
- package/dist/commands/migrate.js +0 -37
- package/dist/commands/publish.js +0 -104
- package/dist/commands/test.js +0 -190
- package/dist/commands/update.js +0 -64
- package/dist/commands/upgrade.js +0 -47
- package/dist/commands/versions.js +0 -41
- package/dist/commands/versions.test.js +0 -49
- package/dist/lint.js +0 -11
- package/jest.setup.ts +0 -3
package/eslint.config.js
ADDED
package/index.cjs
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommonJS entry point for @nlabs/lex
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// This file provides CommonJS compatibility for projects using require()
|
|
6
|
+
module.exports = {
|
|
7
|
+
// Export Config as both a type and a namespace with create method for backward compatibility
|
|
8
|
+
Config: {
|
|
9
|
+
create: (config) => config
|
|
10
|
+
},
|
|
11
|
+
// Export LexConfig class
|
|
12
|
+
LexConfig: require('./dist/LexConfig.js').LexConfig,
|
|
13
|
+
// Export utility functions
|
|
14
|
+
utils: {
|
|
15
|
+
aiService: require('./dist/utils/aiService.js'),
|
|
16
|
+
app: require('./dist/utils/app.js'),
|
|
17
|
+
file: require('./dist/utils/file.js'),
|
|
18
|
+
log: require('./dist/utils/log.js')
|
|
19
|
+
}
|
|
20
|
+
};
|
package/jest.config.cjs
CHANGED
|
@@ -2,38 +2,42 @@
|
|
|
2
2
|
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
|
|
3
3
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
6
|
-
const base = require("../../jest.config.base");
|
|
7
|
-
const pack = require("./package.json");
|
|
5
|
+
const pack = require('./package.json');
|
|
8
6
|
|
|
9
7
|
module.exports = {
|
|
10
|
-
...base,
|
|
11
|
-
collectCoverage: true,
|
|
12
|
-
coveragePathIgnorePatterns: [
|
|
13
|
-
"/node_modules/",
|
|
14
|
-
"(tests/.*.mock).(jsx?|tsx?)$",
|
|
15
|
-
],
|
|
16
|
-
coverageReporters: ["html", "text"],
|
|
17
|
-
coverageThreshold: {
|
|
18
|
-
global: {
|
|
19
|
-
branches: 80,
|
|
20
|
-
functions: 90,
|
|
21
|
-
lines: 80,
|
|
22
|
-
statements: 80,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
8
|
displayName: pack.name,
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
testEnvironment: 'node',
|
|
10
|
+
extensionsToTreatAsEsm: ['.ts'],
|
|
11
|
+
moduleFileExtensions: ['js', 'ts', 'tsx', 'json'],
|
|
28
12
|
moduleNameMapper: {
|
|
29
|
-
|
|
13
|
+
'^(\\.{1,2}/.*)\\.js$': '$1',
|
|
14
|
+
// Mock problematic ES modules
|
|
15
|
+
'^execa$': '<rootDir>/__mocks__/execa.js',
|
|
16
|
+
'^boxen$': '<rootDir>/__mocks__/boxen.js',
|
|
17
|
+
'^chalk$': '<rootDir>/__mocks__/chalk.js',
|
|
18
|
+
'^ora$': '<rootDir>/__mocks__/ora.js',
|
|
19
|
+
// Mock modules that use import.meta.url - use more specific patterns
|
|
20
|
+
'.*LexConfig.*': '<rootDir>/__mocks__/LexConfig.js',
|
|
21
|
+
'.*build\\.js$': '<rootDir>/__mocks__/build.js',
|
|
22
|
+
'.*versions\\.js$': '<rootDir>/__mocks__/versions.js',
|
|
23
|
+
'.*compile\\.js$': '<rootDir>/__mocks__/compile.js'
|
|
30
24
|
},
|
|
31
|
-
rootDir:
|
|
32
|
-
|
|
33
|
-
testMatch: ["<rootDir>/**/*.test.ts*"],
|
|
25
|
+
rootDir: './',
|
|
26
|
+
testMatch: ['<rootDir>/**/*.test.ts*'],
|
|
34
27
|
transform: {
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
'^.+\\.ts$|^.+\\.tsx$': ['ts-jest', {
|
|
29
|
+
useESM: true,
|
|
30
|
+
tsconfig: {
|
|
31
|
+
module: 'ESNext',
|
|
32
|
+
target: 'ESNext',
|
|
33
|
+
allowJs: true
|
|
34
|
+
}
|
|
35
|
+
}],
|
|
36
|
+
'\\.(gql|graphql)$': 'jest-transform-graphql'
|
|
37
37
|
},
|
|
38
|
-
|
|
38
|
+
// Disable coverage temporarily to avoid import.meta issues
|
|
39
|
+
collectCoverage: false,
|
|
40
|
+
// Transform all node_modules to handle ES modules
|
|
41
|
+
transformIgnorePatterns: [],
|
|
42
|
+
setupFilesAfterEnv: ['../../jest.setup.js']
|
|
39
43
|
};
|
package/jest.config.lex.js
CHANGED
|
@@ -1,70 +1,118 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import {existsSync} from 'fs';
|
|
2
|
+
import {resolve as pathResolve} from 'path';
|
|
3
|
+
import {URL} from 'url';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {getNodePath} from './dist/utils/file.js';
|
|
6
6
|
|
|
7
7
|
const rootDir = process.cwd();
|
|
8
8
|
const { jest, sourceFullPath, targetEnvironment, useTypescript } = JSON.parse(
|
|
9
|
-
process.env.LEX_CONFIG ||
|
|
9
|
+
process.env.LEX_CONFIG || '{}'
|
|
10
10
|
);
|
|
11
11
|
|
|
12
|
-
const dirName = new URL(
|
|
13
|
-
const nodePath = pathResolve(dirName,
|
|
12
|
+
const dirName = new URL('.', import.meta.url).pathname;
|
|
13
|
+
const nodePath = pathResolve(dirName, './node_modules');
|
|
14
|
+
const lexSetupFile = pathResolve(dirName, './jest.setup.js');
|
|
15
|
+
const projectSetupFile = pathResolve(rootDir, './jest.setup.js');
|
|
16
|
+
const setupFilesAfterEnv = [];
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
setupFilesAfterEnv.push(lexSetupFile);
|
|
19
|
+
|
|
20
|
+
if(existsSync(projectSetupFile)) {
|
|
21
|
+
setupFilesAfterEnv.push(projectSetupFile);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let testEnvironment = 'node';
|
|
16
25
|
let testEnvironmentOptions = {};
|
|
17
26
|
|
|
18
|
-
if
|
|
19
|
-
testEnvironment =
|
|
27
|
+
if(targetEnvironment === 'web') {
|
|
28
|
+
testEnvironment = 'jsdom';
|
|
20
29
|
testEnvironmentOptions = {
|
|
21
|
-
url:
|
|
30
|
+
url: 'http://localhost'
|
|
22
31
|
};
|
|
23
32
|
}
|
|
24
33
|
|
|
25
|
-
let moduleFileExtensions = [
|
|
26
|
-
let testRegex =
|
|
27
|
-
let transformIgnorePatterns = [
|
|
34
|
+
let moduleFileExtensions = ['js', 'json', 'cjs', 'mjs'];
|
|
35
|
+
let testRegex = '(/__tests__/.*|\\.(test|spec|integration))\\.(js)?$';
|
|
36
|
+
let transformIgnorePatterns = [];
|
|
28
37
|
|
|
29
|
-
if
|
|
30
|
-
moduleFileExtensions = [
|
|
31
|
-
testRegex =
|
|
32
|
-
transformIgnorePatterns = [
|
|
38
|
+
if(useTypescript) {
|
|
39
|
+
moduleFileExtensions = ['js', 'ts', 'tsx', 'json', 'cjs', 'mjs'];
|
|
40
|
+
testRegex = '(/__tests__/.*|\\.(test|spec|integration))\\.(ts|tsx)?$';
|
|
41
|
+
transformIgnorePatterns = [];
|
|
33
42
|
}
|
|
34
43
|
|
|
35
|
-
|
|
44
|
+
const baseConfig = {
|
|
36
45
|
collectCoverage: true,
|
|
37
|
-
coverageDirectory:
|
|
46
|
+
coverageDirectory: '<rootDir>/coverage',
|
|
38
47
|
coveragePathIgnorePatterns: [
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
48
|
+
'/node_modules/',
|
|
49
|
+
'/dist',
|
|
50
|
+
'/lib',
|
|
51
|
+
'__snapshots__',
|
|
52
|
+
'.d.ts'
|
|
44
53
|
],
|
|
45
|
-
coverageReporters: [
|
|
46
|
-
|
|
54
|
+
coverageReporters: ['html', 'text'],
|
|
55
|
+
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
|
56
|
+
moduleDirectories: ['node_modules', nodePath],
|
|
47
57
|
moduleFileExtensions,
|
|
48
58
|
moduleNameMapper: {
|
|
49
|
-
|
|
59
|
+
'^chalk$': getNodePath('chalk/source/index.js'),
|
|
60
|
+
'^#ansi-styles$': getNodePath('chalk/node_modules/ansi-styles/index.js'),
|
|
61
|
+
'^#supports-color$': getNodePath('chalk/node_modules/supports-color/index.js'),
|
|
62
|
+
'\\.(css|jpg|png|svg|txt)$': pathResolve(dirName, './emptyModule')
|
|
50
63
|
},
|
|
51
64
|
modulePaths: [rootDir, `${rootDir}/node_modules`, nodePath, sourceFullPath],
|
|
52
|
-
resolver: pathResolve(dirName,
|
|
65
|
+
resolver: pathResolve(dirName, './resolver.cjs'),
|
|
53
66
|
rootDir,
|
|
54
67
|
setupFiles: [
|
|
55
|
-
getNodePath(
|
|
56
|
-
getNodePath(
|
|
68
|
+
getNodePath('core-js'),
|
|
69
|
+
getNodePath('regenerator-runtime/runtime.js')
|
|
57
70
|
],
|
|
71
|
+
setupFilesAfterEnv,
|
|
58
72
|
testEnvironment,
|
|
59
73
|
testEnvironmentOptions,
|
|
60
|
-
testPathIgnorePatterns: [
|
|
74
|
+
testPathIgnorePatterns: ['/node_modules/', `${nodePath}/`],
|
|
61
75
|
testRegex,
|
|
62
|
-
testRunner: getNodePath("jest-circus/runner.js"),
|
|
63
76
|
transform: {
|
|
64
|
-
...
|
|
65
|
-
|
|
77
|
+
...(useTypescript ? {
|
|
78
|
+
'\\.tsx?$': [getNodePath('ts-jest/dist/index.js'), {
|
|
79
|
+
useESM: true,
|
|
80
|
+
tsconfig: {
|
|
81
|
+
useDefineForClassFields: true,
|
|
82
|
+
esModuleInterop: true,
|
|
83
|
+
allowSyntheticDefaultImports: true
|
|
84
|
+
}
|
|
85
|
+
}]
|
|
86
|
+
} : {
|
|
87
|
+
'\\.[jt]sx?$': getNodePath('babel-jest')
|
|
88
|
+
}),
|
|
89
|
+
'\\.(gql|graphql)$': getNodePath('jest-transform-graphql'),
|
|
90
|
+
'\\.mjs$': [getNodePath('ts-jest/dist/index.js'), {
|
|
91
|
+
useESM: true
|
|
92
|
+
}],
|
|
93
|
+
'\\.cjs$': getNodePath('babel-jest')
|
|
66
94
|
},
|
|
67
|
-
transformIgnorePatterns
|
|
68
|
-
|
|
69
|
-
|
|
95
|
+
transformIgnorePatterns: [
|
|
96
|
+
'node_modules/(?!(chalk|@testing-library/jest-dom|zod|@nlabs)/)'
|
|
97
|
+
],
|
|
98
|
+
verbose: true
|
|
70
99
|
};
|
|
100
|
+
|
|
101
|
+
const deepMerge = (target, source) => {
|
|
102
|
+
if(!source) return target;
|
|
103
|
+
const output = { ...target };
|
|
104
|
+
|
|
105
|
+
Object.keys(source).forEach(key => {
|
|
106
|
+
if(source[key] instanceof Object && key in target && target[key] instanceof Object && !Array.isArray(source[key]) && !Array.isArray(target[key])) {
|
|
107
|
+
output[key] = {...target[key], ...source[key]};
|
|
108
|
+
} else if(Array.isArray(source[key]) && Array.isArray(target[key])) {
|
|
109
|
+
output[key] = [...target[key], ...source[key]];
|
|
110
|
+
} else {
|
|
111
|
+
output[key] = source[key];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
return output;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export default deepMerge(baseConfig, jest);
|
package/jest.setup.js
ADDED
package/lex.config.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lex configuration file
|
|
3
|
+
* This file contains configuration options for the Lex CLI tool
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
// Source and output paths
|
|
8
|
+
sourcePath: './src',
|
|
9
|
+
outputPath: './dist',
|
|
10
|
+
|
|
11
|
+
// Project settings
|
|
12
|
+
useTypescript: true,
|
|
13
|
+
targetEnvironment: 'web',
|
|
14
|
+
preset: 'web',
|
|
15
|
+
|
|
16
|
+
// AI configuration
|
|
17
|
+
// Use this section to configure AI features for lint --fix and ai commands
|
|
18
|
+
ai: {
|
|
19
|
+
// Available providers: 'cursor', 'copilot', 'openai', 'anthropic', 'none'
|
|
20
|
+
provider: 'cursor',
|
|
21
|
+
|
|
22
|
+
// API key for external providers (recommended to use environment variables)
|
|
23
|
+
// apiKey: process.env.OPENAI_API_KEY,
|
|
24
|
+
|
|
25
|
+
// Model configuration (specific to each provider)
|
|
26
|
+
model: 'cursor-code', // For Cursor IDE
|
|
27
|
+
// model: 'copilot-codex', // For GitHub Copilot
|
|
28
|
+
// model: 'gpt-4o', // For OpenAI
|
|
29
|
+
// model: 'claude-3-sonnet', // For Anthropic
|
|
30
|
+
|
|
31
|
+
// Optional parameters
|
|
32
|
+
maxTokens: 4000,
|
|
33
|
+
temperature: 0.1
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
// Build configuration
|
|
37
|
+
esbuild: {
|
|
38
|
+
entryPoints: ['src/index.ts'],
|
|
39
|
+
outdir: 'dist',
|
|
40
|
+
platform: 'node',
|
|
41
|
+
target: 'es2020',
|
|
42
|
+
format: 'esm'
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
// Test configuration
|
|
46
|
+
jest: {
|
|
47
|
+
roots: ['<rootDir>/src'],
|
|
48
|
+
testEnvironment: 'node'
|
|
49
|
+
}
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nlabs/lex",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.47.1",
|
|
4
4
|
"description": "Lex",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"bin": "./dist/lex.js",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"require": "./index.cjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
8
16
|
"keywords": [
|
|
9
17
|
"arkhamjs",
|
|
10
18
|
"lex",
|
|
@@ -28,11 +36,16 @@
|
|
|
28
36
|
"node": ">=22"
|
|
29
37
|
},
|
|
30
38
|
"scripts": {
|
|
31
|
-
"build": "NODE_ENV=production && rm -rf dist && esbuild
|
|
39
|
+
"build": "NODE_ENV=production && rm -rf dist && esbuild $(find src -name '*.ts' -not -name '*.test.ts' -not -name '*.spec.ts') --platform=node --outdir=./dist --sourcemap=inline --target=node22 --format=esm --packages=external && npm run declarations",
|
|
40
|
+
"build:all": "npm run build && npm run build:ai",
|
|
41
|
+
"build:ai": "NODE_ENV=production && esbuild packages/lex/src/commands/ai/*.ts --platform=node --outdir=./dist/commands/ai --sourcemap=inline --target=node22 --format=esm --packages=external",
|
|
42
|
+
"declarations": "tsc --declaration --emitDeclarationOnly --outDir dist",
|
|
32
43
|
"clean": "rm -rf dist node_modules package-lock.json *.log coverage",
|
|
33
44
|
"compile": "tsc -p tsconfig.build.json",
|
|
34
45
|
"env": "LEX_CONFIG='{\"useTypescript\":true}'",
|
|
35
|
-
"lint": "eslint ./src --
|
|
46
|
+
"lint": "eslint ./src --fix || true",
|
|
47
|
+
"lint:ai": "node ./dist/lex.js lint --fix || true",
|
|
48
|
+
"lint:rebuild": "npm run build && npm run lint:ai",
|
|
36
49
|
"prepublishOnly": "npm run build",
|
|
37
50
|
"publish:major": "npm version major && npm publish",
|
|
38
51
|
"publish:minor": "npm version minor && npm publish",
|
|
@@ -43,99 +56,108 @@
|
|
|
43
56
|
"watch": "NODE_ENV=development rm -rf dist && npm run compile -w"
|
|
44
57
|
},
|
|
45
58
|
"dependencies": {
|
|
46
|
-
"@babel/core": "^7.
|
|
47
|
-
"@babel/preset-env": "^7.
|
|
48
|
-
"@babel/preset-typescript": "7.
|
|
59
|
+
"@babel/core": "^7.28.0",
|
|
60
|
+
"@babel/preset-env": "^7.28.0",
|
|
61
|
+
"@babel/preset-typescript": "7.27.1",
|
|
49
62
|
"@luckycatfactory/esbuild-graphql-loader": "^3.8.1",
|
|
50
63
|
"@nlabs/execa-mock": "*",
|
|
51
64
|
"@nlabs/webpack-plugin-static-site": "*",
|
|
52
|
-
"
|
|
65
|
+
"@tailwindcss/postcss": "4.1.11",
|
|
66
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
67
|
+
"acorn": "^8.15.0",
|
|
53
68
|
"ajv": "^8.17.1",
|
|
54
69
|
"assert": "^2.1.0",
|
|
55
|
-
"autoprefixer": "^10.4.
|
|
56
|
-
"babel-jest": "^
|
|
70
|
+
"autoprefixer": "^10.4.21",
|
|
71
|
+
"babel-jest": "^30.0.4",
|
|
72
|
+
"babel-plugin-module-resolver": "^5.0.2",
|
|
57
73
|
"boxen": "8.0.1",
|
|
58
74
|
"buffer": "^6.0.3",
|
|
59
|
-
"caniuse-lite": "1.0.
|
|
75
|
+
"caniuse-lite": "1.0.30001727",
|
|
60
76
|
"chalk": "^5.4.1",
|
|
61
|
-
"commander": "^
|
|
77
|
+
"commander": "^14.0.0",
|
|
62
78
|
"compare-versions": "^6.1.1",
|
|
63
79
|
"compression-webpack-plugin": "^11.1.0",
|
|
64
80
|
"config-webpack-plugin": "^1.1.0",
|
|
65
|
-
"copy-webpack-plugin": "^
|
|
66
|
-
"core-js": "^3.
|
|
81
|
+
"copy-webpack-plugin": "^13.0.0",
|
|
82
|
+
"core-js": "^3.44.0",
|
|
67
83
|
"crypto-browserify": "^3.12.1",
|
|
68
84
|
"css-loader": "^7.1.2",
|
|
69
|
-
"cssnano": "^7.0.
|
|
70
|
-
"dotenv-webpack": "^8.1.
|
|
71
|
-
"download-npm-package": "^1.
|
|
72
|
-
"esbuild": "0.
|
|
73
|
-
"esbuild-loader": "4.
|
|
74
|
-
"eslint": "
|
|
75
|
-
"eslint-
|
|
76
|
-
"
|
|
85
|
+
"cssnano": "^7.0.7",
|
|
86
|
+
"dotenv-webpack": "^8.1.1",
|
|
87
|
+
"download-npm-package": "^3.1.12",
|
|
88
|
+
"esbuild": "0.25.6",
|
|
89
|
+
"esbuild-loader": "4.3.0",
|
|
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.15",
|
|
94
|
+
"execa": "9.6.0",
|
|
77
95
|
"exports-loader": "^5.0.0",
|
|
78
96
|
"favicons-webpack-plugin": "^6.0.1",
|
|
79
97
|
"file-loader": "^6.2.0",
|
|
80
98
|
"find-file-up": "^2.0.1",
|
|
81
|
-
"glob": "^11.0.
|
|
82
|
-
"graphql": "^16.
|
|
99
|
+
"glob": "^11.0.3",
|
|
100
|
+
"graphql": "^16.11.0",
|
|
83
101
|
"graphql-tag": "^2.12.6",
|
|
84
102
|
"html-loader": "^5.1.0",
|
|
85
103
|
"html-webpack-plugin": "^5.6.3",
|
|
86
104
|
"https-browserify": "^1.0.0",
|
|
87
105
|
"imports-loader": "^5.0.0",
|
|
88
|
-
"jest": "
|
|
89
|
-
"jest-circus": "
|
|
90
|
-
"jest-cli": "
|
|
91
|
-
"jest-environment-jsdom": "
|
|
106
|
+
"jest": "30.0.4",
|
|
107
|
+
"jest-circus": "30.0.4",
|
|
108
|
+
"jest-cli": "30.0.4",
|
|
109
|
+
"jest-environment-jsdom": "30.0.4",
|
|
92
110
|
"jest-transform-graphql": "2.1.0",
|
|
93
111
|
"json-d-ts": "1.0.1",
|
|
94
112
|
"latest-version": "9.0.0",
|
|
95
113
|
"lodash": "^4.17.21",
|
|
96
|
-
"luxon": "^3.
|
|
114
|
+
"luxon": "^3.6.1",
|
|
97
115
|
"net": "^1.0.2",
|
|
98
|
-
"npm-check-updates": "^
|
|
116
|
+
"npm-check-updates": "^18.0.1",
|
|
117
|
+
"openai": "^5.8.3",
|
|
99
118
|
"ora": "8.2.0",
|
|
100
119
|
"os-browserify": "^0.3.0",
|
|
101
120
|
"path-browserify": "^1.0.1",
|
|
102
121
|
"postcss-browser-reporter": "^0.7.0",
|
|
103
|
-
"postcss-cli": "^11.0.
|
|
104
|
-
"postcss-custom-properties": "^14.0.
|
|
122
|
+
"postcss-cli": "^11.0.1",
|
|
123
|
+
"postcss-custom-properties": "^14.0.6",
|
|
105
124
|
"postcss-flexbugs-fixes": "^5.0.2",
|
|
106
125
|
"postcss-for": "^2.1.1",
|
|
107
126
|
"postcss-hash": "^3.0.0",
|
|
108
|
-
"postcss-import": "16.1.
|
|
127
|
+
"postcss-import": "16.1.1",
|
|
109
128
|
"postcss-loader": "^8.1.1",
|
|
110
|
-
"postcss-nesting": "^13.0.
|
|
129
|
+
"postcss-nesting": "^13.0.2",
|
|
111
130
|
"postcss-percentage": "^0.0.0",
|
|
112
|
-
"postcss-preset-env": "^10.
|
|
131
|
+
"postcss-preset-env": "^10.2.4",
|
|
113
132
|
"postcss-simple-vars": "^7.0.1",
|
|
114
|
-
"postcss-svgo": "7.0.
|
|
133
|
+
"postcss-svgo": "7.0.2",
|
|
115
134
|
"postcss-url": "10.1.3",
|
|
116
135
|
"process": "^0.11.10",
|
|
117
|
-
"react": "^19.
|
|
118
|
-
"react-dom": "^19.
|
|
136
|
+
"react": "^19.1.0",
|
|
137
|
+
"react-dom": "^19.1.0",
|
|
119
138
|
"regenerator-runtime": "^0.14.1",
|
|
120
139
|
"resolve": "^1.22.10",
|
|
121
140
|
"rimraf": "^6.0.1",
|
|
122
|
-
"semver": "^7.7.
|
|
141
|
+
"semver": "^7.7.2",
|
|
123
142
|
"source-map-loader": "^5.0.0",
|
|
124
143
|
"source-map-support": "^0.5.21",
|
|
125
144
|
"speed-measure-webpack-plugin": "^1.5.0",
|
|
126
|
-
"static-site-generator-webpack-plugin": "^3.
|
|
145
|
+
"static-site-generator-webpack-plugin": "^3.4.2",
|
|
127
146
|
"stream-browserify": "^3.0.0",
|
|
128
147
|
"stream-http": "^3.2.0",
|
|
129
148
|
"style-loader": "^4.0.0",
|
|
130
149
|
"svg-spritemap-webpack-plugin": "^4.7.0",
|
|
131
|
-
"svgo": "
|
|
150
|
+
"svgo": "4.0.0",
|
|
132
151
|
"tls": "^0.0.1",
|
|
133
|
-
"ts-jest": "29.
|
|
152
|
+
"ts-jest": "29.4.0",
|
|
134
153
|
"ts-node": "^10.9.2",
|
|
135
|
-
"
|
|
154
|
+
"tsconfig-paths-webpack-plugin": "^4.2.0",
|
|
155
|
+
"typescript": "5.8.3",
|
|
156
|
+
"unicorn-magic": "^0.3.0",
|
|
136
157
|
"url-loader": "^4.1.1",
|
|
137
158
|
"util": "^0.12.5",
|
|
138
|
-
"
|
|
159
|
+
"vm-browserify": "^1.1.2",
|
|
160
|
+
"webpack": "5.99.9",
|
|
139
161
|
"webpack-bundle-analyzer": "^4.10.2",
|
|
140
162
|
"webpack-cli": "^6.0.1",
|
|
141
163
|
"webpack-merge": "^6.0.1",
|
|
@@ -143,19 +165,17 @@
|
|
|
143
165
|
"webpack-plugin-serve": "^1.6.0"
|
|
144
166
|
},
|
|
145
167
|
"devDependencies": {
|
|
146
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
147
|
-
"@babel/preset-react": "^7.
|
|
168
|
+
"@babel/plugin-transform-runtime": "^7.28.0",
|
|
169
|
+
"@babel/preset-react": "^7.27.1",
|
|
148
170
|
"@nlabs/execa-mock": "^1.41.0",
|
|
149
|
-
"@types/jest": "^
|
|
150
|
-
"@types/luxon": "^3.
|
|
151
|
-
"@types/node": "^
|
|
171
|
+
"@types/jest": "^30.0.0",
|
|
172
|
+
"@types/luxon": "^3.6.2",
|
|
173
|
+
"@types/node": "^24.0.10",
|
|
152
174
|
"@types/ora": "^3.2.0",
|
|
153
|
-
"@types/react": "^19.
|
|
175
|
+
"@types/react": "^19.1.8",
|
|
154
176
|
"@types/webpack": "^5.28.5",
|
|
155
|
-
"babel-plugin-transform-import-meta": "^2.3.
|
|
156
|
-
"babel-plugin-transform-vite-meta-env": "^1.0.3"
|
|
157
|
-
"eslint": "^9.19.0",
|
|
158
|
-
"eslint-config-styleguidejs": "^3.2.1"
|
|
177
|
+
"babel-plugin-transform-import-meta": "^2.3.3",
|
|
178
|
+
"babel-plugin-transform-vite-meta-env": "^1.0.3"
|
|
159
179
|
},
|
|
160
180
|
"gitHead": "0f5fb22fc0f0ab1abab5adf62afed24c7c87e4a8"
|
|
161
181
|
}
|
|
@@ -2,24 +2,29 @@
|
|
|
2
2
|
* Copyright (c) 2018-Present, Nitrogen Labs, Inc.
|
|
3
3
|
* Copyrights licensed under the MIT License. See the accompanying LICENSE file for terms.
|
|
4
4
|
*/
|
|
5
|
+
import tailwindcss from '@tailwindcss/postcss';
|
|
5
6
|
import autoprefixer from 'autoprefixer';
|
|
6
7
|
import cssnano from 'cssnano';
|
|
7
8
|
import postcssBrowserReporter from 'postcss-browser-reporter';
|
|
8
9
|
import postcssCustomProperties from 'postcss-custom-properties';
|
|
9
10
|
import postcssFlexbugsFixes from 'postcss-flexbugs-fixes';
|
|
10
11
|
import postcssFor from 'postcss-for';
|
|
12
|
+
import postcssHash from 'postcss-hash';
|
|
11
13
|
import postcssImport from 'postcss-import';
|
|
12
14
|
import postcssNesting from 'postcss-nesting';
|
|
13
15
|
import postcssPercentage from 'postcss-percentage';
|
|
14
16
|
import postcssPresetEnv from 'postcss-preset-env';
|
|
17
|
+
import postcssSimpleVars from 'postcss-simple-vars';
|
|
18
|
+
import postcssSvgo from 'postcss-svgo';
|
|
15
19
|
import postcssUrl from 'postcss-url';
|
|
16
|
-
import {
|
|
20
|
+
import {default as webpack} from 'webpack';
|
|
17
21
|
|
|
18
22
|
const config = {
|
|
19
23
|
plugins: [
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
tailwindcss(),
|
|
25
|
+
postcssImport({addDependencyTo: webpack}),
|
|
26
|
+
postcssUrl(),
|
|
27
|
+
postcssFor(),
|
|
23
28
|
postcssPercentage({
|
|
24
29
|
floor: true,
|
|
25
30
|
precision: 9,
|
|
@@ -30,16 +35,23 @@ const config = {
|
|
|
30
35
|
strict: false,
|
|
31
36
|
warnings: false
|
|
32
37
|
}),
|
|
33
|
-
autoprefixer,
|
|
34
|
-
postcssNesting,
|
|
35
|
-
postcssFlexbugsFixes,
|
|
38
|
+
autoprefixer(),
|
|
39
|
+
postcssNesting(),
|
|
40
|
+
postcssFlexbugsFixes(),
|
|
36
41
|
postcssPresetEnv({
|
|
37
42
|
browsers: ['last 5 versions'],
|
|
38
43
|
stage: 0
|
|
39
44
|
}),
|
|
40
45
|
cssnano({autoprefixer: false}),
|
|
41
|
-
postcssBrowserReporter
|
|
46
|
+
postcssBrowserReporter(),
|
|
47
|
+
postcssSimpleVars(),
|
|
48
|
+
postcssSvgo()
|
|
49
|
+
// postcssHash({
|
|
50
|
+
// algorithm: 'md5',
|
|
51
|
+
// trim: 10,
|
|
52
|
+
// manifest: './build/manifest.json'
|
|
53
|
+
// })
|
|
42
54
|
]
|
|
43
|
-
}
|
|
55
|
+
};
|
|
44
56
|
|
|
45
57
|
export default config;
|