Skip to content

Commit

Permalink
v3: Vite 5 & ESM [publish]
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnaudBarre committed Nov 28, 2023
1 parent 9ba7932 commit c5a0a24
Show file tree
Hide file tree
Showing 15 changed files with 1,120 additions and 1,585 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 3.0.0

- Add vite@5 to peer dependency ranges
- Switch plugin to ESM. This removes the CJS warning when using the plugin with Vite 5. A CJS wrapper is still provided but [migrating](https://vitejs.dev/guide/migration.html#deprecate-cjs-node-api) to running Vite in ESM is encouraged
- Drop support for Vite 2 & 3 & node<18 (aligns with Vite 5)

## 2.0.0

Context menu on option+right click to see all the intermediate components and jump to the right place!
Expand Down
Binary file modified bun.lockb
Binary file not shown.
21 changes: 11 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "vite-plugin-react-click-to-component",
"version": "2.0.0",
"type": "module",
"version": "3.0.0",
"license": "MIT",
"scripts": {
"postinstall": "cd playground && bun i",
Expand All @@ -9,7 +10,7 @@
"tsc": "tsc",
"lint": "bun lint-ci --fix --cache",
"lint-ci": "eslint src scripts --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"prettier": "yarn prettier-ci --write",
"prettier": "bun prettier-ci --write",
"prettier-ci": "prettier --ignore-path=.gitignore --check '**/*.{ts,tsx,html,css,json,md,yml}'",
"ci": "tsc && bun lint-ci && bun prettier-ci && bun run build && cd playground && tsc && bun lint-ci"
},
Expand All @@ -18,15 +19,15 @@
},
"peerDependencies": {
"react": ">=16",
"vite": "^2 || ^3 || ^4"
"vite": "^4 || ^5"
},
"devDependencies": {
"@arnaud-barre/eslint-config": "^1.0.19",
"@nabla/tnode": "^0.8.0",
"@types/node": "^18.14.0",
"eslint": "^8.34.0",
"prettier": "^2.8.4",
"typescript": "^4.9.5",
"vite": "^4.1.4"
"@arnaud-barre/eslint-config": "^3.1.5",
"@arnaud-barre/tnode": "^0.19.2",
"@types/node": "^18.18.9",
"eslint": "^8.54.0",
"prettier": "3.0.3",
"typescript": "~5.2.2",
"vite": "^5.0.0"
}
}
Binary file modified playground/bun.lockb
Binary file not shown.
5 changes: 3 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "playground",
"type": "module",
"private": true,
"scripts": {
"dev": "vite",
Expand All @@ -10,7 +11,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react-swc": "^3.2.0"
"@types/react-dom": "^18.2.17",
"@vitejs/plugin-react-swc": "^3.5.0"
}
}
28 changes: 14 additions & 14 deletions playground/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
{
"include": ["src", "vite.config.ts"],
"include": ["**/*.ts", "**/*.tsx"],
"compilerOptions": {
"module": "ESNext",
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"target": "ESNext",
"target": "ES2021",
"useDefineForClassFields": true,
"jsx": "react-jsx",
"types": ["vite/client"],
"noEmit": true,
"isolatedModules": true,
"skipLibCheck": true,
"module": "ESNext",
"lib": ["ES2021", "DOM", "DOM.Iterable"],

/* Imports */
"moduleResolution": "node", // Allow `index` imports
"resolveJsonModule": true, // Allow json import
"forceConsistentCasingInFileNames": true, // Avoid difference in case between file name and import
"esModuleInterop": false,
/* Bundler mode */
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"resolveJsonModule": true,
"verbatimModuleSyntax": true,
"noEmit": true,

/* Linting */
"skipLibCheck": true,
"strict": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"useUnknownInCatchVariables": true
"useUnknownInCatchVariables": true,
"noPropertyAccessFromIndexSignature": true
}
}
4 changes: 2 additions & 2 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
import { reactClickToComponent } from "../dist";
import { reactClickToComponent } from "../dist/index.mjs";

// eslint-disable-next-line import/no-default-export
// eslint-disable-next-line @arnaud-barre/no-default-export
export default defineConfig({
plugins: [react(), reactClickToComponent()],
server: { open: true },
Expand Down
Loading

0 comments on commit c5a0a24

Please sign in to comment.