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

feat: add /releases page #1688

Merged
merged 45 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3d51cea
feat: add `/releases` page
amrbashir Nov 18, 2023
765f7ce
Merge branch 'next' into feat/releases
amrbashir Nov 27, 2023
3e693db
Merge branch 'next' into feat/releases
amrbashir Dec 13, 2023
a798d06
remove solid
amrbashir Dec 13, 2023
6208640
generated on build instead
amrbashir Dec 14, 2023
27ebfa6
update lockfile
amrbashir Dec 14, 2023
a134276
Merge remote-tracking branch 'origin/next' into feat/releases
lorenzolewis Dec 19, 2023
8231a31
update links
amrbashir Dec 19, 2023
9a304a8
Update index.mdx
amrbashir Dec 19, 2023
f95690f
Update build.ts
amrbashir Dec 19, 2023
06b3cad
Merge branch 'next' into feat/releases
amrbashir Dec 19, 2023
c3d9aee
fix slug creations
amrbashir Dec 19, 2023
4245746
Add nav links back
amrbashir Dec 19, 2023
7aa3a23
Merge branch 'next' into feat/releases
vasfvitor Feb 29, 2024
bd8bad9
update links valitor to 0.6.0
vasfvitor Mar 4, 2024
b79d351
Merge branch 'next' into feat/releases
vasfvitor Mar 4, 2024
54f7b16
use link card
vasfvitor Mar 6, 2024
b5ddbc9
wip - generated frontmatter
vasfvitor Mar 6, 2024
296704f
wip
vasfvitor Mar 6, 2024
3f15e6b
fix labels name
vasfvitor Mar 6, 2024
6edf830
improve logic
vasfvitor Mar 6, 2024
53a703b
Merge branch 'next' into feat/releases
vasfvitor Mar 6, 2024
1cc52e5
WIP refactor
vasfvitor Mar 9, 2024
1aec253
add entitify
vasfvitor Mar 9, 2024
26553ce
agora vai
vasfvitor Mar 9, 2024
9659bcb
Update build.ts
vasfvitor Mar 9, 2024
58d8e10
fix: dir name
vasfvitor Mar 9, 2024
fd74d33
add (Rust)
vasfvitor Mar 9, 2024
c9b4221
fix dirName build
vasfvitor Mar 11, 2024
bb2c547
change if order
vasfvitor Mar 11, 2024
dc7dd7c
remove dirName
vasfvitor Mar 11, 2024
e61dd8d
redo sidenav
vasfvitor Mar 11, 2024
a709886
place /releases back on header
vasfvitor Mar 12, 2024
f62d725
Merge branch 'next' into feat/releases
vasfvitor Mar 12, 2024
889166a
wip mobile
vasfvitor Mar 21, 2024
c2859e5
improve mobile nav
vasfvitor Mar 21, 2024
9d9722e
Update ReleaseSidebar.astro
vasfvitor Mar 21, 2024
43d77ce
Merge branch 'feat/releases' of https://github.com/tauri-apps/tauri-d…
vasfvitor Mar 21, 2024
643d60e
refactor: sidebar nav + dropdown only
vasfvitor Mar 22, 2024
fe5d39d
fix width and redo button width
vasfvitor Mar 22, 2024
322251e
revert to show sidebar list + hide toc
vasfvitor Mar 22, 2024
39f08c8
fix labels
lucasfernog Mar 25, 2024
09aa010
fix sort
lucasfernog Mar 25, 2024
aabe306
fix split
lucasfernog Mar 25, 2024
d938f70
fix split
lucasfernog Mar 25, 2024
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 astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ export default defineConfig({
Footer: 'src/components/overrides/Footer.astro',
MarkdownContent: 'starlight-blog/overrides/MarkdownContent.astro',
Sidebar: 'starlight-blog/overrides/Sidebar.astro',
Header: 'src/components/overrides/Header.astro',
},
head: [
{
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
"dev": "astro dev",
"format": "prettier -w --cache --plugin prettier-plugin-astro .",
"build:reference": "pnpm --filter js-api-generator run build",
"build:releases": "pnpm --filter releases-generator run build",
"build:astro": "astro build",
"build:i18n": "pnpm --filter docs-i18n-tracker run build",
"build": "pnpm dev:setup && pnpm build:reference && pnpm build:astro && pnpm build:i18n",
"build": "pnpm dev:setup && pnpm build:reference && pnpm build:releases && pnpm build:astro && pnpm build:i18n",
"preview": "astro preview"
},
"dependencies": {
Expand Down
76 changes: 76 additions & 0 deletions packages/releases-generator/build.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { writeFileSync, mkdirSync } from 'node:fs';
import { join } from 'node:path';

const packages = [
{
name: 'tauri',
url: 'https://raw.githubusercontent.com/tauri-apps/tauri/dev/core/tauri/CHANGELOG.md',
},
{
name: '@tauri-apps/api',
url: 'https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/api/CHANGELOG.md',
},
{
name: 'tauri-cli',
url: 'https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/cli/CHANGELOG.md',
},
{
name: '@tauri-apps/cli',
url: 'https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/cli/node/CHANGELOG.md',
},
{
name: 'tauri-bundler',
url: 'https://raw.githubusercontent.com/tauri-apps/tauri/dev/tooling/bundler/CHANGELOG.md',
},
{
name: 'wry',
url: 'https://raw.githubusercontent.com/tauri-apps/wry/dev/CHANGELOG.md',
},
{
name: 'tao',
url: 'https://raw.githubusercontent.com/tauri-apps/tao/dev/CHANGELOG.md',
},
];

// FIXME: starlight apparently doesn't work well if the file continas multiple `.`
function encodeVersion(v: string): string {
return v.replaceAll('.', '_');
}

const baseDir = '../../src/content/docs/releases';

async function generator() {
for (const pkg of packages) {
const response = await fetch(pkg.url);
const responseText: string = await response.text();
const releases = responseText
.split('## \\[')
.filter((item) => !item.includes('# Changelog'))
.map((section) => {
const [version, ...c] = section.split('\n');
const contents = c.join('\n');
return {
version: version.replace('\\[', '').replace(']', ''),
notes: contents,
};
})
.filter(({ version }) => !version.includes('Not Published'));

mkdirSync(join(baseDir, pkg.name), { recursive: true });
writeFileSync(
join(baseDir, pkg.name, 'index.md'),
`---\ntitle: '${pkg.name}'\ntemplate: splash\n---\n\n${releases
.map((r) => `- [${r.version}](/releases/${pkg.name}/v${encodeVersion(r.version)})`)
.join('\n')}`
);

for (const release of releases) {
writeFileSync(
join(baseDir, pkg.name, `v${encodeVersion(release.version)}.md`),
`---\ntitle: '${pkg.name}@${release.version}'\ntemplate: splash\n---\n\n${release.notes}`
);
}
}
}

generator();
15 changes: 15 additions & 0 deletions packages/releases-generator/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "releases-generator",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "tsm ./build.ts"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"tsm": "^2.3.0"
}
}
Loading