Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update all dependencies #33

Merged
merged 3 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 5 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.19
go-version: 1.22

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
Expand All @@ -37,22 +37,13 @@ jobs:
with:
fetch-depth: 0

- name: Setup PNPM
uses: pnpm/action-setup@v4
with:
version: 7

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 18
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- name: Setup BUN
uses: oven-sh/setup-bun@v1

- name: Install Dependencies
run: pnpm install --frozen-lockfile
run: bun install --frozen-lockfile

- name: Release binary
run: npm publish
run: bun run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 1 addition & 4 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec commitlint --edit "$1"
bunx commitlint --edit "$1"
7 changes: 2 additions & 5 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

[ -n "$CI" ] && exit 0

changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
Expand All @@ -9,6 +6,6 @@ hasChanged() {
echo "$changedFiles" | grep -q "$1"
}

if hasChanged 'pnpm-lock.yaml'; then
pnpm install
if hasChanged 'bun.lockb'; then
bun install
fi
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

[ -n "$CI" ] && exit 0

pnpm exec lint-staged
bunx lint-staged
5 changes: 1 addition & 4 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

[ -n "$CI" ] && exit 0

npx use-correct-pm
bunx use-correct-pm bun
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"[go]": {
"editor.defaultFormatter": "golang.go",
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
},
"[go.mod]": {
"editor.formatOnPaste": false,
"editor.formatOnSave": false,
"editor.defaultFormatter": "golang.go",
"editor.codeActionsOnSave": {
"source.organizeImports": false
"source.organizeImports": "never"
}
},
"go.lintTool": "golangci-lint",
Expand Down
Binary file added bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion cmd/use_correct_pm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var rootCmd = &cobra.Command{
Short: "A simple check of the usage of the correct package manager",
Long: `Check if the correct package manager is used.
Available are 'BUN', 'NPM', 'Yarn' and 'PNPM'.`,
Run: func(cmd *cobra.Command, args []string) {
Run: func(_ *cobra.Command, args []string) {
chosenPackageManager := pm.GetSelectedPackageManager(args)
errors := pm.GetCheckLockFilesErrors(chosenPackageManager)
hasErrors := len(errors) > 0
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module github.com/mheob/use-correct-pm

go 1.21

require github.com/spf13/cobra v1.7.0
require github.com/spf13/cobra v1.8.0

require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down
6 changes: 3 additions & 3 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=
github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/spf13/cobra v1.7.0 h1:hyqWnYt1ZQShIddO5kBpj3vu05/++x6tJ6dg8EC572I=
github.com/spf13/cobra v1.7.0/go.mod h1:uLxZILRyS/50WlhOIKD7W6V5bgeIt+4sICxh6uRMrb0=
github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0=
github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@
"files": [],
"scripts": {
"postinstall": "is-ci || go-npm install",
"prepare": "is-ci || husky install",
"sort-package-json": "pnpm dlx sort-package-json",
"prepare": "husky",
"publish": "npm publish",
"sort-package-json": "bunx sort-package-json",
"preuninstall": "go-npm uninstall"
},
"commitlint": {
Expand All @@ -28,17 +29,17 @@
]
},
"lint-staged": {
"package.json": "npx sort-package-json"
"package.json": "bunx sort-package-json"
},
"dependencies": {
"@go-task/go-npm": "^0.2.0",
"is-ci": "^3.0.1"
},
"devDependencies": {
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"husky": "^8.0.3",
"lint-staged": "^15.0.2"
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"husky": "^9.0.11",
"lint-staged": "^15.2.2"
},
"publishConfig": {
"access": "public"
Expand Down
Loading