Skip to content

Commit 7b952e2

Browse files
authored
Merge branch 'main' into feat/org-packages-fancy
2 parents 9b241e1 + 183d7bc commit 7b952e2

10 files changed

Lines changed: 575 additions & 33 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,6 @@ test-results/
3636

3737
# Lighthouse
3838
.lighthouseci
39+
40+
# generated files
41+
shared/types/lexicons

app/pages/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ const debouncedNavigate = debounce(() => {
1414
}, 250)
1515
1616
function handleSearch() {
17-
debouncedNavigate()
17+
// If input is empty, navigate immediately (no need to debounce)
18+
return searchQuery.value.trim() ? debouncedNavigate() : router.push('/search')
1819
}
1920
2021
useSeoMeta({

app/pages/settings.vue

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ defineOgImageComponent('Default', {
203203
</div>
204204
</section>
205205

206-
<!-- LANGUAGE Section -->
207206
<section>
208207
<h2 class="text-xs text-fg-subtle uppercase tracking-wider mb-4">
209208
{{ $t('settings.sections.language') }}
@@ -214,16 +213,22 @@ defineOgImageComponent('Default', {
214213
<label for="language-select" class="block text-sm text-fg font-medium">
215214
{{ $t('settings.language') }}
216215
</label>
217-
<select
218-
id="language-select"
219-
:value="locale"
220-
class="w-full sm:w-auto min-w-48 bg-bg border border-border rounded-md px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 cursor-pointer"
221-
@change="setLocale(($event.target as HTMLSelectElement).value as typeof locale)"
222-
>
223-
<option v-for="loc in availableLocales" :key="loc.code" :value="loc.code">
224-
{{ loc.name }}
225-
</option>
226-
</select>
216+
217+
<ClientOnly>
218+
<select
219+
id="language-select"
220+
:value="locale"
221+
class="w-full sm:w-auto min-w-48 bg-bg border border-border rounded-md px-3 py-2 text-sm text-fg focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 cursor-pointer"
222+
@change="setLocale(($event.target as HTMLSelectElement).value as typeof locale)"
223+
>
224+
<option v-for="loc in availableLocales" :key="loc.code" :value="loc.code">
225+
{{ loc.name }}
226+
</option>
227+
</select>
228+
<template #fallback>
229+
<span class="skeleton block w-48 h-8" />
230+
</template>
231+
</ClientOnly>
227232
</div>
228233

229234
<!-- Translation helper for non-source locales -->

knip.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"$schema": "https://unpkg.com/knip@5/schema.json",
33
"includeEntryExports": true,
44
"ignoreExportsUsedInFile": true,
5-
"ignoreBinaries": ["simple-git-hooks", "lint-staged"],
5+
"ignoreBinaries": ["simple-git-hooks", "lint-staged", "lex"],
6+
"ignore": ["shared/types/lexicons/**"],
67
"workspaces": {
78
".": {
89
"entry": [

lexicons.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"version": 1,
3+
"lexicons": ["site.standard.document"],
4+
"resolutions": {
5+
"com.atproto.repo.strongRef": {
6+
"uri": "at://did:plc:6msi3pj7krzih5qxqtryxlzw/com.atproto.lexicon.schema/com.atproto.repo.strongRef",
7+
"cid": "bafyreifrkdbnkvfjujntdaeigolnrjj3srrs53tfixjhmacclps72qlov4"
8+
},
9+
"site.standard.document": {
10+
"uri": "at://did:plc:re3ebnp5v7ffagz6rb6xfei4/com.atproto.lexicon.schema/site.standard.document",
11+
"cid": "bafyreigdukg62hmel4jbdvghdsoaphslhrdktmahzdyokomuka6yejetwa"
12+
}
13+
}
14+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"id": "com.atproto.repo.strongRef",
3+
"defs": {
4+
"main": {
5+
"type": "object",
6+
"required": ["uri", "cid"],
7+
"properties": {
8+
"cid": {
9+
"type": "string",
10+
"format": "cid"
11+
},
12+
"uri": {
13+
"type": "string",
14+
"format": "at-uri"
15+
}
16+
}
17+
}
18+
},
19+
"$type": "com.atproto.lexicon.schema",
20+
"lexicon": 1,
21+
"description": "A URI with a content-hash fingerprint."
22+
}
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
{
2+
"id": "site.standard.document",
3+
"defs": {
4+
"main": {
5+
"key": "tid",
6+
"type": "record",
7+
"record": {
8+
"type": "object",
9+
"required": ["site", "title", "publishedAt"],
10+
"properties": {
11+
"path": {
12+
"type": "string",
13+
"description": "Combine with site or publication url to construct a canonical URL to the document. Prepend with a leading slash."
14+
},
15+
"site": {
16+
"type": "string",
17+
"format": "uri",
18+
"description": "Points to a publication record (at://) or a publication url (https://) for loose documents. Avoid trailing slashes."
19+
},
20+
"tags": {
21+
"type": "array",
22+
"items": {
23+
"type": "string"
24+
},
25+
"maxLength": 1280,
26+
"description": "Array of strings used to tag or categorize the document. Avoid prepending tags with hashtags.",
27+
"maxGraphemes": 128
28+
},
29+
"title": {
30+
"type": "string",
31+
"maxLength": 5000,
32+
"description": "Title of the document.",
33+
"maxGraphemes": 500
34+
},
35+
"content": {
36+
"refs": [],
37+
"type": "union",
38+
"closed": false,
39+
"description": "Open union used to define the record's content. Each entry must specify a $type and may be extended with other lexicons to support additional content formats."
40+
},
41+
"updatedAt": {
42+
"type": "string",
43+
"format": "datetime",
44+
"description": "Timestamp of the documents last edit."
45+
},
46+
"coverImage": {
47+
"type": "blob",
48+
"accept": ["image/*"],
49+
"maxSize": 1000000,
50+
"description": "Image to used for thumbnail or cover image. Less than 1MB is size."
51+
},
52+
"bskyPostRef": {
53+
"ref": "com.atproto.repo.strongRef",
54+
"type": "ref",
55+
"description": "Strong reference to a Bluesky post. Useful to keep track of comments off-platform."
56+
},
57+
"description": {
58+
"type": "string",
59+
"maxLength": 30000,
60+
"description": "A brief description or excerpt from the document.",
61+
"maxGraphemes": 3000
62+
},
63+
"publishedAt": {
64+
"type": "string",
65+
"format": "datetime",
66+
"description": "Timestamp of the documents publish time."
67+
},
68+
"textContent": {
69+
"type": "string",
70+
"description": "Plaintext representation of the documents contents. Should not contain markdown or other formatting."
71+
}
72+
}
73+
},
74+
"description": "A document record representing a published article, blog post, or other content. Documents can belong to a publication or exist independently."
75+
}
76+
},
77+
"$type": "com.atproto.lexicon.schema",
78+
"lexicon": 1
79+
}

modules/lunaria.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,17 @@ export default defineNuxtModule({
2727
if (!isCI || !existsSync(lunariaDistPath)) {
2828
mkdirSync(lunariaDistPath, { recursive: true })
2929
nuxt.hook('nitro:build:before', async () => {
30-
execSync('node --experimental-transform-types ./lunaria/lunaria.ts', {
31-
cwd: nuxt.options.rootDir,
32-
})
30+
try {
31+
execSync('node --experimental-transform-types ./lunaria/lunaria.ts', {
32+
cwd: nuxt.options.rootDir,
33+
})
34+
} catch (e) {
35+
// do not throw when building for staging
36+
const env = process.env.VERCEL_ENV
37+
if (!isCI || (env && env === 'production')) {
38+
throw e
39+
}
40+
}
3341
})
3442
}
3543
},

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"generate": "nuxt generate",
2222
"npmx-connector": "pnpm --filter npmx-connector dev",
2323
"preview": "nuxt preview",
24-
"postinstall": "nuxt prepare && simple-git-hooks",
24+
"postinstall": "nuxt prepare && simple-git-hooks && pnpm generate:lexicons",
25+
"generate:lexicons": "lex build --lexicons lexicons --out shared/types/lexicons --clear",
2526
"test": "vite test",
2627
"test:browser": "playwright test",
2728
"test:browser:ui": "playwright test --ui",
@@ -31,6 +32,7 @@
3132
"test:unit": "vite test --project unit"
3233
},
3334
"dependencies": {
35+
"@atproto/lex": "^0.0.13",
3436
"@deno/doc": "jsr:^0.189.1",
3537
"@iconify-json/simple-icons": "^1.2.67",
3638
"@iconify-json/vscode-icons": "^1.2.40",

0 commit comments

Comments
 (0)