Skip to content
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

staging: v0.20.0 #1085

Open
wants to merge 28 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
222265f
feat!: Remove `webextension-polyfill` (#1084)
aklinker1 Oct 19, 2024
239dada
fix!: Add suffix to non-production output directories (#1086)
aklinker1 Oct 19, 2024
d83abf2
fix!: Remove deprecated `jiti` entrypoint loader (#1087)
aklinker1 Oct 19, 2024
b6f8789
fix!: Rename `runner` to `webExt` (#1180)
aklinker1 Nov 16, 2024
998098f
fix!: Remove `transformManfiest` option (#1181)
aklinker1 Nov 16, 2024
0ad7115
feat: Upgrade to `c12@2` so config is loaded as ESM (#1182)
aklinker1 Nov 16, 2024
7f092e7
chore: Replace `require.resolve` with `import.meta.resolve` (#1221)
aklinker1 Nov 28, 2024
defd796
chore: Fix type errors
aklinker1 Nov 28, 2024
ed60fd6
fix!: Make `publicDir` and `modulesDir` relative to project root (#1216)
aklinker1 Nov 28, 2024
9971656
docs: Fix public path reference
aklinker1 Dec 29, 2024
0d124b1
docs: Add blog and first blog post to wxt.dev (#1261)
aklinker1 Dec 8, 2024
df6af49
feat!: Individual exports and introduce the `#imports` module (#1258)
aklinker1 Dec 11, 2024
be6b6c0
fix: Add support for WXT v0.20.0
aklinker1 Dec 29, 2024
520b39a
chore: Remove duplicate test
aklinker1 Dec 11, 2024
eff2b70
feat!: Reset inherited styles inside shadow root (#1269)
aklinker1 Dec 11, 2024
57af30e
docs: Fix broken links
aklinker1 Dec 11, 2024
90eb735
fix!: Move `wxt/storage` to `wxt/utils/storage` (#1271)
aklinker1 Dec 12, 2024
1e85f2a
docs: Fix api reference for `wxt/utils/storage`
aklinker1 Dec 12, 2024
1635d93
docs: Update `wxt init` GIF
aklinker1 Dec 25, 2024
85f146c
docs: Add upgrade guide for v0.20 (#1270)
aklinker1 Dec 26, 2024
e23b32c
feat: Add `@wxt-dev/webextension-polyfill` module (#1310)
aklinker1 Dec 28, 2024
590b38f
fix: Add back `ExtensionRunnerConfig` as deprecated (#1311)
aklinker1 Dec 28, 2024
fb1a716
docs: Update upgrade guide
aklinker1 Dec 29, 2024
4e4f99d
feat!: Auto-import types (#1315)
aklinker1 Dec 30, 2024
58145e6
fix: missing browser in shadow-root file (#1317)
1natsu172 Dec 31, 2024
62c7e51
chore(release): wxt-v0.20.0-beta1
aklinker1 Jan 4, 2025
4cdc972
docs: Update configurable directories in `project-structure.md`
aklinker1 Jan 6, 2025
d7c9755
docs: Update modules path to new path
aklinker1 Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:
- module-vue
- storage
- unocss
- webextension-polyfill
- wxt

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/sync-releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
- module-svelte
- module-vue
- storage
- webextension-polyfill
- wxt

jobs:
Expand Down
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,13 @@ npm i https://pkg.pr.new/@wxt-dev/module-react@main
# Install `@wxt-dev/storage` from a specific commit:
npm i https://pkg.pr.new/@wxt-dev/module-react@426f907
```

## Blog Posts

Anyone is welcome to submit a blog post on https://wxt.dev/blog!

> [!NOTE]
> Before starting on a blog post, please message Aaron on Discord or start a discussion on GitHub to get permission to write about a topic, but most topics are welcome: Major version updates, tutorials, etc.

- **English only**: Blog posts should be written in English. Unfortunately, our maintainers doesn't have the bandwidth right now to translate our docs, let alone blog posts. Sorry 😓
- **AI**: Please only use AI to translate or proof-read your blog post. Don't generate the whole thing... We don't want to publish that.
70 changes: 70 additions & 0 deletions docs/.vitepress/components/BlogHome.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<script lang="ts" setup>
import { computed } from 'vue';
// @ts-expect-error: Vitepress data-loader magic, this import is correct
import { data } from '../loaders/blog.data';
import BlogPostPreview from './BlogPostPreview.vue';

const posts = computed(() =>
data
.map((post) => ({
...post,
...post.frontmatter,
date: new Date(post.frontmatter.date),
}))
.sort((a, b) => b.date.getTime() - a.date.getTime()),
);
</script>

<template>
<div class="container">
<div>
<div class="vp-doc">
<h1>Blog</h1>
</div>

<ul>
<BlogPostPreview v-for="post of posts" :key="post.url" :post />
</ul>
</div>
</div>
</template>

<style scoped>
.container {
display: flex;
flex-direction: column;
align-items: center;
}
.container > div {
padding: 32px;
max-width: 900px;
width: 100%;
min-width: 0;
}

h1 {
padding-bottom: 16px;
}

ul {
display: flex;
flex-direction: column;
list-style: none;
}
ul,
li {
padding: 0;
margin: 0;
}

ul li {
padding-top: 16px;
margin-top: 16px;
border-top: 1px solid var(--vp-c-default);
}
ul li:last-child {
padding-bottom: 16px;
margin-bottom: 16px;
border-bottom: 1px solid var(--vp-c-default);
}
</style>
76 changes: 76 additions & 0 deletions docs/.vitepress/components/BlogLayout.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<script lang="ts" setup>
import useBlogDate from '../composables/useBlogDate';
import { useData } from 'vitepress';

const { frontmatter } = useData();
const date = useBlogDate(() => frontmatter.value.date);
</script>

<template>
<div class="vp-doc">
<main class="container-content">
<h1 v-html="$frontmatter.title" />
<p class="meta-row">
<a
class="author"
v-for="author of $frontmatter.authors"
:key="author.github"
:href="`https://github.com/${author.github}`"
>
<img :src="`https://github.com/${author.github}.png?size=96`" />
<span>{{ author.name }}</span>
</a>
<span>&bull;</span>
<span>{{ date }}</span>
</p>
<Content />
</main>
</div>
</template>

<style scoped>
vp-doc {
display: flex;
}
main {
max-width: 1080px;
padding: 32px;
margin: auto;
}
@media (min-width: 768px) {
main {
padding: 64px;
}
}
.meta-row {
display: flex;
color: var(--vp-c-text-2);
gap: 16px;
overflow: hidden;
padding-bottom: 32px;
}
.meta-row > * {
flex-shrink: 0;
}
.author {
display: flex;
gap: 8px;
align-items: center;
color: var(--vp-c-text-2);
font-weight: normal;
text-decoration: none;
}
.author img {
width: 24px;
height: 24px;
border-radius: 100%;
}
.author span {
padding: 0;
margin: 0;
}
.author:hover {
text-decoration: underline;
color: var(--vp-c-text-2);
}
</style>
72 changes: 72 additions & 0 deletions docs/.vitepress/components/BlogPostPreview.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<script lang="ts" setup>
import useBlogDate from '../composables/useBlogDate';

const props = defineProps<{
post: {
title: string;
description?: string;
date: Date;
url: string;
authors: Array<{ name: string; github: string }>;
};
}>();

const date = useBlogDate(() => props.post.date);
</script>

<template>
<li class="blog-list-item">
<a :href="post.url">
<div class="vp-doc">
<h3 class="title" v-html="post.title" />
<p class="description" v-html="post.description" />
<p class="meta">
{{ post.authors.map((author) => author.name).join(', ') }}
&bull;
{{ date }}
</p>
</div>
</a>
</li>
</template>

<style scoped>
li {
padding: 0;
margin: 0;
}

p {
margin: 0;
}
h3 {
margin: 0;
padding: 0;
border: none;
}

li > a > div {
display: flex;
flex-direction: column;
margin: 0 -16px;
padding: 16px;
border-radius: 16px;
}
li > a > div:hover {
background: var(--vp-c-default);
}
li .title {
color: var(--vp-c-text);
margin-bottom: 12px;
}
li .description {
font-size: 16px;
color: var(--vp-c-text-2);
margin-bottom: 8px;
}
li .meta {
font-weight: 400;
font-size: 12px;
color: var(--vp-c-text-2);
}
</style>
15 changes: 15 additions & 0 deletions docs/.vitepress/composables/useBlogDate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { computed, toValue, MaybeRefOrGetter } from 'vue';

const MONTH_FORMATTER = new Intl.DateTimeFormat(
globalThis?.navigator?.language,
{
month: 'long',
},
);

export default function (date: MaybeRefOrGetter<Date | string>) {
return computed(() => {
const d = new Date(toValue(date));
return `${MONTH_FORMATTER.format(d)} ${d.getDate()}, ${d.getFullYear()}`;
});
}
35 changes: 32 additions & 3 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ import { version as i18nVersion } from '../../packages/i18n/package.json';
import { version as autoIconsVersion } from '../../packages/auto-icons/package.json';
import { version as unocssVersion } from '../../packages/unocss/package.json';
import { version as storageVersion } from '../../packages/storage/package.json';
import { Feed } from 'feed';
import { writeFile } from 'node:fs/promises';
import { join } from 'node:path';

const origin = 'https://wxt.dev';

const title = 'Next-gen Web Extension Framework';
const titleSuffix = ' – WXT';
const description =
"WXT provides the best developer experience, making it quick, easy, and fun to develop web extensions. With built-in utilities for building, zipping, and publishing your extension, it's easy to get started.";
const ogTitle = `${title}${titleSuffix}`;
const ogUrl = 'https://wxt.dev';
const ogImage = 'https://wxt.dev/social-preview.png';
const ogUrl = origin;
const ogImage = `${origin}/social-preview.png`;

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand All @@ -33,7 +38,30 @@ export default defineConfig({
},
lastUpdated: true,
sitemap: {
hostname: 'https://wxt.dev',
hostname: origin,
},

async buildEnd(site) {
// Only construct the RSS document for production builds
const { default: blogDataLoader } = await import('./loaders/blog.data');
const posts = await blogDataLoader.load();
const feed = new Feed({
copyright: 'MIT',
id: 'wxt',
title: 'WXT Blog',
link: `${origin}/blog`,
});
posts.forEach((post) => {
feed.addItem({
date: post.frontmatter.date,
link: new URL(post.url, origin).href,
title: post.frontmatter.title,
description: post.frontmatter.description,
});
});
console.log('rss.xml:');
console.log(feed.rss2());
await writeFile(join(site.outDir, 'rss.xml'), feed.rss2(), 'utf8');
},

head: [
Expand Down Expand Up @@ -89,6 +117,7 @@ export default defineConfig({
navItem('Guide', '/guide/installation'),
navItem('Examples', '/examples'),
navItem('API', '/api/reference/wxt'),
navItem('Blog', '/blog'),
navItem(`v${wxtVersion}`, [
navItem('wxt', [
navItem(`v${wxtVersion}`, '/'),
Expand Down
3 changes: 3 additions & 0 deletions docs/.vitepress/loaders/blog.data.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { createContentLoader } from 'vitepress';

export default createContentLoader('blog/*.md');
11 changes: 7 additions & 4 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@ import Icon from '../components/Icon.vue';
import EntrypointPatterns from '../components/EntrypointPatterns.vue';
import UsingWxtSection from '../components/UsingWxtSection.vue';
import ExampleSearch from '../components/ExampleSearch.vue';
import BlogLayout from '../components/BlogLayout.vue';
import './custom.css';

export default {
extends: DefaultTheme,
enhanceApp(ctx) {
ctx.app.component('Icon', Icon);
ctx.app.component('EntrypointPatterns', EntrypointPatterns);
ctx.app.component('UsingWxtSection', UsingWxtSection);
ctx.app.component('ExampleSearch', ExampleSearch);
ctx.app
.component('Icon', Icon)
.component('EntrypointPatterns', EntrypointPatterns)
.component('UsingWxtSection', UsingWxtSection)
.component('ExampleSearch', ExampleSearch)
.component('blog', BlogLayout);
},
};
Binary file modified docs/assets/init-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions docs/blog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: page
---

<script lang="ts" setup>
import BlogHome from './.vitepress/components/BlogHome.vue';
</script>

<BlogHome />
12 changes: 12 additions & 0 deletions docs/blog/.drafts/2024-10-19-real-world-messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
layout: blog
title: Real World Messaging
description: |
The extension messaging APIs are difficult to learn. Let's go beyond the simple examples from Chrome and Firefox's documentation to build our own simple messaging system from scratch.
authors:
- name: Aaron Klinker
github: aklinker1
date: 2024-10-20T04:54:23.601Z
---

Test content **bold** _italic_
Loading