Skip to content

Commit

Permalink
BREAKING CHANGES: ORM, DI Container and Database (#1)
Browse files Browse the repository at this point in the history
* refactor: prisma to drizzle and mariadb to postgres

* refactor: completely migrate to drizzle

* refactor: completely migrate to drizzle

* refactor: code quality set up

* refactor: add use case classes and change di container to awilix

* ci: use pnpm instead npm
  • Loading branch information
arahiko-ayami authored Feb 5, 2024
1 parent afd8c70 commit 74e2c25
Show file tree
Hide file tree
Showing 72 changed files with 9,873 additions and 16,472 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ end_of_line = lf
tab_width = 2
insert_final_newline = true
indent_style = space
tab_width = 2
editor.formatOnSave = true

62 changes: 34 additions & 28 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
module.exports = {
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"plugin:prettier/recommended",
],
parser: "@typescript-eslint/parser",
plugins: ["prettier", "@typescript-eslint"],
rules: {
"prettier/prettier": [
"error",
{
singleQuote: true,
},
],
},
ignorePatterns: [
"*.js",
"*.cjs",
"package.json",
"package-lock.json",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"dist",
".sst",
"/**/node_modules/*",
"*.d.ts",
],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'prettier',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
plugins: ['prettier', '@typescript-eslint'],
rules: {
'prettier/prettier': [
'error',
{
singleQuote: true,
trailingComma: 'all',
tabWidth: 2,
insertPragma: false,
endOfLine: 'lf',
emptyLines: true,
useTabs: false,
},
],
},
ignorePatterns: [
'*.js',
'*.cjs',
'package.json',
'package-lock.json',
'pnpm-lock.yaml',
'pnpm-workspace.yaml',
'dist',
'.sst',
'/**/node_modules/*',
'*.d.ts',
],
};
33 changes: 27 additions & 6 deletions .github/workflows/prod-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,39 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false

- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: npm ci
run: pnpm i --frozen-lockfile

- name: Lint
run: npm run lint
run: pnpm lint && pnpm typecheck

# https://stackoverflow.com/questions/68119012/create-env-file-in-gh-action-using-repo-secrets
- name: Apply all pending migrations to the database
# redirect output to /dev/null to hide any sensitive information
run: npx prisma migrate deploy > /dev/null
run: |
echo $DB_URL > .env
pnpm db:migrate
working-directory: packages/core

- name: Deploy
run: npx sst deploy --stage prod
run: pnpm sst deploy --stage prod

Loading

0 comments on commit 74e2c25

Please sign in to comment.