Skip to content

Commit

Permalink
build: downgrade to PostCSSv7to and watch css files using Storybook
Browse files Browse the repository at this point in the history
Due to compatibility reason, we should currently work with PostCSSv7, because Storybook is not up-to-date and use this version.

Using v8 causes some instabilities in the stack.

Cf: storybookjs/storybook#13491
  • Loading branch information
jleveugle committed Dec 23, 2020
1 parent d916437 commit e3db09c
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 233 deletions.
9 changes: 4 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"bootstrap": "lerna bootstrap",
"build": "lerna run build",
"format": "lerna run format",
"postinstall": "husky install",
"postinstall": "npx husky install",
"lint": "lerna run lint",
"lint:fix": "lerna run lint:fix",
"pack": "lerna run pack",
Expand All @@ -48,7 +48,6 @@
"@storybook/addon-essentials": "^6.1.11",
"@storybook/addon-links": "^6.1.11",
"@storybook/html": "^6.1.11",
"autoprefixer": "^10.1.0",
"babel-loader": "^8.2.2",
"chokidar-cli": "^2.1.0",
"cross-env": "^7.0.3",
Expand All @@ -58,9 +57,9 @@
"lerna": "^3.22.1",
"lint-staged": "^10.5.3",
"npm-run-all": "^4.1.5",
"postcss": "^8.2.1",
"postcss-cli": "^8.3.1",
"postcss-import": "^14.0.0",
"postcss-cli": "^7.1.2",
"postcss-import": "^12.0.0",
"postcss-loader": "^4.1.0",
"prettier": "^2.2.1"
},
"licenses": [
Expand Down
2 changes: 1 addition & 1 deletion packages/css/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ module.exports = {
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-storysource',
],
]
};
1 change: 0 additions & 1 deletion packages/css/.storybook/preview-head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
href="https://fonts.googleapis.com/css2?family=Roboto+Condensed:ital,wght@0,400;0,700;1,700&display=swap"
rel="stylesheet"
/>
<link href="./index.css" rel="stylesheet" />

<style>
.block {
Expand Down
2 changes: 2 additions & 0 deletions packages/css/.storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import '../src/index.css';

export const parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
};
10 changes: 5 additions & 5 deletions packages/css/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@
"author": "Decathlon <[email protected]>",
"homepage": "https://github.com/Decathlon/vitamin-web#readme",
"scripts": {
"dev": "npm run watch:storybook",
"dev": "start-storybook -p 6006",
"build": "cross-env NODE_ENV=production npm run build:tailwind",
"build:tailwind": "postcss src/index.css -o lib/index.css",
"watch:tailwind": "chokidar 'src/**/*.css' 'src/**/*.mdx' '*.js' -c 'npm run build:tailwind'",
"watch:storybook": "npm-run-all build:tailwind --parallel watch:tailwind start:storybook",
"start:storybook": "start-storybook -p 6006 -s lib",
"build:storybook": "build-storybook --docs"
},
"directories": {
Expand All @@ -37,6 +34,9 @@
}
],
"dependencies": {
"tailwindcss": "^2.0.2"
"@tailwindcss/postcss7-compat": "^2.0.2",
"autoprefixer": "^9.8.6",
"postcss": "^7.0.35",
"tailwindcss": "npm:@tailwindcss/postcss7-compat"
}
}
Loading

0 comments on commit e3db09c

Please sign in to comment.