Skip to content

Commit

Permalink
Merge pull request #2 from drwpow/update-deps
Browse files Browse the repository at this point in the history
Update deps, reformat
  • Loading branch information
drwpow authored Mar 6, 2024
2 parents 735f984 + 9fb3a08 commit 99af673
Show file tree
Hide file tree
Showing 21 changed files with 1,323 additions and 1,345 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: ci

on:
push:
branches:
- main
pull_request:

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v2
with:
version: latest
- run: pnpm i
- run: pnpm run lint
test-node-versions:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 21.x]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v2
with:
version: latest
- run: pnpm i
- run: pnpm run build
- run: pnpm test
5 changes: 2 additions & 3 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"bracketSpacing": false,
"printWidth": 240,
"singleQuote": true,
"useTabs": true
"printWidth": 160,
"singleQuote": true
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Inspired by [webpack-bundle-analyzer](https://github.com/webpack-contrib/webpack

### Requirements

- **Vite 4.x**. For most users on 3.x this should be a painless upgrade.
- **Vite 4.x/5.x**
- `"type": "module"` enabled in your project’s `package.json` ([docs](https://nodejs.org/api/packages.html#type))

### Installing
Expand Down
2 changes: 1 addition & 1 deletion example/vite-react/bundlemeta.json

Large diffs are not rendered by default.

18 changes: 9 additions & 9 deletions example/vite-react/index.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>vite-plugin-bundlesize example</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="src/index.tsx"></script>
</body>
<head>
<meta charset="UTF-8" />
<title>vite-plugin-bundlesize example</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="src/index.tsx"></script>
</body>
</html>
51 changes: 26 additions & 25 deletions example/vite-react/package.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
{
"name": "@example/vite-react",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "vite build",
"dev": "vite dev",
"dev:viz": "bundlesize viz"
},
"dependencies": {
"@apollo/client": "^3.7.7",
"graphql": "^16.6.0",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.8.1",
"three": "^0.147.0"
},
"devDependencies": {
"@types/react": "^18.0.27",
"@types/react-dom": "^18.0.10",
"@vitejs/plugin-react-swc": "^3.1.0",
"typescript": "^4.9.5",
"vite": "^4.1.1",
"vite-plugin-bundlesize": "^0.0.7"
}
"name": "@example/vite-react",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"build": "vite build",
"dev": "vite dev",
"dev:viz": "bundlesize viz"
},
"dependencies": {
"@apollo/client": "^3.9.5",
"graphql": "^16.8.1",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.22.2",
"three": "^0.147.0"
},
"devDependencies": {
"@types/react": "^18.2.63",
"@types/react-dom": "^18.2.20",
"@vitejs/plugin-react-swc": "^3.6.0",
"typescript": "^5.3.3",
"vite": "^5.1.5",
"vite-plugin-bundlesize": "workspace:^"
}
}
36 changes: 18 additions & 18 deletions example/vite-react/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
import React from 'react';
import { createBrowserRouter, RouterProvider } from 'react-router-dom';
import {createBrowserRouter, RouterProvider} from 'react-router-dom';
import IndexPage from './pages/index.js';
import AboutPage from './pages/about.js';
import PokemonViewPage from './pages/pokemon/[number].js';

const router = createBrowserRouter([
{
path: '/',
element: <IndexPage />,
},
{
path: '/pokemon/:no',
element: <PokemonViewPage />,
},
{
path: '/about',
element: <AboutPage />,
},
{
path: '/',
element: <IndexPage />,
},
{
path: '/pokemon/:no',
element: <PokemonViewPage />,
},
{
path: '/about',
element: <AboutPage />,
},
]);

export default function App() {
return (
<div>
<RouterProvider router={router} />
</div>
);
return (
<div>
<RouterProvider router={router} />
</div>
);
}
14 changes: 7 additions & 7 deletions example/vite-react/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import React from 'react';
import { createRoot } from 'react-dom/client';
import { ApolloClient, InMemoryCache, ApolloProvider } from '@apollo/client';
import {createRoot} from 'react-dom/client';
import {ApolloClient, InMemoryCache, ApolloProvider} from '@apollo/client';
import App from './App.js';

const client = new ApolloClient({
uri: 'https://beta.pokeapi.co/graphql/v1beta',
cache: new InMemoryCache(),
uri: 'https://beta.pokeapi.co/graphql/v1beta',
cache: new InMemoryCache(),
});

const root = createRoot(document.getElementById('app') as HTMLDivElement);
root.render(
<ApolloProvider client={client}>
<App />
</ApolloProvider>
<ApolloProvider client={client}>
<App />
</ApolloProvider>,
);
2 changes: 1 addition & 1 deletion example/vite-react/src/pages/about.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

export default function AboutPage() {
return <h1>About page</h1>;
return <h1>About page</h1>;
}
2 changes: 1 addition & 1 deletion example/vite-react/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

export default function IndexPage() {
return <h1>Index page</h1>;
return <h1>Index page</h1>;
}
2 changes: 1 addition & 1 deletion example/vite-react/src/pages/pokemon/[number].tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';

export default function PokemonViewPage() {
return <h1>PokemonView page</h1>;
return <h1>PokemonView page</h1>;
}
24 changes: 12 additions & 12 deletions example/vite-react/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["DOM"],
"module": "ESNext",
"moduleResolution": "Node",
"skipLibCheck": true,
"strict": true,
"target": "ESNext"
},
"include": ["src"]
"compilerOptions": {
"allowSyntheticDefaultImports": true,
"isolatedModules": true,
"jsx": "react",
"lib": ["DOM"],
"module": "ESNext",
"moduleResolution": "Node",
"skipLibCheck": true,
"strict": true,
"target": "ESNext"
},
"include": ["src"]
}
18 changes: 9 additions & 9 deletions example/vite-react/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {defineConfig} from 'vite';
import bundlesize from 'vite-plugin-bundlesize';

export default defineConfig({
plugins: [
react(),
bundlesize({
entrypoints: [{src: 'assets/index-*.js', limit: '120 kB'}],
}),
],
build: {
sourcemap: 'hidden',
},
plugins: [
react(),
bundlesize({
entrypoints: [{src: 'assets/index-*.js', limit: '120 kB'}],
}),
],
build: {
sourcemap: 'hidden',
},
});
120 changes: 60 additions & 60 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
{
"name": "vite-plugin-bundlesize",
"version": "0.0.7",
"description": "Monitor bundle sizes and analyze bundle contents",
"type": "module",
"scripts": {
"build": "npm run clean && npm run build:ts",
"build:ts": "tsc",
"dev": "npm run build:core -- --watch",
"clean": "del dist",
"lint": "eslint",
"test": "vitest run",
"test:js": "vitest run",
"test:ts": "tsc --noEmit",
"version": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/drwpow/vite-plugin-bundlesize.git"
},
"keywords": [
"vite",
"bundle",
"esbuild",
"bundlesize",
"webpack-bundle-analyzer"
],
"author": {
"name": "Drew Powers",
"email": "drew@pow.rs"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/drwpow/vite-plugin-bundlesize/issues"
},
"homepage": "https://github.com/drwpow/vite-plugin-bundlesize#readme",
"bin": {
"bundlesize": "./bin/cli.js"
},
"main": "dist/plugin/index.js",
"peerDependencies": {
"vite": ">= 3.0.0"
},
"dependencies": {
"picomatch": "^2.3.1",
"vlq": "^2.0.4"
},
"devDependencies": {
"@types/node": "^20.3.1",
"@types/picomatch": "^2.3.0",
"@typescript-eslint/eslint-plugin": "^5.59.11",
"@typescript-eslint/parser": "^5.59.11",
"del-cli": "^5.0.0",
"eslint": "^8.42.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"prettier": "^2.8.8",
"typescript": "^4.9.5",
"vite": "^4.3.9",
"vitest": "^0.32.0"
}
"name": "vite-plugin-bundlesize",
"version": "0.0.7",
"description": "Monitor bundle sizes and analyze bundle contents",
"type": "module",
"scripts": {
"build": "npm run clean && npm run build:ts",
"build:ts": "tsc",
"dev": "npm run build:core -- --watch",
"clean": "del dist",
"lint": "eslint",
"test": "vitest run",
"test:js": "vitest run",
"test:ts": "tsc --noEmit",
"version": "npm run build"
},
"repository": {
"type": "git",
"url": "git+https://github.com/drwpow/vite-plugin-bundlesize.git"
},
"keywords": [
"vite",
"bundle",
"esbuild",
"bundlesize",
"webpack-bundle-analyzer"
],
"author": {
"name": "Drew Powers",
"email": "drew@pow.rs"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/drwpow/vite-plugin-bundlesize/issues"
},
"homepage": "https://github.com/drwpow/vite-plugin-bundlesize#readme",
"bin": {
"bundlesize": "./bin/cli.js"
},
"main": "dist/plugin/index.js",
"peerDependencies": {
"vite": ">= 3.0.0"
},
"dependencies": {
"picomatch": "^2.3.1",
"vlq": "^2.0.4"
},
"devDependencies": {
"@types/node": "^20.11.24",
"@types/picomatch": "^2.3.3",
"@typescript-eslint/eslint-plugin": "^7.1.1",
"@typescript-eslint/parser": "^7.1.1",
"del-cli": "^5.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"prettier": "^3.2.5",
"typescript": "^5.3.3",
"vite": "^5.1.5",
"vitest": "^1.3.1"
}
}
Loading

0 comments on commit 99af673

Please sign in to comment.