feat: Lerna shared

This commit is contained in:
Ahmed Bouhuolia
2024-10-06 17:20:28 +02:00
parent 184648040c
commit 6cad929738
13 changed files with 15 additions and 22 deletions

View File

@@ -3,6 +3,7 @@
"version": "independent",
"npmClient": "pnpm",
"packages": [
"packages/*"
"packages/*",
"shared/*"
]
}

View File

@@ -4,11 +4,11 @@
"scripts": {
"dev": "lerna run dev",
"build": "lerna run build",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\"",
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\"",
"dev:server": "lerna run dev --scope \"@bigcapital/server\"",
"build:server": "lerna run build --scope \"@bigcapital/server\"",
"serve:server": "lerna run serve --scope \"@bigcapital/server\"",
"dev:webapp": "lerna run dev --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\"",
"build:webapp": "lerna run build --scope \"@bigcapital/webapp\" --scope \"@bigcapital/utils\"",
"dev:server": "lerna run dev --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"build:server": "lerna run build --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"serve:server": "lerna run serve --scope \"@bigcapital/server\" --scope \"@bigcapital/utils\"",
"test:e2e": "playwright test",
"prepare": "husky install"
},

View File

@@ -90,11 +90,7 @@ RUN chown node:node /
RUN npm install -g pnpm
# Copy application dependency manifests to the container image.
COPY ./package*.json ./
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
COPY ./lerna.json ./lerna.json
COPY ./pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY ./packages/server/package*.json ./packages/server/
COPY --chown=node:node ./ ./
# Install application dependencies
RUN apk update
@@ -109,6 +105,6 @@ RUN pnpm install
COPY --chown=node:node ./packages/server ./packages/server
# # Creates a "dist" folder with the production build
RUN npm run build:server --skip-nx-cache
RUN pnpm run build:server --skip-nx-cache
CMD [ "node", "./packages/server/build/index.js" ]

View File

@@ -5,11 +5,7 @@ USER root
WORKDIR /app
# Copy application dependency manifests to the container image.
COPY ./package*.json ./
COPY ./pnpm-lock.yaml ./pnpm-lock.yaml
COPY ./lerna.json ./lerna.json
COPY ./pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY ./packages/webapp/package*.json ./packages/webapp/
COPY . .
# Install application dependencies
RUN apk update
@@ -23,7 +19,6 @@ RUN npm install -g pnpm
RUN pnpm install
# Build webapp package
COPY ./packages/webapp /app/packages/webapp
RUN pnpm run build:webapp
FROM nginx

8
pnpm-lock.yaml generated
View File

@@ -37,8 +37,6 @@ importers:
specifier: ^9.0.5
version: 9.1.2
packages/bigcapital-utils: {}
packages/server:
dependencies:
'@aws-sdk/client-s3':
@@ -49,7 +47,7 @@ importers:
version: 3.583.0
'@bigcapital/utils':
specifier: '*'
version: link:../bigcapital-utils
version: link:../../shared/bigcapital-utils
'@casl/ability':
specifier: ^5.4.3
version: 5.4.4
@@ -482,7 +480,7 @@ importers:
dependencies:
'@bigcapital/utils':
specifier: '*'
version: link:../bigcapital-utils
version: link:../../shared/bigcapital-utils
'@blueprintjs-formik/core':
specifier: ^0.3.6
version: 0.3.6(@babel/core@7.24.5)(@blueprintjs/core@4.20.2)(@blueprintjs/select@4.9.24)(formik@2.4.6)(react-dom@18.3.1)(react-is@18.3.1)(react@18.3.1)
@@ -841,6 +839,8 @@ importers:
specifier: ^0.28.1
version: 0.28.5
shared/bigcapital-utils: {}
packages:
/@alloc/quick-lru@5.2.0:

View File

@@ -1,3 +1,4 @@
packages:
# all packages in direct subdirs of packages/
- 'packages/*'
- 'shared/*'