diff --git a/.gitmodules b/.gitmodules index 9a2adb9..18a68e0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,10 +10,14 @@ path = lemmy-translations url = https://github.com/lemmynet/lemmy-translations branch = main -[submodule "lemmy-js-client"] - path = lemmy-js-client +[submodule "lemmy-js-client-v0.19"] + path = lemmy-js-client-v0.19 url = https://github.com/LemmyNet/lemmy-js-client branch = release/v0.19 +[submodule "lemmy-js-client-main"] + path = lemmy-js-client-main + url = https://github.com/LemmyNet/lemmy-js-client + branch = main [submodule "lemmy-stats-crawler"] path = lemmy-stats-crawler url = https://github.com/LemmyNet/lemmy-stats-crawler.git diff --git a/.woodpecker.yml b/.woodpecker.yml index ac50a4c..df2838a 100644 --- a/.woodpecker.yml +++ b/.woodpecker.yml @@ -21,7 +21,7 @@ steps: prettier_markdown_check: image: tmknom/prettier:3.2.5 commands: - - prettier -c . "!dist" "!lemmy-docs" "!lemmy-translations" "!joinlemmy-translations" "!lemmy-js-client" "!lemmy-stats-crawler" "!src/shared/instance_stats.ts" "!src/shared/donation_stats.ts" "!pnpm-lock.yaml" + - prettier -c . "!dist" "!lemmy-docs" "!lemmy-translations" "!joinlemmy-translations" "!lemmy-js-client-v0.19" "!lemmy-js-client-main" "!lemmy-stats-crawler" "!src/shared/instance_stats.ts" "!src/shared/donation_stats.ts" "!pnpm-lock.yaml" when: - event: pull_request diff --git a/Dockerfile b/Dockerfile index 611bb3d..b51cc0d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,14 +14,25 @@ RUN tar -xzf mdbook.tar.gz COPY lemmy-docs ./lemmy-docs RUN ./mdbook build lemmy-docs -d ../docs -# Build the typedoc API docs -FROM node:20-alpine AS api +# Build the typedoc lemmy-js-client docs, and swagger.json +FROM node:20-alpine AS api_v0.19 WORKDIR /app -COPY lemmy-js-client lemmy-js-client +COPY lemmy-js-client-v0.19 lemmy-js-client WORKDIR /app/lemmy-js-client RUN corepack enable pnpm RUN pnpm i RUN pnpm run docs +# OpenAPI isn't currently working for the v0.19 docs, so no pnpm tsoa + +# Do the same for the api docs, but on main +FROM node:20-alpine AS api_main +WORKDIR /app +COPY lemmy-js-client-main lemmy-js-client +WORKDIR /app/lemmy-js-client +RUN corepack enable pnpm +RUN pnpm i +RUN pnpm run docs +RUN pnpm tsoa # Build the isomorphic app FROM node:20-alpine AS builder @@ -48,9 +59,11 @@ COPY joinlemmy-translations joinlemmy-translations COPY lemmy-translations lemmy-translations COPY src src -# Copy the docs and API +# Copy the rust docs, lemmy-js-client docs, and OpenAPI docs. COPY --from=docs /app/docs ./src/assets/docs -COPY --from=api /app/lemmy-js-client/docs ./src/assets/api +COPY --from=api_v0.19 /app/lemmy-js-client/docs ./src/assets/lemmy-js-client-v0.19-docs +COPY --from=api_main /app/lemmy-js-client/docs ./src/assets/lemmy-js-client-main-docs +COPY --from=api_main /app/lemmy-js-client/redoc-static.html ./src/assets/api_main.html RUN pnpm i RUN pnpm prebuild:prod diff --git a/eslint.config.mjs b/eslint.config.mjs index 0e3e13a..586fe91 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -31,7 +31,8 @@ export default [ "crawl.mjs", "generate_rss_feed.mjs", "generate_translations.mjs", - "lemmy-js-client", + "lemmy-js-client-main", + "lemmy-js-client-v0.19", "webpack.config.js", "tailwind.config.js", "src/shared/build-config.js", diff --git a/joinlemmy-translations b/joinlemmy-translations index cdec211..78d2424 160000 --- a/joinlemmy-translations +++ b/joinlemmy-translations @@ -1 +1 @@ -Subproject commit cdec211a960139e7f477b3dfbd861849721b9e9d +Subproject commit 78d242413b70ca50032fb13fa840478aeb94b0ce diff --git a/lemmy-docs b/lemmy-docs index fd75c84..abb0f7d 160000 --- a/lemmy-docs +++ b/lemmy-docs @@ -1 +1 @@ -Subproject commit fd75c843211dff9437a6c8aea4a360e090ce73cf +Subproject commit abb0f7d09f425bbb784fad940cf04efd8c7fcee4 diff --git a/lemmy-js-client b/lemmy-js-client deleted file mode 160000 index 5b3c7eb..0000000 --- a/lemmy-js-client +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5b3c7ebcfa7bc9598254999b72b9ec89007bd51e diff --git a/lemmy-js-client-main b/lemmy-js-client-main new file mode 160000 index 0000000..4a24cb1 --- /dev/null +++ b/lemmy-js-client-main @@ -0,0 +1 @@ +Subproject commit 4a24cb1f62b825f54dd9f826557b5fd38090c2e3 diff --git a/lemmy-js-client-v0.19 b/lemmy-js-client-v0.19 new file mode 160000 index 0000000..81dc694 --- /dev/null +++ b/lemmy-js-client-v0.19 @@ -0,0 +1 @@ +Subproject commit 81dc69449f2ced9dd5a32ca13e55c1bd93a4e775 diff --git a/lemmy-stats-crawler b/lemmy-stats-crawler index ec65b0e..e2e7015 160000 --- a/lemmy-stats-crawler +++ b/lemmy-stats-crawler @@ -1 +1 @@ -Subproject commit ec65b0e65eec61f05b9c4fbdeaaabc907131a20e +Subproject commit e2e70155f32d59099fb9cd0f7e75011a44a421b8 diff --git a/lemmy-translations b/lemmy-translations index 61ca6bd..30a97d3 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 61ca6bdfc1755a4ae4d0693b3296cba38ad4cae2 +Subproject commit 30a97d394b5c83c398afd459b71f3f38e5c93e4d diff --git a/src/server/index.tsx b/src/server/index.tsx index d8649ed..1e4ae0a 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -26,7 +26,26 @@ server.use(express.json() as RequestHandler); server.use(express.urlencoded({ extended: false }) as RequestHandler); server.use("/static", express.static(path.resolve("./dist"))); server.use("/docs", express.static(path.resolve("./dist/assets/docs"))); -server.use("/api", express.static(path.resolve("./dist/assets/api"))); + +// The v0.19 release docs +server.use( + "/api/v0.19", + express.static(path.resolve("./dist/assets/lemmy-js-client-v0.19-docs")), +); +server.use( + "/lemmy-js-client-docs/v0.19", + express.static(path.resolve("./dist/assets/lemmy-js-client-v0.19-docs")), +); + +// The main release docs +server.use( + "/api/main", + express.static(path.resolve("./dist/assets/api_main.html")), +); +server.use( + "/lemmy-js-client-docs/main", + express.static(path.resolve("./dist/assets/lemmy-js-client-main-docs")), +); server.use( "/context.json", cors,