@nlabs/lex 1.46.1 → 1.47.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 (72) hide show
  1. package/__mocks__/LexConfig.js +20 -0
  2. package/__mocks__/boxen.js +7 -0
  3. package/__mocks__/build.js +16 -0
  4. package/__mocks__/chalk.js +23 -0
  5. package/__mocks__/compile.js +8 -0
  6. package/__mocks__/execa.js +21 -0
  7. package/__mocks__/ora.js +17 -0
  8. package/__mocks__/versions.js +12 -0
  9. package/dist/LexConfig.js +72 -14
  10. package/dist/commands/ai/ai.js +303 -0
  11. package/dist/commands/ai/index.js +7 -0
  12. package/dist/commands/build/build.js +350 -0
  13. package/dist/commands/clean/clean.js +31 -0
  14. package/dist/commands/compile/compile.js +195 -0
  15. package/dist/commands/config/config.js +43 -0
  16. package/dist/commands/copy/copy.js +38 -0
  17. package/dist/commands/create/create.js +124 -0
  18. package/dist/commands/dev/dev.js +70 -0
  19. package/dist/commands/init/init.js +93 -0
  20. package/dist/commands/link/link.js +15 -0
  21. package/dist/commands/lint/lint.js +656 -0
  22. package/dist/commands/migrate/migrate.js +37 -0
  23. package/dist/commands/publish/publish.js +104 -0
  24. package/dist/commands/test/test.js +327 -0
  25. package/dist/commands/update/update.js +62 -0
  26. package/dist/commands/upgrade/upgrade.js +47 -0
  27. package/dist/commands/versions/versions.js +41 -0
  28. package/dist/create/changelog.js +3 -3
  29. package/dist/index.js +35 -0
  30. package/dist/jest.config.lex.d.ts +2 -0
  31. package/dist/lex.js +25 -22
  32. package/dist/types.js +1 -0
  33. package/dist/utils/aiService.js +290 -0
  34. package/dist/utils/app.js +4 -4
  35. package/dist/utils/file.js +1 -1
  36. package/dist/utils/log.js +2 -1
  37. package/dist/utils/reactShim.js +3 -3
  38. package/dist/webpack.config.d.ts +2 -0
  39. package/eslint.config.js +10 -0
  40. package/index.cjs +20 -0
  41. package/jest.config.cjs +31 -27
  42. package/jest.config.lex.js +90 -38
  43. package/jest.setup.js +5 -0
  44. package/lex.config.js +50 -0
  45. package/package.json +70 -50
  46. package/{.postcssrc.js → postcss.config.js} +21 -9
  47. package/tsconfig.build.json +7 -16
  48. package/tsconfig.json +2 -1
  49. package/webpack.config.js +136 -77
  50. package/.eslintrc +0 -45
  51. package/dist/commands/build.js +0 -265
  52. package/dist/commands/bulid.test.js +0 -317
  53. package/dist/commands/clean.js +0 -31
  54. package/dist/commands/clean.test.js +0 -63
  55. package/dist/commands/compile.js +0 -195
  56. package/dist/commands/compile.test.js +0 -93
  57. package/dist/commands/config.js +0 -43
  58. package/dist/commands/copy.js +0 -38
  59. package/dist/commands/create.js +0 -116
  60. package/dist/commands/dev.js +0 -70
  61. package/dist/commands/init.js +0 -93
  62. package/dist/commands/link.js +0 -15
  63. package/dist/commands/lint.js +0 -179
  64. package/dist/commands/migrate.js +0 -37
  65. package/dist/commands/publish.js +0 -104
  66. package/dist/commands/test.js +0 -190
  67. package/dist/commands/update.js +0 -64
  68. package/dist/commands/upgrade.js +0 -47
  69. package/dist/commands/versions.js +0 -41
  70. package/dist/commands/versions.test.js +0 -49
  71. package/dist/lint.js +0 -11
  72. package/jest.setup.ts +0 -3
@@ -1,70 +1,122 @@
1
- import { createDefaultPreset } from "ts-jest";
2
- import { resolve as pathResolve } from "path";
3
- import { URL } from "url";
1
+ import { existsSync } from 'fs';
2
+ import { resolve as pathResolve } from 'path';
3
+ import { URL } from 'url';
4
4
 
5
- import { getNodePath } from "./dist/utils/file.js";
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(".", import.meta.url).pathname;
13
- const nodePath = pathResolve(dirName, "./node_modules");
12
+ const dirName = new URL('.', import.meta.url).pathname;
13
+ const nodePath = pathResolve(dirName, './node_modules');
14
14
 
15
- let testEnvironment = "node";
15
+ // Check if setup files exist
16
+ const lexSetupFile = pathResolve(dirName, './jest.setup.js');
17
+ const projectSetupFile = pathResolve(rootDir, './jest.setup.js');
18
+ const setupFilesAfterEnv = [];
19
+
20
+ // Add Lex's setup file if it exists
21
+ if(existsSync(lexSetupFile)) {
22
+ setupFilesAfterEnv.push(lexSetupFile);
23
+ }
24
+
25
+ // Add project's setup file if it exists
26
+ if(existsSync(projectSetupFile)) {
27
+ setupFilesAfterEnv.push(projectSetupFile);
28
+ }
29
+
30
+ let testEnvironment = 'node';
16
31
  let testEnvironmentOptions = {};
17
32
 
18
- if (targetEnvironment === "web") {
19
- testEnvironment = "jsdom";
33
+ if(targetEnvironment === 'web') {
34
+ testEnvironment = 'jsdom';
20
35
  testEnvironmentOptions = {
21
- url: "http://localhost",
36
+ url: 'http://localhost'
22
37
  };
23
38
  }
24
39
 
25
- let moduleFileExtensions = ["js", "json"];
26
- let testRegex = "(/__tests__/.*|\\.(test|spec))\\.(js)?$";
27
- let transformIgnorePatterns = ["[/\\\\]node_modules[/\\\\].+\\.(js)$"];
40
+ let moduleFileExtensions = ['js', 'json'];
41
+ let testRegex = '(/__tests__/.*|\\.(test|spec))\\.(js)?$';
42
+ let transformIgnorePatterns = [];
28
43
 
29
- if (useTypescript) {
30
- moduleFileExtensions = ["js", "ts", "tsx", "json"];
31
- testRegex = "(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)?$";
32
- transformIgnorePatterns = ["[/\\\\]node_modules[/\\\\].+\\.(js|ts|tsx)$"];
44
+ if(useTypescript) {
45
+ moduleFileExtensions = ['js', 'ts', 'tsx', 'json'];
46
+ testRegex = '(/__tests__/.*|\\.(test|spec))\\.(ts|tsx)?$';
47
+ transformIgnorePatterns = [];
33
48
  }
34
49
 
35
- export default {
50
+ // Create a base config
51
+ const baseConfig = {
36
52
  collectCoverage: true,
37
- coverageDirectory: "<rootDir>/coverage",
53
+ coverageDirectory: '<rootDir>/coverage',
38
54
  coveragePathIgnorePatterns: [
39
- "/node_modules/",
40
- "/dist",
41
- "/lib",
42
- "__snapshots__",
43
- ".d.ts",
55
+ '/node_modules/',
56
+ '/dist',
57
+ '/lib',
58
+ '__snapshots__',
59
+ '.d.ts'
44
60
  ],
45
- coverageReporters: ["html", "text"],
46
- moduleDirectories: ["node_modules", nodePath],
61
+ coverageReporters: ['html', 'text'],
62
+ extensionsToTreatAsEsm: ['.ts', '.tsx'],
63
+ moduleDirectories: ['node_modules', nodePath],
47
64
  moduleFileExtensions,
48
65
  moduleNameMapper: {
49
- "\\.(css|jpg|png|svg|txt)$": pathResolve(dirName, "./emptyModule"),
66
+ '^chalk$': getNodePath('chalk/source/index.js'),
67
+ '^#ansi-styles$': getNodePath('chalk/node_modules/ansi-styles/index.js'),
68
+ '^#supports-color$': getNodePath('chalk/node_modules/supports-color/index.js'),
69
+ '\\.(css|jpg|png|svg|txt)$': pathResolve(dirName, './emptyModule')
50
70
  },
51
71
  modulePaths: [rootDir, `${rootDir}/node_modules`, nodePath, sourceFullPath],
52
- resolver: pathResolve(dirName, "./resolver.cjs"),
72
+ // preset: 'ts-jest', // Removed to avoid resolution issues
73
+ resolver: pathResolve(dirName, './resolver.cjs'),
53
74
  rootDir,
54
75
  setupFiles: [
55
- getNodePath("core-js"),
56
- getNodePath("regenerator-runtime/runtime.js"),
76
+ getNodePath('core-js'),
77
+ getNodePath('regenerator-runtime/runtime.js')
57
78
  ],
79
+ // Only add setupFilesAfterEnv if there are entries
80
+ ...(setupFilesAfterEnv.length > 0 ? { setupFilesAfterEnv } : {}),
58
81
  testEnvironment,
59
82
  testEnvironmentOptions,
60
- testPathIgnorePatterns: ["/node_modules/", `${nodePath}/`],
83
+ testPathIgnorePatterns: ['/node_modules/', `${nodePath}/`],
61
84
  testRegex,
62
- testRunner: getNodePath("jest-circus/runner.js"),
85
+ testRunner: getNodePath('jest-circus/runner.js'),
63
86
  transform: {
64
- ...createDefaultPreset().transform,
65
- "\\.(gql|graphql)$": "jest-transform-graphql",
87
+ ...(useTypescript ? {
88
+ '\\.tsx?$': [getNodePath('ts-jest/dist/index.js'), {
89
+ useESM: true
90
+ }]
91
+ } : {
92
+ '\\.[jt]sx?$': getNodePath('babel-jest')
93
+ }),
94
+ '\\.(gql|graphql)$': getNodePath('jest-transform-graphql')
66
95
  },
67
- transformIgnorePatterns,
68
- verbose: true,
69
- ...jest,
96
+ transformIgnorePatterns: [
97
+ 'node_modules/(?!(chalk|@testing-library/jest-dom)/)'
98
+ ],
99
+ verbose: true
70
100
  };
101
+
102
+ // Deep merge function
103
+ const deepMerge = (target, source) => {
104
+ if(!source) return target;
105
+ const output = { ...target };
106
+
107
+ Object.keys(source).forEach(key => {
108
+ if(source[key] instanceof Object && key in target && target[key] instanceof Object && !Array.isArray(source[key]) && !Array.isArray(target[key])) {
109
+ output[key] = {...target[key], ...source[key]};
110
+ } else if(Array.isArray(source[key]) && Array.isArray(target[key])) {
111
+ // Merge arrays
112
+ output[key] = [...target[key], ...source[key]];
113
+ } else {
114
+ output[key] = source[key];
115
+ }
116
+ });
117
+
118
+ return output;
119
+ };
120
+
121
+ // Export the merged configuration
122
+ export default deepMerge(baseConfig, jest);
package/jest.setup.js ADDED
@@ -0,0 +1,5 @@
1
+ // Temporarily disable jest-dom due to ESM compatibility issues with chalk 5
2
+ // require('@testing-library/jest-dom');
3
+ // const execaMock = require('@nlabs/execa-mock');
4
+
5
+ // jest.mock('execa', execaMock);
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.46.1",
3
+ "version": "1.47.0",
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 ./src/**/**.ts* ./src/**.ts* --platform=node --outdir=./dist --sourcemap=inline --target=node22 --format=esm --packages=external",
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 --ext .ts,.tsx",
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,80 +56,86 @@
43
56
  "watch": "NODE_ENV=development rm -rf dist && npm run compile -w"
44
57
  },
45
58
  "dependencies": {
46
- "@babel/core": "^7.26.7",
47
- "@babel/preset-env": "^7.26.7",
48
- "@babel/preset-typescript": "7.26.0",
59
+ "@babel/core": "^7.27.4",
60
+ "@babel/preset-env": "^7.27.2",
61
+ "@babel/preset-typescript": "7.27.1",
49
62
  "@luckycatfactory/esbuild-graphql-loader": "^3.8.1",
50
- "@nlabs/execa-mock": "^1.42.0",
51
- "@nlabs/webpack-plugin-static-site": "^0.1.1",
52
- "acorn": "^8.14.0",
63
+ "@nlabs/execa-mock": "*",
64
+ "@nlabs/webpack-plugin-static-site": "*",
65
+ "@tailwindcss/postcss": "4.1.10",
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.20",
56
- "babel-jest": "^29.7.0",
70
+ "autoprefixer": "^10.4.21",
71
+ "babel-jest": "^30.0.2",
57
72
  "boxen": "8.0.1",
58
- "caniuse-lite": "1.0.30001697",
73
+ "buffer": "^6.0.3",
74
+ "caniuse-lite": "1.0.30001726",
59
75
  "chalk": "^5.4.1",
60
- "commander": "^13.1.0",
76
+ "commander": "^14.0.0",
61
77
  "compare-versions": "^6.1.1",
62
78
  "compression-webpack-plugin": "^11.1.0",
63
79
  "config-webpack-plugin": "^1.1.0",
64
- "copy-webpack-plugin": "^12.0.2",
65
- "core-js": "^3.40.0",
80
+ "copy-webpack-plugin": "^13.0.0",
81
+ "core-js": "^3.43.0",
66
82
  "crypto-browserify": "^3.12.1",
67
83
  "css-loader": "^7.1.2",
68
- "cssnano": "^7.0.6",
84
+ "cssnano": "^7.0.7",
69
85
  "dotenv-webpack": "^8.1.0",
70
86
  "download-npm-package": "^3.1.12",
71
- "esbuild": "0.24.2",
72
- "esbuild-loader": "4.2.2",
73
- "execa": "9.5.2",
87
+ "esbuild": "0.25.5",
88
+ "esbuild-loader": "4.3.0",
89
+ "eslint": "9.29.0",
90
+ "eslint-config-styleguidejs": "^4.0.10",
91
+ "execa": "9.6.0",
74
92
  "exports-loader": "^5.0.0",
75
93
  "favicons-webpack-plugin": "^6.0.1",
76
94
  "file-loader": "^6.2.0",
77
95
  "find-file-up": "^2.0.1",
78
- "glob": "^11.0.1",
79
- "graphql": "^16.10.0",
96
+ "glob": "^11.0.3",
97
+ "graphql": "^16.11.0",
80
98
  "graphql-tag": "^2.12.6",
81
99
  "html-loader": "^5.1.0",
82
100
  "html-webpack-plugin": "^5.6.3",
83
101
  "https-browserify": "^1.0.0",
84
102
  "imports-loader": "^5.0.0",
85
- "jest": "29.7.0",
86
- "jest-circus": "29.7.0",
87
- "jest-cli": "29.7.0",
88
- "jest-environment-jsdom": "29.7.0",
103
+ "jest": "30.0.3",
104
+ "jest-circus": "30.0.3",
105
+ "jest-cli": "30.0.3",
106
+ "jest-environment-jsdom": "30.0.2",
89
107
  "jest-transform-graphql": "2.1.0",
90
108
  "json-d-ts": "1.0.1",
91
109
  "latest-version": "9.0.0",
92
110
  "lodash": "^4.17.21",
93
- "luxon": "^3.5.0",
111
+ "luxon": "^3.6.1",
94
112
  "net": "^1.0.2",
95
- "npm-check-updates": "^17.1.14",
113
+ "npm-check-updates": "^18.0.1",
114
+ "openai": "^5.7.0",
96
115
  "ora": "8.2.0",
97
116
  "os-browserify": "^0.3.0",
98
117
  "path-browserify": "^1.0.1",
99
118
  "postcss-browser-reporter": "^0.7.0",
100
- "postcss-cli": "^11.0.0",
101
- "postcss-custom-properties": "^14.0.4",
119
+ "postcss-cli": "^11.0.1",
120
+ "postcss-custom-properties": "^14.0.6",
102
121
  "postcss-flexbugs-fixes": "^5.0.2",
103
122
  "postcss-for": "^2.1.1",
104
123
  "postcss-hash": "^3.0.0",
105
- "postcss-import": "16.1.0",
124
+ "postcss-import": "16.1.1",
106
125
  "postcss-loader": "^8.1.1",
107
- "postcss-nesting": "^13.0.1",
126
+ "postcss-nesting": "^13.0.2",
108
127
  "postcss-percentage": "^0.0.0",
109
- "postcss-preset-env": "^10.1.3",
128
+ "postcss-preset-env": "^10.2.3",
110
129
  "postcss-simple-vars": "^7.0.1",
111
- "postcss-svgo": "7.0.1",
130
+ "postcss-svgo": "7.0.2",
112
131
  "postcss-url": "10.1.3",
113
132
  "process": "^0.11.10",
114
- "react": "^19.0.0",
115
- "react-dom": "^19.0.0",
133
+ "react": "^19.1.0",
134
+ "react-dom": "^19.1.0",
116
135
  "regenerator-runtime": "^0.14.1",
117
136
  "resolve": "^1.22.10",
118
137
  "rimraf": "^6.0.1",
119
- "semver": "^7.7.1",
138
+ "semver": "^7.7.2",
120
139
  "source-map-loader": "^5.0.0",
121
140
  "source-map-support": "^0.5.21",
122
141
  "speed-measure-webpack-plugin": "^1.5.0",
@@ -125,14 +144,17 @@
125
144
  "stream-http": "^3.2.0",
126
145
  "style-loader": "^4.0.0",
127
146
  "svg-spritemap-webpack-plugin": "^4.7.0",
128
- "svgo": "3.3.2",
147
+ "svgo": "4.0.0",
129
148
  "tls": "^0.0.1",
130
- "ts-jest": "29.2.5",
149
+ "ts-jest": "29.4.0",
131
150
  "ts-node": "^10.9.2",
132
- "typescript": "5.7.3",
151
+ "tsconfig-paths-webpack-plugin": "^4.2.0",
152
+ "typescript": "5.8.3",
153
+ "unicorn-magic": "^0.3.0",
133
154
  "url-loader": "^4.1.1",
134
155
  "util": "^0.12.5",
135
- "webpack": "5.97.1",
156
+ "vm-browserify": "^1.1.2",
157
+ "webpack": "5.99.9",
136
158
  "webpack-bundle-analyzer": "^4.10.2",
137
159
  "webpack-cli": "^6.0.1",
138
160
  "webpack-merge": "^6.0.1",
@@ -140,19 +162,17 @@
140
162
  "webpack-plugin-serve": "^1.6.0"
141
163
  },
142
164
  "devDependencies": {
143
- "@babel/plugin-transform-runtime": "^7.25.9",
144
- "@babel/preset-react": "^7.26.3",
165
+ "@babel/plugin-transform-runtime": "^7.27.4",
166
+ "@babel/preset-react": "^7.27.1",
145
167
  "@nlabs/execa-mock": "^1.41.0",
146
- "@types/jest": "^29.5.14",
147
- "@types/luxon": "^3.4.2",
148
- "@types/node": "^22.13.1",
168
+ "@types/jest": "^30.0.0",
169
+ "@types/luxon": "^3.6.2",
170
+ "@types/node": "^24.0.4",
149
171
  "@types/ora": "^3.2.0",
150
- "@types/react": "^19.0.8",
172
+ "@types/react": "^19.1.8",
151
173
  "@types/webpack": "^5.28.5",
152
- "babel-plugin-transform-import-meta": "^2.3.2",
153
- "babel-plugin-transform-vite-meta-env": "^1.0.3",
154
- "eslint": "^9.19.0",
155
- "eslint-config-styleguidejs": "^3.2.1"
174
+ "babel-plugin-transform-import-meta": "^2.3.3",
175
+ "babel-plugin-transform-vite-meta-env": "^1.0.3"
156
176
  },
157
177
  "gitHead": "0f5fb22fc0f0ab1abab5adf62afed24c7c87e4a8"
158
178
  }
@@ -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 {fileURLToPath} from 'url';
20
+ import {default as webpack} from 'webpack';
17
21
 
18
22
  const config = {
19
23
  plugins: [
20
- postcssImport,
21
- postcssUrl,
22
- postcssFor,
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;
@@ -1,24 +1,15 @@
1
1
  {
2
- "extends": "../../tsconfig.base.json",
2
+ "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
- "baseUrl": "./src",
5
- "esModuleInterop": true,
6
- "lib": [
7
- "es2020"
8
- ],
9
- "module": "ESNext",
4
+ "moduleResolution": "node16",
10
5
  "outDir": "./dist",
11
- "skipLibCheck": true,
12
- "target": "ESNext"
6
+ "rootDir": "./src"
13
7
  },
14
8
  "include": [
15
- "./src"
9
+ "src/**/*"
16
10
  ],
17
11
  "exclude": [
18
- "**/*.test.*",
19
- "./dist",
20
- "./website",
21
- "./node_modules",
22
- "./test"
12
+ "**/*.test.ts",
13
+ "**/*.spec.ts"
23
14
  ]
24
- }
15
+ }
package/tsconfig.json CHANGED
@@ -6,6 +6,7 @@
6
6
  ],
7
7
  "extends": "../../tsconfig.base.json",
8
8
  "include": [
9
- "./src"
9
+ "./src",
10
+ "./jest.setup.ts"
10
11
  ]
11
12
  }