diff --git a/_packages/@karrotmarket/gatsby-theme-post/.gitignore b/_packages/@karrotmarket/gatsby-theme-post/.gitignore deleted file mode 100644 index 3d56a4c69..000000000 --- a/_packages/@karrotmarket/gatsby-theme-post/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-theme-post/gatsby/gatsby-config.ts b/_packages/@karrotmarket/gatsby-theme-post/gatsby-config.mjs similarity index 90% rename from _packages/@karrotmarket/gatsby-theme-post/gatsby/gatsby-config.ts rename to _packages/@karrotmarket/gatsby-theme-post/gatsby-config.mjs index 6ce23e76c..3d26a95f9 100644 --- a/_packages/@karrotmarket/gatsby-theme-post/gatsby/gatsby-config.ts +++ b/_packages/@karrotmarket/gatsby-theme-post/gatsby-config.mjs @@ -1,9 +1,15 @@ -import type { GatsbyConfig } from 'gatsby'; +// @ts-check + +/** + * @typedef {import('gatsby').GatsbyConfig} GatsbyConfig + */ -// @ts-ignore import { linkResolver } from '@karrotmarket/gatsby-theme-post/src/@karrotmarket/gatsby-theme-prismic/linkResolver'; -const config = (): GatsbyConfig => ({ +/** + * @return {GatsbyConfig} + */ +export default { plugins: [ 'gatsby-theme-stitches', 'gatsby-plugin-svgr', @@ -50,6 +56,4 @@ const config = (): GatsbyConfig => ({ }, }, ], -}); - -export default config; +}; diff --git a/_packages/@karrotmarket/gatsby-theme-post/gatsby/gatsby-node.ts b/_packages/@karrotmarket/gatsby-theme-post/gatsby-node.mjs similarity index 58% rename from _packages/@karrotmarket/gatsby-theme-post/gatsby/gatsby-node.ts rename to _packages/@karrotmarket/gatsby-theme-post/gatsby-node.mjs index 98e110ec2..e8e9ee809 100644 --- a/_packages/@karrotmarket/gatsby-theme-post/gatsby/gatsby-node.ts +++ b/_packages/@karrotmarket/gatsby-theme-post/gatsby-node.mjs @@ -1,28 +1,42 @@ -import type { GatsbyNode, Page } from 'gatsby'; +// @ts-check + +/** + * @typedef {import('gatsby').GatsbyNode} GatsbyNode + * @typedef {import('gatsby').Page} Page + */ const gql = String.raw; -export const onCreateBabelConfig: GatsbyNode['onCreateBabelConfig'] = ({ actions }) => { +/** + * @type {GatsbyNode['onCreateBabelConfig']} + */ +export const onCreateBabelConfig = ({ actions }) => { actions.setBabelPlugin({ name: require.resolve('babel-plugin-polished'), options: {}, }); }; -export const createPages: GatsbyNode['createPages'] = async ({ graphql, actions }) => { - type Data = { - allPost: { - nodes: Array<{ - id: string; - slug: string; - category: { - uid: string; - }; - }>; - }; - }; +/** + * @type {GatsbyNode['createPages']} + */ +export const createPages = async ({ graphql, actions }) => { + /** + * @typedef {{ + * allPost: { + * nodes: Array<{ + * id: string; + * slug: string; + * category: { + * uid: string; + * }; + * }>; + * }; + * }} Data + */ - const { data, errors } = await graphql( + /** @type {{ data?: Data, errors?: any }} */ + const { data, errors } = await graphql( gql` query { allPost{ diff --git a/_packages/@karrotmarket/gatsby-theme-post/package.json b/_packages/@karrotmarket/gatsby-theme-post/package.json index b5f10c66e..7c019f3ff 100644 --- a/_packages/@karrotmarket/gatsby-theme-post/package.json +++ b/_packages/@karrotmarket/gatsby-theme-post/package.json @@ -2,15 +2,9 @@ "name": "@karrotmarket/gatsby-theme-post", "version": "0.0.1", "private": true, - "scripts": { - "init:gatsby": "yarn build", - "build": "concurrently \"yarn:build:*\"", - "build:babel": "babel gatsby -d . -x .ts,.tsx --presets gatsby-package", - "prepack": "yarn build" - }, "peerDependencies": { "@stitches/react": "^0.1.0 || ^0.2.0 || ^1.0.0", - "gatsby": "^4.19.0 || ^5.0.0", + "gatsby": "^5.3.0", "polished": "^4.0.0", "react": "*", "react-dom": "*" @@ -42,10 +36,6 @@ "sharp": "^0.33.4" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", - "babel-preset-gatsby-package": "^3.13.1", - "concurrently": "^8.2.2", "gatsby": "^5.13.5", "polished": "^4.3.1", "react": "^18.2.0", diff --git a/_packages/@karrotmarket/gatsby-theme-post/tsconfig.json b/_packages/@karrotmarket/gatsby-theme-post/tsconfig.json index 8fb78e30d..5e55cd912 100644 --- a/_packages/@karrotmarket/gatsby-theme-post/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-theme-post/tsconfig.json @@ -6,6 +6,5 @@ "gatsby-theme-stitches/src/*": ["./src/gatsby-theme-stitches/*"] } }, - "include": ["src/**/*", "gatsby"], "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-theme-prismic/.gitignore b/_packages/@karrotmarket/gatsby-theme-prismic/.gitignore deleted file mode 100644 index 3d56a4c69..000000000 --- a/_packages/@karrotmarket/gatsby-theme-prismic/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-theme-prismic/gatsby/gatsby-config.ts b/_packages/@karrotmarket/gatsby-theme-prismic/gatsby-config.mjs similarity index 61% rename from _packages/@karrotmarket/gatsby-theme-prismic/gatsby/gatsby-config.ts rename to _packages/@karrotmarket/gatsby-theme-prismic/gatsby-config.mjs index d3cc984c2..5d67b79b0 100644 --- a/_packages/@karrotmarket/gatsby-theme-prismic/gatsby/gatsby-config.ts +++ b/_packages/@karrotmarket/gatsby-theme-prismic/gatsby-config.mjs @@ -1,5 +1,9 @@ -import type { LinkResolverFunction } from '@prismicio/helpers'; -import type { GatsbyConfig } from 'gatsby'; +// @ts-check + +/** + * @typedef {import('gatsby').GatsbyConfig} GatsbyConfig + * @typedef {import('@prismicio/helpers').LinkResolverFunction} LinkResolverFunction + */ // https://karrot.prismic.io const repositoryName = 'karrot'; @@ -8,13 +12,20 @@ const repositoryName = 'karrot'; const customTypesApiToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0eXBlIjoibWFjaGluZTJtYWNoaW5lIiwiZGJpZCI6ImthcnJvdC00NzU3OWU1Yy1jZjg5LTQ3YTMtODVjMS01MDkzMWM3MzU0ZTlfNSIsImRhdGUiOjE2MzcwODI3NzMsImRvbWFpbiI6ImthcnJvdCIsImlhdCI6MTYzNzA4Mjc3M30.QQfmjFJK_vPZT9765NP1UI9h6Prvr46AnIOrAiUm0fU'; -type ThemeOptions = { - accessToken?: string; - linkResolver?: LinkResolverFunction; -}; +/** + * @typedef {{ + * accessToken?: string; + * linkResolver?: LinkResolverFunction; + * }} ThemeOptions + */ -const config = ({ accessToken, linkResolver }: ThemeOptions): GatsbyConfig => ({ +/** + * @param {ThemeOptions} options + * @return {GatsbyConfig} + */ +const config = ({ accessToken, linkResolver }) => ({ plugins: [ + /** @type {satisfies import('gatsby-source-prismic').PluginOptions} */ { resolve: 'gatsby-source-prismic', options: { @@ -29,14 +40,15 @@ const config = ({ accessToken, linkResolver }: ThemeOptions): GatsbyConfig => ({ fit: 'max', q: 100, }, - } satisfies import('gatsby-source-prismic').PluginOptions, + }, }, + /** @type {satisfies import('gatsby-plugin-prismic-previews').PluginOptions} */ { resolve: 'gatsby-plugin-prismic-previews', options: { repositoryName, accessToken, - } satisfies import('gatsby-plugin-prismic-previews').PluginOptions, + }, }, ], }); diff --git a/_packages/@karrotmarket/gatsby-theme-prismic/package.json b/_packages/@karrotmarket/gatsby-theme-prismic/package.json index 2d55215fe..6cd63a980 100644 --- a/_packages/@karrotmarket/gatsby-theme-prismic/package.json +++ b/_packages/@karrotmarket/gatsby-theme-prismic/package.json @@ -6,13 +6,6 @@ "url": "git+https://github.com/daangn/websites", "directory": "_packages/@karrotmarket/gatsby-theme-prismic" }, - "scripts": { - "init:gatsby": "yarn build", - "build": "concurrently \"yarn:build:*\"", - "build:babel": "babel gatsby -d . -x .ts,.tsx --presets gatsby-package", - "build:dts": "tsc --emitDeclarationOnly --skipLibCheck", - "prepack": "yarn build" - }, "files": [ "index.js", "src", @@ -22,7 +15,7 @@ "gatsby-ssr.js" ], "peerDependencies": { - "gatsby": "^4.19.0 || ^5.0.0", + "gatsby": "^5.3.0", "react": "*", "react-dom": "*" }, @@ -34,13 +27,9 @@ "prismic-reactjs": "^1.3.4" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", "@types/node": "^20.11.28", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "babel-preset-gatsby-package": "^3.13.1", - "concurrently": "^8.2.2", "gatsby": "^5.13.5", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/_packages/@karrotmarket/gatsby-theme-prismic/src/linkResolver.js b/_packages/@karrotmarket/gatsby-theme-prismic/src/linkResolver.js new file mode 100644 index 000000000..15b22c057 --- /dev/null +++ b/_packages/@karrotmarket/gatsby-theme-prismic/src/linkResolver.js @@ -0,0 +1,10 @@ +// @ts-check + +/** + * @typedef {import('@prismicio/helpers').LinkResolverFunction} LinkResolverFunction + */ + +/** @type {LinkResolverFunction} */ +exports.linkResolver = (_doc) => { + return '/'; +}; diff --git a/_packages/@karrotmarket/gatsby-theme-prismic/src/linkResolver.ts b/_packages/@karrotmarket/gatsby-theme-prismic/src/linkResolver.ts deleted file mode 100644 index 25b6991b1..000000000 --- a/_packages/@karrotmarket/gatsby-theme-prismic/src/linkResolver.ts +++ /dev/null @@ -1,5 +0,0 @@ -import type { LinkResolverFunction } from '@prismicio/helpers'; - -export const linkResolver: LinkResolverFunction = (_doc) => { - return '/'; -}; diff --git a/_packages/@karrotmarket/gatsby-theme-prismic/tsconfig.json b/_packages/@karrotmarket/gatsby-theme-prismic/tsconfig.json index 4e784cb0f..3e3cc2f02 100644 --- a/_packages/@karrotmarket/gatsby-theme-prismic/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-theme-prismic/tsconfig.json @@ -1,10 +1,7 @@ { "extends": "../../../tsconfig.json", "compilerOptions": { - "rootDir": "gatsby", - "outDir": ".", "jsx": "react" }, - "include": ["gatsby"], - "exclude": ["node_modules"] + "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-theme-seed-design/.gitignore b/_packages/@karrotmarket/gatsby-theme-seed-design/.gitignore deleted file mode 100644 index 3d56a4c69..000000000 --- a/_packages/@karrotmarket/gatsby-theme-seed-design/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby-config.mjs b/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby-config.mjs new file mode 100644 index 000000000..5acb0b8f0 --- /dev/null +++ b/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby-config.mjs @@ -0,0 +1,28 @@ +// @ts-check + +/** + * @typedef {import('gatsby').GatsbyConfig} GatsbyConfig + */ + +/** + * @typedef {{ + * mode?: string, + * }} PluginOptions + */ + +/** + * @param {PluginOptions} options + * @return {GatsbyConfig} + */ +const config = ({ mode }) => ({ + plugins: [ + { + resolve: 'gatsby-plugin-seed-design', + options: { + mode, + }, + }, + ], +}); + +export default config; diff --git a/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby/gatsby-ssr.tsx b/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby-ssr.tsx similarity index 100% rename from _packages/@karrotmarket/gatsby-theme-seed-design/gatsby/gatsby-ssr.tsx rename to _packages/@karrotmarket/gatsby-theme-seed-design/gatsby-ssr.tsx diff --git a/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby/gatsby-config.ts b/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby/gatsby-config.ts deleted file mode 100644 index 2dde203d0..000000000 --- a/_packages/@karrotmarket/gatsby-theme-seed-design/gatsby/gatsby-config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { GatsbyConfig } from 'gatsby'; - -type PluginOptions = { - mode?: string; -}; - -const config = ({ mode }: PluginOptions): GatsbyConfig => ({ - plugins: [ - { - resolve: 'gatsby-plugin-seed-design', - options: { - mode, - }, - }, - ], -}); - -export default config; diff --git a/_packages/@karrotmarket/gatsby-theme-seed-design/package.json b/_packages/@karrotmarket/gatsby-theme-seed-design/package.json index c70f628c5..50b6fdef3 100644 --- a/_packages/@karrotmarket/gatsby-theme-seed-design/package.json +++ b/_packages/@karrotmarket/gatsby-theme-seed-design/package.json @@ -3,13 +3,10 @@ "version": "0.0.0", "private": true, "scripts": { - "init:gatsby": "yarn build", - "prepack": "yarn build", - "build": "babel gatsby -d . -x .ts,.tsx --presets gatsby-package", "generate": "seed-icon generate" }, "peerDependencies": { - "gatsby": "^4.19.0 || ^5.0.0", + "gatsby": "^5.3.0", "react": "^18.0.0", "react-dom": "^18.0.0" }, @@ -17,12 +14,9 @@ "gatsby-plugin-seed-design": "^0.2.7" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", "@seed-design/icon": "^0.5.8", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "babel-preset-gatsby-package": "^3.13.1", "gatsby": "^5.13.5", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/_packages/@karrotmarket/gatsby-theme-seed-design/tsconfig.json b/_packages/@karrotmarket/gatsby-theme-seed-design/tsconfig.json index d12c77800..3e3cc2f02 100644 --- a/_packages/@karrotmarket/gatsby-theme-seed-design/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-theme-seed-design/tsconfig.json @@ -3,6 +3,5 @@ "compilerOptions": { "jsx": "react" }, - "include": ["src", "gatsby"], "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/.gitignore b/_packages/@karrotmarket/gatsby-theme-website-team/.gitignore deleted file mode 100644 index 6e40a6104..000000000 --- a/_packages/@karrotmarket/gatsby-theme-website-team/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -/.cache/ -/public/ -/dist/ - -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-config.ts b/_packages/@karrotmarket/gatsby-theme-website-team/gatsby-config.mjs similarity index 72% rename from _packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-config.ts rename to _packages/@karrotmarket/gatsby-theme-website-team/gatsby-config.mjs index a65c11db9..da4eeb391 100644 --- a/_packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-config.ts +++ b/_packages/@karrotmarket/gatsby-theme-website-team/gatsby-config.mjs @@ -1,13 +1,27 @@ -import type { GatsbyConfig } from 'gatsby'; -import { assemble as assembleHangul, disassemble as disassembleHangul } from 'hangul-js'; +// @ts-check -// @ts-ignore -import { linkResolver } from '@karrotmarket/gatsby-theme-website-team/src/@karrotmarket/gatsby-theme-prismic/linkResolver'; -import type { PluginOptions } from './types'; +/** + * @typedef {import('gatsby').GatsbyConfig} GatsbyConfig + * @typedef {import('./types').PluginOptions} PluginOptions; + */ +import * as path from 'node:path'; +import { fileURLToPath } from 'node:url'; +import { createRequire } from 'node:module'; + +import Hangul from 'hangul-js'; + +import { linkResolver } from '@karrotmarket/gatsby-theme-website-team/src/@karrotmarket/gatsby-theme-prismic/linkResolver.js'; + +const __dirname = path.dirname(fileURLToPath(import.meta.url)); +const require = createRequire(import.meta.url); const gql = String.raw; -const config = ({ locale }: PluginOptions): GatsbyConfig => ({ +/** + * @param {PluginOptions} options + * @return {GatsbyConfig} + */ +const config = ({ locale }) => ({ siteMetadata: { locale, }, @@ -60,17 +74,19 @@ const config = ({ locale }: PluginOptions): GatsbyConfig => ({ name: 'jobPosts', engine: 'flexsearch', engineOptions: { - tokenize: (str: string) => { + /** @param {string} str */ + tokenize: (str) => { const index = JSON.parse(str); const specialCharactersRegex = /[\{\}\[\]\/?.,;:|\)*~`!^\-_+<>@\#$%&\\\=\(\'\"]/g; const splitTitle = index.title.replace(specialCharactersRegex, '').trim().split(/\s/); const wordSet = new Set([...splitTitle, ...index.keywords]); - const tokens: string[] = []; + /** @type {string[]} */ + const tokens = []; for (const word of wordSet) { - const syllables = disassembleHangul(word); + const syllables = Hangul.disassemble(word); for (let i = 0; i < syllables.length; i++) { - const token = assembleHangul(syllables.slice(0, i + 1)).toLocaleLowerCase(); + const token = Hangul.assemble(syllables.slice(0, i + 1)).toLocaleLowerCase(); tokens.push(token); } } @@ -90,8 +106,7 @@ const config = ({ locale }: PluginOptions): GatsbyConfig => ({ ref: 'id', index: ['title', 'keywords'], store: ['id'], - // biome-ignore lint/suspicious/noExplicitAny: intentional - normalizer: ({ data }: any) => data.allJobPost.nodes, + normalizer: ({ data }) => data.allJobPost.nodes, }, }, diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-node.ts b/_packages/@karrotmarket/gatsby-theme-website-team/gatsby-node.mjs similarity index 73% rename from _packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-node.ts rename to _packages/@karrotmarket/gatsby-theme-website-team/gatsby-node.mjs index 64140cf07..ae215d9db 100644 --- a/_packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-node.ts +++ b/_packages/@karrotmarket/gatsby-theme-website-team/gatsby-node.mjs @@ -1,26 +1,34 @@ -import type { GatsbyNode, Page } from 'gatsby'; -import type { PluginOptions } from './types'; +// @ts-check + +/** + * @typedef {import('gatsby').GatsbyNode} GatsbyNode + * @typedef {import('gatsby').Page} Page + * @typedef {import('./types').PluginOptions} PluginOptions + */ + +import { createRequire } from 'node:module'; +const require = createRequire(import.meta.url); const gql = String.raw; -export const pluginOptionsSchema: GatsbyNode['pluginOptionsSchema'] = ({ Joi }) => { +/** @type {GatsbyNode['pluginOptionsSchema']} */ +export const pluginOptionsSchema = ({ Joi }) => { return Joi.object({ locale: Joi.string().required(), navigationId: Joi.string().required(), }); }; -export const onCreateBabelConfig: GatsbyNode['onCreateBabelConfig'] = ({ actions }) => { +/** @type {GatsbyNode['onCreateBabelConfig']} */ +export const onCreateBabelConfig = ({ actions }) => { actions.setBabelPlugin({ name: require.resolve('babel-plugin-polished'), options: {}, }); }; -export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = ({ - actions, - schema, -}) => { +/** @type {GatsbyNode['createSchemaCustomization']} */ +export const createSchemaCustomization = ({ actions, schema }) => { // FIXME // see https://github.com/angeloashmore/gatsby-source-prismic/issues/382 actions.createTypes(gql` @@ -61,8 +69,11 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] } `); - // Strip HTML description - const resolveDescriptionText = (source: { description?: string }) => { + /** + * Strip HTML description + * @param {{ description?: string }} source + */ + const resolveDescriptionText = (source) => { const tags = /<[^>]*>?/gm; return source.description ? source.description.replace(tags, '') : null; }; @@ -107,7 +118,10 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] // Note: Command E 인덱싱 용으로 추가함 absoluteUrl: { type: 'String!', - resolve(source: { ghId: string }, _args, ctx) { + /** + * @param {{ ghId: string }} source + */ + resolve(source, _args, ctx) { const site = ctx.nodeModel.getNodeById({ id: 'Site', type: 'Site' }); const { origin } = new URL(site.siteMetadata.siteUrl); return `${origin}/jobs/${source.ghId}/`; @@ -118,56 +132,57 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] ]); }; -export const createPages: GatsbyNode['createPages'] = async ( - { graphql, actions }, - pluginOptions, -) => { - const { locale, navigationId } = pluginOptions as unknown as PluginOptions; +/** @type {GatsbyNode['createPages']} */ +export const createPages = async ({ graphql, actions }, pluginOptions) => { + const { locale, navigationId } = pluginOptions; - type Data = { - prismicTeamContents: { - data?: { - enable_faq_page?: boolean; - enable_life_page?: boolean; - enable_culture_page?: boolean; - faq_page_entries: Array<{ - faq_page: { - document: { - id: string; - uid: string; - data: { - entries: Array<{ - question: string; - answer: { - text: string; - }; - }>; - }; - }; - }; - }>; - }; - }; - allPrismicTeamsArticle: { - nodes: Array<{ - uid: string; - }>; - }; - allJobPost: { - nodes: Array<{ - id: string; - ghId: string; - }>; - }; - allJobDepartment: { - nodes: Array<{ - id: string; - slug: string; - }>; - }; - }; + /** + * @typedef {{ + * prismicTeamContents: { + * data?: { + * enable_faq_page?: boolean; + * enable_life_page?: boolean; + * enable_culture_page?: boolean; + * faq_page_entries: Array<{ + * faq_page: { + * document: { + * id: string; + * uid: string; + * data: { + * entries: Array<{ + * question: string; + * answer: { + * text: string; + * }; + * }>; + * }; + * }; + * }; + * }>; + * }; + * }; + * allPrismicTeamsArticle: { + * nodes: Array<{ + * uid: string; + * }>; + * }; + * allJobPost: { + * nodes: Array<{ + * id: string; + * ghId: string; + * }>; + * }; + * allJobDepartment: { + * nodes: Array<{ + * id: string; + * slug: string; + * }>; + * }; + * }} Data + */ - const { data, errors } = await graphql( + /** @type {{ data?: Data, errors?: any }} */ + const { data, errors } = await graphql( gql` query ($locale: String!) { prismicTeamContents(lang: { eq: $locale }) { @@ -328,13 +343,13 @@ export const createPages: GatsbyNode['createPages'] = async ( } }; -export const onCreatePage: GatsbyNode['onCreateNode'] = ( - { page: _page, actions }, - pluginOptions, -) => { - const { locale, navigationId } = pluginOptions as unknown as PluginOptions; +/** @type {GatsbyNode['onCreateNode']} */ +export const onCreatePage = ({ page: _page, actions }, pluginOptions) => { + const { locale, navigationId } = pluginOptions; - const page = _page as Page; + /** @type {Page} */ + // @ts-ignore + const page = _page; actions.deletePage(page); actions.createPage({ diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-ssr.tsx b/_packages/@karrotmarket/gatsby-theme-website-team/gatsby-ssr.tsx similarity index 100% rename from _packages/@karrotmarket/gatsby-theme-website-team/gatsby/gatsby-ssr.tsx rename to _packages/@karrotmarket/gatsby-theme-website-team/gatsby-ssr.tsx diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/package.json b/_packages/@karrotmarket/gatsby-theme-website-team/package.json index 371b625c7..178253dd4 100644 --- a/_packages/@karrotmarket/gatsby-theme-website-team/package.json +++ b/_packages/@karrotmarket/gatsby-theme-website-team/package.json @@ -2,15 +2,8 @@ "name": "@karrotmarket/gatsby-theme-website-team", "version": "0.0.0", "private": true, - "scripts": { - "init:gatsby": "yarn build", - "build": "concurrently \"yarn:build:*\"", - "build:babel": "babel gatsby -d . -x .ts,.tsx --presets gatsby-package", - "build:dts": "tsc --emitDeclarationOnly --skipLibCheck -p tsconfig.build.json", - "prepack": "yarn build" - }, "peerDependencies": { - "gatsby": "^4.19.0 || ^5.0.0", + "gatsby": "^5.3.0", "react": "*", "react-dom": "*" }, @@ -62,14 +55,10 @@ "use-dark-mode": "^2.3.1" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", "@prismicio/helpers": "^2.3.9", "@types/node": "^20.11.28", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "babel-preset-gatsby-package": "^3.13.1", - "concurrently": "^8.2.2", "react": "^18.2.0", "react-dom": "^18.2.0", "typescript": "^5.4.2" diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/src/@karrotmarket/gatsby-theme-prismic/linkResolver.js b/_packages/@karrotmarket/gatsby-theme-website-team/src/@karrotmarket/gatsby-theme-prismic/linkResolver.js index a7f71e62c..50cb022ab 100644 --- a/_packages/@karrotmarket/gatsby-theme-website-team/src/@karrotmarket/gatsby-theme-prismic/linkResolver.js +++ b/_packages/@karrotmarket/gatsby-theme-website-team/src/@karrotmarket/gatsby-theme-prismic/linkResolver.js @@ -1,4 +1,10 @@ -// Note: gatsby-config 에서 함께 사용하기 위해 CommonJS 스타일로 전환 +// @ts-check + +/** + * @typedef {import('@prismicio/helpers').LinkResolverFunction} LinkResolverFunction + */ + +/** @type {LinkResolverFunction} */ exports.linkResolver = (doc) => { switch (doc.type) { case 'site_navigation': { diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.build.json b/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.build.json deleted file mode 100644 index f41966708..000000000 --- a/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "compilerOptions": { - "rootDir": "gatsby", - "outDir": ".", - "jsx": "react" - }, - "include": ["gatsby"], - "exclude": [] -} diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.json b/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.json index 3338532e8..5e55cd912 100644 --- a/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-theme-website-team/tsconfig.json @@ -6,6 +6,5 @@ "gatsby-theme-stitches/src/*": ["./src/gatsby-theme-stitches/*"] } }, - "include": ["src/**/*", "src/**/*.json", "gatsby"], "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-theme-website-team/gatsby/types.ts b/_packages/@karrotmarket/gatsby-theme-website-team/types.d.ts similarity index 100% rename from _packages/@karrotmarket/gatsby-theme-website-team/gatsby/types.ts rename to _packages/@karrotmarket/gatsby-theme-website-team/types.d.ts diff --git a/_packages/@karrotmarket/gatsby-theme-website/.gitignore b/_packages/@karrotmarket/gatsby-theme-website/.gitignore deleted file mode 100644 index 3d56a4c69..000000000 --- a/_packages/@karrotmarket/gatsby-theme-website/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-theme-website/gatsby/gatsby-config.ts b/_packages/@karrotmarket/gatsby-theme-website/gatsby-config.mjs similarity index 56% rename from _packages/@karrotmarket/gatsby-theme-website/gatsby/gatsby-config.ts rename to _packages/@karrotmarket/gatsby-theme-website/gatsby-config.mjs index 5497af0e5..8995ee7fd 100644 --- a/_packages/@karrotmarket/gatsby-theme-website/gatsby/gatsby-config.ts +++ b/_packages/@karrotmarket/gatsby-theme-website/gatsby-config.mjs @@ -1,6 +1,13 @@ -import type { GatsbyConfig } from 'gatsby'; +// @ts-check -const config: GatsbyConfig = { +/** + * @typedef {import('gatsby').GatsbyConfig} GatsbyConfig + */ + +/** + * @type {GatsbyConfig} + */ +export default { plugins: [ 'gatsby-plugin-svgr', 'gatsby-theme-stitches', @@ -8,5 +15,3 @@ const config: GatsbyConfig = { '@karrotmarket/gatsby-theme-seed-design', ], }; - -export default config; diff --git a/_packages/@karrotmarket/gatsby-theme-website/gatsby/gatsby-node.ts b/_packages/@karrotmarket/gatsby-theme-website/gatsby-node.mjs similarity index 54% rename from _packages/@karrotmarket/gatsby-theme-website/gatsby/gatsby-node.ts rename to _packages/@karrotmarket/gatsby-theme-website/gatsby-node.mjs index b1039c7c7..66c78663c 100644 --- a/_packages/@karrotmarket/gatsby-theme-website/gatsby/gatsby-node.ts +++ b/_packages/@karrotmarket/gatsby-theme-website/gatsby-node.mjs @@ -1,6 +1,13 @@ -import { type GatsbyNode } from 'gatsby'; +// @ts-check -export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = ({ actions }) => { +/** + * @typedef {import('gatsby').GatsbyNode} GatsbyNode + */ + +/** + * @type {GatsbyNode['createSchemaCustomization']} + */ +export const createSchemaCustomization = ({ actions }) => { const gql = String.raw; actions.createTypes(gql` diff --git a/_packages/@karrotmarket/gatsby-theme-website/package.json b/_packages/@karrotmarket/gatsby-theme-website/package.json index 8131b52c9..467d730bd 100644 --- a/_packages/@karrotmarket/gatsby-theme-website/package.json +++ b/_packages/@karrotmarket/gatsby-theme-website/package.json @@ -2,17 +2,10 @@ "name": "@karrotmarket/gatsby-theme-website", "version": "0.0.1", "private": true, - "scripts": { - "init:gatsby": "yarn build", - "build": "concurrently \"yarn:build:*\"", - "build:babel": "babel gatsby -d . -x .ts,.tsx --presets gatsby-package", - "build:dts": "tsc -p tsconfig.build.json --emitDeclarationOnly --skipLibCheck", - "prepack": "yarn build" - }, "peerDependencies": { "@karrotmarket/gatsby-theme-prismic": "*", "@stitches/react": "^0.1.0 || ^0.2.0 || ^1.0.0", - "gatsby": "^4.19.0 || ^5.0.0", + "gatsby": "^5.3.0", "polished": "^4.0.0", "react": "*", "react-dom": "*" @@ -28,14 +21,10 @@ "react-intersection-observer": "^9.8.1" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", "@stitches/react": "^1.2.8", "@types/node": "^20.11.28", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "babel-preset-gatsby-package": "^3.13.1", - "concurrently": "^8.2.2", "gatsby": "^5.13.5", "polished": "^4.3.1", "react": "^18.2.0", diff --git a/_packages/@karrotmarket/gatsby-theme-website/tsconfig.build.json b/_packages/@karrotmarket/gatsby-theme-website/tsconfig.build.json deleted file mode 100644 index f41966708..000000000 --- a/_packages/@karrotmarket/gatsby-theme-website/tsconfig.build.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.json", - "compilerOptions": { - "rootDir": "gatsby", - "outDir": ".", - "jsx": "react" - }, - "include": ["gatsby"], - "exclude": [] -} diff --git a/_packages/@karrotmarket/gatsby-theme-website/tsconfig.json b/_packages/@karrotmarket/gatsby-theme-website/tsconfig.json index d12c77800..3e3cc2f02 100644 --- a/_packages/@karrotmarket/gatsby-theme-website/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-theme-website/tsconfig.json @@ -3,6 +3,5 @@ "compilerOptions": { "jsx": "react" }, - "include": ["src", "gatsby"], "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/.gitattributes b/_packages/@karrotmarket/gatsby-transformer-job-post/.gitattributes deleted file mode 100644 index 7b54f7ae9..000000000 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -/*.js linguist-generated -/*.d.ts linguist-generated diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/.gitignore b/_packages/@karrotmarket/gatsby-transformer-job-post/.gitignore deleted file mode 100644 index 3d56a4c69..000000000 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/gatsby-node.ts b/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby-node.mjs similarity index 72% rename from _packages/@karrotmarket/gatsby-transformer-job-post/gatsby/gatsby-node.ts rename to _packages/@karrotmarket/gatsby-transformer-job-post/gatsby-node.mjs index 471c2c7f1..5ade51ed8 100644 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/gatsby-node.ts +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby-node.mjs @@ -1,31 +1,40 @@ -import type { - GreenhouseJobBoardDepartmentNode, - GreenhouseJobBoardJobNode, -} from '@karrotmarket/gatsby-source-greenhouse-jobboard/types'; +// @ts-check + +/** + * @typedef {( + * import('@karrotmarket/gatsby-source-greenhouse-jobboard/types').GreenhouseJobBoardDepartmentNode + * )} GreenhouseJobBoardDepartmentNode + * + * @typedef {( + * import('@karrotmarket/gatsby-source-greenhouse-jobboard/types').GreenhouseJobBoardJobNode + * )} GreenhouseJobBoardJobNode + * + * @typedef {import('gatsby').GatsbyNode} GatsbyNode + * @typedef {import('gatsby').NodeInput} NodeInput + * + * @typedef {import('./types').PluginOptions} PluginOptions + */ + import slugify from 'cjk-slug'; -import type { GatsbyNode, NodeInput } from 'gatsby'; -import * as greenhouseJobBlockParser from './greenhouseJobBlockParser'; -import * as greenhouseJobCustomFieldParser from './greenhouseJobCustomFieldParser'; -import { isGreenhouseDepartmentNode, isGreenhouseJobNode } from './types'; -export const pluginOptionsSchema: GatsbyNode['pluginOptionsSchema'] = ({ Joi }) => { +import * as greenhouseJobBlockParser from './greenhouseJobBlockParser.mjs'; +import * as greenhouseJobCustomFieldParser from './greenhouseJobCustomFieldParser.mjs'; +import { isGreenhouseDepartmentNode, isGreenhouseJobNode } from './types.mjs'; + +/** @type {GatsbyNode['pluginOptionsSchema']} */ +export const pluginOptionsSchema = ({ Joi }) => { return Joi.object({ defaultTags: Joi.object().pattern(Joi.string(), Joi.array().items(Joi.string())), }); }; -type PluginOptions = { - defaultTags?: { - [boardToken: string]: string[]; - }; -}; - -export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = ( - ctx, - options, -) => { +/** @type {GatsbyNode['createSchemaCustomization']} */ +export const createSchemaCustomization = (ctx, options) => { const { actions, schema } = ctx; - const { defaultTags = {} } = options as unknown as PluginOptions; + + /** @type {PluginOptions} */ + // @ts-ignore + const { defaultTags = {} } = options; const gql = String.raw; const fieldParser = greenhouseJobCustomFieldParser; @@ -57,7 +66,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] extensions: { dateformat: {}, }, - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return source.updated_at; }, }, @@ -67,7 +77,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] extensions: { dateformat: {}, }, - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.validThrough(source, ctx) ?? null; }, }, @@ -79,14 +90,16 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, boardUrl: { type: 'String!', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return source.absolute_url; }, }, content: { type: '[JobPostContentSection!]!', description: 'Parsed content', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { const { content } = greenhouseJobBlockParser.parseContent(source.content); return content; }, @@ -94,50 +107,57 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] rawContent: { type: 'String!', description: 'HTML content (unsafe)', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return source.content; }, }, corporate: { type: 'JobCorporate', // 이거 왜 nullable 이더라...? description: '회사 (당근, 당근페이)', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.corporate(source, ctx); }, }, employmentType: { type: 'JobEmploymentType!', description: '고용 형태', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.employmentType(source, ctx) ?? 'FULL_TIME'; }, }, alternativeCivilianService: { type: 'Boolean!', description: '산업기능요원 근무 가능합니까?', - resolve(sourcsource: GreenhouseJobBoardJobNode) { - return fieldParser.alternativeCivilianService(sourcsource, ctx) ?? false; + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { + return fieldParser.alternativeCivilianService(source, ctx) ?? false; }, }, priorExperience: { type: 'JobPriorExperience!', description: '경력? 신입?', - resolve(sourcsourcsource: GreenhouseJobBoardJobNode) { - return fieldParser.priorExperience(sourcsourcsource, ctx) ?? 'YES'; + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { + return fieldParser.priorExperience(source, ctx) ?? 'YES'; }, }, chapter: { type: 'String!', description: '소속 챕터 (=직무)', deprecationReason: 'departments로 대체됨', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.chapter(source, ctx) ?? ''; }, }, departments: { type: '[JobDepartment!]!', description: '소속', - async resolve(source: GreenhouseJobBoardJobNode, _args, ctx) { + /** @param {GreenhouseJobBoardJobNode} source */ + async resolve(source, _args, ctx) { const departmentIds = source.departments .filter((department) => !department.child_ids.length) .filter((department) => department.id !== 0) @@ -164,14 +184,16 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] keywords: { type: '[String!]!', description: '검색 키워드', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.keywords(source, ctx) ?? []; }, }, order: { type: 'Int!', description: '정렬 선호 순위 값 (signed, 기본값: 0)', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.order(source, ctx) ?? 0; }, }, @@ -179,14 +201,16 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] type: 'String', description: '외부 링크 (공고가 바깥에서 열리는 경우.. 좀 컨텐츠 많으면 노션 링크 선호되는 경우 있음)', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return fieldParser.externalUrl(source, ctx)?.toString() ?? null; }, }, tags: { type: '[String!]!', description: '목록에서 표시할 태그', - resolve(source: GreenhouseJobBoardJobNode) { + /** @param {GreenhouseJobBoardJobNode} source */ + resolve(source) { return [ ...(defaultTags[source.boardToken] ?? []), ...(fieldParser.tags(source, ctx) ?? []), @@ -208,7 +232,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { ghId: { type: 'String!', - resolve(source: GreenhouseJobBoardDepartmentNode) { + /** @param {GreenhouseJobBoardDepartmentNode} source */ + resolve(source) { return source.ghId.toString(); }, }, @@ -217,13 +242,15 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, slug: { type: 'String', - resolve(source: GreenhouseJobBoardDepartmentNode) { + /** @param {GreenhouseJobBoardDepartmentNode} source */ + resolve(source) { return slugify(source.name); }, }, jobPosts: { type: '[JobPost!]!', - async resolve(source: GreenhouseJobBoardDepartmentNode, _args, ctx) { + /** @param {GreenhouseJobBoardDepartmentNode} source */ + async resolve(source, _args, ctx) { const { entries } = await ctx.nodeModel.findAll({ type: 'JobPost', query: { @@ -294,10 +321,12 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] `); }; -export const onCreateNode: GatsbyNode['onCreateNode'] = (ctx, options) => { +/** @type {GatsbyNode['onCreateNode']} */ +export const onCreateNode = (ctx) => { const { node, actions, createNodeId, createContentDigest } = ctx; if (isGreenhouseJobNode(node)) { - const jobPostNode: NodeInput = { + /** @type {NodeInput} */ + const jobPostNode = { ...node, id: createNodeId(`GreenhouseJobBoardJob:${node.id} >>> JobPost`), parent: node.id, @@ -319,7 +348,8 @@ export const onCreateNode: GatsbyNode['onCreateNode'] = (ctx, options) => { return; } - const jobChapterNode: NodeInput = { + /** @type {NodeInput} */ + const jobChapterNode = { ...node, id: createNodeId(`GreenhouseJobBoardDepartment:${node.id} >>> JobChapter`), parent: node.id, diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/types.ts b/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/types.ts deleted file mode 100644 index 526af2cf5..000000000 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import type { - GreenhouseJobBoardDepartmentNode, - GreenhouseJobBoardJobNode, -} from '@karrotmarket/gatsby-source-greenhouse-jobboard/types'; -import type { Node } from 'gatsby'; - -export function isGreenhouseJobNode(node: Node): node is GreenhouseJobBoardJobNode { - return node.internal.type === 'GreenhouseJobBoardJob'; -} - -export function isGreenhouseDepartmentNode(node: Node): node is GreenhouseJobBoardDepartmentNode { - return node.internal.type === 'GreenhouseJobBoardDepartment'; -} diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/greenhouseJobBlockParser.ts b/_packages/@karrotmarket/gatsby-transformer-job-post/greenhouseJobBlockParser.mjs similarity index 54% rename from _packages/@karrotmarket/gatsby-transformer-job-post/gatsby/greenhouseJobBlockParser.ts rename to _packages/@karrotmarket/gatsby-transformer-job-post/greenhouseJobBlockParser.mjs index bb0f2548a..c7da089d9 100644 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/greenhouseJobBlockParser.ts +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/greenhouseJobBlockParser.mjs @@ -1,30 +1,42 @@ -import { decode } from 'html-entities'; +// @ts-check -type Content = { - level: `H${1 | 2 | 3 | 4 | 5 | 6}`; - title: string; - bodyHtml: string; -}; +import { decode } from 'html-entities'; -type Result = { - content: Content[]; - raw: string; -}; +/** + * @typedef {{ + * level: `H${1 | 2 | 3 | 4 | 5 | 6}`; + * title: string; + * bodyHtml: string; + * }} Content + * + * @typedef {{ + * content: Content[]; + * raw: string; + * }} Result + */ -export function parseContent(contentHtml: string): Result { +/** + * @param {string} contentHtml + * @return {Result} + */ +export function parseContent(contentHtml) { const splitter = /<(h[1-6])>(.*)<\/\1>/; const parts = decode(contentHtml) .replace(/[\s\S]*?<\/div>/g, '') .split(splitter); - const result: Result = { + /** @type {Result} */ + const result = { content: [], raw: contentHtml, }; - type State = 'initial' | 'wait_title' | 'wait_body'; - let state: State = 'initial'; - let current: Partial = {}; + /** @typedef {'initial' | 'wait_title' | 'wait_body'} State */ + + /** @type {State} */ + let state = 'initial'; + /** @type {Partial} */ + let current = {}; for (const part of parts) { if (part === '') { @@ -33,7 +45,8 @@ export function parseContent(contentHtml: string): Result { switch (state) { case 'initial': { - current.level = part.toUpperCase() as Content['level']; + // @ts-ignore + current.level = part.toUpperCase(); state = 'wait_title'; break; } @@ -49,7 +62,8 @@ export function parseContent(contentHtml: string): Result { case 'wait_body': { current.bodyHtml = part.trim(); - result.content.push(current as Content); + // @ts-ignore + result.content.push(current); current = {}; state = 'initial'; diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/greenhouseJobCustomFieldParser.ts b/_packages/@karrotmarket/gatsby-transformer-job-post/greenhouseJobCustomFieldParser.mjs similarity index 67% rename from _packages/@karrotmarket/gatsby-transformer-job-post/gatsby/greenhouseJobCustomFieldParser.ts rename to _packages/@karrotmarket/gatsby-transformer-job-post/greenhouseJobCustomFieldParser.mjs index f8a1b14c2..d5db3ba48 100644 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/gatsby/greenhouseJobCustomFieldParser.ts +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/greenhouseJobCustomFieldParser.mjs @@ -1,23 +1,46 @@ -import type { GreenhouseJobBoardJobNode } from '@karrotmarket/gatsby-source-greenhouse-jobboard/types'; -import type { NodePluginArgs } from 'gatsby'; - -type FieldParser = ( - node: GreenhouseJobBoardJobNode, - context: NodePluginArgs, -) => FieldType | undefined; - -function findMetadataById( - node: GreenhouseJobBoardJobNode, - id: number, -) { +// @ts-check + +/** + * @typedef {( + * import('@karrotmarket/gatsby-source-greenhouse-jobboard/types').GreenhouseJobBoardJobNode + * )} GreenhouseJobBoardJobNode + * + * @typedef {import('gatsby').NodePluginArgs} NodePluginArgs + */ + +/** + * @template FieldType + * @typedef {( + * node: GreenhouseJobBoardJobNode, + * context: NodePluginArgs + * ) => FieldType | undefined} FieldParser + */ + +/** + * @template {string | number | null} [T=string | number | null] + * @param {GreenhouseJobBoardJobNode} node + * @param {number} id + * @return {{ + * type: GreenhouseJobBoardJobNode['metadata'][number]['value_type'], + * value: T | null, + * } | undefined} + */ +function findMetadataById(node, id) { const metadata = node.metadata.find((v) => v.id === id); - return metadata && { type: metadata.value_type, value: metadata.value as T | null }; + return ( + metadata && { + type: metadata.value_type, + /** @type {T | null} */ + // @ts-ignore + value: metadata.value, + } + ); } -export const corporate: FieldParser<'KARROT_MARKET' | 'KARROT_PAY' | null> = ( - node, - { reporter }, -) => { +/** + * @type {FieldParser<'KARROT_MARKET' | 'KARROT_PAY' | null>} + */ +export const corporate = (node, { reporter }) => { const fieldId = 6128545003; const field = findMetadataById(node, fieldId); return ( @@ -51,9 +74,8 @@ export const corporate: FieldParser<'KARROT_MARKET' | 'KARROT_PAY' | null> = ( ); }; -export const employmentType: FieldParser< - 'FULL_TIME' | 'CONTRACTOR' | 'INTERN' | 'ASSISTANT' | 'PART_TIME' -> = (node, { reporter }) => { +/** @type {FieldParser<'FULL_TIME' | 'CONTRACTOR' | 'INTERN' | 'ASSISTANT' | 'PART_TIME'>} */ +export const employmentType = (node, { reporter }) => { const fieldId = 5033980003; const field = findMetadataById(node, fieldId); return ( @@ -89,7 +111,8 @@ export const employmentType: FieldParser< ); }; -export const alternativeCivilianService: FieldParser = (node, { reporter }) => { +/** @type {FieldParser} */ +export const alternativeCivilianService = (node, { reporter }) => { const fieldId = 5784622003; const field = findMetadataById(node, fieldId); return ( @@ -117,7 +140,8 @@ export const alternativeCivilianService: FieldParser = (node, { reporte ); }; -export const priorExperience: FieldParser<'YES' | 'NO' | 'WHATEVER'> = (node, { reporter }) => { +/** @type {FieldParser<'YES' | 'NO' | 'WHATEVER'>} */ +export const priorExperience = (node, { reporter }) => { const fieldId = 5784623003; const field = findMetadataById(node, fieldId); return ( @@ -149,7 +173,8 @@ export const priorExperience: FieldParser<'YES' | 'NO' | 'WHATEVER'> = (node, { ); }; -export const keywords: FieldParser = (node) => { +/** @type {FieldParser} */ +export const keywords = (node) => { const metadata = findMetadataById(node, 6008744003); return ( (metadata?.value && @@ -159,34 +184,43 @@ export const keywords: FieldParser = (node) => { ); }; -export const chapter: FieldParser = (node) => { - const metadata = findMetadataById(node, 6015694003); +/** @type {FieldParser} */ +export const chapter = (node) => { + const metadata = findMetadataById(node, 6015694003); + // @ts-ignore return metadata?.value ?? ''; }; -export const order: FieldParser = (node) => { +/** @type {FieldParser} */ +export const order = (node) => { const fieldId = 6990001003; - const field = findMetadataById(node, fieldId); + const field = findMetadataById(node, fieldId); + // @ts-ignore return field && (field.value ?? 0 | 0); }; -export const tags: FieldParser = (node) => { +/** @type {FieldParser} */ +export const tags = (node) => { const fieldId = 6990204003; - const field = findMetadataById(node, fieldId); + const field = findMetadataById(node, fieldId); return ( field && (() => { - return field.value - ?.split(',') - .map((value) => value.trim()) - .filter(Boolean); + return ( + field.value + // @ts-ignore + ?.split(',') + .map((value) => value.trim()) + .filter(Boolean) + ); })() ); }; -export const validThrough: FieldParser = (node) => { +/** @type {FieldParser} */ +export const validThrough = (node) => { const fieldId = 6972127003; - const field = findMetadataById(node, fieldId); + const field = findMetadataById(node, fieldId); return ( field && (() => { @@ -195,12 +229,14 @@ export const validThrough: FieldParser = (node) => { ); }; -export const externalUrl: FieldParser = (node) => { +/** @type {FieldParser} */ +export const externalUrl = (node) => { const fieldId = 7142945003; - const field = findMetadataById(node, fieldId); + const field = findMetadataById(node, fieldId); return ( field && (() => { + // @ts-ignore return field.value ? new URL(field.value) : undefined; })() ); diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/jest.config.json b/_packages/@karrotmarket/gatsby-transformer-job-post/jest.config.json deleted file mode 100644 index 7e931c7a1..000000000 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/jest.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "transform": { - "\\.[jt]sx?$": [ - "babel-jest", - { - "presets": ["babel-preset-gatsby-package"] - } - ] - } -} diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/package.json b/_packages/@karrotmarket/gatsby-transformer-job-post/package.json index 41afa435f..94745cb65 100644 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/package.json +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/package.json @@ -3,32 +3,22 @@ "version": "0.0.1", "private": true, "scripts": { - "init:gatsby": "yarn build", - "test": "jest", - "build": "concurrently \"yarn:build:*\"", - "build:babel": "babel gatsby -d . -x .ts --presets gatsby-package", - "build:dts": "tsc --emitDeclarationOnly --skipLibCheck", - "prepack": "yarn build" + "test": "jest" }, "peerDependencies": { "@karrotmarket/gatsby-source-greenhouse-jobboard": "^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0", - "gatsby": "^4.19.0 || ^5.0.0" + "gatsby": "^5.3.0" }, "dependencies": { "html-entities": "^2.3.3" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", "@karrotmarket/gatsby-source-greenhouse-jobboard": "^0.10.1", "@types/common-tags": "^1.8.4", "@types/jest": "^29.5.12", "@types/node": "^20.11.28", - "babel-jest": "^29.7.0", - "babel-preset-gatsby-package": "^3.13.1", "cjk-slug": "^0.3.1", "common-tags": "^1.8.2", - "concurrently": "^8.2.2", "gatsby": "^5.13.5", "jest": "^29.5.0", "typescript": "^5.4.2" diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/tsconfig.json b/_packages/@karrotmarket/gatsby-transformer-job-post/tsconfig.json index a833d9524..f022acc77 100644 --- a/_packages/@karrotmarket/gatsby-transformer-job-post/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/tsconfig.json @@ -1,9 +1,4 @@ { "extends": "../../../tsconfig.json", - "compilerOptions": { - "rootDir": "gatsby", - "outDir": "." - }, - "include": ["gatsby"], "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/types.d.ts b/_packages/@karrotmarket/gatsby-transformer-job-post/types.d.ts new file mode 100644 index 000000000..3cc3ee236 --- /dev/null +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/types.d.ts @@ -0,0 +1,5 @@ +export type PluginOptions = { + defaultTags?: { + [boardToken: string]: string[]; + }, +}; diff --git a/_packages/@karrotmarket/gatsby-transformer-job-post/types.mjs b/_packages/@karrotmarket/gatsby-transformer-job-post/types.mjs new file mode 100644 index 000000000..a8b531204 --- /dev/null +++ b/_packages/@karrotmarket/gatsby-transformer-job-post/types.mjs @@ -0,0 +1,29 @@ +// @ts-check + +/** + * @typedef {( + * import('@karrotmarket/gatsby-source-greenhouse-jobboard/types').GreenhouseJobBoardDepartmentNode + * )} GreenhouseJobBoardDepartmentNode + * + * @typedef {( + * import('@karrotmarket/gatsby-source-greenhouse-jobboard/types').GreenhouseJobBoardJobNode + * )} GreenhouseJobBoardJobNode + * + * @typedef {import('gatsby').Node} Node + */ + +/** + * @param {Node} node + * @return {node is GreenhouseJobBoardJobNode} + */ +export function isGreenhouseJobNode(node) { + return node.internal.type === 'GreenhouseJobBoardJob'; +} + +/** + * @param {Node} node + * @return {node is GreenhouseJobBoardDepartmentNode} + */ +export function isGreenhouseDepartmentNode(node) { + return node.internal.type === 'GreenhouseJobBoardDepartment'; +} diff --git a/_packages/@karrotmarket/gatsby-transformer-post/.gitignore b/_packages/@karrotmarket/gatsby-transformer-post/.gitignore deleted file mode 100644 index 3d56a4c69..000000000 --- a/_packages/@karrotmarket/gatsby-transformer-post/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/*.js -!/index.js -/*.d.ts diff --git a/_packages/@karrotmarket/gatsby-transformer-post/gatsby/gatsby-node.ts b/_packages/@karrotmarket/gatsby-transformer-post/gatsby-node.mjs similarity index 70% rename from _packages/@karrotmarket/gatsby-transformer-post/gatsby/gatsby-node.ts rename to _packages/@karrotmarket/gatsby-transformer-post/gatsby-node.mjs index c778a611a..966847753 100644 --- a/_packages/@karrotmarket/gatsby-transformer-post/gatsby/gatsby-node.ts +++ b/_packages/@karrotmarket/gatsby-transformer-post/gatsby-node.mjs @@ -1,24 +1,26 @@ +// @ts-check + +/** + * @typedef {import('gatsby').GatsbyNode} GatsbyNode + * @typedef {import('./types').PrismicMemberProfileNode} PrismicMemberProfileNode + * @typedef {import('./types').PrismicPostDataBodyCtaButtonSlice} PrismicPostDataBodyCtaButtonSlice + * @typedef {import('./types').PrismicPostDataBodyDividerSlice} PrismicPostDataBodyDividerSlice + * @typedef {import('./types').PrismicPostDataBodyGroupImageSectionSlice} PrismicPostDataBodyGroupImageSectionSlice + * @typedef {import('./types').PrismicPostDataBodyQuoteSectionSlice} PrismicPostDataBodyQuoteSectionSlice + * @typedef {import('./types').PrismicPostDataBodySingleImageSectionSlice} PrismicPostDataBodySingleImageSectionSlice + * @typedef {import('./types').PrismicPostDataBodySummaryBulletSectionSlice} PrismicPostDataBodySummaryBulletSectionSlice + * @typedef {import('./types').PrismicPostDataBodyVerticalQuoteSectionSlice} PrismicPostDataBodyVerticalQuoteSectionSlice + * @typedef {import('./types').PrismicPostNode} PrismicPostNode + * @typedef {import('./types').PrismicPostRichTextSectionSlice} PrismicPostRichTextSectionSlice + */ + import slugify from 'cjk-slug'; -import { type GatsbyNode } from 'gatsby'; import { createRemoteFileNode } from 'gatsby-source-filesystem'; -import { - type PrismicMemberProfileNode, - type PrismicPostDataBodyCtaButtonSlice, - type PrismicPostDataBodyDividerSlice, - type PrismicPostDataBodyGroupImageSectionSlice, - type PrismicPostDataBodyQuoteSectionSlice, - type PrismicPostDataBodySingleImageSectionSlice, - type PrismicPostDataBodySummaryBulletSectionSlice, - type PrismicPostDataBodyVerticalQuoteSectionSlice, - type PrismicPostNode, - type PrismicPostRichTextSectionSlice, - isPrismicMemberProfile, - isPrismicPostCategoryNode, - isPrismicPostNode, -} from './types'; +import { isPrismicMemberProfile, isPrismicPostCategoryNode, isPrismicPostNode } from './types.mjs'; -export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] = ({ +/** @type {GatsbyNode['createSchemaCustomization']} */ +export const createSchemaCustomization = ({ schema, cache, createNodeId, @@ -66,13 +68,15 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, slug: { type: 'String!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { return node.uid && slugify(node.uid); }, }, publishedAt: { type: 'Date!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { if (!node.data.published_at) { throw new Error( `Post 의 published_at 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -83,7 +87,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, thumbnailImage: { type: 'File!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { if (!node.data.thumbnail_image.url) { throw new Error( `Post 의 thumbnail_image 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -99,7 +104,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, verticalThumbnailImage: { type: 'File!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { if (!node.tags.includes('blog')) { return null; } @@ -120,7 +126,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, title: { type: 'String!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { const titleNode = node.data.title[0]; if (!titleNode?.text) { throw new Error(`글 제목이 비어있습니다. prismic id: ${node.prismicId}`); @@ -130,7 +137,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, summary: { type: 'String!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { if (!node.data.summary) { throw new Error(`글 요약 비어있습니다. prismic id: ${node.prismicId}`); } @@ -157,7 +165,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, tags: { type: '[String!]!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { if (!node.data.tags) { return []; } @@ -166,7 +175,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, headerQuote: { type: '[JSON]', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { return node.data.header_quote; }, }, @@ -177,7 +187,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] by: 'prismicId', }, }, - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { if (!node.data.related_posts || node.data.related_posts.length === 0) { return []; } @@ -188,7 +199,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, body: { type: '[PostBodyItem!]!', - resolve(node: PrismicPostNode) { + /** @param {PrismicPostNode} node */ + resolve(node) { return node.data.body; }, }, @@ -207,7 +219,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] 'PostSummaryBulletSection', // 'PostSummaryBulletPoint', ], - resolveType(parent: PrismicPostNode['data']['body'][number]) { + /** @param {PrismicPostNode['data']['body'][number]} parent */ + resolveType(parent) { switch (parent.slice_type) { case 'rich_text_section': return 'PostRichTextSection'; @@ -238,31 +251,36 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { content: { type: 'JSON!', - resolve(parent: PrismicPostRichTextSectionSlice) { + /** @param {PrismicPostRichTextSectionSlice} parent */ + resolve(parent) { return parent; }, }, id: { type: 'String!', - resolve(parent: PrismicPostRichTextSectionSlice) { + /** @param {PrismicPostRichTextSectionSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostRichTextSectionSlice) { + /** @param {PrismicPostRichTextSectionSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, items: { type: '[JSON!]!', - resolve(parent: PrismicPostRichTextSectionSlice) { + /** @param {PrismicPostRichTextSectionSlice} parent */ + resolve(parent) { return parent.items; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostRichTextSectionSlice) { + /** @param {PrismicPostRichTextSectionSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -276,19 +294,22 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodyGroupImageSectionSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodyGroupImageSectionSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, groupImage1: { type: 'File!', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodyGroupImageSectionSlice} parent */ + resolve(parent) { if (!parent.primary.group_image1.url) { throw new Error( `GroupImageSection 의 image 필드 값이 비어있습니다. prismicId: ${parent.id}`, @@ -304,7 +325,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, groupImage2: { type: 'File!', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodyGroupImageSectionSlice} parent */ + resolve(parent) { if (!parent.primary.group_image2.url) { throw new Error( `GroupImageSection 의 image 필드 값이 비어있습니다. prismicId: ${parent.id}`, @@ -320,13 +342,15 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, groupImageCaption: { type: 'String', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodyGroupImageSectionSlice} parent */ + resolve(parent) { return parent.primary?.group_image_caption; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodyGroupImageSectionSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -340,19 +364,22 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodyQuoteSectionSlice) { + /** @param {PrismicPostDataBodyQuoteSectionSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodyQuoteSectionSlice) { + /** @param {PrismicPostDataBodyQuoteSectionSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostDataBodyQuoteSectionSlice) { + /** @param {PrismicPostDataBodyQuoteSectionSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -366,19 +393,22 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodyVerticalQuoteSectionSlice) { + /** @param {PrismicPostDataBodyVerticalQuoteSectionSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodyVerticalQuoteSectionSlice) { + /** @param {PrismicPostDataBodyVerticalQuoteSectionSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostDataBodyVerticalQuoteSectionSlice) { + /** @param {PrismicPostDataBodyVerticalQuoteSectionSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -392,19 +422,22 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodyCtaButtonSlice) { + /** @param {PrismicPostDataBodyCtaButtonSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodyCtaButtonSlice) { + /** @param {PrismicPostDataBodyCtaButtonSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostDataBodyCtaButtonSlice) { + /** @param {PrismicPostDataBodyCtaButtonSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -425,7 +458,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, name: { type: 'String!', - resolve(node: PrismicMemberProfileNode) { + /** @param {PrismicMemberProfileNode} node */ + resolve(node) { if (!node.data.name) { throw new Error( `MemberProfile 의 name 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -436,7 +470,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, image: { type: 'File!', - resolve(node: PrismicMemberProfileNode) { + /** @param {PrismicMemberProfileNode} node */ + resolve(node) { if (!node.data.image.url) { throw new Error( `MemberProfile 의 image 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -452,7 +487,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, nickname: { type: 'String!', - resolve(node: PrismicMemberProfileNode) { + /** @param {PrismicMemberProfileNode} node */ + resolve(node) { if (!node.data.nickname) { throw new Error( `MemberProfile 의 nickname 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -463,7 +499,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, email: { type: 'String!', - resolve(node: PrismicMemberProfileNode) { + /** @param {PrismicMemberProfileNode} node */ + resolve(node) { if (!node.data.email) { throw new Error( `MemberProfile 의 email 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -474,7 +511,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, role: { type: 'String!', - resolve(node: PrismicMemberProfileNode) { + /** @param {PrismicMemberProfileNode} node */ + resolve(node) { if (!node.data.role) { throw new Error( `MemberProfile 의 role 필드 값이 비어있습니다. prismicId: ${node.prismicId}`, @@ -485,7 +523,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, profileLink: { type: 'String', - resolve(node: PrismicMemberProfileNode) { + /** @param {PrismicMemberProfileNode} node */ + resolve(node) { return node.data?.profile_link?.url; }, }, @@ -499,19 +538,22 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodySingleImageSectionSlice) { + /** @param {PrismicPostDataBodySingleImageSectionSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodySingleImageSectionSlice) { + /** @param {PrismicPostDataBodySingleImageSectionSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, image: { type: 'File!', - resolve(parent: PrismicPostDataBodySingleImageSectionSlice) { + /** @param {PrismicPostDataBodySingleImageSectionSlice} parent */ + resolve(parent) { if (!parent.primary.image.url) { throw new Error( `SingleImageSection 의 image 필드 값이 비어있습니다. prismicId: ${parent.id}`, @@ -527,13 +569,15 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] }, imageCaption: { type: 'String', - resolve(parent: PrismicPostDataBodySingleImageSectionSlice) { + /** @param {PrismicPostDataBodySingleImageSectionSlice} parent */ + resolve(parent) { return parent.primary?.image_caption_text; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostDataBodyGroupImageSectionSlice) { + /** @param {PrismicPostDataBodySingleImageSectionSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -547,31 +591,36 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodyDividerSlice) { + /** @param {PrismicPostDataBodyDividerSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodyDividerSlice) { + /** @param {PrismicPostDataBodyDividerSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, fullWidthLineDivider: { type: 'Boolean', - resolve(parent: PrismicPostDataBodyDividerSlice) { + /** @param {PrismicPostDataBodyDividerSlice} parent */ + resolve(parent) { return parent.primary?.full_width_line_divider; }, }, lineDivider: { type: 'Boolean', - resolve(parent: PrismicPostDataBodyDividerSlice) { + /** @param {PrismicPostDataBodyDividerSlice} parent */ + resolve(parent) { return parent.primary?.line_divider; }, }, dotDivider: { type: 'Boolean', - resolve(parent: PrismicPostDataBodyDividerSlice) { + /** @param {PrismicPostDataBodyDividerSlice} parent */ + resolve(parent) { return parent.primary?.dot_divider; }, }, @@ -585,19 +634,22 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] fields: { id: { type: 'String!', - resolve(parent: PrismicPostDataBodySummaryBulletSectionSlice) { + /** @param {PrismicPostDataBodySummaryBulletSectionSlice} parent */ + resolve(parent) { return parent.id; }, }, sliceType: { type: 'String!', - resolve(parent: PrismicPostDataBodySummaryBulletSectionSlice) { + /** @param {PrismicPostDataBodySummaryBulletSectionSlice} parent */ + resolve(parent) { return parent.slice_type; }, }, primary: { type: 'JSON!', - resolve(parent: PrismicPostDataBodySummaryBulletSectionSlice) { + /** @param {PrismicPostDataBodySummaryBulletSectionSlice} parent */ + resolve(parent) { return parent.primary; }, }, @@ -606,12 +658,8 @@ export const createSchemaCustomization: GatsbyNode['createSchemaCustomization'] ]); }; -export const onCreateNode: GatsbyNode['onCreateNode'] = ({ - node, - actions, - createNodeId, - createContentDigest, -}) => { +/** @type {GatsbyNode['onCreateNode']} */ +export const onCreateNode = ({ node, actions, createNodeId, createContentDigest }) => { if (isPrismicPostCategoryNode(node)) { actions.createNode({ ...node, diff --git a/_packages/@karrotmarket/gatsby-transformer-post/package.json b/_packages/@karrotmarket/gatsby-transformer-post/package.json index df9d09723..a6ebd40e5 100644 --- a/_packages/@karrotmarket/gatsby-transformer-post/package.json +++ b/_packages/@karrotmarket/gatsby-transformer-post/package.json @@ -2,25 +2,14 @@ "name": "@karrotmarket/gatsby-transformer-post", "version": "0.0.0", "private": true, - "scripts": { - "init:gatsby": "yarn build", - "build": "concurrently \"yarn:build:*\"", - "build:babel": "babel gatsby -d . -x .ts --presets gatsby-package", - "build:dts": "tsc --emitDeclarationOnly --skipLibCheck", - "prepack": "yarn build" - }, "peerDependencies": { - "gatsby": "^4.19.0 || ^5.0.0" + "gatsby": "^5.3.0" }, "dependencies": { "gatsby-source-filesystem": "^5.13.1" }, "devDependencies": { - "@babel/cli": "^7.23.9", - "@babel/core": "^7.24.0", "@prismicio/types": "^0.2.8", - "babel-preset-gatsby-package": "^3.13.1", - "concurrently": "^8.2.2", "gatsby": "^5.13.5", "typescript": "^5.4.2" } diff --git a/_packages/@karrotmarket/gatsby-transformer-post/tsconfig.json b/_packages/@karrotmarket/gatsby-transformer-post/tsconfig.json index a833d9524..f022acc77 100644 --- a/_packages/@karrotmarket/gatsby-transformer-post/tsconfig.json +++ b/_packages/@karrotmarket/gatsby-transformer-post/tsconfig.json @@ -1,9 +1,4 @@ { "extends": "../../../tsconfig.json", - "compilerOptions": { - "rootDir": "gatsby", - "outDir": "." - }, - "include": ["gatsby"], "exclude": [] } diff --git a/_packages/@karrotmarket/gatsby-transformer-post/gatsby/types.ts b/_packages/@karrotmarket/gatsby-transformer-post/types.d.ts similarity index 88% rename from _packages/@karrotmarket/gatsby-transformer-post/gatsby/types.ts rename to _packages/@karrotmarket/gatsby-transformer-post/types.d.ts index dcac84b26..bae3d34ec 100644 --- a/_packages/@karrotmarket/gatsby-transformer-post/gatsby/types.ts +++ b/_packages/@karrotmarket/gatsby-transformer-post/types.d.ts @@ -25,10 +25,6 @@ export type PrismicPostCategoryNode = PrismicSourceNode & 'post_category' >; -export function isPrismicPostCategoryNode(node: Node): node is PrismicPostCategoryNode { - return node.internal.type === 'PrismicPostCategory'; -} - export type PrismicPostNode = PrismicSourceNode & PrismicDocument< { @@ -141,10 +137,6 @@ export type PrismicPostDataBodySummaryBulletSectionSlice = Slice< } >; -export function isPrismicPostNode(node: Node): node is PrismicPostNode { - return node.internal.type === 'PrismicPost'; -} - export type PrismicMemberProfileNode = PrismicSourceNode & PrismicDocument< { @@ -160,7 +152,3 @@ export type PrismicMemberProfileNode = PrismicSourceNode & }, 'member_profile' >; - -export function isPrismicMemberProfile(node: Node): node is PrismicMemberProfileNode { - return node.internal.type === 'PrismicMemberProfile'; -} diff --git a/_packages/@karrotmarket/gatsby-transformer-post/types.mjs b/_packages/@karrotmarket/gatsby-transformer-post/types.mjs new file mode 100644 index 000000000..cffc8ad58 --- /dev/null +++ b/_packages/@karrotmarket/gatsby-transformer-post/types.mjs @@ -0,0 +1,33 @@ +// @ts-ignore + +/** + * @typedef {import('gatsby').Node} Node + * + * @typedef {import('./types').PrismicPostCategoryNode} PrismicPostCategoryNode + * @typedef {import('./types').PrismicPostNode} PrismicPostNode + * @typedef {import('./types').PrismicMemberProfileNode} PrismicMemberProfileNode + */ + +/** + * @param {Node} node + * @return {node is PrismicPostCategoryNode} + */ +export function isPrismicPostCategoryNode(node) { + return node.internal.type === 'PrismicPostCategory'; +} + +/** + * @param {Node} node + * @return {node is PrismicPostNode} + */ +export function isPrismicPostNode(node) { + return node.internal.type === 'PrismicPost'; +} + +/** + * @param {Node} node + * @return {node is PrismicMemberProfileNode} + */ +export function isPrismicMemberProfile(node) { + return node.internal.type === 'PrismicMemberProfile'; +} diff --git a/about.daangn.com/gatsby-config.ts b/about.daangn.com/gatsby-config.ts index 2061e480d..08a793686 100644 --- a/about.daangn.com/gatsby-config.ts +++ b/about.daangn.com/gatsby-config.ts @@ -1,5 +1,5 @@ import type { GatsbyConfig } from 'gatsby'; -import * as Hangul from 'hangul-js'; +import Hangul from 'hangul-js'; import 'dotenv/config'; diff --git a/about.daangn.com/package.json b/about.daangn.com/package.json index 2d5c73929..cd24847c6 100644 --- a/about.daangn.com/package.json +++ b/about.daangn.com/package.json @@ -18,7 +18,6 @@ "not ie 11" ], "scripts": { - "ultra": "yarn workspace @daangn/websites ultra --recursive --filter +team.daangn.com", "develop": "gatsby develop", "build": "gatsby build", "serve": "gatsby serve", @@ -58,15 +57,12 @@ "simple-reveal": "^0.6.0" }, "devDependencies": { - "@babel/core": "^7.24.0", "@types/dotenv-safe": "^8.1.6", "@types/node": "^20.11.28", "@types/prismjs": "^1.26.3", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "babel-preset-gatsby-package": "^3.13.1", "typescript": "^5.4.2", - "ultra-runner": "^3.10.5", "websites-integration": "workspace:^" } } diff --git a/careers.ca.karrotmarket.com/package.json b/careers.ca.karrotmarket.com/package.json index 308a94bea..bcd542ca0 100644 --- a/careers.ca.karrotmarket.com/package.json +++ b/careers.ca.karrotmarket.com/package.json @@ -18,7 +18,6 @@ "not ie 11" ], "scripts": { - "ultra": "yarn workspace @daangn/websites ultra --recursive --filter +careers.ca.karrotmarket.com", "develop": "gatsby develop", "build": "gatsby clean && gatsby build", "serve": "gatsby serve", @@ -48,7 +47,6 @@ "@types/node": "^20.11.28", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "typescript": "^5.4.2", - "ultra-runner": "^3.10.5" + "typescript": "^5.4.2" } } diff --git a/careers.jp.karrotmarket.com/package.json b/careers.jp.karrotmarket.com/package.json index 2b8ea784e..d7ec1fee6 100644 --- a/careers.jp.karrotmarket.com/package.json +++ b/careers.jp.karrotmarket.com/package.json @@ -18,7 +18,6 @@ "not ie 11" ], "scripts": { - "ultra": "yarn workspace @daangn/websites ultra --recursive --filter +careers.jp.karrotmarket.com", "develop": "gatsby develop", "build": "gatsby build", "serve": "gatsby serve", @@ -48,7 +47,6 @@ "@types/node": "^20.11.28", "@types/react": "^18.2.66", "@types/react-dom": "^18.2.22", - "typescript": "^5.4.2", - "ultra-runner": "^3.10.5" + "typescript": "^5.4.2" } } diff --git a/package.json b/package.json index 4125be01b..f3a28d526 100644 --- a/package.json +++ b/package.json @@ -18,9 +18,6 @@ "about.daangn.com" ], "scripts": { - "postinstall": "yarn init:gatsby", - "build:packages": "ultra --recursive --filter \"_packages/*\" build", - "init:gatsby": "ultra --recursive init:gatsby", "lint": "biome check . --apply", "format": "biome format . --write" }, @@ -30,8 +27,7 @@ "devDependencies": { "@biomejs/biome": "1.6.1", "@types/node": "^20.11.28", - "typescript": "^5.4.2", - "ultra-runner": "^3.10.5" + "typescript": "^5.4.2" }, "packageManager": "yarn@4.2.2" } diff --git a/yarn.lock b/yarn.lock index 90a21ee00..a15bd5d3f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -44,33 +44,6 @@ __metadata: languageName: node linkType: hard -"@babel/cli@npm:^7.23.9": - version: 7.23.9 - resolution: "@babel/cli@npm:7.23.9" - dependencies: - "@jridgewell/trace-mapping": "npm:^0.3.17" - "@nicolo-ribaudo/chokidar-2": "npm:2.1.8-no-fsevents.3" - chokidar: "npm:^3.4.0" - commander: "npm:^4.0.1" - convert-source-map: "npm:^2.0.0" - fs-readdir-recursive: "npm:^1.1.0" - glob: "npm:^7.2.0" - make-dir: "npm:^2.1.0" - slash: "npm:^2.0.0" - peerDependencies: - "@babel/core": ^7.0.0-0 - dependenciesMeta: - "@nicolo-ribaudo/chokidar-2": - optional: true - chokidar: - optional: true - bin: - babel: ./bin/babel.js - babel-external-helpers: ./bin/babel-external-helpers.js - checksum: 10c0/0a5e9399e95ff0efea10db217e48682e025bd09d51aa96886e5c4d8c7b9d2115bc17d00704dc05e9ae7ab858c26467fec15e87a100cf995567c395f2941df4a0 - languageName: node - linkType: hard - "@babel/code-frame@npm:7.12.11": version: 7.12.11 resolution: "@babel/code-frame@npm:7.12.11" @@ -1170,7 +1143,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-flow-strip-types@npm:^7.0.0, @babel/plugin-transform-flow-strip-types@npm:^7.21.0": +"@babel/plugin-transform-flow-strip-types@npm:^7.0.0": version: 7.21.0 resolution: "@babel/plugin-transform-flow-strip-types@npm:7.21.0" dependencies: @@ -1491,7 +1464,7 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.20.13, @babel/plugin-transform-typescript@npm:^7.21.3": +"@babel/plugin-transform-typescript@npm:^7.21.3": version: 7.21.3 resolution: "@babel/plugin-transform-typescript@npm:7.21.3" dependencies: @@ -1613,19 +1586,6 @@ __metadata: languageName: node linkType: hard -"@babel/preset-flow@npm:^7.18.6": - version: 7.21.4 - resolution: "@babel/preset-flow@npm:7.21.4" - dependencies: - "@babel/helper-plugin-utils": "npm:^7.20.2" - "@babel/helper-validator-option": "npm:^7.21.0" - "@babel/plugin-transform-flow-strip-types": "npm:^7.21.0" - peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 10c0/50ec8dc9a30ef7ba668e9872f2142bad4ecf7a9a37dfe323a28b7f1de3b2db861e4cf7737e9dfa1a433bd65c3a26d4da93d2efce4f83c39bb8114fcc010ec39f - languageName: node - linkType: hard - "@babel/preset-modules@npm:^0.1.5": version: 0.1.5 resolution: "@babel/preset-modules@npm:0.1.5" @@ -2049,7 +2009,6 @@ __metadata: "@biomejs/biome": "npm:1.6.1" "@types/node": "npm:^20.11.28" typescript: "npm:^5.4.2" - ultra-runner: "npm:^3.10.5" languageName: unknown linkType: soft @@ -3087,8 +3046,6 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-theme-post@workspace:_packages/@karrotmarket/gatsby-theme-post" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@cometjs/core": "npm:^2.2.0" "@cometjs/graphql-utils": "npm:^2.0.5" "@karrotmarket/gatsby-theme-prismic": "workspace:^" @@ -3098,8 +3055,6 @@ __metadata: "@stitches/react": "npm:^1.2.8" "@svgr/webpack": "npm:^8.1.0" babel-plugin-polished: "npm:^1.1.0" - babel-preset-gatsby-package: "npm:^3.13.1" - concurrently: "npm:^8.2.2" framer-motion: "npm:^11.0.14" gatsby: "npm:^5.13.5" gatsby-plugin-head-seo: "npm:^1.0.2" @@ -3122,7 +3077,7 @@ __metadata: typescript: "npm:^5.4.2" peerDependencies: "@stitches/react": ^0.1.0 || ^0.2.0 || ^1.0.0 - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 polished: ^4.0.0 react: "*" react-dom: "*" @@ -3133,14 +3088,10 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-theme-prismic@workspace:_packages/@karrotmarket/gatsby-theme-prismic" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@prismicio/helpers": "npm:^2.3.9" "@types/node": "npm:^20.11.28" "@types/react": "npm:^18.2.66" "@types/react-dom": "npm:^18.2.22" - babel-preset-gatsby-package: "npm:^3.13.1" - concurrently: "npm:^8.2.2" gatsby: "npm:^5.13.5" gatsby-plugin-image: "npm:^3.13.1" gatsby-plugin-prismic-previews: "npm:^6.0.1" @@ -3150,7 +3101,7 @@ __metadata: react-dom: "npm:^18.2.0" typescript: "npm:^5.4.2" peerDependencies: - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 react: "*" react-dom: "*" languageName: unknown @@ -3160,19 +3111,16 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-theme-seed-design@workspace:_packages/@karrotmarket/gatsby-theme-seed-design" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@seed-design/icon": "npm:^0.5.8" "@types/react": "npm:^18.2.66" "@types/react-dom": "npm:^18.2.22" - babel-preset-gatsby-package: "npm:^3.13.1" gatsby: "npm:^5.13.5" gatsby-plugin-seed-design: "npm:^0.2.7" react: "npm:^18.2.0" react-dom: "npm:^18.2.0" typescript: "npm:^5.4.2" peerDependencies: - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 react: ^18.0.0 react-dom: ^18.0.0 languageName: unknown @@ -3182,8 +3130,6 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-theme-website-team@workspace:_packages/@karrotmarket/gatsby-theme-website-team" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@cometjs/core": "npm:^2.2.0" "@cometjs/graphql-utils": "npm:^2.0.5" "@cometjs/react-utils": "npm:^2.1.2" @@ -3201,9 +3147,7 @@ __metadata: "@types/react": "npm:^18.2.66" "@types/react-dom": "npm:^18.2.22" babel-plugin-polished: "npm:^1.1.0" - babel-preset-gatsby-package: "npm:^3.13.1" clsx: "npm:^2.1.0" - concurrently: "npm:^8.2.2" focus-trap-react: "npm:^10.2.3" framer-motion: "npm:^11.0.14" gatsby: "npm:^5.13.5" @@ -3238,7 +3182,7 @@ __metadata: typescript: "npm:^5.4.2" use-dark-mode: "npm:^2.3.1" peerDependencies: - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 react: "*" react-dom: "*" languageName: unknown @@ -3248,8 +3192,6 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-theme-website@workspace:_packages/@karrotmarket/gatsby-theme-website" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@cometjs/core": "npm:^2.2.0" "@cometjs/react-utils": "npm:^2.1.2" "@karrotmarket/gatsby-theme-seed-design": "workspace:^" @@ -3259,8 +3201,6 @@ __metadata: "@types/node": "npm:^20.11.28" "@types/react": "npm:^18.2.66" "@types/react-dom": "npm:^18.2.22" - babel-preset-gatsby-package: "npm:^3.13.1" - concurrently: "npm:^8.2.2" gatsby: "npm:^5.13.5" gatsby-plugin-svgr: "npm:^3.0.0-beta.0" gatsby-theme-stitches: "npm:^1.0.1" @@ -3272,7 +3212,7 @@ __metadata: peerDependencies: "@karrotmarket/gatsby-theme-prismic": "*" "@stitches/react": ^0.1.0 || ^0.2.0 || ^1.0.0 - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 polished: ^4.0.0 react: "*" react-dom: "*" @@ -3283,24 +3223,19 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-transformer-job-post@workspace:_packages/@karrotmarket/gatsby-transformer-job-post" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@karrotmarket/gatsby-source-greenhouse-jobboard": "npm:^0.10.1" "@types/common-tags": "npm:^1.8.4" "@types/jest": "npm:^29.5.12" "@types/node": "npm:^20.11.28" - babel-jest: "npm:^29.7.0" - babel-preset-gatsby-package: "npm:^3.13.1" cjk-slug: "npm:^0.3.1" common-tags: "npm:^1.8.2" - concurrently: "npm:^8.2.2" gatsby: "npm:^5.13.5" html-entities: "npm:^2.3.3" jest: "npm:^29.5.0" typescript: "npm:^5.4.2" peerDependencies: "@karrotmarket/gatsby-source-greenhouse-jobboard": ^0.3.0 || ^0.4.0 || ^0.5.0 || ^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 languageName: unknown linkType: soft @@ -3308,16 +3243,12 @@ __metadata: version: 0.0.0-use.local resolution: "@karrotmarket/gatsby-transformer-post@workspace:_packages/@karrotmarket/gatsby-transformer-post" dependencies: - "@babel/cli": "npm:^7.23.9" - "@babel/core": "npm:^7.24.0" "@prismicio/types": "npm:^0.2.8" - babel-preset-gatsby-package: "npm:^3.13.1" - concurrently: "npm:^8.2.2" gatsby: "npm:^5.13.5" gatsby-source-filesystem: "npm:^5.13.1" typescript: "npm:^5.4.2" peerDependencies: - gatsby: ^4.19.0 || ^5.0.0 + gatsby: ^5.3.0 languageName: unknown linkType: soft @@ -3491,13 +3422,6 @@ __metadata: languageName: node linkType: hard -"@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3": - version: 2.1.8-no-fsevents.3 - resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3" - checksum: 10c0/27dcabaa0c9a29b3a60217bd3fff87a22cb43ed77863da570c6828e4d0b8f1c6ee52582cd3d439275a2b1f2051005e648ed866b981f2a03b61c645b7e4806ba7 - languageName: node - linkType: hard - "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1": version: 5.1.1-v1 resolution: "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1" @@ -5616,7 +5540,6 @@ __metadata: version: 0.0.0-use.local resolution: "about.daangn.com@workspace:about.daangn.com" dependencies: - "@babel/core": "npm:^7.24.0" "@karrotmarket/gatsby-source-greenhouse-jobboard": "npm:^0.10.1" "@karrotmarket/gatsby-theme-prismic": "workspace:^" "@karrotmarket/gatsby-theme-website-team": "workspace:^" @@ -5628,7 +5551,6 @@ __metadata: "@types/prismjs": "npm:^1.26.3" "@types/react": "npm:^18.2.66" "@types/react-dom": "npm:^18.2.22" - babel-preset-gatsby-package: "npm:^3.13.1" cjk-slug: "npm:^0.3.1" dotenv: "npm:^16.0.3" gatsby: "npm:^5.13.5" @@ -5654,7 +5576,6 @@ __metadata: react-responsive-carousel: "npm:^3.2.23" simple-reveal: "npm:^0.6.0" typescript: "npm:^5.4.2" - ultra-runner: "npm:^3.10.5" websites-integration: "workspace:^" languageName: unknown linkType: soft @@ -5871,13 +5792,6 @@ __metadata: languageName: node linkType: hard -"ansi-regex@npm:^3.0.0": - version: 3.0.1 - resolution: "ansi-regex@npm:3.0.1" - checksum: 10c0/d108a7498b8568caf4a46eea4f1784ab4e0dfb2e3f3938c697dee21443d622d765c958f2b7e2b9f6b9e55e2e2af0584eaa9915d51782b89a841c28e744e7a167 - languageName: node - linkType: hard - "ansi-regex@npm:^4.1.0": version: 4.1.1 resolution: "ansi-regex@npm:4.1.1" @@ -5892,15 +5806,6 @@ __metadata: languageName: node linkType: hard -"ansi-split@npm:^1.0.1": - version: 1.0.1 - resolution: "ansi-split@npm:1.0.1" - dependencies: - ansi-regex: "npm:^3.0.0" - checksum: 10c0/30600b5d76e4f1e7b680f6322fe2f7f782b461ff999c82a8a465a90db455be80f1d08a9255c0cda5f1e88f693d8488a9387fc52c3b3d0d85cfb79fed3c6d718f - languageName: node - linkType: hard - "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -6517,28 +6422,6 @@ __metadata: languageName: node linkType: hard -"babel-preset-gatsby-package@npm:^3.13.1": - version: 3.13.1 - resolution: "babel-preset-gatsby-package@npm:3.13.1" - dependencies: - "@babel/plugin-proposal-nullish-coalescing-operator": "npm:^7.18.6" - "@babel/plugin-proposal-optional-chaining": "npm:^7.20.7" - "@babel/plugin-syntax-dynamic-import": "npm:^7.8.3" - "@babel/plugin-transform-runtime": "npm:^7.19.6" - "@babel/plugin-transform-typescript": "npm:^7.20.13" - "@babel/preset-env": "npm:^7.20.2" - "@babel/preset-flow": "npm:^7.18.6" - "@babel/preset-react": "npm:^7.18.6" - "@babel/runtime": "npm:^7.20.13" - "@sigmacomputing/babel-plugin-lodash": "npm:^3.3.5" - babel-plugin-dynamic-import-node: "npm:^2.3.3" - core-js: "npm:^3.31.0" - peerDependencies: - "@babel/core": ^7.11.6 - checksum: 10c0/6426366d86ec65bd182d3df9f2d06b81fdaf1749fb96d95de60a8418b10f278ca34df51f8689546d48edae8273f3feb7820e49a01f22ece089860d4bd0e740f5 - languageName: node - linkType: hard - "babel-preset-gatsby@npm:^3.13.2": version: 3.13.2 resolution: "babel-preset-gatsby@npm:3.13.2" @@ -7086,7 +6969,6 @@ __metadata: react: "npm:^18.2.0" react-dom: "npm:^18.2.0" typescript: "npm:^5.4.2" - ultra-runner: "npm:^3.10.5" languageName: unknown linkType: soft @@ -7116,7 +6998,6 @@ __metadata: react: "npm:^18.2.0" react-dom: "npm:^18.2.0" typescript: "npm:^5.4.2" - ultra-runner: "npm:^3.10.5" languageName: unknown linkType: soft @@ -7211,7 +7092,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.4.0, chokidar@npm:^3.4.2, chokidar@npm:^3.5.3": +"chokidar@npm:^3.4.2, chokidar@npm:^3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" dependencies: @@ -7340,17 +7221,6 @@ __metadata: languageName: node linkType: hard -"cliui@npm:^7.0.2": - version: 7.0.4 - resolution: "cliui@npm:7.0.4" - dependencies: - string-width: "npm:^4.2.0" - strip-ansi: "npm:^6.0.0" - wrap-ansi: "npm:^7.0.0" - checksum: 10c0/6035f5daf7383470cef82b3d3db00bec70afb3423538c50394386ffbbab135e26c3689c41791f911fa71b62d13d3863c712fdd70f0fbdffd938a1e6fd09aac00 - languageName: node - linkType: hard - "cliui@npm:^8.0.1": version: 8.0.1 resolution: "cliui@npm:8.0.1" @@ -7508,13 +7378,6 @@ __metadata: languageName: node linkType: hard -"commander@npm:^4.0.1": - version: 4.1.1 - resolution: "commander@npm:4.1.1" - checksum: 10c0/84a76c08fe6cc08c9c93f62ac573d2907d8e79138999312c92d4155bc2325d487d64d13f669b2000c9f8caf70493c1be2dac74fec3c51d5a04f8bc3ae1830bab - languageName: node - linkType: hard - "commander@npm:^7.2.0": version: 7.2.0 resolution: "commander@npm:7.2.0" @@ -7586,26 +7449,6 @@ __metadata: languageName: node linkType: hard -"concurrently@npm:^8.2.2": - version: 8.2.2 - resolution: "concurrently@npm:8.2.2" - dependencies: - chalk: "npm:^4.1.2" - date-fns: "npm:^2.30.0" - lodash: "npm:^4.17.21" - rxjs: "npm:^7.8.1" - shell-quote: "npm:^1.8.1" - spawn-command: "npm:0.0.2" - supports-color: "npm:^8.1.1" - tree-kill: "npm:^1.2.2" - yargs: "npm:^17.7.2" - bin: - conc: dist/bin/concurrently.js - concurrently: dist/bin/concurrently.js - checksum: 10c0/0e9683196fe9c071d944345d21d8f34aa6c0cc50c0dd897e95619f2f1c9eb4871dca851b2569da17888235b7335b4c821ca19deed35bebcd9a131ee5d247f34c - languageName: node - linkType: hard - "config-chain@npm:^1.1.11": version: 1.1.13 resolution: "config-chain@npm:1.1.13" @@ -9759,7 +9602,7 @@ __metadata: languageName: node linkType: hard -"fast-glob@npm:^3.2.5, fast-glob@npm:^3.2.9": +"fast-glob@npm:^3.2.9": version: 3.2.12 resolution: "fast-glob@npm:3.2.12" dependencies: @@ -10227,13 +10070,6 @@ __metadata: languageName: node linkType: hard -"fs-readdir-recursive@npm:^1.1.0": - version: 1.1.0 - resolution: "fs-readdir-recursive@npm:1.1.0" - checksum: 10c0/7e190393952143e674b6d1ad4abcafa1b5d3e337fcc21b0cb051079a7140a54617a7df193d562ef9faf21bd7b2148a38601b3d5c16261fa76f278d88dc69989c - languageName: node - linkType: hard - "fs.realpath@npm:^1.0.0": version: 1.0.0 resolution: "fs.realpath@npm:1.0.0" @@ -11347,7 +11183,7 @@ __metadata: languageName: node linkType: hard -"glob@npm:^7.0.5, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.0, glob@npm:^7.2.3": +"glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.2.3": version: 7.2.3 resolution: "glob@npm:7.2.3" dependencies: @@ -11433,13 +11269,6 @@ __metadata: languageName: node linkType: hard -"globrex@npm:^0.1.2": - version: 0.1.2 - resolution: "globrex@npm:0.1.2" - checksum: 10c0/a54c029520cf58bda1d8884f72bd49b4cd74e977883268d931fd83bcbd1a9eb96d57c7dbd4ad80148fb9247467ebfb9b215630b2ed7563b2a8de02e1ff7f89d1 - languageName: node - linkType: hard - "gopd@npm:^1.0.1": version: 1.0.1 resolution: "gopd@npm:1.0.1" @@ -11933,7 +11762,7 @@ __metadata: languageName: node linkType: hard -"ignore@npm:^5.1.8, ignore@npm:^5.2.0": +"ignore@npm:^5.2.0": version: 5.2.4 resolution: "ignore@npm:5.2.4" checksum: 10c0/7c7cd90edd9fea6e037f9b9da4b01bf0a86b198ce78345f9bbd983929d68ff14830be31111edc5d70c264921f4962404d75b7262b4d9cc3bc12381eccbd03096 @@ -13927,16 +13756,6 @@ __metadata: languageName: node linkType: hard -"make-dir@npm:^2.1.0": - version: 2.1.0 - resolution: "make-dir@npm:2.1.0" - dependencies: - pify: "npm:^4.0.1" - semver: "npm:^5.6.0" - checksum: 10c0/ada869944d866229819735bee5548944caef560d7a8536ecbc6536edca28c72add47cc4f6fc39c54fb25d06b58da1f8994cf7d9df7dadea047064749efc085d8 - languageName: node - linkType: hard - "make-dir@npm:^3.0.0, make-dir@npm:^3.0.2, make-dir@npm:^3.1.0": version: 3.1.0 resolution: "make-dir@npm:3.1.0" @@ -14136,13 +13955,6 @@ __metadata: languageName: node linkType: hard -"micro-memoize@npm:^4.0.9": - version: 4.0.14 - resolution: "micro-memoize@npm:4.0.14" - checksum: 10c0/80c7f719edd4623ac3cd46e6ad3a70bd4d4495d2fe154e4f3435805d0038c01c4118e7ede9b37e77feea74ad94546c8437a066cc3dc7d835085d35482ca02c81 - languageName: node - linkType: hard - "micromatch@npm:^4.0.4, micromatch@npm:^4.0.5": version: 4.0.5 resolution: "micromatch@npm:4.0.5" @@ -14909,7 +14721,7 @@ __metadata: languageName: node linkType: hard -"npm-run-path@npm:4.0.1, npm-run-path@npm:^4.0.1": +"npm-run-path@npm:^4.0.1": version: 4.0.1 resolution: "npm-run-path@npm:4.0.1" dependencies: @@ -15556,13 +15368,6 @@ __metadata: languageName: node linkType: hard -"pid-cwd@npm:^1.2.0": - version: 1.2.0 - resolution: "pid-cwd@npm:1.2.0" - checksum: 10c0/bcfd5ea67d41366998068ad8438bda4ebd5ecdcfec4d1ca00941d1c7347339b9824161e05fd03ce40c016e7154160345428aea4c480c18eba2a762e57314f68d - languageName: node - linkType: hard - "pify@npm:5.0.0": version: 5.0.0 resolution: "pify@npm:5.0.0" @@ -15570,13 +15375,6 @@ __metadata: languageName: node linkType: hard -"pify@npm:^4.0.1": - version: 4.0.1 - resolution: "pify@npm:4.0.1" - checksum: 10c0/6f9d404b0d47a965437403c9b90eca8bb2536407f03de165940e62e72c8c8b75adda5516c6b9b23675a5877cc0bcac6bdfb0ef0e39414cd2476d5495da40e7cf - languageName: node - linkType: hard - "pirates@npm:^4.0.4": version: 4.0.5 resolution: "pirates@npm:4.0.5" @@ -16269,13 +16067,6 @@ __metadata: languageName: node linkType: hard -"ps-list@npm:^7.2.0": - version: 7.2.0 - resolution: "ps-list@npm:7.2.0" - checksum: 10c0/1c9dd310713a6f3c595acc329c71407069abcc15794fc0bd905de06ebc58af9907e409d7dc357c5d52dfe12e5d598f79f51ee7f9a36417c89f34588886fb57e9 - languageName: node - linkType: hard - "pseudomap@npm:^1.0.1": version: 1.0.2 resolution: "pseudomap@npm:1.0.2" @@ -17156,15 +16947,6 @@ __metadata: languageName: node linkType: hard -"rxjs@npm:^7.8.1": - version: 7.8.1 - resolution: "rxjs@npm:7.8.1" - dependencies: - tslib: "npm:^2.1.0" - checksum: 10c0/3c49c1ecd66170b175c9cacf5cef67f8914dcbc7cd0162855538d365c83fea631167cacb644b3ce533b2ea0e9a4d0b12175186985f89d75abe73dbd8f7f06f68 - languageName: node - linkType: hard - "safe-array-concat@npm:^1.1.2": version: 1.1.2 resolution: "safe-array-concat@npm:1.1.2" @@ -17298,7 +17080,7 @@ __metadata: languageName: node linkType: hard -"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.6.0, semver@npm:^5.7.1": +"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.5.0, semver@npm:^5.7.1": version: 5.7.1 resolution: "semver@npm:5.7.1" bin: @@ -17521,20 +17303,13 @@ __metadata: languageName: node linkType: hard -"shell-quote@npm:^1.7.3, shell-quote@npm:^1.8.1": +"shell-quote@npm:^1.7.3": version: 1.8.1 resolution: "shell-quote@npm:1.8.1" checksum: 10c0/8cec6fd827bad74d0a49347057d40dfea1e01f12a6123bf82c4649f3ef152fc2bc6d6176e6376bffcd205d9d0ccb4f1f9acae889384d20baff92186f01ea455a languageName: node linkType: hard -"shellwords-ts@npm:^3.0.0": - version: 3.0.1 - resolution: "shellwords-ts@npm:3.0.1" - checksum: 10c0/a027b71b8a32297a57756da5399274e34c0fc7a9472165be3021eb1ae076c0a1830d244572674aecf62465c39669c3dd884bf452fee53d974ba536c2a466dc4a - languageName: node - linkType: hard - "side-channel@npm:^1.0.4": version: 1.0.4 resolution: "side-channel@npm:1.0.4" @@ -17624,13 +17399,6 @@ __metadata: languageName: node linkType: hard -"slash@npm:^2.0.0": - version: 2.0.0 - resolution: "slash@npm:2.0.0" - checksum: 10c0/f83dbd3cb62c41bb8fcbbc6bf5473f3234b97fa1d008f571710a9d3757a28c7169e1811cad1554ccb1cc531460b3d221c9a7b37f549398d9a30707f0a5af9193 - languageName: node - linkType: hard - "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -17803,13 +17571,6 @@ __metadata: languageName: node linkType: hard -"spawn-command@npm:0.0.2": - version: 0.0.2 - resolution: "spawn-command@npm:0.0.2" - checksum: 10c0/b22f2d71239e6e628a400831861ba747750bbb40c0a53323754cf7b84330b73d81e40ff1f9055e6d1971818679510208a9302e13d9ff3b32feb67e74d7a1b3ef - languageName: node - linkType: hard - "spdx-correct@npm:^3.0.0": version: 3.2.0 resolution: "spdx-correct@npm:3.2.0" @@ -18274,7 +18035,7 @@ __metadata: languageName: node linkType: hard -"supports-color@npm:^8.0.0, supports-color@npm:^8.1.1": +"supports-color@npm:^8.0.0": version: 8.1.1 resolution: "supports-color@npm:8.1.1" dependencies: @@ -18615,15 +18376,6 @@ __metadata: languageName: node linkType: hard -"tree-kill@npm:^1.2.2": - version: 1.2.2 - resolution: "tree-kill@npm:1.2.2" - bin: - tree-kill: cli.js - checksum: 10c0/7b1b7c7f17608a8f8d20a162e7957ac1ef6cd1636db1aba92f4e072dc31818c2ff0efac1e3d91064ede67ed5dc57c565420531a8134090a12ac10cf792ab14d2 - languageName: node - linkType: hard - "trim-newlines@npm:^3.0.0": version: 3.0.1 resolution: "trim-newlines@npm:3.0.1" @@ -18680,13 +18432,6 @@ __metadata: languageName: node linkType: hard -"tslib@npm:2.1.0": - version: 2.1.0 - resolution: "tslib@npm:2.1.0" - checksum: 10c0/e95c8fb198d0209bba917db7b0f399d1aed3c4d6408bf1e4c30deebfeffb4076dc3786500100a3b5c55a535abaaeb5e6bd1da04d0cb49d4228e5a62362cee0b2 - languageName: node - linkType: hard - "tslib@npm:^1.10.0, tslib@npm:^1.8.1, tslib@npm:^1.9.0": version: 1.14.1 resolution: "tslib@npm:1.14.1" @@ -18765,7 +18510,7 @@ __metadata: languageName: node linkType: hard -"type-fest@npm:^0.21.2, type-fest@npm:^0.21.3": +"type-fest@npm:^0.21.3": version: 0.21.3 resolution: "type-fest@npm:0.21.3" checksum: 10c0/902bd57bfa30d51d4779b641c2bc403cdf1371fb9c91d3c058b0133694fcfdb817aef07a47f40faf79039eecbaa39ee9d3c532deff244f3a19ce68cea71a61e8 @@ -18943,34 +18688,6 @@ __metadata: languageName: node linkType: hard -"ultra-runner@npm:^3.10.5": - version: 3.10.5 - resolution: "ultra-runner@npm:3.10.5" - dependencies: - ansi-split: "npm:^1.0.1" - chalk: "npm:^4.1.0" - cross-spawn: "npm:^7.0.3" - fast-glob: "npm:^3.2.5" - globrex: "npm:^0.1.2" - ignore: "npm:^5.1.8" - json5: "npm:^2.2.0" - micro-memoize: "npm:^4.0.9" - npm-run-path: "npm:4.0.1" - pid-cwd: "npm:^1.2.0" - ps-list: "npm:^7.2.0" - shellwords-ts: "npm:^3.0.0" - string-width: "npm:^4.2.0" - tslib: "npm:2.1.0" - type-fest: "npm:^0.21.2" - wrap-ansi: "npm:^7.0.0" - yamljs: "npm:^0.3.0" - yargs: "npm:^16.2.0" - bin: - ultra: bin/ultra.js - checksum: 10c0/53409dd4eba0213738dc150575c6b32ff8c1902007b623edc3843a6dd2c0ff8cddb7750c914f3a1eef836f7bf5823f05e9392492b23510dec5ae46692589ee13 - languageName: node - linkType: hard - "unbox-primitive@npm:^1.0.2": version: 1.0.2 resolution: "unbox-primitive@npm:1.0.2" @@ -19977,19 +19694,6 @@ __metadata: languageName: node linkType: hard -"yamljs@npm:^0.3.0": - version: 0.3.0 - resolution: "yamljs@npm:0.3.0" - dependencies: - argparse: "npm:^1.0.7" - glob: "npm:^7.0.5" - bin: - json2yaml: ./bin/json2yaml - yaml2json: ./bin/yaml2json - checksum: 10c0/61bea60327c9326fc05ddc53983e0e28d019f191499e8e0bf631fa2cd233935bbce89199d852574bcc90f436a5c040e458e882aed5a143ba9e9d85621444bbc9 - languageName: node - linkType: hard - "yargs-parser@npm:^18.1.2, yargs-parser@npm:^18.1.3": version: 18.1.3 resolution: "yargs-parser@npm:18.1.3" @@ -20000,13 +19704,6 @@ __metadata: languageName: node linkType: hard -"yargs-parser@npm:^20.2.2": - version: 20.2.9 - resolution: "yargs-parser@npm:20.2.9" - checksum: 10c0/0685a8e58bbfb57fab6aefe03c6da904a59769bd803a722bb098bd5b0f29d274a1357762c7258fb487512811b8063fb5d2824a3415a0a4540598335b3b086c72 - languageName: node - linkType: hard - "yargs-parser@npm:^21.1.1": version: 21.1.1 resolution: "yargs-parser@npm:21.1.1" @@ -20033,21 +19730,6 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^16.2.0": - version: 16.2.0 - resolution: "yargs@npm:16.2.0" - dependencies: - cliui: "npm:^7.0.2" - escalade: "npm:^3.1.1" - get-caller-file: "npm:^2.0.5" - require-directory: "npm:^2.1.1" - string-width: "npm:^4.2.0" - y18n: "npm:^5.0.5" - yargs-parser: "npm:^20.2.2" - checksum: 10c0/b1dbfefa679848442454b60053a6c95d62f2d2e21dd28def92b647587f415969173c6e99a0f3bab4f1b67ee8283bf735ebe3544013f09491186ba9e8a9a2b651 - languageName: node - linkType: hard - "yargs@npm:^17.3.1": version: 17.7.1 resolution: "yargs@npm:17.7.1" @@ -20063,21 +19745,6 @@ __metadata: languageName: node linkType: hard -"yargs@npm:^17.7.2": - version: 17.7.2 - resolution: "yargs@npm:17.7.2" - dependencies: - cliui: "npm:^8.0.1" - escalade: "npm:^3.1.1" - get-caller-file: "npm:^2.0.5" - require-directory: "npm:^2.1.1" - string-width: "npm:^4.2.3" - y18n: "npm:^5.0.5" - yargs-parser: "npm:^21.1.1" - checksum: 10c0/ccd7e723e61ad5965fffbb791366db689572b80cca80e0f96aad968dfff4156cd7cd1ad18607afe1046d8241e6fb2d6c08bf7fa7bfb5eaec818735d8feac8f05 - languageName: node - linkType: hard - "yauzl@npm:^2.10.0": version: 2.10.0 resolution: "yauzl@npm:2.10.0"