Skip to content

Commit

Permalink
fix: PostCSS processing order issue for widget (#463)
Browse files Browse the repository at this point in the history
* fix: PostCSS processing issue for widget

* fix: regenerate widget version 2.36.0
  • Loading branch information
mortennordseth authored Dec 11, 2024
1 parent 292baa9 commit b070b2f
Show file tree
Hide file tree
Showing 10 changed files with 323 additions and 117 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
"next-router-mock": "^0.9.13",
"patch-package": "^8.0.0",
"postcss": "^8.4.49",
"postcss-cli": "^11.0.0",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-preset-env": "^10.1.1",
"postinstall-postinstall": "^2.1.0",
Expand Down
2 changes: 1 addition & 1 deletion public/widget/C4Jw9gtgzkA/2.36.0/planner-web.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/widget/G4awLkA/2.36.0/planner-web.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/widget/GYJwhgtkA/2.36.0/planner-web.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/widget/GYQwTgLgpkA/2.36.0/planner-web.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/widget/HYMw1kA/2.36.0/planner-web.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/widget/IYFwRkA/2.36.0/planner-web.css

Large diffs are not rendered by default.

19 changes: 18 additions & 1 deletion scripts/build-widget.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,21 @@ for orgId in atb nfk fram troms vkt farte; do
echo "Building widget for $orgId"
NEXT_PUBLIC_PLANNER_ORG_ID=$orgId yarn build:widget
NEXT_PUBLIC_PLANNER_ORG_ID=$orgId node ./scripts/generate-widget-stat.js
done
done

# Workaround for PostCSS processing issue
# Issue: PostCSS does not allow control over plugin execution order, meaning the "composes"
# CSS is not processed before other plugins. As a result, parts of the CSS remain unprocessed.
#
# Workaround: Run PostCSS twice to ensure CSS imported using "composes" also is processed properly.

BASE_DIR="public/widget"
VERSION=$(node -p "require('./package.json').version")

for FOLDER in "$BASE_DIR"/*/; do
FOLDER_NAME=$(basename "$FOLDER")
FILE_NAME="$BASE_DIR/$FOLDER_NAME/$VERSION/planner-web.css"
npx postcss "$FILE_NAME" -o "$FILE_NAME"
done

echo "Post processing completed"
1 change: 1 addition & 0 deletions src/widget/widget.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@import '@atb/theme/theme.css';
@value assistant: "../page-modules/assistant/assistant.module.css";
@value departures: "../page-modules/departures/departures.module.css";
@value search: "../components/search/search.module.css";
Expand Down
407 changes: 297 additions & 110 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit b070b2f

Please sign in to comment.