merge branch feature/migrate-yarn-to-pnpm
This commit is contained in:
parent
79e707a232
commit
9e40e5141c
2
.gitignore
vendored
2
.gitignore
vendored
@ -68,3 +68,5 @@ yarn-error.log*
|
||||
.turbo
|
||||
|
||||
# End of https://www.toptal.com/developers/gitignore/api/turbo
|
||||
|
||||
.pnpm
|
||||
104
README.md
104
README.md
@ -1,59 +1,28 @@
|
||||
# Turborepo Docker starter
|
||||
# Turborepo starter
|
||||
|
||||
This is an official Docker starter Turborepo.
|
||||
|
||||
## What's inside?
|
||||
|
||||
This turborepo uses [Yarn](https://classic.yarnpkg.com/lang/en/) as a package manager. It includes the following packages/apps:
|
||||
|
||||
### Apps and Packages
|
||||
|
||||
- `web`: a [Next.js](https://nextjs.org/) app
|
||||
- `api`: an [Express](https://expressjs.com/) server
|
||||
- `ui`: ui: a React component library
|
||||
- `eslint-config-custom`: `eslint` configurations for client side applications (includes `eslint-config-next` and `eslint-config-prettier`)
|
||||
- `eslint-config-custom-server`: `eslint` configurations for server side applications (includes `eslint-config-next` and `eslint-config-prettier`)
|
||||
- `scripts`: Jest configurations
|
||||
- `logger`: Isomorphic logger (a small wrapper around console.log)
|
||||
- `tsconfig`: tsconfig.json;s used throughout the monorepo
|
||||
|
||||
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
|
||||
This is an official starter Turborepo.
|
||||
|
||||
## Using this example
|
||||
|
||||
Run the following command:
|
||||
|
||||
```sh
|
||||
npx degit vercel/turbo/examples/with-docker with-docker
|
||||
cd with-docker
|
||||
yarn install
|
||||
git init . && git add . && git commit -m "Init"
|
||||
npx create-turbo@latest
|
||||
```
|
||||
|
||||
### Docker
|
||||
## What's inside?
|
||||
|
||||
This repo is configured to be built with Docker, and Docker compose. To build all apps in this repo:
|
||||
This Turborepo includes the following packages/apps:
|
||||
|
||||
```
|
||||
# Create a network, which allows containers to communicate
|
||||
# with each other, by using their container name as a hostname
|
||||
docker network create app_network
|
||||
### Apps and Packages
|
||||
|
||||
# Build prod using new BuildKit engine
|
||||
COMPOSE_DOCKER_CLI_BUILD=1 DOCKER_BUILDKIT=1 docker-compose -f docker-compose.yml build --parallel
|
||||
- `docs`: a [Next.js](https://nextjs.org/) app
|
||||
- `web`: another [Next.js](https://nextjs.org/) app
|
||||
- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications
|
||||
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
|
||||
- `@repo/tsconfig`: `tsconfig.json`s used throughout the monorepo
|
||||
|
||||
# Start prod in detached mode
|
||||
docker-compose -f docker-compose.yml up -d
|
||||
```
|
||||
|
||||
Open http://localhost:3000.
|
||||
|
||||
To shutdown all running containers:
|
||||
|
||||
```
|
||||
# Stop all running containers
|
||||
docker kill $(docker ps -q) && docker rm $(docker ps -a -q)
|
||||
```
|
||||
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
|
||||
|
||||
### Utilities
|
||||
|
||||
@ -61,5 +30,52 @@ This Turborepo has some additional tools already setup for you:
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org/) for static type checking
|
||||
- [ESLint](https://eslint.org/) for code linting
|
||||
- [Jest](https://jestjs.io) test runner for all things JavaScript
|
||||
- [Prettier](https://prettier.io) for code formatting
|
||||
|
||||
### Build
|
||||
|
||||
To build all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
pnpm build
|
||||
```
|
||||
|
||||
### Develop
|
||||
|
||||
To develop all apps and packages, run the following command:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
pnpm dev
|
||||
```
|
||||
|
||||
### Remote Caching
|
||||
|
||||
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
|
||||
|
||||
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands:
|
||||
|
||||
```
|
||||
cd my-turborepo
|
||||
npx turbo login
|
||||
```
|
||||
|
||||
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
|
||||
|
||||
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
|
||||
|
||||
```
|
||||
npx turbo link
|
||||
```
|
||||
|
||||
## Useful Links
|
||||
|
||||
Learn more about the power of Turborepo:
|
||||
|
||||
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
|
||||
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
|
||||
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
|
||||
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
|
||||
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
|
||||
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
|
||||
|
||||
@ -2,17 +2,21 @@
|
||||
# Make sure you update both files!
|
||||
|
||||
FROM node:alpine AS builder
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
ENV PNPM_HOME=/usr/local/bin
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
RUN yarn global add turbo
|
||||
RUN pnpm add -g turbo dotenv-cli
|
||||
COPY . .
|
||||
RUN turbo prune --scope=api --docker
|
||||
|
||||
# Add lockfile and package.json's of isolated subworkspace
|
||||
FROM node:alpine AS installer
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
ENV PNPM_HOME=/usr/local/bin
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
WORKDIR /app
|
||||
@ -20,14 +24,15 @@ WORKDIR /app
|
||||
# First install dependencies (as they change less often)
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
COPY --from=builder /app/out/yarn.lock ./yarn.lock
|
||||
RUN yarn install
|
||||
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project and its dependencies
|
||||
COPY --from=builder /app/out/full/ .
|
||||
COPY turbo.json turbo.json
|
||||
# COPY .env .env
|
||||
RUN yarn turbo run build --filter=api...
|
||||
COPY .env .env
|
||||
RUN pnpm dotenv -e .env turbo run build --filter=api...
|
||||
|
||||
FROM node:alpine AS runner
|
||||
WORKDIR /app
|
||||
@ -38,4 +43,4 @@ RUN adduser --system --uid 1001 nestjs
|
||||
USER nestjs
|
||||
COPY --from=installer /app .
|
||||
|
||||
CMD node apps/api/dist/main.js
|
||||
CMD node apps/api/dist/main.js
|
||||
|
||||
@ -29,33 +29,33 @@
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
$ yarn install
|
||||
$ pnpm install
|
||||
```
|
||||
|
||||
## Running the app
|
||||
|
||||
```bash
|
||||
# development
|
||||
$ yarn run start
|
||||
$ pnpm run start
|
||||
|
||||
# watch mode
|
||||
$ yarn run start:dev
|
||||
$ pnpm run start:dev
|
||||
|
||||
# production mode
|
||||
$ yarn run start:prod
|
||||
$ pnpm run start:prod
|
||||
```
|
||||
|
||||
## Test
|
||||
|
||||
```bash
|
||||
# unit tests
|
||||
$ yarn run test
|
||||
$ pnpm run test
|
||||
|
||||
# e2e tests
|
||||
$ yarn run test:e2e
|
||||
$ pnpm run test:e2e
|
||||
|
||||
# test coverage
|
||||
$ yarn run test:cov
|
||||
$ pnpm run test:cov
|
||||
```
|
||||
|
||||
## Support
|
||||
|
||||
@ -40,8 +40,8 @@
|
||||
"@types/jest": "^29.5.2",
|
||||
"@types/node": "^20.3.1",
|
||||
"@types/supertest": "^6.0.0",
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.5",
|
||||
"eslint": "^8.51.0",
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.6",
|
||||
"eslint": "^8.52.0",
|
||||
"fastify": "^4.26.1",
|
||||
"jest": "^29.5.0",
|
||||
"prettier": "^3.0.0",
|
||||
@ -51,7 +51,7 @@
|
||||
"ts-loader": "^9.4.3",
|
||||
"ts-node": "^10.9.1",
|
||||
"tsconfig-paths": "^4.2.0",
|
||||
"typescript": "^5.1.3"
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"jest": {
|
||||
"moduleFileExtensions": [
|
||||
|
||||
@ -1,11 +1,14 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'@vchikalkin/eslint-config-awesome/next-typescript/config',
|
||||
'@vchikalkin/eslint-config-awesome/next-typescript/rules',
|
||||
],
|
||||
const { createConfig } = require('@vchikalkin/eslint-config-awesome');
|
||||
|
||||
module.exports = createConfig('next-typescript', {
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
root: true,
|
||||
};
|
||||
rules: {
|
||||
'import/no-duplicates': 'off',
|
||||
'react/forbid-component-props': 'off',
|
||||
'import/consistent-type-specifier-style': 'off',
|
||||
},
|
||||
ignorePatterns: ['*.config.js', '.eslintrc.js'],
|
||||
});
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
overwrite: true
|
||||
schema: './graphql/crm.schema.graphql'
|
||||
documents: ['./**/!(*.{d,types}).{ts,tsx}', './**/.{js,jsx}', ./**/!(*.schema).graphql]
|
||||
documents: [./**/!(*.schema).graphql]
|
||||
generates:
|
||||
./graphql/crm.types.ts:
|
||||
plugins:
|
||||
|
||||
@ -19,6 +19,6 @@ export const Grid = styled(Box)`
|
||||
}
|
||||
|
||||
${min('desktop-xl')} {
|
||||
margin: 8px 10%;
|
||||
margin: 8px 10% !important;
|
||||
}
|
||||
`;
|
||||
|
||||
@ -7,7 +7,7 @@ import { observer } from 'mobx-react-lite';
|
||||
import { Table } from 'ui/elements';
|
||||
|
||||
const PaymentsTable = observer(() => {
|
||||
const { $results, $process } = useStore();
|
||||
const { $process, $results } = useStore();
|
||||
|
||||
const unlimited = $process.has('Unlimited');
|
||||
const dataSource = toJS($results.payments);
|
||||
@ -27,8 +27,8 @@ const PaymentsTable = observer(() => {
|
||||
showSizeChanger: false,
|
||||
}}
|
||||
scroll={{
|
||||
x: dataColumns.length > 4 && 1000,
|
||||
y: 630,
|
||||
x: dataColumns.length > 5 ? 1000 : undefined,
|
||||
y: dataSource.length > 16 ? 630 : undefined,
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
@ -2,17 +2,21 @@
|
||||
# Make sure you update both files!
|
||||
|
||||
FROM node:alpine AS builder
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
ENV PNPM_HOME=/usr/local/bin
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
RUN yarn global add turbo
|
||||
RUN pnpm add -g turbo dotenv-cli
|
||||
COPY . .
|
||||
RUN turbo prune --scope=web --docker
|
||||
|
||||
# Add lockfile and package.json's of isolated subworkspace
|
||||
FROM node:alpine AS installer
|
||||
RUN corepack enable && corepack prepare pnpm@latest --activate
|
||||
ENV PNPM_HOME=/usr/local/bin
|
||||
RUN apk add --no-cache libc6-compat
|
||||
RUN apk update
|
||||
WORKDIR /app
|
||||
@ -20,8 +24,9 @@ WORKDIR /app
|
||||
# First install the dependencies (as they change less often)
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
COPY --from=builder /app/out/yarn.lock ./yarn.lock
|
||||
RUN yarn install
|
||||
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
COPY --from=builder /app/out/pnpm-workspace.yaml ./pnpm-workspace.yaml
|
||||
RUN pnpm install
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /app/out/full/ .
|
||||
@ -42,7 +47,7 @@ ARG URL_CORE_CALCULATE_DIRECT
|
||||
ARG URL_1C_TRANSTAX_DIRECT
|
||||
ARG URL_ELT_OSAGO_DIRECT
|
||||
ARG URL_ELT_KASKO_DIRECT
|
||||
RUN yarn turbo run build --filter=web...
|
||||
RUN pnpm dotenv -e .env turbo run build --filter=web...
|
||||
|
||||
FROM node:alpine AS runner
|
||||
WORKDIR /app
|
||||
@ -61,4 +66,4 @@ COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
|
||||
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
|
||||
COPY --from=installer --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
|
||||
|
||||
CMD node apps/web/server.js
|
||||
CMD node apps/web/server.js
|
||||
@ -1,30 +1,36 @@
|
||||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
|
||||
|
||||
## Getting Started
|
||||
|
||||
First, run the development server:
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
# or
|
||||
yarn dev
|
||||
# or
|
||||
pnpm dev
|
||||
# or
|
||||
bun dev
|
||||
```
|
||||
|
||||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
|
||||
|
||||
You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file.
|
||||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file.
|
||||
|
||||
[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
|
||||
|
||||
The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
|
||||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
|
||||
|
||||
## Learn More
|
||||
|
||||
To learn more about Next.js, take a look at the following resources:
|
||||
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn/foundations/about-nextjs) - an interactive Next.js tutorial.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js.
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
|
||||
@ -48,6 +48,7 @@ query GetLead($leadid: Uuid!) {
|
||||
}
|
||||
evo_okved
|
||||
}
|
||||
link
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +62,7 @@ query GetOpportunity($opportunityid: Uuid!) {
|
||||
}
|
||||
evo_okved
|
||||
}
|
||||
link
|
||||
}
|
||||
}
|
||||
|
||||
@ -107,6 +109,7 @@ query GetQuote($quoteId: Uuid!) {
|
||||
evo_kasko_payer
|
||||
evo_promotion
|
||||
evo_sale_without_nds
|
||||
link
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@ -33,8 +33,8 @@
|
||||
"react-dom": "^18.2.0",
|
||||
"styled-components": "^5.3.11",
|
||||
"superjson": "^2.2.1",
|
||||
"tools": "*",
|
||||
"ui": "*",
|
||||
"tools": "workspace:*",
|
||||
"ui": "workspace:*",
|
||||
"use-debounce": "^9.0.4",
|
||||
"zod": "^3.22.4"
|
||||
},
|
||||
@ -43,6 +43,7 @@
|
||||
"@graphql-codegen/typed-document-node": "^5.0.1",
|
||||
"@graphql-codegen/typescript": "^4.0.1",
|
||||
"@graphql-codegen/typescript-operations": "^4.0.1",
|
||||
"@graphql-typed-document-node/core": "^3.2.0",
|
||||
"@graphql-typed-document-node/patch-cli": "^3.0.9",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
@ -50,15 +51,15 @@
|
||||
"@types/react": "^18.2.14",
|
||||
"@types/react-dom": "^18.2.6",
|
||||
"@types/styled-components": "^5.1.26",
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.1",
|
||||
"eslint": "^8.46.0",
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.6",
|
||||
"antd": "^5.14.2",
|
||||
"eslint": "^8.52.0",
|
||||
"gql-sdl": "^1.0.0",
|
||||
"jest": "^29.4.3",
|
||||
"jest-environment-jsdom": "^29.3.1",
|
||||
"msw": "^1.1.0",
|
||||
"ts-jest": "^29.0.5",
|
||||
"tsconfig": "*",
|
||||
"typescript": "^4.9.5"
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"msw": {
|
||||
"workerDirectory": "public"
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import 'normalize.css';
|
||||
import '../styles/fonts.css';
|
||||
import '../styles/globals.css';
|
||||
import '../styles/antd-fix.css';
|
||||
import initializeQueryClient from '@/api/client';
|
||||
import initializeApollo from '@/apollo/client';
|
||||
import { Notification } from '@/Components/Common/Notification';
|
||||
|
||||
@ -1,17 +1,31 @@
|
||||
/* eslint-disable no-negated-condition */
|
||||
import type { Elements } from '@/Components/Calculation/config/map/values';
|
||||
import * as CRMTypes from '@/graphql/crm.types';
|
||||
import type { ProcessContext } from '@/process/types';
|
||||
import type { DocumentNode } from '@apollo/client';
|
||||
import { gql } from '@apollo/client';
|
||||
import { reaction } from 'mobx';
|
||||
|
||||
type LinkReactionParams = {
|
||||
elementName: Elements;
|
||||
entityName: string;
|
||||
linkElementName: Elements;
|
||||
query: DocumentNode;
|
||||
variableName: string;
|
||||
};
|
||||
|
||||
export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
const { $calculation } = store;
|
||||
|
||||
/**
|
||||
* При выборе Интереса, ЛС и Предложения скачиваем ссылку CRM
|
||||
*/
|
||||
function makeLinkReaction(elementName: Elements, linkElementName: Elements, query: DocumentNode) {
|
||||
function makeLinkReaction({
|
||||
elementName,
|
||||
linkElementName,
|
||||
query,
|
||||
variableName,
|
||||
entityName,
|
||||
}: LinkReactionParams) {
|
||||
reaction(
|
||||
() => $calculation.element(elementName).getValue(),
|
||||
(id) => {
|
||||
@ -29,13 +43,13 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
.query({
|
||||
query,
|
||||
variables: {
|
||||
id,
|
||||
[variableName]: id,
|
||||
},
|
||||
})
|
||||
.then(({ data }) => {
|
||||
clearTimeout(timeoutId);
|
||||
if (data.entity?.link) {
|
||||
$calculation.element(linkElementName).setValue(data.entity?.link);
|
||||
if (data[entityName]?.link) {
|
||||
$calculation.element(linkElementName).setValue(data[entityName]?.link);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
@ -56,30 +70,27 @@ export default function reactions({ store, apolloClient }: ProcessContext) {
|
||||
);
|
||||
}
|
||||
|
||||
const QUERY_GET_LEAD_URL = gql`
|
||||
query GetLeadUrl($id: Uuid!) {
|
||||
entity: lead(leadid: $id) {
|
||||
link
|
||||
}
|
||||
}
|
||||
`;
|
||||
makeLinkReaction('selectLead', 'linkLeadUrl', QUERY_GET_LEAD_URL);
|
||||
makeLinkReaction({
|
||||
elementName: 'selectLead',
|
||||
entityName: 'lead',
|
||||
linkElementName: 'linkLeadUrl',
|
||||
query: CRMTypes.GetLeadDocument,
|
||||
variableName: 'leadid',
|
||||
});
|
||||
|
||||
const QUERY_GET_OPPORTUNITY_URL = gql`
|
||||
query GetOpportunityUrl($id: Uuid!) {
|
||||
entity: opportunity(opportunityid: $id) {
|
||||
link
|
||||
}
|
||||
}
|
||||
`;
|
||||
makeLinkReaction('selectOpportunity', 'linkOpportunityUrl', QUERY_GET_OPPORTUNITY_URL);
|
||||
makeLinkReaction({
|
||||
elementName: 'selectOpportunity',
|
||||
entityName: 'opportunity',
|
||||
linkElementName: 'linkOpportunityUrl',
|
||||
query: CRMTypes.GetOpportunityDocument,
|
||||
variableName: 'opportunityid',
|
||||
});
|
||||
|
||||
const QUERY_GET_QUOTE_URL = gql`
|
||||
query GetQuoteUrl($id: Uuid!) {
|
||||
entity: quote(quoteId: $id) {
|
||||
link
|
||||
}
|
||||
}
|
||||
`;
|
||||
makeLinkReaction('selectQuote', 'linkQuoteUrl', QUERY_GET_QUOTE_URL);
|
||||
makeLinkReaction({
|
||||
elementName: 'selectQuote',
|
||||
entityName: 'quote',
|
||||
linkElementName: 'linkQuoteUrl',
|
||||
query: CRMTypes.GetQuoteDocument,
|
||||
variableName: 'quoteId',
|
||||
});
|
||||
}
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
const { downloadSchema, generateTypescript } = require('./lib/graphql');
|
||||
const { downloadSchema } = require('./lib/graphql');
|
||||
|
||||
downloadSchema();
|
||||
generateTypescript();
|
||||
|
||||
4
apps/web/styles/antd-fix.css
Normal file
4
apps/web/styles/antd-fix.css
Normal file
@ -0,0 +1,4 @@
|
||||
/* fix antd tables override scroll style */
|
||||
.ant-table {
|
||||
scrollbar-color: unset !important;
|
||||
}
|
||||
@ -1,9 +1,23 @@
|
||||
{
|
||||
"extends": "tsconfig/nextjs.json",
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"files": ["@types/graphql.d.ts"],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
||||
"exclude": ["node_modules"],
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"noEmit": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"incremental": true,
|
||||
"downlevelIteration": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["*"]
|
||||
|
||||
16
package.json
16
package.json
@ -2,10 +2,6 @@
|
||||
"name": "evocalculator.client",
|
||||
"version": "2.0.0",
|
||||
"private": true,
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "dotenv -e .env turbo run build",
|
||||
"clean": "turbo run clean",
|
||||
@ -15,23 +11,19 @@
|
||||
"lint:fix": "dotenv -e .env.local turbo run lint:fix",
|
||||
"test": "dotenv -e .env.local turbo run test",
|
||||
"prepare": "husky install",
|
||||
"precommit": "yarn format && yarn lint:fix && yarn test",
|
||||
"graphql:update": "dotenv -e .env.local node ./scripts/graphql-update.js",
|
||||
"graphql:codegen": "dotenv -e .env.local node ./scripts/graphql-codegen.js"
|
||||
"precommit": "pnpm format && pnpm lint:fix && pnpm test",
|
||||
"graphql:update": "dotenv -e .env.local turbo run graphql:update",
|
||||
"graphql:codegen": "dotenv -e .env.local turbo run graphql:codegen"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"dotenv-cli": "^7.0.0",
|
||||
"husky": "^8.0.3",
|
||||
"lint-staged": "^13.2.0",
|
||||
"prettier": "^2.8.4",
|
||||
"tools": "*",
|
||||
"turbo": "^1.12.4"
|
||||
},
|
||||
"packageManager": "yarn@1.22.17",
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
"node": ">=18.0.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{js,jsx,ts,tsx}": [
|
||||
|
||||
@ -1,11 +1,10 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'@vchikalkin/eslint-config-awesome/typescript/config',
|
||||
'@vchikalkin/eslint-config-awesome/typescript/rules',
|
||||
],
|
||||
const { createConfig } = require('@vchikalkin/eslint-config-awesome');
|
||||
|
||||
module.exports = createConfig('typescript', {
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
};
|
||||
ignorePatterns: ['*.config.js', '.eslintrc.js'],
|
||||
root: true,
|
||||
});
|
||||
|
||||
@ -8,8 +8,8 @@
|
||||
"lint": "TIMING=1 eslint \"**/*.ts*\""
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.1",
|
||||
"eslint": "^8.46.0"
|
||||
},
|
||||
"dependencies": {}
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.6",
|
||||
"eslint": "^8.52.0",
|
||||
"tsconfig": "workspace:*"
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,5 +2,5 @@
|
||||
"extends": "tsconfig/common.json",
|
||||
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx"],
|
||||
"exclude": ["dist", "build", "node_modules"],
|
||||
"compilerOptions": { "outDir": "./build" }
|
||||
"compilerOptions": { "outDir": "./build", "lib": ["DOM", "ES2020"] }
|
||||
}
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
{
|
||||
"$schema": "https://json.schemastore.org/tsconfig",
|
||||
"display": "Next.js",
|
||||
"extends": "./base.json",
|
||||
"compilerOptions": {
|
||||
"target": "ES6",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noEmit": true,
|
||||
"incremental": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "esnext",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve"
|
||||
},
|
||||
"include": ["src", "next-env.d.ts"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
||||
@ -1,15 +1,17 @@
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [
|
||||
'@vchikalkin/eslint-config-awesome/react-typescript/config',
|
||||
'@vchikalkin/eslint-config-awesome/react-typescript/rules',
|
||||
],
|
||||
const { createConfig } = require('@vchikalkin/eslint-config-awesome');
|
||||
|
||||
module.exports = createConfig('react-typescript', {
|
||||
parserOptions: {
|
||||
project: './tsconfig.json',
|
||||
tsconfigRootDir: __dirname,
|
||||
},
|
||||
rules: {
|
||||
'import/no-duplicates': 'off',
|
||||
'react/forbid-component-props': 'off',
|
||||
'import/consistent-type-specifier-style': 'off',
|
||||
'unicorn/filename-case': 'off',
|
||||
'react/jsx-no-bind': 'off',
|
||||
},
|
||||
};
|
||||
ignorePatterns: ['*.config.js', '.eslintrc.js'],
|
||||
root: true,
|
||||
});
|
||||
|
||||
@ -12,18 +12,18 @@
|
||||
"@types/react-dom": "^18.2.6",
|
||||
"@types/rebass": "^4.0.10",
|
||||
"@types/styled-components": "^5.1.26",
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.1",
|
||||
"eslint": "^8.46.0",
|
||||
"@vchikalkin/eslint-config-awesome": "^1.1.6",
|
||||
"eslint": "^8.52.0",
|
||||
"react": "^18.2.0",
|
||||
"tsconfig": "*",
|
||||
"typescript": "^4.9.5"
|
||||
"tsconfig": "workspace:*",
|
||||
"typescript": "^5.3.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design/cssinjs": "^1.10.1",
|
||||
"@ant-design/icons": "^5.1.4",
|
||||
"antd": "^5.6.3",
|
||||
"@ant-design/cssinjs": "^1.18.4",
|
||||
"@ant-design/icons": "^5.3.0",
|
||||
"antd": "^5.14.2",
|
||||
"rebass": "^4.0.7",
|
||||
"styled-components": "^5.3.6",
|
||||
"styled-components": "^5.3.11",
|
||||
"use-debounce": "^9.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
14073
pnpm-lock.yaml
generated
Normal file
14073
pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
3
pnpm-workspace.yaml
Normal file
3
pnpm-workspace.yaml
Normal file
@ -0,0 +1,3 @@
|
||||
packages:
|
||||
- "apps/**"
|
||||
- 'packages/**'
|
||||
@ -1,5 +0,0 @@
|
||||
const run = require('tools/scripts');
|
||||
|
||||
const command = ['yarn', 'workspace', 'web', 'graphql:codegen'].join(' ');
|
||||
|
||||
run(command, '*** Update GraphQL files ***');
|
||||
@ -1,5 +0,0 @@
|
||||
const run = require('tools/scripts');
|
||||
|
||||
const command = ['yarn', 'workspace', 'web', 'graphql:update'].join(' ');
|
||||
|
||||
run(command, '*** Update GraphQL files ***');
|
||||
@ -24,6 +24,12 @@
|
||||
},
|
||||
"clean": {
|
||||
"cache": false
|
||||
},
|
||||
"graphql:codegen": {
|
||||
"cache": false
|
||||
},
|
||||
"graphql:update": {
|
||||
"cache": false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user