From db3ec07afbf4844d714706c9e12ddebea96c8278 Mon Sep 17 00:00:00 2001 From: pahaz Date: Sat, 11 May 2024 14:31:00 +0300 Subject: [PATCH] fix(ci): init linter checks --- .github/workflows/ci.build.yml | 1 - .github/workflows/ci.linters.yml | 5 +- .gitignore | 1 - README.md | 30 +++++----- apps/README.md | 4 +- docs/contributing.md | 12 ++-- docs/deploy.md | 2 +- docs/links.md | 8 +-- package.json | 2 + packages/README.md | 4 +- turbo.json | 17 ++++++ yarn.lock | 95 ++++++++++++++++++++++++++++++++ 12 files changed, 146 insertions(+), 35 deletions(-) create mode 100644 turbo.json create mode 100644 yarn.lock diff --git a/.github/workflows/ci.build.yml b/.github/workflows/ci.build.yml index f7e7987..f3afae6 100644 --- a/.github/workflows/ci.build.yml +++ b/.github/workflows/ci.build.yml @@ -24,7 +24,6 @@ jobs: - name: install packages run: | corepack enable - yarn init -2 yarn set version stable yarn install - name: BUILD diff --git a/.github/workflows/ci.linters.yml b/.github/workflows/ci.linters.yml index 1d8c391..4a8ef0f 100644 --- a/.github/workflows/ci.linters.yml +++ b/.github/workflows/ci.linters.yml @@ -24,8 +24,7 @@ jobs: - name: install packages run: | corepack enable - yarn init -2 yarn set version stable yarn install - - name: BUILD - run: yarn lint + - run: yarn format --check + - run: yarn lint diff --git a/.gitignore b/.gitignore index e02d089..8a26530 100644 --- a/.gitignore +++ b/.gitignore @@ -20,7 +20,6 @@ !.yarn/sdks !.yarn/versions yarn-error.log -yarn.lock npm-debug.* # mobile diff --git a/README.md b/README.md index 54dafd6..d41d247 100644 --- a/README.md +++ b/README.md @@ -11,14 +11,14 @@ We use: Prisma, Apollo GraphQL ### Contents -* [Motivation & Features](#why) -* [Getting started](docs/getting-started.md) -* [Deploy](docs/deploy.md) -* [Contributing](docs/contributing.md) +- [Motivation & Features](#why) +- [Getting started](docs/getting-started.md) +- [Deploy](docs/deploy.md) +- [Contributing](docs/contributing.md) ## Why? -When you start a new project, you need a time-tested approach to development. +When you start a new project, you need a time-tested approach to development. You need to prepare the basic structure of the project, implement registration and authorization. If you are making a B2B solution, you need to implement roles and access rights and the possibility of invites. @@ -27,7 +27,7 @@ You need to implement notifications, page templates, and internationalization su Using a template, you don't have to spend hours choosing technologies and gluing them together. -The libraries used can be changed over time. +The libraries used can be changed over time. Don't start by choosing a technology, start implement your key features! @@ -37,15 +37,15 @@ You can use this project if you are going to launch a new startup or participate ## Features -* Auth flow - * Registration - * Authentication and Authorization - * Change password - * Reset password -* Organization entity - * Management of organization members - * Invite users -* Ant design based frontend +- Auth flow + - Registration + - Authentication and Authorization + - Change password + - Reset password +- Organization entity + - Management of organization members + - Invite users +- Ant design based frontend Full list of features and requested features is found under [contributing.md](docs/contributing.md) and issues diff --git a/apps/README.md b/apps/README.md index 6757bac..a3ba5e9 100644 --- a/apps/README.md +++ b/apps/README.md @@ -1,4 +1,4 @@ -All applications are stored here. +All applications are stored here. -You can use a microservice approach or a traditional monolith approach. +You can use a microservice approach or a traditional monolith approach. But we strongly recommend separating your API from the front-end application. diff --git a/docs/contributing.md b/docs/contributing.md index 084a72d..63892d3 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -9,17 +9,17 @@ **Available CLI-commands:** - - `yarn lint` lint whole project <- this command runs on CI +- `yarn lint` lint whole project <- this command runs on CI # Project features and feature requests. - [x] Monorepo: packages and apps -- [x] Monorepo: requirements tree : /packages/* and /apps/* depends on /package.json +- [x] Monorepo: requirements tree : /packages/\* and /apps/\* depends on /package.json - [x] Monorepo: reusable UI package example - [ ] Monorepo: docs how to add app or package -- [x] TypeScript support -- [x] NextJs: init with SSR (app router) + the latest React -- [x] Antd: init Ant Design support with custom theme +- [ ] TypeScript support +- [ ] NextJs: init with SSR (app router) + the latest React +- [ ] Antd: init Ant Design support with custom theme - [ ] CI: run tests - [ ] CI: test build - [ ] CI: linters @@ -72,4 +72,4 @@ - [ ] Bull: scheduled tasks - [ ] Logging - [ ] DX: command to add new API Schema -- [ ] DX: command to add new Web and Api app +- [ ] DX: command to add new Web and Api app diff --git a/docs/deploy.md b/docs/deploy.md index b2ecf7d..c01ea79 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -1,3 +1,3 @@ # Deploy -TODO \ No newline at end of file +TODO diff --git a/docs/links.md b/docs/links.md index 541ceed..305123e 100644 --- a/docs/links.md +++ b/docs/links.md @@ -1,6 +1,6 @@ # Learn -0. You should have a [basic knowledge](https://htmlacademy.org/courses/html-css-basics/intro/html) about [HTML/CSS](https://www.internetingishard.com/html-and-css/) +0. You should have a [basic knowledge](https://htmlacademy.org/courses/html-css-basics/intro/html) about [HTML/CSS](https://www.internetingishard.com/html-and-css/) 1. You should know [Modern JavaScript](https://javascript.info/) 2. You should know [GraphQL](https://graphql.org/) @@ -23,6 +23,6 @@ # Philosophy - 1) BACKEND: You write domain models and services on backend side (it's better if each service have only one action) - 2) TESTS: TDD is matter! Tests should work parallel and independently! You should write tests in mind of extensibility (you don't need to rewrite the test if you add extra fields). You can run tests on a remote production API by URL or local development server! - 3) STYLE: You should follow the common style or change the whole style everywhere (not only in your files) +1. BACKEND: You write domain models and services on backend side (it's better if each service have only one action) +2. TESTS: TDD is matter! Tests should work parallel and independently! You should write tests in mind of extensibility (you don't need to rewrite the test if you add extra fields). You can run tests on a remote production API by URL or local development server! +3. STYLE: You should follow the common style or change the whole style everywhere (not only in your files) diff --git a/package.json b/package.json index db14194..d1b8216 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,12 @@ "scripts": { "build": "turbo build", "dev": "turbo dev", + "start": "turbo start", "lint": "turbo lint", "format": "prettier --write \"**/*.{ts,tsx,md}\"" }, "devDependencies": { + "prettier": "^3.2.5", "turbo": "^1.13.3" }, "dependencies": { diff --git a/packages/README.md b/packages/README.md index b46c247..39a566a 100644 --- a/packages/README.md +++ b/packages/README.md @@ -1,4 +1,4 @@ -The internal packages are stored here. +The internal packages are stored here. -These can be UI libraries or auxiliary utilities. +These can be UI libraries or auxiliary utilities. Everything that can be published in NPM, but is used inside the apps. diff --git a/turbo.json b/turbo.json new file mode 100644 index 0000000..781f274 --- /dev/null +++ b/turbo.json @@ -0,0 +1,17 @@ +{ + "$schema": "https://turbo.build/schema.json", + "globalDependencies": ["**/.env.*local"], + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": [".next/**", "!.next/cache/**"] + }, + "lint": { + "dependsOn": ["^lint"] + }, + "dev": { + "cache": false, + "persistent": true + } + } +} diff --git a/yarn.lock b/yarn.lock new file mode 100644 index 0000000..67eca34 --- /dev/null +++ b/yarn.lock @@ -0,0 +1,95 @@ +# This file is generated by running "yarn install" inside your project. +# Manual changes might be lost - proceed with caution! + +__metadata: + version: 8 + cacheKey: 10c0 + +"prettier@npm:^3.2.5": + version: 3.2.5 + resolution: "prettier@npm:3.2.5" + bin: + prettier: bin/prettier.cjs + checksum: 10c0/ea327f37a7d46f2324a34ad35292af2ad4c4c3c3355da07313339d7e554320f66f65f91e856add8530157a733c6c4a897dc41b577056be5c24c40f739f5ee8c6 + languageName: node + linkType: hard + +"start-up-kit@workspace:.": + version: 0.0.0-use.local + resolution: "start-up-kit@workspace:." + dependencies: + prettier: "npm:^3.2.5" + turbo: "npm:^1.13.3" + languageName: unknown + linkType: soft + +"turbo-darwin-64@npm:1.13.3": + version: 1.13.3 + resolution: "turbo-darwin-64@npm:1.13.3" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"turbo-darwin-arm64@npm:1.13.3": + version: 1.13.3 + resolution: "turbo-darwin-arm64@npm:1.13.3" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"turbo-linux-64@npm:1.13.3": + version: 1.13.3 + resolution: "turbo-linux-64@npm:1.13.3" + conditions: os=linux & cpu=x64 + languageName: node + linkType: hard + +"turbo-linux-arm64@npm:1.13.3": + version: 1.13.3 + resolution: "turbo-linux-arm64@npm:1.13.3" + conditions: os=linux & cpu=arm64 + languageName: node + linkType: hard + +"turbo-windows-64@npm:1.13.3": + version: 1.13.3 + resolution: "turbo-windows-64@npm:1.13.3" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + +"turbo-windows-arm64@npm:1.13.3": + version: 1.13.3 + resolution: "turbo-windows-arm64@npm:1.13.3" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"turbo@npm:^1.13.3": + version: 1.13.3 + resolution: "turbo@npm:1.13.3" + dependencies: + turbo-darwin-64: "npm:1.13.3" + turbo-darwin-arm64: "npm:1.13.3" + turbo-linux-64: "npm:1.13.3" + turbo-linux-arm64: "npm:1.13.3" + turbo-windows-64: "npm:1.13.3" + turbo-windows-arm64: "npm:1.13.3" + dependenciesMeta: + turbo-darwin-64: + optional: true + turbo-darwin-arm64: + optional: true + turbo-linux-64: + optional: true + turbo-linux-arm64: + optional: true + turbo-windows-64: + optional: true + turbo-windows-arm64: + optional: true + bin: + turbo: bin/turbo + checksum: 10c0/0382cc88f65a6690e97d30a6ad5d9b9ede7705f5f57edea27629408b166eff4a5938824746ce2cbcd50d2b64ebdbd359160e2cbe009f0bfd6f144997f9f6705b + languageName: node + linkType: hard