Skip to content

Commit 5490434

Browse files
committed
update deps
1 parent ea38c1f commit 5490434

6 files changed

+387
-4
lines changed

pwa/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ RUN apk add --no-cache libc6-compat bash git
77

88
WORKDIR /srv/app
99

10-
RUN corepack enable && \
10+
RUN npm install --global corepack@latest && \
11+
corepack enable && \
1112
corepack prepare --activate pnpm@latest && \
1213
pnpm config -g set store-dir /.pnpm-store
1314

@@ -81,7 +82,7 @@ RUN --mount=type=secret,id=GITHUB_KEY \
8182
if [ -z "$GITHUB_KEY" ]; then \
8283
echo "Please set the GITHUB_KEY secret" && exit 1 ; \
8384
fi \
84-
&& pnpm run prebuild
85+
&& pnpm i ts-node && pnpm run prebuild
8586

8687
# ADD https://soyuka.me/contributors.json ./data/contributors.json
8788

@@ -97,7 +98,7 @@ RUN --mount=type=secret,id=GITHUB_KEY \
9798
if [ -z "$GITHUB_KEY" ]; then \
9899
echo "Please set the GITHUB_KEY secret" && exit 1 ; \
99100
fi \
100-
&& pnpm run postbuild
101+
&& pnpm i ts-node && pnpm run postbuild
101102

102103
# Production image, copy all the files and run next
103104
FROM node:18-alpine AS prod

pwa/contributors.js

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import { getAllContributors } from "./api/contributorsRank";
2+
const fs = require("fs");
3+
const path = require("path");
4+
5+
async function getContributors() {
6+
const allContributors = await getAllContributors();
7+
fs.writeFileSync(
8+
path.join(process.cwd(), "data/contributors.json"),
9+
JSON.stringify(allContributors, null, 2),
10+
"utf-8"
11+
);
12+
}
13+
14+
getContributors();

pwa/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
"sharp": "^0.32.5",
5353
"shiki": "^0.14.3",
5454
"swagger-ui": "^5.4.2",
55-
"ts-node": "^10.9.1",
5655
"unist-util-visit": "^4.1.2",
5756
"yaml": "^2.3.1"
5857
},
@@ -82,6 +81,7 @@
8281
"eslint-plugin-react-hooks": "^4.6.0",
8382
"postcss": "^8.4.45",
8483
"tailwindcss": "^3.4.10",
84+
"ts-node": "^10.9.1",
8585
"typescript": "^5.1.6"
8686
},
8787
"peerDependencies": {

pwa/pnpm-lock.yaml

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pwa/postbuild.js

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const cpr = require("cpr");
2+
const path = require("path");
3+
4+
cpr(path.join(__dirname, 'node_modules/shiki/themes'), path.join(__dirname, '.next/standalone/node_modules/shiki/themes'), function(err: any, files: any) {
5+
err && console.error(err)
6+
});
7+
8+
cpr(path.join(__dirname, 'node_modules/shiki/languages'), path.join(__dirname, '.next/standalone/node_modules/shiki/languages'), function(err: any, files: any) {
9+
err && console.error(err)
10+
});
11+

0 commit comments

Comments
 (0)