Skip to content

Commit

Permalink
Merge branch 'main' into svelte-v6
Browse files Browse the repository at this point in the history
  • Loading branch information
sarah11918 authored Nov 15, 2024
2 parents a048d52 + e9934f8 commit 8c1011f
Show file tree
Hide file tree
Showing 108 changed files with 2,858 additions and 4,020 deletions.
5 changes: 2 additions & 3 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import rehypeSlug from 'rehype-slug';
import remarkSmartypants from 'remark-smartypants';

import { sitemap } from './integrations/sitemap';
import { rehypeAutolink } from './plugins/rehype-autolink';
import { starlightPluginAutolinkHeadings } from './plugins/rehype-autolink';
import { rehypeTasklistEnhancer } from './plugins/rehype-tasklist-enhancer';
import { remarkFallbackLang } from './plugins/remark-fallback-lang';

Expand Down Expand Up @@ -66,6 +66,7 @@ export default defineConfig({
},
],
disable404Route: true,
plugins: [starlightPluginAutolinkHeadings()],
}),
sitemap(),
],
Expand All @@ -82,8 +83,6 @@ export default defineConfig({
],
rehypePlugins: [
rehypeSlug,
// This adds links to headings
...rehypeAutolink(),
// Tweak GFM task list syntax
rehypeTasklistEnhancer(),
],
Expand Down
112 changes: 0 additions & 112 deletions lunaria.config.json

This file was deleted.

4 changes: 2 additions & 2 deletions lunaria.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ export default defineConfig({
],
files: [
{
include: ['src/i18n/en/(ui|docsearch).ts'],
pattern: 'src/i18n/@lang/@path',
include: ['src/content/i18n/en.yml'],
pattern: 'src/content/i18n/@tag.yml',
type: 'dictionary',
},
{
Expand Down
34 changes: 9 additions & 25 deletions lunaria/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ export function html(strings: TemplateStringsArray, ...values: (string | string[
type LunariaInstance = Awaited<ReturnType<typeof createLunaria>>;

function collapsePath(path: string) {
const basesToHide = [
'src/content/docs/en/',
'src/i18n/en/',
'src/content/docs/',
'src/content/i18n/',
];
const basesToHide = ['src/content/docs/en/', 'src/i18n/en/', 'src/content/docs/', 'src/content/'];

for (const base of basesToHide) {
const newPath = path.replace(base, '');
Expand Down Expand Up @@ -193,7 +188,7 @@ export const OutdatedFiles = (
${localization.missingKeys.map((key) => html`<li>${key}</li>`)}
</ul>
</details>
`
`
: html` ${ContentDetailsLinks(file, lang, lunaria)} `}
</li>
`;
Expand Down Expand Up @@ -254,23 +249,12 @@ export const TableContentStatus = (
lunaria: LunariaInstance
): string => {
const localization = localizations.find((localization) => localization.lang === lang)!;
const isMissingKeys =
localization.status !== 'missing' &&
'missingKeys' in localization &&
localization.missingKeys.length > 0;

const status = localization.status;
const isMissingKeys = 'missingKeys' in localization && localization.missingKeys.length > 0;
const status = isMissingKeys ? 'outdated' : localization.status;
const links = lunaria.gitHostingLinks();

return html`
<td>
${status === 'missing'
? EmojiFileLink(links.create(localization.path), localization.status)
: status === 'outdated' || isMissingKeys
? EmojiFileLink(links.source(localization.path), localization.status)
: EmojiFileLink(links.source(localization.path), localization.status)}
</td>
`;
const link =
status === 'missing' ? links.create(localization.path) : links.source(localization.path);
return html`<td>${EmojiFileLink(link, status)}</td>`;
};

export const ContentDetailsLinks = (
Expand Down Expand Up @@ -323,10 +307,10 @@ export const EmojiFileLink = (
return href
? html`<a href="${href}" title="${statusTextOpts[type]}">
<span aria-hidden="true">${statusEmojiOpts[type]}</span>
</a>`
</a>`
: html`<span title="${statusTextOpts[type]}">
<span aria-hidden="true">${statusEmojiOpts[type]}</span>
</span>`;
</span>`;
};

export const Link = (href: string, text: string): string => {
Expand Down
35 changes: 9 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"format": "pnpm run format:code",
"format:ci": "pnpm run format:imports && pnpm run format:code",
"format:code": "prettier -w . --cache --plugin-search-dir=.",
"format:imports": "organize-imports-cli ./tsconfig.json",
"add-language": "node ./scripts/add-language.mjs",
"format:imports": "echo 'Skipped formatting imports'",
"docgen": "node ./scripts/docgen.mjs",
"docgen:errors": "node ./scripts/error-docgen.mjs",
"lint:a11y": "start-test 'yarn build && yarn preview' 3000 'yarn lint:a11y:local'",
Expand All @@ -28,7 +27,6 @@
"devDependencies": {
"@11ty/eleventy-fetch": "^3.0.0",
"@actions/core": "^1.9.0",
"@babel/core": "^7.18.10",
"@docsearch/css": "^3.5.1",
"@types/canvas-confetti": "^1.6.0",
"@types/hast": "^3.0.3",
Expand All @@ -37,63 +35,48 @@
"@types/node": "^18.6.4",
"@typescript-eslint/eslint-plugin": "^5.46.1",
"@typescript-eslint/parser": "^5.46.1",
"astro": "4.15.3",
"astro": "4.16.8",
"astro-auto-import": "^0.4.2",
"astro-eslint-parser": "^0.16.0",
"astro-og-canvas": "^0.5.0",
"bcp-47-normalize": "^2.1.0",
"canvaskit-wasm": "^0.39.1",
"dedent-js": "^1.0.1",
"domhandler": "^4.3.1",
"eslint": "^8.29.0",
"eslint-plugin-astro": "^0.21.0",
"eslint-plugin-react": "^7.32.1",
"fast-glob": "^3.2.11",
"hast-util-from-html": "^2.0.1",
"hast-util-select": "^6.0.2",
"hast-util-to-html": "^9.0.1",
"hast-util-to-string": "^3.0.0",
"hastscript": "^8.0.0",
"html-escaper": "^3.0.3",
"htmlparser2": "^7.2.0",
"kleur": "^4.1.5",
"mdast-util-from-markdown": "^2.0.0",
"mdast-util-to-hast": "^13.0.0",
"mdast-util-to-string": "^4.0.0",
"micromark-util-character": "^2.0.1",
"micromark-util-symbol": "^2.0.0",
"node-fetch": "^3.2.10",
"organize-imports-cli": "^0.10.0",
"p-retry": "^5.1.1",
"parse-numeric-range": "^1.3.0",
"prettier": "^3.1.0",
"prettier-plugin-astro": "^0.12.2",
"prompts": "^2.4.2",
"prettier": "^3.3.3",
"prettier-plugin-astro": "^0.14.1",
"rehype": "^13.0.1",
"remark": "^15.0.1",
"remark-directive": "^3.0.0",
"tsm": "^2.3.0",
"typescript": "^5.0.2",
"unified": "^11.0.4",
"unist-util-remove": "^4.0.0",
"unist-util-visit": "^5.0.0",
"unist-util-walker": "^1.0.0"
"unist-util-visit": "^5.0.0"
},
"dependencies": {
"@astrojs/check": "^0.9.3",
"@astrojs/sitemap": "^3.1.6",
"@astrojs/starlight": "^0.26.4",
"@astrojs/starlight": "^0.29.0",
"@docsearch/js": "^3.5.2",
"@expressive-code/plugin-collapsible-sections": "^0.35.0",
"@fontsource/ibm-plex-mono": "^4.5.10",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@ae1b8a7",
"@expressive-code/plugin-collapsible-sections": "^0.38.3",
"@lunariajs/core": "https://pkg.pr.new/lunariajs/lunaria/@lunariajs/core@62a858f",
"canvas-confetti": "^1.6.0",
"jsdoc-api": "^7.1.1",
"jsdoc-api": "^9.3.4",
"rehype-autolink-headings": "^7.1.0",
"rehype-slug": "^6.0.0",
"remark-gfm": "^4.0.0",
"remark-smartypants": "^2.0.0",
"sass": "^1.54.3",
"sharp": "^0.32.6"
},
"packageManager": "[email protected]",
Expand Down
Loading

0 comments on commit 8c1011f

Please sign in to comment.