Skip to content

Commit

Permalink
chore: maintenance 2024 q3 (#608)
Browse files Browse the repository at this point in the history
* chore(project): remove obsolete dep resolutions

* chore(project): add resolutions for high risk dep issues

* chore(project): add resolution for medium risk dep issues

* chore(project): update date-fns

* chore(project): update dompurify

* chore(project): update fast-xml-parser

* chore(project): update zustand

* chore(project): perform yarn upgrade for payment deps

* chore(project): perform yarn upgrade (interactive)

* chore(project): sync yarn lock

* refactor(project): fix incorrect store update

* refactor(project): update yarn lock

* refactor(project): remove deprecated zustand State type

* chore(project): update syncpack rules for non-peer local packages
  • Loading branch information
royschut authored Sep 16, 2024
1 parent 4cd86b6 commit 20ddad5
Show file tree
Hide file tree
Showing 11 changed files with 300 additions and 502 deletions.
82 changes: 16 additions & 66 deletions .syncpackrc.json
Original file line number Diff line number Diff line change
@@ -1,88 +1,38 @@
{
"$schema": "https://unpkg.com/syncpack@11.2.1/dist/schema.json",
"sortFirst": [
"name",
"description",
"version",
"private",
"license",
"repository",
"author",
"main",
"exports",
"engines",
"workspaces",
"scripts"
],
"sortFirst": ["name", "description", "version", "private", "license", "repository", "author", "main", "exports", "engines", "workspaces", "scripts"],
"semverGroups": [
{
"dependencies": [
"codeceptjs",
"codeceptjs**",
"react-router",
"react-router-dom",
"typescript"
],
"packages": [
"**"
],
"dependencies": ["codeceptjs", "codeceptjs**", "react-router", "react-router-dom", "typescript"],
"packages": ["**"],
"isIgnored": true
},
{
"range": "^",
"dependencies": [
"**"
],
"packages": [
"**"
],
"dependencyTypes": [
"prod",
"dev",
"peer"
]
"dependencies": ["**"],
"packages": ["**"],
"dependencyTypes": ["prod", "dev", "peer"]
}
],
"versionGroups": [
{
"label": "Ensure semver ranges for locally developed packages satisfy the local version",
"dependencies": [
"@jwp/**",
"**-config-jwp"
],
"dependencyTypes": [
"peer"
],
"packages": [
"**"
],
"dependencies": ["@jwp/**", "**-config-jwp"],
"dependencyTypes": ["dev", "prod", "peer"],
"packages": ["**"],
"pinVersion": "*"
},
{
"label": "Ensure local packages are installed as peerDependency",
"dependencies": [
"@jwp/**",
"**-config-jwp"
],
"dependencyTypes": [
"dev",
"prod"
],
"packages": [
"**"
],
"label": "Ensure local packages are installed as dev or prod dependency",
"dependencies": ["@jwp/**", "**-config-jwp"],
"dependencyTypes": ["peer"],
"packages": ["**"],
"isBanned": true
},
{
"dependencies": [
"@types/**"
],
"dependencyTypes": [
"!dev"
],
"packages": [
"**"
],
"dependencies": ["@types/**"],
"dependencyTypes": ["!dev"],
"packages": ["**"],
"isBanned": true,
"label": "@types packages should only be under devDependencies"
}
Expand Down
2 changes: 1 addition & 1 deletion configs/eslint-config-jwp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@typescript-eslint/parser": "^7.13.1",
"confusing-browser-globals": "^1.0.11",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-react": "^7.34.2",
"eslint-plugin-react": "^7.34.3",
"eslint-plugin-react-hooks": "^4.6.2"
}
}
14 changes: 6 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"devDependencies": {
"@commitlint/cli": "^17.8.1",
"@commitlint/config-conventional": "^17.8.1",
"@types/node": "^18.19.36",
"@types/node": "^18.19.37",
"csv-parse": "^5.5.6",
"eslint": "^8.57.0",
"husky": "^6.0.0",
"i18next-parser-workspaces": "^0.2.0",
"knip": "^5.21.1",
"lint-staged": "^15.2.7",
"knip": "^5.30.1",
"lint-staged": "^15.2.10",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"read": "^2.1.0",
Expand All @@ -56,10 +56,8 @@
"eslint-config-jwp": "*"
},
"resolutions": {
"codeceptjs/**/ansi-regex": "^4.1.1",
"codeceptjs/**/minimatch": "^3.0.5",
"flat": "^5.0.1",
"glob-parent": "^5.1.2",
"json5": "^2.2.2"
"codeceptjs/**/fast-xml-parser": "^4.5.0",
"micromatch": ">=4.0.8",
"ws": ">=5.2.4"
}
}
6 changes: 3 additions & 3 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"dependencies": {
"@inplayer-org/inplayer.js": "^3.13.28",
"broadcast-channel": "^7.0.0",
"date-fns": "^2.30.0",
"fast-xml-parser": "^4.4.0",
"date-fns": "^3.6.0",
"fast-xml-parser": "^4.5.0",
"i18next": "^22.5.1",
"ini": "^3.0.1",
"inversify": "^6.0.2",
Expand All @@ -21,7 +21,7 @@
"react-i18next": "^12.3.1",
"reflect-metadata": "^0.2.2",
"yup": "^0.32.11",
"zustand": "^3.7.2"
"zustand": "^4.5.5"
},
"devDependencies": {
"@types/ini": "^1.3.34",
Expand Down
6 changes: 1 addition & 5 deletions packages/common/src/controllers/AppController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ export default class AppController {
}

// Store the logo right away and set css variables so the error page will be branded
const banner = config.assets.banner;

useConfigStore.setState((s) => {
s.config.assets.banner = banner;
});
useConfigStore.setState((state) => merge({}, state, { config: { assets: { banner: config.assets.banner } } }));

config = await this.configService.validateConfig(config);
config = merge({}, defaultConfig, config);
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/stores/utils.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { State, StateCreator } from 'zustand';
import create from 'zustand';
import type { StateCreator } from 'zustand';
import { create } from 'zustand';
import { devtools, subscribeWithSelector } from 'zustand/middleware';

import { IS_DEVELOPMENT_BUILD, IS_TEST_MODE } from '../utils/common';

export const createStore = <T extends State>(name: string, storeFn: StateCreator<T>) => {
export const createStore = <T>(name: string, storeFn: StateCreator<T>) => {
const store = subscribeWithSelector(storeFn);

// https://github.com/pmndrs/zustand/issues/852#issuecomment-1059783350
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/utils/compare.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import shallow from 'zustand/shallow';
import { shallow } from 'zustand/shallow';

export { shallow };
2 changes: 1 addition & 1 deletion packages/hooks-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"test-watch": "TZ=UTC LC_ALL=en_US.UTF-8 vitest"
},
"dependencies": {
"date-fns": "^2.30.0",
"date-fns": "^3.6.0",
"i18next": "^22.5.1",
"planby": "^0.3.0",
"react": "^18.3.1",
Expand Down
12 changes: 6 additions & 6 deletions packages/ui-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
"test-watch": "TZ=UTC LC_ALL=en_US.UTF-8 vitest"
},
"dependencies": {
"@adyen/adyen-web": "^5.66.1",
"@adyen/adyen-web": "^5.68.1",
"@videodock/tile-slider": "^2.0.0",
"classnames": "^2.5.1",
"date-fns": "^2.30.0",
"dompurify": "^2.5.5",
"date-fns": "^3.6.0",
"dompurify": "^3.1.6",
"i18next": "^22.5.1",
"inversify": "^6.0.2",
"marked": "^4.3.0",
"payment": "^2.4.6",
"payment": "^2.4.7",
"planby": "^0.3.0",
"react": "^18.3.1",
"react-app-polyfill": "^3.0.0",
Expand All @@ -34,7 +34,7 @@
"devDependencies": {
"@testing-library/jest-dom": "^6.4.6",
"@testing-library/react": "^14.3.1",
"@types/dompurify": "^2.4.0",
"@types/dompurify": "^3.0.5",
"@types/jwplayer": "^8.31.1",
"@types/marked": "^4.3.2",
"@types/payment": "^2.1.7",
Expand All @@ -47,7 +47,7 @@
"vite-plugin-svgr": "^4.2.0",
"vitest": "^1.6.0",
"vitest-axe": "^1.0.0-pre.3",
"wicg-inert": "^3.1.2"
"wicg-inert": "^3.1.3"
},
"peerDependencies": {
"@jwp/ott-common": "*",
Expand Down
8 changes: 4 additions & 4 deletions platforms/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@
"@jwp/ott-ui-react": "*",
"i18next": "^22.5.1",
"i18next-browser-languagedetector": "^6.1.8",
"i18next-http-backend": "^2.5.2",
"i18next-http-backend": "^2.6.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-helmet": "^6.1.0",
"react-i18next": "^12.3.1",
"react-router": "6.14.2",
"react-router-dom": "6.14.2",
"wicg-inert": "^3.1.2"
"wicg-inert": "^3.1.3"
},
"devDependencies": {
"@babel/core": "^7.24.7",
Expand All @@ -50,7 +50,7 @@
"@testing-library/jest-dom": "^6.4.6",
"@types/jwplayer": "^8.31.1",
"@types/luxon": "^3.4.2",
"@types/node": "^18.19.36",
"@types/node": "^18.19.37",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@types/react-helmet": "^6.1.11",
Expand All @@ -66,7 +66,7 @@
"i18next-parser": "^8.13.0",
"jsdom": "^22.1.0",
"luxon": "^3.4.4",
"playwright": "^1.44.5",
"playwright": "^1.45.0",
"postcss": "^8.4.38",
"postcss-config-jwp": "*",
"react-app-polyfill": "^3.0.0",
Expand Down
Loading

0 comments on commit 20ddad5

Please sign in to comment.