-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: new architecture, update to Svelte 5 and refactor core lib #1127
Open
edodusi
wants to merge
11
commits into
main
Choose a base branch
from
feature/new-arch-and-svelte5
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+9,392
−10,514
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2371fa6
feat!: upgrade to svelte5 and structure change
edodusi 3a89115
chore: align gh actions and dependabot with ecosystem standard
edodusi c7f36dc
test: add cypress and initial e2e tests
edodusi ba86bb5
feat: refactoring the main library exports
edodusi 4d0e473
fix: renaming files and imports, fix dependabot config
edodusi f94f641
fix: migrate from SvelteComponent to Component, add svelte-check
edodusi 1afcc31
chore: remove unused files
edodusi a2eab79
chore: update to vitest 3
edodusi fa6228f
chore: update to cypress 14
edodusi 319f7c1
chore(playground): add pathe package and update configuration for ali…
alvarosabu ab5b522
chore: tweak dependabot config
edodusi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
blank_issues_enabled: false | ||
blank_issues_enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" | ||
directory: "/" | ||
- package-ecosystem: npm | ||
directory: / | ||
schedule: | ||
interval: "daily" | ||
time: "04:00" | ||
interval: daily | ||
time: '04:00' | ||
commit-message: | ||
prefix: fix | ||
prefix-development: chore | ||
include: scope | ||
labels: | ||
- dependabot | ||
groups: | ||
security-updates: | ||
patterns: | ||
- '*' | ||
exclude-patterns: | ||
- 'storyblok*' | ||
update-types: | ||
- patch | ||
- minor | ||
storyblok: | ||
patterns: | ||
- 'storyblok*' | ||
update-types: | ||
- patch | ||
- minor | ||
ignore: | ||
- dependency-name: '*' | ||
update-types: | ||
- version-update:semver-major |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
SKIP_INSTALL_SIMPLE_GIT_HOOKS: 1 # Skip installing simple-git-hooks | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-24.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'push' | ||
run: pnpm commitlint --last --verbose | ||
- name: Validate PR commits with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: pnpm commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Dependabot auto-approve | ||
on: pull_request | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'storyblok/storyblok-svelte' | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' | ||
alert-lookup: true | ||
- uses: actions/checkout@v4 | ||
- name: Approve a PR if not already approved | ||
run: | | ||
gh pr checkout "$PR_URL" # sets the upstream metadata for `gh pr status` | ||
if [ "$(gh pr status --json reviewDecision -q .currentBranch.reviewDecision)" != "APPROVED" ]; | ||
then gh pr review --approve "$PR_URL" | ||
else echo "PR already approved, skipping additional approvals to minimize emails/notification noise."; | ||
fi | ||
env: | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,23 @@ | ||
# **** AUTOMERGE **** | ||
# Merge automatically the PR that contain a minor or patch update on the dependency you define in env.DEPENDENCY | ||
# - Inspiration: https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request | ||
|
||
name: Dependabot auto-merge | ||
on: pull_request | ||
|
||
permissions: | ||
pull-requests: write | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'storyblok/storyblok-svelte' | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1.1.1 | ||
uses: dependabot/fetch-metadata@v2 | ||
with: | ||
github-token: "${{ secrets.GITHUB_TOKEN }}" | ||
- name: Enable auto-merge for Dependabot PRs | ||
if: ${{contains(steps.metadata.outputs.dependency-names, env.DEPENDENCY) && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor')}} | ||
github-token: '${{ secrets.GITHUB_TOKEN }}' | ||
- name: Enable auto-merge for Dependabot PRs with Storyblok updates | ||
if: contains(steps.metadata.outputs.dependency-names, '*storyblok') && (steps.metadata.outputs.update-type == 'version-update:semver-patch' || steps.metadata.outputs.update-type == 'version-update:semver-minor') | ||
run: gh pr merge --auto --merge "$PR_URL" | ||
env: | ||
DEPENDENCY: "@storyblok/js" | ||
PR_URL: ${{github.event.pull_request.html_url}} | ||
alexjoverm marked this conversation as resolved.
Show resolved
Hide resolved
|
||
GITHUB_TOKEN: ${{secrets.DEPENDABOT_TOKEN}} | ||
GH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Run linters | ||
on: [push] | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
SKIP_INSTALL_SIMPLE_GIT_HOOKS: 1 # Skip installing simple-git-hooks | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
node-version: [20] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Run Lint | ||
run: pnpm run lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Publish Any Commit | ||
on: | ||
push: | ||
branches: | ||
- '**' | ||
tags: | ||
- '!**' | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
SKIP_INSTALL_SIMPLE_GIT_HOOKS: 1 # Skip installing simple-git-hooks | ||
|
||
permissions: {} | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.number }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [20] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
- name: Install dependencies | ||
run: pnpm install | ||
- name: Build | ||
run: pnpm build | ||
- run: pnpx pkg-pr-new publish --compact --pnpm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Run tests | ||
|
||
on: [push] | ||
|
||
env: | ||
PNPM_CACHE_FOLDER: .pnpm-store | ||
SKIP_INSTALL_SIMPLE_GIT_HOOKS: 1 # Skip installing simple-git-hooks | ||
|
||
jobs: | ||
tests: | ||
runs-on: ubuntu-24.04 | ||
strategy: | ||
matrix: | ||
node-version: [20] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: pnpm | ||
|
||
- name: Cache Cypress binary | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/Cypress | ||
key: cypress-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }} | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build Library | ||
run: pnpm build | ||
|
||
- name: Vitest run | ||
run: pnpm run test:unit:ci --silent | ||
|
||
- name: Cypress run | ||
run: pnpm run test:e2e | ||
|
||
- name: Upload Cypress artifacts | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cypress-artifacts | ||
path: | | ||
cypress/screenshots | ||
cypress/videos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
.DS_Store | ||
node_modules | ||
dist | ||
dist-v2 | ||
lib/cypress/videos | ||
.svelte-kit | ||
lib/README.md | ||
|
||
# Output | ||
.output | ||
.vercel | ||
.netlify | ||
.wrangler | ||
/.svelte-kit | ||
/build | ||
/dist | ||
|
||
# OS | ||
.DS_Store | ||
Thumbs.db | ||
|
||
# Env | ||
.env | ||
.env.* | ||
!.env.example | ||
!.env.test | ||
|
||
# Vite | ||
vite.config.js.timestamp-* | ||
vite.config.ts.timestamp-* | ||
|
||
# Cypress | ||
cypress/screenshots/ | ||
cypress/videos | ||
cypress/downloads |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
engine-strict=true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edodusi wouldn't the
ignore
statement prevent the releases from working properly? Because it'll ignore also the updates coming from@storyblok/js
.If that's the case, can we set it to "ignore all dependencies except
@storyblok/js
"? cc @alvarosabuThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexjoverm look at the line after, this is to tell dependabot to ignore all
minor
andmajor
versions of all packages, and focus only onpatch
.This is just for security updates, I should include a new rule for storyblok packages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edodusi in the way is set up, on the lines above (the
groups
statement) it where it groups the security updates. But theignore
applies to all minors and majors, not only security ones. Correct?If that's the case, if in
@storyblok/js
we publish a new minor release, wouldn't that be ignored by this pkg? If the idea is to have a separate dependabot config for storyblok package, is it included in this PR?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes exactly, because the desired outcome would be that dependabot only opens auto-approved PR with grouped patches (we can decide to auto-merge them), and we control manually minors and majors because sometime there are changes that alter some stuff even in minor updates and it's better we do that manually
For storyblok packages we should have specific rules, because maybe we want patches and minors to be automatically merged
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"because maybe we want patches and minors to be automatically merged" -> Exactly, we need it as that's how the whole release system works currently. Can we add them?
About security updates, makes total sense 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added