Skip to content

Commit b4ec619

Browse files
authored
Merge pull request #218 from DaveKeehl/dev
Release version 1.1.0
2 parents a7cfa49 + f9d1e42 commit b4ec619

File tree

8 files changed

+77
-33
lines changed

8 files changed

+77
-33
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ body:
77
attributes:
88
value: |
99
Thanks for taking the time to fill out this bug report!
10+
- type: dropdown
11+
id: platform
12+
attributes:
13+
label: Type of Svelte app
14+
options:
15+
- Svelte Vite template
16+
- SvelteKit
17+
- Astro + Svelte
18+
- Other (please describe later)
19+
validations:
20+
required: true
1021
- type: textarea
1122
id: bug-description
1223
attributes:
@@ -26,9 +37,9 @@ body:
2637
id: system-info
2738
attributes:
2839
label: System Info
29-
description: Output of `npx envinfo --system --binaries --browsers --npmPackages "{svelte-reveal}"`
40+
description: Output of `npx envinfo --system --binaries --browsers --npmPackages` in your repository.
3041
render: Shell
31-
placeholder: System, Binaries, Browsers
42+
placeholder: System, Binaries, Browsers, NPM Packages
3243
validations:
3344
required: true
3445
- type: dropdown

.github/workflows/ci.yml

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
name: CI
22

3-
on: [push, pull_request]
3+
on: [push]
44

55
jobs:
6-
CI:
6+
build:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout code
@@ -17,19 +17,8 @@ jobs:
1717
node-version: 20
1818
cache: 'npm'
1919

20-
- name: Installing dependencies
20+
- name: Install dependencies
2121
run: npm ci
2222

2323
- name: Build package
2424
run: npm run build -- --filter=svelte-reveal
25-
26-
# - name: Testing
27-
# run: npm run test
28-
29-
# - name: SonarCloud Scan
30-
# uses: sonarsource/sonarcloud-github-action@master
31-
# env:
32-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33-
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
34-
# with:
35-
# projectBaseDir: packages/svelte-reveal

.github/workflows/release.yml

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,52 @@
1-
name: 'Publish to NPM'
1+
name: Release
22

33
on:
44
pull_request:
55
types:
6+
- opened
7+
- synchronize
68
- closed
79
branches:
810
- main
911

1012
jobs:
13+
check-version:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
version: ${{ steps.package-version.outputs.current-version }}
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Get current version
24+
id: package-version
25+
uses: martinbeentjes/[email protected]
26+
with:
27+
path: 'packages/svelte-reveal'
28+
29+
- name: Get latest tag
30+
id: latest-tag
31+
uses: 'WyriHaximus/github-action-get-previous-tag@v1'
32+
33+
- name: Compare versions
34+
uses: madhead/semver-utils@v4
35+
id: version
36+
with:
37+
version: ${{ steps.latest-tag.outputs.tag }}
38+
39+
- name: Detected invalid semver upgrade
40+
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 }}
41+
uses: actions/github-script@v7
42+
with:
43+
script: |
44+
core.setFailed('Invalid semver upgrade (${{ steps.latest-tag.outputs.tag }} -> ${{ steps.package-version.outputs.current-version }})')
45+
1146
release:
12-
if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main'
1347
runs-on: ubuntu-latest
48+
needs: check-version
49+
if: github.event.pull_request.merged == true
1450
steps:
1551
- name: Checkout code
1652
uses: actions/checkout@v4
@@ -23,7 +59,7 @@ jobs:
2359
node-version: 20
2460
cache: 'npm'
2561

26-
- name: Installing dependencies
62+
- name: Install dependencies
2763
run: npm ci
2864

2965
- name: Build package
@@ -40,12 +76,6 @@ jobs:
4076
package: ./packages/svelte-reveal/package.json
4177
strategy: upgrade
4278

43-
- name: Get Package Version
44-
id: package-version
45-
uses: martinbeentjes/npm-get-version-action@master
46-
with:
47-
path: 'packages/svelte-reveal'
48-
4979
- name: Extract release notes
5080
id: extract-release-notes
5181
uses: ffurrer2/extract-release-notes@v1
@@ -58,8 +88,8 @@ jobs:
5888
env:
5989
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6090
with:
61-
tag_name: ${{ steps.package-version.outputs.current-version }}
62-
release_name: ${{ steps.package-version.outputs.current-version }}
91+
tag_name: ${{ needs.check-version.outputs.version }}
92+
release_name: ${{ needs.check-version.outputs.version }}
6393
draft: false
6494
prerelease: false
6595
body: ${{ steps.extract-release-notes.outputs.release_notes }}
@@ -71,6 +101,6 @@ jobs:
71101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
72102
with:
73103
upload_url: ${{ steps.create-release.outputs.upload_url }}
74-
asset_path: ./packages/svelte-reveal/svelte-reveal-${{ steps.package-version.outputs.current-version }}.tgz
75-
asset_name: svelte-reveal-${{ steps.package-version.outputs.current-version }}.tgz
104+
asset_path: ./packages/svelte-reveal/svelte-reveal-${{ needs.check-version.outputs.version }}.tgz
105+
asset_name: svelte-reveal-${{ needs.check-version.outputs.version }}.tgz
76106
asset_content_type: application/gzip

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/svelte-reveal/CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.0] - 2024-04-10
9+
10+
### Changed
11+
12+
- Improved GitHub actions workflows ([#212](https://github.com/DaveKeehl/svelte-reveal/pull/212))
13+
- Improved bundled stylesheet ([#213](https://github.com/DaveKeehl/svelte-reveal/pull/213))
14+
- Improve bug report template ([#217](https://github.com/DaveKeehl/svelte-reveal/pull/217))
15+
16+
### Fixed
17+
18+
- Elements targeted by Svelte Reveal inside a parent node no longer appear on the bottom ([#215](https://github.com/DaveKeehl/svelte-reveal/pull/215))
19+
820
## [1.0.4] - 2024-04-05
921

1022
### Fixed
@@ -201,3 +213,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
201213
[1.0.2]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.1...1.0.2
202214
[1.0.3]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.2...1.0.3
203215
[1.0.4]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.3...1.0.4
216+
[1.1.0]: https://github.com/DaveKeehl/svelte-reveal/compare/1.0.4...1.1.0

packages/svelte-reveal/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "svelte-reveal",
3-
"version": "1.0.4",
3+
"version": "1.1.0",
44
"description": "Svelte action that leverages the Intersection Observer API to trigger reveal on scroll transitions",
55
"type": "module",
66
"main": "dist/index.cjs",

packages/svelte-reveal/src/internal/DOM.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ export const revealNode = (
6666
*/
6767
export const getNodeToReveal = (node: HTMLElement): HTMLElement => {
6868
const wrapper = document.createElement('div');
69-
node.parentElement?.appendChild(wrapper);
69+
const parentElement = node.parentElement;
70+
parentElement?.insertBefore(wrapper, node);
7071
wrapper.appendChild(node);
7172
return wrapper;
7273
};

packages/svelte-reveal/src/styles.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.sr__hide {
2-
display: none !important;
2+
visibility: hidden;
33
}

0 commit comments

Comments
 (0)