mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: add prisma
This commit is contained in:
1 parent
bd160efdb2
commit
eb41434565
5 files changed
+27
-19
No files matched your search
@@ -21,10 +21,10 @@ jobs:
|
|||||||
run: bun install
|
run: bun install
|
||||||
|
|
||||||
- name: Build Prisma
|
- name: Build Prisma
|
||||||
run: bun prisma generate
|
run: bun run build:prisma
|
||||||
|
|
||||||
- name: Build bot
|
- name: Build bot
|
||||||
run: bun build:bot
|
run: bun run build:bot
|
||||||
|
|
||||||
- name: Archive build
|
- name: Archive build
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
|||||||
@@ -39,4 +39,5 @@ jobs:
|
|||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
||||||
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
DISCORD_CLIENT_ID: ${{ secrets.DISCORD_CLIENT_ID }}
|
||||||
run: |
|
run: |
|
||||||
|
mv dist/bot/prisma .
|
||||||
bun dist/bot/main.js
|
bun dist/bot/main.js
|
||||||
+1
-1
@@ -46,7 +46,7 @@
|
|||||||
"@types/lodash-es": "^4.17.12",
|
"@types/lodash-es": "^4.17.12",
|
||||||
"@types/node": "^22.5.4",
|
"@types/node": "^22.5.4",
|
||||||
"prettier": "^3.3.3",
|
"prettier": "^3.3.3",
|
||||||
"prisma": "^5.19.1",
|
"prisma": "^6.0.0",
|
||||||
"typescript": "^5.5.4"
|
"typescript": "^5.5.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,9 +2,10 @@ import { build } from 'esbuild';
|
|||||||
import { cp, readdir, rm } from 'fs/promises';
|
import { cp, readdir, rm } from 'fs/promises';
|
||||||
import { argv } from 'process';
|
import { argv } from 'process';
|
||||||
|
|
||||||
const srcRoot = '../bot';
|
const projectDir = '../..';
|
||||||
const distRoot = '../../dist/bot';
|
const srcRoot = `${projectDir}/packages/bot`;
|
||||||
const modulesRoot = '../../node_modules';
|
const distRoot = `${projectDir}/dist/bot`;
|
||||||
|
const modulesRoot = `${projectDir}/node_modules`;
|
||||||
const workers = await readdir(`${srcRoot}/src/workers`);
|
const workers = await readdir(`${srcRoot}/src/workers`);
|
||||||
const dev = argv.includes('--dev');
|
const dev = argv.includes('--dev');
|
||||||
|
|
||||||
@@ -29,19 +30,25 @@ build({
|
|||||||
sourcemap: !dev,
|
sourcemap: !dev,
|
||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all(
|
for (const module of await readdir(`${modulesRoot}/@resvg`)) {
|
||||||
(await readdir(`${modulesRoot}/@resvg`)).map(async (module) => {
|
readdir(`${modulesRoot}/@resvg/${module}`).then((files) =>
|
||||||
const files = await readdir(`${modulesRoot}/@resvg/${module}`).then(
|
files
|
||||||
(files) => files.filter((file) => file.endsWith('.node')),
|
.filter((file) => file.endsWith('.node'))
|
||||||
);
|
.map((file) =>
|
||||||
|
cp(
|
||||||
await Promise.all(
|
|
||||||
files.map(async (file) => {
|
|
||||||
await cp(
|
|
||||||
`${modulesRoot}/@resvg/${module}/${file}`,
|
`${modulesRoot}/@resvg/${module}/${file}`,
|
||||||
`${distRoot}/workers/${file}`,
|
`${distRoot}/workers/${file}`,
|
||||||
|
),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}),
|
}
|
||||||
);
|
|
||||||
}),
|
if (!dev) {
|
||||||
);
|
await cp(`${projectDir}/prisma`, `${distRoot}/prisma`, { recursive: true });
|
||||||
|
|
||||||
|
for (const file of await readdir(`${modulesRoot}/prisma`).then((files) =>
|
||||||
|
files.filter((file) => file.endsWith('.node')),
|
||||||
|
)) {
|
||||||
|
cp(`${modulesRoot}/prisma/${file}`, `${distRoot}/prisma/${file}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in new issue
Block a user