Skip to content

Commit

Permalink
Merge pull request #23 from Applelo/dev
Browse files Browse the repository at this point in the history
Version 4.0.0
  • Loading branch information
Applelo authored Dec 15, 2024
2 parents c20a631 + dede1f1 commit f687afc
Show file tree
Hide file tree
Showing 32 changed files with 2,498 additions and 2,779 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/jsr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v2.2.4
uses: pnpm/action-setup@v4

- name: Use Node.js 20
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: pnpm
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dist
.DS_Store
.idea
.vscode
coverage
coverage
.astro
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Add [BrowserSync](https://browsersync.io) in your Vite project.

> This plugin supports Vite 4 and 5.
> This plugin supports Vite 5 and 6.
<p align="center">
<a href="https://github.com/Applelo/vite-plugin-browser-sync/blob/main/screenshot.png?raw=true">
Expand Down
8 changes: 5 additions & 3 deletions demo/astro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "astro",
"type": "module",
"version": "0.0.1",
"private": true,
"packageManager": "pnpm@9.15.0",
"scripts": {
"dev": "astro dev",
"start": "astro dev",
Expand All @@ -10,9 +12,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/check": "^0.8.2",
"astro": "^4.12.2",
"typescript": "^5.5.3",
"@astrojs/check": "^0.9.4",
"astro": "^5.0.5",
"typescript": "^5.7.2",
"vite-plugin-browser-sync": "workspace:*"
}
}
24 changes: 24 additions & 0 deletions demo/basic-vite5/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
15 changes: 15 additions & 0 deletions demo/basic-vite5/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions demo/basic-vite5/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite Plugin Browser Sync</title>
</head>
<body>
<h1>Vite Plugin Browser Sync</h1>

<form id="form">
<div>
<label for="firstname">First Name</label>
<input type="text" id="firstname" name="firstname" />
</div>
<div>
<label for="lastname">Last Name</label>
<input type="text" id="lastname" name="lastname" />
</div>
<input type="submit" value="Submit" />
</form>
<p id="message"></p>

<script type="module" src="/src/main.ts"></script>
</body>
</html>
18 changes: 18 additions & 0 deletions demo/basic-vite5/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "demo",
"type": "module",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@9.15.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:watch": "vite build --watch",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^5.7.2",
"vite": "^5.4.11",
"vite-plugin-browser-sync": "workspace:*"
}
}
1 change: 1 addition & 0 deletions demo/basic-vite5/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions demo/basic-vite5/src/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import './style.css'

const form = document.getElementById('form') as HTMLFormElement | null

form?.addEventListener('submit', (e) => {
e.preventDefault()
const data = new FormData(form)

const firstname = data.get('firstname')
const lastname = data.get('lastname')

const message = `Hello ${firstname} ${lastname} !`
const messageEl = document.getElementById('message')
if (messageEl)
messageEl.textContent = message
})
27 changes: 27 additions & 0 deletions demo/basic-vite5/src/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
:root {
font-family: Inter, Avenir, Helvetica, Arial, sans-serif;
font-size: 16px;
line-height: 24px;
font-weight: 400;

color-scheme: light dark;
color: #dedede;
background-color: #121212;

font-synthesis: none;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-text-size-adjust: 100%;
}

body {
margin: 0;
padding: 5vw;
min-height: 200vh;
}

h1 {
font-size: 3.2em;
line-height: 1.1;
}
1 change: 1 addition & 0 deletions demo/basic-vite5/src/typescript.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions demo/basic-vite5/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
20 changes: 20 additions & 0 deletions demo/basic-vite5/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["ESNext", "DOM"],
"useDefineForClassFields": true,
"module": "ESNext",
"moduleResolution": "Node",
"resolveJsonModule": true,
"strict": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noEmit": true,
"sourceMap": true,
"esModuleInterop": true,
"isolatedModules": true,
"skipLibCheck": true
},
"include": ["src"]
}
35 changes: 35 additions & 0 deletions demo/basic-vite5/vite.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { defineConfig } from 'vite'
import VitePluginBrowserSync from 'vite-plugin-browser-sync'

export default defineConfig({
// build: {
// watch: {},
// },
plugins: [
VitePluginBrowserSync({
dev: {
enable: true,
bs: {
online: true,
},
},
preview: {
enable: true,
bs: {
proxy: 'http://localhost:3000',
},
},
buildWatch: {
enable: true,
// mode: 'snippet',
bs: {
// server: 'dist',
proxy: 'http://localhost:3000',
// proxy: {
// target: 'http://localhost:3000',
// },
},
},
}),
],
})
6 changes: 3 additions & 3 deletions demo/basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"type": "module",
"version": "0.0.0",
"private": true,
"packageManager": "pnpm@9.5.0",
"packageManager": "pnpm@9.15.0",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build:watch": "vite build --watch",
"preview": "vite preview"
},
"devDependencies": {
"typescript": "^5.5.3",
"vite": "^5.3.4",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vite-plugin-browser-sync": "workspace:*"
}
}
2 changes: 1 addition & 1 deletion demo/basic/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import VitePluginBrowserSync from 'vite-plugin-browser-sync'
import { defineConfig } from 'vite'
import VitePluginBrowserSync from 'vite-plugin-browser-sync'

export default defineConfig({
// build: {
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@applelo/vite-plugin-browser-sync",
"version": "3.0.4",
"version": "4.0.0",
"exports": "./src/index.ts",
"exclude": [
"test",
Expand Down
28 changes: 14 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "vite-plugin-browser-sync",
"type": "module",
"version": "3.0.4",
"packageManager": "pnpm@9.5.0",
"version": "4.0.0",
"packageManager": "pnpm@9.15.0",
"description": "Add BrowserSync in your Vite project",
"author": "Applelo",
"license": "MIT",
Expand Down Expand Up @@ -33,7 +33,7 @@
"dist"
],
"engines": {
"node": "^14.18.0 || >=16.0.0"
"node": "^18.0.0 || >=20.0.0"
},
"scripts": {
"lint": "eslint .",
Expand All @@ -46,22 +46,22 @@
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"vite": "^4.0.0 || ^5.0.0"
"vite": "^5.0.0 || ^6.0.0"
},
"dependencies": {
"@types/browser-sync": "^2.29.0",
"browser-sync": "^3.0.2",
"browser-sync": "^3.0.3",
"kolorist": "^1.8.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.23.0",
"@vitest/coverage-v8": "^2.0.3",
"eslint": "^9.7.0",
"playwright": "^1.45.2",
"rollup": "^4.18.1",
"tsup": "^8.2.0",
"typescript": "^5.5.3",
"vite": "^5.3.4",
"vitest": "^2.0.3"
"@antfu/eslint-config": "^3.12.0",
"@vitest/coverage-v8": "^2.1.8",
"eslint": "^9.17.0",
"playwright": "^1.49.1",
"rollup": "^4.28.1",
"tsup": "^8.3.5",
"typescript": "^5.7.2",
"vite": "^6.0.3",
"vitest": "^2.1.8"
}
}
Loading

0 comments on commit f687afc

Please sign in to comment.