diff --git a/apps/civicsignalblog/.eslintrc.js b/apps/civicsignalblog/.eslintrc.js index 468a5ff74..857290a40 100644 --- a/apps/civicsignalblog/.eslintrc.js +++ b/apps/civicsignalblog/.eslintrc.js @@ -6,6 +6,10 @@ module.exports = { webpack: { config: "./eslint.webpack.config.js", }, + typescript: { + alwaysTryTypes: false, // we mostly have JS thus we don't need types automatically resolved + project: "./tsconfig.json", + }, }, }, }; diff --git a/apps/civicsignalblog/eslint.webpack.config.js b/apps/civicsignalblog/eslint.webpack.config.js index cb3271e24..37737cdfe 100644 --- a/apps/civicsignalblog/eslint.webpack.config.js +++ b/apps/civicsignalblog/eslint.webpack.config.js @@ -23,4 +23,8 @@ module.exports = { }, extensions: [".js"], }, + typescript: { + alwaysTryTypes: false, + project: "./tsconfig.json", + }, }; diff --git a/apps/civicsignalblog/package.json b/apps/civicsignalblog/package.json index 5abf3beeb..c6d764d71 100644 --- a/apps/civicsignalblog/package.json +++ b/apps/civicsignalblog/package.json @@ -25,7 +25,7 @@ "build-next": "NEXT_BUILD=true pnpm build-server && NEXT_BUILD=true PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH:-dist/payload.config.js} node dist/server.js", "build-payload": "payload build", "start": "PAYLOAD_CONFIG_PATH=${PAYLOAD_CONFIG_PATH:-dist/payload.config.js} NODE_ENV=${NODE_ENV:-production} node dist/server.js", - "dev": "NODE_OPTIONS='--inspect' ts-node --project tsconfig.server.json server.ts", + "dev": "NODE_OPTIONS='--inspect --conditions=dev' ts-node --project tsconfig.server.json server.ts", "lint-check": "TIMING=1 eslint './'", "lint": "TIMING=1 eslint --fix './'", "jest": "jest", @@ -88,6 +88,7 @@ "babel-jest": "catalog:", "eslint": "catalog:", "eslint-config-commons-ui": "workspace:*", + "eslint-import-resolver-typescript": "catalog:", "eslint-import-resolver-webpack": "catalog:", "eslint-plugin-import": "catalog:", "identity-obj-proxy": "catalog:", @@ -102,5 +103,15 @@ }, "engines": { "node": "20.x" + }, + "imports": { + "#civicsignalblog/*": { + "dev": [ + "./src/*.js" + ], + "default": [ + "./dist/src/*.js" + ] + } } } diff --git a/apps/civicsignalblog/payload.config.ts b/apps/civicsignalblog/payload.config.ts index 4a5b41c4e..0e56691e8 100644 --- a/apps/civicsignalblog/payload.config.ts +++ b/apps/civicsignalblog/payload.config.ts @@ -12,11 +12,11 @@ import nestedDocs from "@payloadcms/plugin-nested-docs"; import { s3Adapter } from "@payloadcms/plugin-cloud-storage/s3"; import { loadEnvConfig } from "@next/env"; +import Actions from "./src/payload/components/actions"; import Authors from "./src/payload/collections/Research/Authors"; import Media from "./src/payload/collections/Research/Media"; import Pages from "./src/payload/collections/Research/Pages"; import CivicSignalPages from "./src/payload/collections/Main/Pages"; - import Posts from "./src/payload/collections/Research/Posts"; import Publication from "./src/payload/globals/Publication"; import Research from "./src/payload/globals/Site/research"; @@ -25,8 +25,6 @@ import Tags from "./src/payload/collections/Research/Tags"; import Users from "./src/payload/collections/Users"; import { defaultLocale, locales } from "./src/payload/utils/locales"; -import Actions from "./src/payload/components/actions"; - const dev = process.env.NODE_ENV !== "production"; const projectDir = process.cwd(); loadEnvConfig(projectDir, dev); @@ -81,7 +79,6 @@ export default buildConfig({ } : undefined), admin: { - css: path.resolve(__dirname, "./src/payload/admin/scss/custom.scss"), user: Users.slug, components: { actions: [Actions], @@ -100,6 +97,10 @@ export default buildConfig({ ...config, resolve: { ...config.resolve, + alias: { + ...config.resolve.alias, + "#civicsignalblog": path.resolve(__dirname, "src"), + }, fallback: { ...config?.resolve?.fallback, fs: false, diff --git a/apps/civicsignalblog/src/payload/access/applications/main.js b/apps/civicsignalblog/src/payload/access/applications/main.js index ea89b28e6..87b8cb19c 100644 --- a/apps/civicsignalblog/src/payload/access/applications/main.js +++ b/apps/civicsignalblog/src/payload/access/applications/main.js @@ -1,5 +1,5 @@ -import { MAIN } from "../../lib/data/common/applications"; -import canAccessApplication from "../canAccessApplication"; +import canAccessApplication from "#civicsignalblog/payload/access/canAccessApplication"; +import { MAIN } from "#civicsignalblog/payload/lib/data/common/applications"; const canRead = ({ req: { user } }) => { return canAccessApplication(user, MAIN); diff --git a/apps/civicsignalblog/src/payload/access/applications/research.js b/apps/civicsignalblog/src/payload/access/applications/research.js index 2171f614e..dccecce0d 100644 --- a/apps/civicsignalblog/src/payload/access/applications/research.js +++ b/apps/civicsignalblog/src/payload/access/applications/research.js @@ -1,5 +1,5 @@ -import { RESEARCH } from "../../lib/data/common/applications"; -import canAccessApplication from "../canAccessApplication"; +import canAccessApplication from "#civicsignalblog/payload/access/canAccessApplication"; +import { RESEARCH } from "#civicsignalblog/payload/lib/data/common/applications"; const canRead = ({ req: { user } }) => { return canAccessApplication(user, RESEARCH); diff --git a/apps/civicsignalblog/src/payload/admin/scss/custom.scss b/apps/civicsignalblog/src/payload/admin/scss/custom.scss deleted file mode 100644 index d49008729..000000000 --- a/apps/civicsignalblog/src/payload/admin/scss/custom.scss +++ /dev/null @@ -1,13 +0,0 @@ -@import "~payload/scss"; - -.array-field-nested, -.group-field-nested { - .array-field__header, - .group-field__header { - h3 { - @extend %body; - color: var(--theme-elevation-800); - font-family: var(--font-body); - } - } -} diff --git a/apps/civicsignalblog/src/payload/blocks/CustomPageHeader.js b/apps/civicsignalblog/src/payload/blocks/CustomPageHeader.js index 6cbebe7f2..60b4aa444 100644 --- a/apps/civicsignalblog/src/payload/blocks/CustomPageHeader.js +++ b/apps/civicsignalblog/src/payload/blocks/CustomPageHeader.js @@ -1,4 +1,4 @@ -import image from "../fields/image"; +import image from "#civicsignalblog/payload/fields/image"; const CustomPageHeader = { slug: "custom-page-header", diff --git a/apps/civicsignalblog/src/payload/blocks/Error.js b/apps/civicsignalblog/src/payload/blocks/Error.js index 966642a3e..d30bf5d4a 100644 --- a/apps/civicsignalblog/src/payload/blocks/Error.js +++ b/apps/civicsignalblog/src/payload/blocks/Error.js @@ -1,6 +1,6 @@ import { slateEditor } from "@payloadcms/richtext-slate"; -import richText from "../fields/richText"; +import richText from "#civicsignalblog/payload/fields/richText"; const Error = { slug: "error", diff --git a/apps/civicsignalblog/src/payload/blocks/ExternalEmbed.js b/apps/civicsignalblog/src/payload/blocks/ExternalEmbed.js index 2d6fdadc3..0a2405953 100644 --- a/apps/civicsignalblog/src/payload/blocks/ExternalEmbed.js +++ b/apps/civicsignalblog/src/payload/blocks/ExternalEmbed.js @@ -1,4 +1,4 @@ -import blockFields from "../fields/blockFields"; +import blockFields from "#civicsignalblog/payload/fields/blockFields"; const ExternalEmbed = { slug: "external-embed", diff --git a/apps/civicsignalblog/src/payload/blocks/FeaturedStories.js b/apps/civicsignalblog/src/payload/blocks/FeaturedStories.js index 3c01c52c0..a4acd4919 100644 --- a/apps/civicsignalblog/src/payload/blocks/FeaturedStories.js +++ b/apps/civicsignalblog/src/payload/blocks/FeaturedStories.js @@ -1,4 +1,4 @@ -import linkGroup from "../fields/links/linkGroup"; +import linkGroup from "#civicsignalblog/payload/fields/links/linkGroup"; const FeaturedStories = { slug: "featured-stories", diff --git a/apps/civicsignalblog/src/payload/blocks/LongForm.js b/apps/civicsignalblog/src/payload/blocks/LongForm.js index 2385afdc7..0b6753daa 100644 --- a/apps/civicsignalblog/src/payload/blocks/LongForm.js +++ b/apps/civicsignalblog/src/payload/blocks/LongForm.js @@ -1,4 +1,4 @@ -import content from "../fields/content"; +import content from "#civicsignalblog/payload/fields/content"; const LongForm = { slug: "longform", diff --git a/apps/civicsignalblog/src/payload/blocks/MediaBlock.js b/apps/civicsignalblog/src/payload/blocks/MediaBlock.js index 08b2530a6..673dbb866 100644 --- a/apps/civicsignalblog/src/payload/blocks/MediaBlock.js +++ b/apps/civicsignalblog/src/payload/blocks/MediaBlock.js @@ -1,4 +1,4 @@ -import blockFields from "../fields/blockFields"; +import blockFields from "#civicsignalblog/payload/fields/blockFields"; const MediaBlock = { slug: "mediaBlock", diff --git a/apps/civicsignalblog/src/payload/blocks/RichText.js b/apps/civicsignalblog/src/payload/blocks/RichText.js index 0ad3bd8a6..ca3094e32 100644 --- a/apps/civicsignalblog/src/payload/blocks/RichText.js +++ b/apps/civicsignalblog/src/payload/blocks/RichText.js @@ -1,7 +1,7 @@ import { slateEditor } from "@payloadcms/richtext-slate"; -import blockFields from "../fields/blockFields"; -import richText from "../fields/richText"; +import blockFields from "#civicsignalblog/payload/fields/blockFields"; +import richText from "#civicsignalblog/payload/fields/richText"; const RichText = { slug: "richText", diff --git a/apps/civicsignalblog/src/payload/collections/Main/Pages.js b/apps/civicsignalblog/src/payload/collections/Main/Pages.js index aeae6a6d8..20fc0f9ec 100644 --- a/apps/civicsignalblog/src/payload/collections/Main/Pages.js +++ b/apps/civicsignalblog/src/payload/collections/Main/Pages.js @@ -1,12 +1,12 @@ -import canRead from "../../access/applications/main"; -import CustomPageHeader from "../../blocks/CustomPageHeader"; -import Error from "../../blocks/Error"; -import FeaturedStories from "../../blocks/FeaturedStories"; -import LongForm from "../../blocks/LongForm"; -import PageHeader from "../../blocks/PageHeader"; -import Posts from "../../blocks/Posts"; -import { MAIN } from "../../lib/data/common/applications"; -import pages from "../../utils/createPagesCollection"; +import canRead from "#civicsignalblog/payload/access/applications/main"; +import CustomPageHeader from "#civicsignalblog/payload/blocks/CustomPageHeader"; +import Error from "#civicsignalblog/payload/blocks/Error"; +import FeaturedStories from "#civicsignalblog/payload/blocks/FeaturedStories"; +import LongForm from "#civicsignalblog/payload/blocks/LongForm"; +import PageHeader from "#civicsignalblog/payload/blocks/PageHeader"; +import Posts from "#civicsignalblog/payload/blocks/Posts"; +import { MAIN } from "#civicsignalblog/payload/lib/data/common/applications"; +import pages from "#civicsignalblog/payload/utils/createPagesCollection"; const Pages = pages({ pageSlug: `${MAIN}-pages`, diff --git a/apps/civicsignalblog/src/payload/collections/Research/Authors.js b/apps/civicsignalblog/src/payload/collections/Research/Authors.js index ae7479291..02e870655 100644 --- a/apps/civicsignalblog/src/payload/collections/Research/Authors.js +++ b/apps/civicsignalblog/src/payload/collections/Research/Authors.js @@ -1,4 +1,4 @@ -import canRead from "../../access/applications/research"; +import canRead from "#civicsignalblog/payload/access/applications/research"; const Authors = { slug: "author", diff --git a/apps/civicsignalblog/src/payload/collections/Research/Pages.js b/apps/civicsignalblog/src/payload/collections/Research/Pages.js index 90356848a..b12f8f5c2 100644 --- a/apps/civicsignalblog/src/payload/collections/Research/Pages.js +++ b/apps/civicsignalblog/src/payload/collections/Research/Pages.js @@ -1,12 +1,12 @@ -import canRead from "../../access/applications/research"; -import CustomPageHeader from "../../blocks/CustomPageHeader"; -import Error from "../../blocks/Error"; -import FeaturedStories from "../../blocks/FeaturedStories"; -import LongForm from "../../blocks/LongForm"; -import PageHeader from "../../blocks/PageHeader"; -import Posts from "../../blocks/Posts"; -import { RESEARCH } from "../../lib/data/common/applications"; -import pages from "../../utils/createPagesCollection"; +import canRead from "#civicsignalblog/payload/access/applications/research"; +import CustomPageHeader from "#civicsignalblog/payload/blocks/CustomPageHeader"; +import Error from "#civicsignalblog/payload/blocks/Error"; +import FeaturedStories from "#civicsignalblog/payload/blocks/FeaturedStories"; +import LongForm from "#civicsignalblog/payload/blocks/LongForm"; +import PageHeader from "#civicsignalblog/payload/blocks/PageHeader"; +import Posts from "#civicsignalblog/payload/blocks/Posts"; +import { RESEARCH } from "#civicsignalblog/payload/lib/data/common/applications"; +import pages from "#civicsignalblog/payload/utils/createPagesCollection"; const Pages = pages({ pageSlug: `${RESEARCH}-pages`, diff --git a/apps/civicsignalblog/src/payload/collections/Research/Posts.js b/apps/civicsignalblog/src/payload/collections/Research/Posts.js index f4d88f9a2..0edd10398 100644 --- a/apps/civicsignalblog/src/payload/collections/Research/Posts.js +++ b/apps/civicsignalblog/src/payload/collections/Research/Posts.js @@ -1,11 +1,11 @@ -import canRead from "../../access/applications/research"; -import authors from "../../fields/authors"; -import content from "../../fields/content"; -import image from "../../fields/image"; -import publishedOn from "../../fields/publishedOn"; -import slug from "../../fields/slug"; -import tags from "../../fields/tags"; -import formatDraftUrl from "../../utils/formatDraftUrl"; +import canRead from "#civicsignalblog/payload/access/applications/research"; +import authors from "#civicsignalblog/payload/fields/authors"; +import content from "#civicsignalblog/payload/fields/content"; +import image from "#civicsignalblog/payload/fields/image"; +import publishedOn from "#civicsignalblog/payload/fields/publishedOn"; +import slug from "#civicsignalblog/payload/fields/slug/index"; +import tags from "#civicsignalblog/payload/fields/tags"; +import formatDraftUrl from "#civicsignalblog/payload/utils/formatDraftUrl"; const Posts = { slug: "posts", diff --git a/apps/civicsignalblog/src/payload/collections/Research/Tags.js b/apps/civicsignalblog/src/payload/collections/Research/Tags.js index 33b027e6a..e2c29b87a 100644 --- a/apps/civicsignalblog/src/payload/collections/Research/Tags.js +++ b/apps/civicsignalblog/src/payload/collections/Research/Tags.js @@ -1,5 +1,5 @@ -import canRead from "../../access/applications/research"; -import slug from "../../fields/slug"; +import canRead from "#civicsignalblog/payload/access/applications/research"; +import slug from "#civicsignalblog/payload/fields/slug/index"; const Tags = { slug: "tag", diff --git a/apps/civicsignalblog/src/payload/collections/Users.js b/apps/civicsignalblog/src/payload/collections/Users.js index 46baa9954..05e4dc624 100644 --- a/apps/civicsignalblog/src/payload/collections/Users.js +++ b/apps/civicsignalblog/src/payload/collections/Users.js @@ -1,12 +1,20 @@ import payload from "payload"; -import { isAdmin, isAdminFieldLevel } from "../access/isAdmin"; +import { + isAdmin, + isAdminFieldLevel, +} from "#civicsignalblog/payload/access/isAdmin"; import { isAdminOrSelf, isAdminOrSelfFieldLevel, -} from "../access/isAdminOrSelf"; -import { ROLE_DEFAULT, ROLE_OPTIONS } from "../access/roles"; -import applications, { RESEARCH } from "../lib/data/common/applications"; +} from "#civicsignalblog/payload/access/isAdminOrSelf"; +import { + ROLE_DEFAULT, + ROLE_OPTIONS, +} from "#civicsignalblog/payload/access/roles"; +import applications, { + RESEARCH, +} from "#civicsignalblog/payload/lib/data/common/applications"; const Users = { slug: "users", diff --git a/apps/civicsignalblog/src/payload/components/actions/index.tsx b/apps/civicsignalblog/src/payload/components/actions/index.tsx index 6f8a313cd..b31ee262f 100644 --- a/apps/civicsignalblog/src/payload/components/actions/index.tsx +++ b/apps/civicsignalblog/src/payload/components/actions/index.tsx @@ -1,7 +1,11 @@ +/* eslint-env browser */ + import { useAuth } from "payload/components/utilities"; import React, { useEffect, useState } from "react"; -import applications, { RESEARCH } from "../../lib/data/common/applications"; +import applications, { + RESEARCH, +} from "#civicsignalblog/payload/lib/data/common/applications"; function BeforeDashboard() { const { user } = useAuth(); @@ -32,7 +36,6 @@ function BeforeDashboard() { if (!response.ok) { throw new Error("Network response was not ok"); } - const data = await response.json(); window.location.replace(`/admin?app=${encodeURI(data.currentApp)}`); } catch (error) { @@ -44,7 +47,7 @@ function BeforeDashboard() { }; updateCurrentApp(); - }, [selectedApp]); + }, [selectedApp, user.currentApp]); const handleChange = (event) => { const selectedValue = event.target.value; @@ -64,12 +67,11 @@ function BeforeDashboard() { Loading...
) : ( - <> - + )} ); diff --git a/apps/civicsignalblog/src/payload/fields/content.js b/apps/civicsignalblog/src/payload/fields/content.js index 1951e5f53..07d1934eb 100644 --- a/apps/civicsignalblog/src/payload/fields/content.js +++ b/apps/civicsignalblog/src/payload/fields/content.js @@ -1,8 +1,8 @@ import { deepmerge } from "@mui/utils"; -import ExternalEmbed from "../blocks/ExternalEmbed"; -import MediaBlock from "../blocks/MediaBlock"; -import RichText from "../blocks/RichText"; +import ExternalEmbed from "#civicsignalblog/payload/blocks/ExternalEmbed"; +import MediaBlock from "#civicsignalblog/payload/blocks/MediaBlock"; +import RichText from "#civicsignalblog/payload/blocks/RichText"; const content = (overrides) => deepmerge( diff --git a/apps/civicsignalblog/src/payload/fields/links/link.js b/apps/civicsignalblog/src/payload/fields/links/link.js index 2518eff0e..283b44dae 100644 --- a/apps/civicsignalblog/src/payload/fields/links/link.js +++ b/apps/civicsignalblog/src/payload/fields/links/link.js @@ -1,7 +1,10 @@ import { deepmerge } from "@mui/utils"; -import { RESEARCH, MAIN } from "../../lib/data/common/applications"; -import mapLinkTypeToHref from "../../utils/mapLinkTypeToHref"; +import { + RESEARCH, + MAIN, +} from "#civicsignalblog/payload/lib/data/common/applications"; +import mapLinkTypeToHref from "#civicsignalblog/payload/utils/mapLinkTypeToHref"; export async function mapLinkToHrefBeforeValidate({ siblingData, diff --git a/apps/civicsignalblog/src/payload/fields/richText.js b/apps/civicsignalblog/src/payload/fields/richText.js index e84a3fa92..d338e33e6 100644 --- a/apps/civicsignalblog/src/payload/fields/richText.js +++ b/apps/civicsignalblog/src/payload/fields/richText.js @@ -1,6 +1,6 @@ import { deepmerge } from "@mui/utils"; -import mapLinkTypeToHref from "../utils/mapLinkTypeToHref"; +import mapLinkTypeToHref from "#civicsignalblog/payload/utils/mapLinkTypeToHref"; async function insertHref(nodes, payload) { if (!nodes?.length) { diff --git a/apps/civicsignalblog/src/payload/globals/Publication/index.js b/apps/civicsignalblog/src/payload/globals/Publication/index.js index 51ce83255..74a35a62f 100644 --- a/apps/civicsignalblog/src/payload/globals/Publication/index.js +++ b/apps/civicsignalblog/src/payload/globals/Publication/index.js @@ -1,7 +1,7 @@ -import canRead from "../../access/applications/research"; - import PostTab from "./PostTab"; +import canRead from "#civicsignalblog/payload/access/applications/research"; + const Publication = { slug: "settings-publication", label: "Publication", diff --git a/apps/civicsignalblog/src/payload/globals/Site/Components/EngagementTab.js b/apps/civicsignalblog/src/payload/globals/Site/Components/EngagementTab.js index d8f369c31..a3d4c9b68 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/Components/EngagementTab.js +++ b/apps/civicsignalblog/src/payload/globals/Site/Components/EngagementTab.js @@ -1,4 +1,4 @@ -import socialLinks from "../../../fields/socialLinks"; +import socialLinks from "#civicsignalblog/payload/fields/socialLinks"; const EngagementTab = { label: "Engagement", diff --git a/apps/civicsignalblog/src/payload/globals/Site/Components/GeneralTab.js b/apps/civicsignalblog/src/payload/globals/Site/Components/GeneralTab.js index 729bd12bd..39b424608 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/Components/GeneralTab.js +++ b/apps/civicsignalblog/src/payload/globals/Site/Components/GeneralTab.js @@ -1,5 +1,5 @@ -import image from "../../../fields/image"; -import richText from "../../../fields/richText"; +import image from "#civicsignalblog/payload/fields/image"; +import richText from "#civicsignalblog/payload/fields/richText"; const GeneralTab = { label: "General", diff --git a/apps/civicsignalblog/src/payload/globals/Site/Components/NavigationTab.js b/apps/civicsignalblog/src/payload/globals/Site/Components/NavigationTab.js index 5d6778435..da803dae2 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/Components/NavigationTab.js +++ b/apps/civicsignalblog/src/payload/globals/Site/Components/NavigationTab.js @@ -1,6 +1,6 @@ -import link from "../../../fields/links/link"; -import linkArray from "../../../fields/links/linkArray"; -import { socialMediaOptions } from "../../../fields/socialLinks"; +import link from "#civicsignalblog/payload/fields/links/link"; +import linkArray from "#civicsignalblog/payload/fields/links/linkArray"; +import { socialMediaOptions } from "#civicsignalblog/payload/fields/socialLinks"; const linkField = link({ disableOpenInNewTab: true, diff --git a/apps/civicsignalblog/src/payload/globals/Site/main.js b/apps/civicsignalblog/src/payload/globals/Site/main.js index 8f74ccebe..733c873e9 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/main.js +++ b/apps/civicsignalblog/src/payload/globals/Site/main.js @@ -1,11 +1,11 @@ -import canRead from "../../access/applications/main"; -import { MAIN } from "../../lib/data/common/applications"; -import settings from "../../utils/createGlobalSettings"; - import EngagementTab from "./Components/EngagementTab"; import GeneralTab from "./Components/GeneralTab"; import NavigationTab from "./Components/NavigationTab"; +import canRead from "#civicsignalblog/payload/access/applications/main"; +import { MAIN } from "#civicsignalblog/payload/lib/data/common/applications"; +import settings from "#civicsignalblog/payload/utils/createGlobalSettings"; + const Main = settings({ slug: `settings-${MAIN}-site`, label: "Site", diff --git a/apps/civicsignalblog/src/payload/globals/Site/research.js b/apps/civicsignalblog/src/payload/globals/Site/research.js index f0fbd5256..fbba06602 100644 --- a/apps/civicsignalblog/src/payload/globals/Site/research.js +++ b/apps/civicsignalblog/src/payload/globals/Site/research.js @@ -1,11 +1,11 @@ -import canRead from "../../access/applications/research"; -import { RESEARCH } from "../../lib/data/common/applications"; -import settings from "../../utils/createGlobalSettings"; - import EngagementTab from "./Components/EngagementTab"; import GeneralTab from "./Components/GeneralTab"; import NavigationTab from "./Components/NavigationTab"; +import canRead from "#civicsignalblog/payload/access/applications/research"; +import { RESEARCH } from "#civicsignalblog/payload/lib/data/common/applications"; +import settings from "#civicsignalblog/payload/utils/createGlobalSettings"; + const Research = settings({ slug: `settings-${RESEARCH}-site`, label: " Site", diff --git a/apps/civicsignalblog/src/payload/utils/createPagesCollection.js b/apps/civicsignalblog/src/payload/utils/createPagesCollection.js index f5b409b5d..d4072b682 100644 --- a/apps/civicsignalblog/src/payload/utils/createPagesCollection.js +++ b/apps/civicsignalblog/src/payload/utils/createPagesCollection.js @@ -1,8 +1,8 @@ -import fullTitle from "../fields/fullTitle"; -import slug from "../fields/slug"; - import formatDraftUrl from "./formatDraftUrl"; +import fullTitle from "#civicsignalblog/payload/fields/fullTitle/index"; +import slug from "#civicsignalblog/payload/fields/slug/index"; + const Pages = ({ pageSlug, group, diff --git a/apps/civicsignalblog/tsconfig.json b/apps/civicsignalblog/tsconfig.json index b75546819..bd01d5c12 100644 --- a/apps/civicsignalblog/tsconfig.json +++ b/apps/civicsignalblog/tsconfig.json @@ -8,8 +8,8 @@ "noEmit": true, "incremental": true, "esModuleInterop": true, - "module": "esnext", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "NodeNext", "resolveJsonModule": true, "isolatedModules": true, "jsx": "preserve", @@ -17,7 +17,8 @@ "paths": { "@/civicsignalblog/*": ["./src/*"], "@/commons-ui/core/*": ["../../packages/commons-ui-core/src/*"], - "@/commons-ui/next/*": ["../../packages/commons-ui-next/src/*"] + "@/commons-ui/next/*": ["../../packages/commons-ui-next/src/*"], + "#civicsignalblog*": ["./src/*"] } }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], diff --git a/apps/civicsignalblog/tsconfig.server.json b/apps/civicsignalblog/tsconfig.server.json index e013c7a98..b410f3275 100644 --- a/apps/civicsignalblog/tsconfig.server.json +++ b/apps/civicsignalblog/tsconfig.server.json @@ -3,7 +3,8 @@ "compilerOptions": { "target": "ES2015", "noEmit": false, - "module": "CommonJS", + "module": "NodeNext", + "moduleResolution": "NodeNext", "jsx": "react", "outDir": "./dist", "rootDir": "./" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b378e674b..c275fd72b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -282,6 +282,9 @@ catalogs: eslint-import-resolver-jsconfig: specifier: ^1.1.0 version: 1.1.0 + eslint-import-resolver-typescript: + specifier: ^3.6.3 + version: 3.6.3 eslint-import-resolver-webpack: specifier: ^0.13.9 version: 0.13.9 @@ -998,12 +1001,15 @@ importers: eslint-config-commons-ui: specifier: workspace:* version: link:../../packages/eslint-config-commons-ui + eslint-import-resolver-typescript: + specifier: 'catalog:' + version: 3.6.3(eslint-import-resolver-webpack@0.13.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1) eslint-import-resolver-webpack: specifier: 'catalog:' version: 0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))) eslint-plugin-import: specifier: 'catalog:' - version: 2.30.0(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1) + version: 2.30.0(eslint-import-resolver-typescript@3.6.3)(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1) identity-obj-proxy: specifier: 'catalog:' version: 3.0.0 @@ -19665,7 +19671,7 @@ snapshots: '@types/better-sqlite3@7.6.11': dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 '@types/body-parser@1.19.5': dependencies: @@ -19676,7 +19682,7 @@ snapshots: '@types/concat-stream@2.0.3': dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 '@types/connect@3.4.36': dependencies: @@ -19688,7 +19694,7 @@ snapshots: '@types/cross-spawn@6.0.6': dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 '@types/d3-array@3.2.1': {} @@ -19764,7 +19770,7 @@ snapshots: '@types/graceful-fs@4.1.9': dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 '@types/hast@3.0.4': dependencies: @@ -19850,7 +19856,7 @@ snapshots: '@types/nodemailer@6.4.16': dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 '@types/parse-json@4.0.2': {} @@ -19927,7 +19933,7 @@ snapshots: '@types/whatwg-url@8.2.2': dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 '@types/webidl-conversions': 7.0.3 '@types/yargs-parser@21.0.3': {} @@ -20907,7 +20913,7 @@ snapshots: buffer@4.9.2: dependencies: base64-js: 1.5.1 - ieee754: 1.1.13 + ieee754: 1.2.1 isarray: 1.0.0 buffer@5.6.0: @@ -22408,6 +22414,25 @@ snapshots: - eslint-import-resolver-webpack - supports-color + eslint-import-resolver-typescript@3.6.3(eslint-import-resolver-webpack@0.13.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1): + dependencies: + '@nolyfill/is-core-module': 1.0.39 + debug: 4.3.7 + enhanced-resolve: 5.17.1 + eslint: 8.57.1 + eslint-module-utils: 2.12.0(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(eslint-import-resolver-webpack@0.13.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint-import-resolver-webpack@0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))))(eslint@8.57.1) + fast-glob: 3.3.2 + get-tsconfig: 4.8.1 + is-bun-module: 1.2.1 + is-glob: 4.0.3 + optionalDependencies: + eslint-plugin-import: 2.30.0(eslint-import-resolver-typescript@3.6.3)(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1) + transitivePeerDependencies: + - '@typescript-eslint/parser' + - eslint-import-resolver-node + - eslint-import-resolver-webpack + - supports-color + eslint-import-resolver-webpack@0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))(webpack-cli@4.10.0)): dependencies: debug: 3.2.7 @@ -22429,7 +22454,7 @@ snapshots: dependencies: debug: 3.2.7 enhanced-resolve: 0.9.1 - eslint-plugin-import: 2.30.0(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1) + eslint-plugin-import: 2.30.0(eslint-import-resolver-typescript@3.6.3)(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1) find-root: 1.1.0 hasown: 2.0.2 interpret: 1.4.0 @@ -22532,6 +22557,17 @@ snapshots: transitivePeerDependencies: - supports-color + eslint-module-utils@2.12.0(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(eslint-import-resolver-webpack@0.13.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint-import-resolver-webpack@0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))))(eslint@8.57.1): + dependencies: + debug: 3.2.7 + optionalDependencies: + eslint: 8.57.1 + eslint-import-resolver-node: 0.3.9 + eslint-import-resolver-typescript: 3.6.3(eslint-import-resolver-webpack@0.13.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1) + eslint-import-resolver-webpack: 0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))) + transitivePeerDependencies: + - supports-color + eslint-module-utils@2.12.0(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-webpack@0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))(webpack-cli@4.10.0)))(eslint@8.57.1): dependencies: debug: 3.2.7 @@ -22626,6 +22662,32 @@ snapshots: - eslint-import-resolver-webpack - supports-color + eslint-plugin-import@2.30.0(eslint-import-resolver-typescript@3.6.3)(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1): + dependencies: + '@rtsao/scc': 1.1.0 + array-includes: 3.1.8 + array.prototype.findlastindex: 1.2.5 + array.prototype.flat: 1.3.2 + array.prototype.flatmap: 1.3.2 + debug: 3.2.7 + doctrine: 2.1.0 + eslint: 8.57.1 + eslint-import-resolver-node: 0.3.9 + eslint-module-utils: 2.12.0(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.3(eslint-import-resolver-webpack@0.13.9)(eslint-plugin-import@2.30.0)(eslint@8.57.1))(eslint-import-resolver-webpack@0.13.9(eslint-plugin-import@2.30.0)(webpack@5.95.0(@swc/core@1.7.26(@swc/helpers@0.5.5))))(eslint@8.57.1) + hasown: 2.0.2 + is-core-module: 2.15.1 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.fromentries: 2.0.8 + object.groupby: 1.0.3 + object.values: 1.2.0 + semver: 6.3.1 + tsconfig-paths: 3.15.0 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + eslint-plugin-import@2.30.0(eslint-import-resolver-webpack@0.13.9)(eslint@8.57.1): dependencies: '@rtsao/scc': 1.1.0 @@ -24421,7 +24483,7 @@ snapshots: '@jest/expect': 29.7.0 '@jest/test-result': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.10 + '@types/node': 22.7.4 chalk: 4.1.2 co: 4.6.0 dedent: 1.5.3(babel-plugin-macros@3.1.0) @@ -24530,7 +24592,7 @@ snapshots: '@jest/environment': 29.7.0 '@jest/fake-timers': 29.7.0 '@jest/types': 29.6.3 - '@types/node': 20.16.10 + '@types/node': 22.7.4 jest-mock: 29.7.0 jest-util: 29.7.0 @@ -24722,7 +24784,7 @@ snapshots: jest-worker@29.7.0: dependencies: - '@types/node': 20.16.10 + '@types/node': 22.7.4 jest-util: 29.7.0 merge-stream: 2.0.0 supports-color: 8.1.1 @@ -30436,7 +30498,7 @@ snapshots: xml2js@0.6.2: dependencies: - sax: 1.2.1 + sax: 1.4.1 xmlbuilder: 11.0.1 xmlbuilder@11.0.1: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 00ed543e2..4225e55fc 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -97,6 +97,7 @@ catalog: eslint-import-resolver-babel-module: ^5.3.2 eslint-import-resolver-jsconfig: ^1.1.0 eslint-import-resolver-webpack: ^0.13.9 + eslint-import-resolver-typescript: ^3.6.3 eslint-plugin-import: ^2.29.1 eslint-plugin-jest: ^28.8.3 eslint-plugin-jest-dom: ^5.4.0