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

@@ -1 +0,0 @@
/dist

View File

@@ -1,22 +0,0 @@
{
"name": "@bigcapital/utils",
"version": "1.0.0",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.js",
"import": "./dist/index.mjs"
}
},
"scripts": {
"build:cjs": "tsup src/index.ts --format cjs --dts --sourcemap",
"build:esm": "tsup src/index.ts --format esm --dts --sourcemap",
"build": "npm run build:cjs && npm run build:esm",
"dev": "npm run build -- --watch"
},
"author": "",
"license": "ISC"
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,20 +0,0 @@
import { Countries } from './constant';
import { Country, Maybe } from './types';
export const getAllCountries = () => {
return Object.keys(Countries).map((countryCode) => {
return {
...Countries[countryCode],
countryCode,
};
});
};
export const findByIsoCountryCode = (
isoCode: string
): Maybe<Country & { countryCode: string }> => {
const _isoCode = isoCode?.toUpperCase();
const country = Countries[_isoCode];
return country ? { ...country, countryCode: isoCode } : null;
};

View File

@@ -1,12 +0,0 @@
export interface Country {
name: string;
native: string;
phone: number[];
continent: string;
continents?: string[];
capital: string;
currency: string[];
languages: string[];
}
export type Maybe<T> = T | null;

View File

@@ -1,3 +0,0 @@
export * from './countries';
export const test = () => {};

View File

@@ -1,17 +0,0 @@
{
"compilerOptions": {
"target": "ES6", // Equivalent to ES6 output
"module": "ESNext", // CommonJS for Node.js compatibility
"outDir": "dist", // Output directory for compiled files
"declaration": true, // Generates .d.ts files (same as dts: true)
"declarationDir": "dist", // Specifies where to output declaration files
"sourceMap": true, // Generate sourcemaps
"esModuleInterop": true, // Enables interop between CommonJS and ESModules
"strict": true, // Enables strict type-checking options
"moduleResolution": "node", // Resolve modules using Node.js-style resolution
"skipLibCheck": true, // Skip type checking of declaration files
"forceConsistentCasingInFileNames": true // Enforces consistent casing in import paths
},
"include": ["src/**/*"], // Includes all TypeScript files in the src directory
"exclude": ["node_modules"] // Excludes node_modules from being compiled
}

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