Skip to content

Commit 6740283

Browse files
committed
Pkg - Edit actions, add publish workflow, fix non-sense TSC warning
1 parent 7590094 commit 6740283

File tree

6 files changed

+72
-6
lines changed

6 files changed

+72
-6
lines changed

.github/workflows/chrome.yml renamed to .github/workflows/chrome-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Chrome
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- '*'
8+
tags-ignore:
9+
- '*'
10+
workflow_call:
411

512
jobs:
613
cypress-ct:

.github/workflows/firefox.yml renamed to .github/workflows/firefox-tests.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Firefox
22

3-
on: [push]
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- '*'
8+
tags-ignore:
9+
- '*'
10+
workflow_call:
411

512
jobs:
613
cypress-ct:

.github/workflows/publish.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Publish to NPM
2+
3+
on:
4+
push:
5+
tags: ['v*']
6+
workflow_dispatch:
7+
8+
jobs:
9+
chrome-tests-workflow:
10+
uses: ./.github/workflows/chrome-tests.yml
11+
firefox-tests-workflow:
12+
uses: ./.github/workflows/firefox-tests.yml
13+
publish:
14+
needs: [chrome-tests-workflow, firefox-tests-workflow]
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
id-token: write
19+
steps:
20+
- uses: actions/checkout@v3
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: '20.x'
24+
registry-url: 'https://registry.npmjs.org'
25+
- uses: pnpm/action-setup@v2
26+
name: Install pnpm
27+
with:
28+
version: 8
29+
run_install: true
30+
- name: Build package
31+
run: pnpm build
32+
- name: Copy README and LICENSE
33+
run: cp README.md LICENSE packages/vue-use-fixed-header
34+
- name: Pack
35+
run: cd packages/vue-use-fixed-header && rm -rf *.tgz && npm pack
36+
- name: Publish
37+
run: cd packages/vue-use-fixed-header && npm publish *.tgz --provenance --access public
38+
env:
39+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![npm](https://img.shields.io/npm/v/vue-use-fixed-header?color=46c119) ![dependency-count](https://img.shields.io/badge/dependencies-0-success) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/chrome.yml?branch=main&label=chrome) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/firefox.yml?branch=main&label=firefox)
1+
![npm](https://img.shields.io/npm/v/vue-use-fixed-header?color=46c119) ![dependency-count](https://img.shields.io/badge/dependencies-0-success) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/chrome-tests.yml?branch=main&label=chrome) ![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/smastrom/vue-use-fixed-header/firefox-tests.yml?branch=main&label=firefox)
22

33
# Vue Use Fixed Header
44

packages/vue-use-fixed-header/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vue-use-fixed-header",
33
"description": "Turn your boring fixed header into a smart one with three lines of code.",
44
"private": false,
5-
"version": "0.9.0",
5+
"version": "2.0.0",
66
"type": "module",
77
"keywords": [
88
"vue",

packages/vue-use-fixed-header/src/useFixedHeader.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
1-
import { shallowRef, ref, unref, watch, computed, readonly, type CSSProperties as CSS } from 'vue'
1+
import {
2+
shallowRef,
3+
ref,
4+
unref,
5+
watch,
6+
computed,
7+
readonly,
8+
type ComputedRef,
9+
type CSSProperties as CSS,
10+
} from 'vue'
211

312
import { useReducedMotion, isBrowser } from './utils'
413
import { TRANSITION_STYLES } from './constants'
@@ -14,7 +23,11 @@ enum State {
1423
export function useFixedHeader(
1524
target: MaybeTemplateRef,
1625
options: Partial<UseFixedHeaderOptions> = {},
17-
) {
26+
): {
27+
styles: Readonly<CSS>
28+
isLeave: Readonly<ComputedRef<boolean>>
29+
isEnter: Readonly<ComputedRef<boolean>>
30+
} {
1831
// Config
1932

2033
const { enterStyles, leaveStyles } = TRANSITION_STYLES

0 commit comments

Comments
 (0)