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

CPP-2230: upgrade to Webpack 5 #1002

Merged
merged 41 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
5076461
chore: update webpack dependencies and peer dependency versions in bu…
apaleslimghost Sep 27, 2023
ce9cc6a
chore: remove webpack-fix-style-only-entries plugin
apaleslimghost Sep 27, 2023
6b404d5
chore: remove reliable-module-ids-plugin and use webpack 5 defaults
apaleslimghost Sep 27, 2023
3a21858
fix: use EntryPlugin instead of removed MultiEntryPlugin
apaleslimghost Sep 27, 2023
4f3b036
feat: use webpack 5 resource modules for images
apaleslimghost Sep 27, 2023
6c91f51
chore: update webpack in examples
apaleslimghost Sep 27, 2023
d4fbe17
chore: update typescript
apaleslimghost Sep 27, 2023
cd30901
build: update jest and all associated packages
apaleslimghost Sep 27, 2023
8748968
fix: try to get o-header dependency working in kitchen-sink example
apaleslimghost Sep 27, 2023
403ddc5
build: pass lint-staged when there are no related tests
apaleslimghost Sep 27, 2023
5b21f46
fix: add node_modules/@financial-times to default sass includePaths
apaleslimghost Sep 27, 2023
436e4fe
fix(asset-loader): support new asset manifest format
apaleslimghost Oct 14, 2024
d1a2f81
chore: remove unneeded webpackImporter option for example webpack con…
apaleslimghost Oct 14, 2024
4d08f03
fix: allow importing module requests without extensions
apaleslimghost Oct 15, 2024
1d21e90
fix: make n-topic-search a peer dependency
apaleslimghost Oct 15, 2024
a521b73
fix: don't output mini-css-extract-plugin runtime
apaleslimghost Oct 15, 2024
4c20f5d
fix: remove empty js bundles after extracting css
apaleslimghost Oct 17, 2024
25c1576
feat: switch from cssnano via postcss to css-minimizer-webpack-plugin
apaleslimghost Oct 17, 2024
1f45da2
feat!: switch autoprefixer and babel-preset-env to target browserslis…
apaleslimghost Oct 17, 2024
a19e27b
feat!: remove autoprefixer
apaleslimghost Oct 17, 2024
ad259af
chore: update package-lock
apaleslimghost Oct 21, 2024
99cfb2c
ci: use npm ci instead of npm install
apaleslimghost Oct 21, 2024
6376264
ci: set npm loglevel to silly
apaleslimghost Oct 21, 2024
9c5922d
ci: use node orb install-packages command
apaleslimghost Oct 21, 2024
e982ce2
ci: remove homespun npm cache
apaleslimghost Oct 21, 2024
8cc89ca
ci: split build job into setup/checkout/build, remove renovate/nori a…
apaleslimghost Oct 22, 2024
aa12322
chore: update puppeteer
apaleslimghost Oct 22, 2024
2fee4a5
test: remove @types/webpack and fix webpack type errors in tests
apaleslimghost Oct 22, 2024
89f83c5
fix: don't add bower to sass import paths
apaleslimghost Oct 22, 2024
61f5c8a
chore: remove references to autoprefixer
apaleslimghost Jan 9, 2025
195b104
test: update to latest jest-puppeteer
apaleslimghost Jan 20, 2025
15dcf34
test(kitchen-sink): update snapshots for new hashed asset names
apaleslimghost Jan 20, 2025
3b1827d
test(building-sass-files): force minimisation
apaleslimghost Jan 20, 2025
b8e4786
feat!(dotcom-build-sass): remove deprecated prependData option
apaleslimghost Jan 20, 2025
c540c37
fix: static vendors chunk name for development
apaleslimghost Jan 20, 2025
26ba362
ci: update puppeteer and use its command to install chrome instead of…
apaleslimghost Jan 20, 2025
e837abe
ci: run example jest suites in-band
apaleslimghost Jan 20, 2025
4dbf43b
ci: build the examples in the build step
apaleslimghost Jan 20, 2025
a549dc3
ci: force-exit the ft-ui and kitchen sink examples tests
apaleslimghost Jan 20, 2025
a3727e0
build: remove storybook
apaleslimghost Jan 20, 2025
6bec4ab
Merge pull request #1117 from Financial-Times/unstorybook
apaleslimghost Jan 20, 2025
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
167 changes: 74 additions & 93 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2.1

orbs:
browser-tools: circleci/[email protected]
node: circleci/[email protected]

executors:
node:
Expand All @@ -13,18 +13,16 @@ executors:
docker:
- image: cimg/node:20.18-browsers
environment:
NODE_OPTIONS: "--openssl-legacy-provider"
NODE_OPTIONS: '--openssl-legacy-provider'
node18:
docker:
- image: cimg/node:18.20-browsers

references:

#
# Workspace
#
container_config_node:
&container_config_node
container_config_node: &container_config_node
working_directory: ~/project/build
parameters:
executor:
Expand All @@ -34,84 +32,64 @@ references:

workspace_root: &workspace_root ~/project

attach_workspace:
&attach_workspace
attach_workspace: &attach_workspace
attach_workspace:
at: *workspace_root

# Cache creation
#
create_cache:
&create_cache
save_cache:
key: cache-v1-{{ .Branch }}-{{ checksum "./package.json" }}
paths:
- ./node_modules/

# Cache restoration
#
restore_cache:
&restore_cache
restore_cache:
keys:
- cache-v1-{{ .Branch }}-{{ checksum "./package.json" }}

# Filters
#
filters_only_main:
&filters_only_main
filters_only_main: &filters_only_main
branches:
only:
- main

filters_only_renovate_nori:
&filters_only_renovate_nori
branches:
only: /(^renovate-.*|^nori\/.*)/

filters_ignore_tags_renovate_nori_build:
&filters_ignore_tags_renovate_nori_build
tags:
ignore: /.*/
branches:
ignore: /(^renovate-.*|^nori\/.*|^gh-pages)/

filters_main_branch:
&filters_main_branch
filters_main_branch: &filters_main_branch
branches:
only:
- main

filters_release_build:
&filters_release_build
filters_release_build: &filters_release_build
tags:
only:
- /^v\d+\.\d+\.\d+$/
branches:
ignore: /.*/

filters_prerelease_build:
&filters_prerelease_build
filters_prerelease_build: &filters_prerelease_build
tags:
only:
- /^v\d+\.\d+\.\d+(?:-\w+\.\d+)$/
branches:
ignore: /.*/

jobs:

build:
checkout:
<<: *container_config_node
steps:
- checkout
- *restore_cache
- run:
name: Install project dependencies
command: npm install
- persist_to_workspace:
root: *workspace_root
paths:
- build
setup:
<<: *container_config_node
steps:
- *attach_workspace
- node/install-packages
- persist_to_workspace:
root: *workspace_root
paths:
- build
build:
<<: *container_config_node
steps:
- *attach_workspace
- run:
name: Run build
command: npm run build
- *create_cache
- run:
name: Run build in examples/
command: npm run build:examples
- persist_to_workspace:
root: *workspace_root
paths:
Expand All @@ -121,19 +99,18 @@ jobs:
<<: *container_config_node
steps:
- *attach_workspace
- browser-tools/install-chrome
- run:
name: Install Chrome
command: npx puppeteer browsers install chrome
- run:
name: Check code style
command: npm run prettier -- --list-different
- run:
name: Run package tests
command: npm run test:ci -- --runInBand
command: npm run test:ci
- run:
name: Run example app integration tests
command: npm run test:examples
- run:
name: Run storybook
command: npm run storybook:ci
command: npm run test:examples-ci

publish:
<<: *container_config_node
Expand Down Expand Up @@ -165,56 +142,26 @@ jobs:
name: NPM publish
command: npm publish --workspace=packages/ --access=public --tag=pre-release

deploy:
<<: *container_config_node
steps:
- *attach_workspace
- run:
name: Deploy Storybook
command: npm run deploy-storybook:ci

workflows:

version: 2

build-test:
jobs:
- build:
filters:
<<: *filters_ignore_tags_renovate_nori_build
name: build-<< matrix.executor >>
matrix:
parameters:
executor:
- node
- node20
- node18
- test:
- checkout
- setup:
name: setup-<< matrix.executor >>
requires:
- build-<< matrix.executor >>
name: test-<< matrix.executor >>
- checkout
matrix:
parameters:
executor:
- node
- node20
- node18
- deploy:
filters:
<<: *filters_only_main
requires:
- test-node

renovate-nori-build-test:
jobs:
- waiting-for-approval:
type: approval
filters:
<<: *filters_only_renovate_nori
- build:
requires:
- waiting-for-approval
name: build-<< matrix.executor >>
requires:
- setup-<< matrix.executor >>
matrix:
parameters:
executor:
Expand All @@ -234,10 +181,27 @@ workflows:

build-test-publish:
jobs:
- checkout:
filters:
<<: *filters_release_build
- setup:
filters:
<<: *filters_release_build
name: setup-<< matrix.executor >>
requires:
- checkout
matrix:
parameters:
executor:
- node
- node20
- node18
- build:
filters:
<<: *filters_release_build
name: build-<< matrix.executor >>
requires:
- setup-<< matrix.executor >>
matrix:
parameters:
executor:
Expand Down Expand Up @@ -265,10 +229,27 @@ workflows:

build-test-prepublish:
jobs:
- checkout:
filters:
<<: *filters_prerelease_build
- setup:
filters:
<<: *filters_prerelease_build
name: setup-<< matrix.executor >>
requires:
- checkout
matrix:
parameters:
executor:
- node
- node20
- node18
- build:
filters:
<<: *filters_prerelease_build
name: build-<< matrix.executor >>
requires:
- setup-<< matrix.executor >>
matrix:
parameters:
executor:
Expand Down
12 changes: 0 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ module.exports = {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts', '.mjs']
},
webpack: {
// Because we configure Storybook in "full control" mode we have to manually extend a
// configuration object. Rather than mock all that here I've chosen to copy the resolve
// rules so that the two files do not need to know about one other and their structure.
config: {
resolve: {
modules: ['node_modules'],
descriptionFiles: ['package.json'],
mainFiles: ['index', 'main']
}
}
}
}
},
Expand Down
4 changes: 0 additions & 4 deletions .storybook/.browserslistrc

This file was deleted.

1 change: 0 additions & 1 deletion .storybook/.gitignore

This file was deleted.

41 changes: 0 additions & 41 deletions .storybook/components/OnReady.tsx

This file was deleted.

12 changes: 0 additions & 12 deletions .storybook/main.js

This file was deleted.

27 changes: 0 additions & 27 deletions .storybook/preview-head.html

This file was deleted.

Loading