@nlabs/lex 1.48.6 → 1.49.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 (107) hide show
  1. package/.storybook/main.ts +9 -2
  2. package/.vscode/settings.json +1 -6
  3. package/README.md +276 -4
  4. package/eslint.config.mjs +24 -0
  5. package/examples/lex.config.js +18 -8
  6. package/examples/serverless-example/README.md +109 -0
  7. package/examples/serverless-example/dist/handlers/echo.js +15 -0
  8. package/examples/serverless-example/dist/handlers/graphql.js +137 -0
  9. package/examples/serverless-example/dist/handlers/hello.js +15 -0
  10. package/examples/serverless-example/dist/handlers/test.js +17 -0
  11. package/examples/serverless-example/dist/handlers/websocket.js +14 -0
  12. package/examples/serverless-example/lex.config.mjs +74 -0
  13. package/jest.config.mjs +13 -12
  14. package/{dist → lib}/LexConfig.d.ts +14 -6
  15. package/lib/LexConfig.js +268 -0
  16. package/lib/commands/ai/ai.js +303 -0
  17. package/{dist → lib}/commands/build/build.d.ts +3 -0
  18. package/lib/commands/build/build.js +494 -0
  19. package/{dist → lib}/commands/clean/clean.js +1 -1
  20. package/lib/commands/compile/compile.js +241 -0
  21. package/lib/commands/copy/copy.js +38 -0
  22. package/{dist → lib}/commands/create/create.js +1 -1
  23. package/{dist → lib}/commands/dev/dev.d.ts +2 -0
  24. package/lib/commands/dev/dev.js +286 -0
  25. package/{dist → lib}/commands/init/init.js +1 -1
  26. package/{dist → lib}/commands/lint/lint.d.ts +4 -1
  27. package/lib/commands/lint/lint.js +993 -0
  28. package/{dist → lib}/commands/migrate/migrate.js +1 -1
  29. package/lib/commands/publish/publish.js +104 -0
  30. package/lib/commands/serverless/serverless.d.ts +17 -0
  31. package/lib/commands/serverless/serverless.js +662 -0
  32. package/lib/commands/storybook/storybook.js +249 -0
  33. package/lib/commands/test/test.js +428 -0
  34. package/lib/commands/update/update.js +128 -0
  35. package/lib/commands/versions/versions.js +41 -0
  36. package/{dist → lib}/create/changelog.js +1 -1
  37. package/{dist → lib}/index.d.ts +2 -0
  38. package/{dist → lib}/index.js +3 -1
  39. package/lib/lex.js +73 -0
  40. package/lib/storybook/index.d.ts +5 -0
  41. package/lib/types.js +1 -0
  42. package/lib/utils/aiService.d.ts +9 -0
  43. package/lib/utils/aiService.js +299 -0
  44. package/{dist → lib}/utils/app.d.ts +3 -0
  45. package/lib/utils/app.js +296 -0
  46. package/lib/utils/deepMerge.js +26 -0
  47. package/{dist → lib}/utils/file.d.ts +7 -3
  48. package/lib/utils/file.js +229 -0
  49. package/lib/utils/translations.d.ts +1 -0
  50. package/lib/utils/translations.js +74 -0
  51. package/package.json +62 -50
  52. package/postcss.config.js +5 -3
  53. package/tsconfig.build.json +2 -2
  54. package/webpack.config.js +229 -39
  55. package/dist/LexConfig.js +0 -286
  56. package/dist/commands/ai/ai.js +0 -303
  57. package/dist/commands/build/build.js +0 -404
  58. package/dist/commands/compile/compile.js +0 -234
  59. package/dist/commands/copy/copy.js +0 -38
  60. package/dist/commands/dev/dev.js +0 -74
  61. package/dist/commands/lint/lint.js +0 -811
  62. package/dist/commands/publish/publish.js +0 -104
  63. package/dist/commands/storybook/storybook.js +0 -249
  64. package/dist/commands/test/test.js +0 -429
  65. package/dist/commands/update/update.js +0 -132
  66. package/dist/commands/versions/versions.js +0 -41
  67. package/dist/lex.js +0 -70
  68. package/dist/utils/aiService.d.ts +0 -9
  69. package/dist/utils/aiService.js +0 -299
  70. package/dist/utils/app.js +0 -267
  71. package/dist/utils/deepMerge.js +0 -24
  72. package/dist/utils/file.js +0 -185
  73. package/emptyModule.js +0 -0
  74. package/eslint.config.js +0 -7
  75. /package/{dist → lib}/Button.stories.d.ts +0 -0
  76. /package/{dist → lib}/commands/ai/ai.d.ts +0 -0
  77. /package/{dist → lib}/commands/ai/index.d.ts +0 -0
  78. /package/{dist → lib}/commands/ai/index.js +0 -0
  79. /package/{dist → lib}/commands/clean/clean.d.ts +0 -0
  80. /package/{dist → lib}/commands/compile/compile.d.ts +0 -0
  81. /package/{dist → lib}/commands/config/config.d.ts +0 -0
  82. /package/{dist → lib}/commands/config/config.js +0 -0
  83. /package/{dist → lib}/commands/copy/copy.d.ts +0 -0
  84. /package/{dist → lib}/commands/create/create.d.ts +0 -0
  85. /package/{dist → lib}/commands/init/init.d.ts +0 -0
  86. /package/{dist → lib}/commands/link/link.d.ts +0 -0
  87. /package/{dist → lib}/commands/link/link.js +0 -0
  88. /package/{dist → lib}/commands/lint/autofix.d.ts +0 -0
  89. /package/{dist → lib}/commands/migrate/migrate.d.ts +0 -0
  90. /package/{dist → lib}/commands/publish/publish.d.ts +0 -0
  91. /package/{dist → lib}/commands/storybook/storybook.d.ts +0 -0
  92. /package/{dist → lib}/commands/test/test.d.ts +0 -0
  93. /package/{dist → lib}/commands/update/update.d.ts +0 -0
  94. /package/{dist → lib}/commands/upgrade/upgrade.d.ts +0 -0
  95. /package/{dist → lib}/commands/upgrade/upgrade.js +0 -0
  96. /package/{dist → lib}/commands/versions/versions.d.ts +0 -0
  97. /package/{dist → lib}/create/changelog.d.ts +0 -0
  98. /package/{dist → lib}/lex.d.ts +0 -0
  99. /package/{dist/types.js → lib/storybook/index.js} +0 -0
  100. /package/{dist → lib}/test-react/index.d.ts +0 -0
  101. /package/{dist → lib}/test-react/index.js +0 -0
  102. /package/{dist → lib}/types.d.ts +0 -0
  103. /package/{dist → lib}/utils/deepMerge.d.ts +0 -0
  104. /package/{dist → lib}/utils/log.d.ts +0 -0
  105. /package/{dist → lib}/utils/log.js +0 -0
  106. /package/{dist → lib}/utils/reactShim.d.ts +0 -0
  107. /package/{dist → lib}/utils/reactShim.js +0 -0
@@ -0,0 +1,74 @@
1
+ import { existsSync, readFileSync, writeFileSync } from "fs";
2
+ import { sync as globSync } from "glob";
3
+ import { resolve as pathResolve } from "path";
4
+ import { log } from "./log.js";
5
+ const flattenTranslations = (obj, prefix = "") => {
6
+ let flattened = {};
7
+ for (const key in obj) {
8
+ const value = obj[key];
9
+ const newKey = prefix ? `${prefix}.${key}` : key;
10
+ if (typeof value === "object" && value !== null && !Array.isArray(value)) {
11
+ flattened = { ...flattened, ...flattenTranslations(value, newKey) };
12
+ } else {
13
+ flattened[newKey] = String(value);
14
+ }
15
+ }
16
+ return flattened;
17
+ };
18
+ const findTranslationFiles = (sourcePath) => {
19
+ const patterns = [
20
+ "**/translations/*.json",
21
+ "**/i18n/*.json",
22
+ "**/locales/*.json",
23
+ "**/lang/*.json"
24
+ ];
25
+ const files = [];
26
+ patterns.forEach((pattern) => {
27
+ try {
28
+ const matches = globSync(pattern, {
29
+ absolute: true,
30
+ cwd: sourcePath,
31
+ nodir: true
32
+ });
33
+ files.push(...matches);
34
+ } catch (error) {
35
+ }
36
+ });
37
+ return files;
38
+ };
39
+ const processTranslations = async (sourcePath, outputPath, quiet = false) => {
40
+ if (!existsSync(sourcePath)) {
41
+ log(`Source path does not exist: ${sourcePath}`, "error", quiet);
42
+ return;
43
+ }
44
+ log("Finding translation files...", "info", quiet);
45
+ const translationFiles = findTranslationFiles(sourcePath);
46
+ if (translationFiles.length === 0) {
47
+ log("No translation files found", "warn", quiet);
48
+ return;
49
+ }
50
+ log(`Found ${translationFiles.length} translation files`, "info", quiet);
51
+ let allTranslations = {};
52
+ for (const filePath of translationFiles) {
53
+ try {
54
+ const content = readFileSync(filePath, "utf8");
55
+ const data = JSON.parse(content);
56
+ allTranslations = { ...allTranslations, ...data };
57
+ log(`Processed: ${filePath}`, "info", quiet);
58
+ } catch (error) {
59
+ log(`Error processing ${filePath}: ${error.message}`, "error", quiet);
60
+ }
61
+ }
62
+ const flattenedTranslations = flattenTranslations(allTranslations);
63
+ const outputFile = pathResolve(outputPath, "translations.json");
64
+ try {
65
+ writeFileSync(outputFile, JSON.stringify(flattenedTranslations, null, 2), "utf8");
66
+ log(`Translations written to: ${outputFile}`, "info", quiet);
67
+ } catch (error) {
68
+ log(`Error writing translations file: ${error.message}`, "error", quiet);
69
+ }
70
+ };
71
+ export {
72
+ processTranslations
73
+ };
74
+ //# source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BSTtBQUNGLFlBQU0sVUFBVSxhQUFhLFVBQVUsTUFBTTtBQUM3QyxZQUFNLE9BQU8sS0FBSyxNQUFNLE9BQU87QUFFL0Isd0JBQWtCLEVBQUMsR0FBRyxpQkFBaUIsR0FBRyxLQUFJO0FBRTlDLFVBQUksY0FBYyxRQUFRLElBQUksUUFBUSxLQUFLO0FBQUEsSUFDN0MsU0FBUyxPQUFPO0FBQ2QsVUFBSSxvQkFBb0IsUUFBUSxLQUFLLE1BQU0sT0FBTyxJQUFJLFNBQVMsS0FBSztBQUFBLElBQ3RFO0FBQUEsRUFDRjtBQUVBLFFBQU0sd0JBQXdCLG9CQUFvQixlQUFlO0FBQ2pFLFFBQU0sYUFBYSxZQUFZLFlBQVksbUJBQW1CO0FBRTlELE1BQUk7QUFDRixrQkFBYyxZQUFZLEtBQUssVUFBVSx1QkFBdUIsTUFBTSxDQUFDLEdBQUcsTUFBTTtBQUNoRixRQUFJLDRCQUE0QixVQUFVLElBQUksUUFBUSxLQUFLO0FBQUEsRUFDN0QsU0FBUyxPQUFPO0FBQ2QsUUFBSSxvQ0FBb0MsTUFBTSxPQUFPLElBQUksU0FBUyxLQUFLO0FBQUEsRUFDekU7QUFDRjsiLAogICJuYW1lcyI6IFtdCn0K
package/package.json CHANGED
@@ -1,23 +1,29 @@
1
1
  {
2
2
  "name": "@nlabs/lex",
3
- "version": "1.48.6",
3
+ "version": "1.49.0",
4
4
  "description": "Lex",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
- "bin": "./dist/lex.js",
8
- "main": "./dist/index.js",
7
+ "bin": "./lib/lex.js",
8
+ "main": "./lib/index.js",
9
9
  "exports": {
10
10
  ".": {
11
- "import": "./dist/index.js",
11
+ "import": "./lib/index.js",
12
12
  "require": "./index.cjs"
13
13
  },
14
14
  "./test-react": {
15
- "types": "./dist/test-react/index.d.ts",
16
- "import": "./dist/test-react/index.js",
17
- "require": "./dist/test-react/index.js"
18
- }
15
+ "types": "./lib/test-react/index.d.ts",
16
+ "import": "./lib/test-react/index.js",
17
+ "require": "./lib/test-react/index.js"
18
+ },
19
+ "./storybook": {
20
+ "types": "./lib/storybook/index.d.ts",
21
+ "import": "./lib/storybook/index.js",
22
+ "require": "./lib/storybook/index.js"
23
+ },
24
+ "./eslint.config.js": "./eslint.config.js"
19
25
  },
20
- "types": "./dist/index.d.ts",
26
+ "types": "./lib/index.d.ts",
21
27
  "keywords": [
22
28
  "arkhamjs",
23
29
  "lex",
@@ -41,22 +47,22 @@
41
47
  "node": ">=22"
42
48
  },
43
49
  "scripts": {
44
- "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",
50
+ "build": "NODE_ENV=production && rm -rf lib && esbuild $(find src -name '*.ts' -not -name '*.test.ts' -not -name '*.spec.ts') --platform=node --outdir=./lib --sourcemap=inline --target=node22 --format=esm --packages=external && npm run declarations",
45
51
  "build:all": "npm run build && npm run build:ai",
46
- "build:ai": "NODE_ENV=production && esbuild src/commands/ai/*.ts --platform=node --outdir=./dist/commands/ai --sourcemap=inline --target=node22 --format=esm --packages=external",
52
+ "build:ai": "NODE_ENV=production && esbuild src/commands/ai/*.ts --platform=node --outdir=./lib/commands/ai --sourcemap=inline --target=node22 --format=esm --packages=external",
47
53
  "declarations": "tsc -p tsconfig.build.json",
48
- "clean": "rm -rf dist node_modules package-lock.json *.log coverage",
54
+ "clean": "rm -rf lib node_modules package-lock.json *.log coverage",
49
55
  "compile": "tsc -p tsconfig.build.json",
50
56
  "env": "LEX_CONFIG='{\"useTypescript\":true}'",
51
- "lint": "eslint ./src --fix",
52
- "lint:ai": "node ./dist/lex.js lint --fix",
57
+ "lint": "eslint ./src --fix --no-warn-ignored",
58
+ "lint:ai": "node ./lib/lex.js lint --fix",
53
59
  "lint:rebuild": "npm run build && npm run lint:ai",
54
60
  "prepublishOnly": "npm run build",
55
61
  "publish:major": "npm version major && npm publish",
56
62
  "publish:minor": "npm version minor && npm publish",
57
63
  "publish:patch": "npm version patch && npm publish",
58
- "test": "NODE_ENV=test && npm run lint && npm run test:unit",
59
- "test:unit": "NODE_ENV=test npm run env && npx jest",
64
+ "test": "NODE_ENV=test && (npm run lint || true) && npm run test:unit",
65
+ "test:unit": "NODE_ENV=test && npm run env && npx jest",
60
66
  "test:integration": "NODE_ENV=test && npx jest --testPathPattern=integration",
61
67
  "test:cli": "NODE_ENV=test && npx jest --testPathPattern=cli",
62
68
  "test:commands": "NODE_ENV=test && npm run test:cli && npm run test:integration",
@@ -71,7 +77,7 @@
71
77
  "ci:build": "npm run build && npm run package",
72
78
  "ci:deploy": "npm run prepublishOnly",
73
79
  "update": "npm-check-updates -i",
74
- "watch": "NODE_ENV=development rm -rf dist && npm run compile -w"
80
+ "watch": "NODE_ENV=development rm -rf lib && npm run compile -w"
75
81
  },
76
82
  "dependencies": {
77
83
  "@babel/core": "^7.28.0",
@@ -87,21 +93,22 @@
87
93
  "@storybook/addon-actions": "^9.0.8",
88
94
  "@storybook/addon-backgrounds": "^9.0.8",
89
95
  "@storybook/addon-controls": "^9.0.8",
90
- "@storybook/addon-docs": "^9.0.17",
91
- "@storybook/addon-links": "^9.0.17",
96
+ "@storybook/addon-docs": "^9.0.18",
97
+ "@storybook/addon-links": "^9.0.18",
92
98
  "@storybook/addon-postcss": "^2.0.0",
93
99
  "@storybook/addon-styling-webpack": "^2.0.0",
94
- "@storybook/addon-themes": "^9.0.17",
100
+ "@storybook/addon-themes": "^9.0.18",
95
101
  "@storybook/addon-viewport": "^9.0.8",
96
102
  "@storybook/addon-webpack5-compiler-babel": "^3.0.6",
97
- "@storybook/cli": "^9.0.17",
98
- "@storybook/react": "^9.0.17",
99
- "@storybook/react-webpack5": "^9.0.17",
103
+ "@storybook/cli": "^9.0.18",
104
+ "@storybook/react": "^9.0.18",
105
+ "@storybook/react-webpack5": "^9.0.18",
106
+ "@tailwindcss/nesting": "^0.0.0-insiders.565cd3e",
100
107
  "@tailwindcss/postcss": "4.1.11",
101
- "@testing-library/jest-dom": "^6.6.3",
108
+ "@testing-library/jest-dom": "^6.6.4",
102
109
  "@testing-library/react": "^16.3.0",
103
- "@typescript-eslint/eslint-plugin": "^8.37.0",
104
- "@typescript-eslint/parser": "^8.37.0",
110
+ "@typescript-eslint/eslint-plugin": "^8.38.0",
111
+ "@typescript-eslint/parser": "^8.38.0",
105
112
  "acorn": "^8.15.0",
106
113
  "ajv": "^8.17.1",
107
114
  "assert": "^2.1.0",
@@ -112,7 +119,7 @@
112
119
  "babel-plugin-transform-import-meta": "^2.3.3",
113
120
  "boxen": "8.0.1",
114
121
  "buffer": "^6.0.3",
115
- "caniuse-lite": "1.0.30001727",
122
+ "caniuse-lite": "1.0.30001731",
116
123
  "chalk": "^5.4.1",
117
124
  "commander": "^14.0.0",
118
125
  "compare-versions": "^6.1.1",
@@ -120,27 +127,31 @@
120
127
  "config-webpack-plugin": "^1.1.0",
121
128
  "copy-webpack-plugin": "^13.0.0",
122
129
  "core-js": "^3.44.0",
123
- "crypto-browserify": "^3.12.1",
130
+ "crypto-js": "^4.2.0",
124
131
  "css-loader": "^7.1.2",
125
132
  "cssnano": "^7.1.0",
126
133
  "dotenv-webpack": "^8.1.1",
127
134
  "download-npm-package": "^3.1.12",
128
- "esbuild": "0.25.6",
135
+ "esbuild": "0.25.8",
129
136
  "esbuild-loader": "4.3.0",
130
- "eslint": "^9.31.0",
131
- "eslint-config-styleguidejs": "^4.0.22",
137
+ "eslint": "^9.32.0",
138
+ "eslint-config-styleguidejs": "^4.1.2",
132
139
  "execa": "9.6.0",
133
- "expect": "^29.7.0",
140
+ "expect": "^30.0.5",
141
+ "express": "^5.1.0",
142
+ "graphql-http": "^1.22.4",
134
143
  "exports-loader": "^5.0.0",
135
144
  "favicons-webpack-plugin": "^6.0.1",
136
145
  "file-loader": "^6.2.0",
137
146
  "find-file-up": "^2.0.1",
138
147
  "glob": "^11.0.3",
148
+ "global": "^4.4.0",
139
149
  "graphql": "^16.11.0",
140
150
  "graphql-tag": "^2.12.6",
141
151
  "html-loader": "^5.1.0",
142
152
  "html-webpack-plugin": "^5.6.3",
143
153
  "https-browserify": "^1.0.0",
154
+ "image-webpack-loader": "^8.1.0",
144
155
  "imports-loader": "^5.0.0",
145
156
  "jest": "^29.7.0",
146
157
  "jest-circus": "^29.7.0",
@@ -153,8 +164,8 @@
153
164
  "lodash": "^4.17.21",
154
165
  "luxon": "^3.7.1",
155
166
  "net": "^1.0.2",
156
- "npm-check-updates": "^18.0.1",
157
- "openai": "^5.10.1",
167
+ "npm-check-updates": "^18.0.2",
168
+ "openai": "^5.11.0",
158
169
  "ora": "8.2.0",
159
170
  "os-browserify": "^0.3.0",
160
171
  "path-browserify": "^1.0.1",
@@ -173,51 +184,52 @@
173
184
  "postcss-svgo": "7.1.0",
174
185
  "postcss-url": "10.1.3",
175
186
  "process": "^0.11.10",
176
- "react": "^19.1.0",
177
- "react-dom": "^19.1.0",
187
+ "randombytes": "^2.1.0",
188
+ "react": "^19.1.1",
189
+ "react-dom": "^19.1.1",
178
190
  "regenerator-runtime": "^0.14.1",
179
191
  "resolve": "^1.22.10",
180
192
  "rimraf": "^6.0.1",
181
193
  "semver": "^7.7.2",
194
+ "source-map-loader": "^5.0.0",
182
195
  "speed-measure-webpack-plugin": "^1.5.0",
183
196
  "static-site-generator-webpack-plugin": "^3.4.2",
184
- "storybook": "^9.0.17",
197
+ "storybook": "^9.0.18",
185
198
  "stream-browserify": "^3.0.0",
186
199
  "stream-http": "^3.2.0",
187
200
  "style-loader": "^4.0.0",
188
- "svg-spritemap-webpack-plugin": "^4.7.0",
201
+ "svg-spritemap-webpack-plugin": "^5.0.0",
189
202
  "svgo": "4.0.0",
203
+ "tailwindcss": "^4.1.11",
190
204
  "tls": "^0.0.1",
191
205
  "ts-node": "^10.9.2",
192
206
  "tsconfig-paths-webpack-plugin": "^4.2.0",
193
207
  "typescript": "5.8.3",
208
+ "uncrypto": "^0.1.3",
194
209
  "unicorn-magic": "^0.3.0",
195
210
  "url-loader": "^4.1.1",
196
211
  "util": "^0.12.5",
197
212
  "vm-browserify": "^1.1.2",
198
- "webpack": "5.100.2",
213
+ "webpack": "5.101.0",
199
214
  "webpack-bundle-analyzer": "^4.10.2",
200
215
  "webpack-cli": "^6.0.1",
201
216
  "webpack-merge": "^6.0.1",
202
217
  "webpack-nano": "^1.1.1",
203
- "webpack-plugin-serve": "^1.6.0"
218
+ "webpack-plugin-serve": "^1.6.0",
219
+ "ws": "^8.18.3"
204
220
  },
205
221
  "devDependencies": {
206
222
  "@babel/plugin-transform-react-jsx": "^7.27.1",
207
- "@babel/runtime": "^7.27.6",
208
- "@babel/runtime-corejs3": "^7.28.0",
223
+ "@babel/runtime": "^7.28.2",
224
+ "@babel/runtime-corejs3": "^7.28.2",
225
+ "@types/express": "^5.0.3",
209
226
  "@types/jest": "^29.5.14",
210
- "@types/luxon": "^3.6.2",
211
- "@types/node": "^24.0.14",
227
+ "@types/luxon": "^3.7.1",
228
+ "@types/node": "^24.1.0",
212
229
  "@types/ora": "^3.2.0",
213
- "@types/react": "^19.1.8",
230
+ "@types/react": "^19.1.9",
214
231
  "@types/webpack": "^5.28.5"
215
232
  },
216
- "peerDependencies": {
217
- "@storybook/react": "^9.0.17",
218
- "@storybook/react-webpack5": "^9.0.17",
219
- "storybook": "^9.0.17"
220
- },
221
233
  "resolutions": {
222
234
  "css-loader": "7.1.2"
223
235
  },
package/postcss.config.js CHANGED
@@ -2,7 +2,6 @@
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';
6
5
  import autoprefixer from 'autoprefixer';
7
6
  import cssnano from 'cssnano';
8
7
  import postcssBrowserReporter from 'postcss-browser-reporter';
@@ -12,6 +11,8 @@ import postcssFor from 'postcss-for';
12
11
  import postcssHash from 'postcss-hash';
13
12
  import postcssImport from 'postcss-import';
14
13
  import postcssNesting from 'postcss-nesting';
14
+ import tailwindcss from '@tailwindcss/postcss';
15
+ import tailwindNesting from '@tailwindcss/nesting';
15
16
  import postcssPercentage from 'postcss-percentage';
16
17
  import postcssPresetEnv from 'postcss-preset-env';
17
18
  import postcssSimpleVars from 'postcss-simple-vars';
@@ -21,7 +22,6 @@ import {default as webpack} from 'webpack';
21
22
 
22
23
  const config = {
23
24
  plugins: [
24
- tailwindcss(),
25
25
  postcssImport({addDependencyTo: webpack}),
26
26
  postcssUrl(),
27
27
  postcssFor(),
@@ -35,8 +35,10 @@ const config = {
35
35
  strict: false,
36
36
  warnings: false
37
37
  }),
38
- autoprefixer(),
38
+ tailwindNesting(),
39
39
  postcssNesting(),
40
+ tailwindcss(),
41
+ autoprefixer(),
40
42
  postcssFlexbugsFixes(),
41
43
  postcssPresetEnv({
42
44
  browsers: ['last 5 versions'],
@@ -21,7 +21,7 @@
21
21
  "noUnusedLocals": false,
22
22
  "pretty": true,
23
23
  "resolveJsonModule": true,
24
- "outDir": "./dist",
24
+ "outDir": "./lib",
25
25
  "rootDir": "./src",
26
26
  "skipLibCheck": true,
27
27
  "target": "ESNext",
@@ -39,7 +39,7 @@
39
39
  "**/*.integration.*",
40
40
  "**/__tests__/**",
41
41
  "**/__mocks__/**",
42
- "dist",
42
+ "lib",
43
43
  "node_modules",
44
44
  "jest.config.mjs"
45
45
  ]