Skip to content

Commit

Permalink
fix: Structure scripts folder
Browse files Browse the repository at this point in the history
  • Loading branch information
matvp91 committed Nov 13, 2024
1 parent a57db09 commit 097a31c
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 19 deletions.
7 changes: 4 additions & 3 deletions scripts/build.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {$} from "bun";
import { $ } from "bun";
import { buildClientPackages } from "./devtools/client-packages";

import "./pre-build";
await buildClientPackages();

await Promise.all([
$`bun run --filter="@superstreamer/app" build`,
$`bun run --filter="@superstreamer/artisan" build`,
$`bun run --filter="@superstreamer/stitcher" build`,
])
])
7 changes: 5 additions & 2 deletions scripts/clean-s3.ts → scripts/devtools/clear-all.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ListObjectsCommand,
S3,
} from "@aws-sdk/client-s3";
import { env } from "../packages/api/src/env";
import { env } from "../../packages/api/src/env";

const client = new S3({
endpoint: env.S3_ENDPOINT,
Expand All @@ -14,7 +14,7 @@ const client = new S3({
},
});

for (const prefix of ["transcode", "package"]) {
async function clearFolder(prefix: string) {
const response = await client.send(
new ListObjectsCommand({
Bucket: env.S3_BUCKET,
Expand All @@ -33,3 +33,6 @@ for (const prefix of ["transcode", "package"]) {
}),
);
}

await clearFolder("transcode");
await clearFolder("package");
10 changes: 10 additions & 0 deletions scripts/devtools/client-packages.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { $ } from "bun";

export async function buildClientPackages() {
await Promise.all([
// Build api for the api client.
$`bun run --filter="@superstreamer/api" build`,
// Build player for app.
$`bun run --filter="@superstreamer/player" build`,
]);
}
7 changes: 4 additions & 3 deletions scripts/lint.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {$} from "bun";
import { $ } from "bun";
import { buildClientPackages } from "./devtools/client-packages";

import "./pre-build";
await buildClientPackages();

await $`bun run --filter="*" lint`;
await $`bun run --filter="*" lint`;
8 changes: 0 additions & 8 deletions scripts/pre-build.ts

This file was deleted.

7 changes: 4 additions & 3 deletions scripts/test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {$} from "bun";
import { $ } from "bun";
import { buildClientPackages } from "./devtools/client-packages";

import "./pre-build";
await buildClientPackages();

await $`bun run --filter="*" test`;
await $`bun run --filter="*" test`;

0 comments on commit 097a31c

Please sign in to comment.