From 0da2c7bf0a508bf22246899c9161e8589b1703cf Mon Sep 17 00:00:00 2001 From: Dessalines Date: Fri, 24 Jan 2025 09:25:21 -0500 Subject: [PATCH] Use main and v0.19 instead of latest and next. --- .gitmodules | 8 +++---- .woodpecker.yml | 2 +- Dockerfile | 18 +++++++-------- eslint.config.mjs | 4 ++-- lemmy-js-client-next => lemmy-js-client-main | 0 ...-js-client-latest => lemmy-js-client-v0.19 | 0 src/server/index.tsx | 22 +++++++++---------- 7 files changed, 27 insertions(+), 27 deletions(-) rename lemmy-js-client-next => lemmy-js-client-main (100%) rename lemmy-js-client-latest => lemmy-js-client-v0.19 (100%) diff --git a/.gitmodules b/.gitmodules index f8c39d2..e3b76d2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -10,12 +10,12 @@ path = lemmy-translations url = https://github.com/lemmynet/lemmy-translations branch = main -[submodule "lemmy-js-client-latest"] - path = lemmy-js-client-latest +[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-next"] - path = lemmy-js-client-next +[submodule "lemmy-js-client-main"] + path = lemmy-js-client-main url = https://github.com/LemmyNet/lemmy-js-client branch = tsoa_1 [submodule "lemmy-stats-crawler"] diff --git a/.woodpecker.yml b/.woodpecker.yml index 8a68c8e..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-latest" "!lemmy-js-client-next" "!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 ac79d23..02d9086 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,20 +15,20 @@ COPY lemmy-docs ./lemmy-docs RUN ./mdbook build lemmy-docs -d ../docs # Build the typedoc lemmy-js-client docs, and swagger.json -FROM node:20-alpine AS api_latest +FROM node:20-alpine AS api_v0.19 WORKDIR /app -COPY lemmy-js-client-latest 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 -# TODO OpenAPI isn't currently working for the latest docs. This can be changed after the next release. +# TODO OpenAPI isn't currently working for the v0.19 docs. This can be changed after the next release. # RUN pnpm tsoa -# Do the same for the api docs, but next -FROM node:20-alpine AS api_next +# Do the same for the api docs, but on main +FROM node:20-alpine AS api_main WORKDIR /app -COPY lemmy-js-client-next lemmy-js-client +COPY lemmy-js-client-main lemmy-js-client WORKDIR /app/lemmy-js-client RUN corepack enable pnpm RUN pnpm i @@ -62,11 +62,11 @@ COPY src src # Copy the rust docs, lemmy-js-client docs, and OpenAPI docs. COPY --from=docs /app/docs ./src/assets/docs -COPY --from=api_latest /app/lemmy-js-client/docs ./src/assets/lemmy-js-client-latest-docs +COPY --from=api_v0.19 /app/lemmy-js-client/docs ./src/assets/lemmy-js-client-v0.19-docs # TODO OpenAPI isn't currently working for the latest docs. This can be changed after the next release. # COPY --from=api_latest /app/lemmy-js-client/redoc-static.html ./src/assets/api_latest.html -COPY --from=api_next /app/lemmy-js-client/docs ./src/assets/lemmy-js-client-next-docs -COPY --from=api_next /app/lemmy-js-client/redoc-static.html ./src/assets/api_next.html +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 443f51d..586fe91 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -31,8 +31,8 @@ export default [ "crawl.mjs", "generate_rss_feed.mjs", "generate_translations.mjs", - "lemmy-js-client-next", - "lemmy-js-client-latest", + "lemmy-js-client-main", + "lemmy-js-client-v0.19", "webpack.config.js", "tailwind.config.js", "src/shared/build-config.js", diff --git a/lemmy-js-client-next b/lemmy-js-client-main similarity index 100% rename from lemmy-js-client-next rename to lemmy-js-client-main diff --git a/lemmy-js-client-latest b/lemmy-js-client-v0.19 similarity index 100% rename from lemmy-js-client-latest rename to lemmy-js-client-v0.19 diff --git a/src/server/index.tsx b/src/server/index.tsx index 1bf2a75..ec5c0b5 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -27,26 +27,26 @@ 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"))); -// The latest release docs +// The v0.19 release docs // TODO OpenAPI isn't currently working for the latest docs. This can be changed after the next release. -// server.use("/api/latest", express.static(path.resolve("./dist/assets/api_latest.html"))); +// server.use("/api/v0.19", express.static(path.resolve("./dist/assets/api_v0.19.html"))); server.use( - "/api/latest", - express.static(path.resolve("./dist/assets/lemmy-js-client-latest-docs")), + "/api/v0.19", + express.static(path.resolve("./dist/assets/lemmy-js-client-v0.19-docs")), ); server.use( - "/lemmy-js-client-docs/latest", - express.static(path.resolve("./dist/assets/lemmy-js-client-latest-docs")), + "/lemmy-js-client-docs/v0.19", + express.static(path.resolve("./dist/assets/lemmy-js-client-v0.19-docs")), ); -// The Next release docs +// The main release docs server.use( - "/api/next", - express.static(path.resolve("./dist/assets/api_next.html")), + "/api/main", + express.static(path.resolve("./dist/assets/api_main.html")), ); server.use( - "/lemmy-js-client-docs/next", - express.static(path.resolve("./dist/assets/lemmy-js-client-next-docs")), + "/lemmy-js-client-docs/main", + express.static(path.resolve("./dist/assets/lemmy-js-client-main-docs")), ); server.use( "/context.json",