Skip to content

Commit

Permalink
More
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Dec 6, 2024
1 parent d7e4aa3 commit 34163af
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
1 change: 1 addition & 0 deletions TODO
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,7 @@ redesign season summary

offsetting penalties broken on kickoff https://discord.com/channels/290013534023057409/290015591216054273/929998618331590667
- another example https://discord.com/channels/290013534023057409/290015591216054273/1274861396332646554
- another example https://discord.com/channels/290013534023057409/290015591216054273/1314324170535862305

on team history, graph of team ovr / winp / mov over time, star for championship
- maybe better on league history, to show for whole league?
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"scripts": {
"start": "node --experimental-strip-types --disable-warning=ExperimentalWarning tools/server.ts",
"build": "node --experimental-strip-types --disable-warning=ExperimentalWarning tools/build.ts",
"deploy": "node --run lint && node --run test && node --experimental-strip-types --disable-warning=ExperimentalWarning tools/deploy.js",
"deploy-all": "node --run lint && node --run test && node --experimental-strip-types --disable-warning=ExperimentalWarning tools/deploy-all.js",
"deploy": "node --run lint && node --run test && node --experimental-strip-types --disable-warning=ExperimentalWarning tools/deploy.ts",
"deploy-all": "node --run lint && node --run test && node --experimental-strip-types --disable-warning=ExperimentalWarning tools/deploy-all.ts",
"start-watch": "concurrently --kill-others \"node --run start\" \"node --run watch\"",
"watch": "node --experimental-strip-types --disable-warning=ExperimentalWarning --loader=import-jsx tools/watch.ts",
"lint": "concurrently --raw \"node --run lint-js\" \"node --run lint-ts\"",
Expand Down
8 changes: 0 additions & 8 deletions tools/deploy-all.js

This file was deleted.

8 changes: 8 additions & 0 deletions tools/deploy-all.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import deploy from "./lib/deploy.ts";

const sports = ["basketball", "football", "baseball", "hockey"] as const;

for (const sport of sports) {
process.env.SPORT = sport;
await deploy();
}
3 changes: 0 additions & 3 deletions tools/deploy.js

This file was deleted.

3 changes: 3 additions & 0 deletions tools/deploy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import deploy from "./lib/deploy.ts";

await deploy();
2 changes: 1 addition & 1 deletion tools/lib/build-js.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const buildJS = async () => {
promises.push(
new Promise<void>(resolve => {
const worker = new Worker(
new URL("./buildJSWorker.js", import.meta.url),
new URL("./buildJSWorker.ts", import.meta.url),
{
workerData: {
legacy,
Expand Down
10 changes: 7 additions & 3 deletions tools/lib/buildJSWorker.js → tools/lib/buildJSWorker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@ const BLACKLIST = {
worker: [...LODASH_BLACKLIST, /\/ui/, /^react/],
};

const buildFile = async (name, legacy, rev) => {
const buildFile = async (
name: "ui" | "worker",
legacy: boolean,
rev: string,
) => {
const bundle = await rollup.rollup({
...rollupConfig("production", {
blacklistOptions: BLACKLIST[name],
Expand All @@ -28,7 +32,7 @@ const buildFile = async (name, legacy, rev) => {
preserveEntrySignatures: false,
});

let format;
let format: rollup.ModuleFormat;
if (legacy) {
// ES modules don't work in workers in all the browsers currently supported
// Chrome 80, Firefox 114, Safari 15.5/16.4
Expand All @@ -47,7 +51,7 @@ const buildFile = async (name, legacy, rev) => {
dir: "build/gen",
});

parentPort.postMessage("done");
parentPort!.postMessage("done");
};

(async () => {
Expand Down
5 changes: 3 additions & 2 deletions tools/lib/deploy.js → tools/lib/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const getSubdomain = () => {
);
};

const mySpawn = (command, args) => {
return new Promise(resolve => {
const mySpawn = (command: string, args: string[]) => {
return new Promise<void>(resolve => {
console.log(`${command} ${args.join(" ")}`);

const cmd = spawn(command, args, { shell: true, stdio: "inherit" });
Expand All @@ -42,6 +42,7 @@ const deploy = async () => {
const cloudflareConfig = JSON.parse(
await readFile(
new URL("../../../../.config/cloudflare.json", import.meta.url),
"utf8",
),
);

Expand Down

0 comments on commit 34163af

Please sign in to comment.