Skip to content

Commit

Permalink
Merge pull request #218 from DaveKeehl/dev
Browse files Browse the repository at this point in the history
Release version 1.1.0
  • Loading branch information
DaveKeehl authored Apr 10, 2024
2 parents a7cfa49 + f9d1e42 commit b4ec619
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 33 deletions.
15 changes: 13 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ body:
attributes:
value: |
Thanks for taking the time to fill out this bug report!
- type: dropdown
id: platform
attributes:
label: Type of Svelte app
options:
- Svelte Vite template
- SvelteKit
- Astro + Svelte
- Other (please describe later)
validations:
required: true
- type: textarea
id: bug-description
attributes:
Expand All @@ -26,9 +37,9 @@ body:
id: system-info
attributes:
label: System Info
description: Output of `npx envinfo --system --binaries --browsers --npmPackages "{svelte-reveal}"`
description: Output of `npx envinfo --system --binaries --browsers --npmPackages` in your repository.
render: Shell
placeholder: System, Binaries, Browsers
placeholder: System, Binaries, Browsers, NPM Packages
validations:
required: true
- type: dropdown
Expand Down
17 changes: 3 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
name: CI

on: [push, pull_request]
on: [push]

jobs:
CI:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand All @@ -17,19 +17,8 @@ jobs:
node-version: 20
cache: 'npm'

- name: Installing dependencies
- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build -- --filter=svelte-reveal

# - name: Testing
# run: npm run test

# - name: SonarCloud Scan
# uses: sonarsource/sonarcloud-github-action@master
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# with:
# projectBaseDir: packages/svelte-reveal
56 changes: 43 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,52 @@
name: 'Publish to NPM'
name: Release

on:
pull_request:
types:
- opened
- synchronize
- closed
branches:
- main

jobs:
check-version:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.package-version.outputs.current-version }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get current version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: 'packages/svelte-reveal'

- name: Get latest tag
id: latest-tag
uses: 'WyriHaximus/github-action-get-previous-tag@v1'

- name: Compare versions
uses: madhead/semver-utils@v4
id: version
with:
version: ${{ steps.latest-tag.outputs.tag }}

- name: Detected invalid semver upgrade
if: ${{ steps.package-version.outputs.current-version != steps.version.outputs.inc-major && steps.package-version.outputs.current-version != steps.version.outputs.inc-minor && steps.package-version.outputs.current-version != steps.version.outputs.inc-patch }}
uses: actions/github-script@v7
with:
script: |
core.setFailed('Invalid semver upgrade (${{ steps.latest-tag.outputs.tag }} -> ${{ steps.package-version.outputs.current-version }})')
release:
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: check-version
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -23,7 +59,7 @@ jobs:
node-version: 20
cache: 'npm'

- name: Installing dependencies
- name: Install dependencies
run: npm ci

- name: Build package
Expand All @@ -40,12 +76,6 @@ jobs:
package: ./packages/svelte-reveal/package.json
strategy: upgrade

- name: Get Package Version
id: package-version
uses: martinbeentjes/npm-get-version-action@master
with:
path: 'packages/svelte-reveal'

- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
Expand All @@ -58,8 +88,8 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.package-version.outputs.current-version }}
release_name: ${{ steps.package-version.outputs.current-version }}
tag_name: ${{ needs.check-version.outputs.version }}
release_name: ${{ needs.check-version.outputs.version }}
draft: false
prerelease: false
body: ${{ steps.extract-release-notes.outputs.release_notes }}
Expand All @@ -71,6 +101,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./packages/svelte-reveal/svelte-reveal-${{ steps.package-version.outputs.current-version }}.tgz
asset_name: svelte-reveal-${{ steps.package-version.outputs.current-version }}.tgz
asset_path: ./packages/svelte-reveal/svelte-reveal-${{ needs.check-version.outputs.version }}.tgz
asset_name: svelte-reveal-${{ needs.check-version.outputs.version }}.tgz
asset_content_type: application/gzip
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions packages/svelte-reveal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.1.0] - 2024-04-10

### Changed

- Improved GitHub actions workflows ([#212](https://github.com/DaveKeehl/svelte-reveal/pull/212))
- Improved bundled stylesheet ([#213](https://github.com/DaveKeehl/svelte-reveal/pull/213))
- Improve bug report template ([#217](https://github.com/DaveKeehl/svelte-reveal/pull/217))

### Fixed

- Elements targeted by Svelte Reveal inside a parent node no longer appear on the bottom ([#215](https://github.com/DaveKeehl/svelte-reveal/pull/215))

## [1.0.4] - 2024-04-05

### Fixed
Expand Down Expand Up @@ -201,3 +213,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.0.2]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.1...1.0.2
[1.0.3]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.2...1.0.3
[1.0.4]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.3...1.0.4
[1.1.0]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.4...1.1.0
2 changes: 1 addition & 1 deletion packages/svelte-reveal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svelte-reveal",
"version": "1.0.4",
"version": "1.1.0",
"description": "Svelte action that leverages the Intersection Observer API to trigger reveal on scroll transitions",
"type": "module",
"main": "dist/index.cjs",
Expand Down
3 changes: 2 additions & 1 deletion packages/svelte-reveal/src/internal/DOM.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ export const revealNode = (
*/
export const getNodeToReveal = (node: HTMLElement): HTMLElement => {
const wrapper = document.createElement('div');
node.parentElement?.appendChild(wrapper);
const parentElement = node.parentElement;
parentElement?.insertBefore(wrapper, node);
wrapper.appendChild(node);
return wrapper;
};
Expand Down
2 changes: 1 addition & 1 deletion packages/svelte-reveal/src/styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.sr__hide {
display: none !important;
visibility: hidden;
}

0 comments on commit b4ec619

Please sign in to comment.