Skip to content

Commit 8a8ab49

Browse files
Merge pull request #2 from SisyphusZheng/main
chore: optimize release process and fix issues
2 parents 4bc64a0 + 6defdcb commit 8a8ab49

22 files changed

Lines changed: 4263 additions & 268 deletions

.github/workflows/publish.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Publish to npm and GitHub Packages
2+
3+
on:
4+
push:
5+
tags:
6+
- '*' # 监听标签推送
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# 检出代码
14+
- name: Checkout code
15+
uses: actions/checkout@v3
16+
17+
# 设置 Node.js 环境
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '18'
22+
cache: 'yarn'
23+
24+
# 配置 npm 认证(包括 GitHub 和 npm)
25+
- name: Configure npm registry and authenticate
26+
run: |
27+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
28+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> ~/.npmrc
29+
30+
# 安装依赖
31+
- name: Install dependencies with yarn
32+
run: yarn install
33+
34+
# 构建项目
35+
- name: Build project
36+
run: yarn build
37+
38+
# 运行测试
39+
- name: Run tests
40+
run: yarn test
41+
42+
# 发布到 GitHub Packages
43+
- name: Publish to GitHub Package
44+
if: startsWith(github.ref, 'refs/tags/')
45+
env:
46+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
47+
run: yarn publish --access public --registry=https://npm.pkg.github.com
48+
49+
# 发布到 npm
50+
- name: Publish to npm
51+
if: startsWith(github.ref, 'refs/tags/')
52+
env:
53+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54+
run: yarn publish --access public --registry=https://registry.npmjs.org

.npmrc

Whitespace-only changes.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,4 @@ defineCustomElements();
4949
document.querySelector('air-button').addEventListener('click', () => {
5050
alert('Button clicked!');
5151
});
52-
```
52+
```

package.json

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"name": "stencil-component-example",
3-
"version": "0.0.1",
4-
"description": "Stencil Component Starter",
2+
"name": "@aircomponents/components",
3+
"version": "0.0.6",
4+
"private": false,
5+
"description": "custom components",
56
"main": "dist/index.cjs.js",
67
"module": "./dist/index.js",
78
"es2015": "dist/esm/index.mjs",
@@ -12,14 +13,17 @@
1213
"unpkg": "dist/stencil-component-example/stencil-component-example.esm.js",
1314
"files": [
1415
"dist/",
15-
"loader/"
16+
"loader/",
17+
"README.md",
18+
"LICENSE"
1619
],
1720
"scripts": {
1821
"build": "stencil build --docs",
1922
"start": "stencil build --dev --watch --serve",
2023
"test": "stencil test --spec --e2e",
2124
"test.watch": "stencil test --spec --e2e --watchAll",
22-
"generate": "stencil generate"
25+
"generate": "stencil generate",
26+
"prepare": "yarn run build"
2327
},
2428
"license": "MIT",
2529
"devDependencies": {
@@ -37,11 +41,18 @@
3741
"stencil-tailwind-plugin": "^1.8.0",
3842
"storybook-addon-stencil": "^0.2.2",
3943
"tailwindcss": "^3.4.17",
40-
"testing": "link:@stencil/core/testing",
44+
"testing": "@stencil/core/testing",
4145
"ts-jest": "^29.2.5",
4246
"typescript": "^5.7.2"
4347
},
4448
"dependencies": {
4549
"postcss": "^8.1.0"
50+
},
51+
"publishConfig": {
52+
"registry": "https://registry.npmjs.org"
53+
},
54+
"repository": {
55+
"type": "git",
56+
"url": "git+https://github.com/SisyphusZheng/Components.git"
4657
}
4758
}
11.7 KB
Loading
48.1 KB
Binary file not shown.

src/assets/air-components-logo.svg

Lines changed: 25 additions & 13 deletions
Loading
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<svg width="108" height="115" viewBox="0 0 108 115" fill="none" xmlns="http://www.w3.org/2000/svg">
2+
<g filter="url(#filter0_d_1_13)">
3+
<path d="M104 57C104 84.6142 81.6142 107 54 107C26.3858 107 4 84.6142 4 57C4 29.3858 26.3858 7 54 7C81.6142 7 104 29.3858 104 57Z" fill="#363433"/>
4+
<path d="M103.5 57C103.5 84.3381 81.3381 106.5 54 106.5C26.6619 106.5 4.5 84.3381 4.5 57C4.5 29.6619 26.6619 7.5 54 7.5C81.3381 7.5 103.5 29.6619 103.5 57Z" stroke="black"/>
5+
</g>
6+
<g filter="url(#filter1_d_1_13)">
7+
<path d="M55.0336 31.056L36.8896 74.736L32.3776 85.392L31.2256 87.312L30.3616 87.984L29.6896 88.464L29.0176 88.08L28.1536 87.696V86.928L28.4416 84.912L28.7296 84.144L27.1936 87.12L25.6576 88.464L25.0816 88.848L24.0256 88.752L22.9696 88.656L22.4896 87.984L21.8176 87.024L21.9136 86.16L22.2976 84.048L27.0016 72.528L40.7296 39.408L44.5696 30L47.3536 24.816L49.1776 23.568L50.4256 23.472L51.1936 23.376L51.9616 24.144L52.5376 24.72V25.68L51.8656 28.464L52.7296 26.544L53.6896 25.296L54.6496 24.912L55.5136 24.624L56.0896 25.488L56.4736 26.064L56.2816 27.12L55.0336 31.056ZM42.9376 32.208L25.9456 73.2L21.7216 83.376L20.3776 85.872L19.9936 86.544L19.3216 86.256L18.5536 85.968L18.7456 85.2L19.3216 83.472L23.7376 72.624L27.0976 64.752L36.7936 36.816L39.4816 29.04L41.4016 24.816L42.8416 23.472L43.5136 23.664L44.2816 23.76V24.528L44.0896 26.544L43.9936 26.832L44.1856 26.736L44.3776 27.792L43.9936 29.616L42.9376 32.208ZM62.8096 31.824L59.4496 40.08L57.3376 44.784L56.0896 46.512L52.8256 49.296L52.0576 51.216L51.0016 54.864L49.3696 61.008L48.1216 67.056L43.7056 77.904L40.9216 84.528L38.8096 88.272L37.9456 89.232L36.7936 89.712L36.0256 90L34.9696 89.808L34.1056 89.616L33.5296 88.752L32.9536 87.888V87.12L33.3376 85.104L38.1376 73.2L51.7696 40.368L55.8016 30.672L57.0496 28.272L57.4336 27.408L58.6816 25.104V25.488L61.2736 24.144L62.2336 23.856L63.1936 24.432L64.0576 25.008L64.2496 26.256L62.8096 31.824ZM69.6256 39.12L56.1856 71.472L54.3616 75.696L52.4416 79.056L51.4816 80.016L50.2336 80.4L49.4656 80.592L47.6416 79.536V78.96L47.4496 77.52L47.8336 76.464L48.3136 75.312L45.5296 80.88L43.5136 84.048L42.7456 84.624L42.1696 84.048L42.5536 82.8L43.7056 79.728L48.6016 67.92L49.9456 65.232L50.8096 64.464L51.6736 63.792L52.1536 64.656L52.6336 65.616L52.3456 66.192L54.9376 63.216L56.8576 62.352L57.8176 61.488L58.2976 61.008L58.3936 60.24L58.4896 58.896L58.1056 56.88L57.9136 52.752L59.4496 48.624L59.1616 49.008L58.4896 48.624L57.8176 48.336V47.76V46.224L59.9296 40.752L63.9616 30.864L66.0736 26.736L67.3216 26.064L68.3776 26.736L68.1856 27.984L67.3216 30.192L68.5696 29.808L69.5296 30.096L70.5856 31.632L70.8736 33.072L69.6256 39.12ZM73.7536 52.368L67.1296 68.688L64.4416 75.024L62.9056 78.576L60.8896 80.976L60.1216 81.552L58.5856 81.84L58.1056 81.936L57.0496 81.168L56.3776 80.784L56.2816 80.208L56.0896 78.768L56.2816 78.192L55.0336 78.384L54.5536 78.48V77.904L54.7456 75.792L57.6256 68.592L67.6096 44.496L70.1056 38.64L71.3536 37.008L72.6016 38.256L72.5056 39.312L71.5456 42.768L71.4496 43.056H71.9296L73.2736 43.536L73.9456 44.592L74.4256 46.032L73.7536 52.368ZM81.6256 70.992L77.4016 81.648L74.5216 87.6L72.8896 89.04L71.5456 89.424L70.6816 89.616L69.6256 88.848L68.9536 88.368L68.7616 87.6L68.4736 86.352L68.8576 84.336L69.3376 82.896L68.0896 83.664L67.1296 82.992L66.4576 82.512L65.9776 81.648L65.0176 78.768L65.1136 77.424L67.3216 71.088L73.1776 56.976L75.5776 51.6L76.4416 50.352L77.3056 50.256H78.4576L79.1296 51.504L80.1856 56.304L79.9936 58.032L78.6496 61.872L79.8016 61.584L80.5696 61.776L81.6256 63.312L82.3936 67.056L81.6256 70.992ZM84.2176 83.568L83.5456 84.912L82.5856 86.16L82.1056 86.832L80.4736 88.08L79.1296 88.176L78.3616 88.272L77.5936 87.6L77.0176 87.024V86.064L77.5936 82.992L81.7216 73.104L83.0656 70.608L83.5456 69.936L84.3136 70.128L85.4656 70.224L86.1376 71.664L85.5616 79.824L84.6016 82.224L84.6976 82.416L84.2176 83.568ZM90.7456 85.584L89.6896 87.216L87.7696 87.792L86.5216 87.312L85.8496 87.024L85.5616 86.064L85.3696 85.008L85.8496 83.088L87.2896 80.304L87.9616 79.344L89.0176 79.728L89.7856 80.112L90.2656 81.168L91.0336 83.856L90.7456 85.584Z" fill="#C02C38"/>
8+
</g>
9+
<defs>
10+
<filter id="filter0_d_1_13" x="0" y="7" width="108" height="108" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
11+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
12+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
13+
<feOffset dy="4"/>
14+
<feGaussianBlur stdDeviation="2"/>
15+
<feComposite in2="hardAlpha" operator="out"/>
16+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
17+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_13"/>
18+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_13" result="shape"/>
19+
</filter>
20+
<filter id="filter1_d_1_13" x="14.5536" y="23.376" width="80.48" height="74.624" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
21+
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
22+
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
23+
<feOffset dy="4"/>
24+
<feGaussianBlur stdDeviation="2"/>
25+
<feComposite in2="hardAlpha" operator="out"/>
26+
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
27+
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1_13"/>
28+
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1_13" result="shape"/>
29+
</filter>
30+
</defs>
31+
</svg>

src/components.d.ts

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@ export namespace Components {
1313
"size": string;
1414
}
1515
interface AirButton {
16-
"color": string;
16+
"color": | "default"
17+
| "primary"
18+
| "success"
19+
| "info"
20+
| "warning"
21+
| "danger"
22+
| "ghost";
1723
"disabled": boolean;
1824
"icon": string;
1925
"loading": boolean;
20-
"size": 'small' | 'medium' | 'large';
26+
"selected": boolean;
27+
"size": "small" | "medium" | "large";
2128
"suffixIcon": string;
22-
"variant": 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'ghost';
29+
"variant": | "solid"
30+
| "outline"
31+
| "text"
32+
| "outline"
33+
| "neo"
34+
| "default";
2335
}
2436
interface AirCard {
2537
"description": string;
@@ -131,13 +143,25 @@ declare namespace LocalJSX {
131143
"size"?: string;
132144
}
133145
interface AirButton {
134-
"color"?: string;
146+
"color"?: | "default"
147+
| "primary"
148+
| "success"
149+
| "info"
150+
| "warning"
151+
| "danger"
152+
| "ghost";
135153
"disabled"?: boolean;
136154
"icon"?: string;
137155
"loading"?: boolean;
138-
"size"?: 'small' | 'medium' | 'large';
156+
"selected"?: boolean;
157+
"size"?: "small" | "medium" | "large";
139158
"suffixIcon"?: string;
140-
"variant"?: 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger' | 'ghost';
159+
"variant"?: | "solid"
160+
| "outline"
161+
| "text"
162+
| "outline"
163+
| "neo"
164+
| "default";
141165
}
142166
interface AirCard {
143167
"description"?: string;

0 commit comments

Comments
 (0)