Skip to content

Commit

Permalink
Merge branch 'main' into feat/namespace-sync-state
Browse files Browse the repository at this point in the history
* main:
  chore: update github action steps (#322)
  fix: fix mdns discovery (finally) (#323)
  chore: check npm lockfile version does not change (#321)
  chore: commit hooks for lint & package-lock chk (#320)
  feat: define sync capability per namespace (#319)
  feat: add namespace to peer pre-have messages (#314)
  • Loading branch information
gmaclennan committed Oct 5, 2023
2 parents 2bab34a + 49cb4d7 commit b0b354a
Show file tree
Hide file tree
Showing 11 changed files with 139 additions and 168 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/lockfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Check Lockfile
on: pull_request
jobs:
lockfile:
name: Lockfile check
runs-on: ubuntu-latest
steps:
- name: Check out a copy of the repo
uses: actions/checkout@v4
- name: Check package-lock.json version has not been changed
uses: mansona/npm-lockfile-version@v1
with:
version: 3
4 changes: 2 additions & 2 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ jobs:
- '16.x'
- '18.x'
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
Expand Down
16 changes: 16 additions & 0 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env sh

# Exit early if this was only a file checkout, not a branch change ($3 == 1)
[ "$3" = 0 ] && exit 0

oldRef=$1
newRef=$2


changed() {
git diff --name-only "$oldRef" "$newRef" | grep "^$1" > /dev/null 2>&1
}

if changed 'package-lock.json'; then
echo "📦 package-lock.json changed. Run npm install to bring your dependencies up to date."
fi
9 changes: 9 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env sh

changed() {
git diff --name-only HEAD@{1} HEAD | grep "^$1" > /dev/null 2>&1
}

if changed 'package-lock.json'; then
echo "📦 package-lock.json changed. Run npm install to bring your dependencies up to date."
fi
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
139 changes: 1 addition & 138 deletions package-lock.json

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

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"db:generate:project": "drizzle-kit generate:sqlite --schema src/schema/project.js --out drizzle/project",
"db:generate:client": "drizzle-kit generate:sqlite --schema src/schema/client.js --out drizzle/client",
"prepack": "npm run build:types",
"postinstall": "patch-package"
"postinstall": "patch-package",
"prepare": "husky install"
},
"files": [
"src",
Expand All @@ -32,6 +33,12 @@
"semi": false,
"singleQuote": true
},
"lint-staged": {
"*.js": [
"eslint --cache --fix"
],
"*.{js,css,md}": "prettier --write"
},
"eslintConfig": {
"env": {
"commonjs": true,
Expand Down Expand Up @@ -79,7 +86,9 @@
"drizzle-kit": "^0.19.12",
"eslint": "^8.39.0",
"fastify": "^4.20.0",
"husky": "^8.0.0",
"light-my-request": "^5.10.0",
"lint-staged": "^14.0.1",
"math-random-seed": "^2.0.0",
"nanobench": "^3.0.0",
"npm-run-all": "^4.1.5",
Expand Down
Loading

0 comments on commit b0b354a

Please sign in to comment.