Skip to content

Commit 9ad3db2

Browse files
committed
feat: init
0 parents  commit 9ad3db2

26 files changed

+3555
-0
lines changed

.editorconfig

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
root = true
2+
3+
[*]
4+
indent_size = 2
5+
end_of_line = lf
6+
insert_final_newline = true

.eslintignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
dist
3+
pnpm-lock.yaml
4+
tests/fixtures

.eslintrc.js

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
const { defineConfig } = require('eslint-define-config')
2+
3+
module.exports = defineConfig({
4+
root: true,
5+
extends: ['@sxzz'],
6+
rules: {
7+
'unicorn/prefer-string-replace-all': 'off',
8+
},
9+
})

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: sxzz

.github/renovate.json5

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
extends: ['config:base', 'schedule:weekly', 'group:allNonMajor'],
3+
labels: ['dependencies'],
4+
pin: false,
5+
rangeStrategy: 'bump',
6+
node: false,
7+
packageRules: [
8+
{
9+
depTypeList: ['peerDependencies'],
10+
enabled: false,
11+
},
12+
],
13+
ignoreDeps: ['node'],
14+
}

.github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Set node
17+
uses: actions/setup-node@v3
18+
with:
19+
node-version: 16.x
20+
21+
- run: npx changelogithub
22+
env:
23+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/unit-test.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Unit Test
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- name: Set node
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: 16.x
18+
19+
- name: Setup
20+
run: npm i -g @antfu/ni
21+
22+
- name: Install
23+
run: nci
24+
25+
- name: Lint
26+
run: nr lint
27+
28+
test:
29+
runs-on: ${{ matrix.os }}
30+
31+
strategy:
32+
matrix:
33+
os: [ubuntu-latest, windows-latest]
34+
node: [14.19.0, 16.x, 18]
35+
fail-fast: false
36+
37+
steps:
38+
- uses: actions/checkout@v3
39+
- name: Set node ${{ matrix.node }}
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: ${{ matrix.node }}
43+
44+
- name: Setup
45+
run: npm i -g @antfu/ni
46+
47+
- name: Install
48+
run: nci
49+
50+
- name: Build
51+
run: nr build
52+
53+
- name: Test
54+
run: nr test

.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules
2+
.DS_Store
3+
dist
4+
*.log
5+
.vercel

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
pnpm-lock.yaml

.prettierrc

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
3+
"semi": false,
4+
"singleQuote": true
5+
}

.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"editor.formatOnSave": true
3+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright © 2022 三咲智子 (https://github.com/sxzz)
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

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# unplugin-vue-jsx [![npm](https://img.shields.io/npm/v/unplugin-vue-jsx.svg)](https://npmjs.com/package/unplugin-vue-jsx)
2+
3+
[![Unit Test](https://github.com/sxzz/unplugin-vue-jsx/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sxzz/unplugin-vue-jsx/actions/workflows/unit-test.yml)
4+
5+
- Vue JSX plugin for both Vue 2 and 3.
6+
- Supports Rollup, Vite, esbuild and Webpack.
7+
8+
## Installation
9+
10+
```bash
11+
npm i unplugin-vue-jsx
12+
```
13+
14+
<details>
15+
<summary>Vite</summary><br>
16+
17+
```ts
18+
// vite.config.ts
19+
import VueJsx from 'unplugin-vue-jsx/vite'
20+
21+
export default defineConfig({
22+
plugins: [VueJsx()],
23+
})
24+
```
25+
26+
<br></details>
27+
28+
<details>
29+
<summary>Rollup</summary><br>
30+
31+
```ts
32+
// rollup.config.js
33+
import VueJsx from 'unplugin-vue-jsx/rollup'
34+
35+
export default {
36+
plugins: [VueJsx()],
37+
}
38+
```
39+
40+
<br></details>
41+
42+
<details>
43+
<summary>esbuild</summary><br>
44+
45+
```ts
46+
// esbuild.config.js
47+
import { build } from 'esbuild'
48+
49+
build({
50+
plugins: [require('unplugin-vue-jsx/esbuild')()],
51+
})
52+
```
53+
54+
<br></details>
55+
56+
<details>
57+
<summary>Webpack</summary><br>
58+
59+
```ts
60+
// webpack.config.js
61+
module.exports = {
62+
/* ... */
63+
plugins: [require('unplugin-vue-jsx/webpack')()],
64+
}
65+
```
66+
67+
<br></details>
68+
69+
<details>
70+
<summary>Vue CLI</summary><br>
71+
72+
```ts
73+
// vue.config.js
74+
module.exports = {
75+
configureWebpack: {
76+
plugins: [require('unplugin-vue-jsx/webpack')()],
77+
},
78+
}
79+
```
80+
81+
<br></details>
82+
83+
## Sponsors
84+
85+
<p align="center">
86+
<a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
87+
<img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
88+
</a>
89+
</p>
90+
91+
## License
92+
93+
[MIT](./LICENSE) License © 2022 [三咲智子](https://github.com/sxzz)

package.json

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{
2+
"name": "unplugin-vue-jsx",
3+
"version": "0.0.0",
4+
"packageManager": "[email protected]",
5+
"description": "Vue JSX plugin for both Vue 2 and 3. Supports Rollup, Vite, esbuild and Webpack.",
6+
"keywords": [
7+
"unplugin",
8+
"rollup",
9+
"vite",
10+
"esbuild",
11+
"webpack"
12+
],
13+
"license": "MIT",
14+
"homepage": "https://github.com/sxzz/unplugin-vue-jsx#readme",
15+
"bugs": {
16+
"url": "https://github.com/sxzz/unplugin-vue-jsx/issues"
17+
},
18+
"repository": {
19+
"type": "git",
20+
"url": "git+https://github.com/sxzz/unplugin-vue-jsx.git"
21+
},
22+
"author": "三咲智子 <[email protected]>",
23+
"files": [
24+
"dist"
25+
],
26+
"main": "./dist/index.js",
27+
"module": "./dist/index.mjs",
28+
"types": "index.d.ts",
29+
"exports": {
30+
".": {
31+
"require": "./dist/index.js",
32+
"import": "./dist/index.mjs"
33+
},
34+
"./vite": {
35+
"require": "./dist/vite.js",
36+
"import": "./dist/vite.mjs"
37+
},
38+
"./webpack": {
39+
"require": "./dist/webpack.js",
40+
"import": "./dist/webpack.mjs"
41+
},
42+
"./rollup": {
43+
"require": "./dist/rollup.js",
44+
"import": "./dist/rollup.mjs"
45+
},
46+
"./esbuild": {
47+
"require": "./dist/esbuild.js",
48+
"import": "./dist/esbuild.mjs"
49+
},
50+
"./cores": {
51+
"require": "./dist/cores.js",
52+
"import": "./dist/cores.mjs"
53+
},
54+
"./*": "./*"
55+
},
56+
"typesVersions": {
57+
"*": {
58+
"*": [
59+
"./dist/*",
60+
"./*"
61+
]
62+
}
63+
},
64+
"publishConfig": {
65+
"access": "public"
66+
},
67+
"scripts": {
68+
"lint": "eslint . --ext .vue,.js,.ts,.jsx,.tsx,.json,.md",
69+
"lint:fix": "pnpm run lint -- --fix",
70+
"build": "tsup && tsx scripts/postbuild.mts",
71+
"test": "vitest",
72+
"release": "bumpp && pnpm publish",
73+
"prepublishOnly": "pnpm run build"
74+
},
75+
"dependencies": {
76+
"@rollup/pluginutils": "^4.2.1",
77+
"magic-string": "^0.26.2",
78+
"unplugin": "^0.7.0"
79+
},
80+
"devDependencies": {
81+
"@sxzz/eslint-config": "^2.2.2",
82+
"@types/node": "*",
83+
"bumpp": "^8.2.1",
84+
"eslint": "^8.18.0",
85+
"eslint-define-config": "^1.5.1",
86+
"fast-glob": "^3.2.11",
87+
"prettier": "^2.7.1",
88+
"tsup": "^6.1.2",
89+
"tsx": "^3.4.3",
90+
"typescript": "^4.7.4",
91+
"vite": "^2.9.12",
92+
"vitest": "^0.15.1"
93+
},
94+
"engines": {
95+
"node": ">=14.19.0"
96+
}
97+
}

0 commit comments

Comments
 (0)