Skip to content

Commit bcaead4

Browse files
committed
chore: init
0 parents  commit bcaead4

26 files changed

+6345
-0
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.eslintrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"env": {
3+
"jest": true
4+
},
5+
"extends": ["@antfu"],
6+
"plugins": ["jest"],
7+
"rules": {}
8+
}

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: [antfu]

.github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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@v2
13+
with:
14+
fetch-depth: 0
15+
- uses: actions/setup-node@v2
16+
with:
17+
node-version: '14'
18+
registry-url: https://registry.npmjs.org/
19+
- run: npm i -g pnpm @antfu/ni
20+
- run: nci
21+
- run: nr test --if-present
22+
# - run: npm publish --access public
23+
# env:
24+
# NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
25+
- run: npx conventional-github-releaser -p angular
26+
env:
27+
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{secrets.GITHUB_TOKEN}}

.github/workflows/test.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
9+
pull_request:
10+
branches:
11+
- main
12+
- master
13+
14+
jobs:
15+
build:
16+
runs-on: ${{ matrix.os }}
17+
18+
strategy:
19+
matrix:
20+
node-version: [12.x, 14.x]
21+
os: [ubuntu-latest, windows-latest, macos-latest]
22+
fail-fast: false
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
27+
- name: Use Node.js ${{ matrix.node-version }}
28+
uses: actions/setup-node@v1
29+
with:
30+
node-version: ${{ matrix.node-version }}
31+
32+
- name: Setup
33+
run: npm i -g pnpm @antfu/ni
34+
35+
- name: Install
36+
run: nci
37+
38+
# - name: Lint
39+
# run: nr lint --if-present
40+
41+
- name: Test
42+
run: nr test --if-present

.gitignore

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Created by .ignore support plugin (hsz.mobi)
2+
### Node template
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
yarn-debug.log*
8+
yarn-error.log*
9+
10+
# Runtime data
11+
pids
12+
*.pid
13+
*.seed
14+
*.pid.lock
15+
16+
# Directory for instrumented libs generated by jscoverage/JSCover
17+
lib-cov
18+
19+
# Coverage directory used by tools like istanbul
20+
coverage
21+
22+
# nyc test coverage
23+
.nyc_output
24+
25+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
26+
.grunt
27+
28+
# Bower dependency directory (https://bower.io/)
29+
bower_components
30+
31+
# node-waf configuration
32+
.lock-wscript
33+
34+
# Compiled binary addons (https://nodejs.org/api/addons.html)
35+
build/Release
36+
37+
# Dependency directories
38+
node_modules/
39+
jspm_packages/
40+
41+
# TypeScript v1 declaration files
42+
typings/
43+
44+
# Optional npm cache directory
45+
.npm
46+
47+
# Optional eslint cache
48+
.eslintcache
49+
50+
# Optional REPL history
51+
.node_repl_history
52+
53+
# Output of 'npm pack'
54+
*.tgz
55+
56+
# Yarn Integrity file
57+
.yarn-integrity
58+
59+
# dotenv environment variables file
60+
.env
61+
62+
# parcel-bundler cache (https://parceljs.org/)
63+
.cache
64+
65+
# next.js build output
66+
.next
67+
68+
# nuxt.js build output
69+
.nuxt
70+
71+
# Nuxt generate
72+
dist
73+
74+
# vuepress build output
75+
.vuepress/dist
76+
77+
# Serverless directories
78+
.serverless
79+
80+
# IDE
81+
.idea
82+
/*.d.ts

.npmrc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
ignore-workspace-root-check=true
2+
shamefully-hoist=true

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 Anthony Fu <https://github.com/antfu>
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

+108
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
# unplugin-starter
2+
3+
[![NPM version](https://img.shields.io/npm/v/unplugin-starter?color=a1b858&label=)](https://www.npmjs.com/package/unplugin-starter)
4+
5+
Starter template for [unplugin](https://github.com/unjs/unplugin).
6+
7+
## Template Usage
8+
9+
To use this template, clone it down using:
10+
11+
```bash
12+
npx degit antfu/unplugin-starter my-unplugin
13+
```
14+
15+
And do a global replace of `unplugin-starter` with your plugin name.
16+
17+
Then you can start developing your unplugin 🔥
18+
19+
To test your plugin, run: `pnpm run dev`
20+
To release a new version, run: `pnpm run release`
21+
22+
## Install
23+
24+
```bash
25+
npm i unplugin-starter
26+
```
27+
28+
<details>
29+
<summary>Vite</summary><br>
30+
31+
```ts
32+
// vite.config.ts
33+
import Starter from 'unplugin-starter/vite'
34+
35+
export default defineConfig({
36+
plugins: [
37+
Starter({ /* options */ }),
38+
],
39+
})
40+
```
41+
42+
Example: [`playground/`](./playground/)
43+
44+
<br></details>
45+
46+
<details>
47+
<summary>Rollup</summary><br>
48+
49+
```ts
50+
// rollup.config.js
51+
import Starter from 'unplugin-starter/rollup'
52+
53+
export default {
54+
plugins: [
55+
Starter({ /* options */ }),
56+
],
57+
}
58+
```
59+
60+
<br></details>
61+
62+
63+
<details>
64+
<summary>Webpack</summary><br>
65+
66+
```ts
67+
// webpack.config.js
68+
module.exports = {
69+
/* ... */
70+
plugins: [
71+
require('unplugin-starter/webpack')({ /* options */ })
72+
]
73+
}
74+
```
75+
76+
<br></details>
77+
78+
<details>
79+
<summary>Nuxt</summary><br>
80+
81+
```ts
82+
// nuxt.config.js
83+
export default {
84+
buildModules: [
85+
['unplugin-starter/nuxt', { /* options */ }],
86+
],
87+
}
88+
```
89+
90+
> This module works for both Nuxt 2 and [Nuxt Vite](https://github.com/nuxt/vite)
91+
92+
<br></details>
93+
94+
<details>
95+
<summary>Vue CLI</summary><br>
96+
97+
```ts
98+
// vue.config.js
99+
module.exports = {
100+
configureWebpack: {
101+
plugins: [
102+
require('unplugin-starter/webpack')({ /* options */ }),
103+
],
104+
},
105+
}
106+
```
107+
108+
<br></details>

jest.config.js

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
roots: [
3+
'<rootDir>/test',
4+
],
5+
testMatch: [
6+
'**/__tests__/**/*.+(ts|tsx|js)',
7+
'**/?(*.)+(spec|test).+(ts|tsx|js)',
8+
],
9+
transform: {
10+
'^.+\\.(ts|tsx)$': 'ts-jest',
11+
},
12+
}

0 commit comments

Comments
 (0)