From 06c118bda4d7c905f3036ab849ff1e06eba7982a Mon Sep 17 00:00:00 2001 From: JJIIIINN Date: Tue, 5 Dec 2023 14:16:55 +0900 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20SEO=20=EC=B5=9C=EC=A0=81=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .pnp.cjs | 267 +++++++++++++++++++++-------------------- .pnp.loader.mjs | 81 +++++++------ src/app/layout.tsx | 38 +++--- src/components/SEO.tsx | 41 +++++++ 4 files changed, 238 insertions(+), 189 deletions(-) create mode 100644 src/components/SEO.tsx diff --git a/.pnp.cjs b/.pnp.cjs index ee1c144..df5c173 100644 --- a/.pnp.cjs +++ b/.pnp.cjs @@ -18513,118 +18513,6 @@ function hydrateRuntimeState(data, { basePath }) { }; } -/** - * @param {object} exports - * @param {Set} keys - */ -function loop(exports, keys) { - if (typeof exports === 'string') { - return exports; - } - - if (exports) { - let idx, tmp; - if (Array.isArray(exports)) { - for (idx=0; idx < exports.length; idx++) { - if (tmp = loop(exports[idx], keys)) return tmp; - } - } else { - for (idx in exports) { - if (keys.has(idx)) { - return loop(exports[idx], keys); - } - } - } - } -} - -/** - * @param {string} name The package name - * @param {string} entry The target entry, eg "." - * @param {number} [condition] Unmatched condition? - */ -function bail(name, entry, condition) { - throw new Error( - condition - ? `No known conditions for "${entry}" entry in "${name}" package` - : `Missing "${entry}" export in "${name}" package` - ); -} - -/** - * @param {string} name the package name - * @param {string} entry the target path/import - */ -function toName(name, entry) { - return entry === name ? '.' - : entry[0] === '.' ? entry - : entry.replace(new RegExp('^' + name + '\/'), './'); -} - -/** - * @param {object} pkg package.json contents - * @param {string} [entry] entry name or import path - * @param {object} [options] - * @param {boolean} [options.browser] - * @param {boolean} [options.require] - * @param {string[]} [options.conditions] - * @param {boolean} [options.unsafe] - */ -function resolve(pkg, entry='.', options={}) { - let { name, exports } = pkg; - - if (exports) { - let { browser, require, unsafe, conditions=[] } = options; - - let target = toName(name, entry); - if (target[0] !== '.') target = './' + target; - - if (typeof exports === 'string') { - return target === '.' ? exports : bail(name, target); - } - - let allows = new Set(['default', ...conditions]); - unsafe || allows.add(require ? 'require' : 'import'); - unsafe || allows.add(browser ? 'browser' : 'node'); - - let key, tmp, isSingle=false; - - for (key in exports) { - isSingle = key[0] !== '.'; - break; - } - - if (isSingle) { - return target === '.' - ? loop(exports, allows) || bail(name, target, 1) - : bail(name, target); - } - - if (tmp = exports[target]) { - return loop(tmp, allows) || bail(name, target, 1); - } - - for (key in exports) { - tmp = key[key.length - 1]; - if (tmp === '/' && target.startsWith(key)) { - return (tmp = loop(exports[key], allows)) - ? (tmp + target.substring(key.length)) - : bail(name, target, 1); - } - if (tmp === '*' && target.startsWith(key.slice(0, -1))) { - // do not trigger if no *content* to inject - if (target.substring(key.length - 1).length > 0) { - return (tmp = loop(exports[key], allows)) - ? tmp.replace('*', target.substring(key.length - 1)) - : bail(name, target, 1); - } - } - } - - return bail(name, target); - } -} - const ArrayIsArray = Array.isArray; const JSONStringify = JSON.stringify; const ObjectGetOwnPropertyNames = Object.getOwnPropertyNames; @@ -18685,6 +18573,15 @@ const ERR_INVALID_PACKAGE_CONFIG = createErrorType( }, Error ); +const ERR_PACKAGE_PATH_NOT_EXPORTED = createErrorType( + "ERR_PACKAGE_PATH_NOT_EXPORTED", + (pkgPath, subpath, base = void 0) => { + if (subpath === ".") + return `No "exports" main defined in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; + return `Package subpath '${subpath}' is not defined by "exports" in ${pkgPath}package.json${base ? ` imported from ${base}` : ""}`; + }, + Error +); function filterOwnProperties(source, keys) { const filtered = /* @__PURE__ */ Object.create(null); @@ -19004,12 +18901,121 @@ function patternKeyCompare(a, b) { return 1; return 0; } -function packageImportsResolve({ - name, +function isConditionalExportsMainSugar(exports, packageJSONUrl, base) { + if (typeof exports === "string" || ArrayIsArray(exports)) + return true; + if (typeof exports !== "object" || exports === null) + return false; + const keys = ObjectGetOwnPropertyNames(exports); + let isConditionalSugar = false; + let i = 0; + for (let j = 0; j < keys.length; j++) { + const key = keys[j]; + const curIsConditionalSugar = key === "" || key[0] !== "."; + if (i++ === 0) { + isConditionalSugar = curIsConditionalSugar; + } else if (isConditionalSugar !== curIsConditionalSugar) { + throw new ERR_INVALID_PACKAGE_CONFIG( + url.fileURLToPath(packageJSONUrl), + base, + `"exports" cannot contain some keys starting with '.' and some not. The exports object must either be an object of package subpath keys or an object of main entry condition name keys only.` + ); + } + } + return isConditionalSugar; +} +function throwExportsNotFound(subpath, packageJSONUrl, base) { + throw new ERR_PACKAGE_PATH_NOT_EXPORTED( + url.fileURLToPath(new URL(".", packageJSONUrl)), + subpath, + base && url.fileURLToPath(base) + ); +} +const emittedPackageWarnings = /* @__PURE__ */ new Set(); +function emitTrailingSlashPatternDeprecation(match, pjsonUrl, base) { + const pjsonPath = url.fileURLToPath(pjsonUrl); + if (emittedPackageWarnings.has(pjsonPath + "|" + match)) + return; + emittedPackageWarnings.add(pjsonPath + "|" + match); + process.emitWarning( + `Use of deprecated trailing slash pattern mapping "${match}" in the "exports" field module resolution of the package at ${pjsonPath}${base ? ` imported from ${url.fileURLToPath(base)}` : ""}. Mapping specifiers ending in "/" is no longer supported.`, + "DeprecationWarning", + "DEP0155" + ); +} +function packageExportsResolve({ + packageJSONUrl, + packageSubpath, + exports, base, - conditions, - readFileSyncFn + conditions }) { + if (isConditionalExportsMainSugar(exports, packageJSONUrl, base)) + exports = { ".": exports }; + if (ObjectPrototypeHasOwnProperty(exports, packageSubpath) && !StringPrototypeIncludes(packageSubpath, "*") && !StringPrototypeEndsWith(packageSubpath, "/")) { + const target = exports[packageSubpath]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + target, + "", + packageSubpath, + base, + false, + false, + conditions + ); + if (resolveResult == null) { + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + } + return resolveResult; + } + let bestMatch = ""; + let bestMatchSubpath; + const keys = ObjectGetOwnPropertyNames(exports); + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const patternIndex = StringPrototypeIndexOf(key, "*"); + if (patternIndex !== -1 && StringPrototypeStartsWith( + packageSubpath, + StringPrototypeSlice(key, 0, patternIndex) + )) { + if (StringPrototypeEndsWith(packageSubpath, "/")) + emitTrailingSlashPatternDeprecation( + packageSubpath, + packageJSONUrl, + base + ); + const patternTrailer = StringPrototypeSlice(key, patternIndex + 1); + if (packageSubpath.length >= key.length && StringPrototypeEndsWith(packageSubpath, patternTrailer) && patternKeyCompare(bestMatch, key) === 1 && StringPrototypeLastIndexOf(key, "*") === patternIndex) { + bestMatch = key; + bestMatchSubpath = StringPrototypeSlice( + packageSubpath, + patternIndex, + packageSubpath.length - patternTrailer.length + ); + } + } + } + if (bestMatch) { + const target = exports[bestMatch]; + const resolveResult = resolvePackageTarget( + packageJSONUrl, + target, + bestMatchSubpath, + bestMatch, + base, + true, + false, + conditions + ); + if (resolveResult == null) { + throwExportsNotFound(packageSubpath, packageJSONUrl, base); + } + return resolveResult; + } + throwExportsNotFound(packageSubpath, packageJSONUrl, base); +} +function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { const reason = "is not a valid internal imports specifier name"; throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, url.fileURLToPath(base)); @@ -19477,12 +19483,11 @@ function makeApi(runtimeState, opts) { return false; } const defaultExportsConditions = /* @__PURE__ */ new Set([ - `default`, `node`, `require`, ...getOptionValue(`--conditions`) ]); - function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions) { + function applyNodeExportsResolution(unqualifiedPath, conditions = defaultExportsConditions, issuer) { const locator = findPackageLocator(ppath.join(unqualifiedPath, `internal.js`), { resolveIgnored: true, includeDiscardFromLookup: true @@ -19498,6 +19503,8 @@ function makeApi(runtimeState, opts) { if (!opts.fakeFs.existsSync(manifestPath)) return null; const pkgJson = JSON.parse(opts.fakeFs.readFileSync(manifestPath, `utf8`)); + if (pkgJson.exports == null) + return null; let subpath = ppath.contains(packageLocation, unqualifiedPath); if (subpath === null) { throw makeError( @@ -19505,25 +19512,25 @@ function makeApi(runtimeState, opts) { `unqualifiedPath doesn't contain the packageLocation (this is probably an internal error)` ); } - if (!isRelativeRegexp.test(subpath)) + if (subpath !== `.` && !isRelativeRegexp.test(subpath)) subpath = `./${subpath}`; - let resolvedExport; try { - resolvedExport = resolve(pkgJson, ppath.normalize(subpath), { - conditions, - unsafe: true + const resolvedExport = packageExportsResolve({ + packageJSONUrl: url.pathToFileURL(npath.fromPortablePath(manifestPath)), + packageSubpath: subpath, + exports: pkgJson.exports, + base: issuer ? url.pathToFileURL(npath.fromPortablePath(issuer)) : null, + conditions }); + return npath.toPortablePath(url.fileURLToPath(resolvedExport)); } catch (error) { throw makeError( ErrorCode.EXPORTS_RESOLUTION_FAILED, error.message, { unqualifiedPath: getPathForDisplay(unqualifiedPath), locator, pkgJson, subpath: getPathForDisplay(subpath), conditions }, - `ERR_PACKAGE_PATH_NOT_EXPORTED` + error.code ); } - if (typeof resolvedExport === `string`) - return ppath.join(packageLocation, resolvedExport); - return null; } function applyNodeExtensionResolution(unqualifiedPath, candidates, { extensions }) { let stat; @@ -19900,10 +19907,10 @@ Required by: ${issuerLocator.name}@${issuerLocator.reference} (via ${issuerForDi } return ppath.normalize(unqualifiedPath); } - function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions) { + function resolveUnqualifiedExport(request, unqualifiedPath, conditions = defaultExportsConditions, issuer) { if (isStrictRegExp.test(request)) return unqualifiedPath; - const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions); + const unqualifiedExportPath = applyNodeExportsResolution(unqualifiedPath, conditions, issuer); if (unqualifiedExportPath) { return ppath.normalize(unqualifiedExportPath); } else { @@ -19990,7 +19997,7 @@ ${candidates.map((candidate) => `Not found: ${getPathForDisplay(candidate)} if (unqualifiedPath === null) return null; const isIssuerIgnored = () => issuer !== null ? isPathIgnored(issuer) : false; - const remappedPath = (!considerBuiltins || !isBuiltinModule(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions) : unqualifiedPath; + const remappedPath = (!considerBuiltins || !isBuiltinModule(request)) && !isIssuerIgnored() ? resolveUnqualifiedExport(request, unqualifiedPath, conditions, issuer) : unqualifiedPath; return resolveUnqualified(remappedPath, { extensions }); } catch (error) { if (Object.prototype.hasOwnProperty.call(error, `pnpCode`)) diff --git a/.pnp.loader.mjs b/.pnp.loader.mjs index 057766a..7390f92 100644 --- a/.pnp.loader.mjs +++ b/.pnp.loader.mjs @@ -1333,6 +1333,7 @@ const HAS_CONSOLIDATED_HOOKS = major > 16 || major === 16 && minor >= 12; const HAS_UNFLAGGED_JSON_MODULES = major > 17 || major === 17 && minor >= 5 || major === 16 && minor >= 15; const HAS_JSON_IMPORT_ASSERTION_REQUIREMENT = major > 17 || major === 17 && minor >= 1 || major === 16 && minor > 14; const WATCH_MODE_MESSAGE_USES_ARRAYS = major > 19 || major === 19 && minor >= 2 || major === 18 && minor >= 13; +const HAS_LAZY_LOADED_TRANSLATORS = major > 19 || major === 19 && minor >= 3; const builtinModules = new Set(Module.builtinModules || Object.keys(process.binding(`natives`))); const isBuiltinModule = (request) => request.startsWith(`node:`) || builtinModules.has(request); @@ -1854,12 +1855,7 @@ function patternKeyCompare(a, b) { return 1; return 0; } -function packageImportsResolve({ - name, - base, - conditions, - readFileSyncFn -}) { +function packageImportsResolve({ name, base, conditions, readFileSyncFn }) { if (name === "#" || StringPrototypeStartsWith(name, "#/") || StringPrototypeEndsWith(name, "/")) { const reason = "is not a valid internal imports specifier name"; throw new ERR_INVALID_MODULE_SPECIFIER(name, reason, fileURLToPath(base)); @@ -1955,7 +1951,7 @@ async function resolvePrivateRequest(specifier, issuer, context, nextResolve) { } } async function resolve$1(originalSpecifier, context, nextResolve) { - var _a; + var _a, _b; const { findPnpApi } = moduleExports; if (!findPnpApi || isBuiltinModule(originalSpecifier)) return nextResolve(originalSpecifier, context, nextResolve); @@ -1967,8 +1963,8 @@ async function resolve$1(originalSpecifier, context, nextResolve) { specifier = fileURLToPath(url); } const { parentURL, conditions = [] } = context; - const issuer = parentURL ? fileURLToPath(parentURL) : process.cwd(); - const pnpapi = (_a = findPnpApi(issuer)) != null ? _a : url ? findPnpApi(specifier) : null; + const issuer = parentURL && ((_a = tryParseURL(parentURL)) == null ? void 0 : _a.protocol) === `file:` ? fileURLToPath(parentURL) : process.cwd(); + const pnpapi = (_b = findPnpApi(issuer)) != null ? _b : url ? findPnpApi(specifier) : null; if (!pnpapi) return nextResolve(originalSpecifier, context, nextResolve); if (specifier.startsWith(`#`)) @@ -1988,10 +1984,17 @@ async function resolve$1(originalSpecifier, context, nextResolve) { } } } - const result = pnpapi.resolveRequest(specifier, issuer, { - conditions: new Set(conditions), - extensions: allowLegacyResolve ? void 0 : [] - }); + let result; + try { + result = pnpapi.resolveRequest(specifier, issuer, { + conditions: new Set(conditions), + extensions: allowLegacyResolve ? void 0 : [] + }); + } catch (err) { + if (err instanceof Error && `code` in err && err.code === `MODULE_NOT_FOUND`) + err.code = `ERR_MODULE_NOT_FOUND`; + throw err; + } if (!result) throw new Error(`Resolving '${specifier}' from '${issuer}' failed`); const resultURL = pathToFileURL(result); @@ -2007,32 +2010,34 @@ async function resolve$1(originalSpecifier, context, nextResolve) { }; } -const binding = process.binding(`fs`); -const originalfstat = binding.fstat; -const ZIP_MASK = 4278190080; -const ZIP_MAGIC = 704643072; -binding.fstat = function(...args) { - const [fd, useBigint, req] = args; - if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) { - try { - const stats = fs.fstatSync(fd); - return new Float64Array([ - stats.dev, - stats.mode, - stats.nlink, - stats.uid, - stats.gid, - stats.rdev, - stats.blksize, - stats.ino, - stats.size, - stats.blocks - ]); - } catch { +if (!HAS_LAZY_LOADED_TRANSLATORS) { + const binding = process.binding(`fs`); + const originalfstat = binding.fstat; + const ZIP_MASK = 4278190080; + const ZIP_MAGIC = 704643072; + binding.fstat = function(...args) { + const [fd, useBigint, req] = args; + if ((fd & ZIP_MASK) === ZIP_MAGIC && useBigint === false && req === void 0) { + try { + const stats = fs.fstatSync(fd); + return new Float64Array([ + stats.dev, + stats.mode, + stats.nlink, + stats.uid, + stats.gid, + stats.rdev, + stats.blksize, + stats.ino, + stats.size, + stats.blocks + ]); + } catch { + } } - } - return originalfstat.apply(this, args); -}; + return originalfstat.apply(this, args); + }; +} const resolve = resolve$1; const getFormat = HAS_CONSOLIDATED_HOOKS ? void 0 : getFormat$1; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index b598367..f4a30e0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,32 +2,28 @@ import "./globals.css"; import { Noto_Sans_KR } from "@next/font/google"; import Header from "@/components/common/Header"; import Provider from "@/components/Provider"; -import type { Metadata } from "next"; +import SEOConfig from "@/components/SEO"; const notoSans = Noto_Sans_KR({ - weight: ["400", "500", "700"], - subsets: ["latin"], - display: "swap", + weight: ["400", "500", "700"], + subsets: ["latin"], + display: "swap", }); -export const metadata: Metadata = { - title: "JOBIS", - description: "취업의 지름길", -}; - export default function RootLayout({ - children, + children, }: { - children: React.ReactNode; + children: React.ReactNode; }) { - return ( - - - -
- {children} - - - - ); + return ( + + + + +
+ {children} + + + + ); } diff --git a/src/components/SEO.tsx b/src/components/SEO.tsx new file mode 100644 index 0000000..2cbda00 --- /dev/null +++ b/src/components/SEO.tsx @@ -0,0 +1,41 @@ +import Head from "next/head"; + +const SEOConfig = () => { + return ( + + JOBIS + + + + + + + + + + + + + + ); +}; + +export default SEOConfig; From 4f5047945dccc960ce379b94ce288f6d921fe037 Mon Sep 17 00:00:00 2001 From: KANGYONGSU23 Date: Wed, 6 Dec 2023 15:31:59 +0900 Subject: [PATCH 2/2] =?UTF-8?q?hotfix=20::=20response=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/apis/recruitments/type.ts | 9 ++++----- src/components/recruitments/RecruitmentsCard.tsx | 14 +++++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/apis/recruitments/type.ts b/src/apis/recruitments/type.ts index c17c995..803e59c 100644 --- a/src/apis/recruitments/type.ts +++ b/src/apis/recruitments/type.ts @@ -1,15 +1,14 @@ export interface RecruitmentsListResponseType { - recruitments: RecruitmentsListType[]; + recruitments: RecruitmentsListType[]; } export interface RecruitmentsListType { - recruit_id: number; + id: number; company_name: string; company_profile_url: string; train_pay: number; - military: boolean; - total_hiring: number; - job_code_list: string; + military_support: boolean; + hiring_jobs: number; bookmarked: boolean; } diff --git a/src/components/recruitments/RecruitmentsCard.tsx b/src/components/recruitments/RecruitmentsCard.tsx index ca8e649..866b68d 100644 --- a/src/components/recruitments/RecruitmentsCard.tsx +++ b/src/components/recruitments/RecruitmentsCard.tsx @@ -32,15 +32,15 @@ export default function RecruitmentsCard({ maxLength = 12 }: PropsType) { company_profile_url, company_name, train_pay, - job_code_list, + hiring_jobs, bookmarked, - recruit_id, - military, + id, + military_support, }, index ) => (
@@ -54,21 +54,21 @@ export default function RecruitmentsCard({ maxLength = 12 }: PropsType) {

- {job_code_list} + {hiring_jobs}

{company_name}

실습수당 {money_regex(train_pay)}원
- {military &&
병역특례
} + {military_support &&
병역특례
}