Skip to content

Commit

Permalink
feat: support vite 5 (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Dec 7, 2023
1 parent 382a75b commit cbe57ab
Show file tree
Hide file tree
Showing 9 changed files with 817 additions and 665 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-wasps-dream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'vite-plugin-qrcode': patch
---

Support Vite 5 peer dependency
17 changes: 2 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# build and test on linux, windows, mac with node 12, 14, 16
# build and test on linux, windows, mac with node 16, 18
name: CI

on:
Expand Down Expand Up @@ -43,7 +43,7 @@ jobs:
if: (${{ success() }} || ${{ failure() }})
run: pnpm audit

# this is the test matrix, it runs with node16 on linux,windows,macos + node14,18 on linux
# this is the test matrix, it runs with node16 on linux,windows,macos + node18 on linux
# it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail)
test:
needs: checks
Expand All @@ -56,31 +56,18 @@ jobs:
node: [16]
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- node: 14
os: ubuntu-latest
- node: 18
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: install pnpm (node 14, pnpm 7)
if: matrix.node == 14
uses: pnpm/action-setup@v2
with:
version: 7
- name: install pnpm
if: matrix.node != 14
uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: install (node 14, pnpm 7)
if: matrix.node == 14
run: |
pnpm install --no-frozen-lockfile --prefer-offline --ignore-scripts
- name: install
if: matrix.node != 14
run: |
pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
- name: build
Expand Down
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,26 @@
"devDependencies": {
"@changesets/cli": "^2.26.2",
"@svitejs/changesets-changelog-github-compact": "^1.1.0",
"@types/node": "^18.18.1",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@types/node": "^20.9.1",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"cross-env": "^7.0.3",
"eslint": "^8.50.0",
"eslint": "^8.53.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-markdown": "^3.0.1",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^5.0.0",
"eslint-plugin-svelte": "^2.33.2",
"eslint-plugin-prettier": "^5.0.1",
"eslint-plugin-svelte": "^2.35.0",
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"lint-staged": "^15.1.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.0.3",
"prettier-plugin-svelte": "^3.0.3",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.0",
"rimraf": "^5.0.5",
"svelte": "^4.2.1",
"svelte": "^4.2.4",
"tsm": "^2.3.0",
"tsup": "^7.2.0",
"tsup": "^7.3.0",
"typescript": "^5.2.2"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion packages/playground/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"preview": "vite preview"
},
"devDependencies": {
"vite": "^4.4.9",
"vite": "^5.0.0",
"vite-plugin-qrcode": "workspace:*"
}
}
6 changes: 3 additions & 3 deletions packages/playground/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
"preview": "vite preview"
},
"devDependencies": {
"@sveltejs/kit": "^1.25.1",
"svelte": "^4.2.1",
"vite": "^4.4.9",
"@sveltejs/kit": "^1.27.6",
"svelte": "^4.2.4",
"vite": "^5.0.0",
"vite-plugin-qrcode": "workspace:*"
},
"type": "module"
Expand Down
2 changes: 1 addition & 1 deletion packages/vite-plugin-qrcode/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 [these people](https://github.com/svitejs/vite-plugin-qrcode/graphs/contributors)
Copyright (c) 2023 [these people](https://github.com/svitejs/vite-plugin-qrcode/graphs/contributors)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 3 additions & 3 deletions packages/vite-plugin-qrcode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@
"qrcode-terminal": "^0.12.0"
},
"peerDependencies": {
"vite": "^3.0.0 || ^4.0.0"
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0"
},
"devDependencies": {
"@types/qrcode-terminal": "^0.12.0",
"@types/qrcode-terminal": "^0.12.2",
"uvu": "^0.5.6",
"vite": "^4.4.9"
"vite": "^5.0.0"
}
}
4 changes: 2 additions & 2 deletions packages/vite-plugin-qrcode/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Plugin, PreviewServerForHook, ViteDevServer } from 'vite';
import type { Plugin, PreviewServer, ViteDevServer } from 'vite';
import qr from 'qrcode-terminal';

export function qrcode(options: PluginOptions = {}): Plugin {
Expand Down Expand Up @@ -32,7 +32,7 @@ export function qrcode(options: PluginOptions = {}): Plugin {
};
}

function logQrcode(server: ViteDevServer | PreviewServerForHook, options: PluginOptions) {
function logQrcode(server: ViteDevServer | PreviewServer, options: PluginOptions) {
let networkUrls = server.resolvedUrls?.network;

if (!networkUrls) return;
Expand Down
Loading

0 comments on commit cbe57ab

Please sign in to comment.