Skip to content

Commit

Permalink
simplify top level
Browse files Browse the repository at this point in the history
  • Loading branch information
tailuge committed Dec 23, 2024
1 parent 70bc666 commit c95b813
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 43 deletions.
8 changes: 0 additions & 8 deletions .gitpod.yml

This file was deleted.

10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@
"yarn": "1.x"
},
"scripts": {
"test": "jest --verbose",
"coverage": "jest --coverage",
"test": "jest --config ./test/jest.config.js --verbose",
"coverage": "jest --config ./test/jest.config.js --coverage",
"dev": "webpack",
"prettify": "prettier --cache true --write --trailing-comma es5 --no-semi {src,test}/**/*.[jt]s dist/**/*.{css,html} *.[jt]s *.json dist/lobby/*",
"markdownlint": "npx markdownlint-cli2 README.md --fix",
"serve": "webpack serve",
"servegitpod": "webpack serve --client-web-socket-url $(gp url 8080 | sed 's/http/ws/' | sed 's#$#/ws#')",
"deps": "npx yarn-check --skip-unused",
"websocket": "node dist/server.js",
"build:server": "webpack --config webpack.server.config.js",
"websocket": "nodemon ./src/network/server/server.ts",
"build:server": "webpack --config ./src/network/server/webpack.server.config.js",
"start:server": "node dist/server.js",
"nop": "echo nop",
"dockerify": "docker build -f dist/Dockerfile -t tailuge/billiards-nginx .",
"gltfpack": "npx gltfpack -i dist/models/p8.gltf -o dist/models/p8.min.gltf && npx gltfpack -i dist/models/threecushion.gltf -o dist/models/threecushion.min.gltf && npx gltfpack -i dist/models/snooker.gltf -o dist/models/snooker.min.gltf && npx gltfpack -i dist/models/d-snooker.gltf -o dist/models/d-snooker.min.gltf"
},
Expand Down
7 changes: 2 additions & 5 deletions src/network/Dockerfile → src/network/server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ FROM node:22-alpine

WORKDIR /app

# Install nodemon globally
RUN npm install -g nodemon

# Create a non-root user
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
USER appuser
Expand All @@ -13,8 +10,8 @@ USER appuser
COPY . .

# Expose the application port
EXPOSE 8888
EXPOSE 10000

# Command to run the application
CMD ["nodemon", "src/network/server/server.ts"]
CMD ["node", "dist/server.js"]

25 changes: 25 additions & 0 deletions src/network/server/webpack.server.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const path = require("path");
const nodeExternals = require(path.resolve(__dirname, "../../../node_modules/webpack-node-externals"));

module.exports = {
target: "node",
externals: [nodeExternals()],
entry: "./src/network/server/server.ts",
output: {
path: path.resolve(__dirname, "../../../dist"),
filename: "server.js",
},
resolve: {
extensions: [".ts", ".js"],
modules: [path.resolve(__dirname, "../../../node_modules"), "node_modules"],
},
module: {
rules: [
{
test: /\.ts$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
};
1 change: 1 addition & 0 deletions jest.config.js → test/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module.exports = {
rootDir: "../",
preset: "ts-jest",
transformIgnorePatterns: ["node_modules/(?!jsoncrush)"],
transform: {
Expand Down
24 changes: 0 additions & 24 deletions webpack.server.config.js

This file was deleted.

0 comments on commit c95b813

Please sign in to comment.