Skip to content

Commit

Permalink
chore: update pob dependencies and remove yarn git cache
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehurpeau committed Apr 25, 2024
1 parent bef709f commit 75631e3
Show file tree
Hide file tree
Showing 22 changed files with 952 additions and 971 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
run: corepack enable

- name: Install Dependencies
run: yarn install --immutable --immutable-cache
run: yarn install --immutable

- name: Run tsc for tsc cache
run: yarn tsc
Expand All @@ -33,7 +33,7 @@ jobs:
run: touch docs/.nojekyll

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
2 changes: 1 addition & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: corepack enable

- name: Install Dependencies
run: yarn install --immutable --immutable-cache
run: yarn install --immutable

- name: Checks
run: yarn run checks
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: corepack enable

- name: Install Dependencies
run: yarn install --immutable --immutable-cache
run: yarn install --immutable

- name: New version (dry run)
if: github.ref == 'refs/heads/main' && inputs.dry-run
Expand Down
1 change: 1 addition & 0 deletions .yarn/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/unplugged
/install-state.gz
/cache
14 changes: 2 additions & 12 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
compressionLevel: 0
compressionLevel: mixed
defaultSemverRangePrefix: ^
enableGlobalCache: false
enableGlobalCache: true
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-postinstall-dev.cjs
spec: https://raw.githubusercontent.com/sachinraja/yarn-plugin-postinstall-dev/main/bundles/%40yarnpkg/plugin-postinstall-dev.js
- path: .yarn/plugins/@yarnpkg/plugin-conventional-version.cjs
spec: https://raw.githubusercontent.com/christophehurpeau/yarn-plugin-conventional-version/main/bundles/%40yarnpkg/plugin-conventional-version.cjs
supportedArchitectures:
cpu:
- x64
- arm64
os:
- linux
- darwin
libc:
- glibc
- musl
2 changes: 1 addition & 1 deletion dist/definitions/check-package-with-workspaces.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/definitions/check-package.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/definitions/checks/checkExactVersions.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/definitions/utils/object.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions dist/index-node18.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,8 @@ const getAllowedPeerInFromType = (depPkgType, isLibrary) => {
return isLibrary ? ['dependencies', 'peerDependencies'] : ['devDependencies', 'dependencies'];
case 'optionalDependencies':
return isLibrary ? ['dependencies', 'optionalDependencies', 'peerDependencies'] : ['devDependencies', 'dependencies'];

// no default
}
};
async function checkDirectPeerDependencies(isLibrary, pkg, pkgPathName, getDependencyPackageJson, missingOnlyWarnsForCheck, invalidOnlyWarnsForCheck, customCreateReportError = createReportError) {
Expand All @@ -196,7 +198,7 @@ async function checkDirectPeerDependencies(isLibrary, pkg, pkgPathName, getDepen
if (!dependencies) return;
for (const depName of getKeys(dependencies)) {
if (pkg.peerDependencies?.[depName]) {
if (semver.intersects(dependencies[depName], pkg.peerDependencies?.[depName])) {
if (semver.intersects(dependencies[depName], pkg.peerDependencies[depName])) {
continue;
}
}
Expand Down Expand Up @@ -227,6 +229,8 @@ async function checkDirectPeerDependencies(isLibrary, pkg, pkgPathName, getDepen
}

const isVersionRange = version => version.startsWith('^') || version.startsWith('~') || version.startsWith('>') || version.startsWith('<');

// eslint-disable-next-line @typescript-eslint/require-await
async function checkExactVersions(pkg, pkgPathName, types, {
getDependencyPackageJson,
onlyWarnsForCheck,
Expand Down Expand Up @@ -500,7 +504,12 @@ function checkSatisfiesVersionsFromDependency(pkg, pkgPathName, type, depKeys, d
const version = pkgDependencies[depKey];
const getAutoFixIfExists = () => {
const existingOperator = version ? getOperator(version) : null;
const expectedOperator = existingOperator === null ? shouldHaveExactVersions(type) ? '' : null : existingOperator;
const expectedOperator = (() => {
if (existingOperator !== null) {
return existingOperator;
}
return shouldHaveExactVersions(type) ? '' : null;
})();
return expectedOperator === '' ? semver.minVersion(range)?.version : changeOperator(range, expectedOperator);
};
const autoFix = versionToApply => {
Expand Down Expand Up @@ -678,7 +687,6 @@ const createOnlyWarnsForMappingCheck = (configName, onlyWarnsFor) => {
};
};

/* eslint-disable max-lines */
function createCheckPackage({
packageDirectoryPath = '.',
internalWorkspacePkgDirectoryPath,
Expand Down Expand Up @@ -1022,7 +1030,6 @@ function createCheckPackage({
};
}

/* eslint-disable max-lines */
function createCheckPackageWithWorkspaces(createCheckPackageOptions = {}) {
const checkPackage = createCheckPackage({
...createCheckPackageOptions,
Expand Down
2 changes: 1 addition & 1 deletion dist/index-node18.mjs.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@
"devDependencies": {
"@babel/core": "7.24.4",
"@pob/commitlint-config": "6.3.1",
"@pob/eslint-config": "54.0.1",
"@pob/eslint-config-typescript": "54.0.1",
"@pob/root": "9.2.0",
"@pob/eslint-config": "55.2.1",
"@pob/eslint-config-typescript": "55.2.1",
"@pob/root": "9.3.2",
"@types/jest": "29.5.12",
"@types/semver": "7.5.6",
"@types/semver-utils": "1.1.3",
Expand All @@ -91,6 +91,6 @@
"pob-babel": "38.1.0",
"semver": "7.5.4",
"typedoc": "0.25.13",
"typescript": "5.3.3"
"typescript": "5.4.5"
}
}
3 changes: 2 additions & 1 deletion src/.eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"ignorePatterns": ["*.d.ts"],
"rules": {
"complexity": ["error", 20],
"@typescript-eslint/max-params": "warn"
"@typescript-eslint/max-params": "warn",
"@typescript-eslint/require-await": "warn"
},
"overrides": [
{
Expand Down
1 change: 0 additions & 1 deletion src/check-package-with-workspaces.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-lines */
import fs from 'node:fs';
import path from 'node:path';
import { globSync } from 'glob';
Expand Down
1 change: 0 additions & 1 deletion src/check-package.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable max-lines */
import path from 'node:path';
import util from 'node:util';
import { checkDirectDuplicateDependencies } from './checks/checkDirectDuplicateDependencies';
Expand Down
Loading

0 comments on commit 75631e3

Please sign in to comment.