Skip to content

Commit ca17860

Browse files
Merge branch 'main' into fix/errors-and-unused-code-of-docs
2 parents 4ae51b1 + 55dc263 commit ca17860

174 files changed

Lines changed: 5231 additions & 2384 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Set default
2-
* @aklinker1 @Timeraa
2+
* @aklinker1
33

44
# Secure Directories
55
/.github/ @aklinker1

.github/workflows/auto-label.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: ✨ Auto-label PR
2+
3+
on:
4+
pull_request_target:
5+
types: [opened, synchronized, reopened]
6+
7+
jobs:
8+
update-pr:
9+
name: Update PR
10+
runs-on: ubuntu-latest
11+
permissions:
12+
pull-requests: write
13+
steps:
14+
- name: Gather Info
15+
id: check
16+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
17+
with:
18+
script: |
19+
const { data: pr } = await github.rest.pulls.get({
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
pull_number: context.payload.pull_request.number
23+
});
24+
25+
// Check if PR has assignees
26+
const hasAssignees = pr.assignees && pr.assignees.length > 0;
27+
core.setOutput('has_assignees', hasAssignees);
28+
core.setOutput('author', pr.user.login);
29+
30+
// Get list of changed files
31+
const { data: files } = await github.rest.pulls.listFiles({
32+
owner: context.repo.owner,
33+
repo: context.repo.repo,
34+
pull_number: context.payload.pull_request.number
35+
});
36+
37+
// Find all packages that were modified
38+
const packagesRegex = /^packages\/([^\/]+)\//;
39+
const affectedPackages = new Set();
40+
41+
for (const file of files) {
42+
const match = file.filename.match(packagesRegex);
43+
if (match) {
44+
affectedPackages.add(match[1]);
45+
}
46+
}
47+
48+
const labels = Array.from(affectedPackages).map(pkg => `pkg/${pkg}`);
49+
core.setOutput('labels', JSON.stringify(labels));
50+
console.log('Detected package labels:', labels);
51+
52+
// Get current labels on the PR that match pkg/* pattern
53+
const currentPkgLabels = pr.labels
54+
.map(label => label.name)
55+
.filter(name => name.startsWith('pkg/'));
56+
57+
core.setOutput('current_pkg_labels', JSON.stringify(currentPkgLabels));
58+
console.log('Current pkg labels:', currentPkgLabels);
59+
60+
- name: Sync Author
61+
if: steps.check.outputs.has_assignees == 'false'
62+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
63+
with:
64+
script: |
65+
await github.rest.issues.addAssignees({
66+
owner: context.repo.owner,
67+
repo: context.repo.repo,
68+
issue_number: context.payload.pull_request.number,
69+
assignees: ['${{ steps.check.outputs.author }}']
70+
});
71+
72+
console.log('Assigned PR author: ${{ steps.check.outputs.author }}');
73+
74+
- name: Sync Labels
75+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8
76+
with:
77+
script: |
78+
const newLabels = ${{ steps.check.outputs.labels }};
79+
const currentLabels = ${{ steps.check.outputs.current_pkg_labels }};
80+
81+
// Find labels to add (in newLabels but not in currentLabels)
82+
const labelsToAdd = newLabels.filter(label => !currentLabels.includes(label));
83+
84+
// Find labels to remove (in currentLabels but not in newLabels)
85+
const labelsToRemove = currentLabels.filter(label => !newLabels.includes(label));
86+
87+
// Add new labels
88+
if (labelsToAdd.length > 0) {
89+
await github.rest.issues.addLabels({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
issue_number: context.payload.pull_request.number,
93+
labels: labelsToAdd
94+
});
95+
console.log('Added labels:', labelsToAdd);
96+
}
97+
98+
// Remove obsolete labels
99+
for (const label of labelsToRemove) {
100+
await github.rest.issues.removeLabel({
101+
owner: context.repo.owner,
102+
repo: context.repo.repo,
103+
issue_number: context.payload.pull_request.number,
104+
name: label
105+
});
106+
console.log('Removed label:', label);
107+
}
108+
109+
if (labelsToAdd.length === 0 && labelsToRemove.length === 0) {
110+
console.log('No label changes needed');
111+
}

.github/workflows/release.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- analytics
1111
- auto-icons
1212
- i18n
13+
- is-background
1314
- module-react
1415
- module-solid
1516
- module-svelte

.github/workflows/sync-releases.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010
- analytics
1111
- auto-icons
1212
- i18n
13+
- is-background
1314
- module-react
1415
- module-solid
1516
- module-svelte

.github/workflows/vhs.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,35 +11,46 @@ permissions:
1111
jobs:
1212
vhs:
1313
name: Create VHS
14-
runs-on: ubuntu-22.04
14+
runs-on: macos-latest
1515
if: ${{ github.repository == 'wxt-dev/wxt' }}
1616
permissions:
1717
contents: write
1818
steps:
1919
- name: Checkout
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
21+
with:
22+
ref: ${{ github.ref }}
2123

2224
- name: Setup
2325
uses: ./.github/actions/setup
2426
with:
2527
install: false
2628

29+
- name: Setup Go
30+
uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00
31+
with:
32+
go-version: '1.25.1'
33+
2734
# This prevents pnpm dlx from downloading WXT in the video
2835
- name: Pre-install WXT
2936
run: |
3037
pnpm store add wxt@latest
3138
pnpm dlx wxt@latest --version
3239
3340
- name: Record VHS
34-
uses: charmbracelet/vhs-action@59641cdc7fadf3978db65eb8c6937ea2752f4ec3 # v2.1.0
35-
with:
36-
path: 'docs/tapes/init-demo.tape'
41+
run: |
42+
brew install ttyd ffmpeg
43+
go install github.com/charmbracelet/vhs@517bcda0faf416728bcf6b7fe489eb0e2469d9b5 # v0.10.0
44+
vhs docs/tapes/init-demo.tape
3745
3846
- name: Save recorded GIF
3947
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
4048
env:
4149
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4250
with:
4351
commit_message: 'docs: Update `wxt init` GIF'
52+
commit_user_name: github-actions[bot]
53+
commit_user_email: github-actions[bot]@users.noreply.github.com
54+
commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
4455
# https://github.com/charmbracelet/vhs#output
4556
file_pattern: 'docs/assets/*.gif'

.prettierrc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
singleQuote: true
22
endOfLine: lf
3+
plugins:
4+
- prettier-plugin-jsdoc

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,6 @@ cp -r templates/vanilla templates/<new-template-name>
163163

164164
That's it. Once your template is merged, it will be available inside `wxt init` immediately. You don't need to release a new version of WXT to release a new template.
165165

166-
## Releasing Updates
167-
168-
Releases are done with GitHub actions:
169-
170-
- Use the [Release workflow](https://github.com/wxt-dev/wxt/actions/workflows/release.yml) to release a single package in the monorepo. This automatically detects the version change with conventional commits, builds and uploads the package to NPM, and creates a GitHub release.
171-
- Use the [Sync Releases workflow](https://github.com/wxt-dev/wxt/actions/workflows/sync-releases.yml) to sync the GitHub releases with changes to the changelog. To change a release, update the `CHANGELOG.md` file and run the workflow. It will sync the releases of a single package in the monorepo.
172-
173166
## Upgrading Dependencies
174167

175168
WXT has custom rules around what dependencies can be upgraded. Use the `scripts/upgrade-deps.ts` script to upgrade dependencies and follow these rules.

MAINTAINERS.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,44 @@ Here's an example of how to ask for a reproduction: <https://github.com/wxt-dev/
4747
## Add yourself as a code owner
4848

4949
If you want to be responsible for a specific package or directory, add yourself to the [`.github/CODEOWNERS`](https://github.com/wxt-dev/wxt/blob/main/.github/CODEOWNERS) file to get added as a reviewer to PRs automatically. You can also add yourself to the default list to be added as a reviewer on all PRs.
50+
51+
## Releasing Package Updates
52+
53+
Releases are done with GitHub actions:
54+
55+
- Use the [Release workflow](https://github.com/wxt-dev/wxt/actions/workflows/release.yml) to release a single package in the monorepo. This automatically detects the version change with conventional commits, builds and uploads the package to NPM, and creates a GitHub release.
56+
- Use the [Sync Releases workflow](https://github.com/wxt-dev/wxt/actions/workflows/sync-releases.yml) to sync the GitHub releases with changes to the changelog. To change a release, update the `CHANGELOG.md` file and run the workflow. It will sync the releases of a single package in the monorepo.
57+
58+
## Creating New Packages
59+
60+
Example PR: <https://github.com/wxt-dev/wxt/pull/2152>
61+
62+
1. Create the package.
63+
64+
2. Update CI workflow inputs.
65+
66+
3. Add docs page and version for "Other Packages" dropdown.
67+
68+
4. Merge the PR.
69+
70+
5. Tag the commit (look at other tags for pattern):
71+
72+
```sh
73+
git tag <dir-name>-v<version>
74+
git push --tags
75+
```
76+
77+
6. Publish the package to NPM:
78+
79+
```sh
80+
cd packages/<dir-name>
81+
pnpm publish --access public
82+
```
83+
84+
7. Create a basic release on GitHub mentioning the new package is available.
85+
86+
A couple of things to note:
87+
88+
- pkg.pr.new will fail on the original PR. It's fine to ignore and merge your PR as long as it fails due to your new package not being published to NPM yet.
89+
- The regular release workflow DOES NOT WORK for new packages. You have to have at least one `<dir-name>-v<version>` tag created before you can run that workflow for your new package.
90+
- You don't need to create a CHANGELOG.md file for the package, it will be created automatically after future changes are released via the normal release workflow.

SECURITY.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,8 @@ While WXT is in prerelease, only the latest version will receive security update
44

55
<img alt="npm version" src="https://img.shields.io/npm/v/wxt?labelColor=black&color=%234fa048">
66

7-
<!--
87
## Reporting a Vulnerability
98

10-
Use this section to tell people how to report a vulnerability.
9+
If you discover a security vulnerability, please email me at <aaronklinker1@gmail.com>. I will respond within a few days to acknowledge receipt of your report.
1110

12-
Tell them where to go, how often they can expect to get an update on a
13-
reported vulnerability, what to expect if the vulnerability is accepted or
14-
declined, etc.
15-
-->
11+
If the vulnerability is accepted, I will open a public issue to track the fix. If the vulnerability is not accepted, no further action will be taken.

docs/.vitepress/components/UsingWxtSection.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ const CHROME_EXTENSIONS_ID = [
117117
'jdcppdokgfbnhiacbeplahgnciahnhck', // Lofi BGM Player - Free lofi focus music for work & study
118118
'cgpmbiiagnehkikhcbnhiagfomajncpa', // Margin - Annotate and highlight any webpage, with your notes saved to the decentralized AT Protocol.
119119
'mfjdonmgmgcijagclnkfhmjiblbfjaid', // KeyFloat - Floating multilingual keyboard with native key mappings, drag, dark mode, sounds, and dynamic layouts for macOS & Windows
120+
'dhiekgdaipindoapjmcnpompdknjeijf', // Glossy New Tab - Say Goodbye to Boring Tabs with live wallpapers
121+
'lapnciffpekdengooeolaienkeoilfeo', // All API Hub – AI Relay & New API Manager - https://github.com/qixing-jk/all-api-hub
122+
'bhgobenflkkhfcgkikejaaejenoddcmo', // Scrape Similar - Extract data from websites into spreadsheets - https://github.com/zizzfizzix/scrape-similar
123+
'kinlknncggaihnhdcalijdmpbhbflalm', // isTrust - https://github.com/Internet-Society-Belgium/isTrust/
120124
];
121125
122126
const { data, err, isLoading } = useListExtensionDetails(CHROME_EXTENSIONS_ID);

0 commit comments

Comments
 (0)