Skip to content

Commit

Permalink
fix(catalog, umd): remove node-sass to allow building on node16 (patt…
Browse files Browse the repository at this point in the history
  • Loading branch information
redallen authored Oct 6, 2021
1 parent f5cfac2 commit 212611a
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 201 deletions.
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"url": "https://github.com/patternfly/patternfly-react.git"
},
"engines": {
"node": ">=8.9.0",
"npm": ">=5.5.1",
"node": ">=14.0.0",
"yarn": ">=1.6.0"
},
"keywords": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const path = require('path');
const sass = require('sass');
const fs = require('fs');

const outDir = 'dist/css';

/**
* @param {string} url - Url string
Expand All @@ -16,4 +20,13 @@ function importer(url) {
return { file: url };
}

module.exports = importer;
const res = sass.renderSync({
file: 'sass/react-catalog-view-extension.scss',
outputStyle: 'compressed',
importer
});
if (!fs.existsSync(outDir)) {
fs.mkdirSync(outDir);
}

fs.writeFileSync(path.join(outDir, 'react-catalog-view-extension.css'), res.css);
7 changes: 3 additions & 4 deletions packages/react-catalog-view-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,18 @@
"homepage": "https://github.com/patternfly/patternfly-react/blob/main/packages/react-catalog-view-extension/README.md",
"scripts": {
"generate": "concurrently \"yarn build:sass\" \"yarn copy:sass\"",
"build:sass": "node-sass --output-style compressed --importer=./node-sass-patternfly-importer.js -o dist/css sass/react-catalog-view-extension.scss",
"build:sass": "node buildSass.js",
"copy:sass": "shx mkdir -p dist/sass && shx cp -r sass/react-catalog-view-extension/* dist/sass",
"clean": "rimraf dist"
},
"dependencies": {
"@patternfly/patternfly": "4.139.2",
"@patternfly/react-core": "^4.160.0",
"@patternfly/react-styles": "^4.12.1",
"classnames": "^2.2.5"
"@patternfly/react-styles": "^4.12.1"
},
"devDependencies": {
"concurrently": "^5.3.0",
"node-sass": "^4.14.1",
"sass": "^1.42.1",
"rimraf": "^2.6.2",
"shx": "^0.3.2",
"tslib": "^2.0.0",
Expand Down
12 changes: 6 additions & 6 deletions packages/react-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
},
"devDependencies": {
"@patternfly/patternfly": "4.139.2",
"@rollup/plugin-commonjs": "^11.0.2",
"@rollup/plugin-node-resolve": "^7.1.1",
"@rollup/plugin-replace": "^2.3.1",
"@rollup/plugin-commonjs": "^21.0.0",
"@rollup/plugin-node-resolve": "^13.0.0",
"@rollup/plugin-replace": "^3.0.0",
"css": "^2.2.3",
"fs-extra": "^6.0.1",
"glob": "^7.1.2",
"rimraf": "^2.6.2",
"rollup": "^2.2.0",
"rollup-plugin-scss": "^2.1.0",
"rollup-plugin-terser": "^5.3.0",
"rollup": "^2.58.0",
"rollup-plugin-scss": "^3.0.0",
"rollup-plugin-terser": "^7.0.0",
"typescript": "^4.0.0"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/rollup.base.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const resolve = require('@rollup/plugin-node-resolve');
const { nodeResolve } = require('@rollup/plugin-node-resolve');
const commonjs = require('@rollup/plugin-commonjs');
const scss = require('rollup-plugin-scss');
const replace = require('@rollup/plugin-replace');
Expand Down Expand Up @@ -34,7 +34,7 @@ module.exports = ({ packageName, name }) => ({
replace({
'process.env.NODE_ENV': `'${isProduction ? 'production' : 'development'}'`
}),
resolve(),
nodeResolve(),
commonjs(),
scss(),
isProduction && terser(),
Expand Down
Loading

0 comments on commit 212611a

Please sign in to comment.