diff --git a/.eslintrc.js b/.eslintrc.js index d2ce2d97..6984ef5a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -2,7 +2,7 @@ module.exports = { env: { node: true }, - extends: ['enact', 'plugin:prettier/recommended', 'prettier/babel', 'prettier/react'], + extends: ['enact', 'plugin:prettier/recommended'], plugins: ['import'], rules: { 'import/no-unresolved': ['error', {commonjs: true, caseSensitive: true}], diff --git a/bin/enact.js b/bin/enact.js index 77ad819d..fad5bf31 100755 --- a/bin/enact.js +++ b/bin/enact.js @@ -9,7 +9,13 @@ const semver = require('semver'); const pkg = require('../package.json'); // Verify the correct version of Node is in use. -if (!semver.satisfies(process.version, pkg.engines.node)) { +if ( + !semver.satisfies( + // Coerce strings with metadata (i.e. `15.0.0-nightly`). + semver.coerce(process.version), + pkg.engines.node + ) +) { console.log( chalk.red(`You are running Node ${process.version}, but @enact/cli requires Node ${pkg.engines.node}.\n`) + chalk.bold.red('Please update your version of Node.') diff --git a/config/webpack.config.js b/config/webpack.config.js index 7ca493a4..29760919 100644 --- a/config/webpack.config.js +++ b/config/webpack.config.js @@ -66,6 +66,9 @@ module.exports = function (env, ilibAdditionalResourcesPath) { // Check if TypeScript is setup const useTypeScript = fs.existsSync('tsconfig.json'); + // Check if Tailwind config exists + const useTailwind = fs.existsSync(path.join(app.context, 'tailwind.config.js')); + process.env.NODE_ENV = env || process.env.NODE_ENV; const isEnvProduction = process.env.NODE_ENV === 'production'; @@ -124,6 +127,7 @@ module.exports = function (env, ilibAdditionalResourcesPath) { // https://github.com/facebook/create-react-app/issues/2677 ident: 'postcss', plugins: [ + useTailwind && require('tailwindcss'), // Fix and adjust for known flexbox issues // See https://github.com/philipwalton/flexbugs 'postcss-flexbugs-fixes', @@ -145,7 +149,7 @@ module.exports = function (env, ilibAdditionalResourcesPath) { ], // Adds PostCSS Normalize to standardize browser quirks based on // the browserslist targets. - 'postcss-normalize', + !useTailwind && require('postcss-normalize'), // Resolution indepedence support app.ri !== false && require('postcss-resolution-independence')(app.ri) ].filter(Boolean) diff --git a/package.json b/package.json index b803d9d4..eedcd3ec 100644 --- a/package.json +++ b/package.json @@ -39,93 +39,94 @@ "upupdowndownleftrightleftrightbastart" ], "dependencies": { - "@babel/core": "7.16.7", - "@babel/plugin-proposal-decorators": "7.16.7", - "@babel/plugin-proposal-export-default-from": "7.16.7", - "@babel/plugin-transform-react-inline-elements": "7.16.7", - "@babel/plugin-transform-runtime": "7.16.7", - "@babel/preset-env": "7.16.7", - "@babel/preset-react": "7.16.7", - "@babel/preset-typescript": "7.16.7", - "@babel/runtime": "7.16.7", - "@enact/dev-utils": "4.1.4", - "@enact/template-sandstone": "1.0.0", - "@pmmmwh/react-refresh-webpack-plugin": "0.5.3", + "@babel/core": "^7.16.7", + "@babel/plugin-proposal-decorators": "^7.16.7", + "@babel/plugin-proposal-export-default-from": "^7.16.7", + "@babel/plugin-transform-react-inline-elements": "^7.16.7", + "@babel/plugin-transform-runtime": "^7.16.7", + "@babel/preset-env": "^7.16.7", + "@babel/preset-react": "^7.16.7", + "@babel/preset-typescript": "^7.16.7", + "@babel/runtime": "^7.16.7", + "@enact/dev-utils": "^4.1.4", + "@enact/template-sandstone": "^1.0.0", + "@pmmmwh/react-refresh-webpack-plugin": "^0.5.4", "@testing-library/jest-dom": "^5.14.1", "@testing-library/react": "^12.0.0", "@testing-library/react-hooks": "^7.0.1", "@testing-library/user-event": "^13.2.0", "@wojtekmaj/enzyme-adapter-react-17": "0.3.2", "babel-eslint": "10.1.0", - "babel-jest": "27.4.2", - "babel-loader": "8.2.3", - "babel-plugin-dev-expression": "0.2.2", - "babel-plugin-dynamic-import-node": "2.3.3", - "babel-plugin-transform-react-remove-prop-types": "0.4.24", - "babel-plugin-transform-rename-import": "2.3.0", - "case-sensitive-paths-webpack-plugin": "2.4.0", - "chalk": "4.1.0", - "core-js": "3.6.5", - "cross-spawn": "7.0.3", - "css-loader": "6.2.0", - "css-minimizer-webpack-plugin": "3.0.2", - "dotenv": "9.0.2", - "dotenv-expand": "5.1.0", + "babel-jest": "^27.5.1", + "babel-loader": "^8.2.3", + "babel-plugin-dev-expression": "^0.2.3", + "babel-plugin-dynamic-import-node": "^2.3.3", + "babel-plugin-transform-react-remove-prop-types": "^0.4.24", + "babel-plugin-transform-rename-import": "^2.3.0", + "case-sensitive-paths-webpack-plugin": "^2.4.0", + "chalk": "^4.1.2", + "core-js": "^3.21.1", + "cross-spawn": "^7.0.3", + "css-loader": "^6.7.1", + "css-minimizer-webpack-plugin": "^3.4.1", + "dotenv": "^16.0.0", + "dotenv-expand": "^8.0.3", "enzyme": "3.11.0", - "eslint": "7.30.0", - "eslint-config-enact": "3.1.3", - "eslint-plugin-babel": "5.3.1", - "eslint-plugin-enact": "0.2.3", - "eslint-plugin-jsx-a11y": "6.5.1", - "eslint-plugin-react": "7.29.3", - "eslint-plugin-react-hooks": "4.3.0", - "eslint-plugin-testing-library": "5.0.2", - "eslint-webpack-plugin": "2.5.4", - "expose-loader": "1.0.0", - "file-loader": "6.2.0", - "filesize": "6.1.0", - "fs-extra": "10.0.0", - "glob": "7.1.6", - "global-modules": "2.0.0", - "html-webpack-plugin": "5.3.2", - "identity-obj-proxy": "3.0.0", - "jest": "27.4.3", - "jest-watch-typeahead": "1.0.0", - "less": "3.11.3", - "less-loader": "6.2.0", - "less-plugin-npm-import": "2.1.0", - "license-checker": "25.0.1", - "mini-css-extract-plugin": "2.1.0", - "minimist": "1.2.5", - "postcss": "^8.4.4", + "eslint": "7.32.0", + "eslint-config-enact": "^3.1.3", + "eslint-plugin-babel": "^5.3.1", + "eslint-plugin-enact": "^0.2.3", + "eslint-plugin-jsx-a11y": "^6.5.1", + "eslint-plugin-react": "^7.29.4", + "eslint-plugin-react-hooks": "^4.3.0", + "eslint-plugin-testing-library": "^5.1.0", + "eslint-webpack-plugin": "^3.1.1", + "expose-loader": "^3.1.0", + "file-loader": "^6.2.0", + "filesize": "^8.0.7", + "fs-extra": "^10.0.1", + "glob": "^7.2.0", + "global-modules": "^2.0.0", + "html-webpack-plugin": "^5.5.0", + "identity-obj-proxy": "^3.0.0", + "jest": "^27.5.1", + "jest-watch-typeahead": "^1.0.0", + "less": "^4.1.2", + "less-loader": "^8.1.1", + "less-plugin-npm-import": "^2.1.0", + "license-checker": "^25.0.1", + "mini-css-extract-plugin": "^2.6.0", + "minimist": "^1.2.5", + "postcss": "^8.4.12", "postcss-flexbugs-fixes": "^5.0.2", "postcss-global-import": "^1.0.6", "postcss-loader": "^6.2.1", "postcss-normalize": "^10.0.1", - "postcss-preset-env": "^7.0.1", + "postcss-preset-env": "^7.4.3", "postcss-resolution-independence": "^1.0.1", "postcss-safe-parser": "^6.0.0", - "prompts": "2.4.1", - "react": "17.0.1", + "prompts": "^2.4.2", + "react": "^17.0.2", "react-dev-utils": "^12.0.0", - "react-dom": "17.0.1", - "react-refresh": "0.10.0", - "react-test-renderer": "17.0.1", - "resolution-independence": "1.0.0", - "resolve": "1.20.0", - "semver": "7.3.5", - "source-map-loader": "^3.0.0", - "strip-ansi": "6.0.0", - "style-loader": "3.0.0", - "tar": "6.0.2", - "terser-webpack-plugin": "5.2.5", - "v8-compile-cache": "2.1.1", - "validate-npm-package-name": "3.0.0", - "webpack": "5.64.4", - "webpack-dev-server": "4.6.0" + "react-dom": "^17.0.2", + "react-refresh": "^0.11.0", + "react-test-renderer": "^17.0.2", + "resolution-independence": "^1.0.0", + "resolve": "^1.22.0", + "semver": "^7.3.5", + "source-map-loader": "^3.0.1", + "strip-ansi": "^6.0.1", + "style-loader": "^3.3.1", + "tailwindcss": "^3.0.23", + "tar": "^6.1.11", + "terser-webpack-plugin": "^5.3.1", + "v8-compile-cache": "^2.3.0", + "validate-npm-package-name": "^3.0.0", + "webpack": "^5.64.4", + "webpack-dev-server": "^4.6.0" }, "optionalDependencies": { - "fsevents": "^2.1.3" + "fsevents": "^2.3.2" }, "peerDependencies": { "typescript": "^3.2.1 || ^4" @@ -136,9 +137,9 @@ } }, "devDependencies": { - "eslint-config-prettier": "^6.11.0", - "eslint-plugin-import": "^2.22.0", - "eslint-plugin-prettier": "^3.1.4", - "prettier": "^2.0.5" + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-import": "^2.25.4", + "eslint-plugin-prettier": "^4.0.0", + "prettier": "^2.6.0" } }