Skip to content

Commit 7fbf4c9

Browse files
committed
Replace biome with eslint and prettier and replace tsx with jiti
1 parent a45bc45 commit 7fbf4c9

30 files changed

Lines changed: 2055 additions & 415 deletions

.npmignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
.changeset
22
.github
33
.vscode
4-
src
4+
.react-router
5+
cli
6+
core
7+
ui
58
tests
9+
examples
610
pnpm-lock.yaml
711
tsconfig.json
812
vitest.config.mts

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pnpm-lock.yaml

.prettierrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"plugins": ["prettier-plugin-tailwindcss"],
3+
"semi": false
4+
}

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,9 @@
22
"editor.formatOnSave": true,
33
"editor.codeActionsOnSave": {
44
"source.organizeImports": "explicit"
5+
},
6+
"editor.defaultFormatter": "esbenp.prettier-vscode",
7+
"[json]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
59
}
610
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ comprising of the Monarch CLI and Studio.
1414

1515
```sh
1616
npm install -D monarch-kit
17-
```
17+
```

biome.json

Lines changed: 0 additions & 36 deletions
This file was deleted.

cli/db.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { createCommand } from "commandstruct";
2-
import type { Database } from "~/core/database";
1+
import { createCommand } from "commandstruct"
2+
import type { Database } from "~/core/database"
33

44
export const dbCmd = createCommand("db")
55
.use<{ database: Database }>()
66
.action(async (_, ctx) => {
7-
const dbs = await ctx.database.list();
8-
console.log(dbs);
9-
});
7+
const dbs = await ctx.database.list()
8+
console.log(dbs)
9+
})

cli/index.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/env node
22

3-
import { createProgram } from "commandstruct";
4-
import { Database } from "~/core/database";
5-
import { dbCmd } from "./db";
6-
import { studioCmd } from "./studio";
3+
import { createProgram } from "commandstruct"
4+
import { Database } from "~/core/database"
5+
import { dbCmd } from "./db"
6+
import { studioCmd } from "./studio"
77

88
createProgram("monarch-cli")
99
.provide({ database: Database })
1010
.commands(dbCmd, studioCmd)
1111
.build()
12-
.run();
12+
.run()

cli/studio.ts

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
1-
import { createRequestHandler } from "@react-router/express";
2-
import { createCommand, flag } from "commandstruct";
3-
import compression from "compression";
4-
import express from "express";
5-
import morgan from "morgan";
6-
import os from "node:os";
7-
import path from "node:path";
8-
import url from "node:url";
9-
import { type ServerBuild } from "react-router";
10-
import type { Database } from "~/core/database";
1+
import { createRequestHandler } from "@react-router/express"
2+
import { createCommand, flag } from "commandstruct"
3+
import compression from "compression"
4+
import express from "express"
5+
import morgan from "morgan"
6+
import os from "node:os"
7+
import path from "node:path"
8+
import url from "node:url"
9+
import { type ServerBuild } from "react-router"
10+
import type { Database } from "~/core/database"
1111

1212
export const studioCmd = createCommand("studio")
1313
.use<{ database: Database }>()
1414
.flags({
1515
port: flag("web server port").char("p").optionalParam("number", 6543),
1616
})
1717
.action(async ({ flags }) => {
18-
let buildPath = import.meta.dirname;
18+
let buildPath = import.meta.dirname
1919
if (buildPath.endsWith("dist")) {
20-
buildPath = path.join(buildPath, "ui/server/index.js");
20+
buildPath = path.join(buildPath, "ui/server/index.js")
2121
} else {
2222
// during development the ui dir different
23-
buildPath = path.join(buildPath, "../dist/ui/server/index.js");
23+
buildPath = path.join(buildPath, "../dist/ui/server/index.js")
2424
}
2525

2626
const build: ServerBuild | null = await import(
2727
url.pathToFileURL(buildPath).href
28-
).catch(() => null);
28+
).catch(() => null)
2929
if (!build) {
3030
return console.error(
31-
`[monarch-studio] err: missing build output at ${buildPath}`
32-
);
31+
`[monarch-studio] err: missing build output at ${buildPath}`,
32+
)
3333
}
3434

35-
runServer(build, flags.port);
36-
});
35+
runServer(build, flags.port)
36+
})
3737

3838
function runServer(build: ServerBuild, port: number) {
3939
function onListen() {
@@ -42,42 +42,42 @@ function runServer(build: ServerBuild, port: number) {
4242
Object.values(os.networkInterfaces())
4343
.flat()
4444
.find((ip) => String(ip?.family).includes("4") && !ip?.internal)
45-
?.address;
45+
?.address
4646

4747
if (!address) {
48-
console.log(`[monarch-studio] http://localhost:${port}`);
48+
console.log(`[monarch-studio] http://localhost:${port}`)
4949
} else {
5050
console.log(
51-
`[monarch-studio] http://localhost:${port} (http://${address}:${port})`
52-
);
51+
`[monarch-studio] http://localhost:${port} (http://${address}:${port})`,
52+
)
5353
}
5454
}
5555

56-
const app = express();
57-
app.disable("x-powered-by");
58-
app.use(compression());
56+
const app = express()
57+
app.disable("x-powered-by")
58+
app.use(compression())
5959
app.use(
6060
path.posix.join(build.publicPath, "assets"),
6161
express.static(path.join(build.assetsBuildDirectory, "assets"), {
6262
immutable: true,
6363
maxAge: "1y",
64-
})
65-
);
64+
}),
65+
)
6666
app.use(
6767
build.publicPath,
6868
express.static(build.assetsBuildDirectory, {
6969
immutable: true,
7070
maxAge: "1y",
71-
})
72-
);
73-
app.use(express.static("public", { maxAge: "1h" }));
74-
app.use(morgan("tiny"));
75-
app.all("*", createRequestHandler({ build, mode: "production" }));
71+
}),
72+
)
73+
app.use(express.static("public", { maxAge: "1h" }))
74+
app.use(morgan("tiny"))
75+
app.all("*", createRequestHandler({ build, mode: "production" }))
7676

7777
const server = process.env.HOST
7878
? app.listen(port, process.env.HOST, onListen)
79-
: app.listen(port, onListen);
79+
: app.listen(port, onListen)
8080

81-
process.once("SIGTERM", () => server?.close(console.error));
82-
process.once("SIGINT", () => server?.close(console.error));
81+
process.once("SIGTERM", () => server?.close(console.error))
82+
process.once("SIGINT", () => server?.close(console.error))
8383
}

components.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@
1818
"hooks": "~/ui/hooks"
1919
},
2020
"iconLibrary": "lucide"
21-
}
21+
}

0 commit comments

Comments
 (0)