5 Commits

Author SHA1 Message Date
李启源
3c1c29fa56 fix(demo): avoid circular vendor imports
All checks were successful
Package component / package (push) Successful in 2m23s
2026-07-21 14:26:23 +08:00
李启源
70c60b9daa chore(release): prepare v0.1.11-rc.1
All checks were successful
Package component / package (push) Successful in 3m50s
2026-07-21 14:08:39 +08:00
李启源
52ab42ffac feat(demo): deploy stable release preview
All checks were successful
Package component / package (push) Successful in 2m31s
2026-07-21 14:03:27 +08:00
李启源
dc66c4006f chore(release): prepare v0.1.9
All checks were successful
Package component / package (push) Successful in 2m54s
2026-07-21 13:34:24 +08:00
李启源
a27a541074 feat(ci): publish tagged releases to npmjs
Some checks failed
Package component / package (push) Failing after 2m40s
2026-07-21 13:27:12 +08:00
4 changed files with 52 additions and 24 deletions

View File

@@ -86,14 +86,21 @@ jobs:
exit 1 exit 1
fi fi
if npm view "$package_name@$PACKAGE_VERSION" version --registry='https://registry.npmjs.org/' > /dev/null 2>&1; then
echo "npmjs package $package_name@$PACKAGE_VERSION already exists" >&2
exit 1
fi
- name: Validate publish credentials - name: Validate publish credentials
shell: bash shell: bash
env: env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }} NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPMJS_PUBLISH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }} RELEASE_TOKEN: ${{ secrets.RELEASE_TOKEN }}
run: | run: |
set -euo pipefail set -euo pipefail
: "${NODE_AUTH_TOKEN:?NPM_PUBLISH_TOKEN is required}" : "${NODE_AUTH_TOKEN:?NPM_PUBLISH_TOKEN is required}"
: "${NPMJS_PUBLISH_TOKEN:?NPMJS_PUBLISH_TOKEN is required}"
: "${RELEASE_TOKEN:?RELEASE_TOKEN is required}" : "${RELEASE_TOKEN:?RELEASE_TOKEN is required}"
- name: Type check - name: Type check
@@ -106,6 +113,8 @@ jobs:
run: pnpm test:coverage run: pnpm test:coverage
- name: Build component - name: Build component
env:
DEMO_BASE_PATH: /waveform-analysis/
run: pnpm build run: pnpm build
- name: Pack component - name: Pack component
@@ -154,20 +163,47 @@ jobs:
npm config set -- '//lqycustomsite.online/api/packages/admin/npm/:_authToken' "$NODE_AUTH_TOKEN" npm config set -- '//lqycustomsite.online/api/packages/admin/npm/:_authToken' "$NODE_AUTH_TOKEN"
npm publish "./$package_file" --registry="$registry_url" --tag "$NPM_DIST_TAG" npm publish "./$package_file" --registry="$registry_url" --tag "$NPM_DIST_TAG"
- name: Publish component package - name: Publish to npmjs.org
shell: bash
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
run: |
set -euo pipefail
source release.env
: "${NODE_AUTH_TOKEN:?NPMJS_PUBLISH_TOKEN is required}"
package_file="release-assets/waveform-analysis-${PACKAGE_VERSION}.tgz"
npm config set -- '//registry.npmjs.org/:_authToken' "$NODE_AUTH_TOKEN"
npm publish "./$package_file" --registry='https://registry.npmjs.org/' --tag "$NPM_DIST_TAG" --access public
- name: Deploy stable demo
shell: bash shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
source release.env source release.env
published_name="waveform-analysis-${PACKAGE_VERSION}.tgz" if [[ "$IS_PRERELEASE" == 'true' ]]; then
install -m 644 "release-assets/$published_name" "/downloads/$published_name" echo 'Skipping demo deployment for prerelease'
cd /downloads exit 0
sha256sum "$published_name" > "$published_name.sha256"
if [[ "$IS_PRERELEASE" == 'false' ]]; then
ln -sfn "$published_name" waveform-analysis-latest.tgz
ln -sfn "$published_name.sha256" waveform-analysis-latest.tgz.sha256
fi fi
deploy_root='/demo-deploy'
releases_dir="$deploy_root/releases"
release_dir="$releases_dir/$PACKAGE_VERSION"
test ! -e "$release_dir"
install -d -m 755 "$releases_dir"
staging_dir="$(mktemp -d "$deploy_root/.staging-${PACKAGE_VERSION}-XXXXXX")"
trap 'rm -rf -- "$staging_dir"' EXIT
cp -a dist-demo/. "$staging_dir/"
find "$staging_dir" -type d -exec chmod 755 {} +
find "$staging_dir" -type f -exec chmod 644 {} +
mv "$staging_dir" "$release_dir"
trap - EXIT
ln -sfn "releases/$PACKAGE_VERSION" "$deploy_root/current"
mapfile -t old_releases < <(find "$releases_dir" -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | sort -V | head -n -5)
for old_release in "${old_releases[@]}"; do
rm -rf -- "$releases_dir/$old_release"
done
- name: Create Gitea release - name: Create Gitea release
shell: bash shell: bash
env: env:

View File

@@ -5,6 +5,10 @@
组件使用 SVG 绘制坐标轴和波形;大数据会按当前可见范围和屏幕像素自动保峰降采样, 组件使用 SVG 绘制坐标轴和波形;大数据会按当前可见范围和屏幕像素自动保峰降采样,
tooltip 与标注仍使用完整原始数据。 tooltip 与标注仍使用完整原始数据。
## 在线示例
最新稳定版 Demo<https://lqycustomsite.online/waveform-analysis/>
## 开始使用 ## 开始使用
```bash ```bash
@@ -30,7 +34,8 @@ pnpm test:coverage
pnpm build pnpm build
``` ```
`pnpm build` 同时生成 `dist` 组件库产物和 `dist-demo` 演示应用。正式公开入口为 `pnpm build` 同时生成 `dist` 组件库产物和 `dist-demo` 演示应用。发布稳定版后,在线示例
会自动更新;预发布版本不会覆盖在线示例。正式公开入口为
`src/index.ts`;发布后使用包入口: `src/index.ts`;发布后使用包入口:
```ts ```ts

View File

@@ -1,6 +1,6 @@
{ {
"name": "waveform-analysis", "name": "waveform-analysis",
"version": "0.1.7", "version": "0.1.11",
"main": "./dist/index.cjs", "main": "./dist/index.cjs",
"module": "./dist/index.js", "module": "./dist/index.js",
"types": "./dist/types/index.d.ts", "types": "./dist/types/index.d.ts",

View File

@@ -4,6 +4,7 @@ import vue from '@vitejs/plugin-vue'
import { defineConfig } from 'vitest/config' import { defineConfig } from 'vitest/config'
export default defineConfig({ export default defineConfig({
base: process.env.DEMO_BASE_PATH ?? '/',
plugins: [vue()], plugins: [vue()],
server: { server: {
host: '0.0.0.0', host: '0.0.0.0',
@@ -33,19 +34,5 @@ export default defineConfig({
}, },
build: { build: {
outDir: 'dist-demo', outDir: 'dist-demo',
rolldownOptions: {
output: {
codeSplitting: {
groups: [
{
name: 'vendor',
test: /node_modules[\\/]/,
maxSize: 400_000,
priority: 1,
},
],
},
},
},
}, },
}) })