Skip to content

Commit bf4771e

Browse files
committed
Initial version [publish]
0 parents  commit bf4771e

28 files changed

+2885
-0
lines changed

.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["@arnaud-barre"],
4+
};

.github/workflows/publish.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Publish to npm
2+
on:
3+
push:
4+
branches:
5+
- main
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
if: ${{ contains(github.event.head_commit.message, '[publish]') }}
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: xhyrom/[email protected]
13+
- run: rm -rf ~/.bun/install/cache
14+
- run: bun install
15+
- run: bun ci
16+
- uses: ArnaudBarre/[email protected]
17+
with:
18+
working-directory: dist
19+
npm-token: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea/
2+
node_modules/
3+
dist/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Changelog
2+
3+
## 1.0.0
4+
5+
Initial release

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Arnaud Barré (https://github.com/ArnaudBarre)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# vite-plugin-react-click-to-component [![npm](https://img.shields.io/npm/v/vite-plugin-react-click-to-component)](https://www.npmjs.com/package/vite-plugin-react-click-to-component)
2+
3+
Option+Click React components in your browser to open the source in your editor.
4+
5+
Light version of [ericclemmons/click-to-component](https://github.com/ericclemmons/click-to-component) that uses Vite's launch editor middleware to open the source code in your currently running editor.
6+
7+
## Installation
8+
9+
```sh
10+
npm i -D vite-plugin-react-click-to-component
11+
```
12+
13+
In your Vite config:
14+
15+
```ts
16+
import { defineConfig } from "vite";
17+
import { swcReactRefresh } from "vite-plugin-swc-react-refresh"; // or @vitejs/plugin-react
18+
import { reactClickToComponent } from "vite-plugin-react-click-to-component";
19+
20+
export default defineConfig({
21+
plugins: [swcReactRefresh(), reactClickToComponent()],
22+
});
23+
```

bun.lockb

92.8 KB
Binary file not shown.

bunfig.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[install.lockfile]
2+
print = "yarn"

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "vite-plugin-react-click-to-component",
3+
"version": "1.0.0",
4+
"license": "MIT",
5+
"scripts": {
6+
"dev": "scripts/bundle.ts --dev",
7+
"build": "scripts/bundle.ts",
8+
"tsc": "tsc",
9+
"lint": "bun lint-ci --fix --cache",
10+
"lint-ci": "eslint src scripts --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
11+
"prettier": "yarn prettier-ci --write",
12+
"prettier-ci": "prettier --ignore-path=.gitignore --check '**/*.{ts,tsx,html,css,json,md,yml}'",
13+
"ci": "tsc && bun lint-ci && bun prettier-ci && bun run build"
14+
},
15+
"peerDependencies": {
16+
"react": ">=16",
17+
"vite": "^2 || ^3"
18+
},
19+
"devDependencies": {
20+
"@arnaud-barre/eslint-config": "^1.0.13",
21+
"@nabla/tnode": "^0.7.0",
22+
"@types/node": "^18.11.4",
23+
"eslint": "^8.26.0",
24+
"prettier": "^2.7.1",
25+
"typescript": "^4.8.4",
26+
"vite": "^3.1.8"
27+
}
28+
}

playground/.eslintrc.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
root: true,
3+
extends: ["@arnaud-barre"],
4+
};

0 commit comments

Comments
 (0)