Skip to content

Commit a6bc1e5

Browse files
committed
chore: init
0 parents  commit a6bc1e5

File tree

260 files changed

+48510
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

260 files changed

+48510
-0
lines changed

Diff for: .github/cache/action.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Setup PNPM cache'
2+
3+
description: 'Cache Dependencies'
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Install Node.js
8+
uses: actions/setup-node@v4
9+
with:
10+
node-version: 20
11+
12+
- uses: pnpm/action-setup@v4
13+
name: Install pnpm
14+
with:
15+
version: 9.3.0
16+
run_install: false
17+
18+
- name: Get pnpm store directory
19+
shell: bash
20+
run: |
21+
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
22+
23+
- uses: actions/cache@v4
24+
name: Setup pnpm cache
25+
with:
26+
path: ${{ env.STORE_PATH }}
27+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
28+
restore-keys: |
29+
${{ runner.os }}-pnpm-store-
30+
31+
# - name: Enable corepack
32+
# run: corepack enable
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
shell: bash

Diff for: .github/commit-convention.md

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
## Git Commit Message Convention
2+
3+
> This is adapted from [Commit convention](https://www.conventionalcommits.org/en/v1.0.0/).
4+
5+
#### TL;DR:
6+
7+
Messages must be matched by the following regex:
8+
9+
``` js
10+
/^((feat|fix|docs|style|core|i18n|a11y|report|misc|cli|audits|improve|security|deprecated|refactor|perf|test|workflow|build|ci|chore|types|wip|release|deps?|merge|examples?|revert)(\(.+\))?(\:|\!\:)|(Merge|Revert|Version)) .{1,50}$/
11+
```
12+
13+
#### Examples
14+
15+
Appears under "Features" header, `compiler` subheader:
16+
17+
```
18+
feat(compiler): add 'comments' option
19+
```
20+
21+
Appears under "Bug Fixes" header, `v-model` subheader, with a link to issue #28:
22+
23+
```
24+
fix(v-model): handle events on blur
25+
26+
close #28
27+
```
28+
29+
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
30+
31+
```
32+
perf(core): improve vdom diffing by removing 'foo' option
33+
34+
BREAKING CHANGE: The 'foo' option has been removed.
35+
```
36+
37+
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
38+
39+
```
40+
revert: feat(compiler): add 'comments' option
41+
42+
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
43+
```
44+
45+
### Full Message Format
46+
47+
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
48+
49+
```
50+
<type>(<scope>): <subject>
51+
<BLANK LINE>
52+
<body>
53+
<BLANK LINE>
54+
<footer>
55+
```
56+
57+
The **header** is mandatory and the **scope** of the header is optional.
58+
59+
### Revert
60+
61+
If the commit reverts a previous commit, it should begin with `revert: `, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
62+
63+
### Type
64+
65+
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
66+
67+
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
68+
69+
### Scope
70+
71+
The scope could be anything specifying the place of the commit change. For example `core`, `compiler`, `ssr`, `v-model`, `transition` etc...
72+
73+
### Subject
74+
75+
The subject contains a succinct description of the change:
76+
77+
* use the imperative, present tense: "change" not "changed" nor "changes"
78+
* don't capitalize the first letter
79+
* no dot (.) at the end
80+
81+
### Body
82+
83+
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
84+
The body should include the motivation for the change and contrast this with previous behavior.
85+
86+
### Footer
87+
88+
The footer should contain any information about **Breaking Changes** and is also the place to
89+
reference GitHub issues that this commit **Closes**.
90+
91+
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
92+
93+
```
94+
feat!: breaking change / feat(scope)!: rework API
95+
```

Diff for: .github/workflows/main.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI
2+
3+
on: [pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v3
15+
16+
- name: Setup Continuous integration
17+
uses: ./.github/cache
18+
19+
- run: pnpm run lint && pnpm run build

Diff for: .github/workflows/prepublish.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish Any Commit
2+
3+
on: [pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
pr-release:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v3
16+
17+
- name: Setup Continuous integration
18+
uses: ./.github/cache
19+
20+
- name: Enable corepack
21+
run: corepack enable
22+
23+
- name: Build
24+
run: pnpm run build
25+
26+
- name: Release for Pull request
27+
run: pnpx pkg-pr-new publish

Diff for: .github/workflows/publish.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish NPM
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
publish-npm:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Continuous integration
23+
uses: ./.github/cache
24+
25+
- run: pnpm run build
26+
- run: pnpm publish
27+
env:
28+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Diff for: .github/workflows/release.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Release
2+
3+
permissions:
4+
contents: write
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v3
21+
22+
- name: Setup Continuous integration
23+
uses: ./.github/cache
24+
25+
- run: pnpm dlx changeloggithub@latest
26+
env:
27+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Diff for: .gitignore

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

Diff for: .npmignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
./distSrc
2+
./srcTest
3+
./src
4+
.github
5+
./test
6+
node_modules

Diff for: .nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
22

Diff for: .vscode/settings.json

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"editor.tabSize": 2,
3+
"editor.rulers": [100],
4+
"git.ignoreLimitWarning": true,
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
7+
"editor.quickSuggestions": {
8+
"strings": true
9+
},
10+
"workbench.tree.indent": 14,
11+
"workbench.tree.renderIndentGuides": "always",
12+
"workbench.colorCustomizations": {
13+
"tree.indentGuidesStroke": "#b7b7b7"
14+
},
15+
16+
// Disable the default formatter, use eslint instead
17+
"prettier.enable": false,
18+
"editor.formatOnSave": false,
19+
20+
// Auto fix
21+
"editor.codeActionsOnSave": {
22+
"source.fixAll.eslint": "explicit",
23+
"source.organizeImports": "never"
24+
},
25+
26+
"eslint.runtime": "node",
27+
28+
// Silent the stylistic rules in you IDE, but still auto fix them
29+
"eslint.rules.customizations": [
30+
{ "rule": "style/*", "severity": "off", "fixable": true },
31+
{ "rule": "*-indent", "severity": "off", "fixable": true },
32+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
33+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
34+
{ "rule": "*-order", "severity": "off", "fixable": true },
35+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
36+
{ "rule": "*-newline", "severity": "off", "fixable": true },
37+
{ "rule": "*quotes", "severity": "off", "fixable": true },
38+
{ "rule": "*semi", "severity": "off", "fixable": true }
39+
],
40+
41+
// Enable eslint for all supported languages
42+
"eslint.validate": [
43+
"javascript",
44+
"javascriptreact",
45+
"typescript",
46+
"typescriptreact",
47+
"vue",
48+
"html",
49+
"markdown",
50+
"json",
51+
"json5",
52+
"jsonc",
53+
"yaml",
54+
"toml",
55+
"xml"
56+
],
57+
58+
"iconify.color": "#ddd",
59+
"iconify.customCollectionJsonPaths": [
60+
"./public/svgtocss/icon-collection.json"
61+
],
62+
"iconify.delimiters": ["-"],
63+
"iconify.prefixes": ["", "icon"],
64+
"iconify.inplace": false,
65+
"iconify.annotations": true,
66+
"iconify.languageIds": ["typescript", "typescriptreact"],
67+
68+
"color-preview.annotations": true,
69+
"color-preview.colorDirectoryPath": "./src/styles/color/color-preview-vscode.json"
70+
}

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 opensource
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.

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# unbuild template

Diff for: build.config.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import path from 'path';
2+
import { defineBuildConfig } from 'unbuild';
3+
4+
export default defineBuildConfig({
5+
entries: ['src/index'],
6+
clean: true,
7+
declaration: false,
8+
rollup: {
9+
emitCJS: false,
10+
esbuild: {
11+
minify: false,
12+
},
13+
},
14+
failOnWarn: false,
15+
alias: {
16+
'~': path.resolve(__dirname, 'src'),
17+
}
18+
});

Diff for: eslint.config.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { basic } from '@hunghg255/eslint-config';
2+
3+
export default [
4+
...basic(),
5+
{
6+
rules: {
7+
indent: 'warn',
8+
},
9+
},
10+
{
11+
ignores: [
12+
'dist/**/*.ts',
13+
'dist/**',
14+
'scripts/genColorCss.ts',
15+
'tailwind.config.ts',
16+
'src/styles/color/color.tailwind.ts',
17+
],
18+
},
19+
];

0 commit comments

Comments
 (0)