Skip to content

Commit 044af65

Browse files
authored
Merge pull request #934 from soluble-io/add-syncpack
Add syncpack
2 parents 242ab19 + 38ac250 commit 044af65

File tree

16 files changed

+434
-184
lines changed

16 files changed

+434
-184
lines changed

.changeset/nasty-tables-accept.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@soluble/cache-e2e-tests": patch
3+
"@soluble/cache-interop": patch
4+
"@soluble/cache-ioredis": patch
5+
"@soluble/cache-redis": patch
6+
"@examples/nextjs-cjs": patch
7+
"@examples/nextjs-esm": patch
8+
"@soluble/dsn-parser": patch
9+
---
10+
11+
Add syncpack to ensure consistence in package.json(s)

.github/workflows/ci-monorepo-integrity.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ jobs:
2424
- name: 📥 Monorepo install
2525
uses: ./.github/actions/yarn-nm-install
2626

27-
- name: Check for duplicate dependencies in lock file
28-
run: |
29-
yarn dedupe --check
27+
- name: 🦺 Check for duplicate dependencies in lock file
28+
run: yarn dedupe --check
3029

31-
- name: Check for yarn constraints.pro
32-
run: |
33-
yarn constraints
30+
- name: 🦺 Check for yarn constraints.pro
31+
run: yarn constraints
3432

35-
- name: Check monorepo dependency graph
36-
run: |
37-
yarn check:install
33+
- name: 🦺 Check monorepo dependency graph
34+
run: yarn check:install
35+
36+
- name: 🦺 Syncpack - packages - lint-semver-ranges
37+
run: yarn syncpack:check || yarn syncpack:list

.prettierignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ package.json
22
package-lock.json
33
tsconfig.json
44
tsconfig.*.json
5-
yarn.lock
5+
*.lock
6+
7+
.*
68

79
*.log
810

.syncpackrc.cjs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
module.exports = {
2+
"customTypes": {
3+
"engines": {
4+
"path": "engines",
5+
"strategy": "versionsByName"
6+
},
7+
"packageManager": {
8+
"path": "packageManager",
9+
"strategy": "name@version"
10+
}
11+
},
12+
"dependencyTypes": ["dev", "prod", "peer"],
13+
"filter": ".",
14+
"indent": " ",
15+
"semverRange": "",
16+
"semverGroups": [
17+
{
18+
"range": "",
19+
"label": "apps",
20+
"dependencyTypes": ["dev", "prod"],
21+
"dependencies": ["**"],
22+
"packages": ["*-app"]
23+
},
24+
{
25+
"range": "^",
26+
"label": "publishable-packages",
27+
"dependencyTypes": ["peer", "prod"],
28+
"dependencies": ["**"],
29+
"packages": ["@soluble/*"]
30+
},
31+
],
32+
"sortAz": [
33+
"contributors",
34+
"dependencies",
35+
"devDependencies",
36+
"peerDependencies",
37+
"resolutions"
38+
],
39+
"sortFirst": ["name", "description", "version", "private", "license", "author", "homepage", "repository", "keywords", "sideEffects", "browserslist", "type", "main", "module", "types", "exports", "typesVersions?", "typesVersions", "files", "resolutions?", "resolutions", "scripts", "workspaces", "engine", "packageManager"],
40+
"source": ["examples/**", "packages/**", "./package.json"],
41+
"versionGroups": []
42+
}

CHANGELOG.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ This project adheres to [semantic versioning](https://semver.org/).
55
All notable changes to this project are documented in their respective packages
66

77
- [@soluble/cache-interop](./packages/cache-interop/CHANGELOG.md)
8-
- [@soluble/cache-ioredis](./packages/cache-ioredis/CHANGELOG.md)
8+
- [@soluble/cache-ioredis](./packages/cache-ioredis/CHANGELOG.md)
99
- [@soluble/cache-redis](./packages/cache-redis/CHANGELOG.md)
1010
- [@soluble/dsn-parser](./packages/dsn-parser/CHANGELOG.md)
1111

1212
and on the [github release page](https://github.com/soluble-io/cache-interop/releases).
13-
14-
15-
16-

CODE_OF_CONDUCT.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,23 @@ diverse, inclusive, and healthy community.
1717
Examples of behavior that contributes to a positive environment for our
1818
community include:
1919

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
22-
* Giving and gracefully accepting constructive feedback
23-
* Accepting responsibility and apologizing to those affected by our mistakes,
20+
- Demonstrating empathy and kindness toward other people
21+
- Being respectful of differing opinions, viewpoints, and experiences
22+
- Giving and gracefully accepting constructive feedback
23+
- Accepting responsibility and apologizing to those affected by our mistakes,
2424
and learning from the experience
25-
* Focusing on what is best not just for us as individuals, but for the
25+
- Focusing on what is best not just for us as individuals, but for the
2626
overall community
2727

2828
Examples of unacceptable behavior include:
2929

30-
* The use of sexualized language or imagery, and sexual attention or
30+
- The use of sexualized language or imagery, and sexual attention or
3131
advances of any kind
32-
* Trolling, insulting or derogatory comments, and personal or political attacks
33-
* Public or private harassment
34-
* Publishing others' private information, such as a physical or email
32+
- Trolling, insulting or derogatory comments, and personal or political attacks
33+
- Public or private harassment
34+
- Publishing others' private information, such as a physical or email
3535
address, without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
36+
- Other conduct which could reasonably be considered inappropriate in a
3737
professional setting
3838

3939
## Enforcement Responsibilities
@@ -106,7 +106,7 @@ Violating these terms may lead to a permanent ban.
106106
### 4. Permanent Ban
107107

108108
**Community Impact**: Demonstrating a pattern of violation of community
109-
standards, including sustained inappropriate behavior, harassment of an
109+
standards, including sustained inappropriate behavior, harassment of an
110110
individual, or aggression toward or disparagement of classes of individuals.
111111

112112
**Consequence**: A permanent ban from any sort of public interaction within

CONTRIBUTING.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Contributions are welcome.
1313
## Scripts
1414

1515
| Name | Description |
16-
|------------------------------|------------------------------------------------------------------|
16+
| ---------------------------- | ---------------------------------------------------------------- |
1717
| `yarn g:changeset` | Add a changeset to declare version bumps. |
1818
| `yarn g:typecheck` | Run typechecks all packages. |
1919
| `yarn g:lint` | Display linter issues in all packages. |
@@ -62,4 +62,3 @@ This repo adheres to the [conventional commit](https://www.conventionalcommits.o
6262
- **test**: Adding missing tests or correcting existing tests
6363
- **translation**: Adding missing translations or correcting existing ones
6464
- **revert**: When reverting a commit
65-

examples/nextjs-cjs/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
"version": "0.1.12",
44
"private": true,
55
"scripts": {
6-
"dev": "next dev",
76
"build": "cross-env TSCONFIG=./tsconfig.no-paths.json next build",
8-
"start": "next start",
97
"clean": "rimraf ./.next ./out ./coverage ./tsconfig.tsbuildinfo ./node_modules/.cache",
10-
"typecheck": "tsc --project tsconfig.json --noEmit",
8+
"dev": "next dev",
9+
"fix-staged": "lint-staged --allow-empty",
1110
"lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mjs,.cjs,.mts,.cts --cache --cache-location ../../.cache/eslint/nextjs-cjs.eslintcache",
12-
"fix-staged": "lint-staged --allow-empty"
11+
"start": "next start",
12+
"typecheck": "tsc --project tsconfig.json --noEmit"
1313
},
1414
"dependencies": {
1515
"@soluble/cache-interop": "workspace:^",

examples/nextjs-esm/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"dev": "next dev",
87
"build": "cross-env TSCONFIG=./tsconfig.no-paths.json next build",
9-
"start": "next start",
108
"clean": "rimraf ./.next ./coverage ./tsconfig.tsbuildinfo ./node_modules/.cache",
11-
"typecheck": "tsc --project tsconfig.json --noEmit",
9+
"dev": "next dev",
10+
"fix-staged": "lint-staged --allow-empty",
1211
"lint": "eslint . --ext .ts,.tsx,.js,.jsx,.mjs,.cjs,.mts,.cts --cache --cache-location ../../.cache/eslint/nextjs-esm.eslintcache",
13-
"fix-staged": "lint-staged --allow-empty"
12+
"start": "next start",
13+
"typecheck": "tsc --project tsconfig.json --noEmit"
1414
},
1515
"dependencies": {
1616
"@soluble/cache-interop": "workspace:^",

package.json

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,49 +2,57 @@
22
"name": "cache-interop-monorepo",
33
"private": true,
44
"license": "MIT",
5-
"homepage": "https://github.com/soluble-io/cache-interop",
6-
"repository": {
7-
"type": "git",
8-
"url": "https://github.com/soluble-io/cache-interop.git"
9-
},
105
"author": {
116
"name": "Vanvelthem Sébastien",
127
"url": "https://github.com/belgattitude"
138
},
14-
"workspaces": {
15-
"packages": [
16-
"examples/*",
17-
"packages/*"
18-
]
9+
"homepage": "https://github.com/soluble-io/cache-interop",
10+
"repository": "soluble-io/cache-interop.git",
11+
"resolutions?": {
12+
"eslint-plugin-react-hooks": "https://github.com/vercel/next.js/issues/52365"
13+
},
14+
"resolutions": {
15+
"eslint-plugin-react-hooks": "4.6.0"
1916
},
2017
"scripts": {
21-
"postinstall": "is-ci || husky install",
18+
"?build-release": "When https://github.com/atlassian/changesets/issues/432 has a solution we can remove this trick",
19+
"check:codecov-config": "curl --data-binary @codecov.yml https://codecov.io/validate",
20+
"check:install": "yarn dlx @yarnpkg/doctor@^3.1.3 .",
21+
"clean:global-cache": "rimraf ./.cache",
22+
"deps:check": "npx npm-check-updates@latest --configFileName ncurc.yml --workspaces --root --mergeConfig",
23+
"deps:update": "npx npm-check-updates@latest --configFileName ncurc.yml -u --workspaces --root --mergeConfig",
2224
"g:build": "yarn g:build-release",
25+
"g:build-api-doc": "yarn workspaces foreach -pv run build-api-doc",
2326
"g:build-packages": "yarn workspaces foreach -v --no-private run build",
24-
"?build-release": "When https://github.com/atlassian/changesets/issues/432 has a solution we can remove this trick",
2527
"g:build-release": "yarn workspaces foreach -tv run build-release",
26-
"g:size-limit": "yarn workspaces foreach -v --no-private run size-limit",
28+
"g:changeset": "changeset",
2729
"g:check-dist": "yarn workspaces foreach -v --no-private run check-dist",
2830
"g:check-pub": "yarn workspaces foreach -v --no-private run check-pub",
31+
"g:ci-coverage-upload": "yarn workspaces foreach -tv run ci-coverage-upload",
2932
"g:clean": "yarn clean:global-cache && yarn workspaces foreach -pv run clean",
30-
"g:build-api-doc": "yarn workspaces foreach -pv run build-api-doc",
33+
"g:fix-staged": "yarn workspaces foreach -t run fix-staged",
34+
"g:lint": "yarn workspaces foreach -pv run lint",
35+
"g:lint-staged-files": "lint-staged --allow-empty",
36+
"g:release": "yarn g:build-release && changeset publish",
37+
"g:size-limit": "yarn workspaces foreach -v --no-private run size-limit",
3138
"g:test": "run-s g:test-unit g:test-e2e",
32-
"g:test-unit": "yarn workspaces foreach -ptv --exclude '@soluble/*e2e*' --exclude 'cache-interop-docs' run test-unit",
3339
"g:test-e2e": "yarn workspaces foreach -ptv --include '@soluble/*e2e*' --exclude 'cache-interop-docs' run test-e2e",
34-
"g:changeset": "changeset",
35-
"g:release": "yarn g:build-release && changeset publish",
40+
"g:test-unit": "yarn workspaces foreach -ptv --exclude '@soluble/*e2e*' --exclude 'cache-interop-docs' run test-unit",
3641
"g:typecheck": "yarn workspaces foreach -ptv run typecheck",
37-
"g:lint": "yarn workspaces foreach -pv run lint",
38-
"g:lint-staged-files": "lint-staged --allow-empty",
39-
"g:fix-staged": "yarn workspaces foreach -t run fix-staged",
40-
"g:ci-coverage-upload": "yarn workspaces foreach -tv run ci-coverage-upload",
41-
"deps:check": "npx npm-check-updates@latest --configFileName ncurc.yml --workspaces --root --mergeConfig",
42-
"deps:update": "npx npm-check-updates@latest --configFileName ncurc.yml -u --workspaces --root --mergeConfig",
43-
"check:install": "yarn dlx @yarnpkg/doctor@^3.1.3 .",
44-
"check:codecov-config": "curl --data-binary @codecov.yml https://codecov.io/validate",
4542
"nuke:node_modules": "rimraf --glob '**/node_modules'",
46-
"clean:global-cache": "rimraf ./.cache"
43+
"postinstall": "is-ci || husky install",
44+
"syncpack:check": "syncpack lint-semver-ranges --types prod,dev --source \"package.json\" --source \"packages/*/package.json\"",
45+
"syncpack:format": "syncpack format",
46+
"syncpack:list": "syncpack list-semver-ranges --types prod,dev --source \"package.json\" --source \"packages/*/package.json\"",
47+
"prettier:format": "prettier --config .prettierrc.js --cache --cache-location=\".cache/prettier/monorepo.prettiercache\" --ignore-path .prettierignore \"**/*.{js,cjs,mjs,ts,mts,md,mdx,json}\" --write"
4748
},
49+
"workspaces": {
50+
"packages": [
51+
"examples/*",
52+
"packages/*"
53+
]
54+
},
55+
"packageManager": "[email protected]",
4856
"dependenciesMeta": {
4957
"cpu-features": {
5058
"built": false
@@ -72,18 +80,12 @@
7280
"npm-run-all": "4.1.5",
7381
"prettier": "3.0.0",
7482
"rimraf": "5.0.1",
75-
"shell-quote": "1.8.1"
83+
"shell-quote": "1.8.1",
84+
"syncpack": "10.7.3"
7685
},
7786
"engines": {
7887
"node": "^14.13.1 || >=16",
7988
"yarn": ">=1.19.0",
8089
"npm": "please-use-yarn"
81-
},
82-
"packageManager": "[email protected]",
83-
"resolutions?": {
84-
"eslint-plugin-react-hooks": "https://github.com/vercel/next.js/issues/52365"
85-
},
86-
"resolutions": {
87-
"eslint-plugin-react-hooks": "4.6.0"
8890
}
8991
}

0 commit comments

Comments
 (0)