-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit fixes the style issues introduced in 9c9cbb8 according to the output from Prettier. Details: #380
- Loading branch information
1 parent
9c9cbb8
commit b970176
Showing
14 changed files
with
1,212 additions
and
939 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,54 @@ | ||
/* eslint-disable turbo/no-undeclared-env-vars */ | ||
// @ts-check | ||
import bundleAnalyze from '@next/bundle-analyzer' | ||
import nextRoutes from 'nextjs-routes/config' | ||
import bundleAnalyze from "@next/bundle-analyzer"; | ||
import nextRoutes from "nextjs-routes/config"; | ||
|
||
import i18nConfig from './next-i18next.config.js' | ||
import i18nConfig from "./next-i18next.config.js"; | ||
/** | ||
* Run `build` or `dev` with `SKIP_ENV_VALIDATION` to skip env validation. This is especially useful for | ||
* Docker builds. | ||
*/ | ||
|
||
!process.env.SKIP_ENV_VALIDATION && (await import('./src/env/server.mjs')) | ||
!process.env.SKIP_ENV_VALIDATION && (await import("./src/env/server.mjs")); | ||
|
||
const withRoutes = nextRoutes({ outDir: 'src/types' }) | ||
const withRoutes = nextRoutes({ outDir: "src/types" }); | ||
const withBundleAnalyzer = bundleAnalyze({ | ||
enabled: process.env.ANALYZE === 'true', | ||
}) | ||
enabled: process.env.ANALYZE === "true", | ||
}); | ||
|
||
/** @type {import('next').NextConfig} */ | ||
const config = { | ||
i18n: i18nConfig.i18n, | ||
reactStrictMode: true, | ||
swcMinify: true, | ||
compiler: { | ||
...(process.env.VERCEL_ENV === 'production' ? { removeConsole: { exclude: ['error'] } } : {}), | ||
...(process.env.VERCEL_ENV === "production" | ||
? { removeConsole: { exclude: ["error"] } } | ||
: {}), | ||
}, | ||
images: { | ||
remotePatterns: [{ protocol: 'https', hostname: 'placehold.co', pathname: '/**' }], | ||
remotePatterns: [ | ||
{ protocol: "https", hostname: "placehold.co", pathname: "/**" }, | ||
], | ||
// domains: ['placehold.co'], | ||
}, | ||
experimental: { | ||
outputFileTracingExcludes: { | ||
'*': ['**swc+core**', '**esbuild**'], | ||
"*": ["**swc+core**", "**esbuild**"], | ||
}, | ||
webpackBuildWorker: true, | ||
}, | ||
eslint: { ignoreDuringBuilds: process.env.VERCEL_ENV !== 'production' }, | ||
typescript: { ignoreBuildErrors: process.env.VERCEL_ENV !== 'production' }, | ||
} | ||
eslint: { ignoreDuringBuilds: process.env.VERCEL_ENV !== "production" }, | ||
typescript: { ignoreBuildErrors: process.env.VERCEL_ENV !== "production" }, | ||
}; | ||
/** | ||
* Wraps NextJS config with the Bundle Analyzer config. | ||
* | ||
* @param {typeof config} config | ||
* @returns {typeof config} | ||
*/ | ||
function defineNextConfig(config) { | ||
return withBundleAnalyzer(withRoutes(config)) | ||
return withBundleAnalyzer(withRoutes(config)); | ||
} | ||
|
||
export default defineNextConfig(config) | ||
export default defineNextConfig(config); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,75 @@ | ||
/* eslint-disable import/no-unused-modules */ | ||
|
||
import { PrismaClient } from '@prisma/client' | ||
import { PrismaClient } from "@prisma/client"; | ||
|
||
import fs from 'fs' | ||
import path from 'path' | ||
import fs from "fs"; | ||
import path from "path"; | ||
|
||
import { categories } from './seedData/categories' | ||
import { partnerData } from './seedData/partners' | ||
import { pronouns } from './seedData/pronouns' | ||
import { categories } from "./seedData/categories"; | ||
import { partnerData } from "./seedData/partners"; | ||
import { pronouns } from "./seedData/pronouns"; | ||
|
||
const prisma = new PrismaClient() | ||
const prisma = new PrismaClient(); | ||
|
||
async function main() { | ||
const categoryResult = await prisma.storyCategory.createMany({ | ||
data: categories, | ||
skipDuplicates: true, | ||
}) | ||
console.log(`Categories created: ${categoryResult.count}`) | ||
}); | ||
console.log(`Categories created: ${categoryResult.count}`); | ||
|
||
const pronounResult = await prisma.pronouns.createMany({ | ||
data: pronouns, | ||
skipDuplicates: true, | ||
}) | ||
console.log(`Pronoun records created: ${pronounResult.count}`) | ||
}); | ||
console.log(`Pronoun records created: ${pronounResult.count}`); | ||
|
||
const partnerResult = await prisma.partnerOrg.createMany({ | ||
data: partnerData, | ||
skipDuplicates: true, | ||
}) | ||
console.log(`Partner records created: ${partnerResult.count}`) | ||
}); | ||
console.log(`Partner records created: ${partnerResult.count}`); | ||
const output: Record<string, unknown> = { | ||
categories: await prisma.storyCategory.findMany(), | ||
pronouns: await prisma.pronouns.findMany(), | ||
partners: await prisma.partnerOrg.findMany(), | ||
} | ||
}; | ||
|
||
if (fs.existsSync(path.resolve(__dirname, './seedData/stories.ts'))) { | ||
const stories = await import('./seedData/stories') | ||
if (fs.existsSync(path.resolve(__dirname, "./seedData/stories.ts"))) { | ||
const stories = await import("./seedData/stories"); | ||
const storiesResult = await prisma.story.createMany({ | ||
data: stories.stories, | ||
skipDuplicates: true, | ||
}) | ||
console.log(`Stories created: ${storiesResult.count}`) | ||
}); | ||
console.log(`Stories created: ${storiesResult.count}`); | ||
const linkCategories = await prisma.storyToCategory.createMany({ | ||
data: stories.links.categories, | ||
skipDuplicates: true, | ||
}) | ||
}); | ||
const linkPronouns = await prisma.pronounsToStory.createMany({ | ||
data: stories.links.pronouns, | ||
skipDuplicates: true, | ||
}) | ||
console.log(`Links -> categories: ${linkCategories.count}, pronouns: ${linkPronouns.count}`) | ||
}); | ||
console.log( | ||
`Links -> categories: ${linkCategories.count}, pronouns: ${linkPronouns.count}`, | ||
); | ||
output.storiesResult = await prisma.story.findMany({ | ||
select: { id: true, name: true }, | ||
}) | ||
}); | ||
} | ||
|
||
fs.writeFileSync(path.resolve(__dirname, 'seedresult.json'), JSON.stringify(output)) | ||
fs.writeFileSync( | ||
path.resolve(__dirname, "seedresult.json"), | ||
JSON.stringify(output), | ||
); | ||
} | ||
|
||
main() | ||
.then(async () => { | ||
await prisma.$disconnect() | ||
await prisma.$disconnect(); | ||
}) | ||
.catch(async (e) => { | ||
console.error(e) | ||
await prisma.$disconnect() | ||
process.exit(1) | ||
}) | ||
console.error(e); | ||
await prisma.$disconnect(); | ||
process.exit(1); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,28 @@ | ||
import { type Prisma } from '@prisma/client' | ||
import { type Prisma } from "@prisma/client"; | ||
|
||
export const pronouns: Prisma.PronounsCreateManyInput[] = [ | ||
{ | ||
id: 'clienra200007pexbweivoffq', | ||
pronounsEN: 'They/Them/Theirs', | ||
pronounsES: 'Elle', | ||
tag: 'they', | ||
id: "clienra200007pexbweivoffq", | ||
pronounsEN: "They/Them/Theirs", | ||
pronounsES: "Elle", | ||
tag: "they", | ||
}, | ||
{ | ||
id: 'clienra200008pexbpobaxztr', | ||
pronounsEN: 'He/Him/His', | ||
pronounsES: 'Él', | ||
tag: 'he', | ||
id: "clienra200008pexbpobaxztr", | ||
pronounsEN: "He/Him/His", | ||
pronounsES: "Él", | ||
tag: "he", | ||
}, | ||
{ | ||
id: 'clienra200009pexb5wyo4bkt', | ||
pronounsEN: 'Any pronouns', | ||
pronounsES: 'Cualquier pronombre', | ||
tag: 'any', | ||
id: "clienra200009pexb5wyo4bkt", | ||
pronounsEN: "Any pronouns", | ||
pronounsES: "Cualquier pronombre", | ||
tag: "any", | ||
}, | ||
{ | ||
id: 'clienra20000apexb4zhmhq3d', | ||
pronounsEN: 'No pronouns', | ||
pronounsES: 'No pronombres', | ||
tag: 'none', | ||
id: "clienra20000apexb4zhmhq3d", | ||
pronounsEN: "No pronouns", | ||
pronounsES: "No pronombres", | ||
tag: "none", | ||
}, | ||
] | ||
]; |
Oops, something went wrong.