Compare commits
28 Commits
blitz@3.0.
...
research-w
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
debdf73c09 | ||
|
|
0b314f676a | ||
|
|
d6b755c55d | ||
|
|
35037409bd | ||
|
|
9216fcf490 | ||
|
|
da1f9ccc66 | ||
|
|
cea5a3bde3 | ||
|
|
b1a3ed446f | ||
|
|
ecfb545143 | ||
|
|
5db22d1b2b | ||
|
|
5aa4a6fd5f | ||
|
|
2b4fe66c2e | ||
|
|
bb8a943bfd | ||
|
|
aea690007b | ||
|
|
3400483a18 | ||
|
|
7021c3951f | ||
|
|
441568a2dc | ||
|
|
0146f65550 | ||
|
|
1cefce3f81 | ||
|
|
7cc0f530f6 | ||
|
|
74d9b2cd37 | ||
|
|
cc0d0c7c9f | ||
|
|
43ed45ff58 | ||
|
|
305eb50c4e | ||
|
|
6fa48684f4 | ||
|
|
c46ef8d360 | ||
|
|
7c121a6901 | ||
|
|
d804b1a1a3 |
106
.github/workflows/main.yml
vendored
106
.github/workflows/main.yml
vendored
@@ -1,5 +1,3 @@
|
||||
# https://github.com/vercel/next.js/commits/canary/.github/workflows/build_test_deploy.yml
|
||||
|
||||
name: CI
|
||||
|
||||
on:
|
||||
@@ -16,14 +14,8 @@ env:
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: "Lint: ${{ matrix.os }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
node_version:
|
||||
- 16
|
||||
name: Lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
@@ -32,7 +24,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
node-version: 16
|
||||
cache: "pnpm"
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
@@ -48,14 +40,8 @@ jobs:
|
||||
run: pnpm lint -- --api="http://127.0.0.1:9080"
|
||||
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
node_version:
|
||||
- 16
|
||||
name: Build - ${{ matrix.os }}
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
@@ -64,7 +50,7 @@ jobs:
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: ${{ matrix.node_version }}
|
||||
node-version: 16
|
||||
cache: "pnpm"
|
||||
- run: pnpm install --frozen-lockfile
|
||||
- run: pnpm manypkg check
|
||||
@@ -78,19 +64,17 @@ jobs:
|
||||
- name: Build Apps
|
||||
run: pnpm build:apps -- --api="http://127.0.0.1:9080"
|
||||
|
||||
test:
|
||||
name: "Test: ${{ matrix.os }} (node@${{ matrix.NODE_VERSION }})"
|
||||
Unit-Tests:
|
||||
name: "Unit Test: ${{ matrix.os }} (node@16)"
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
node_version:
|
||||
- 16
|
||||
fail-fast: false
|
||||
env:
|
||||
NODE_VERSION: ${{ matrix.NODE_VERSION }}
|
||||
NODE_VERSION: 16
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -100,6 +84,74 @@ jobs:
|
||||
with:
|
||||
version: 6.32.6
|
||||
|
||||
- name: Setup node@16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: "pnpm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: pnpm install --frozen-lockfile
|
||||
shell: bash
|
||||
|
||||
- run: pnpm manypkg check
|
||||
shell: bash
|
||||
|
||||
- name: Turborepo local server
|
||||
uses: felixmosh/turborepo-gh-artifacts@v1
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
server-token: ${{ env.TURBO_TOKEN }}
|
||||
|
||||
- name: Build
|
||||
run: pnpm build -- --api="http://127.0.0.1:9080"
|
||||
shell: bash
|
||||
|
||||
- name: Test Packages
|
||||
run: pnpm test -- --filter=./packages/*
|
||||
shell: bash
|
||||
|
||||
- name: Test Apps
|
||||
run: pnpm test -- --filter=./apps/*
|
||||
shell: bash
|
||||
|
||||
find-integration-tests:
|
||||
name: "Find Integration Tests"
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
folders: ${{ steps.set-matrix.outputs.folders }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- id: set-matrix
|
||||
name: "Find all folders"
|
||||
shell: bash
|
||||
run: |
|
||||
cd ./integration-tests
|
||||
tree -J -d -L 1 | jq -c '.[0].contents | map(.name | tostring)'
|
||||
folders=$(tree -J -d -L 1 | jq -c '.[0].contents | map(.name | tostring)')
|
||||
echo "::set-output name=folders::$folders"
|
||||
|
||||
Integration-Tests:
|
||||
name: "Integration Test: ${{matrix.folder}} @ ${{ matrix.os }} "
|
||||
needs: [find-integration-tests]
|
||||
strategy:
|
||||
matrix:
|
||||
folder: ${{fromJSON(needs.find-integration-tests.outputs.folders)}}
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- windows-latest
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- run: echo ${{matrix.folder}}
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@646cdf48217256a3d0b80361c5a50727664284f2
|
||||
with:
|
||||
version: 6.32.6
|
||||
|
||||
- name: Setup node@${{ matrix.NODE_VERSION }}
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
@@ -123,6 +175,6 @@ jobs:
|
||||
run: pnpm build -- --api="http://127.0.0.1:9080"
|
||||
shell: bash
|
||||
|
||||
- name: Test
|
||||
run: pnpm test -- --api="http://127.0.0.1:9080"
|
||||
- name: Test Packages
|
||||
run: pnpm test -- --filter=./integration-tests/${{matrix.folder}}
|
||||
shell: bash
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
"name": "test-auth",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"prisma": {
|
||||
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
|
||||
},
|
||||
"scripts": {
|
||||
"start:dev": "pnpm run prisma:start && next dev",
|
||||
"test": "pnpm run prisma:start && vitest run",
|
||||
@@ -9,7 +12,8 @@
|
||||
"start": "next start",
|
||||
"lint": "next lint",
|
||||
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf .next",
|
||||
"prisma:start": "prisma generate && prisma migrate deploy",
|
||||
"prisma:start": "prisma generate && prisma migrate dev && pnpm run prisma:seed",
|
||||
"prisma:seed": "prisma db seed",
|
||||
"prisma:studio": "prisma studio"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -6,13 +6,19 @@ const seed = async () => {
|
||||
|
||||
const hashedPassword = await SecurePassword.hash("abcd1234")
|
||||
|
||||
await prisma.user.create({
|
||||
data: {
|
||||
email: "test@test.com",
|
||||
hashedPassword,
|
||||
role: "user",
|
||||
},
|
||||
})
|
||||
await prisma.user
|
||||
.create({
|
||||
data: {
|
||||
email: "test@test.com",
|
||||
hashedPassword,
|
||||
role: "user",
|
||||
},
|
||||
})
|
||||
.catch(console.error)
|
||||
|
||||
process.exit(0)
|
||||
}
|
||||
|
||||
seed()
|
||||
|
||||
export default seed
|
||||
|
||||
@@ -128,7 +128,7 @@ describe("Auth Tests", () => {
|
||||
try {
|
||||
appPort = await findPort()
|
||||
app = await launchApp(appDir, appPort, {cwd: process.cwd()})
|
||||
await seed()
|
||||
// await seed()
|
||||
} catch (error) {
|
||||
console.log(error)
|
||||
}
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
"prompts": "2.4.2",
|
||||
"resolve-cwd": "3.0.0",
|
||||
"resolve-from": "5.0.0",
|
||||
"shelljs": "0.8.5",
|
||||
"superjson": "1.9.1",
|
||||
"supports-color": "8.1.1",
|
||||
"ts-node": "10.7.0",
|
||||
@@ -69,6 +70,7 @@
|
||||
"@types/prompts": "2.0.14",
|
||||
"@types/react": "18.0.17",
|
||||
"@types/react-dom": "17.0.14",
|
||||
"@types/shelljs": "0.8.11",
|
||||
"@types/test-listen": "1.1.0",
|
||||
"@types/watchpack": "1.1.1",
|
||||
"express": "4.17.3",
|
||||
|
||||
@@ -35,9 +35,11 @@ export const enhancePrisma = <TPrismaClientCtor extends Constructor>(
|
||||
"You are calling db.$reset() in a production environment. We think you probably didn't mean to do that, so we are throwing this error instead of destroying your life's work.",
|
||||
)
|
||||
}
|
||||
|
||||
const prismaBin = which(process.cwd()).sync("prisma")
|
||||
|
||||
await new Promise((res, rej) => {
|
||||
const process = spawn(prismaBin, ["migrate", "reset", "--force", "--skip-generate"], {
|
||||
const process = spawn(prismaBin, ["db", "push", "--force-reset"], {
|
||||
stdio: "ignore",
|
||||
})
|
||||
process.on("exit", (code) => (code === 0 ? res(0) : rej(code)))
|
||||
|
||||
56
pnpm-lock.yaml
generated
56
pnpm-lock.yaml
generated
@@ -665,6 +665,7 @@ importers:
|
||||
"@types/prompts": 2.0.14
|
||||
"@types/react": 18.0.17
|
||||
"@types/react-dom": 17.0.14
|
||||
"@types/shelljs": 0.8.11
|
||||
"@types/test-listen": 1.1.0
|
||||
"@types/watchpack": 1.1.1
|
||||
arg: 5.0.1
|
||||
@@ -692,6 +693,7 @@ importers:
|
||||
react: 18.2.0
|
||||
resolve-cwd: 3.0.0
|
||||
resolve-from: 5.0.0
|
||||
shelljs: 0.8.5
|
||||
superjson: 1.9.1
|
||||
supports-color: 8.1.1
|
||||
test-listen: 1.1.0
|
||||
@@ -728,6 +730,7 @@ importers:
|
||||
prompts: 2.4.2
|
||||
resolve-cwd: 3.0.0
|
||||
resolve-from: 5.0.0
|
||||
shelljs: 0.8.5
|
||||
superjson: 1.9.1
|
||||
supports-color: 8.1.1
|
||||
ts-node: 10.7.0_typescript@4.6.3
|
||||
@@ -749,6 +752,7 @@ importers:
|
||||
"@types/prompts": 2.0.14
|
||||
"@types/react": 18.0.17
|
||||
"@types/react-dom": 17.0.14
|
||||
"@types/shelljs": 0.8.11
|
||||
"@types/test-listen": 1.1.0
|
||||
"@types/watchpack": 1.1.1
|
||||
express: 4.17.3_supports-color@8.1.1
|
||||
@@ -3235,6 +3239,7 @@ packages:
|
||||
semver: 5.7.1
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@babel/preset-flow/7.17.12_@babel+core@7.18.2:
|
||||
resolution:
|
||||
@@ -5080,7 +5085,7 @@ packages:
|
||||
}
|
||||
dependencies:
|
||||
"@types/minimatch": 3.0.5
|
||||
"@types/node": 17.0.24
|
||||
"@types/node": 18.7.13
|
||||
|
||||
/@types/graceful-fs/4.1.5:
|
||||
resolution:
|
||||
@@ -5302,7 +5307,6 @@ packages:
|
||||
{
|
||||
integrity: sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==,
|
||||
}
|
||||
dev: true
|
||||
|
||||
/@types/nodemailer/6.4.4:
|
||||
resolution:
|
||||
@@ -5516,6 +5520,16 @@ packages:
|
||||
"@types/mime": 1.3.2
|
||||
"@types/node": 17.0.24
|
||||
|
||||
/@types/shelljs/0.8.11:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-x9yaMvEh5BEaZKeVQC4vp3l+QoFj3BXcd4aYfuKSzIIyihjdVARAadYy3SMNIz0WCCdS2vB9JL/U6GQk5PaxQw==,
|
||||
}
|
||||
dependencies:
|
||||
"@types/glob": 7.2.0
|
||||
"@types/node": 18.7.13
|
||||
dev: true
|
||||
|
||||
/@types/stack-utils/2.0.1:
|
||||
resolution:
|
||||
{
|
||||
@@ -5721,6 +5735,7 @@ packages:
|
||||
typescript: 4.6.3
|
||||
transitivePeerDependencies:
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/@typescript-eslint/experimental-utils/5.28.0_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
resolution:
|
||||
@@ -9699,6 +9714,7 @@ packages:
|
||||
transitivePeerDependencies:
|
||||
- eslint-import-resolver-webpack
|
||||
- supports-color
|
||||
dev: false
|
||||
|
||||
/eslint-config-next/12.3.0_hrkuebk64jiu2ut2d2sm4oylnu:
|
||||
resolution:
|
||||
@@ -9736,6 +9752,7 @@ packages:
|
||||
hasBin: true
|
||||
peerDependencies:
|
||||
eslint: ">=7.0.0"
|
||||
dev: false
|
||||
|
||||
/eslint-config-prettier/8.5.0_eslint@7.32.0:
|
||||
resolution:
|
||||
@@ -11704,6 +11721,14 @@ packages:
|
||||
has: 1.0.3
|
||||
side-channel: 1.0.4
|
||||
|
||||
/interpret/1.4.0:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==,
|
||||
}
|
||||
engines: {node: ">= 0.10"}
|
||||
dev: false
|
||||
|
||||
/ip-regex/4.3.0:
|
||||
resolution:
|
||||
{
|
||||
@@ -12408,7 +12433,7 @@ packages:
|
||||
pretty-format: 27.5.1
|
||||
slash: 3.0.0
|
||||
strip-json-comments: 3.1.1
|
||||
ts-node: 10.7.0_typescript@4.6.3
|
||||
ts-node: 10.7.0_fxg3r7oju3tntkxsvleuiot4fa
|
||||
transitivePeerDependencies:
|
||||
- bufferutil
|
||||
- canvas
|
||||
@@ -15998,6 +16023,16 @@ packages:
|
||||
source-map: 0.6.1
|
||||
tslib: 2.4.0
|
||||
|
||||
/rechoir/0.6.2:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==,
|
||||
}
|
||||
engines: {node: ">= 0.10"}
|
||||
dependencies:
|
||||
resolve: 1.22.0
|
||||
dev: false
|
||||
|
||||
/redent/3.0.0:
|
||||
resolution:
|
||||
{
|
||||
@@ -16700,6 +16735,19 @@ packages:
|
||||
}
|
||||
dev: true
|
||||
|
||||
/shelljs/0.8.5:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==,
|
||||
}
|
||||
engines: {node: ">=4"}
|
||||
hasBin: true
|
||||
dependencies:
|
||||
glob: 7.2.0
|
||||
interpret: 1.4.0
|
||||
rechoir: 0.6.2
|
||||
dev: false
|
||||
|
||||
/side-channel/1.0.4:
|
||||
resolution:
|
||||
{
|
||||
@@ -17742,7 +17790,6 @@ packages:
|
||||
typescript: 4.6.3
|
||||
v8-compile-cache-lib: 3.0.1
|
||||
yn: 3.1.1
|
||||
dev: false
|
||||
|
||||
/ts-node/10.7.0_typescript@4.6.3:
|
||||
resolution:
|
||||
@@ -17775,6 +17822,7 @@ packages:
|
||||
typescript: 4.6.3
|
||||
v8-compile-cache-lib: 3.0.1
|
||||
yn: 3.1.1
|
||||
dev: false
|
||||
|
||||
/ts-node/10.9.1_kakyiqi62sfonxvjmz3ft5vt7y:
|
||||
resolution:
|
||||
|
||||
Reference in New Issue
Block a user