Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: PostCSS processing order issue for widget #463

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading