Skip to content

Commit

Permalink
v1.0.3 [publish]
Browse files Browse the repository at this point in the history
- Add Vite 4 to peer dependency range
- Don't show outline for non-clickable targets
- Use debug log when no React instance was found
  • Loading branch information
ArnaudBarre committed Dec 9, 2022
1 parent 940fff6 commit b1d0a96
Show file tree
Hide file tree
Showing 14 changed files with 578 additions and 556 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: xhyrom/[email protected]
with:
bun-version: "0.2.1"
- run: bun install
- run: bun ci
- uses: ArnaudBarre/npm-publish@v1.1
- uses: ArnaudBarre/npm-publish@v1
with:
working-directory: dist
npm-token: ${{ secrets.NPM_TOKEN }}
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 1.0.3

- Add Vite 4 to peer dependency range
- Don't show outline for non-clickable targets
- Use debug log when no React instance was found

## 1.0.1

Fix tooltip position for elements on the right side of the screen
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ In your Vite config:

```ts
import { defineConfig } from "vite";
import { swcReactRefresh } from "vite-plugin-swc-react-refresh"; // or @vitejs/plugin-react
import react from "@vitejs/plugin-react-swc"; // or @vitejs/plugin-react
import { reactClickToComponent } from "vite-plugin-react-click-to-component";

export default defineConfig({
plugins: [swcReactRefresh(), reactClickToComponent()],
plugins: [react(), reactClickToComponent()],
});
```
Binary file modified bun.lockb
Binary file not shown.
22 changes: 13 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "vite-plugin-react-click-to-component",
"version": "1.0.1",
"version": "1.0.3",
"license": "MIT",
"scripts": {
"postinstall": "cd playground && bun i",
"dev": "scripts/bundle.ts --dev",
"build": "scripts/bundle.ts",
"tsc": "tsc",
Expand All @@ -12,17 +13,20 @@
"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"
},
"prettier": {
"trailingComma": "all"
},
"peerDependencies": {
"react": ">=16",
"vite": "^2 || ^3"
"vite": "^2 || ^3 || ^4"
},
"devDependencies": {
"@arnaud-barre/eslint-config": "^1.0.13",
"@nabla/tnode": "^0.7.0",
"@types/node": "^18.11.4",
"eslint": "^8.26.0",
"prettier": "^2.7.1",
"typescript": "^4.8.4",
"vite": "^3.1.8"
"@arnaud-barre/eslint-config": "^1.0.17",
"@nabla/tnode": "^0.8.0",
"@types/node": "^18.11.12",
"eslint": "^8.29.0",
"prettier": "^2.8.1",
"typescript": "^4.9.4",
"vite": "^4.0.0"
}
}
Binary file modified playground/bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/react-dom": "^18.0.6",
"vite-plugin-swc-react-refresh": "^2.1.0"
"@types/react-dom": "^18.0.9",
"@vitejs/plugin-react-swc": "^3.0.0"
}
}
2 changes: 2 additions & 0 deletions playground/src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@
left: 40px;
display: flex;
align-items: center;
border: 1px solid white;
padding: 10px;
}
2 changes: 1 addition & 1 deletion playground/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ import "./index.css";
createRoot(document.getElementById("root")!).render(
<StrictMode>
<App />
</StrictMode>
</StrictMode>,
);
4 changes: 2 additions & 2 deletions playground/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { defineConfig } from "vite";
import { swcReactRefresh } from "vite-plugin-swc-react-refresh";
import react from "@vitejs/plugin-react-swc";
import { reactClickToComponent } from "../dist";

// eslint-disable-next-line import/no-default-export
export default defineConfig({
plugins: [swcReactRefresh(), reactClickToComponent()],
plugins: [react(), reactClickToComponent()],
server: { open: true },
});
198 changes: 79 additions & 119 deletions playground/yarn.lock
Original file line number Diff line number Diff line change
@@ -1,132 +1,92 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# bun ./bun.lockb --hash: 90D590E1A5BB8A04-9db21b68f1ee355f-AD9EC10C47070D42-492220feaf5267d8
# bun ./bun.lockb --hash: 7E502891CC3CE8CC-f8f63b46ff797c67-3D098B48DC753020-0c86a38c3d477462


"@swc/core@^1.2.245":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core/-/core-1.3.10.tgz"
integrity sha512-A5YjYFa45ThHOwftKqIQKNbukxJGTsdBQAqoTr+QD1/L6jbRg3xxhU5UDyVdUIULz40PH6YQiulyUVbyrjl1Iw==
"@swc/core@^1.3.21":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core/-/core-1.3.22.tgz"
integrity sha512-oQ9EPEb7NgWcGIDoVfLCuffvtC4MzVtrwjqwKzFHP8FUh1fn8+2wraOjkkDXW74BB4Hgve5ykkaHix9bebB9Ww==
dependencies:
"@swc/core-win32-x64-msvc" "1.3.10"
"@swc/core-darwin-x64" "1.3.10"
"@swc/core-linux-x64-gnu" "1.3.10"
"@swc/core-linux-x64-musl" "1.3.10"
"@swc/core-freebsd-x64" "1.3.10"
"@swc/core-win32-ia32-msvc" "1.3.10"
"@swc/core-linux-arm64-gnu" "1.3.10"
"@swc/core-linux-arm-gnueabihf" "1.3.10"
"@swc/core-darwin-arm64" "1.3.10"
"@swc/core-android-arm64" "1.3.10"
"@swc/core-linux-arm64-musl" "1.3.10"
"@swc/core-win32-arm64-msvc" "1.3.10"
"@swc/core-android-arm-eabi" "1.3.10"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.3.10.tgz"
integrity sha512-yeW0dvv7SSmb0Y1Hhr9+QceoDjn2uulcaY+LUZ9Zt2UBHl/95c7QVgjDaE2B/lSlTV5En/81/q58lXoT/IqjGw==
dependencies:
"@swc/wasm" "1.2.122"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-android-arm64/-/core-android-arm64-1.3.10.tgz"
integrity sha512-HXkUXP4Lm3Xc9qfd9J/6/YfxknWk0Esqmu6nFRikXDc691aXHDcDZ2D8SqPlhx2CZT1juuRajphOaUXMTaAP3g==
dependencies:
"@swc/wasm" "1.2.130"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.10.tgz"
integrity sha512-X1eM5LDk24W/pbGamwpMRGkQW1BC+1xYNzS38hiK5YCS20TDZwI5LIg2pTEecKl/SRt1WFMwAThUwKbp4m1HIA==

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.10.tgz"
integrity sha512-wrsv6upfEzwCGHB7y7IsdrppyywNV7C5TZDXVYv3GCUQZAFlRBar+1yHMojuPxPvyjjfHtTEr68MOhUwq9ti3w==

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-freebsd-x64/-/core-freebsd-x64-1.3.10.tgz"
integrity sha512-tJ+ncGIZcueU3RVuQtawLvU0zGza4YKH7aD9unaypFE6e0qx34EX7fzObAhTUi881muEFIU/mDKmVpFqdEi7QQ==
dependencies:
"@swc/wasm" "1.2.130"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.10.tgz"
integrity sha512-4IsAIBk1zdzTINZR5+kPE170yyIQMY76R/yKxtHuzMYxhOaErxsObokttyZ9k9ImlZRujTzEn3A5SsZ/EvibUA==
dependencies:
"@swc/wasm" "1.2.130"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.10.tgz"
integrity sha512-OaOd+wFbcTQwOD9Ce5luUp8qYoEvdX3s00Bby+j7hybu1fVZK4W40cqzVRp/EDElriG0I+tAdFvQW7PCcEzsPQ==

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.10.tgz"
integrity sha512-AUzQ/5T2hoNIgZlnbflDufWDEfJbw+w8FwKoCp7kKyLLAXG8RHgTsx0TazzQ8PVcAQk8lWI2EBrObLL82n91kQ==

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.10.tgz"
integrity sha512-rjAyQVRkHCWvCA0wyk0nhJdVMfown6wLvDztKZ0wyT6NDDFdvekTMgALQXL5MW4Q0MYBvGMSauoysTZCdZW9aA==

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.10.tgz"
integrity sha512-X5KFbPTxcXaycGOrKoiPNCBUOjhCf8GpeNFpM7QASEWulWWM7nkMPrNeXKmQgJBlRT2j3iLine4Pkyc2bLPlVg==

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.10.tgz"
integrity sha512-KcQIERfwGyTAcJOnqGsFbRtU6wSm91xwYFVYjeYy2aNU/SKQ5rtwPTW1UAaUDdwDcS1Y49fNWWj+GPtdaZ+WXQ==
dependencies:
"@swc/wasm" "1.2.130"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.10.tgz"
integrity sha512-bNpFGZX8tNkwWbQyFRSO+wJ9BgE38ItEodTUXmBsC1xhsHPYLYMlP+6lDKvkO7+jzRMLbyWWUyoWXCEfkvdYWw==
dependencies:
"@swc/wasm" "1.2.130"

"@swc/[email protected]":
version "1.3.10"
resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.10.tgz"
integrity sha512-40yeeov6XcJHm99anMeEn/NwhDcoM2fhBQHWRVZfCa43QC45AUjJ3kWrD76U6MPGnGy7MsCOXdFyu1mJOAHKEw==

"@swc/[email protected]":
version "1.2.122"
resolved "https://registry.npmjs.org/@swc/wasm/-/wasm-1.2.122.tgz"
integrity sha512-sM1VCWQxmNhFtdxME+8UXNyPNhxNu7zdb6ikWpz0YKAQQFRGT5ThZgJrubEpah335SUToNg8pkdDF7ibVCjxbQ==

"@swc/[email protected]":
version "1.2.130"
resolved "https://registry.npmjs.org/@swc/wasm/-/wasm-1.2.130.tgz"
integrity sha512-rNcJsBxS70+pv8YUWwf5fRlWX6JoY/HJc25HD/F8m6Kv7XhJdqPPMhyX6TKkUBPAG7TWlZYoxa+rHAjPy4Cj3Q==
"@swc/core-win32-x64-msvc" "1.3.22"
"@swc/core-darwin-x64" "1.3.22"
"@swc/core-linux-x64-gnu" "1.3.22"
"@swc/core-linux-x64-musl" "1.3.22"
"@swc/core-win32-ia32-msvc" "1.3.22"
"@swc/core-linux-arm64-gnu" "1.3.22"
"@swc/core-linux-arm-gnueabihf" "1.3.22"
"@swc/core-darwin-arm64" "1.3.22"
"@swc/core-linux-arm64-musl" "1.3.22"
"@swc/core-win32-arm64-msvc" "1.3.22"

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.22.tgz"
integrity sha512-MMhtPsuXp8gpUgr9bs+RZQ2IyFGiUNDG93usCDAFgAF+6VVp+YaAVjET/3/Bx5Lk2WAt0RxT62C9KTEw1YMo3w==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-darwin-x64/-/core-darwin-x64-1.3.22.tgz"
integrity sha512-SG6QbNat4GZ5VJU3Zo6a54oQOtbhJVE6BCQw4JjOCZJmAeBzNebGy9wsT4+fCJNHC3C5qtaRw7ToXJvLniXwfg==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.3.22.tgz"
integrity sha512-4E+TdQT1oHnHjDaPs/DyrRy9lOuFd6ncEd67yYA4j9lFqt6nuz/jnXss45k8KU7wR5kOTtdW73xPwkU4NbOWdw==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.3.22.tgz"
integrity sha512-6VcynOMbOBcbLutIPENI3Ejvg5LGz/Pwvzm25hM0FoiEtPxHA+tawQUwLx8Alk1Yr+Rnqid06UEZ0veJOGn2pQ==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.3.22.tgz"
integrity sha512-86RxGy0L3qa4De3xWHx8vL2caTxvSLSWTlgUW/Yd4l1pvrCFibMjhkImGu5ViKiReX9DlBtJ7CBs4dln2kHidw==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.22.tgz"
integrity sha512-FLkbiqsdXsVIFZi6iedx4rSBGX8x0vo/5aDlklSxJAAYOcQpO0QADKP5Yr65iMT1d6ABCt2d+/StpGLF7GWOcA==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.22.tgz"
integrity sha512-giBuw+Z0Bq6fpZ0Y5TcfpcQwf9p/cE1fOQyO/K1XSTn/haQOqFi7421Jq/dFThSARZiXw1u9Om9VFbwxr8VI+A==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.3.22.tgz"
integrity sha512-loKGO+ZM2By6VdrmVJk1G79jVgDPaee93qLFuis5KyeoLLb4m1MlNMc/6SIDZUSuYg6NqaGP1spFeiFetMQ4Zg==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.3.22.tgz"
integrity sha512-lvNWAZ3QjXMsrsch6oLLQVikT/hC/4ZcLrTBXa14HwQylaYigkGElgp3ekJr78HjWDPwB46GXwBbNMG0VNAfvA==

"@swc/[email protected]":
version "1.3.22"
resolved "https://registry.npmjs.org/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.22.tgz"
integrity sha512-ESyn4lZXAKEE3mcTaDfXatsolCiEfVGstsXdgBmZYa6o1IE1bDW8FE7Ob/Y+82WTpm9+A9ZYXYjZ62t67POHZg==

"@types/prop-types@*":
version "15.7.5"
resolved "https://registry.npmjs.org/@types/prop-types/-/prop-types-15.7.5.tgz"
integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==

"@types/react@*":
version "18.0.21"
resolved "https://registry.npmjs.org/@types/react/-/react-18.0.21.tgz"
integrity sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA==
version "18.0.25"
resolved "https://registry.npmjs.org/@types/react/-/react-18.0.25.tgz"
integrity sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==
dependencies:
"@types/prop-types" "*"
"@types/scheduler" "*"
csstype "^3.0.2"

"@types/react-dom@^18.0.6":
version "18.0.6"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.6.tgz"
integrity sha512-/5OFZgfIPSwy+YuIBP/FgJnQnsxhZhjjrnxudMddeblOouIodEQ75X14Rr4wGSG/bknL+Omy9iWlLo1u/9GzAA==
"@types/react-dom@^18.0.9":
version "18.0.9"
resolved "https://registry.npmjs.org/@types/react-dom/-/react-dom-18.0.9.tgz"
integrity sha512-qnVvHxASt/H7i+XG1U1xMiY5t+IHcPGUK7TDMDzom08xa7e86eCeKOiLZezwCKVxJn6NEiiy2ekgX8aQssjIKg==
dependencies:
"@types/react" "*"

Expand All @@ -135,6 +95,13 @@
resolved "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz"
integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==

"@vitejs/plugin-react-swc@^3.0.0":
version "3.0.0"
resolved "https://registry.npmjs.org/@vitejs/plugin-react-swc/-/plugin-react-swc-3.0.0.tgz"
integrity sha512-vYlodz/mjYRbxMGbHzDgR8aPR+z8n7K/enWkyBGH096xrL2DIPCuTvQVRYPTXGyy6wO7OFiMxZ3r4nKQD1sH0A==
dependencies:
"@swc/core" "^1.3.21"

csstype@^3.0.2:
version "3.1.1"
resolved "https://registry.npmjs.org/csstype/-/csstype-3.1.1.tgz"
Expand Down Expand Up @@ -173,10 +140,3 @@ scheduler@^0.23.0:
integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==
dependencies:
loose-envify "^1.1.0"

vite-plugin-swc-react-refresh@^2.1.0:
version "2.1.0"
resolved "https://registry.npmjs.org/vite-plugin-swc-react-refresh/-/vite-plugin-swc-react-refresh-2.1.0.tgz"
integrity sha512-6YWmPG44ghIu75RbXkDg9OKC2F79jQ4wL3siIMQNKkZ05/PMYYp3DVv7qkXcXBCSjYHbG1bIpDvex8kGxDxIfQ==
dependencies:
"@swc/core" "^1.2.245"
6 changes: 3 additions & 3 deletions scripts/bundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Promise.all([
"dist/index.d.ts",
`import { PluginOption } from "vite";
export declare const reactClickToComponent: () => PluginOption;
`
`,
);

writeFileSync(
Expand All @@ -56,7 +56,7 @@ export declare const reactClickToComponent: () => PluginOption;
peerDependencies: packageJSON.peerDependencies,
},
null,
2
)
2,
),
);
});
Loading

0 comments on commit b1d0a96

Please sign in to comment.