Skip to content

Commit

Permalink
Pkg - Edit actions, add publish workflow, fix non-sense TSC error at m…
Browse files Browse the repository at this point in the history
  • Loading branch information
smastrom committed Nov 16, 2023
1 parent 7590094 commit 063a51e
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Chrome

on: [push]
on:
pull_request:
push:
branches:
- '*'
tags-ignore:
- '*'
workflow_call:

jobs:
cypress-ct:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: Firefox

on: [push]
on:
pull_request:
push:
branches:
- '*'
tags-ignore:
- '*'
workflow_call:

jobs:
cypress-ct:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Publish to NPM

on:
push:
tags: ['v*']
workflow_dispatch:

jobs:
chrome-tests-workflow:
uses: ./.github/workflows/chrome-tests.yml
firefox-tests-workflow:
uses: ./.github/workflows/firefox-tests.yml
publish:
needs: [chrome-tests-workflow, firefox-tests-workflow]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: true
- name: Build package
run: pnpm build
- name: Copy README and LICENSE
run: cp README.md LICENSE packages/vue-use-fixed-header
- name: Pack
run: cd packages/vue-use-fixed-header && rm -rf *.tgz && npm pack
- name: Publish
run: cd packages/vue-use-fixed-header && npm publish *.tgz --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![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)
![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)

# Vue Use Fixed Header

Expand Down
17 changes: 15 additions & 2 deletions packages/vue-use-fixed-header/src/useFixedHeader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
import { shallowRef, ref, unref, watch, computed, readonly, type CSSProperties as CSS } from 'vue'
import {
shallowRef,
ref,
unref,
watch,
computed,
readonly,
type ComputedRef,
type CSSProperties as CSS,
} from 'vue'

import { useReducedMotion, isBrowser } from './utils'
import { TRANSITION_STYLES } from './constants'
Expand All @@ -14,7 +23,11 @@ enum State {
export function useFixedHeader(
target: MaybeTemplateRef,
options: Partial<UseFixedHeaderOptions> = {},
) {
): {
styles: Readonly<CSS>
isLeave: Readonly<ComputedRef<boolean>>
isEnter: Readonly<ComputedRef<boolean>>
} {
// Config

const { enterStyles, leaveStyles } = TRANSITION_STYLES
Expand Down

0 comments on commit 063a51e

Please sign in to comment.