Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

development to production #132

Merged
merged 36 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b619c65
Merge pull request #121 from BinaryStudioAcademy/production
v0ldemar01 Jan 7, 2024
5706b79
thjs-122: * prepare packages/shared workspace
v0ldemar01 Jun 6, 2024
1046a47
thjs-122: * prepare packages/backend workspace
v0ldemar01 Jun 8, 2024
4e8985b
thjs-122: * prepare packages/frontend workspace
v0ldemar01 Jun 9, 2024
1b49833
thjs-122: * eslint configuration for packages/shared workspace
v0ldemar01 Jun 9, 2024
0e35917
thjs-122: * eslint configuration for apps/backend workspace
v0ldemar01 Jun 10, 2024
fb6f980
thjs-122: * eslint configuration for apps/frontend workspace
v0ldemar01 Jun 10, 2024
388f308
thjs-122: * prettier configuration for workspaces
v0ldemar01 Jun 10, 2024
c69e61d
thjs-122: * stylelint configuration for workspaces
v0ldemar01 Jun 10, 2024
3236ea6
thjs-122: * knip configuration for workspaces
v0ldemar01 Jun 10, 2024
e4f4ad5
thjs-122: * lint staged configuration for workspaces
v0ldemar01 Jun 10, 2024
a846666
thjs-122: * ls-lint configuration for workspaces
v0ldemar01 Jun 10, 2024
f1003bc
thjs-122: * fix vs-code eslint configuration for workspaces
v0ldemar01 Jun 10, 2024
1ea0300
thjs-122: * stylelint configuration for workspaces
v0ldemar01 Jun 10, 2024
ef17c70
thjs-124: * upgrade nodejs with 20 lts version with npm package updates
v0ldemar01 Jun 10, 2024
9e2864a
thjs-122: - useless test config
v0ldemar01 Jun 10, 2024
1a91663
thjs-124: + package for backend start:dev script
v0ldemar01 Jun 10, 2024
02a463b
thjs-124: * ignore ts-paths-esm-loader package as a part of migration…
v0ldemar01 Jun 10, 2024
e477eab
Merge branch 'task/thjs-122-setup-project-base-starter' of https://gi…
v0ldemar01 Jun 10, 2024
4c40689
thjs-122: * application module structure changes
v0ldemar01 Jun 10, 2024
4e5bbe7
thjs-122: * fix ci lint trash
v0ldemar01 Jun 10, 2024
dcc3faa
thjs-122: * commitlint config
v0ldemar01 Jun 10, 2024
5d513fe
thjs-122: * fix ci linting commitlint config
v0ldemar01 Jun 10, 2024
2911b7e
thjs-122: * fix ci linting prettier config
v0ldemar01 Jun 10, 2024
2b94309
Merge pull request #126 from BinaryStudioAcademy/task/thjs-122-setup-…
v0ldemar01 Jun 10, 2024
5f4896e
Merge branch 'development' of https://github.com/BinaryStudioAcademy/…
v0ldemar01 Jun 10, 2024
cdfe19f
thjs-124: * fix typescript build
v0ldemar01 Jun 11, 2024
48d91f6
Merge pull request #127 from BinaryStudioAcademy/task/thjs-124-upgrad…
v0ldemar01 Jun 11, 2024
696b712
feat: add new development flow thjs-123
v0ldemar01 Jun 11, 2024
a5af7f3
fix: dangerfile configuration import thjs-123
v0ldemar01 Jun 11, 2024
02c7e6f
Merge pull request #128 from BinaryStudioAcademy/123-feat-integrate-n…
v0ldemar01 Jun 11, 2024
2c25736
feat: new readme content thjs-129
v0ldemar01 Jun 11, 2024
bb4513c
Merge pull request #130 from BinaryStudioAcademy/129-feat-update-read…
v0ldemar01 Jun 11, 2024
d18dc06
fix: typo into readme content thjs-129
v0ldemar01 Jun 11, 2024
a91457e
feat: additional dev content into readme thjs-129
v0ldemar01 Jun 11, 2024
efbf613
Merge pull request #131 from BinaryStudioAcademy/129-feat-update-read…
v0ldemar01 Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

[*.md]
indent_size = unset
indent_style = space
149 changes: 0 additions & 149 deletions .eslintrc.yml

This file was deleted.

6 changes: 0 additions & 6 deletions .lintstagedrc.yml

This file was deleted.

14 changes: 6 additions & 8 deletions .ls-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ ls:
ignore:
- .git
- node_modules
- build
- shared/build
- shared/node_modules
- client/build
- client/node_modules
- server/build
- server/node_modules
- .idea
- packages/shared/build
- packages/shared/node_modules
- apps/frontend/build
- apps/frontend/node_modules
- apps/backend/build
- apps/backend/node_modules
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18
20.11
13 changes: 0 additions & 13 deletions .prettierrc.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .stylelintrc.yml

This file was deleted.

11 changes: 0 additions & 11 deletions server/.env.example → apps/backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,3 @@ DB_CLIENT=pg
DB_POOL_MIN=1
DB_POOL_MAX=10

#
# AUTHENTICATION
#
# SECRET_KEY has to be changed to own random secret key
SECRET_KEY=secretkeysecretkeysecretkey

# Image Storage
#
# GYAZO_ACCESS_TOKEN - has to be changed to a real key from Gyazo
GYAZO_UPLOAD_API_URL=https://upload.gyazo.com/api/upload
GYAZO_ACCESS_TOKEN=gyazoaccesstoken
54 changes: 54 additions & 0 deletions apps/backend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import baseConfig from '../../eslint.config.js';

/** @typedef {import("eslint").Linter.FlatConfig} */
let FlatConfig;

/** @type {FlatConfig} */
const ignoresConfig = {
ignores: ['build']
};

/** @type {FlatConfig[]} */
const overridesConfigs = [
{
files: ['knexfile.ts'],
rules: {
'import/no-default-export': ['off']
}
},
{
files: ['jest.config.js'],
rules: {
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/no-magic-numbers': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'import/no-default-export': ['off']
}
},
{
files: ['src/db/migrations/**/*.ts'],
rules: {
'unicorn/filename-case': [
'error',
{
case: 'snakeCase'
}
]
}
},
{
files: ['src/libs/modules/controller/controller.module.ts'],
rules: {
'@typescript-eslint/no-magic-numbers': ['off']
}
}
];

/** @type {FlatConfig[]} */
const config = [...baseConfig, ignoresConfig, ...overridesConfigs];

export default config;
13 changes: 6 additions & 7 deletions server/jest.config.js → apps/backend/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
import { join } from 'node:path';
import { fileURLToPath } from 'node:url';

import { pathsToModuleNameMapper } from 'ts-jest';

import tsconfigJson from './tsconfig.json' assert { type: 'json' };

const sourcePath = join(fileURLToPath(import.meta.url), '../');

const manageKey = key => {
return key.includes('(.*)') ? key.slice(0, -1) + '\\.js$' : key;
return key.includes('(.*)') ? key.slice(0, -1) + String.raw`\.js$` : key;
};

const manageMapper = mapper => ({
Expand All @@ -19,19 +18,19 @@ const manageMapper = mapper => ({
});

export default {
testEnvironment: 'jest-environment-node',
preset: 'ts-jest/presets/default-esm',
extensionsToTreatAsEsm: ['.ts'],
transformIgnorePatterns: ['node_modules/'],
testPathIgnorePatterns: ['node_modules/', 'dist/', 'build/'],
moduleNameMapper: manageMapper(
pathsToModuleNameMapper(tsconfigJson.compilerOptions.paths, {
prefix: sourcePath
})
),
preset: 'ts-jest/presets/default-esm',
testEnvironment: 'jest-environment-node',
testPathIgnorePatterns: ['node_modules/', 'dist/', 'build/'],
testTimeout: 10_000,
transform: {
'^.+\\.tsx?$': ['ts-jest', { useESM: true }]
},
testTimeout: 10_000,
transformIgnorePatterns: ['node_modules/'],
workerIdleMemoryLimit: '1GB'
};
3 changes: 3 additions & 0 deletions apps/backend/knexfile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { database } from '~/libs/modules/database/database.js';

export default database.environmentsConfig;
12 changes: 12 additions & 0 deletions apps/backend/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { default as baseConfig } from '../../lint-staged.config.js';

/** @type {import('lint-staged').Config} */
const config = {
...baseConfig,
'**/*.ts': [
() => 'npm run lint:js -w apps/backend',
() => 'npm run lint:type -w apps/backend'
]
};

export default config;
53 changes: 53 additions & 0 deletions apps/backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"name": "@thread-js/backend",
"private": true,
"engines": {
"node": "20.11.x",
"npm": "10.2.x"
},
"type": "module",
"scripts": {
"knex": "cross-env NODE_OPTIONS=\"--loader ts-paths-esm-loader\" knex",
"migrate:dev": "npm run knex migrate:latest",
"migrate:dev:make": "npm run knex migrate:make -- -x ts",
"migrate:dev:down": "npm run knex migrate:down",
"migrate:dev:rollback": "npm run knex migrate:rollback -- --all",
"migrate:dev:unlock": "npm run knex migrate:unlock",
"migrate:dev:reset": "npm run migrate:dev:rollback && npm run migrate:dev",
"seed:run": "npm run knex seed:run",
"start:dev": "tsx watch ./src/index.ts",
"lint:type": "npx tsc --noEmit",
"lint:js": "npx eslint . --max-warnings=0",
"lint": "concurrently \"npm:lint:*\"",
"build": "tsc && tsc-alias",
"pretest": "cross-env NODE_ENV=test npm run migrate:dev",
"test": "cross-env NODE_ENV=test node --experimental-vm-modules --expose-gc --no-compilation-cache ../../node_modules/jest/bin/jest.js --config jest.config.js --runInBand --forceExit --detectOpenHandles",
"test:auth": "npm run test -- --verbose --rootDir=tests/modules/auth/"
},
"dependencies": {
"@fastify/static": "7.0.4",
"@thread-js/shared": "*",
"convict": "6.2.4",
"dotenv": "16.4.5",
"fastify": "4.27.0",
"knex": "3.1.0",
"objection": "3.1.4",
"pg": "8.12.0",
"pino": "9.1.0",
"qs": "6.12.1"
},
"devDependencies": {
"@faker-js/faker": "8.4.1",
"@jest/globals": "29.7.0",
"@types/convict": "6.1.6",
"@types/jest": "29.5.12",
"@types/pg": "8.11.6",
"@types/qs": "6.9.15",
"cross-env": "7.0.3",
"jest": "29.7.0",
"pino-pretty": "11.2.0",
"ts-jest": "29.1.4",
"ts-paths-esm-loader": "1.4.3",
"tsx": "4.15.1"
}
}
Loading
Loading