mirror of
https://github.com/Ryujinx/Ryujinx-Ldn-Website.git
synced 2024-12-22 08:25:37 +00:00
Switch to NPM lock files and rewrite nixpkg (#53)
This prepare for flake rewrite Signed-off-by: Mary Guillemard <mary@mary.zone>
This commit is contained in:
parent
af0a708b3b
commit
0337d6eeee
26
.github/workflows/check.yml
vendored
26
.github/workflows/check.yml
vendored
|
@ -15,17 +15,13 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: npm ci
|
||||
|
||||
- name: Run ESLint
|
||||
run: node_modules/.bin/eslint .
|
||||
|
@ -35,17 +31,13 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: npm ci
|
||||
|
||||
- name: Run Prettier
|
||||
run: node_modules/.bin/prettier -c .
|
||||
|
@ -55,17 +47,13 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: npm ci
|
||||
|
||||
- name: Build package
|
||||
run: pnpm build
|
||||
run: npm run build
|
||||
|
|
16
.github/workflows/code-quality.yml
vendored
16
.github/workflows/code-quality.yml
vendored
|
@ -19,14 +19,10 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
cache: "npm"
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
|
@ -34,7 +30,7 @@ jobs:
|
|||
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: npm ci
|
||||
|
||||
- name: Run ESLint
|
||||
run: node_modules/.bin/eslint --fix .
|
||||
|
@ -58,14 +54,10 @@ jobs:
|
|||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: latest
|
||||
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
cache: "pnpm"
|
||||
cache: "npm"
|
||||
|
||||
- name: Configure git
|
||||
run: |
|
||||
|
@ -73,7 +65,7 @@ jobs:
|
|||
git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
run: npm ci
|
||||
|
||||
- name: Run Prettier
|
||||
run: node_modules/.bin/prettier -w .
|
||||
|
|
|
@ -2,5 +2,5 @@ dist/
|
|||
public/
|
||||
*.js
|
||||
.github/
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
nodemon.json
|
||||
|
|
|
@ -3,7 +3,6 @@ FROM node:lts-hydrogen as common
|
|||
ENV NPM_CONFIG_PREFIX=/home/node/.npm-global
|
||||
ENV PATH=$PATH:/home/node/.npm-global/bin
|
||||
|
||||
RUN npm i -g pnpm
|
||||
|
||||
WORKDIR /home/node/app
|
||||
|
||||
|
@ -11,14 +10,14 @@ FROM common as build
|
|||
|
||||
COPY . /home/node/app
|
||||
|
||||
RUN pnpm install --frozen-lockfile
|
||||
RUN pnpm build
|
||||
RUN npm ci
|
||||
RUN npm run build
|
||||
|
||||
FROM common as app
|
||||
|
||||
COPY --from=build --chown=node:node /home/node/app/dist /home/node/app/dist
|
||||
COPY --from=build --chown=node:node /home/node/app/public /home/node/app/public
|
||||
COPY --from=build --chown=node:node /home/node/app/package.json /home/node/app/pnpm-lock.yaml /home/node/app/
|
||||
COPY --from=build --chown=node:node /home/node/app/package.json /home/node/app/package-lock.json /home/node/app/
|
||||
COPY --from=build --chown=node:node /home/node/app/node_modules /home/node/app/node_modules
|
||||
|
||||
RUN mkdir /home/node/app/data
|
||||
|
|
46
default.nix
46
default.nix
|
@ -1,46 +1,28 @@
|
|||
{ pkgs ? (import <nixpkgs> {})}:
|
||||
with pkgs;
|
||||
with (import (fetchFromGitHub {
|
||||
owner = "TSRBerry";
|
||||
repo = "pnpm2nix";
|
||||
rev = "8df6e2a8bd0174f4e9fa858d37c08ff3e91019bc";
|
||||
sha256 = "YhWzfuqNCZmKMbcoDoAT52KodjpuNj/7MklwKD0ojrg=";
|
||||
}) { inherit pkgs; });
|
||||
|
||||
|
||||
let
|
||||
|
||||
buildPackage = mkPnpmPackage {
|
||||
src = nix-gitignore.gitignoreSource [] ./.;
|
||||
package = buildNpmPackage {
|
||||
pname = "ryujinx-ldn-website";
|
||||
version = "1.0.0";
|
||||
|
||||
linkDevDependencies = true;
|
||||
#linkDevDependencies = true;
|
||||
|
||||
postBuild = ''
|
||||
cp -R "node_modules/$pname"/* ./
|
||||
src = ./.;
|
||||
|
||||
export PATH="node_modules/.bin:$PATH"
|
||||
npmBuildScript = "release";
|
||||
npmBuildFlags = [ "--" "--outDir" "dist" ];
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
cp -r dist $out/
|
||||
cp -r public package.json package-lock.json node_modules $out/
|
||||
|
||||
mkdir -p "$out/dist"
|
||||
makeWrapper '${nodejs}/bin/node' "$out/bin/ryujinx-ldn-website" --add-flags "$out/index.js"
|
||||
|
||||
npm run build -- --outDir "$out/dist"
|
||||
mv public package.json pnpm-lock.yaml "$out/"
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
rm -rf "$out/bin" "$lib/node_modules/$pname"
|
||||
'';
|
||||
};
|
||||
|
||||
package = mkPnpmPackage {
|
||||
src = buildPackage;
|
||||
|
||||
postInstall = ''
|
||||
mv "$lib/node_modules/$pname/dist" "$lib/node_modules/$pname/public" "$lib/node_modules/$pname/package.json" "$out/"
|
||||
rm -rf "$lib/node_modules/$pname"
|
||||
|
||||
ln -s "$lib/node_modules" "$out/node_modules"
|
||||
ln -s "$npm_config_nodedir/bin/node" "$out/bin/node"
|
||||
'';
|
||||
npmDepsHash = "sha256-Wo4dGsUAZwXbkuWwTKNA5kv4ZUnekdKm/TagP4Q4Ds8=";
|
||||
};
|
||||
|
||||
in package
|
||||
|
|
|
@ -9,5 +9,5 @@
|
|||
"views"
|
||||
],
|
||||
"ext": "ts,js,html,css,ejs,png",
|
||||
"exec": "pnpm run dev"
|
||||
"exec": "npm run dev"
|
||||
}
|
||||
|
|
3066
package-lock.json
generated
Normal file
3066
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
|
@ -13,11 +13,12 @@
|
|||
"format": "prettier -w .",
|
||||
"lint": "eslint --fix .",
|
||||
"build": "tsc",
|
||||
"prestart": "pnpm build",
|
||||
"prestart": "npm build",
|
||||
"start": "node .",
|
||||
"dev": "pnpm build && pnpm start",
|
||||
"dev": "npm build && npm start",
|
||||
"serve": "nodemon",
|
||||
"prepack": "pnpm build"
|
||||
"prepack": "npm build",
|
||||
"release": "tsc"
|
||||
},
|
||||
"dependencies": {
|
||||
"ejs": "^3.1.9",
|
||||
|
|
1898
pnpm-lock.yaml
1898
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue