Skip to content

Commit ea66262

Browse files
hong6316MikyungKim
andauthored
WRN-16762: Added support for tailwindcss and update dependencies (#263)
* initial modules update(before wp5 update) * npm audit fix * Update package.json * fix lint errors * update CHANGELOG.md * Update package.json * revert CHANGELOG.mx * revert jest 27 * revert npm-shrinkwrap.json * revert pack/serve.js * for removing conflict with #262, revert versions * Update react-refresh-webpack-plugin version Co-authored-by: Mikyung Kim <[email protected]> * Update babel-jest version Co-authored-by: Mikyung Kim <[email protected]> * Update babel-plugin-dev-expression version Co-authored-by: Mikyung Kim <[email protected]> * remove unnecessary code * revert file permission * update dependencies * update package.json * Update package.json Co-authored-by: Mikyung Kim <[email protected]> * Update package.json * fix Enact-DCO-1.0-Signed-off-by: Mikyung Kim ([email protected]) Co-authored-by: Mikyung Kim <[email protected]>
1 parent a05cdf6 commit ea66262

File tree

4 files changed

+89
-78
lines changed

4 files changed

+89
-78
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module.exports = {
22
env: {
33
node: true
44
},
5-
extends: ['enact', 'plugin:prettier/recommended', 'prettier/babel', 'prettier/react'],
5+
extends: ['enact', 'plugin:prettier/recommended'],
66
plugins: ['import'],
77
rules: {
88
'import/no-unresolved': ['error', {commonjs: true, caseSensitive: true}],

bin/enact.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ const semver = require('semver');
99
const pkg = require('../package.json');
1010

1111
// Verify the correct version of Node is in use.
12-
if (!semver.satisfies(process.version, pkg.engines.node)) {
12+
if (
13+
!semver.satisfies(
14+
// Coerce strings with metadata (i.e. `15.0.0-nightly`).
15+
semver.coerce(process.version),
16+
pkg.engines.node
17+
)
18+
) {
1319
console.log(
1420
chalk.red(`You are running Node ${process.version}, but @enact/cli requires Node ${pkg.engines.node}.\n`) +
1521
chalk.bold.red('Please update your version of Node.')

config/webpack.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ module.exports = function (env, ilibAdditionalResourcesPath) {
6666
// Check if TypeScript is setup
6767
const useTypeScript = fs.existsSync('tsconfig.json');
6868

69+
// Check if Tailwind config exists
70+
const useTailwind = fs.existsSync(path.join(app.context, 'tailwind.config.js'));
71+
6972
process.env.NODE_ENV = env || process.env.NODE_ENV;
7073
const isEnvProduction = process.env.NODE_ENV === 'production';
7174

@@ -124,6 +127,7 @@ module.exports = function (env, ilibAdditionalResourcesPath) {
124127
// https://github.com/facebook/create-react-app/issues/2677
125128
ident: 'postcss',
126129
plugins: [
130+
useTailwind && require('tailwindcss'),
127131
// Fix and adjust for known flexbox issues
128132
// See https://github.com/philipwalton/flexbugs
129133
'postcss-flexbugs-fixes',
@@ -145,7 +149,7 @@ module.exports = function (env, ilibAdditionalResourcesPath) {
145149
],
146150
// Adds PostCSS Normalize to standardize browser quirks based on
147151
// the browserslist targets.
148-
'postcss-normalize',
152+
!useTailwind && require('postcss-normalize'),
149153
// Resolution indepedence support
150154
app.ri !== false && require('postcss-resolution-independence')(app.ri)
151155
].filter(Boolean)

package.json

Lines changed: 76 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -39,93 +39,94 @@
3939
"upupdowndownleftrightleftrightbastart"
4040
],
4141
"dependencies": {
42-
"@babel/core": "7.16.7",
43-
"@babel/plugin-proposal-decorators": "7.16.7",
44-
"@babel/plugin-proposal-export-default-from": "7.16.7",
45-
"@babel/plugin-transform-react-inline-elements": "7.16.7",
46-
"@babel/plugin-transform-runtime": "7.16.7",
47-
"@babel/preset-env": "7.16.7",
48-
"@babel/preset-react": "7.16.7",
49-
"@babel/preset-typescript": "7.16.7",
50-
"@babel/runtime": "7.16.7",
51-
"@enact/dev-utils": "4.1.4",
52-
"@enact/template-sandstone": "1.0.0",
53-
"@pmmmwh/react-refresh-webpack-plugin": "0.5.3",
42+
"@babel/core": "^7.16.7",
43+
"@babel/plugin-proposal-decorators": "^7.16.7",
44+
"@babel/plugin-proposal-export-default-from": "^7.16.7",
45+
"@babel/plugin-transform-react-inline-elements": "^7.16.7",
46+
"@babel/plugin-transform-runtime": "^7.16.7",
47+
"@babel/preset-env": "^7.16.7",
48+
"@babel/preset-react": "^7.16.7",
49+
"@babel/preset-typescript": "^7.16.7",
50+
"@babel/runtime": "^7.16.7",
51+
"@enact/dev-utils": "^4.1.4",
52+
"@enact/template-sandstone": "^1.0.0",
53+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
5454
"@testing-library/jest-dom": "^5.14.1",
5555
"@testing-library/react": "^12.0.0",
5656
"@testing-library/react-hooks": "^7.0.1",
5757
"@testing-library/user-event": "^13.2.0",
5858
"@wojtekmaj/enzyme-adapter-react-17": "0.3.2",
5959
"babel-eslint": "10.1.0",
60-
"babel-jest": "27.4.2",
61-
"babel-loader": "8.2.3",
62-
"babel-plugin-dev-expression": "0.2.2",
63-
"babel-plugin-dynamic-import-node": "2.3.3",
64-
"babel-plugin-transform-react-remove-prop-types": "0.4.24",
65-
"babel-plugin-transform-rename-import": "2.3.0",
66-
"case-sensitive-paths-webpack-plugin": "2.4.0",
67-
"chalk": "4.1.0",
68-
"core-js": "3.6.5",
69-
"cross-spawn": "7.0.3",
70-
"css-loader": "6.2.0",
71-
"css-minimizer-webpack-plugin": "3.0.2",
72-
"dotenv": "9.0.2",
73-
"dotenv-expand": "5.1.0",
60+
"babel-jest": "^27.5.1",
61+
"babel-loader": "^8.2.3",
62+
"babel-plugin-dev-expression": "^0.2.3",
63+
"babel-plugin-dynamic-import-node": "^2.3.3",
64+
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
65+
"babel-plugin-transform-rename-import": "^2.3.0",
66+
"case-sensitive-paths-webpack-plugin": "^2.4.0",
67+
"chalk": "^4.1.2",
68+
"core-js": "^3.21.1",
69+
"cross-spawn": "^7.0.3",
70+
"css-loader": "^6.7.1",
71+
"css-minimizer-webpack-plugin": "^3.4.1",
72+
"dotenv": "^16.0.0",
73+
"dotenv-expand": "^8.0.3",
7474
"enzyme": "3.11.0",
75-
"eslint": "7.30.0",
76-
"eslint-config-enact": "3.1.3",
77-
"eslint-plugin-babel": "5.3.1",
78-
"eslint-plugin-enact": "0.2.3",
79-
"eslint-plugin-jsx-a11y": "6.5.1",
80-
"eslint-plugin-react": "7.29.3",
81-
"eslint-plugin-react-hooks": "4.3.0",
82-
"eslint-plugin-testing-library": "5.0.2",
83-
"eslint-webpack-plugin": "2.5.4",
84-
"expose-loader": "1.0.0",
85-
"file-loader": "6.2.0",
86-
"filesize": "6.1.0",
87-
"fs-extra": "10.0.0",
88-
"glob": "7.1.6",
89-
"global-modules": "2.0.0",
90-
"html-webpack-plugin": "5.3.2",
91-
"identity-obj-proxy": "3.0.0",
92-
"jest": "27.4.3",
93-
"jest-watch-typeahead": "1.0.0",
94-
"less": "3.11.3",
95-
"less-loader": "6.2.0",
96-
"less-plugin-npm-import": "2.1.0",
97-
"license-checker": "25.0.1",
98-
"mini-css-extract-plugin": "2.1.0",
99-
"minimist": "1.2.5",
100-
"postcss": "^8.4.4",
75+
"eslint": "7.32.0",
76+
"eslint-config-enact": "^3.1.3",
77+
"eslint-plugin-babel": "^5.3.1",
78+
"eslint-plugin-enact": "^0.2.3",
79+
"eslint-plugin-jsx-a11y": "^6.5.1",
80+
"eslint-plugin-react": "^7.29.4",
81+
"eslint-plugin-react-hooks": "^4.3.0",
82+
"eslint-plugin-testing-library": "^5.1.0",
83+
"eslint-webpack-plugin": "^3.1.1",
84+
"expose-loader": "^3.1.0",
85+
"file-loader": "^6.2.0",
86+
"filesize": "^8.0.7",
87+
"fs-extra": "^10.0.1",
88+
"glob": "^7.2.0",
89+
"global-modules": "^2.0.0",
90+
"html-webpack-plugin": "^5.5.0",
91+
"identity-obj-proxy": "^3.0.0",
92+
"jest": "^27.5.1",
93+
"jest-watch-typeahead": "^1.0.0",
94+
"less": "^4.1.2",
95+
"less-loader": "^8.1.1",
96+
"less-plugin-npm-import": "^2.1.0",
97+
"license-checker": "^25.0.1",
98+
"mini-css-extract-plugin": "^2.6.0",
99+
"minimist": "^1.2.5",
100+
"postcss": "^8.4.12",
101101
"postcss-flexbugs-fixes": "^5.0.2",
102102
"postcss-global-import": "^1.0.6",
103103
"postcss-loader": "^6.2.1",
104104
"postcss-normalize": "^10.0.1",
105-
"postcss-preset-env": "^7.0.1",
105+
"postcss-preset-env": "^7.4.3",
106106
"postcss-resolution-independence": "^1.0.1",
107107
"postcss-safe-parser": "^6.0.0",
108-
"prompts": "2.4.1",
109-
"react": "17.0.1",
108+
"prompts": "^2.4.2",
109+
"react": "^17.0.2",
110110
"react-dev-utils": "^12.0.0",
111-
"react-dom": "17.0.1",
112-
"react-refresh": "0.10.0",
113-
"react-test-renderer": "17.0.1",
114-
"resolution-independence": "1.0.0",
115-
"resolve": "1.20.0",
116-
"semver": "7.3.5",
117-
"source-map-loader": "^3.0.0",
118-
"strip-ansi": "6.0.0",
119-
"style-loader": "3.0.0",
120-
"tar": "6.0.2",
121-
"terser-webpack-plugin": "5.2.5",
122-
"v8-compile-cache": "2.1.1",
123-
"validate-npm-package-name": "3.0.0",
124-
"webpack": "5.64.4",
125-
"webpack-dev-server": "4.6.0"
111+
"react-dom": "^17.0.2",
112+
"react-refresh": "^0.11.0",
113+
"react-test-renderer": "^17.0.2",
114+
"resolution-independence": "^1.0.0",
115+
"resolve": "^1.22.0",
116+
"semver": "^7.3.5",
117+
"source-map-loader": "^3.0.1",
118+
"strip-ansi": "^6.0.1",
119+
"style-loader": "^3.3.1",
120+
"tailwindcss": "^3.0.23",
121+
"tar": "^6.1.11",
122+
"terser-webpack-plugin": "^5.3.1",
123+
"v8-compile-cache": "^2.3.0",
124+
"validate-npm-package-name": "^3.0.0",
125+
"webpack": "^5.64.4",
126+
"webpack-dev-server": "^4.6.0"
126127
},
127128
"optionalDependencies": {
128-
"fsevents": "^2.1.3"
129+
"fsevents": "^2.3.2"
129130
},
130131
"peerDependencies": {
131132
"typescript": "^3.2.1 || ^4"
@@ -136,9 +137,9 @@
136137
}
137138
},
138139
"devDependencies": {
139-
"eslint-config-prettier": "^6.11.0",
140-
"eslint-plugin-import": "^2.22.0",
141-
"eslint-plugin-prettier": "^3.1.4",
142-
"prettier": "^2.0.5"
140+
"eslint-config-prettier": "^8.5.0",
141+
"eslint-plugin-import": "^2.25.4",
142+
"eslint-plugin-prettier": "^4.0.0",
143+
"prettier": "^2.6.0"
143144
}
144145
}

0 commit comments

Comments
 (0)