Skip to content

Commit 4eda834

Browse files
authored
Merge pull request #9 from nitic-pbl-p8/4/auth
愚か PR
2 parents 2279bf3 + ae520d6 commit 4eda834

File tree

412 files changed

+16622
-4993
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

412 files changed

+16622
-4993
lines changed

.devcontainer/devcontainer.json

+2
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
"mikestead.dotenv",
2929
"ms-ossdata.vscode-postgresql",
3030
"orta.vscode-jest",
31+
"prisma.prisma",
32+
"Prettier-SQL.SQLFlavourOverride",
3133
"stylelint.vscode-stylelint",
3234
"usernamehw.errorlens",
3335
"vincaslt.highlight-matching-tag",

.github/workflows/app-test.yaml

+9-163
Original file line numberDiff line numberDiff line change
@@ -28,164 +28,6 @@ jobs:
2828
token: ${{ github.token }}
2929
filters: .github/filter.yaml
3030

31-
install:
32-
runs-on: ubuntu-latest
33-
needs: filter
34-
if: needs.filter.outputs.app == 'true'
35-
outputs:
36-
STORE_PATH: ${{ steps.pnpm-env.outputs.STORE_PATH }}
37-
steps:
38-
- name: checkout
39-
uses: actions/checkout@v4
40-
41-
- name: setup node
42-
uses: actions/setup-node@v3
43-
with:
44-
node-version-file: "package.json"
45-
46-
- name: setup pnpm
47-
uses: pnpm/action-setup@v2
48-
with:
49-
run_install: false
50-
51-
- name: setup pnpm environment variable
52-
id: pnpm-env
53-
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
54-
55-
- name: cache pnpm dependencies
56-
uses: actions/cache@v3
57-
with:
58-
path: ${{ steps.pnpm-env.outputs.STORE_PATH }}
59-
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
60-
restore-keys: ${{ runner.os }}-pnpm-dependencies-
61-
62-
- name: install dependencies
63-
run: pnpm install --frozen-lockfile
64-
65-
format:
66-
runs-on: ubuntu-latest
67-
needs: install
68-
steps:
69-
- name: checkout
70-
uses: actions/checkout@v4
71-
72-
- name: setup node
73-
uses: actions/setup-node@v3
74-
with:
75-
node-version-file: "package.json"
76-
77-
- name: setup pnpm
78-
uses: pnpm/action-setup@v2
79-
id: pnpm-install
80-
with:
81-
run_install: false
82-
83-
- name: restore pnpm dependencies
84-
uses: actions/cache/restore@v3
85-
with:
86-
path: ${{ needs.install.outputs.STORE_PATH }}
87-
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
88-
restore-keys: ${{ runner.os }}-pnpm-dependencies-
89-
90-
- name: install dependencies
91-
run: pnpm install --frozen-lockfile
92-
93-
- name: format
94-
run: pnpm turbo run fmt
95-
96-
lint:
97-
runs-on: ubuntu-latest
98-
needs: install
99-
steps:
100-
- name: checkout
101-
uses: actions/checkout@v4
102-
103-
- name: setup node
104-
uses: actions/setup-node@v3
105-
with:
106-
node-version-file: "package.json"
107-
108-
- name: setup pnpm
109-
uses: pnpm/action-setup@v2
110-
id: pnpm-install
111-
with:
112-
run_install: false
113-
114-
- name: restore pnpm dependencies
115-
uses: actions/cache/restore@v3
116-
with:
117-
path: ${{ needs.install.outputs.STORE_PATH }}
118-
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
119-
restore-keys: ${{ runner.os }}-pnpm-dependencies-
120-
121-
- name: install
122-
run: pnpm install --frozen-lockfile
123-
124-
- name: lint
125-
run: pnpm turbo run lint -- --max-warnings=0
126-
127-
style-lint:
128-
runs-on: ubuntu-latest
129-
needs: install
130-
steps:
131-
- name: checkout
132-
uses: actions/checkout@v4
133-
134-
- name: setup node
135-
uses: actions/setup-node@v3
136-
with:
137-
node-version-file: "package.json"
138-
139-
- name: setup pnpm
140-
uses: pnpm/action-setup@v2
141-
id: pnpm-install
142-
with:
143-
run_install: false
144-
145-
- name: restore pnpm dependencies
146-
uses: actions/cache/restore@v3
147-
with:
148-
path: ${{ needs.install.outputs.STORE_PATH }}
149-
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
150-
restore-keys: ${{ runner.os }}-pnpm-dependencies-
151-
152-
- name: install dependencies
153-
run: pnpm install --frozen-lockfile
154-
155-
- name: lint styles
156-
run: pnpm turbo run style -- --max-warnings=0
157-
158-
build:
159-
runs-on: ubuntu-latest
160-
needs: install
161-
steps:
162-
- name: checkout
163-
uses: actions/checkout@v4
164-
165-
- name: setup node
166-
uses: actions/setup-node@v3
167-
with:
168-
node-version-file: "package.json"
169-
170-
- name: setup pnpm
171-
uses: pnpm/action-setup@v2
172-
id: pnpm-install
173-
with:
174-
run_install: false
175-
176-
- name: restore pnpm dependencies
177-
uses: actions/cache/restore@v3
178-
with:
179-
path: ${{ needs.install.outputs.STORE_PATH }}
180-
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
181-
restore-keys: ${{ runner.os }}-pnpm-dependencies-
182-
183-
- name: install dependencies
184-
run: pnpm install --frozen-lockfile
185-
186-
- name: build
187-
run: pnpm turbo run build
188-
18931
test:
19032
runs-on: ubuntu-latest
19133
env:
@@ -194,7 +36,7 @@ jobs:
19436
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET }}
19537
SUPABASE_AUTH_EXTERNAL_GOOGLE_URL: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_URL }}
19638
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
197-
needs: [install, build]
39+
needs: filter
19840
steps:
19941
- name: checkout
20042
uses: actions/checkout@v4
@@ -215,10 +57,14 @@ jobs:
21557
with:
21658
run_install: false
21759

218-
- name: restore pnpm dependencies
219-
uses: actions/cache/restore@v3
60+
- name: setup pnpm environment variable
61+
id: pnpm-env
62+
run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
63+
64+
- name: cache pnpm dependencies
65+
uses: actions/cache@v3
22066
with:
221-
path: ${{ needs.install.outputs.STORE_PATH }}
67+
path: ${{ steps.pnpm-env.outputs.STORE_PATH }}
22268
key: ${{ runner.os }}-pnpm-dependencies-${{ hashFiles('**/pnpm-lock.yaml') }}
22369
restore-keys: ${{ runner.os }}-pnpm-dependencies-
22470

@@ -233,7 +79,7 @@ jobs:
23379

23480
app-test-check:
23581
runs-on: ubuntu-latest
236-
needs: [format, lint, style-lint, build, test]
82+
needs: test
23783
if: ${{ ! failure() }}
23884
steps:
23985
- name: check

.github/workflows/catalog-deploy-chromatic.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
workingDir: apps/catalog/
7373
buildScriptName: sb:build
7474

75-
app-test-check:
75+
catalog-deploy-chromatic-check:
7676
runs-on: ubuntu-latest
7777
needs: deploy-chromatic
7878
if: ${{ ! failure() }}

.github/workflows/db-commit-migration.yaml .github/workflows/db-push-migration.yaml

+17-35
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
name: db commit migration
1+
name: db push migration
22

3-
on: push
3+
on:
4+
push:
5+
branches:
6+
- main
47

58
env:
69
DATABASE_URL: postgresql://postgres:postgres@localhost:54322/postgres
@@ -31,13 +34,12 @@ jobs:
3134
token: ${{ github.token }}
3235
filters: .github/filter.yaml
3336

34-
commit:
37+
push:
3538
runs-on: ubuntu-latest
3639
env:
3740
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_ACCESS_TOKEN }}
3841
SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_CLIENT_ID }}
3942
SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_SECRET }}
40-
SUPABASE_AUTH_EXTERNAL_GOOGLE_URL: ${{ secrets.SUPABASE_AUTH_EXTERNAL_GOOGLE_URL }}
4143
SUPABASE_DB_PASSWORD: ${{ secrets.SUPABASE_DB_PASSWORD }}
4244
needs: filter
4345
if: needs.filter.outputs.db == 'true'
@@ -82,38 +84,18 @@ jobs:
8284
- name: authenticate to supabase
8385
run: pnpm supabase link --project-ref ${{ secrets.SUPABASE_REFERENCE_ID }}
8486

85-
- name: update migration file
86-
run: echo y | (pnpm supabase db pull --schema public && pnpm supabase migration squash)
87-
continue-on-error: true
88-
89-
- name: commit migration file update
90-
run: |
91-
git config --global user.name "github-actions[bot]"
92-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
93-
if git diff --name-only --diff-filter=D | grep -q "supabase/migrations/.*_remote_schema.sql"; then \
94-
git add $(git diff --name-only --diff-filter=D); \
95-
OLD_VERSION=$(git diff --name-only --diff-filter=D --staged | grep "supabase/migrations/.*_remote_schema.sql" | cut -d/ -f3 | cut -d_ -f1); \
96-
git add supabase/migrations/*_remote_schema.sql -N; \
97-
NEW_VERSION=$(git diff --name-only --diff-filter=A | grep "supabase/migrations/.*_remote_schema.sql" | cut -d/ -f3 | cut -d_ -f1); \
98-
pnpm supabase migration repair ${OLD_VERSION} --status reverted; \
99-
pnpm supabase migration repair ${NEW_VERSION} --status reverted; \
100-
pnpm supabase migration repair ${NEW_VERSION} --status applied; \
101-
git add supabase/migrations/*_remote_schema.sql; \
102-
git commit -m "actions: 🤖 (supabase) updated migration file"; \
103-
git push origin HEAD:${GITHUB_REF} --force; \
104-
echo "Committed changes to migration history"; \
105-
elif ls "./supabase/migrations" | grep ".*_remote_schema.sql"; then \
106-
git add supabase/migrations/*_remote_schema.sql; \
107-
git commit -m "actions: 🤖 (supabase) created migration file"; \
108-
git push origin HEAD:${GITHUB_REF} --force; \
109-
echo "Committed changes to migration history"; \
110-
else \
111-
echo "No changes detected in migration history"; \
112-
fi
113-
114-
db-commit-migration-check:
87+
- name: start local supabase
88+
run: pnpm supabase start
89+
90+
- name: lint local db
91+
run: pnpm supabase db lint
92+
93+
- name: deploy migration file to remote db
94+
run: pnpm supabase db push
95+
96+
db-push-migration-check:
11597
runs-on: ubuntu-latest
116-
needs: commit
98+
needs: push
11799
if: ${{ ! failure() }}
118100
steps:
119101
- name: check

.github/workflows/graphql-deploy-apollo-studio.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
- name: publish graphs
7272
run: pnpm api apollo:rover
7373

74-
app-test-check:
74+
graphql-deploy-apollo-check:
7575
runs-on: ubuntu-latest
7676
needs: deploy-apollo-studio
7777
if: ${{ ! failure() }}

.github/workflows/script/graphql-commit-schema.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
if [ "$1" = 1 ]; then
44
pnpm api dev
55
elif [ "$1" = 2 ]; then
6-
sleep 15 && pnpm --filter='@shio/website' gql:introspect
6+
sleep 15 && pnpm --filter='@lockerai/website' gql:introspect
77
fi

.vscode/settings.json

+13-3
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@
161161
"eslint.workingDirectories": [
162162
"apps/api/",
163163
"apps/catalog/",
164+
"apps/locker-dashboard/",
164165
"apps/website/",
165166
"packages/core/",
166167
"packages/design-token/",
@@ -174,9 +175,18 @@
174175
"files.encoding": "utf8",
175176
"files.eol": "\n",
176177
"jest.jestCommandLine": "pnpm all -- test",
177-
"tailwindCSS.classAttributes": ["class", "className"],
178+
"Prettier-SQL.SQLFlavourOverride": "postgresql",
179+
"Prettier-SQL.keywordCase": "upper",
180+
"tailwindCSS.classAttributes": ["class", "className", "classNames"],
178181
"tailwindCSS.experimental.classRegex": [
179182
["tv\\(([^)]*)\\)", "[\"']([^\"']*).*?[\"']"],
180-
["className:.*cn\\(([^)]*)\\)", "[\"']([^\"']*).*?[\"']"]
181-
]
183+
["className:.*cn\\(([^)]*)\\)", "[\"']([^\"']*).*?[\"']"],
184+
["classNames:.*cn\\(([^)]*)\\)", "[\"']([^\"']*).*?[\"']"]
185+
],
186+
"[prisma]": {
187+
"editor.defaultFormatter": "Prisma.prisma"
188+
},
189+
"[sql]": {
190+
"editor.defaultFormatter": "inferrinizzard.prettier-sql-vscode"
191+
}
182192
}

apps/api/.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ coverage/
22
dist/
33
generated/
44
node_modules/
5+
src/infra/drizzle/migrations/meta/

apps/api/drizzle.config.ts

-34
This file was deleted.

0 commit comments

Comments
 (0)