Skip to content

Commit 4dfcfee

Browse files
authored
Initial commit
0 parents  commit 4dfcfee

37 files changed

+8419
-0
lines changed

.eslintrc.cjs

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
es6: true,
7+
},
8+
extends: ['@innei/eslint-config-ts'],
9+
}

.github/workflows/build.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: Node.js CI
5+
6+
on:
7+
push:
8+
branches:
9+
- '**'
10+
pull_request:
11+
branches: [master, main]
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
17+
strategy:
18+
matrix:
19+
node-version: [18.x]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- name: Cache pnpm modules
28+
uses: actions/cache@v2
29+
env:
30+
cache-name: cache-pnpm-modules
31+
with:
32+
path: ~/.pnpm-store
33+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
34+
restore-keys: |
35+
${{ runner.os }}-build-${{ env.cache-name }}-${{ matrix.node-version }}-${{ hashFiles('**/package.json') }}
36+
37+
- uses: pnpm/[email protected]
38+
with:
39+
version: 8.x.x
40+
run_install: true
41+
- run: pnpm run package
42+
- run: pnpm run test
43+
env:
44+
CI: true

.github/workflows/release.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
- uses: actions/setup-node@v3
17+
with:
18+
node-version: 18.x
19+
20+
- run: npx changelogithub # or [email protected] if ensure the stable result
21+
env:
22+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
tags
2+
node_modules
3+
/node_modules
4+
.DS_Store
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15+
16+
# Runtime data
17+
pids
18+
*.pid
19+
*.seed
20+
*.pid.lock
21+
22+
# Directory for instrumented libs generated by jscoverage/JSCover
23+
lib-cov
24+
25+
# Coverage directory used by tools like istanbul
26+
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
31+
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33+
.grunt
34+
35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
38+
# node-waf configuration
39+
.lock-wscript
40+
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
42+
build/Release
43+
44+
# Dependency directories
45+
node_modules/
46+
jspm_packages/
47+
48+
# Snowpack dependency directory (https://snowpack.dev/)
49+
web_modules/
50+
51+
# TypeScript cache
52+
*.tsbuildinfo
53+
54+
# Optional npm cache directory
55+
.npm
56+
57+
# Optional eslint cache
58+
.eslintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# parcel-bundler cache (https://parceljs.org/)
76+
.cache
77+
.parcel-cache
78+
79+
# Next.js build output
80+
.next
81+
82+
# Nuxt.js build / generate output
83+
.nuxt
84+
85+
# Gatsby files
86+
.cache/
87+
88+
# vuepress build output
89+
.vuepress/dist
90+
91+
# Serverless directories
92+
.serverless/
93+
94+
# FuseBox cache
95+
.fusebox/
96+
97+
# DynamoDB Local files
98+
.dynamodb/
99+
100+
# TernJS port file
101+
.tern-port
102+
103+
# Stores VSCode versions used for testing VSCode extensions
104+
.vscode-test
105+
106+
# yarn v2
107+
108+
.yarn/cache
109+
.yarn/unplugged
110+
.yarn/build-state.yml
111+
.pnp.*
112+
113+
# vim
114+
ctag
115+
/tags
116+
.undodir
117+
118+
# idea
119+
# .idea/*
120+
121+
/dist
122+
/publish
123+
/build
124+
/lib
125+
/esm
126+
/types
127+
128+
example/dist

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
lint-staged

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
registry=https://registry.npmjs.org
2+
# https://zenn.dev/haxibami/scraps/083718c1beec04
3+
strict-peer-dependencies=false

.prettierrc.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import config from '@innei/prettier'
2+
export default config

example/App.vue

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<template>
2+
<DefaultLayout>
3+
4+
<Page />
5+
6+
</DefaultLayout>
7+
8+
</template>
9+
10+
<script setup>
11+
import {DefaultLayout} from './layouts/Default.tsx'
12+
import {Page} from './pages/page.tsx'
13+
</script>

example/components/corner/index.ts

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
export class GitHubCornerElement extends HTMLElement {
2+
constructor() {
3+
super()
4+
this.attachShadow({ mode: 'open' })
5+
const repo = this.getAttribute('repo')
6+
this.shadowRoot.innerHTML = `
7+
<a
8+
href="https://github.com/${repo}"
9+
class="github-corner"
10+
aria-label="View source on GitHub"
11+
><svg
12+
width="80"
13+
height="80"
14+
viewBox="0 0 250 250"
15+
style="
16+
fill: #151513;
17+
color: #fff;
18+
position: absolute;
19+
top: 0;
20+
border: 0;
21+
right: 0;
22+
"
23+
aria-hidden="true"
24+
>
25+
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
26+
<path
27+
d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
28+
fill="currentColor"
29+
style="transform-origin: 130px 106px"
30+
class="octo-arm"
31+
></path>
32+
<path
33+
d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
34+
fill="currentColor"
35+
class="octo-body"
36+
></path></svg></a
37+
><style>
38+
.github-corner:hover .octo-arm {
39+
animation: octocat-wave 560ms ease-in-out;
40+
}
41+
@keyframes octocat-wave {
42+
0%,
43+
100% {
44+
transform: rotate(0);
45+
}
46+
20%,
47+
60% {
48+
transform: rotate(-25deg);
49+
}
50+
40%,
51+
80% {
52+
transform: rotate(10deg);
53+
}
54+
}
55+
@media (max-width: 500px) {
56+
.github-corner:hover .octo-arm {
57+
animation: none;
58+
}
59+
.github-corner .octo-arm {
60+
animation: octocat-wave 560ms ease-in-out;
61+
}
62+
}
63+
</style>`
64+
}
65+
}
66+
67+
customElements.define('github-corner', GitHubCornerElement)

example/index.css

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
html,
2+
body {
3+
font-family:
4+
system-ui,
5+
-apple-system,
6+
BlinkMacSystemFont,
7+
'Segoe UI',
8+
Roboto,
9+
Oxygen,
10+
Ubuntu,
11+
Cantarell,
12+
'Open Sans',
13+
'Helvetica Neue',
14+
sans-serif;
15+
}
16+
17+
.hello {
18+
padding: 0;
19+
20+
.nest {
21+
bottom: 0;
22+
}
23+
}

example/index.html

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!doctype html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite</title>
8+
</head>
9+
<body>
10+
<github-corner repo="----------------repo----------------"></github-corner>
11+
<div id="app"></div>
12+
<script src="./index.ts" type="module"></script>
13+
<script src="./components/corner/index.ts" type="module"></script>
14+
</body>
15+
</html>

example/index.ts

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import './index.css'
2+
import 'uno.css'
3+
import '@unocss/reset/tailwind.css'
4+
5+
import { createApp } from 'vue'
6+
7+
import App from './App.vue'
8+
9+
createApp(App).mount('#app')

example/layouts/Default.tsx

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { defineComponent } from 'vue'
2+
3+
export const DefaultLayout = defineComponent({
4+
setup(ctx, { slots }) {
5+
return () => (
6+
<div>
7+
<main class="max-w-60rem m-auto px-4 py-10">{slots.default?.()}</main>
8+
</div>
9+
)
10+
},
11+
})

example/package.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "example",
3+
"scripts": {
4+
"dev": "vite"
5+
},
6+
"dependencies": {
7+
"@unocss/reset": "0.57.1",
8+
"my-awesome-lib": "link:../",
9+
"vue": "3.3.7"
10+
},
11+
"devDependencies": {
12+
"@vitejs/plugin-vue": "4.4.0",
13+
"@vitejs/plugin-vue-jsx": "3.0.2"
14+
}
15+
}

example/pages/page.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineComponent } from 'vue'
2+
3+
export const Page = defineComponent({
4+
setup() {
5+
return () => <div>Hello world</div>
6+
},
7+
})

0 commit comments

Comments
 (0)