diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 870e943bf0..dd41b9b000 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -7,6 +7,37 @@ updates: open-pull-requests-limit: 10 labels: [] # disable default labels + # Define groups of dependencies to be updated together + # https://github.blog/changelog/2023-06-30-grouped-version-updates-for-dependabot-public-beta/ + groups: + storybook: + patterns: + - "storybook" + - "@storybook/*" + eslint: + patterns: + - "@typescript-eslint/*" + emotion: + patterns: + - "@emotion/*" + electron: + patterns: + - "electron" + - "electron-*" + - "app-builder-lib" + - "builder-util" + jest: + patterns: + - "jest" + - "jest-*" + - "babel-jest" + - "@types/jest" + webpack: + patterns: + - "webpack" + - "webpack-cli" + - "webpack-dev-server" + - package-ecosystem: "github-actions" directory: "/" schedule: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4bf38dfb6d..2a344e9a8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,7 +22,6 @@ jobs: command: | # lint steps set -x - yarn constraints yarn license-check yarn dedupe --check yarn run tsc --noEmit # typecheck files that are not included by webpack or package builds diff --git a/.github/workflows/dependabot-fix.yml b/.github/workflows/dependabot-fix.yml index 2e406d1fa5..fdb00b934c 100644 --- a/.github/workflows/dependabot-fix.yml +++ b/.github/workflows/dependabot-fix.yml @@ -53,7 +53,6 @@ jobs: key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: ${{ runner.os }}-yarn- - - run: yarn constraints --fix - run: yarn install --mode skip-build env: # yarn runs in immutable mode "by default" in CI -- turning this off requires an diff --git a/.yarn/plugins/@yarnpkg/plugin-constraints.cjs b/.yarn/plugins/@yarnpkg/plugin-constraints.cjs deleted file mode 100644 index 4d57e2fe37..0000000000 --- a/.yarn/plugins/@yarnpkg/plugin-constraints.cjs +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3c08a2ec0c247fb622922d8cbbbda7b5c65145bb1e488dd7a34c38292013123d -size 190763 diff --git a/.yarnrc.yml b/.yarnrc.yml index a34cee1b71..23412a5d61 100644 --- a/.yarnrc.yml +++ b/.yarnrc.yml @@ -17,7 +17,5 @@ plugins: spec: "@yarnpkg/plugin-version" - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs spec: "@yarnpkg/plugin-workspace-tools" - - path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs - spec: "@yarnpkg/plugin-constraints" yarnPath: .yarn/yarn-wrapper.js diff --git a/constraints.pro b/constraints.pro deleted file mode 100644 index 68b6f18244..0000000000 --- a/constraints.pro +++ /dev/null @@ -1,77 +0,0 @@ -constraints_min_version(1). - -% Convert between an atom and a number -atom_number(Atom, Number) :- - atom_chars(Atom, Chars), - number_chars(Number, Chars). - -% Parse an atom such as '1.2.3' into Major=1, Minor=2, Patch=3. -semver(Atom, Major, Minor, Patch) :- - atom_chars(Atom, Chars), - nth0(I, Chars, '.'), - nth0(J, Chars, '.'), - I < J, - MinorLen is J - I - 1, - MinorStart is I + 1, - PatchStart is J + 1, - sub_atom(Atom, 0, I, _, MajorAtom), - sub_atom(Atom, MinorStart, MinorLen, _, MinorAtom), - sub_atom(Atom, PatchStart, _, 0, PatchAtom), - atom_number(MajorAtom, Major), - atom_number(MinorAtom, Minor), - atom_number(PatchAtom, Patch). - -% True if Major1.Minor1.Patch1 is less than Major2.Minor2.Patch2 -semver_less(Major1, Minor1, Patch1, Major2, Minor2, Patch2) :- - Major1 < Major2; - Major1 == Major2, Minor1 < Minor2; - Major1 == Major2, Minor1 == Minor2, Patch1 < Patch2. - -% Find the maximum version in a given list of semver atoms, e.g. semver_max(['1.0.0', '2.0.0'], '2.0.0'). -semver_max([Version], Version). -semver_max([First|Rest], Result) :- - semver_max(Rest, RestMax), - semver(First, Major1, Minor1, Patch1), - semver(RestMax, Major2, Minor2, Patch2), - (semver_less(Major2, Minor2, Patch2, Major1, Minor1, Patch1) -> Result = First; Result = RestMax). - - -% True if Prefix occurs at the beginning of Atom. -has_prefix(Prefix, Atom) :- - atom_concat(Prefix, _, Atom). - -% Find all unique dependency versions across all workspaces that have a given Prefix, or are in -% Includes, excluding any dependencies in Excludes. -all_versions_in_group(Group, Result) :- - findall( - Range, - ( - workspace_has_dependency(_, Dep, Range, _), - version_group(Dep, Group) - ), - ResultList - ), - list_to_set(ResultList, Result). - -% Define version groups for dependencies. All dependencies in the same group will be required to have the same version. -version_group(Dep, storybook) :- - Dep = 'storybook'; - has_prefix('@storybook/', Dep), Dep \= '@storybook/testing-library', Dep \= '@storybook/jest'. -version_group(Dep, typescript_eslint) :- - has_prefix('@typescript-eslint/', Dep). -version_group(Dep, emotion) :- - has_prefix('@emotion/', Dep). - -% Enforce the requirements defined on version groups above. -gen_enforced_dependency(WorkspaceCwd, DependencyIdent, DependencyRange, DependencyType) :- - write('Generating '), write(DependencyType), write(' requirements for '), write(WorkspaceCwd), nl, - % For each existing package dependency... - workspace_has_dependency(WorkspaceCwd, DependencyIdent, _, DependencyType), - % Get the dependency's version group. - version_group(DependencyIdent, Group), - % Find the maximum version for dependencies with this Prefix across all workspaces & packages, and - % require this package to have that version. - all_versions_in_group(Group, Versions), - semver_max(Versions, MaxVersion), - write('Applying maximum '), write(Group), write(' package version '), write(MaxVersion), write(' to '), write(DependencyIdent), nl, - DependencyRange = MaxVersion.