Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/scripts/setup-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
##
##===----------------------------------------------------------------------===##

export NODE_VERSION=v20.19.0
export NODE_PATH=/usr/local/nvm/versions/node/v20.19.0/bin
export NODE_VERSION=v22.21.1
export NODE_PATH=/usr/local/nvm/versions/node/${NODE_VERSION}/bin
export NVM_DIR=/usr/local/nvm

apt-get update && apt-get install -y rsync curl gpg libasound2 libgbm1 libgtk-3-0 libnss3 xvfb build-essential
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/windows/install-nodejs.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$NODEJS='https://nodejs.org/dist/v20.19.0/node-v20.19.0-x64.msi'
$NODEJS_SHA256='c2654d3557abd59de08474c6dd009b1d358f420b8e4010e4debbf130b1dfb90a'
$NODEJS='https://nodejs.org/dist/v22.21.1/node-v22.21.1-x64.msi'
$NODEJS_SHA256='fd7a63fec3a54a665851e2d3d93e07cfead2ffb4521675ffdbceb1bb5ac009bb'
Set-Variable ErrorActionPreference Stop
Set-Variable ProgressPreference SilentlyContinue
Write-Host -NoNewLine ('Downloading {0} ... ' -f ${NODEJS})
Expand Down
9 changes: 3 additions & 6 deletions .github/workflows/scripts/windows/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@

# Download the VSIX archived upstream
npm ci --ignore-scripts
$Process = Start-Process npx "tsx scripts/download_vsix.ts" -Wait -PassThru -NoNewWindow
if ($Process.ExitCode -eq 0) {
Write-Host 'SUCCESS'
} else {
Write-Host ('FAILED ({0})' -f $Process.ExitCode)
exit 1
npx tsx scripts/download_vsix.ts
if ($LastExitCode -ne 0) {
exit $LastExitCode
}
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@
"preLaunchTask": "compile-tests"
},
{
"name": "Update swift-docc-render",
"name": "Build swift-docc-render",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/tsx",
"runtimeArgs": ["${workspaceFolder}/scripts/update_swift_docc_render.ts"]
"runtimeArgs": ["${workspaceFolder}/scripts/build_swift_docc_render.ts"]
},
{
"name": "Preview Package",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2047,10 +2047,10 @@
"compile-documentation-webview": "del-cli ./assets/documentation-webview && esbuild ./src/documentation/webview/webview.ts --bundle --outfile=assets/documentation-webview/index.js --define:process.env.NODE_ENV=\\\"production\\\" --define:process.env.CI=\\\"\\\" --format=cjs --sourcemap",
"watch-documentation-webview": "npm run compile-documentation-webview -- --watch",
"lint": "eslint ./ --ext ts && tsc --noEmit && tsc --noEmit -p scripts/tsconfig.json",
"update-swift-docc-render": "tsx ./scripts/update_swift_docc_render.ts",
"build-swift-docc-render": "tsx ./scripts/build_swift_docc_render.ts",
"compile-icons": "tsx ./scripts/compile_icons.ts",
"format": "prettier --check .",
"postinstall": "npm run compile-icons && npm run update-swift-docc-render",
"postinstall": "npm run compile-icons && npm run build-swift-docc-render",
"pretest": "npm run compile-tests",
"soundness": "scripts/soundness.sh",
"check-package-json": "tsx ./scripts/check_package_json.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
//
//===----------------------------------------------------------------------===//
/* eslint-disable no-console */
import { mkdir, readdir, rm, stat } from "fs/promises";
import { cp, readdir, rm, stat } from "fs/promises";
import * as path from "path";
import * as semver from "semver";
import simpleGit, { ResetMode } from "simple-git";
Expand All @@ -26,9 +26,9 @@ function checkNodeVersion() {
"Unable to determine the version of NodeJS that this script is running under."
);
}
if (!semver.satisfies(nodeVersion, "20")) {
if (!semver.satisfies(nodeVersion, "^22.17")) {
throw new Error(
`Cannot build swift-docc-render with NodeJS v${nodeVersion.raw}. Please install and use NodeJS v20.`
`Cannot build swift-docc-render with NodeJS v${nodeVersion.raw}. Please install and use at least NodeJS v22.17.x.`
);
}
}
Expand All @@ -38,7 +38,7 @@ async function cloneSwiftDocCRender(buildDirectory: string): Promise<string> {
const swiftDocCRenderDirectory = path.join(buildDirectory, "swift-docc-render");
const git = simpleGit({ baseDir: buildDirectory });
console.log("> git clone https://github.com/swiftlang/swift-docc-render.git");
const revision = "10b097153d89d7bfc2dd400b47181a782a0cfaa0";
const revision = "c781d3783f23fda5a4721f5361c6c523772b7a62";
await git.clone("https://github.com/swiftlang/swift-docc-render.git", swiftDocCRenderDirectory);
await git.cwd(swiftDocCRenderDirectory);
await git.reset(ResetMode.HARD, [revision]);
Expand Down Expand Up @@ -69,16 +69,16 @@ main(async () => {
}
checkNodeVersion();
await rm(outputDirectory, { force: true, recursive: true });
await mkdir(outputDirectory, { recursive: true });
await withTemporaryDirectory("update-swift-docc-render_", async buildDirectory => {
const swiftDocCRenderDirectory = await cloneSwiftDocCRender(buildDirectory);
await exec("npm", ["install"], { cwd: swiftDocCRenderDirectory });
await exec("npx", ["vue-cli-service", "build", "--dest", outputDirectory], {
await exec("npm", ["ci"], { cwd: swiftDocCRenderDirectory });
await exec("npx", ["vue-cli-service", "build"], {
cwd: swiftDocCRenderDirectory,
env: {
...process.env,
VUE_APP_TARGET: "ide",
},
});
await cp(path.join(swiftDocCRenderDirectory, "dist"), outputDirectory, { recursive: true });
});
});
17 changes: 8 additions & 9 deletions scripts/patches/swift-docc-render/01_add-live-routes.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/src/routes.js b/src/routes.js
index 0c928ce..f745003 100644
index 11343be..62c13c9 100644
--- a/src/routes.js
+++ b/src/routes.js
@@ -9,7 +9,6 @@
Expand All @@ -10,9 +10,9 @@ index 0c928ce..f745003 100644
notFoundRouteName,
serverErrorRouteName,
} from 'docc-render/constants/router';
@@ -18,25 +17,32 @@ import NotFound from 'theme/views/NotFound.vue';
@@ -31,25 +30,34 @@ export const fallbackRoutes = [

export default [
export const pagesRoutes = [
{
- path: '/tutorials/:id',
- name: 'tutorials-overview',
Expand Down Expand Up @@ -40,15 +40,14 @@ index 0c928ce..f745003 100644
{
- path: '/documentation*',
- name: documentationTopicName,
- component: () => import(
- /* webpackChunkName: "documentation-topic" */ 'theme/views/DocumentationTopic.vue'
- ),
+ path: '/live/documentation',
+ name: 'live-documentation',
+ component: () => import(/* webpackChunkName: "documentation-topic" */ 'docc-render/views/DocumentationTopic.vue'),
component: () => import(
/* webpackChunkName: "documentation-topic" */ 'theme/views/DocumentationTopic.vue'
),
+ meta: {
+ skipFetchingData: true,
+ },
},
{
path: '*',
];