enh
This commit is contained in:
parent
ad2447d14e
commit
4aab508286
19 changed files with 21 additions and 17 deletions
1
.turbo/cache/16b2b9fdd640519f-meta.json
vendored
Normal file
1
.turbo/cache/16b2b9fdd640519f-meta.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{"hash":"16b2b9fdd640519f","duration":4685}
|
||||||
BIN
.turbo/cache/16b2b9fdd640519f.tar.zst
vendored
Normal file
BIN
.turbo/cache/16b2b9fdd640519f.tar.zst
vendored
Normal file
Binary file not shown.
1
.turbo/cache/2c1f4b5c0c1ad80f-meta.json
vendored
Normal file
1
.turbo/cache/2c1f4b5c0c1ad80f-meta.json
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
{"hash":"2c1f4b5c0c1ad80f","duration":4886}
|
||||||
BIN
.turbo/cache/2c1f4b5c0c1ad80f.tar.zst
vendored
Normal file
BIN
.turbo/cache/2c1f4b5c0c1ad80f.tar.zst
vendored
Normal file
Binary file not shown.
0
.turbo/cookies/1.cookie
Normal file
0
.turbo/cookies/1.cookie
Normal file
0
.turbo/cookies/2.cookie
Normal file
0
.turbo/cookies/2.cookie
Normal file
0
.turbo/cookies/3.cookie
Normal file
0
.turbo/cookies/3.cookie
Normal file
0
.turbo/cookies/4.cookie
Normal file
0
.turbo/cookies/4.cookie
Normal file
0
.turbo/cookies/5.cookie
Normal file
0
.turbo/cookies/5.cookie
Normal file
0
.turbo/cookies/6.cookie
Normal file
0
.turbo/cookies/6.cookie
Normal file
0
.turbo/cookies/7.cookie
Normal file
0
.turbo/cookies/7.cookie
Normal file
0
.turbo/daemon/459749df55927c07-turbo.log.2026-03-15
Normal file
0
.turbo/daemon/459749df55927c07-turbo.log.2026-03-15
Normal file
11
Dockerfile
11
Dockerfile
|
|
@ -11,10 +11,11 @@ WORKDIR /app
|
||||||
COPY package.json package-lock.json turbo.json ./
|
COPY package.json package-lock.json turbo.json ./
|
||||||
COPY apps/backend/package.json ./apps/backend/
|
COPY apps/backend/package.json ./apps/backend/
|
||||||
COPY apps/fallback-ui/package.json ./apps/fallback-ui/
|
COPY apps/fallback-ui/package.json ./apps/fallback-ui/
|
||||||
|
COPY packages/shared/ ./packages/shared
|
||||||
COPY packages/ui/package.json ./packages/ui/
|
COPY packages/ui/package.json ./packages/ui/
|
||||||
RUN npm install -g turbo
|
RUN npm install -g turbo
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN turbo prune --scope=backend --scope=fallback-ui --scope=common-ui --docker
|
RUN turbo prune --scope=backend --scope=fallback-ui --scope=common-ui --scope=@packages/shared --docker
|
||||||
|
|
||||||
# 3. ---- Builder ----
|
# 3. ---- Builder ----
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
|
|
@ -35,14 +36,12 @@ ENV NODE_ENV=production
|
||||||
# Copy package files and install production deps
|
# Copy package files and install production deps
|
||||||
COPY --from=pruner /app/out/json/ .
|
COPY --from=pruner /app/out/json/ .
|
||||||
COPY --from=pruner /app/out/package-lock.json ./package-lock.json
|
COPY --from=pruner /app/out/package-lock.json ./package-lock.json
|
||||||
RUN npm config set fetch-retries 5 \
|
RUN npm ci --production --omit=dev
|
||||||
&& npm config set fetch-timeout 600000 \
|
|
||||||
&& npm config set fetch-retry-mintimeout 20000 \
|
|
||||||
&& npm cache clean --force \
|
|
||||||
&& npm ci --omit=dev
|
|
||||||
# Copy built applications
|
# Copy built applications
|
||||||
COPY --from=builder /app/apps/backend/dist ./apps/backend/dist
|
COPY --from=builder /app/apps/backend/dist ./apps/backend/dist
|
||||||
COPY --from=builder /app/apps/fallback-ui/dist ./apps/fallback-ui/dist
|
COPY --from=builder /app/apps/fallback-ui/dist ./apps/fallback-ui/dist
|
||||||
|
COPY --from=builder /app/packages/shared ./packages/shared
|
||||||
|
|
||||||
EXPOSE 4000
|
EXPOSE 4000
|
||||||
RUN npm i -g bun
|
RUN npm i -g bun
|
||||||
CMD ["bun", "apps/backend/dist/index.js"]
|
CMD ["bun", "apps/backend/dist/index.js"]
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ export const getAllTags = async (req: Request, res: Response) => {
|
||||||
* Get a single product tag by ID
|
* Get a single product tag by ID
|
||||||
*/
|
*/
|
||||||
export const getTagById = async (req: Request, res: Response) => {
|
export const getTagById = async (req: Request, res: Response) => {
|
||||||
const { id } = req.params;
|
const id = req.params.id as string
|
||||||
|
|
||||||
const tag = await db.query.productTagInfo.findFirst({
|
const tag = await db.query.productTagInfo.findFirst({
|
||||||
where: eq(productTagInfo.id, parseInt(id)),
|
where: eq(productTagInfo.id, parseInt(id)),
|
||||||
|
|
@ -121,7 +121,7 @@ export const getTagById = async (req: Request, res: Response) => {
|
||||||
* Update a product tag
|
* Update a product tag
|
||||||
*/
|
*/
|
||||||
export const updateTag = async (req: Request, res: Response) => {
|
export const updateTag = async (req: Request, res: Response) => {
|
||||||
const { id } = req.params;
|
const id = req.params.id as string
|
||||||
const { tagName, tagDescription, isDashboardTag, relatedStores } = req.body;
|
const { tagName, tagDescription, isDashboardTag, relatedStores } = req.body;
|
||||||
|
|
||||||
// Get the current tag to check for existing image
|
// Get the current tag to check for existing image
|
||||||
|
|
@ -192,7 +192,7 @@ export const updateTag = async (req: Request, res: Response) => {
|
||||||
* Delete a product tag
|
* Delete a product tag
|
||||||
*/
|
*/
|
||||||
export const deleteTag = async (req: Request, res: Response) => {
|
export const deleteTag = async (req: Request, res: Response) => {
|
||||||
const { id } = req.params;
|
const id = req.params.id as string
|
||||||
|
|
||||||
// Check if tag exists
|
// Check if tag exists
|
||||||
const tag = await db.query.productTagInfo.findFirst({
|
const tag = await db.query.productTagInfo.findFirst({
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ export const createProduct = async (req: Request, res: Response) => {
|
||||||
* Update a product
|
* Update a product
|
||||||
*/
|
*/
|
||||||
export const updateProduct = async (req: Request, res: Response) => {
|
export const updateProduct = async (req: Request, res: Response) => {
|
||||||
const { id } = req.params;
|
const id = req.params.id as string
|
||||||
const { name, shortDescription, longDescription, unitId, storeId, price, marketPrice, incrementStep, productQuantity, isSuspended, isFlashAvailable, flashPrice, deals:dealsRaw, imagesToDelete:imagesToDeleteRaw, tagIds } = req.body;
|
const { name, shortDescription, longDescription, unitId, storeId, price, marketPrice, incrementStep, productQuantity, isSuspended, isFlashAvailable, flashPrice, deals:dealsRaw, imagesToDelete:imagesToDeleteRaw, tagIds } = req.body;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,9 @@
|
||||||
"@commonTypes": ["../../packages/ui/shared-types"],
|
"@commonTypes": ["../../packages/ui/shared-types"],
|
||||||
"@commonTypes/*": ["../../packages/ui/shared-types/*"],
|
"@commonTypes/*": ["../../packages/ui/shared-types/*"],
|
||||||
"@packages/shared": ["../../packages/shared"],
|
"@packages/shared": ["../../packages/shared"],
|
||||||
"@packages/shared/*": ["../../packages/shared/*"]
|
"@packages/shared/*": ["../../packages/shared/*"],
|
||||||
|
"global-shared": ["../../packages/shared"],
|
||||||
|
"global-shared/*": ["../../packages/shared/*"]
|
||||||
},
|
},
|
||||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
// "typeRoots": [""], /* Specify multiple folders that act like './node_modules/@types'. */
|
// "typeRoots": [""], /* Specify multiple folders that act like './node_modules/@types'. */
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,6 @@
|
||||||
"@/*": [
|
"@/*": [
|
||||||
"./src/*"
|
"./src/*"
|
||||||
],
|
],
|
||||||
"common-ui": [
|
|
||||||
"../../packages/ui"
|
|
||||||
],
|
|
||||||
"common-ui/*": [
|
|
||||||
"../../packages/ui/*"
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
"types": [
|
"types": [
|
||||||
"node"
|
"node"
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ config.watchFolders = [
|
||||||
config.resolver.extraNodeModules = {
|
config.resolver.extraNodeModules = {
|
||||||
...config.resolver.extraNodeModules,
|
...config.resolver.extraNodeModules,
|
||||||
'@packages/shared': path.resolve(__dirname, '../../packages/shared'),
|
'@packages/shared': path.resolve(__dirname, '../../packages/shared'),
|
||||||
|
'global-shared': path.resolve(__dirname, '../../packages/shared'),
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = config;
|
module.exports = config;
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,12 @@
|
||||||
],
|
],
|
||||||
"@packages/shared/*": [
|
"@packages/shared/*": [
|
||||||
"../../packages/shared/*"
|
"../../packages/shared/*"
|
||||||
|
],
|
||||||
|
"global-shared": [
|
||||||
|
"../../packages/shared"
|
||||||
|
],
|
||||||
|
"global-shared/*": [
|
||||||
|
"../../packages/shared/*"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"moduleSuffixes": [
|
"moduleSuffixes": [
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue