Skip to content

Commit 3555152

Browse files
committed
merge master -> website
2 parents f3f50cb + 8601c9c commit 3555152

28 files changed

+672
-774
lines changed

.github/workflows/quality.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: pnpm/action-setup@v2
15-
- uses: actions/setup-node@v3
13+
- uses: actions/checkout@v4
14+
- uses: pnpm/action-setup@v4
15+
- uses: actions/setup-node@v4
1616
with:
17-
node-version: 18
17+
node-version: 20
1818
cache: pnpm
1919

2020
- run: pnpm install

.github/workflows/release.yaml

+68-14
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,85 @@ on:
66
pull_request:
77

88
jobs:
9+
manifest:
10+
runs-on: ubuntu-latest
11+
outputs:
12+
version: ${{ steps.extract.outputs.version }}
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- id: extract
17+
working-directory: ./workspace/extension/static
18+
run: echo "version=$(jq -r '.version' manifest.json)" >> $GITHUB_OUTPUT
19+
920
bundle:
1021
runs-on: ubuntu-latest
22+
needs: manifest
1123

1224
steps:
13-
- uses: actions/checkout@v3
14-
- uses: pnpm/action-setup@v2
15-
- uses: actions/setup-node@v3
25+
- uses: actions/checkout@v4
26+
- uses: pnpm/action-setup@v4
27+
- uses: actions/setup-node@v4
1628
with:
17-
node-version: 18
29+
node-version: 20
1830
cache: pnpm
1931

2032
- run: pnpm install
21-
- run: cd workspace/extension && pnpm build
22-
- run: cd workspace/extension/build && zip -r svelte-devtools *
33+
- working-directory: ./workspace/extension
34+
run: pnpm build && cd build && zip -r svelte-devtools *
2335

24-
- uses: actions/upload-artifact@v3
36+
- uses: actions/upload-artifact@v4
2537
with:
2638
name: extension-${{ github.sha }}
2739
path: workspace/extension/build/svelte-devtools.zip
2840

29-
# publish:
30-
# runs-on: ubuntu-latest
31-
# needs: bundle
41+
- if: github.event_name == 'pull_request'
42+
env:
43+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
PR_NUMBER: ${{ github.event.number }}
45+
WORKFLOW: ${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts
46+
run: |
47+
url=https://github.com/$WORKFLOW/$(gh api repos/$WORKFLOW --jq '.artifacts[0].id')
48+
commented=$(gh pr view $PR_NUMBER --json comments --jq '.comments[].author.login | select(. | contains("github-actions"))')
49+
body="Try the changes in this PR by [side-loading the built extension]($url). :rocket:"
50+
51+
if [ -z "$commented" ]; then
52+
gh pr comment $PR_NUMBER --body "$body"
53+
else
54+
gh pr comment $PR_NUMBER --edit-last --body "$body"
55+
fi
56+
57+
publish:
58+
runs-on: ubuntu-latest
59+
needs: [manifest, bundle]
60+
61+
if: |
62+
github.repository == 'sveltejs/svelte-devtools' &&
63+
github.event_name == 'push' && github.ref == 'refs/heads/master' &&
64+
startsWith(github.event.head_commit.message, format('~ v{0}', needs.manifest.outputs.version))
65+
66+
steps:
67+
- uses: actions/checkout@v4
68+
- uses: pnpm/action-setup@v4
69+
- uses: actions/download-artifact@v4
70+
71+
- working-directory: extension-${{ github.sha }}
72+
run: |
73+
pnpm dlx web-ext sign --channel unlisted \
74+
--api-key ${{ secrets.WEB_EXT_API_KEY }} \
75+
--api-secret ${{ secrets.WEB_EXT_API_SECRET }}
76+
77+
- working-directory: extension-${{ github.sha }}
78+
env:
79+
GH_TOKEN: ${{ github.token }}
80+
run: | # https://cli.github.com/manual/gh_release_create
81+
gh release create v${{ needs.manifest.outputs.version }} \
82+
svelte-devtools.zip web-ext-artifacts/*.xpi#svelte-devtools.xpi \
83+
--title ${{ needs.manifest.outputs.version }} \
84+
--draft --generate-notes --notes '
85+
Built from ${{ github.event.head_commit.id }} at https://github.com/sveltejs/svelte-devtools/actions/runs/${{ github.run_id }}
86+
- Chrome Web Store: https://chrome.google.com/webstore/detail/svelte-devtools/kfidecgcdjjfpeckbblhmfkhmlgecoff
87+
- Firefox Signed Add-on: https://github.com/sveltejs/svelte-devtools/releases/download/v${{ needs.manifest.outputs.version }}/svelte-devtools.xpi
88+
---'
3289
33-
# steps:
34-
# - uses: actions/download-artifact@v3
35-
# with:
36-
# name: extension-${{ github.sha }}
90+
# TODO: publish to Chrome Web Store

README.md

+14-5
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,21 @@ Svelte DevTools is a browser extension for the [Svelte](https://svelte.dev/) fra
1111

1212
After installing you will see a new tab in Developer Tools. This tab displays a tree of Svelte components, HTMLx blocks, and DOM elements that were rendered on the page. By selecting one of the nodes in the tree, you can inspect and edit its current state in the panel to the right.
1313

14-
> For Firefox users, you can grab the [`.zip` file of the latest version from the GitHub releases page](https://github.com/sveltejs/svelte-devtools/releases/latest) and load it as a temporary extension. Note that you may need to enable "Always Allow on localhost" in the extension settings.
14+
> For Firefox users, you can install the [`.xpi` file of the latest version from the GitHub releases page](https://github.com/sveltejs/svelte-devtools/releases/latest). Note that if you grab the `.zip` file, you will need to load it as a temporary extension and enable "Always Allow on localhost" in the extension settings.
1515
1616
![2.0.0 Screenshot](./.github/assets/screenshot-2.0.0.png '2.0.0 Screenshot')
1717

1818
## Requirements
1919

20-
The `svelte-devtools` extension requires your Svelte application to be compiled with the `dev` option set to `true`. If you're using [SvelteKit](https://kit.svelte.dev/), this is done automatically, outside of that you will need to set it manually.
20+
The `svelte-devtools` extension requires the following to be true:
2121

22-
This extension officially supports Svelte version `^4.0.0`.
22+
- Chrome or Firefox version 121 or higher
23+
- Application running Svelte version `^4.0.0`
24+
- Application compiled with `dev: true` ([SvelteKit](https://kit.svelte.dev/) does this automatically for you)
2325

2426
## Development
2527

26-
Clone this repository, setup and run the build script
28+
Clone this repository and setup the environment with `pnpm`
2729

2830
```sh
2931
git clone https://github.com/sveltejs/svelte-devtools.git
@@ -34,7 +36,14 @@ cd workspace/extension
3436
pnpm dev
3537
```
3638

37-
This will build the codebase and output all the required files in the `build` directory. To load the extension for development, follow these steps:
39+
To work on the extension, run the `dev` script from `workspace/extension` directory
40+
41+
```sh
42+
cd workspace/extension
43+
pnpm dev
44+
```
45+
46+
This will build the extension and create a directory called `build`. Steps may vary depending on the browser you are using, but generally:
3847

3948
1. Navigate to the extensions settings page
4049
2. Turn on the 'Developer mode' switch

package.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
},
99
"packageManager": "[email protected]",
1010
"devDependencies": {
11-
"@sveltejs/vite-plugin-svelte": "^3.1.0",
12-
"@types/node": "^20.12.7",
13-
"prettier": "^3.2.5",
11+
"@sveltejs/vite-plugin-svelte": "next",
12+
"@types/node": "^20.16.6",
13+
"prettier": "^3.3.3",
1414
"prettier-plugin-sort-package-json": "^0.2.0",
15-
"prettier-plugin-svelte": "^3.2.3",
16-
"svelte": "5.0.0-next.90",
17-
"svelte-check": "^3.6.9",
18-
"typescript": "^5.4.5",
19-
"vite": "^5.2.9"
15+
"prettier-plugin-svelte": "^3.2.6",
16+
"svelte": "5.0.0-next.141",
17+
"svelte-check": "^4.0.2",
18+
"typescript": "^5.6.2",
19+
"vite": "^5.4.7"
2020
}
2121
}

0 commit comments

Comments
 (0)