From ca2fbf5cdf32c0fee70ce338e3510612da26f308 Mon Sep 17 00:00:00 2001 From: James Date: Wed, 6 Mar 2024 15:56:02 -0500 Subject: [PATCH] chore: build --- packages/translations/.swcrc | 3 - .../src/_generatedFiles_/api/index.ts | 60 ++++++------- .../src/_generatedFiles_/client/index.ts | 60 ++++++------- packages/translations/src/all/index.ts | 60 ++++++------- tsconfig.json | 85 +++++-------------- 5 files changed, 110 insertions(+), 158 deletions(-) diff --git a/packages/translations/.swcrc b/packages/translations/.swcrc index 744e3389a2..15eb20bc14 100644 --- a/packages/translations/.swcrc +++ b/packages/translations/.swcrc @@ -2,9 +2,6 @@ "$schema": "https://json.schemastore.org/swcrc", "sourceMaps": "inline", "jsc": { - "experimental": { - "keepImportAssertions": true - }, "target": "esnext", "parser": { "syntax": "typescript", diff --git a/packages/translations/src/_generatedFiles_/api/index.ts b/packages/translations/src/_generatedFiles_/api/index.ts index 7ab7ae98b2..fb2376ff6e 100644 --- a/packages/translations/src/_generatedFiles_/api/index.ts +++ b/packages/translations/src/_generatedFiles_/api/index.ts @@ -1,33 +1,33 @@ -import ar from './ar.json' assert { type: 'json' } -import az from './az.json' assert { type: 'json' } -import bg from './bg.json' assert { type: 'json' } -import cs from './cs.json' assert { type: 'json' } -import de from './de.json' assert { type: 'json' } -import en from './en.json' assert { type: 'json' } -import es from './es.json' assert { type: 'json' } -import fa from './fa.json' assert { type: 'json' } -import fr from './fr.json' assert { type: 'json' } -import hr from './hr.json' assert { type: 'json' } -import hu from './hu.json' assert { type: 'json' } -import it from './it.json' assert { type: 'json' } -import ja from './ja.json' assert { type: 'json' } -import ko from './ko.json' assert { type: 'json' } -import my from './my.json' assert { type: 'json' } -import nb from './nb.json' assert { type: 'json' } -import nl from './nl.json' assert { type: 'json' } -import pl from './pl.json' assert { type: 'json' } -import pt from './pt.json' assert { type: 'json' } -import ro from './ro.json' assert { type: 'json' } -import rs from './rs.json' assert { type: 'json' } -import rsLatin from './rs-latin.json' assert { type: 'json' } -import ru from './ru.json' assert { type: 'json' } -import sv from './sv.json' assert { type: 'json' } -import th from './th.json' assert { type: 'json' } -import tr from './tr.json' assert { type: 'json' } -import ua from './ua.json' assert { type: 'json' } -import vi from './vi.json' assert { type: 'json' } -import zh from './zh.json' assert { type: 'json' } -import zhTw from './zh-tw.json' assert { type: 'json' } +const { default: ar } = await import('./ar.json', { assert: { type: 'json' } }) +const { default: az } = await import('./az.json', { assert: { type: 'json' } }) +const { default: bg } = await import('./bg.json', { assert: { type: 'json' } }) +const { default: cs } = await import('./cs.json', { assert: { type: 'json' } }) +const { default: de } = await import('./de.json', { assert: { type: 'json' } }) +const { default: en } = await import('./en.json', { assert: { type: 'json' } }) +const { default: es } = await import('./es.json', { assert: { type: 'json' } }) +const { default: fa } = await import('./fa.json', { assert: { type: 'json' } }) +const { default: fr } = await import('./fr.json', { assert: { type: 'json' } }) +const { default: hr } = await import('./hr.json', { assert: { type: 'json' } }) +const { default: hu } = await import('./hu.json', { assert: { type: 'json' } }) +const { default: it } = await import('./it.json', { assert: { type: 'json' } }) +const { default: ja } = await import('./ja.json', { assert: { type: 'json' } }) +const { default: ko } = await import('./ko.json', { assert: { type: 'json' } }) +const { default: my } = await import('./my.json', { assert: { type: 'json' } }) +const { default: nb } = await import('./nb.json', { assert: { type: 'json' } }) +const { default: nl } = await import('./nl.json', { assert: { type: 'json' } }) +const { default: pl } = await import('./pl.json', { assert: { type: 'json' } }) +const { default: pt } = await import('./pt.json', { assert: { type: 'json' } }) +const { default: ro } = await import('./ro.json', { assert: { type: 'json' } }) +const { default: rs } = await import('./rs.json', { assert: { type: 'json' } }) +const { default: rsLatin } = await import('./rs-latin.json', { assert: { type: 'json' } }) +const { default: ru } = await import('./ru.json', { assert: { type: 'json' } }) +const { default: sv } = await import('./sv.json', { assert: { type: 'json' } }) +const { default: th } = await import('./th.json', { assert: { type: 'json' } }) +const { default: tr } = await import('./tr.json', { assert: { type: 'json' } }) +const { default: ua } = await import('./ua.json', { assert: { type: 'json' } }) +const { default: vi } = await import('./vi.json', { assert: { type: 'json' } }) +const { default: zh } = await import('./zh.json', { assert: { type: 'json' } }) +const { default: zhTw } = await import('./zh-tw.json', { assert: { type: 'json' } }) export const translations = { ar, diff --git a/packages/translations/src/_generatedFiles_/client/index.ts b/packages/translations/src/_generatedFiles_/client/index.ts index 7ab7ae98b2..fb2376ff6e 100644 --- a/packages/translations/src/_generatedFiles_/client/index.ts +++ b/packages/translations/src/_generatedFiles_/client/index.ts @@ -1,33 +1,33 @@ -import ar from './ar.json' assert { type: 'json' } -import az from './az.json' assert { type: 'json' } -import bg from './bg.json' assert { type: 'json' } -import cs from './cs.json' assert { type: 'json' } -import de from './de.json' assert { type: 'json' } -import en from './en.json' assert { type: 'json' } -import es from './es.json' assert { type: 'json' } -import fa from './fa.json' assert { type: 'json' } -import fr from './fr.json' assert { type: 'json' } -import hr from './hr.json' assert { type: 'json' } -import hu from './hu.json' assert { type: 'json' } -import it from './it.json' assert { type: 'json' } -import ja from './ja.json' assert { type: 'json' } -import ko from './ko.json' assert { type: 'json' } -import my from './my.json' assert { type: 'json' } -import nb from './nb.json' assert { type: 'json' } -import nl from './nl.json' assert { type: 'json' } -import pl from './pl.json' assert { type: 'json' } -import pt from './pt.json' assert { type: 'json' } -import ro from './ro.json' assert { type: 'json' } -import rs from './rs.json' assert { type: 'json' } -import rsLatin from './rs-latin.json' assert { type: 'json' } -import ru from './ru.json' assert { type: 'json' } -import sv from './sv.json' assert { type: 'json' } -import th from './th.json' assert { type: 'json' } -import tr from './tr.json' assert { type: 'json' } -import ua from './ua.json' assert { type: 'json' } -import vi from './vi.json' assert { type: 'json' } -import zh from './zh.json' assert { type: 'json' } -import zhTw from './zh-tw.json' assert { type: 'json' } +const { default: ar } = await import('./ar.json', { assert: { type: 'json' } }) +const { default: az } = await import('./az.json', { assert: { type: 'json' } }) +const { default: bg } = await import('./bg.json', { assert: { type: 'json' } }) +const { default: cs } = await import('./cs.json', { assert: { type: 'json' } }) +const { default: de } = await import('./de.json', { assert: { type: 'json' } }) +const { default: en } = await import('./en.json', { assert: { type: 'json' } }) +const { default: es } = await import('./es.json', { assert: { type: 'json' } }) +const { default: fa } = await import('./fa.json', { assert: { type: 'json' } }) +const { default: fr } = await import('./fr.json', { assert: { type: 'json' } }) +const { default: hr } = await import('./hr.json', { assert: { type: 'json' } }) +const { default: hu } = await import('./hu.json', { assert: { type: 'json' } }) +const { default: it } = await import('./it.json', { assert: { type: 'json' } }) +const { default: ja } = await import('./ja.json', { assert: { type: 'json' } }) +const { default: ko } = await import('./ko.json', { assert: { type: 'json' } }) +const { default: my } = await import('./my.json', { assert: { type: 'json' } }) +const { default: nb } = await import('./nb.json', { assert: { type: 'json' } }) +const { default: nl } = await import('./nl.json', { assert: { type: 'json' } }) +const { default: pl } = await import('./pl.json', { assert: { type: 'json' } }) +const { default: pt } = await import('./pt.json', { assert: { type: 'json' } }) +const { default: ro } = await import('./ro.json', { assert: { type: 'json' } }) +const { default: rs } = await import('./rs.json', { assert: { type: 'json' } }) +const { default: rsLatin } = await import('./rs-latin.json', { assert: { type: 'json' } }) +const { default: ru } = await import('./ru.json', { assert: { type: 'json' } }) +const { default: sv } = await import('./sv.json', { assert: { type: 'json' } }) +const { default: th } = await import('./th.json', { assert: { type: 'json' } }) +const { default: tr } = await import('./tr.json', { assert: { type: 'json' } }) +const { default: ua } = await import('./ua.json', { assert: { type: 'json' } }) +const { default: vi } = await import('./vi.json', { assert: { type: 'json' } }) +const { default: zh } = await import('./zh.json', { assert: { type: 'json' } }) +const { default: zhTw } = await import('./zh-tw.json', { assert: { type: 'json' } }) export const translations = { ar, diff --git a/packages/translations/src/all/index.ts b/packages/translations/src/all/index.ts index 7ab7ae98b2..fb2376ff6e 100644 --- a/packages/translations/src/all/index.ts +++ b/packages/translations/src/all/index.ts @@ -1,33 +1,33 @@ -import ar from './ar.json' assert { type: 'json' } -import az from './az.json' assert { type: 'json' } -import bg from './bg.json' assert { type: 'json' } -import cs from './cs.json' assert { type: 'json' } -import de from './de.json' assert { type: 'json' } -import en from './en.json' assert { type: 'json' } -import es from './es.json' assert { type: 'json' } -import fa from './fa.json' assert { type: 'json' } -import fr from './fr.json' assert { type: 'json' } -import hr from './hr.json' assert { type: 'json' } -import hu from './hu.json' assert { type: 'json' } -import it from './it.json' assert { type: 'json' } -import ja from './ja.json' assert { type: 'json' } -import ko from './ko.json' assert { type: 'json' } -import my from './my.json' assert { type: 'json' } -import nb from './nb.json' assert { type: 'json' } -import nl from './nl.json' assert { type: 'json' } -import pl from './pl.json' assert { type: 'json' } -import pt from './pt.json' assert { type: 'json' } -import ro from './ro.json' assert { type: 'json' } -import rs from './rs.json' assert { type: 'json' } -import rsLatin from './rs-latin.json' assert { type: 'json' } -import ru from './ru.json' assert { type: 'json' } -import sv from './sv.json' assert { type: 'json' } -import th from './th.json' assert { type: 'json' } -import tr from './tr.json' assert { type: 'json' } -import ua from './ua.json' assert { type: 'json' } -import vi from './vi.json' assert { type: 'json' } -import zh from './zh.json' assert { type: 'json' } -import zhTw from './zh-tw.json' assert { type: 'json' } +const { default: ar } = await import('./ar.json', { assert: { type: 'json' } }) +const { default: az } = await import('./az.json', { assert: { type: 'json' } }) +const { default: bg } = await import('./bg.json', { assert: { type: 'json' } }) +const { default: cs } = await import('./cs.json', { assert: { type: 'json' } }) +const { default: de } = await import('./de.json', { assert: { type: 'json' } }) +const { default: en } = await import('./en.json', { assert: { type: 'json' } }) +const { default: es } = await import('./es.json', { assert: { type: 'json' } }) +const { default: fa } = await import('./fa.json', { assert: { type: 'json' } }) +const { default: fr } = await import('./fr.json', { assert: { type: 'json' } }) +const { default: hr } = await import('./hr.json', { assert: { type: 'json' } }) +const { default: hu } = await import('./hu.json', { assert: { type: 'json' } }) +const { default: it } = await import('./it.json', { assert: { type: 'json' } }) +const { default: ja } = await import('./ja.json', { assert: { type: 'json' } }) +const { default: ko } = await import('./ko.json', { assert: { type: 'json' } }) +const { default: my } = await import('./my.json', { assert: { type: 'json' } }) +const { default: nb } = await import('./nb.json', { assert: { type: 'json' } }) +const { default: nl } = await import('./nl.json', { assert: { type: 'json' } }) +const { default: pl } = await import('./pl.json', { assert: { type: 'json' } }) +const { default: pt } = await import('./pt.json', { assert: { type: 'json' } }) +const { default: ro } = await import('./ro.json', { assert: { type: 'json' } }) +const { default: rs } = await import('./rs.json', { assert: { type: 'json' } }) +const { default: rsLatin } = await import('./rs-latin.json', { assert: { type: 'json' } }) +const { default: ru } = await import('./ru.json', { assert: { type: 'json' } }) +const { default: sv } = await import('./sv.json', { assert: { type: 'json' } }) +const { default: th } = await import('./th.json', { assert: { type: 'json' } }) +const { default: tr } = await import('./tr.json', { assert: { type: 'json' } }) +const { default: ua } = await import('./ua.json', { assert: { type: 'json' } }) +const { default: vi } = await import('./vi.json', { assert: { type: 'json' } }) +const { default: zh } = await import('./zh.json', { assert: { type: 'json' } }) +const { default: zhTw } = await import('./zh-tw.json', { assert: { type: 'json' } }) export const translations = { ar, diff --git a/tsconfig.json b/tsconfig.json index 3d881240e5..4dcc51dc91 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,11 +10,7 @@ "esModuleInterop": true, "forceConsistentCasingInFileNames": true, "jsx": "preserve", - "lib": [ - "dom", - "dom.iterable", - "esnext" - ], + "lib": ["dom", "dom.iterable", "esnext"], "noEmit": true, "outDir": "./dist", "resolveJsonModule": true, @@ -22,11 +18,7 @@ "skipLibCheck": true, "sourceMap": true, "strict": false, - "types": [ - "jest", - "node", - "@types/jest" - ], + "types": ["jest", "node", "@types/jest"], "incremental": true, "isolatedModules": true, "plugins": [ @@ -35,65 +27,28 @@ } ], "paths": { - "payload": [ - "./packages/payload/src" - ], - "payload/*": [ - "./packages/payload/src/exports/*" - ], - "@payloadcms/db-mongodb": [ - "./packages/db-mongodb/src" - ], - "@payloadcms/richtext-lexical": [ - "./packages/richtext-lexical/src" - ], - "@payloadcms/plugin-cloud": [ - "./packages/plugin-cloud/src" - ], - "@payloadcms/plugin-cloud-storage": [ - "./packages/plugin-cloud-storage/src" - ], - "@payloadcms/ui": [ - "./packages/ui/src/exports/index.ts" - ], - "@payloadcms/ui/*": [ - "./packages/ui/src/exports/*" - ], - "@payloadcms/ui/scss": [ - "./packages/ui/src/scss/styles.scss" - ], - "@payloadcms/ui/scss/app.scss": [ - "./packages/ui/src/scss/app.scss" - ], - "@payloadcms/translations": [ - "./packages/translations/src/exports/index.ts" - ], + "payload": ["./packages/payload/src"], + "payload/*": ["./packages/payload/src/exports/*"], + "@payloadcms/db-mongodb": ["./packages/db-mongodb/src"], + "@payloadcms/richtext-lexical": ["./packages/richtext-lexical/src"], + "@payloadcms/plugin-cloud": ["./packages/plugin-cloud/src"], + "@payloadcms/plugin-cloud-storage": ["./packages/plugin-cloud-storage/src"], + "@payloadcms/ui": ["./packages/ui/src/exports/index.ts"], + "@payloadcms/ui/*": ["./packages/ui/src/exports/*"], + "@payloadcms/ui/scss": ["./packages/ui/src/scss/styles.scss"], + "@payloadcms/ui/scss/app.scss": ["./packages/ui/src/scss/app.scss"], + "@payloadcms/translations": ["./packages/translations/src/exports/index.ts"], "@payloadcms/translations/client": [ "./packages/translations/src/_generatedFiles_/client/index.ts" ], - "@payloadcms/translations/api": [ - "./packages/translations/src/_generatedFiles_/api/index.ts" - ], - "@payloadcms/next/*": [ - "./packages/next/src/*" - ], - "@payloadcms/next": [ - "./packages/next/src/exports/*" - ], - "@payloadcms/graphql": [ - "./packages/graphql/src" - ], - "@payload-config": [ - "./test/_community/config.ts" - ] + "@payloadcms/translations/api": ["./packages/translations/src/_generatedFiles_/api/index.ts"], + "@payloadcms/next/*": ["./packages/next/src/*"], + "@payloadcms/next": ["./packages/next/src/exports/*"], + "@payloadcms/graphql": ["./packages/graphql/src"], + "@payload-config": ["./test/_community/config.ts"] } }, - "exclude": [ - "dist", - "build", - "temp", - "node_modules" - ], + "exclude": ["dist", "build", "temp", "node_modules"], "composite": true, "references": [ { @@ -161,4 +116,4 @@ "app/**/*.tsx", "scripts/**/*.ts" ] -} \ No newline at end of file +}