Skip to content

Commit

Permalink
feat: rename 'types' folder into 'shared' to allow additional shared …
Browse files Browse the repository at this point in the history
…resources between the sub-projects (#112)

* feat: renaming 'types/src' to 'shared/types'

* feat: update applications to reference renamed 'shared/types' folder

* fix: Updating Dockerfiles to reference updated 'shared' folder
  • Loading branch information
TheNickOfTime authored Aug 9, 2024
1 parent 5175c0d commit 7c93c3c
Show file tree
Hide file tree
Showing 18 changed files with 10 additions and 44 deletions.
4 changes: 2 additions & 2 deletions client/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
"components/*": ["./src/components/*"],
"pages/*": ["./src/pages/*"],
"sections/*": ["./src/sections/*"],
"types/*": ["../types/src/*"]
"types/*": ["../shared/types/*"]
}
},
"references": [
{
"path": "../types"
"path": "../shared"
}
],
"include": ["src"]
Expand Down
2 changes: 1 addition & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig({
components: path.resolve(__dirname, './src/components'),
pages: path.resolve(__dirname, './src/pages'),
sections: path.resolve(__dirname, './src/sections'),
types: path.resolve(__dirname, '../types/src'),
types: path.resolve(__dirname, '../shared/types'),
},
},
server: {
Expand Down
18 changes: 2 additions & 16 deletions server/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,18 @@
# Build client -------------------------------------------------------------------------------------
FROM node:alpine AS client-build
COPY client /handbrake-web/client
COPY types /handbrake-web/types
COPY shared /handbrake-web/shared
WORKDIR /handbrake-web/client

RUN npm install
RUN npm run build

# Build server -------------------------------------------------------------------------------------
# FROM node:alpine AS server-build
# COPY /server /handbrake-web/server
# COPY /types /handbrake-web/types
# WORKDIR /handbrake-web/server

# RUN npm install
# RUN npm run build

# Main ---------------------------------------------------------------------------------------------
FROM node:alpine AS main

# Copy project folder
# COPY --from=client-build /handbrake-web/client/build /handbrake-web/client
# COPY --from=server-build /handbrake-web/server/build /handbrake-web/server/package.json /handbrake-web/server/package-lock.json /handbrake-web
# WORKDIR /handbrake-web

COPY --from=client-build /handbrake-web/client/build /handbrake-web/client
COPY server /handbrake-web/server
COPY types /handbrake-web/types
COPY shared /handbrake-web/shared
WORKDIR /handbrake-web/server

# Install node dependencies
Expand Down
4 changes: 2 additions & 2 deletions server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"routes/*": ["./src/routes/*"],
"scripts/*": ["./src/scripts/*"],
"socket/*": ["./src/socket/*"],
"types/*": ["../types/src/*"]
"types/*": ["../shared/types/*"]
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
Expand Down Expand Up @@ -114,7 +114,7 @@
},
"references": [
{
"path": "../types"
"path": "../shared"
}
],
"include": ["./src"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 1 addition & 21 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,11 @@
# Build applications -------------------------------------------------------------------------------
# FROM node:alpine AS build

# COPY worker /handbrake-web/worker
# COPY types /handbrake-web/types
# WORKDIR /handbrake-web/worker

# RUN npm install
# RUN npm run build

# Node ---------------------------------------------------------------------------------------------
FROM node:bookworm-slim AS main

# Install external dependencies
RUN apt update && apt install -y handbrake-cli

# Copy project folder
# COPY --from=build handbrake-web/worker/build /handbrake-web
# COPY --from=build \
# handbrake-web/worker/package.json \
# handbrake-web/worker/package-lock.json \
# handbrake-web/worker/start.sh \
# handbrake-web/worker/tsconfig.json \
# /handbrake-web
# WORKDIR /handbrake-web

COPY worker /handbrake-web/worker
COPY types /handbrake-web/types
COPY shared /handbrake-web/shared
WORKDIR /handbrake-web/worker

# Install node dependencies
Expand Down
4 changes: 2 additions & 2 deletions worker/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"paths": {
"scripts/*": ["./src/scripts/*"],
"socket/*": ["./src/socket/*"],
"types/*": ["../types/src/*"]
"types/*": ["../shared/types/*"]
} /* Specify a set of entries that re-map imports to additional lookup locations. */,
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
// "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
Expand Down Expand Up @@ -114,7 +114,7 @@
},
"references": [
{
"path": "../types"
"path": "../shared"
}
],
"ts-node": {
Expand Down

0 comments on commit 7c93c3c

Please sign in to comment.