chore: migrate linting and formatting to Oxc
This commit is contained in:
@@ -1,13 +1,9 @@
|
||||
import { getSetupToken, readAuthState } from '../src/features/auth/auth.server'
|
||||
import { getSetupToken, readAuthState } from "../src/features/auth/auth.server";
|
||||
|
||||
if (!readAuthState().needsSetup) {
|
||||
console.error(
|
||||
'This workspace already has an owner. Sign in with your existing account.',
|
||||
)
|
||||
process.exitCode = 1
|
||||
console.error("This workspace already has an owner. Sign in with your existing account.");
|
||||
process.exitCode = 1;
|
||||
} else {
|
||||
console.log(
|
||||
'Open /setup in your workspace and enter this one-time setup code:',
|
||||
)
|
||||
console.log(getSetupToken())
|
||||
console.log("Open /setup in your workspace and enter this one-time setup code:");
|
||||
console.log(getSetupToken());
|
||||
}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
import { backupDatabase } from '../src/features/storage/backup.server'
|
||||
import { backupDatabase } from "../src/features/storage/backup.server";
|
||||
|
||||
const source = process.env.TWITTER_LITE_DB_PATH
|
||||
const destination = process.argv[2]
|
||||
const source = process.env.TWITTER_LITE_DB_PATH;
|
||||
const destination = process.argv[2];
|
||||
if (!source || !destination || process.argv.length !== 3) {
|
||||
console.error(
|
||||
'Usage: TWITTER_LITE_DB_PATH=/absolute/app.db pnpm db:backup /absolute/backup.db',
|
||||
)
|
||||
process.exitCode = 1
|
||||
console.error("Usage: TWITTER_LITE_DB_PATH=/absolute/app.db pnpm db:backup /absolute/backup.db");
|
||||
process.exitCode = 1;
|
||||
} else {
|
||||
await backupDatabase(source, destination)
|
||||
console.log(`Backup verified: ${destination}`)
|
||||
await backupDatabase(source, destination);
|
||||
console.log(`Backup verified: ${destination}`);
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { build } from 'vite'
|
||||
import { build } from "vite";
|
||||
|
||||
for (const entry of ['backup-database', 'account-setup']) {
|
||||
for (const entry of ["backup-database", "account-setup"]) {
|
||||
await build({
|
||||
configFile: false,
|
||||
build: {
|
||||
ssr: `scripts/${entry}.ts`,
|
||||
outDir: '.output/server/tools',
|
||||
outDir: ".output/server/tools",
|
||||
emptyOutDir: false,
|
||||
rollupOptions: { external: ['better-sqlite3'] },
|
||||
rollupOptions: { external: ["better-sqlite3"] },
|
||||
},
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { writeFileSync } from 'node:fs'
|
||||
import { readMigrationFiles } from 'drizzle-orm/migrator'
|
||||
import { writeFileSync } from "node:fs";
|
||||
import { readMigrationFiles } from "drizzle-orm/migrator";
|
||||
|
||||
const migrations = readMigrationFiles({
|
||||
migrationsFolder: new URL('../drizzle', import.meta.url).pathname,
|
||||
})
|
||||
migrationsFolder: new URL("../drizzle", import.meta.url).pathname,
|
||||
});
|
||||
writeFileSync(
|
||||
new URL('../src/features/storage/migrations.generated.ts', import.meta.url),
|
||||
new URL("../src/features/storage/migrations.generated.ts", import.meta.url),
|
||||
`// Generated by pnpm db:generate. Do not edit.\nexport const migrations = ${JSON.stringify(migrations, null, 2)}\n`,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { tanstackStart } from '@tanstack/react-start/plugin/vite'
|
||||
import { createServer } from 'vite'
|
||||
import { tanstackStart } from "@tanstack/react-start/plugin/vite";
|
||||
import { createServer } from "vite";
|
||||
|
||||
const server = await createServer({
|
||||
configFile: false,
|
||||
plugins: [tanstackStart()],
|
||||
server: { middlewareMode: true },
|
||||
})
|
||||
await server.close()
|
||||
});
|
||||
await server.close();
|
||||
|
||||
Reference in New Issue
Block a user