gatsby 3.14.2 → 3.14.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/serve.js +14 -16
- package/dist/commands/serve.js.map +1 -1
- package/dist/datastore/lmdb/lmdb-datastore.js +26 -6
- package/dist/datastore/lmdb/lmdb-datastore.js.map +1 -1
- package/dist/datastore/lmdb/updates/nodes.js.map +1 -1
- package/dist/internal-plugins/functions/gatsby-node.js +16 -17
- package/dist/internal-plugins/functions/gatsby-node.js.map +1 -1
- package/dist/utils/node-manifest.js +26 -7
- package/dist/utils/node-manifest.js.map +1 -1
- package/gatsby-admin-public/index.html +1 -1
- package/gatsby-admin-public/pages/index.html +1 -1
- package/gatsby-admin-public/plugins/index.html +1 -1
- package/gatsby-admin-public/recipe/index.html +1 -1
- package/gatsby-admin-public/recipes/index.html +1 -1
- package/gatsby-admin-public/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2 +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2 +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2 +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff +0 -0
- package/package.json +3 -4
- package/gatsby-admin-public/static/webfonts/s/inter/v3/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2 +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v3/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v3/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2 +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v3/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v3/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2 +0 -0
- package/gatsby-admin-public/static/webfonts/s/inter/v3/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff +0 -0
package/dist/commands/serve.js
CHANGED
|
@@ -22,8 +22,6 @@ var _reporter = _interopRequireDefault(require("gatsby-cli/lib/reporter"));
|
|
|
22
22
|
|
|
23
23
|
var _multer = _interopRequireDefault(require("multer"));
|
|
24
24
|
|
|
25
|
-
var _pathToRegexp = _interopRequireDefault(require("path-to-regexp"));
|
|
26
|
-
|
|
27
25
|
var _cookie = _interopRequireDefault(require("cookie"));
|
|
28
26
|
|
|
29
27
|
var _gatsbyTelemetry = _interopRequireDefault(require("gatsby-telemetry"));
|
|
@@ -149,24 +147,24 @@ module.exports = async program => {
|
|
|
149
147
|
// Check if there's any matchPaths that match.
|
|
150
148
|
// We loop until we find the first match.
|
|
151
149
|
functions.some(f => {
|
|
152
|
-
let exp;
|
|
153
|
-
const keys = [];
|
|
154
|
-
|
|
155
150
|
if (f.matchPath) {
|
|
156
|
-
|
|
157
|
-
}
|
|
151
|
+
const matchResult = (0, _utils.match)(f.matchPath, pathFragment);
|
|
158
152
|
|
|
159
|
-
|
|
160
|
-
|
|
153
|
+
if (matchResult) {
|
|
154
|
+
req.params = matchResult.params;
|
|
161
155
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
156
|
+
if (req.params[`*`]) {
|
|
157
|
+
// Backwards compatability for v3
|
|
158
|
+
// TODO remove in v5
|
|
159
|
+
req.params[`0`] = req.params[`*`];
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
functionObj = f;
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
169
165
|
}
|
|
166
|
+
|
|
167
|
+
return false;
|
|
170
168
|
});
|
|
171
169
|
}
|
|
172
170
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/commands/serve.ts"],"names":["telemetry","trackCli","readMatchPaths","program","filePath","path","join","directory","rawJSON","fs","readFile","error","report","warn","chalk","bold","JSON","parse","matchPathRouter","matchPaths","options","req","res","next","url","accepts","matchPath","find","sendFile","err","module","exports","startBackgroundUpdate","prefixPaths","port","open","host","parseInt","configModule","config","pathPrefix","configPathPrefix","root","app","router","express","Router","use","expressMiddleware","static","dotfiles","compiledFunctionsDir","functions","readFileSync","e","any","urlencoded","extended","_","cookies","headers","cookie","text","json","raw","pathFragment","params","functionObj","functionRoute","some","f","exp","keys","exec","matches","match","slice","newParams","forEach","index","name","pathToFunction","absoluteCompiledFilePath","start","Date","now","require","cache","resolve","fn","fnToExecute","default","Promise","console","headersSent","sendStatus","end","log","GraphQLEngine","getData","renderPageData","renderHTML","graphqlEngine","dbPath","get","requestedPagePath","pagePath","potentialPagePath","page","findPageByPath","mode","data","pathName","results","serverDataHeaders","value","Object","entries","setHeader","send","status","header","printInstructions","appName","urls","lanUrlForTerminal","localUrlForTerminal","startListening","listen","ssl","sitePackageJson","info","localUrlForBrowser","catch","message"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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ACAvC,QAAAA,OAAO,CAACJ,OAAR,CAAgB,wBAAQoC,IAAI,CAACQ,kBAAb,CAAhB,EAAkDC,KAAlD,CAAwD,MACtDzH,kBAAOC,IAAP,CAAa,iDAAb,CADF;AAGD;AACF,KAhBD;AAiBD,GAlBD;;AAoBA,MAAI;AACFqB,IAAAA,IAAI,GAAG,MAAM,wDAAyBA,IAAzB,CAAb;AACA6F,IAAAA,cAAc;AACf,GAHD,CAGE,OAAOzE,CAAP,EAAU;AACV,QAAIA,CAAC,CAACgF,OAAF,KAAe,eAAnB,EAAmC;AACjC;AACD;;AAED,UAAMhF,CAAN;AACD;AACF,CAxRD","sourcesContent":["import path from \"path\"\nimport openurl from \"better-opn\"\nimport fs from \"fs-extra\"\nimport compression from \"compression\"\nimport express from \"express\"\nimport chalk from \"chalk\"\nimport { match as reachMatch } from \"@gatsbyjs/reach-router/lib/utils\"\nimport onExit from \"signal-exit\"\nimport report from \"gatsby-cli/lib/reporter\"\nimport multer from \"multer\"\nimport pathToRegexp from \"path-to-regexp\"\nimport cookie from \"cookie\"\nimport telemetry from \"gatsby-telemetry\"\n\nimport { detectPortInUseAndPrompt } from \"../utils/detect-port-in-use-and-prompt\"\nimport { getConfigFile } from \"../bootstrap/get-config-file\"\nimport { preferDefault } from \"../bootstrap/prefer-default\"\nimport { IProgram } from \"./types\"\nimport { IPreparedUrls, prepareUrls } from \"../utils/prepare-urls\"\nimport { IGatsbyFunction } from \"../redux/types\"\nimport { reverseFixedPagePath } from \"../utils/page-data\"\n\ninterface IMatchPath {\n path: string\n matchPath: string\n}\n\ninterface IPathToRegexpKey {\n name: string | number\n prefix: string\n suffix: string\n pattern: string\n modifier: string\n}\n\ninterface IServeProgram extends IProgram {\n prefixPaths: boolean\n}\n\nonExit(() => {\n telemetry.trackCli(`SERVE_STOP`)\n})\n\nconst readMatchPaths = async (\n program: IServeProgram\n): Promise<Array<IMatchPath>> => {\n const filePath = path.join(program.directory, `.cache`, `match-paths.json`)\n let rawJSON = `[]`\n try {\n rawJSON = await fs.readFile(filePath, `utf8`)\n } catch (error) {\n report.warn(error)\n report.warn(\n `Could not read ${chalk.bold(\n `match-paths.json`\n )} from the .cache directory`\n )\n report.warn(\n `Client-side routing will not work correctly. Maybe you need to re-run ${chalk.bold(\n `gatsby build`\n )}?`\n )\n }\n return JSON.parse(rawJSON) as Array<IMatchPath>\n}\n\nconst matchPathRouter =\n (\n matchPaths: Array<IMatchPath>,\n options: {\n root: string\n }\n ) =>\n (\n req: express.Request,\n res: express.Response,\n next: express.NextFunction\n ): void => {\n const { url } = req\n if (req.accepts(`html`)) {\n const matchPath = matchPaths.find(\n ({ matchPath }) => reachMatch(matchPath, url) !== null\n )\n if (matchPath) {\n return res.sendFile(\n path.join(matchPath.path, `index.html`),\n options,\n err => {\n if (err) {\n next()\n }\n }\n )\n }\n }\n return next()\n }\n\nmodule.exports = async (program: IServeProgram): Promise<void> => {\n telemetry.trackCli(`SERVE_START`)\n telemetry.startBackgroundUpdate()\n let { prefixPaths, port, open, host } = program\n port = typeof port === `string` ? parseInt(port, 10) : port\n\n const { configModule } = await getConfigFile(\n program.directory,\n `gatsby-config`\n )\n const config = preferDefault(configModule)\n\n const { pathPrefix: configPathPrefix } = config || {}\n\n const pathPrefix = prefixPaths && configPathPrefix ? configPathPrefix : `/`\n\n const root = path.join(program.directory, `public`)\n\n const app = express()\n // eslint-disable-next-line new-cap\n const router = express.Router()\n\n app.use(telemetry.expressMiddleware(`SERVE`))\n\n router.use(compression())\n router.use(express.static(`public`, { dotfiles: `allow` }))\n\n const compiledFunctionsDir = path.join(\n program.directory,\n `.cache`,\n `functions`\n )\n\n let functions: Array<IGatsbyFunction> = []\n try {\n functions = JSON.parse(\n fs.readFileSync(path.join(compiledFunctionsDir, `manifest.json`), `utf-8`)\n )\n } catch (e) {\n // ignore\n }\n\n if (functions) {\n app.use(\n `/api/*`,\n multer().any(),\n express.urlencoded({ extended: true }),\n (req, _, next) => {\n const cookies = req.headers.cookie\n\n if (!cookies) {\n return next()\n }\n\n req.cookies = cookie.parse(cookies)\n\n return next()\n },\n express.text(),\n express.json(),\n express.raw(),\n async (req, res, next) => {\n const { \"0\": pathFragment } = req.params\n\n // Check first for exact matches.\n let functionObj = functions.find(\n ({ functionRoute }) => functionRoute === pathFragment\n )\n\n if (!functionObj) {\n // Check if there's any matchPaths that match.\n // We loop until we find the first match.\n functions.some(f => {\n let exp\n const keys: Array<IPathToRegexpKey> = []\n if (f.matchPath) {\n exp = pathToRegexp(f.matchPath, keys)\n }\n if (exp && exp.exec(pathFragment) !== null) {\n functionObj = f\n // @ts-ignore - TS bug? https://stackoverflow.com/questions/50234481/typescript-2-8-3-type-must-have-a-symbol-iterator-method-that-returns-an-iterato\n const matches = [...pathFragment.match(exp)].slice(1)\n const newParams = {}\n matches.forEach(\n (match, index) => (newParams[keys[index].name] = match)\n )\n req.params = newParams\n\n return true\n } else {\n return false\n }\n })\n }\n\n if (functionObj) {\n const pathToFunction = functionObj.absoluteCompiledFilePath\n const start = Date.now()\n\n try {\n delete require.cache[require.resolve(pathToFunction)]\n const fn = require(pathToFunction)\n\n const fnToExecute = (fn && fn.default) || fn\n\n await Promise.resolve(fnToExecute(req, res))\n } catch (e) {\n console.error(e)\n // Don't send the error if that would cause another error.\n if (!res.headersSent) {\n res.sendStatus(500)\n }\n }\n\n const end = Date.now()\n console.log(\n `Executed function \"/api/${functionObj.functionRoute}\" in ${\n end - start\n }ms`\n )\n\n return\n } else {\n next()\n }\n }\n )\n }\n\n // Handle SSR & DSR Pages\n if (_CFLAGS_.GATSBY_MAJOR === `4`) {\n try {\n const { GraphQLEngine } = require(path.join(\n program.directory,\n `.cache`,\n `query-engine`\n )) as typeof import(\"../schema/graphql-engine/entry\")\n const { getData, renderPageData, renderHTML } = require(path.join(\n program.directory,\n `.cache`,\n `page-ssr`\n )) as typeof import(\"../utils/page-ssr-module/entry\")\n const graphqlEngine = new GraphQLEngine({\n dbPath: path.join(program.directory, `.cache`, `data`, `datastore`),\n })\n\n app.get(\n `/page-data/:pagePath(*)/page-data.json`,\n async (req, res, next) => {\n const requestedPagePath = req.params.pagePath\n if (!requestedPagePath) {\n return void next()\n }\n\n const potentialPagePath = reverseFixedPagePath(requestedPagePath)\n const page = graphqlEngine.findPageByPath(potentialPagePath)\n\n if (page && (page.mode === `DSR` || page.mode === `SSR`)) {\n const data = await getData({\n pathName: req.path,\n graphqlEngine,\n req,\n })\n const results = await renderPageData({ data })\n if (page.mode === `SSR` && data.serverDataHeaders) {\n for (const [name, value] of Object.entries(\n data.serverDataHeaders\n )) {\n res.setHeader(name, value)\n }\n }\n return void res.send(results)\n }\n\n return void next()\n }\n )\n\n router.use(async (req, res, next) => {\n if (req.accepts(`html`)) {\n const potentialPagePath = req.path\n const page = graphqlEngine.findPageByPath(potentialPagePath)\n\n if (page && (page.mode === `DSR` || page.mode === `SSR`)) {\n const data = await getData({\n pathName: potentialPagePath,\n graphqlEngine,\n req,\n })\n const results = await renderHTML({ data })\n if (page.mode === `SSR` && data.serverDataHeaders) {\n for (const [name, value] of Object.entries(\n data.serverDataHeaders\n )) {\n res.setHeader(name, value)\n }\n }\n return res.send(results)\n }\n\n return res.status(404).sendFile(`404.html`, { root })\n }\n return next()\n })\n } catch (error) {\n // TODO: Handle case of engine not being generated\n }\n }\n\n const matchPaths = await readMatchPaths(program)\n router.use(matchPathRouter(matchPaths, { root }))\n\n // TODO: Remove/merge with above same block\n router.use((req, res, next) => {\n if (req.accepts(`html`)) {\n return res.status(404).sendFile(`404.html`, { root })\n }\n return next()\n })\n app.use(function (\n _: express.Request,\n res: express.Response,\n next: express.NextFunction\n ) {\n res.header(`Access-Control-Allow-Origin`, `*`)\n res.header(\n `Access-Control-Allow-Headers`,\n `Origin, X-Requested-With, Content-Type, Accept`\n )\n next()\n })\n app.use(pathPrefix, router)\n\n function printInstructions(appName: string, urls: IPreparedUrls): void {\n console.log()\n console.log(`You can now view ${chalk.bold(appName)} in the browser.`)\n console.log()\n\n if (urls.lanUrlForTerminal) {\n console.log(\n ` ${chalk.bold(`Local:`)} ${urls.localUrlForTerminal}`\n )\n console.log(\n ` ${chalk.bold(`On Your Network:`)} ${urls.lanUrlForTerminal}`\n )\n } else {\n console.log(` ${urls.localUrlForTerminal}`)\n }\n }\n\n const startListening = (): void => {\n app.listen(port, host, () => {\n const urls = prepareUrls(\n program.ssl ? `https` : `http`,\n program.host,\n port\n )\n printInstructions(\n program.sitePackageJson.name || `(Unnamed package)`,\n urls\n )\n if (open) {\n report.info(`Opening browser...`)\n Promise.resolve(openurl(urls.localUrlForBrowser)).catch(() =>\n report.warn(`Browser not opened because no browser was found`)\n )\n }\n })\n }\n\n try {\n port = await detectPortInUseAndPrompt(port)\n startListening()\n } catch (e) {\n if (e.message === `USER_REJECTED`) {\n return\n }\n\n throw e\n }\n}\n"],"file":"serve.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/commands/serve.ts"],"names":["telemetry","trackCli","readMatchPaths","program","filePath","path","join","directory","rawJSON","fs","readFile","error","report","warn","chalk","bold","JSON","parse","matchPathRouter","matchPaths","options","req","res","next","url","accepts","matchPath","find","sendFile","err","module","exports","startBackgroundUpdate","prefixPaths","port","open","host","parseInt","configModule","config","pathPrefix","configPathPrefix","root","app","router","express","Router","use","expressMiddleware","static","dotfiles","compiledFunctionsDir","functions","readFileSync","e","any","urlencoded","extended","_","cookies","headers","cookie","text","json","raw","pathFragment","params","functionObj","functionRoute","some","f","matchResult","pathToFunction","absoluteCompiledFilePath","start","Date","now","require","cache","resolve","fn","fnToExecute","default","Promise","console","headersSent","sendStatus","end","log","GraphQLEngine","getData","renderPageData","renderHTML","graphqlEngine","dbPath","get","requestedPagePath","pagePath","potentialPagePath","page","findPageByPath","mode","data","pathName","results","serverDataHeaders","name","value","Object","entries","setHeader","send","status","header","printInstructions","appName","urls","lanUrlForTerminal","localUrlForTerminal","startListening","listen","ssl","sitePackageJson","info","localUrlForBrowser","catch","message"],"mappings":";;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;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AAyBA,IAAzB,CAAb;AACAqF,IAAAA,cAAc;AACf,GAHD,CAGE,OAAOjE,CAAP,EAAU;AACV,QAAIA,CAAC,CAACwE,OAAF,KAAe,eAAnB,EAAmC;AACjC;AACD;;AAED,UAAMxE,CAAN;AACD;AACF,CArRD","sourcesContent":["import path from \"path\"\nimport openurl from \"better-opn\"\nimport fs from \"fs-extra\"\nimport compression from \"compression\"\nimport express from \"express\"\nimport chalk from \"chalk\"\nimport { match as reachMatch } from \"@gatsbyjs/reach-router/lib/utils\"\nimport onExit from \"signal-exit\"\nimport report from \"gatsby-cli/lib/reporter\"\nimport multer from \"multer\"\nimport cookie from \"cookie\"\nimport telemetry from \"gatsby-telemetry\"\n\nimport { detectPortInUseAndPrompt } from \"../utils/detect-port-in-use-and-prompt\"\nimport { getConfigFile } from \"../bootstrap/get-config-file\"\nimport { preferDefault } from \"../bootstrap/prefer-default\"\nimport { IProgram } from \"./types\"\nimport { IPreparedUrls, prepareUrls } from \"../utils/prepare-urls\"\nimport { IGatsbyFunction } from \"../redux/types\"\nimport { reverseFixedPagePath } from \"../utils/page-data\"\n\ninterface IMatchPath {\n path: string\n matchPath: string\n}\n\ninterface IServeProgram extends IProgram {\n prefixPaths: boolean\n}\n\nonExit(() => {\n telemetry.trackCli(`SERVE_STOP`)\n})\n\nconst readMatchPaths = async (\n program: IServeProgram\n): Promise<Array<IMatchPath>> => {\n const filePath = path.join(program.directory, `.cache`, `match-paths.json`)\n let rawJSON = `[]`\n try {\n rawJSON = await fs.readFile(filePath, `utf8`)\n } catch (error) {\n report.warn(error)\n report.warn(\n `Could not read ${chalk.bold(\n `match-paths.json`\n )} from the .cache directory`\n )\n report.warn(\n `Client-side routing will not work correctly. Maybe you need to re-run ${chalk.bold(\n `gatsby build`\n )}?`\n )\n }\n return JSON.parse(rawJSON) as Array<IMatchPath>\n}\n\nconst matchPathRouter =\n (\n matchPaths: Array<IMatchPath>,\n options: {\n root: string\n }\n ) =>\n (\n req: express.Request,\n res: express.Response,\n next: express.NextFunction\n ): void => {\n const { url } = req\n if (req.accepts(`html`)) {\n const matchPath = matchPaths.find(\n ({ matchPath }) => reachMatch(matchPath, url) !== null\n )\n if (matchPath) {\n return res.sendFile(\n path.join(matchPath.path, `index.html`),\n options,\n err => {\n if (err) {\n next()\n }\n }\n )\n }\n }\n return next()\n }\n\nmodule.exports = async (program: IServeProgram): Promise<void> => {\n telemetry.trackCli(`SERVE_START`)\n telemetry.startBackgroundUpdate()\n let { prefixPaths, port, open, host } = program\n port = typeof port === `string` ? parseInt(port, 10) : port\n\n const { configModule } = await getConfigFile(\n program.directory,\n `gatsby-config`\n )\n const config = preferDefault(configModule)\n\n const { pathPrefix: configPathPrefix } = config || {}\n\n const pathPrefix = prefixPaths && configPathPrefix ? configPathPrefix : `/`\n\n const root = path.join(program.directory, `public`)\n\n const app = express()\n // eslint-disable-next-line new-cap\n const router = express.Router()\n\n app.use(telemetry.expressMiddleware(`SERVE`))\n\n router.use(compression())\n router.use(express.static(`public`, { dotfiles: `allow` }))\n\n const compiledFunctionsDir = path.join(\n program.directory,\n `.cache`,\n `functions`\n )\n\n let functions: Array<IGatsbyFunction> = []\n try {\n functions = JSON.parse(\n fs.readFileSync(path.join(compiledFunctionsDir, `manifest.json`), `utf-8`)\n )\n } catch (e) {\n // ignore\n }\n\n if (functions) {\n app.use(\n `/api/*`,\n multer().any(),\n express.urlencoded({ extended: true }),\n (req, _, next) => {\n const cookies = req.headers.cookie\n\n if (!cookies) {\n return next()\n }\n\n req.cookies = cookie.parse(cookies)\n\n return next()\n },\n express.text(),\n express.json(),\n express.raw(),\n async (req, res, next) => {\n const { \"0\": pathFragment } = req.params\n\n // Check first for exact matches.\n let functionObj = functions.find(\n ({ functionRoute }) => functionRoute === pathFragment\n )\n\n if (!functionObj) {\n // Check if there's any matchPaths that match.\n // We loop until we find the first match.\n functions.some(f => {\n if (f.matchPath) {\n const matchResult = reachMatch(f.matchPath, pathFragment)\n if (matchResult) {\n req.params = matchResult.params\n if (req.params[`*`]) {\n // Backwards compatability for v3\n // TODO remove in v5\n req.params[`0`] = req.params[`*`]\n }\n functionObj = f\n\n return true\n }\n }\n\n return false\n })\n }\n\n if (functionObj) {\n const pathToFunction = functionObj.absoluteCompiledFilePath\n const start = Date.now()\n\n try {\n delete require.cache[require.resolve(pathToFunction)]\n const fn = require(pathToFunction)\n\n const fnToExecute = (fn && fn.default) || fn\n\n await Promise.resolve(fnToExecute(req, res))\n } catch (e) {\n console.error(e)\n // Don't send the error if that would cause another error.\n if (!res.headersSent) {\n res.sendStatus(500)\n }\n }\n\n const end = Date.now()\n console.log(\n `Executed function \"/api/${functionObj.functionRoute}\" in ${\n end - start\n }ms`\n )\n\n return\n } else {\n next()\n }\n }\n )\n }\n\n // Handle SSR & DSR Pages\n if (_CFLAGS_.GATSBY_MAJOR === `4`) {\n try {\n const { GraphQLEngine } = require(path.join(\n program.directory,\n `.cache`,\n `query-engine`\n )) as typeof import(\"../schema/graphql-engine/entry\")\n const { getData, renderPageData, renderHTML } = require(path.join(\n program.directory,\n `.cache`,\n `page-ssr`\n )) as typeof import(\"../utils/page-ssr-module/entry\")\n const graphqlEngine = new GraphQLEngine({\n dbPath: path.join(program.directory, `.cache`, `data`, `datastore`),\n })\n\n app.get(\n `/page-data/:pagePath(*)/page-data.json`,\n async (req, res, next) => {\n const requestedPagePath = req.params.pagePath\n if (!requestedPagePath) {\n return void next()\n }\n\n const potentialPagePath = reverseFixedPagePath(requestedPagePath)\n const page = graphqlEngine.findPageByPath(potentialPagePath)\n\n if (page && (page.mode === `DSR` || page.mode === `SSR`)) {\n const data = await getData({\n pathName: req.path,\n graphqlEngine,\n req,\n })\n const results = await renderPageData({ data })\n if (page.mode === `SSR` && data.serverDataHeaders) {\n for (const [name, value] of Object.entries(\n data.serverDataHeaders\n )) {\n res.setHeader(name, value)\n }\n }\n return void res.send(results)\n }\n\n return void next()\n }\n )\n\n router.use(async (req, res, next) => {\n if (req.accepts(`html`)) {\n const potentialPagePath = req.path\n const page = graphqlEngine.findPageByPath(potentialPagePath)\n\n if (page && (page.mode === `DSR` || page.mode === `SSR`)) {\n const data = await getData({\n pathName: potentialPagePath,\n graphqlEngine,\n req,\n })\n const results = await renderHTML({ data })\n if (page.mode === `SSR` && data.serverDataHeaders) {\n for (const [name, value] of Object.entries(\n data.serverDataHeaders\n )) {\n res.setHeader(name, value)\n }\n }\n return res.send(results)\n }\n\n return res.status(404).sendFile(`404.html`, { root })\n }\n return next()\n })\n } catch (error) {\n // TODO: Handle case of engine not being generated\n }\n }\n\n const matchPaths = await readMatchPaths(program)\n router.use(matchPathRouter(matchPaths, { root }))\n\n // TODO: Remove/merge with above same block\n router.use((req, res, next) => {\n if (req.accepts(`html`)) {\n return res.status(404).sendFile(`404.html`, { root })\n }\n return next()\n })\n app.use(function (\n _: express.Request,\n res: express.Response,\n next: express.NextFunction\n ) {\n res.header(`Access-Control-Allow-Origin`, `*`)\n res.header(\n `Access-Control-Allow-Headers`,\n `Origin, X-Requested-With, Content-Type, Accept`\n )\n next()\n })\n app.use(pathPrefix, router)\n\n function printInstructions(appName: string, urls: IPreparedUrls): void {\n console.log()\n console.log(`You can now view ${chalk.bold(appName)} in the browser.`)\n console.log()\n\n if (urls.lanUrlForTerminal) {\n console.log(\n ` ${chalk.bold(`Local:`)} ${urls.localUrlForTerminal}`\n )\n console.log(\n ` ${chalk.bold(`On Your Network:`)} ${urls.lanUrlForTerminal}`\n )\n } else {\n console.log(` ${urls.localUrlForTerminal}`)\n }\n }\n\n const startListening = (): void => {\n app.listen(port, host, () => {\n const urls = prepareUrls(\n program.ssl ? `https` : `http`,\n program.host,\n port\n )\n printInstructions(\n program.sitePackageJson.name || `(Unnamed package)`,\n urls\n )\n if (open) {\n report.info(`Opening browser...`)\n Promise.resolve(openurl(urls.localUrlForBrowser)).catch(() =>\n report.warn(`Browser not opened because no browser was found`)\n )\n }\n })\n }\n\n try {\n port = await detectPortInUseAndPrompt(port)\n startListening()\n } catch (e) {\n if (e.message === `USER_REJECTED`) {\n return\n }\n\n throw e\n }\n}\n"],"file":"serve.js"}
|
|
@@ -30,6 +30,7 @@ const lmdbDatastore = {
|
|
|
30
30
|
getNodes,
|
|
31
31
|
getNodesByType
|
|
32
32
|
};
|
|
33
|
+
const preSyncDeletedNodeIdsCache = new Set();
|
|
33
34
|
|
|
34
35
|
function getDefaultDbPath() {
|
|
35
36
|
var _process$env$FORCE_TE;
|
|
@@ -135,7 +136,10 @@ function iterateNodesByType(type) {
|
|
|
135
136
|
}
|
|
136
137
|
|
|
137
138
|
function getNode(id) {
|
|
138
|
-
if (!id)
|
|
139
|
+
if (!id || preSyncDeletedNodeIdsCache.has(id)) {
|
|
140
|
+
return undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
139
143
|
const {
|
|
140
144
|
nodes
|
|
141
145
|
} = getDatabases();
|
|
@@ -148,9 +152,8 @@ function getTypes() {
|
|
|
148
152
|
|
|
149
153
|
function countNodes(typeName) {
|
|
150
154
|
if (!typeName) {
|
|
151
|
-
const stats = getDatabases().nodes.getStats();
|
|
152
|
-
|
|
153
|
-
return Number(stats.entryCount || 0); // FIXME: add -1 when restoring shared structures key
|
|
155
|
+
const stats = getDatabases().nodes.getStats();
|
|
156
|
+
return Math.max(Number(stats.entryCount) - preSyncDeletedNodeIdsCache.size, 0); // FIXME: add -1 when restoring shared structures key
|
|
154
157
|
}
|
|
155
158
|
|
|
156
159
|
const {
|
|
@@ -196,12 +199,29 @@ function updateDataStore(action) {
|
|
|
196
199
|
}
|
|
197
200
|
|
|
198
201
|
case `CREATE_NODE`:
|
|
202
|
+
case `DELETE_NODE`:
|
|
199
203
|
case `ADD_FIELD_TO_NODE`:
|
|
200
204
|
case `ADD_CHILD_NODE_TO_PARENT_NODE`:
|
|
201
|
-
case `DELETE_NODE`:
|
|
202
205
|
{
|
|
206
|
+
var _action$payload;
|
|
207
|
+
|
|
203
208
|
const dbs = getDatabases();
|
|
204
|
-
|
|
209
|
+
const operationPromise = Promise.all([(0, _nodes.updateNodes)(dbs.nodes, action), (0, _nodesByType.updateNodesByType)(dbs.nodesByType, action)]);
|
|
210
|
+
lastOperationPromise = operationPromise; // if create is used in the same transaction as delete we should remove it from cache
|
|
211
|
+
|
|
212
|
+
if (action.type === `CREATE_NODE`) {
|
|
213
|
+
preSyncDeletedNodeIdsCache.delete(action.payload.id);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (action.type === `DELETE_NODE` && (_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.id) {
|
|
217
|
+
preSyncDeletedNodeIdsCache.add(action.payload.id);
|
|
218
|
+
operationPromise.then(() => {
|
|
219
|
+
// only clear if no other operations have been done in the meantime
|
|
220
|
+
if (lastOperationPromise === operationPromise) {
|
|
221
|
+
preSyncDeletedNodeIdsCache.clear();
|
|
222
|
+
}
|
|
223
|
+
});
|
|
224
|
+
}
|
|
205
225
|
}
|
|
206
226
|
}
|
|
207
227
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/datastore/lmdb/lmdb-datastore.ts"],"names":["lmdbDatastore","getNode","getTypes","countNodes","iterateNodes","iterateNodesByType","updateDataStore","ready","runQuery","getNodes","getNodesByType","getDefaultDbPath","dbFileName","process","env","NODE_ENV","FORCE_TEST_DATABASE_ID","JEST_WORKER_ID","cwd","fullDbPath","rootDb","databases","getRootDb","Error","name","path","compression","getDatabases","nodes","openDB","cache","nodesByType","dupSort","metadata","useVersions","indexes","result","Array","from","type","nodesDb","GatsbyIterable","getKeys","snapshot","map","nodeId","undefined","filter","Boolean","getValues","id","get","asArray","typeName","stats","getStats","Number","entryCount","getValuesCount","args","GATSBY_EXPERIMENTAL_LMDB_INDEXES","datastore","Promise","resolve","lastOperationPromise","action","dbs","transactionSync","clear","clearIndexes","all","setupLmdbStore","dbPath","state","Map","emitter","on"],"mappings":";;;;;AAAA;;AAGA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA,MAAMA,aAAa,GAAG;AACpBC,EAAAA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AAe;AACb5C,IAAAA,KAAK,EAAE,CAAC6C,KAAK,GAAG,IAAIC,GAAJ,EAAT,EAAoBT,MAApB,KACLA,MAAM,CAAC1B,IAAP,KAAiB,cAAjB,GAAiC,IAAImC,GAAJ,EAAjC,GAA6CD,KAFlC;AAGb1C,IAAAA,WAAW,EAAE,CAAC0C,KAAK,GAAG,IAAIC,GAAJ,EAAT,EAAoBT,MAApB,KACXA,MAAM,CAAC1B,IAAP,KAAiB,cAAjB,GAAiC,IAAImC,GAAJ,EAAjC,GAA6CD;AAJlC,GAAf;;AAMAE,iBAAQC,EAAR,CAAY,GAAZ,EAAgBX,MAAM,IAAI;AACxB,QAAIA,MAAJ,EAAY;AACV3D,MAAAA,eAAe,CAAC2D,MAAD,CAAf;AACD;AACF,GAJD,EATuC,CAcvC;;;AACAI,EAAAA,YAAY;AACZ,SAAOrE,aAAP;AACD","sourcesContent":["import { RootDatabase, open } from \"lmdb-store\"\n// import { performance } from \"perf_hooks\"\nimport { ActionsUnion, IGatsbyNode } from \"../../redux/types\"\nimport { updateNodes } from \"./updates/nodes\"\nimport { updateNodesByType } from \"./updates/nodes-by-type\"\nimport { IDataStore, ILmdbDatabases, IQueryResult } from \"../types\"\nimport { emitter, replaceReducer } from \"../../redux\"\nimport { GatsbyIterable } from \"../common/iterable\"\nimport { doRunQuery } from \"./query/run-query\"\nimport {\n IRunFilterArg,\n runFastFiltersAndSort,\n} from \"../in-memory/run-fast-filters\"\n\nconst lmdbDatastore = {\n getNode,\n getTypes,\n countNodes,\n iterateNodes,\n iterateNodesByType,\n updateDataStore,\n ready,\n runQuery,\n\n // deprecated:\n getNodes,\n getNodesByType,\n}\n\nfunction getDefaultDbPath(): string {\n const dbFileName =\n process.env.NODE_ENV === `test`\n ? `test-datastore-${\n // FORCE_TEST_DATABASE_ID will be set if this gets executed in worker context\n // when running jest tests. JEST_WORKER_ID will be set when this gets executed directly\n // in test context (jest will use jest-worker internally).\n process.env.FORCE_TEST_DATABASE_ID ?? process.env.JEST_WORKER_ID\n }`\n : `datastore`\n\n return process.cwd() + `/.cache/data/` + dbFileName\n}\n\nlet fullDbPath\nlet rootDb\nlet databases\n\nfunction getRootDb(): RootDatabase {\n if (!rootDb) {\n if (!fullDbPath) {\n throw new Error(`LMDB path is not set!`)\n }\n rootDb = open({\n name: `root`,\n path: fullDbPath,\n compression: true,\n })\n }\n return rootDb\n}\n\nfunction getDatabases(): ILmdbDatabases {\n if (!databases) {\n const rootDb = getRootDb()\n databases = {\n nodes: rootDb.openDB({\n name: `nodes`,\n // FIXME: sharedStructuresKey breaks tests - probably need some cleanup for it on DELETE_CACHE\n // sharedStructuresKey: Symbol.for(`structures`),\n // @ts-ignore\n cache: true,\n }),\n nodesByType: rootDb.openDB({\n name: `nodesByType`,\n dupSort: true,\n }),\n metadata: rootDb.openDB({\n name: `metadata`,\n useVersions: true,\n }),\n indexes: rootDb.openDB({\n name: `indexes`,\n // TODO: use dupSort when this is ready: https://github.com/DoctorEvidence/lmdb-store/issues/66\n // dupSort: true\n }),\n }\n }\n return databases\n}\n\n/**\n * @deprecated\n */\nfunction getNodes(): Array<IGatsbyNode> {\n // const start = performance.now()\n const result = Array.from<IGatsbyNode>(iterateNodes())\n // const timeTotal = performance.now() - start\n // console.warn(\n // `getNodes() is deprecated, use iterateNodes() instead; ` +\n // `array length: ${result.length}; time(ms): ${timeTotal}`\n // )\n return result ?? []\n}\n\n/**\n * @deprecated\n */\nfunction getNodesByType(type: string): Array<IGatsbyNode> {\n // const start = performance.now()\n const result = Array.from<IGatsbyNode>(iterateNodesByType(type))\n // const timeTotal = performance.now() - start\n // console.warn(\n // `getNodesByType() is deprecated, use iterateNodesByType() instead; ` +\n // `array length: ${result.length}; time(ms): ${timeTotal}`\n // )\n return result ?? []\n}\n\nfunction iterateNodes(): GatsbyIterable<IGatsbyNode> {\n // Additionally fetching items by id to leverage lmdb-store cache\n const nodesDb = getDatabases().nodes\n return new GatsbyIterable(\n nodesDb\n .getKeys({ snapshot: false })\n .map(\n nodeId => (typeof nodeId === `string` ? getNode(nodeId) : undefined)!\n )\n .filter(Boolean)\n )\n}\n\nfunction iterateNodesByType(type: string): GatsbyIterable<IGatsbyNode> {\n const nodesByType = getDatabases().nodesByType\n return new GatsbyIterable(\n nodesByType\n .getValues(type)\n .map(nodeId => getNode(nodeId)!)\n .filter(Boolean)\n )\n}\n\nfunction getNode(id: string): IGatsbyNode | undefined {\n if (!id) return undefined\n const { nodes } = getDatabases()\n return nodes.get(id)\n}\n\nfunction getTypes(): Array<string> {\n return getDatabases().nodesByType.getKeys({}).asArray\n}\n\nfunction countNodes(typeName?: string): number {\n if (!typeName) {\n const stats = getDatabases().nodes.getStats()\n // @ts-ignore\n return Number(stats.entryCount || 0) // FIXME: add -1 when restoring shared structures key\n }\n\n const { nodesByType } = getDatabases()\n return nodesByType.getValuesCount(typeName)\n}\n\nasync function runQuery(args: IRunFilterArg): Promise<IQueryResult> {\n if (process.env.GATSBY_EXPERIMENTAL_LMDB_INDEXES) {\n return await doRunQuery({\n datastore: lmdbDatastore,\n databases: getDatabases(),\n ...args,\n })\n }\n return Promise.resolve(runFastFiltersAndSort(args))\n}\n\nlet lastOperationPromise: Promise<any> = Promise.resolve()\n\nfunction updateDataStore(action: ActionsUnion): void {\n switch (action.type) {\n case `DELETE_CACHE`: {\n const dbs = getDatabases()\n // Force sync commit\n dbs.nodes.transactionSync(() => {\n dbs.nodes.clear()\n dbs.nodesByType.clear()\n dbs.metadata.clear()\n dbs.indexes.clear()\n })\n break\n }\n case `SET_PROGRAM`: {\n // TODO: remove this when we have support for incremental indexes in lmdb\n clearIndexes()\n break\n }\n case `CREATE_NODE`:\n case `ADD_FIELD_TO_NODE`:\n case `ADD_CHILD_NODE_TO_PARENT_NODE`:\n case `DELETE_NODE`: {\n const dbs = getDatabases()\n lastOperationPromise = Promise.all([\n updateNodes(dbs.nodes, action),\n updateNodesByType(dbs.nodesByType, action),\n ])\n }\n }\n}\n\nfunction clearIndexes(): void {\n const dbs = getDatabases()\n dbs.nodes.transactionSync(() => {\n dbs.metadata.clear()\n dbs.indexes.clear()\n })\n}\n\n/**\n * Resolves when all the data is synced\n */\nasync function ready(): Promise<void> {\n await lastOperationPromise\n}\n\nexport function setupLmdbStore({\n dbPath = getDefaultDbPath(),\n}: { dbPath?: string } = {}): IDataStore {\n fullDbPath = dbPath\n\n replaceReducer({\n nodes: (state = new Map(), action) =>\n action.type === `DELETE_CACHE` ? new Map() : state,\n nodesByType: (state = new Map(), action) =>\n action.type === `DELETE_CACHE` ? new Map() : state,\n })\n emitter.on(`*`, action => {\n if (action) {\n updateDataStore(action)\n }\n })\n // TODO: remove this when we have support for incremental indexes in lmdb\n clearIndexes()\n return lmdbDatastore\n}\n"],"file":"lmdb-datastore.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/datastore/lmdb/lmdb-datastore.ts"],"names":["lmdbDatastore","getNode","getTypes","countNodes","iterateNodes","iterateNodesByType","updateDataStore","ready","runQuery","getNodes","getNodesByType","preSyncDeletedNodeIdsCache","Set","getDefaultDbPath","dbFileName","process","env","NODE_ENV","FORCE_TEST_DATABASE_ID","JEST_WORKER_ID","cwd","fullDbPath","rootDb","databases","getRootDb","Error","name","path","compression","getDatabases","nodes","openDB","cache","nodesByType","dupSort","metadata","useVersions","indexes","result","Array","from","type","nodesDb","GatsbyIterable","getKeys","snapshot","map","nodeId","undefined","filter","Boolean","getValues","id","has","get","asArray","typeName","stats","getStats","Math","max","Number","entryCount","size","getValuesCount","args","GATSBY_EXPERIMENTAL_LMDB_INDEXES","datastore","Promise","resolve","lastOperationPromise","action","dbs","transactionSync","clear","clearIndexes","operationPromise","all","delete","payload","add","then","setupLmdbStore","dbPath","state","Map","emitter","on"],"mappings":";;;;;AAAA;;AAGA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AAKA,MAAMA,aAAa,GAAG;AACpBC,EAAAA,OADoB;AAEpBC,EAAAA,QAFoB;AAGpBC,EAAAA,UAHoB;AAIpBC,EAAAA,YAJoB;AAK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n// import { performance } from \"perf_hooks\"\nimport { ActionsUnion, IGatsbyNode } from \"../../redux/types\"\nimport { updateNodes } from \"./updates/nodes\"\nimport { updateNodesByType } from \"./updates/nodes-by-type\"\nimport { IDataStore, ILmdbDatabases, IQueryResult } from \"../types\"\nimport { emitter, replaceReducer } from \"../../redux\"\nimport { GatsbyIterable } from \"../common/iterable\"\nimport { doRunQuery } from \"./query/run-query\"\nimport {\n IRunFilterArg,\n runFastFiltersAndSort,\n} from \"../in-memory/run-fast-filters\"\n\nconst lmdbDatastore = {\n getNode,\n getTypes,\n countNodes,\n iterateNodes,\n iterateNodesByType,\n updateDataStore,\n ready,\n runQuery,\n\n // deprecated:\n getNodes,\n getNodesByType,\n}\n\nconst preSyncDeletedNodeIdsCache = new Set()\n\nfunction getDefaultDbPath(): string {\n const dbFileName =\n process.env.NODE_ENV === `test`\n ? `test-datastore-${\n // FORCE_TEST_DATABASE_ID will be set if this gets executed in worker context\n // when running jest tests. JEST_WORKER_ID will be set when this gets executed directly\n // in test context (jest will use jest-worker internally).\n process.env.FORCE_TEST_DATABASE_ID ?? process.env.JEST_WORKER_ID\n }`\n : `datastore`\n\n return process.cwd() + `/.cache/data/` + dbFileName\n}\n\nlet fullDbPath\nlet rootDb\nlet databases\n\nfunction getRootDb(): RootDatabase {\n if (!rootDb) {\n if (!fullDbPath) {\n throw new Error(`LMDB path is not set!`)\n }\n rootDb = open({\n name: `root`,\n path: fullDbPath,\n compression: true,\n })\n }\n return rootDb\n}\n\nfunction getDatabases(): ILmdbDatabases {\n if (!databases) {\n const rootDb = getRootDb()\n databases = {\n nodes: rootDb.openDB({\n name: `nodes`,\n // FIXME: sharedStructuresKey breaks tests - probably need some cleanup for it on DELETE_CACHE\n // sharedStructuresKey: Symbol.for(`structures`),\n // @ts-ignore\n cache: true,\n }),\n nodesByType: rootDb.openDB({\n name: `nodesByType`,\n dupSort: true,\n }),\n metadata: rootDb.openDB({\n name: `metadata`,\n useVersions: true,\n }),\n indexes: rootDb.openDB({\n name: `indexes`,\n // TODO: use dupSort when this is ready: https://github.com/DoctorEvidence/lmdb-store/issues/66\n // dupSort: true\n }),\n }\n }\n return databases\n}\n\n/**\n * @deprecated\n */\nfunction getNodes(): Array<IGatsbyNode> {\n // const start = performance.now()\n const result = Array.from<IGatsbyNode>(iterateNodes())\n // const timeTotal = performance.now() - start\n // console.warn(\n // `getNodes() is deprecated, use iterateNodes() instead; ` +\n // `array length: ${result.length}; time(ms): ${timeTotal}`\n // )\n return result ?? []\n}\n\n/**\n * @deprecated\n */\nfunction getNodesByType(type: string): Array<IGatsbyNode> {\n // const start = performance.now()\n const result = Array.from<IGatsbyNode>(iterateNodesByType(type))\n // const timeTotal = performance.now() - start\n // console.warn(\n // `getNodesByType() is deprecated, use iterateNodesByType() instead; ` +\n // `array length: ${result.length}; time(ms): ${timeTotal}`\n // )\n return result ?? []\n}\n\nfunction iterateNodes(): GatsbyIterable<IGatsbyNode> {\n // Additionally fetching items by id to leverage lmdb-store cache\n const nodesDb = getDatabases().nodes\n return new GatsbyIterable(\n nodesDb\n .getKeys({ snapshot: false })\n .map(nodeId => (typeof nodeId === `string` ? getNode(nodeId) : undefined))\n .filter(Boolean) as ArrayLikeIterable<IGatsbyNode>\n )\n}\n\nfunction iterateNodesByType(type: string): GatsbyIterable<IGatsbyNode> {\n const nodesByType = getDatabases().nodesByType\n return new GatsbyIterable(\n nodesByType\n .getValues(type)\n .map(nodeId => getNode(nodeId))\n .filter(Boolean) as ArrayLikeIterable<IGatsbyNode>\n )\n}\n\nfunction getNode(id: string): IGatsbyNode | undefined {\n if (!id || preSyncDeletedNodeIdsCache.has(id)) {\n return undefined\n }\n\n const { nodes } = getDatabases()\n return nodes.get(id)\n}\n\nfunction getTypes(): Array<string> {\n return getDatabases().nodesByType.getKeys({}).asArray\n}\n\nfunction countNodes(typeName?: string): number {\n if (!typeName) {\n const stats = getDatabases().nodes.getStats() as { entryCount: number }\n return Math.max(\n Number(stats.entryCount) - preSyncDeletedNodeIdsCache.size,\n 0\n ) // FIXME: add -1 when restoring shared structures key\n }\n\n const { nodesByType } = getDatabases()\n return nodesByType.getValuesCount(typeName)\n}\n\nasync function runQuery(args: IRunFilterArg): Promise<IQueryResult> {\n if (process.env.GATSBY_EXPERIMENTAL_LMDB_INDEXES) {\n return await doRunQuery({\n datastore: lmdbDatastore,\n databases: getDatabases(),\n ...args,\n })\n }\n return Promise.resolve(runFastFiltersAndSort(args))\n}\n\nlet lastOperationPromise: Promise<any> = Promise.resolve()\n\nfunction updateDataStore(action: ActionsUnion): void {\n switch (action.type) {\n case `DELETE_CACHE`: {\n const dbs = getDatabases()\n // Force sync commit\n dbs.nodes.transactionSync(() => {\n dbs.nodes.clear()\n dbs.nodesByType.clear()\n dbs.metadata.clear()\n dbs.indexes.clear()\n })\n break\n }\n case `SET_PROGRAM`: {\n // TODO: remove this when we have support for incremental indexes in lmdb\n clearIndexes()\n break\n }\n case `CREATE_NODE`:\n case `DELETE_NODE`:\n case `ADD_FIELD_TO_NODE`:\n case `ADD_CHILD_NODE_TO_PARENT_NODE`: {\n const dbs = getDatabases()\n const operationPromise = Promise.all([\n updateNodes(dbs.nodes, action),\n updateNodesByType(dbs.nodesByType, action),\n ])\n lastOperationPromise = operationPromise\n\n // if create is used in the same transaction as delete we should remove it from cache\n if (action.type === `CREATE_NODE`) {\n preSyncDeletedNodeIdsCache.delete(action.payload.id)\n }\n\n if (action.type === `DELETE_NODE` && action.payload?.id) {\n preSyncDeletedNodeIdsCache.add(action.payload.id)\n operationPromise.then(() => {\n // only clear if no other operations have been done in the meantime\n if (lastOperationPromise === operationPromise) {\n preSyncDeletedNodeIdsCache.clear()\n }\n })\n }\n }\n }\n}\n\nfunction clearIndexes(): void {\n const dbs = getDatabases()\n dbs.nodes.transactionSync(() => {\n dbs.metadata.clear()\n dbs.indexes.clear()\n })\n}\n\n/**\n * Resolves when all the data is synced\n */\nasync function ready(): Promise<void> {\n await lastOperationPromise\n}\n\nexport function setupLmdbStore({\n dbPath = getDefaultDbPath(),\n}: { dbPath?: string } = {}): IDataStore {\n fullDbPath = dbPath\n\n replaceReducer({\n nodes: (state = new Map(), action) =>\n action.type === `DELETE_CACHE` ? new Map() : state,\n nodesByType: (state = new Map(), action) =>\n action.type === `DELETE_CACHE` ? new Map() : state,\n })\n emitter.on(`*`, action => {\n if (action) {\n updateDataStore(action)\n }\n })\n // TODO: remove this when we have support for incremental indexes in lmdb\n clearIndexes()\n return lmdbDatastore\n}\n"],"file":"lmdb-datastore.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/datastore/lmdb/updates/nodes.ts"],"names":["updateNodes","nodesDb","action","type","put","payload","id","remove"],"mappings":";;;;;AAKO,SAASA,WAAT,CACLC,OADK,EAELC,MAFK,EAGuB;AAC5B,UAAQA,MAAM,CAACC,IAAf;AACE,SAAM,aAAN;AACA,SAAM,mBAAN;AACA,SAAM,+BAAN;AAAsC;AACpC,eAAOF,OAAO,CAACG,GAAR,CAAYF,MAAM,CAACG,OAAP,CAAeC,EAA3B,EAA+BJ,MAAM,CAACG,OAAtC,CAAP;AACD;;AACD,SAAM,aAAN;AAAoB;AAClB,YAAIH,MAAM,CAACG,OAAX,EAAoB;AAClB,iBAAOJ,OAAO,CAACM,MAAR,CAAeL,MAAM,CAACG,OAAP,CAAeC,EAA9B,CAAP;AACD;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/datastore/lmdb/updates/nodes.ts"],"names":["updateNodes","nodesDb","action","type","put","payload","id","remove"],"mappings":";;;;;AAKO,SAASA,WAAT,CACLC,OADK,EAELC,MAFK,EAGuB;AAC5B,UAAQA,MAAM,CAACC,IAAf;AACE,SAAM,aAAN;AACA,SAAM,mBAAN;AACA,SAAM,+BAAN;AAAsC;AACpC,eAAOF,OAAO,CAACG,GAAR,CAAYF,MAAM,CAACG,OAAP,CAAeC,EAA3B,EAA+BJ,MAAM,CAACG,OAAtC,CAAP;AACD;;AACD,SAAM,aAAN;AAAoB;AAClB,YAAIH,MAAM,CAACG,OAAX,EAAoB;AAClB,iBAAOJ,OAAO,CAACM,MAAR,CAAeL,MAAM,CAACG,OAAP,CAAeC,EAA9B,CAAP;AACD;;AAED,eAAO,KAAP;AACD;AAZH;;AAcA,SAAO,KAAP;AACD","sourcesContent":["import { ActionsUnion, IGatsbyNode } from \"../../../redux/types\"\nimport { Database } from \"lmdb-store\"\n\ntype NodeId = string\n\nexport function updateNodes(\n nodesDb: Database<IGatsbyNode, NodeId>,\n action: ActionsUnion\n): Promise<boolean> | boolean {\n switch (action.type) {\n case `CREATE_NODE`:\n case `ADD_FIELD_TO_NODE`:\n case `ADD_CHILD_NODE_TO_PARENT_NODE`: {\n return nodesDb.put(action.payload.id, action.payload)\n }\n case `DELETE_NODE`: {\n if (action.payload) {\n return nodesDb.remove(action.payload.id)\n }\n\n return false\n }\n }\n return false\n}\n"],"file":"nodes.js"}
|
|
@@ -28,7 +28,7 @@ var _dotenv = _interopRequireDefault(require("dotenv"));
|
|
|
28
28
|
|
|
29
29
|
var _chokidar = _interopRequireDefault(require("chokidar"));
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _utils = require("@gatsbyjs/reach-router/lib/utils");
|
|
32
32
|
|
|
33
33
|
var _cookie = _interopRequireDefault(require("cookie"));
|
|
34
34
|
|
|
@@ -40,8 +40,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
40
40
|
|
|
41
41
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
42
42
|
|
|
43
|
-
// We use an ancient version of path-to-regexp as it has breaking changes to express v4
|
|
44
|
-
// see: https://github.com/pillarjs/path-to-regexp/tree/77df63869075cfa5feda1988642080162c584427#compatibility-with-express--4x
|
|
45
43
|
const isProductionEnv = process.env.gatsby_executing_command !== `develop`;
|
|
46
44
|
// During development, we lazily compile functions only when they're requested.
|
|
47
45
|
// Here we keep track of which functions have been requested so are "active"
|
|
@@ -423,23 +421,24 @@ async function onCreateDevServer({
|
|
|
423
421
|
// Check if there's any matchPaths that match.
|
|
424
422
|
// We loop until we find the first match.
|
|
425
423
|
functions.some(f => {
|
|
426
|
-
let exp;
|
|
427
|
-
const keys = [];
|
|
428
|
-
|
|
429
424
|
if (f.matchPath) {
|
|
430
|
-
|
|
431
|
-
}
|
|
425
|
+
const matchResult = (0, _utils.match)(f.matchPath, pathFragment);
|
|
432
426
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
427
|
+
if (matchResult) {
|
|
428
|
+
req.params = matchResult.params;
|
|
429
|
+
|
|
430
|
+
if (req.params[`*`]) {
|
|
431
|
+
// Backwards compatability for v3
|
|
432
|
+
// TODO remove in v5
|
|
433
|
+
req.params[`0`] = req.params[`*`];
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
functionObj = f;
|
|
437
|
+
return true;
|
|
438
|
+
}
|
|
442
439
|
}
|
|
440
|
+
|
|
441
|
+
return false;
|
|
443
442
|
});
|
|
444
443
|
}
|
|
445
444
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/internal-plugins/functions/gatsby-node.ts"],"names":["isProductionEnv","process","env","gatsby_executing_command","activeDevelopmentFunctions","Set","activeEntries","ensureFunctionIsCompiled","functionObj","compiledFunctionsDir","compiledFileExists","fs","stat","absoluteCompiledFilePath","e","time","Date","utimesSync","originalAbsoluteFilePath","Promise","resolve","watcher","chokidar","watch","on","_path","close","createGlobArray","siteDirectoryPath","plugins","globs","push","globPattern","rootPath","path","join","pluginName","forEach","plugin","name","includes","glob","_","union","globAsync","pattern","options","reject","err","files","createWebpackConfig","store","reporter","getState","flattenedPlugins","allFunctions","all","map","knownFunctions","file","originalRelativeFilePath","relative","dir","parse","compiledFunctionName","compiledPath","finalName","functionRoute","relativeCompiledFilePath","matchPath","unionBy","func","dispatch","internalActions","setFunctions","writeFileSync","JSON","stringify","nodeEnv","NODE_ENV","configEnv","GATSBY_ACTIVE_ENV","envFile","parsed","dotenv","readFileSync","encoding","code","error","envObject","Object","keys","reduce","acc","key","varsFromProcessEnv","PUBLIC_DIR","mergedEnvVars","assign","processEnvVars","entries","precompileDevFunctions","GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS","functionsList","parsedFile","compiledNameWithoutExtension","stage","entry","output","filename","libraryTarget","target","optimization","minimize","extensions","cache","type","cacheLocation","mode","module","rules","test","exclude","use","loader","presets","webpack","DefinePlugin","isFirstBuild","onPreBootstrap","parentSpan","activity","activityTimer","start","program","directory","verbose","ensureDir","emptyDir","config","callback","stats","rawMessages","toJson","moduleTrace","warnings","length","errors","compilation","formatted","message","success","run","compiler","ignoreInitial","event","values","log","panic","end","onCreateDevServer","app","any","express","urlencoded","extended","req","next","cookies","headers","cookie","text","json","raw","res","pathFragment","params","functions","find","some","f","exp","exec","matches","match","slice","newParams","index","add","now","pathToFunction","require","fn","fnToExecute","default","headersSent","status","send"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;;;;;AALA;AACA;AAOA,MAAMA,eAAe,GAAGC,OAAO,CAACC,GAAR,CAAYC,wBAAZ,KAA0C,SAAlE;AAmBA;AACA;A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AAGD,OAAO,CAACD,cAAD,CAAlB;;AAEA,cAAMG,WAAW,GAAID,EAAE,IAAIA,EAAE,CAACE,OAAV,IAAsBF,EAA1C;AAEA,cAAM7K,OAAO,CAACC,OAAR,CAAgB6K,WAAW,CAAC3B,GAAD,EAAMQ,GAAN,CAA3B,CAAN;AACD,OAPD,CAOE,OAAOhK,CAAP,EAAU;AACV;AACA,YAAIA,CAAC,CAACwI,OAAF,CAAU9G,QAAV,CAAoB,+BAApB,CAAJ,EAAyD;AACvD1B,UAAAA,CAAC,CAACwI,OAAF,GAAa,GAAE9I,WAAW,CAACU,wBAAyB,8BAApD;AACD;;AACDkC,QAAAA,QAAQ,CAACoC,KAAT,CAAe1E,CAAf,EALU,CAMV;;AACA,YAAI,CAACgK,GAAG,CAACqB,WAAT,EAAsB;AACpBrB,UAAAA,GAAG,CACAsB,MADH,CACU,GADV,EAEGC,IAFH,CAGK,kCAAiC7L,WAAW,CAACU,wBAAyB,iBAAgBJ,CAAC,CAACwI,OAAQ,EAHrG;AAKD;AACF;;AAED,YAAMS,GAAG,GAAG/I,IAAI,CAAC6K,GAAL,EAAZ;AACAzI,MAAAA,QAAQ,CAACyG,GAAT,CACG,2BAA0BrJ,WAAW,CAAC2D,aAAc,QACnD4F,GAAG,GAAG1B,KACP,IAHH;AAKD,KAtCD,MAsCO;AACLkC,MAAAA,IAAI;AACL;AACF,GA/FH;AAiGD","sourcesContent":["import fs from \"fs-extra\"\nimport glob from \"glob\"\nimport path from \"path\"\nimport webpack from \"webpack\"\nimport _ from \"lodash\"\nimport multer from \"multer\"\nimport * as express from \"express\"\nimport { getMatchPath, urlResolve } from \"gatsby-core-utils\"\nimport { CreateDevServerArgs, ParentSpanPluginArgs } from \"gatsby\"\nimport formatWebpackMessages from \"react-dev-utils/formatWebpackMessages\"\nimport dotenv from \"dotenv\"\nimport chokidar from \"chokidar\"\n// We use an ancient version of path-to-regexp as it has breaking changes to express v4\n// see: https://github.com/pillarjs/path-to-regexp/tree/77df63869075cfa5feda1988642080162c584427#compatibility-with-express--4x\nimport pathToRegexp from \"path-to-regexp\"\nimport cookie from \"cookie\"\nimport { reportWebpackWarnings } from \"../../utils/webpack-error-utils\"\nimport { internalActions } from \"../../redux/actions\"\nimport { IGatsbyFunction } from \"../../redux/types\"\n\nconst isProductionEnv = process.env.gatsby_executing_command !== `develop`\n\ninterface IGlobPattern {\n /** The plugin that owns this namespace **/\n pluginName: string\n /** The root path to the functions **/\n rootPath: string\n /** The glob pattern **/\n globPattern: string\n}\n\ninterface IPathToRegexpKey {\n name: string | number\n prefix: string\n suffix: string\n pattern: string\n modifier: string\n}\n\n// During development, we lazily compile functions only when they're requested.\n// Here we keep track of which functions have been requested so are \"active\"\nconst activeDevelopmentFunctions = new Set<IGatsbyFunction>()\nlet activeEntries = {}\n\nasync function ensureFunctionIsCompiled(\n functionObj: IGatsbyFunction,\n compiledFunctionsDir: string\n): Promise<any> {\n // stat the compiled function. If it's there, then return.\n let compiledFileExists = false\n try {\n compiledFileExists = !!(await fs.stat(functionObj.absoluteCompiledFilePath))\n } catch (e) {\n // ignore\n }\n if (compiledFileExists) {\n return\n } else {\n // Otherwise, restart webpack by touching the file and watch for the file to be\n // compiled.\n const time = new Date()\n fs.utimesSync(functionObj.originalAbsoluteFilePath, time, time)\n await new Promise(resolve => {\n const watcher = chokidar\n // Watch the root of the compiled function directory in .cache as chokidar\n // can't watch files in directories that don't yet exist.\n .watch(compiledFunctionsDir)\n .on(`add`, async _path => {\n if (_path === functionObj.absoluteCompiledFilePath) {\n await watcher.close()\n\n resolve(null)\n }\n })\n })\n }\n}\n\n// Create glob type w/ glob, plugin name, root path\nconst createGlobArray = (siteDirectoryPath, plugins): Array<IGlobPattern> => {\n const globs: Array<IGlobPattern> = []\n\n // Add the default site src/api directory.\n globs.push({\n globPattern: `${siteDirectoryPath}/src/api/**/*.{js,ts}`,\n rootPath: path.join(siteDirectoryPath, `src/api`),\n pluginName: `default-site-plugin`,\n })\n\n // Add each plugin\n plugins.forEach(plugin => {\n // Ignore the \"default\" site plugin (aka the src tree) as we're\n // already watching that.\n if (plugin.name === `default-site-plugin`) {\n return\n }\n // Ignore any plugins we include by default. In the very unlikely case\n // we want to ship default functions, we'll special case add them. In the\n // meantime, we'll avoid extra FS IO.\n if (plugin.resolve.includes(`internal-plugin`)) {\n return\n }\n if (plugin.resolve.includes(`gatsby-plugin-typescript`)) {\n return\n }\n if (plugin.resolve.includes(`gatsby-plugin-page-creator`)) {\n return\n }\n\n const glob = {\n globPattern: `${plugin.resolve}/src/api/${plugin.name}/**/*.{js,ts}`,\n rootPath: path.join(plugin.resolve, `src/api`),\n pluginName: plugin.name,\n } as IGlobPattern\n globs.push(glob)\n })\n\n // Only return unique paths\n return _.union(globs)\n}\n\nasync function globAsync(\n pattern: string,\n options: glob.IOptions = {}\n): Promise<Array<string>> {\n return await new Promise((resolve, reject) => {\n glob(pattern, options, (err, files) => {\n if (err) {\n reject(err)\n } else {\n resolve(files)\n }\n })\n })\n}\n\nconst createWebpackConfig = async ({\n siteDirectoryPath,\n store,\n reporter,\n}): Promise<webpack.Configuration> => {\n const compiledFunctionsDir = path.join(\n siteDirectoryPath,\n `.cache`,\n `functions`\n )\n\n const globs = createGlobArray(\n siteDirectoryPath,\n store.getState().flattenedPlugins\n )\n\n // Glob and return object with relative/absolute paths + which plugin\n // they belong to.\n const allFunctions = await Promise.all(\n globs.map(async (glob): Promise<Array<IGatsbyFunction>> => {\n const knownFunctions: Array<IGatsbyFunction> = []\n const files = await globAsync(glob.globPattern)\n files.map(file => {\n const originalAbsoluteFilePath = file\n const originalRelativeFilePath = path.relative(glob.rootPath, file)\n\n const { dir, name } = path.parse(originalRelativeFilePath)\n // Ignore the original extension as all compiled functions now end with js.\n const compiledFunctionName = path.join(dir, name + `.js`)\n const compiledPath = path.join(\n compiledFunctionsDir,\n compiledFunctionName\n )\n const finalName = urlResolve(dir, name === `index` ? `` : name)\n\n knownFunctions.push({\n functionRoute: finalName,\n pluginName: glob.pluginName,\n originalAbsoluteFilePath,\n originalRelativeFilePath,\n relativeCompiledFilePath: compiledFunctionName,\n absoluteCompiledFilePath: compiledPath,\n matchPath: getMatchPath(finalName),\n })\n })\n\n return knownFunctions\n })\n )\n\n // Combine functions by the route name so that functions in the default\n // functions directory can override the plugin's implementations.\n // @ts-ignore - Seems like a TS bug: https://github.com/microsoft/TypeScript/issues/28010#issuecomment-713484584\n const knownFunctions = _.unionBy(...allFunctions, func => func.functionRoute)\n\n store.dispatch(internalActions.setFunctions(knownFunctions))\n\n // Write out manifest for use by `gatsby serve` and plugins\n fs.writeFileSync(\n path.join(compiledFunctionsDir, `manifest.json`),\n JSON.stringify(knownFunctions, null, 4)\n )\n\n // Load environment variables from process.env.GATSBY_* and .env.* files.\n // Logic is shared with webpack.config.js\n\n // node env should be DEVELOPMENT | PRODUCTION as these are commonly used in node land\n const nodeEnv = process.env.NODE_ENV || `development`\n // config env is dependent on the env that it's run, this can be anything from staging-production\n // this allows you to set use different .env environments or conditions in gatsby files\n const configEnv = process.env.GATSBY_ACTIVE_ENV || nodeEnv\n const envFile = path.join(siteDirectoryPath, `./.env.${configEnv}`)\n let parsed = {}\n try {\n parsed = dotenv.parse(fs.readFileSync(envFile, { encoding: `utf8` }))\n } catch (err) {\n if (err.code !== `ENOENT`) {\n reporter.error(\n `There was a problem processing the .env file (${envFile})`,\n err\n )\n }\n }\n\n const envObject = Object.keys(parsed).reduce((acc, key) => {\n acc[key] = JSON.stringify(parsed[key])\n return acc\n }, {} as Record<string, string>)\n\n const varsFromProcessEnv = Object.keys(process.env).reduce((acc, key) => {\n acc[key] = JSON.stringify(process.env[key])\n return acc\n }, {} as Record<string, string>)\n\n // Don't allow overwriting of NODE_ENV, PUBLIC_DIR as to not break gatsby things\n envObject.NODE_ENV = JSON.stringify(nodeEnv)\n envObject.PUBLIC_DIR = JSON.stringify(`${siteDirectoryPath}/public`)\n\n const mergedEnvVars = Object.assign(envObject, varsFromProcessEnv)\n\n const processEnvVars = Object.keys(mergedEnvVars).reduce(\n (acc, key) => {\n acc[`process.env.${key}`] = mergedEnvVars[key]\n return acc\n },\n {\n \"process.env\": `({})`,\n }\n )\n\n const entries = {}\n\n const precompileDevFunctions =\n isProductionEnv ||\n process.env.GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS === `true` ||\n process.env.GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS === `1`\n\n const functionsList = precompileDevFunctions\n ? knownFunctions\n : activeDevelopmentFunctions\n\n functionsList.forEach(functionObj => {\n // Get path without the extension (as it could be ts or js)\n const parsedFile = path.parse(functionObj.originalRelativeFilePath)\n const compiledNameWithoutExtension = path.join(\n parsedFile.dir,\n parsedFile.name\n )\n\n entries[compiledNameWithoutExtension] = functionObj.originalAbsoluteFilePath\n })\n\n activeEntries = entries\n\n const stage = isProductionEnv\n ? `functions-production`\n : `functions-development`\n\n return {\n entry: entries,\n output: {\n path: compiledFunctionsDir,\n filename: `[name].js`,\n libraryTarget: `commonjs2`,\n },\n target: `node`,\n\n // Minification is expensive and not as helpful for serverless functions.\n optimization: {\n minimize: false,\n },\n\n // Resolve files ending with .ts and the default extensions of .js, .json, .wasm\n resolve: {\n extensions: [`.ts`, `...`],\n },\n\n // Have webpack save its cache to the .cache/webpack directory\n cache: {\n type: `filesystem`,\n name: stage,\n cacheLocation: path.join(\n siteDirectoryPath,\n `.cache`,\n `webpack`,\n `stage-` + stage\n ),\n },\n\n mode: isProductionEnv ? `production` : `development`,\n // watch: !isProductionEnv,\n module: {\n rules: [\n {\n test: [/.js$/, /.ts$/],\n exclude: /node_modules/,\n use: {\n loader: `babel-loader`,\n options: {\n presets: [`@babel/typescript`],\n },\n },\n },\n ],\n },\n plugins: [new webpack.DefinePlugin(processEnvVars)],\n }\n}\n\nlet isFirstBuild = true\nexport async function onPreBootstrap({\n reporter,\n store,\n parentSpan,\n}: ParentSpanPluginArgs): Promise<void> {\n const activity = reporter.activityTimer(`Compiling Gatsby Functions`, {\n parentSpan,\n })\n activity.start()\n\n const {\n program: { directory: siteDirectoryPath },\n } = store.getState()\n\n reporter.verbose(`Attaching functions to development server`)\n const compiledFunctionsDir = path.join(\n siteDirectoryPath,\n `.cache`,\n `functions`\n )\n\n await fs.ensureDir(compiledFunctionsDir)\n await fs.emptyDir(compiledFunctionsDir)\n\n try {\n // We do this ungainly thing as we need to make accessible\n // the resolve/reject functions to our shared callback function\n // eslint-disable-next-line\n await new Promise<any>(async (resolve, reject) => {\n const config = await createWebpackConfig({\n siteDirectoryPath,\n store,\n reporter,\n })\n\n function callback(err, stats): any {\n const rawMessages = stats.toJson({ moduleTrace: false })\n if (rawMessages.warnings.length > 0) {\n reportWebpackWarnings(rawMessages.warnings, reporter)\n }\n\n if (err) return reject(err)\n const errors = stats.compilation.errors || []\n\n // If there's errors, reject in production and print to the console\n // in development.\n if (isProductionEnv) {\n if (errors.length > 0) return reject(stats.compilation.errors)\n } else {\n const formatted = formatWebpackMessages({\n errors: rawMessages.errors.map(e => e.message),\n warnings: [],\n })\n reporter.error(formatted.errors)\n }\n\n // Log success in dev\n if (!isProductionEnv) {\n if (isFirstBuild) {\n isFirstBuild = false\n } else {\n reporter.success(`Re-building functions`)\n }\n }\n\n return resolve(null)\n }\n\n if (isProductionEnv) {\n webpack(config).run(callback)\n } else {\n // When in watch mode, you call things differently\n let compiler = webpack(config).watch({}, callback)\n\n const globs = createGlobArray(\n siteDirectoryPath,\n store.getState().flattenedPlugins\n )\n\n // Watch for env files to change and restart the webpack watcher.\n chokidar\n .watch(\n [\n `${siteDirectoryPath}/.env*`,\n ...globs.map(glob => glob.globPattern),\n ],\n { ignoreInitial: true }\n )\n .on(`all`, async (event, path) => {\n // Ignore change events from the API directory for functions we're\n // already watching.\n if (\n event === `change` &&\n Object.values(activeEntries).includes(path) &&\n path.includes(`/src/api/`)\n ) {\n return\n }\n\n reporter.log(\n `Restarting function watcher due to change to \"${path}\"`\n )\n\n // Otherwise, restart the watcher\n compiler.close(async () => {\n const config = await createWebpackConfig({\n siteDirectoryPath,\n store,\n reporter,\n })\n compiler = webpack(config).watch({}, callback)\n })\n })\n }\n })\n } catch (e) {\n activity.panic(`Failed to compile Gatsby Functions.`, e)\n }\n\n activity.end()\n}\n\nexport async function onCreateDevServer({\n reporter,\n app,\n store,\n}: CreateDevServerArgs): Promise<void> {\n reporter.verbose(`Attaching functions to development server`)\n\n const {\n program: { directory: siteDirectoryPath },\n } = store.getState()\n\n const compiledFunctionsDir = path.join(\n siteDirectoryPath,\n `.cache`,\n `functions`\n )\n\n app.use(\n `/api/*`,\n multer().any(),\n express.urlencoded({ extended: true }),\n (req, _, next) => {\n const cookies = req.headers.cookie\n\n if (!cookies) {\n return next()\n }\n\n req.cookies = cookie.parse(cookies)\n\n return next()\n },\n express.text(),\n express.json(),\n express.raw(),\n async (req, res, next) => {\n const { \"0\": pathFragment } = req.params\n\n const { functions }: { functions: Array<IGatsbyFunction> } =\n store.getState()\n\n // Check first for exact matches.\n let functionObj = functions.find(\n ({ functionRoute }) => functionRoute === pathFragment\n )\n\n if (!functionObj) {\n // Check if there's any matchPaths that match.\n // We loop until we find the first match.\n functions.some(f => {\n let exp\n const keys: Array<IPathToRegexpKey> = []\n if (f.matchPath) {\n exp = pathToRegexp(f.matchPath, keys)\n }\n if (exp && exp.exec(pathFragment) !== null) {\n functionObj = f\n const matches = [...pathFragment.match(exp)].slice(1)\n const newParams = {}\n matches.forEach(\n (match, index) => (newParams[keys[index].name] = match)\n )\n req.params = newParams\n\n return true\n } else {\n return false\n }\n })\n }\n\n if (functionObj) {\n activeDevelopmentFunctions.add(functionObj)\n\n await ensureFunctionIsCompiled(functionObj, compiledFunctionsDir)\n\n reporter.verbose(`Running ${functionObj.functionRoute}`)\n const start = Date.now()\n const pathToFunction = functionObj.absoluteCompiledFilePath\n\n try {\n delete require.cache[require.resolve(pathToFunction)]\n const fn = require(pathToFunction)\n\n const fnToExecute = (fn && fn.default) || fn\n\n await Promise.resolve(fnToExecute(req, res))\n } catch (e) {\n // Override the default error with something more specific.\n if (e.message.includes(`fnToExecute is not a function`)) {\n e.message = `${functionObj.originalAbsoluteFilePath} does not export a function.`\n }\n reporter.error(e)\n // Don't send the error if that would cause another error.\n if (!res.headersSent) {\n res\n .status(500)\n .send(\n `Error when executing function \"${functionObj.originalAbsoluteFilePath}\":<br /><br />${e.message}`\n )\n }\n }\n\n const end = Date.now()\n reporter.log(\n `Executed function \"/api/${functionObj.functionRoute}\" in ${\n end - start\n }ms`\n )\n } else {\n next()\n }\n }\n )\n}\n"],"file":"gatsby-node.js"}
|
|
1
|
+
{"version":3,"sources":["../../../src/internal-plugins/functions/gatsby-node.ts"],"names":["isProductionEnv","process","env","gatsby_executing_command","activeDevelopmentFunctions","Set","activeEntries","ensureFunctionIsCompiled","functionObj","compiledFunctionsDir","compiledFileExists","fs","stat","absoluteCompiledFilePath","e","time","Date","utimesSync","originalAbsoluteFilePath","Promise","resolve","watcher","chokidar","watch","on","_path","close","createGlobArray","siteDirectoryPath","plugins","globs","push","globPattern","rootPath","path","join","pluginName","forEach","plugin","name","includes","glob","_","union","globAsync","pattern","options","reject","err","files","createWebpackConfig","store","reporter","getState","flattenedPlugins","allFunctions","all","map","knownFunctions","file","originalRelativeFilePath","relative","dir","parse","compiledFunctionName","compiledPath","finalName","functionRoute","relativeCompiledFilePath","matchPath","unionBy","func","dispatch","internalActions","setFunctions","writeFileSync","JSON","stringify","nodeEnv","NODE_ENV","configEnv","GATSBY_ACTIVE_ENV","envFile","parsed","dotenv","readFileSync","encoding","code","error","envObject","Object","keys","reduce","acc","key","varsFromProcessEnv","PUBLIC_DIR","mergedEnvVars","assign","processEnvVars","entries","precompileDevFunctions","GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS","functionsList","parsedFile","compiledNameWithoutExtension","stage","entry","output","filename","libraryTarget","target","optimization","minimize","extensions","cache","type","cacheLocation","mode","module","rules","test","exclude","use","loader","presets","webpack","DefinePlugin","isFirstBuild","onPreBootstrap","parentSpan","activity","activityTimer","start","program","directory","verbose","ensureDir","emptyDir","config","callback","stats","rawMessages","toJson","moduleTrace","warnings","length","errors","compilation","formatted","message","success","run","compiler","ignoreInitial","event","values","log","panic","end","onCreateDevServer","app","any","express","urlencoded","extended","req","next","cookies","headers","cookie","text","json","raw","res","pathFragment","params","functions","find","some","f","matchResult","add","now","pathToFunction","require","fn","fnToExecute","default","headersSent","status","send"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAGA,MAAMA,eAAe,GAAGC,OAAO,CAACC,GAAR,CAAYC,wBAAZ,KAA0C,SAAlE;AAWA;AACA;AACA,MAAMC,0BAA0B,GAAG,IAAIC,GAAJ,EAAnC;AACA,IAAIC,aAAa,GAAG,EAApB;;AAEA,eAAeC,wBAAf,CACEC,WADF,EAEEC,oBAFF,EAGgB;AACd;AACA,MAAIC,kBAAkB,GAAG,KAAzB;;AACA,MAAI;AACFA,IAAAA,kBAAkB,GAAG,CAAC,EAAE,MAAMC,iBAAGC,IAAH,CAAQJ,WAAW,CAACK,wBAApB,CAAR,CAAtB;AACD,GAFD,CAEE,OAAOC,CAAP,EAAU,CACV;AACD;;AACD,MAAIJ,kBAAJ,EAAwB;AACtB;AACD,GAFD,MAEO;AACL;AACA;AACA,UAAMK,IAAI,GAAG,IAAIC,IAAJ,EAAb;;AACAL,qBAAGM,UAAH,CAAcT,WAAW,CAACU,wBAA1B,EAAoDH,IAApD,EAA0DA,IAA1D;;AACA,UAAM,IAAII,OAAJ,CAAYC,OAAO,IAAI;AAC3B,YAAMC,OAAO,GAAGC,kBACd;AACA;AAFc,OAGbC,KAHa,CAGPd,oBAHO,EAIbe,EAJa,CAIT,KAJS,EAIH,MAAMC,KAAN,IAAe;AACxB,YAAIA,KAAK,KAAKjB,WAAW,CAACK,wBAA1B,EAAoD;AAClD,gBAAMQ,OAAO,CAACK,KAAR,EAAN;AAEAN,UAAAA,OAAO,CAAC,IAAD,CAAP;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AAMC,cAAc,GAAGhL,WAAW,CAACK,wBAAnC;;AAEA,UAAI;AACF,eAAO4K,OAAO,CAACtE,KAAR,CAAcsE,OAAO,CAACrK,OAAR,CAAgBoK,cAAhB,CAAd,CAAP;;AACA,cAAME,EAAE,GAAGD,OAAO,CAACD,cAAD,CAAlB;;AAEA,cAAMG,WAAW,GAAID,EAAE,IAAIA,EAAE,CAACE,OAAV,IAAsBF,EAA1C;AAEA,cAAMvK,OAAO,CAACC,OAAR,CAAgBuK,WAAW,CAACrB,GAAD,EAAMQ,GAAN,CAA3B,CAAN;AACD,OAPD,CAOE,OAAOhK,CAAP,EAAU;AACV;AACA,YAAIA,CAAC,CAACwI,OAAF,CAAU9G,QAAV,CAAoB,+BAApB,CAAJ,EAAyD;AACvD1B,UAAAA,CAAC,CAACwI,OAAF,GAAa,GAAE9I,WAAW,CAACU,wBAAyB,8BAApD;AACD;;AACDkC,QAAAA,QAAQ,CAACoC,KAAT,CAAe1E,CAAf,EALU,CAMV;;AACA,YAAI,CAACgK,GAAG,CAACe,WAAT,EAAsB;AACpBf,UAAAA,GAAG,CACAgB,MADH,CACU,GADV,EAEGC,IAFH,CAGK,kCAAiCvL,WAAW,CAACU,wBAAyB,iBAAgBJ,CAAC,CAACwI,OAAQ,EAHrG;AAKD;AACF;;AAED,YAAMS,GAAG,GAAG/I,IAAI,CAACuK,GAAL,EAAZ;AACAnI,MAAAA,QAAQ,CAACyG,GAAT,CACG,2BAA0BrJ,WAAW,CAAC2D,aAAc,QACnD4F,GAAG,GAAG1B,KACP,IAHH;AAKD,KAtCD,MAsCO;AACLkC,MAAAA,IAAI;AACL;AACF,GA7FH;AA+FD","sourcesContent":["import fs from \"fs-extra\"\nimport glob from \"glob\"\nimport path from \"path\"\nimport webpack from \"webpack\"\nimport _ from \"lodash\"\nimport multer from \"multer\"\nimport * as express from \"express\"\nimport { getMatchPath, urlResolve } from \"gatsby-core-utils\"\nimport { CreateDevServerArgs, ParentSpanPluginArgs } from \"gatsby\"\nimport formatWebpackMessages from \"react-dev-utils/formatWebpackMessages\"\nimport dotenv from \"dotenv\"\nimport chokidar from \"chokidar\"\nimport { match } from \"@gatsbyjs/reach-router/lib/utils\"\nimport cookie from \"cookie\"\nimport { reportWebpackWarnings } from \"../../utils/webpack-error-utils\"\nimport { internalActions } from \"../../redux/actions\"\nimport { IGatsbyFunction } from \"../../redux/types\"\n\nconst isProductionEnv = process.env.gatsby_executing_command !== `develop`\n\ninterface IGlobPattern {\n /** The plugin that owns this namespace **/\n pluginName: string\n /** The root path to the functions **/\n rootPath: string\n /** The glob pattern **/\n globPattern: string\n}\n\n// During development, we lazily compile functions only when they're requested.\n// Here we keep track of which functions have been requested so are \"active\"\nconst activeDevelopmentFunctions = new Set<IGatsbyFunction>()\nlet activeEntries = {}\n\nasync function ensureFunctionIsCompiled(\n functionObj: IGatsbyFunction,\n compiledFunctionsDir: string\n): Promise<any> {\n // stat the compiled function. If it's there, then return.\n let compiledFileExists = false\n try {\n compiledFileExists = !!(await fs.stat(functionObj.absoluteCompiledFilePath))\n } catch (e) {\n // ignore\n }\n if (compiledFileExists) {\n return\n } else {\n // Otherwise, restart webpack by touching the file and watch for the file to be\n // compiled.\n const time = new Date()\n fs.utimesSync(functionObj.originalAbsoluteFilePath, time, time)\n await new Promise(resolve => {\n const watcher = chokidar\n // Watch the root of the compiled function directory in .cache as chokidar\n // can't watch files in directories that don't yet exist.\n .watch(compiledFunctionsDir)\n .on(`add`, async _path => {\n if (_path === functionObj.absoluteCompiledFilePath) {\n await watcher.close()\n\n resolve(null)\n }\n })\n })\n }\n}\n\n// Create glob type w/ glob, plugin name, root path\nconst createGlobArray = (siteDirectoryPath, plugins): Array<IGlobPattern> => {\n const globs: Array<IGlobPattern> = []\n\n // Add the default site src/api directory.\n globs.push({\n globPattern: `${siteDirectoryPath}/src/api/**/*.{js,ts}`,\n rootPath: path.join(siteDirectoryPath, `src/api`),\n pluginName: `default-site-plugin`,\n })\n\n // Add each plugin\n plugins.forEach(plugin => {\n // Ignore the \"default\" site plugin (aka the src tree) as we're\n // already watching that.\n if (plugin.name === `default-site-plugin`) {\n return\n }\n // Ignore any plugins we include by default. In the very unlikely case\n // we want to ship default functions, we'll special case add them. In the\n // meantime, we'll avoid extra FS IO.\n if (plugin.resolve.includes(`internal-plugin`)) {\n return\n }\n if (plugin.resolve.includes(`gatsby-plugin-typescript`)) {\n return\n }\n if (plugin.resolve.includes(`gatsby-plugin-page-creator`)) {\n return\n }\n\n const glob = {\n globPattern: `${plugin.resolve}/src/api/${plugin.name}/**/*.{js,ts}`,\n rootPath: path.join(plugin.resolve, `src/api`),\n pluginName: plugin.name,\n } as IGlobPattern\n globs.push(glob)\n })\n\n // Only return unique paths\n return _.union(globs)\n}\n\nasync function globAsync(\n pattern: string,\n options: glob.IOptions = {}\n): Promise<Array<string>> {\n return await new Promise((resolve, reject) => {\n glob(pattern, options, (err, files) => {\n if (err) {\n reject(err)\n } else {\n resolve(files)\n }\n })\n })\n}\n\nconst createWebpackConfig = async ({\n siteDirectoryPath,\n store,\n reporter,\n}): Promise<webpack.Configuration> => {\n const compiledFunctionsDir = path.join(\n siteDirectoryPath,\n `.cache`,\n `functions`\n )\n\n const globs = createGlobArray(\n siteDirectoryPath,\n store.getState().flattenedPlugins\n )\n\n // Glob and return object with relative/absolute paths + which plugin\n // they belong to.\n const allFunctions = await Promise.all(\n globs.map(async (glob): Promise<Array<IGatsbyFunction>> => {\n const knownFunctions: Array<IGatsbyFunction> = []\n const files = await globAsync(glob.globPattern)\n files.map(file => {\n const originalAbsoluteFilePath = file\n const originalRelativeFilePath = path.relative(glob.rootPath, file)\n\n const { dir, name } = path.parse(originalRelativeFilePath)\n // Ignore the original extension as all compiled functions now end with js.\n const compiledFunctionName = path.join(dir, name + `.js`)\n const compiledPath = path.join(\n compiledFunctionsDir,\n compiledFunctionName\n )\n const finalName = urlResolve(dir, name === `index` ? `` : name)\n\n knownFunctions.push({\n functionRoute: finalName,\n pluginName: glob.pluginName,\n originalAbsoluteFilePath,\n originalRelativeFilePath,\n relativeCompiledFilePath: compiledFunctionName,\n absoluteCompiledFilePath: compiledPath,\n matchPath: getMatchPath(finalName),\n })\n })\n\n return knownFunctions\n })\n )\n\n // Combine functions by the route name so that functions in the default\n // functions directory can override the plugin's implementations.\n // @ts-ignore - Seems like a TS bug: https://github.com/microsoft/TypeScript/issues/28010#issuecomment-713484584\n const knownFunctions = _.unionBy(...allFunctions, func => func.functionRoute)\n\n store.dispatch(internalActions.setFunctions(knownFunctions))\n\n // Write out manifest for use by `gatsby serve` and plugins\n fs.writeFileSync(\n path.join(compiledFunctionsDir, `manifest.json`),\n JSON.stringify(knownFunctions, null, 4)\n )\n\n // Load environment variables from process.env.GATSBY_* and .env.* files.\n // Logic is shared with webpack.config.js\n\n // node env should be DEVELOPMENT | PRODUCTION as these are commonly used in node land\n const nodeEnv = process.env.NODE_ENV || `development`\n // config env is dependent on the env that it's run, this can be anything from staging-production\n // this allows you to set use different .env environments or conditions in gatsby files\n const configEnv = process.env.GATSBY_ACTIVE_ENV || nodeEnv\n const envFile = path.join(siteDirectoryPath, `./.env.${configEnv}`)\n let parsed = {}\n try {\n parsed = dotenv.parse(fs.readFileSync(envFile, { encoding: `utf8` }))\n } catch (err) {\n if (err.code !== `ENOENT`) {\n reporter.error(\n `There was a problem processing the .env file (${envFile})`,\n err\n )\n }\n }\n\n const envObject = Object.keys(parsed).reduce((acc, key) => {\n acc[key] = JSON.stringify(parsed[key])\n return acc\n }, {} as Record<string, string>)\n\n const varsFromProcessEnv = Object.keys(process.env).reduce((acc, key) => {\n acc[key] = JSON.stringify(process.env[key])\n return acc\n }, {} as Record<string, string>)\n\n // Don't allow overwriting of NODE_ENV, PUBLIC_DIR as to not break gatsby things\n envObject.NODE_ENV = JSON.stringify(nodeEnv)\n envObject.PUBLIC_DIR = JSON.stringify(`${siteDirectoryPath}/public`)\n\n const mergedEnvVars = Object.assign(envObject, varsFromProcessEnv)\n\n const processEnvVars = Object.keys(mergedEnvVars).reduce(\n (acc, key) => {\n acc[`process.env.${key}`] = mergedEnvVars[key]\n return acc\n },\n {\n \"process.env\": `({})`,\n }\n )\n\n const entries = {}\n\n const precompileDevFunctions =\n isProductionEnv ||\n process.env.GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS === `true` ||\n process.env.GATSBY_PRECOMPILE_DEVELOP_FUNCTIONS === `1`\n\n const functionsList = precompileDevFunctions\n ? knownFunctions\n : activeDevelopmentFunctions\n\n functionsList.forEach(functionObj => {\n // Get path without the extension (as it could be ts or js)\n const parsedFile = path.parse(functionObj.originalRelativeFilePath)\n const compiledNameWithoutExtension = path.join(\n parsedFile.dir,\n parsedFile.name\n )\n\n entries[compiledNameWithoutExtension] = functionObj.originalAbsoluteFilePath\n })\n\n activeEntries = entries\n\n const stage = isProductionEnv\n ? `functions-production`\n : `functions-development`\n\n return {\n entry: entries,\n output: {\n path: compiledFunctionsDir,\n filename: `[name].js`,\n libraryTarget: `commonjs2`,\n },\n target: `node`,\n\n // Minification is expensive and not as helpful for serverless functions.\n optimization: {\n minimize: false,\n },\n\n // Resolve files ending with .ts and the default extensions of .js, .json, .wasm\n resolve: {\n extensions: [`.ts`, `...`],\n },\n\n // Have webpack save its cache to the .cache/webpack directory\n cache: {\n type: `filesystem`,\n name: stage,\n cacheLocation: path.join(\n siteDirectoryPath,\n `.cache`,\n `webpack`,\n `stage-` + stage\n ),\n },\n\n mode: isProductionEnv ? `production` : `development`,\n // watch: !isProductionEnv,\n module: {\n rules: [\n {\n test: [/.js$/, /.ts$/],\n exclude: /node_modules/,\n use: {\n loader: `babel-loader`,\n options: {\n presets: [`@babel/typescript`],\n },\n },\n },\n ],\n },\n plugins: [new webpack.DefinePlugin(processEnvVars)],\n }\n}\n\nlet isFirstBuild = true\nexport async function onPreBootstrap({\n reporter,\n store,\n parentSpan,\n}: ParentSpanPluginArgs): Promise<void> {\n const activity = reporter.activityTimer(`Compiling Gatsby Functions`, {\n parentSpan,\n })\n activity.start()\n\n const {\n program: { directory: siteDirectoryPath },\n } = store.getState()\n\n reporter.verbose(`Attaching functions to development server`)\n const compiledFunctionsDir = path.join(\n siteDirectoryPath,\n `.cache`,\n `functions`\n )\n\n await fs.ensureDir(compiledFunctionsDir)\n await fs.emptyDir(compiledFunctionsDir)\n\n try {\n // We do this ungainly thing as we need to make accessible\n // the resolve/reject functions to our shared callback function\n // eslint-disable-next-line\n await new Promise<any>(async (resolve, reject) => {\n const config = await createWebpackConfig({\n siteDirectoryPath,\n store,\n reporter,\n })\n\n function callback(err, stats): any {\n const rawMessages = stats.toJson({ moduleTrace: false })\n if (rawMessages.warnings.length > 0) {\n reportWebpackWarnings(rawMessages.warnings, reporter)\n }\n\n if (err) return reject(err)\n const errors = stats.compilation.errors || []\n\n // If there's errors, reject in production and print to the console\n // in development.\n if (isProductionEnv) {\n if (errors.length > 0) return reject(stats.compilation.errors)\n } else {\n const formatted = formatWebpackMessages({\n errors: rawMessages.errors.map(e => e.message),\n warnings: [],\n })\n reporter.error(formatted.errors)\n }\n\n // Log success in dev\n if (!isProductionEnv) {\n if (isFirstBuild) {\n isFirstBuild = false\n } else {\n reporter.success(`Re-building functions`)\n }\n }\n\n return resolve(null)\n }\n\n if (isProductionEnv) {\n webpack(config).run(callback)\n } else {\n // When in watch mode, you call things differently\n let compiler = webpack(config).watch({}, callback)\n\n const globs = createGlobArray(\n siteDirectoryPath,\n store.getState().flattenedPlugins\n )\n\n // Watch for env files to change and restart the webpack watcher.\n chokidar\n .watch(\n [\n `${siteDirectoryPath}/.env*`,\n ...globs.map(glob => glob.globPattern),\n ],\n { ignoreInitial: true }\n )\n .on(`all`, async (event, path) => {\n // Ignore change events from the API directory for functions we're\n // already watching.\n if (\n event === `change` &&\n Object.values(activeEntries).includes(path) &&\n path.includes(`/src/api/`)\n ) {\n return\n }\n\n reporter.log(\n `Restarting function watcher due to change to \"${path}\"`\n )\n\n // Otherwise, restart the watcher\n compiler.close(async () => {\n const config = await createWebpackConfig({\n siteDirectoryPath,\n store,\n reporter,\n })\n compiler = webpack(config).watch({}, callback)\n })\n })\n }\n })\n } catch (e) {\n activity.panic(`Failed to compile Gatsby Functions.`, e)\n }\n\n activity.end()\n}\n\nexport async function onCreateDevServer({\n reporter,\n app,\n store,\n}: CreateDevServerArgs): Promise<void> {\n reporter.verbose(`Attaching functions to development server`)\n\n const {\n program: { directory: siteDirectoryPath },\n } = store.getState()\n\n const compiledFunctionsDir = path.join(\n siteDirectoryPath,\n `.cache`,\n `functions`\n )\n\n app.use(\n `/api/*`,\n multer().any(),\n express.urlencoded({ extended: true }),\n (req, _, next) => {\n const cookies = req.headers.cookie\n\n if (!cookies) {\n return next()\n }\n\n req.cookies = cookie.parse(cookies)\n\n return next()\n },\n express.text(),\n express.json(),\n express.raw(),\n async (req, res, next) => {\n const { \"0\": pathFragment } = req.params\n\n const { functions }: { functions: Array<IGatsbyFunction> } =\n store.getState()\n\n // Check first for exact matches.\n let functionObj = functions.find(\n ({ functionRoute }) => functionRoute === pathFragment\n )\n\n if (!functionObj) {\n // Check if there's any matchPaths that match.\n // We loop until we find the first match.\n functions.some(f => {\n if (f.matchPath) {\n const matchResult = match(f.matchPath, pathFragment)\n if (matchResult) {\n req.params = matchResult.params\n if (req.params[`*`]) {\n // Backwards compatability for v3\n // TODO remove in v5\n req.params[`0`] = req.params[`*`]\n }\n functionObj = f\n\n return true\n }\n }\n\n return false\n })\n }\n\n if (functionObj) {\n activeDevelopmentFunctions.add(functionObj)\n\n await ensureFunctionIsCompiled(functionObj, compiledFunctionsDir)\n\n reporter.verbose(`Running ${functionObj.functionRoute}`)\n const start = Date.now()\n const pathToFunction = functionObj.absoluteCompiledFilePath\n\n try {\n delete require.cache[require.resolve(pathToFunction)]\n const fn = require(pathToFunction)\n\n const fnToExecute = (fn && fn.default) || fn\n\n await Promise.resolve(fnToExecute(req, res))\n } catch (e) {\n // Override the default error with something more specific.\n if (e.message.includes(`fnToExecute is not a function`)) {\n e.message = `${functionObj.originalAbsoluteFilePath} does not export a function.`\n }\n reporter.error(e)\n // Don't send the error if that would cause another error.\n if (!res.headersSent) {\n res\n .status(500)\n .send(\n `Error when executing function \"${functionObj.originalAbsoluteFilePath}\":<br /><br />${e.message}`\n )\n }\n }\n\n const end = Date.now()\n reporter.log(\n `Executed function \"/api/${functionObj.functionRoute}\" in ${\n end - start\n }ms`\n )\n } else {\n next()\n }\n }\n )\n}\n"],"file":"gatsby-node.js"}
|
|
@@ -61,10 +61,9 @@ async function findPageOwnedByNodeId({
|
|
|
61
61
|
// node id to page query tracking
|
|
62
62
|
|
|
63
63
|
let pagePath = byNode === null || byNode === void 0 ? void 0 : (_byNode$get = byNode.get(nodeId)) === null || _byNode$get === void 0 ? void 0 : (_byNode$get$values = _byNode$get.values()) === null || _byNode$get$values === void 0 ? void 0 : (_byNode$get$values$ne = _byNode$get$values.next()) === null || _byNode$get$values$ne === void 0 ? void 0 : _byNode$get$values$ne.value;
|
|
64
|
-
let foundPageBy = pagePath ? `queryTracking` : `none`;
|
|
65
|
-
// we need to try to be more specific
|
|
64
|
+
let foundPageBy = pagePath ? `queryTracking` : `none`;
|
|
66
65
|
|
|
67
|
-
if (pagePathSetOrMap
|
|
66
|
+
if (pagePathSetOrMap) {
|
|
68
67
|
let ownerPagePath;
|
|
69
68
|
let foundOwnerNodeId = false; // for each page this nodeId is queried in
|
|
70
69
|
|
|
@@ -237,10 +236,30 @@ async function processNodeManifest(inputManifest) {
|
|
|
237
236
|
pageDataDigest
|
|
238
237
|
};
|
|
239
238
|
|
|
240
|
-
const gatsbySiteDirectory = _redux.store.getState().program.directory;
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
239
|
+
const gatsbySiteDirectory = _redux.store.getState().program.directory;
|
|
240
|
+
|
|
241
|
+
let fileNameBase = inputManifest.manifestId;
|
|
242
|
+
/**
|
|
243
|
+
* Windows has a handful of special/reserved characters that are not valid in a file path
|
|
244
|
+
* @reference https://superuser.com/questions/358855/what-characters-are-safe-in-cross-platform-file-names-for-linux-windows-and-os
|
|
245
|
+
*
|
|
246
|
+
* The two exceptions to the list linked above are
|
|
247
|
+
* - the colon that is part of the hard disk partition name at the beginning of a file path (i.e. C:)
|
|
248
|
+
* - backslashes. We don't want to replace backslashes because those are used to delineate what the actual file path is
|
|
249
|
+
*
|
|
250
|
+
* During local development, node manifests can be written to disk but are generally unused as they are only used
|
|
251
|
+
* for Content Sync which runs in Gatsby Cloud. Gatsby cloud is a Linux environment in which these special chars are valid in
|
|
252
|
+
* filepaths. To avoid errors on Windows, we replace all instances of the special chars in the filepath (with the exception of the
|
|
253
|
+
* hard disk partition name) with "-" to ensure that local Windows development setups do not break when attempting
|
|
254
|
+
* to write one of these manifests to disk.
|
|
255
|
+
*/
|
|
256
|
+
|
|
257
|
+
if (process.platform === `win32`) {
|
|
258
|
+
fileNameBase = fileNameBase.replace(/:|\/|\*|\?|"|<|>|\||\\/g, `-`);
|
|
259
|
+
} // write out the manifest file
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
const manifestFilePath = _path.default.join(gatsbySiteDirectory, `public`, `__node-manifests`, inputManifest.pluginName, `${fileNameBase}.json`);
|
|
244
263
|
|
|
245
264
|
const manifestFileDir = _path.default.dirname(manifestFilePath);
|
|
246
265
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/node-manifest.ts"],"names":["findPageOwnedByNodeId","nodeId","state","store","getState","pages","nodes","byNode","queries","usingPagesMap","process","env","NODE_ENV","pagePathSetOrMap","get","pagePath","values","next","value","foundPageBy","size","ownerPagePath","foundOwnerNodeId","pathOrPageObject","path","fullPage","ownerNodeId","foundPageIdInContext","context","id","pageCreatedByPluginName","pluginCreatorId","name","pageCreatedByFilesystemPlugin","page","foundPageByToLogIds","none","queryTracking","warnAboutNodeManifestMappingProblems","inputManifest","logId","reporter","error","Error","getPageDataDigestForPagePath","directory","publicDirectory","join","program","pageData","pageDataDigest","e","warn","processNodeManifest","node","fullNode","pluginName","nodeManifestPage","finalManifest","gatsbySiteDirectory","manifestFilePath","manifestId","manifestFileDir","dirname","fs","ensureDir","writeJSON","processNodeManifests","nodeManifests","totalManifests","length","processedManifests","Promise","all","map","manifest","totalProcessedManifests","totalFailedManifests","forEach","pluralize","info","dispatch","internalActions","deleteNodeManifests"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,qBAAf,CAAqC;AAAEC,EAAAA;AAAF,CAArC,EAGG;AAAA;;AACD,QAAMC,KAAK,GAAGC,aAAMC,QAAN,EAAd;;AACA,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAmBJ,KAAzB;AACA,QAAM;AAAEK,IAAAA;AAAF,MAAaL,KAAK,CAACM,OAAzB,CAHC,CAKD;AACA;AACA;AACA;AACA;;AACA,QAAMC,aAAsB,GAAI,aAAD,KAAkBC,OAAO,CAACC,GAAR,CAAYC,QAA7D;AAEA,QAAMC,gBAAgB,GAAGJ,aAAa,GAClC;AACAJ,EAAAA,KAFkC,GAGlC;AACAE,EAAAA,MAJkC,aAIlCA,MAJkC,uBAIlCA,MAAM,CAAEO,GAAR,CAAYb,MAAZ,CAJJ,CAZC,CAkBD;AACA;;AACA,MAAIc,QAAQ,GAAGR,MAAH,aAAGA,MAAH,sCAAGA,MAAM,CAAEO,GAAR,CAAYb,MAAZ,CAAH,sEAAG,YAAqBe,MAArB,EAAH,gFAAG,mBAA+BC,IAA/B,EAAH,0DAAG,sBAAuCC,KAAtD;AAEA,MAAIC,WAAwB,GAAGJ,QAAQ,GAAI,eAAJ,GAAsB,MAA7D,CAtBC,CAwBD;AACA;;AACA,MAAIF,gBAAgB,IAAIA,gBAAgB,CAACO,IAAjB,GAAwB,CAAhD,EAAmD;AACjD,QAAIC,aAAJ;AACA,QAAIC,gBAAgB,GAAG,KAAvB,CAFiD,CAIjD;;AACA,SAAK,MAAMC,gBAAX,IAA+BV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AgBC,mBAAhB,EAAf;AACD","sourcesContent":["import type { ErrorId } from \"gatsby-cli/lib/structured-errors/error-map\"\nimport { getNode } from \"./../datastore\"\nimport { IGatsbyPage, INodeManifest } from \"./../redux/types\"\nimport reporter from \"gatsby-cli/lib/reporter\"\nimport { store } from \"../redux/\"\nimport { internalActions } from \"../redux/actions\"\nimport path from \"path\"\nimport fs from \"fs-extra\"\nimport { readPageData } from \"./page-data\"\nimport { createContentDigest } from \"gatsby-core-utils\"\n\ninterface INodeManifestPage {\n path?: string\n}\n\n/**\n * This it the output after processing calls to the public unstable_createNodeManifest action\n */\ninterface INodeManifestOut {\n page: INodeManifestPage\n node: {\n id: string\n }\n foundPageBy: FoundPageBy\n pageDataDigest: string | null\n}\n\ntype FoundPageBy =\n | `ownerNodeId`\n | `filesystem-route-api`\n // for these three we warn to use ownerNodeId instead\n | `context.id`\n | `queryTracking`\n | `none`\n\n/**\n * Finds a final built page by nodeId\n *\n * Note that this function wont work properly in `gatsby develop`\n * since develop no longer runs all page queries when creating pages.\n * We use the node id to query mapping to find the right page but\n * this mapping only exists once you've visited a page in your browser.\n * When this fn is being used for routing to previews the user wont necessarily have\n * visited the page in the browser yet.\n */\nasync function findPageOwnedByNodeId({ nodeId }: { nodeId: string }): Promise<{\n page: INodeManifestPage\n foundPageBy: FoundPageBy\n}> {\n const state = store.getState()\n const { pages, nodes } = state\n const { byNode } = state.queries\n\n // in development queries are run on demand so we wont have an accurate nodeId->pages map until those pages are visited in the browser. We want this mapping before the page is visited in the browser so we can route to the right page in the browser.\n // So in development we can just use the Map of all pages (pagePath -> pageNode)\n // but for builds (preview inc builds or regular builds) we will have a full map\n // of all nodeId's to pages they're queried on and we can use that instead since it\n // will be a much smaller list of pages, resulting in better performance for large sites\n const usingPagesMap: boolean = `development` === process.env.NODE_ENV\n\n const pagePathSetOrMap = usingPagesMap\n ? // this is a Map of page path to page node\n pages\n : // this is a Set of page paths\n byNode?.get(nodeId)\n\n // the default page path is the first page found in\n // node id to page query tracking\n let pagePath = byNode?.get(nodeId)?.values()?.next()?.value\n\n let foundPageBy: FoundPageBy = pagePath ? `queryTracking` : `none`\n\n // but if we have more than one page where this node shows up\n // we need to try to be more specific\n if (pagePathSetOrMap && pagePathSetOrMap.size > 1) {\n let ownerPagePath: string | undefined\n let foundOwnerNodeId = false\n\n // for each page this nodeId is queried in\n for (const pathOrPageObject of pagePathSetOrMap.values()) {\n // if we haven't found a page with this nodeId\n // set as page.ownerNodeId then run this logic.\n // this condition is on foundOwnerNodeId instead of ownerPagePath\n // in case we find a page with the nodeId in page.context.id\n // and then later in the loop there's a page with this nodeId\n // set on page.ownerNodeId.\n // We always want to prefer ownerPagePath over context.id\n if (foundOwnerNodeId) {\n break\n }\n\n const path = (\n usingPagesMap\n ? // in development we're using a Map, so the value here is a page object\n (pathOrPageObject as IGatsbyPage).path\n : // in builds we're using a Set so the page path is the value\n pathOrPageObject\n ) as string\n\n const fullPage: IGatsbyPage | undefined = pages.get(path)\n\n foundOwnerNodeId = fullPage?.ownerNodeId === nodeId\n\n const foundPageIdInContext = fullPage?.context.id === nodeId\n\n if (foundOwnerNodeId) {\n foundPageBy = `ownerNodeId`\n } else if (foundPageIdInContext && fullPage) {\n const pageCreatedByPluginName = nodes.get(\n fullPage.pluginCreatorId\n )?.name\n\n const pageCreatedByFilesystemPlugin =\n pageCreatedByPluginName === `gatsby-plugin-page-creator`\n\n foundPageBy = pageCreatedByFilesystemPlugin\n ? `filesystem-route-api`\n : `context.id`\n }\n\n if (\n fullPage &&\n // first check for the ownerNodeId on the page. this is\n // the defacto owner. Can't get more specific than this\n (foundOwnerNodeId ||\n // if there's no specified owner look to see if\n // pageContext has an `id` variable which matches our\n // nodeId. Using an \"id\" as a variable in queries is common\n // and if we don't have an owner this is a better guess\n // of an owner than grabbing the first page query we find\n // that's mapped to this node id.\n // this also makes this work with the filesystem Route API without\n // changing that API.\n foundPageIdInContext)\n ) {\n // save this path to use in our manifest!\n ownerPagePath = fullPage.path\n }\n }\n\n if (ownerPagePath) {\n pagePath = ownerPagePath\n }\n }\n\n return {\n page: {\n path: pagePath || null,\n },\n foundPageBy,\n }\n}\n\n// these id's correspond to error id's in\n// packages/gatsby-cli/src/structured-errors/error-map.ts\nexport const foundPageByToLogIds = {\n none: `11801`,\n [`context.id`]: `11802`,\n queryTracking: `11803`,\n [`filesystem-route-api`]: `success`,\n ownerNodeId: `success`,\n}\n\n/**\n * Takes in some info about a node manifest and the page we did or didn't find for it, then warns and returns the warning string\n */\nexport function warnAboutNodeManifestMappingProblems({\n inputManifest,\n pagePath,\n foundPageBy,\n}: {\n inputManifest: INodeManifest\n pagePath?: string\n foundPageBy: FoundPageBy\n}): { logId: string } {\n let logId: ErrorId | `success`\n\n switch (foundPageBy) {\n case `none`:\n case `context.id`:\n case `queryTracking`: {\n logId = foundPageByToLogIds[foundPageBy]\n reporter.error({\n id: logId,\n context: {\n inputManifest,\n pagePath,\n },\n })\n break\n }\n\n case `filesystem-route-api`:\n case `ownerNodeId`:\n logId = `success`\n break\n\n default: {\n throw Error(`Node Manifest mapping is in an impossible state`)\n }\n }\n\n return {\n logId,\n }\n}\n\n/**\n * Retrieves the content digest of a page-data.json file for use in creating node manifest files.\n */\nexport async function getPageDataDigestForPagePath(\n pagePath?: string,\n directory?: string\n): Promise<string | null> {\n if (\n // if no page was created for the node we're creating a manifest for, there wont be a page path.\n !pagePath ||\n // we only add page data digests to node manifests in production because page-data.json may not exist in development.\n (process.env.NODE_ENV !== `production` && process.env.NODE_ENV !== `test`)\n ) {\n return null\n }\n\n try {\n const publicDirectory = path.join(\n directory || store.getState().program.directory,\n `public`\n )\n const pageData = await readPageData(publicDirectory, pagePath)\n\n const pageDataDigest = createContentDigest(pageData)\n\n return pageDataDigest\n } catch (e) {\n reporter.warn(\n `No page-data.json found for ${pagePath} while processing node manifests.`\n )\n\n return null\n }\n}\n\n/**\n * Prepares and then writes out an individual node manifest file to be used for routing to previews. Manifest files are added via the public unstable_createNodeManifest action\n */\nexport async function processNodeManifest(\n inputManifest: INodeManifest\n): Promise<null | INodeManifestOut> {\n const nodeId = inputManifest.node.id\n const fullNode = getNode(nodeId)\n\n if (!fullNode) {\n reporter.warn(\n `Plugin ${inputManifest.pluginName} called unstable_createNodeManifest for a node which doesn't exist with an id of ${nodeId}.`\n )\n return null\n }\n\n // map the node to a page that was created\n const { page: nodeManifestPage, foundPageBy } = await findPageOwnedByNodeId({\n nodeId,\n })\n\n warnAboutNodeManifestMappingProblems({\n inputManifest,\n pagePath: nodeManifestPage.path,\n foundPageBy,\n })\n\n const pageDataDigest = await getPageDataDigestForPagePath(\n nodeManifestPage.path\n )\n\n const finalManifest: INodeManifestOut = {\n node: inputManifest.node,\n page: nodeManifestPage,\n foundPageBy,\n pageDataDigest,\n }\n\n const gatsbySiteDirectory = store.getState().program.directory\n\n // write out the manifest file\n const manifestFilePath = path.join(\n gatsbySiteDirectory,\n `public`,\n `__node-manifests`,\n inputManifest.pluginName,\n `${inputManifest.manifestId}.json`\n )\n\n const manifestFileDir = path.dirname(manifestFilePath)\n\n await fs.ensureDir(manifestFileDir)\n await fs.writeJSON(manifestFilePath, finalManifest)\n\n return finalManifest\n}\n\n/**\n * Grabs all pending node manifests, processes them, writes them to disk,\n * and then removes them from the store.\n * Manifest files are added via the public unstable_createNodeManifest action in sourceNodes\n */\nexport async function processNodeManifests(): Promise<void> {\n const { nodeManifests } = store.getState()\n\n const totalManifests = nodeManifests.length\n\n if (totalManifests === 0) {\n return\n }\n\n const processedManifests = await Promise.all(\n nodeManifests.map(manifest => processNodeManifest(manifest))\n )\n\n let totalProcessedManifests = 0\n let totalFailedManifests = 0\n\n processedManifests.forEach(manifest => {\n if (manifest) {\n totalProcessedManifests++\n } else {\n totalFailedManifests++\n }\n })\n\n const pluralize = (length: number): string =>\n length > 1 || length === 0 ? `s` : ``\n\n reporter.info(\n `Wrote out ${totalProcessedManifests} node page manifest file${pluralize(\n totalProcessedManifests\n )}${\n totalFailedManifests > 0\n ? `. ${totalFailedManifests} manifest${pluralize(\n totalFailedManifests\n )} couldn't be processed.`\n : ``\n }`\n )\n\n // clean up all pending manifests from the store\n store.dispatch(internalActions.deleteNodeManifests())\n}\n"],"file":"node-manifest.js"}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/node-manifest.ts"],"names":["findPageOwnedByNodeId","nodeId","state","store","getState","pages","nodes","byNode","queries","usingPagesMap","process","env","NODE_ENV","pagePathSetOrMap","get","pagePath","values","next","value","foundPageBy","ownerPagePath","foundOwnerNodeId","pathOrPageObject","path","fullPage","ownerNodeId","foundPageIdInContext","context","id","pageCreatedByPluginName","pluginCreatorId","name","pageCreatedByFilesystemPlugin","page","foundPageByToLogIds","none","queryTracking","warnAboutNodeManifestMappingProblems","inputManifest","logId","reporter","error","Error","getPageDataDigestForPagePath","directory","publicDirectory","join","program","pageData","pageDataDigest","e","warn","processNodeManifest","node","fullNode","pluginName","nodeManifestPage","finalManifest","gatsbySiteDirectory","fileNameBase","manifestId","platform","replace","manifestFilePath","manifestFileDir","dirname","fs","ensureDir","writeJSON","processNodeManifests","nodeManifests","totalManifests","length","processedManifests","Promise","all","map","manifest","totalProcessedManifests","totalFailedManifests","forEach","pluralize","info","dispatch","internalActions","deleteNodeManifests"],"mappings":";;;;;;;;;;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AA0BA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeA,qBAAf,CAAqC;AAAEC,EAAAA;AAAF,CAArC,EAGG;AAAA;;AACD,QAAMC,KAAK,GAAGC,aAAMC,QAAN,EAAd;;AACA,QAAM;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,MAAmBJ,KAAzB;AACA,QAAM;AAAEK,IAAAA;AAAF,MAAaL,KAAK,CAACM,OAAzB,CAHC,CAKD;AACA;AACA;AACA;AACA;;AACA,QAAMC,aAAsB,GAAI,aAAD,KAAkBC,OAAO,CAACC,GAAR,CAAYC,QAA7D;AAEA,QAAMC,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AAEA,MAAID,cAAc,KAAK,CAAvB,EAA0B;AACxB;AACD;;AAED,QAAME,kBAAkB,GAAG,MAAMC,OAAO,CAACC,GAAR,CAC/BL,aAAa,CAACM,GAAd,CAAkBC,QAAQ,IAAIzB,mBAAmB,CAACyB,QAAD,CAAjD,CAD+B,CAAjC;AAIA,MAAIC,uBAAuB,GAAG,CAA9B;AACA,MAAIC,oBAAoB,GAAG,CAA3B;AAEAN,EAAAA,kBAAkB,CAACO,OAAnB,CAA2BH,QAAQ,IAAI;AACrC,QAAIA,QAAJ,EAAc;AACZC,MAAAA,uBAAuB;AACxB,KAFD,MAEO;AACLC,MAAAA,oBAAoB;AACrB;AACF,GAND;;AAQA,QAAME,SAAS,GAAIT,MAAD,IAChBA,MAAM,GAAG,CAAT,IAAcA,MAAM,KAAK,CAAzB,GAA8B,GAA9B,GAAoC,EADtC;;AAGAhC,oBAAS0C,IAAT,CACG,aAAYJ,uBAAwB,2BAA0BG,SAAS,CACtEH,uBADsE,CAEtE,GACAC,oBAAoB,GAAG,CAAvB,GACK,KAAIA,oBAAqB,YAAWE,SAAS,CAC5CF,oBAD4C,CAE5C,yBAHN,GAIK,EACN,EATH,EA3B0D,CAuC1D;;;AACA5E,eAAMgF,QAAN,CAAeC,yBAAgBC,mBAAhB,EAAf;AACD","sourcesContent":["import type { ErrorId } from \"gatsby-cli/lib/structured-errors/error-map\"\nimport { getNode } from \"./../datastore\"\nimport { IGatsbyPage, INodeManifest } from \"./../redux/types\"\nimport reporter from \"gatsby-cli/lib/reporter\"\nimport { store } from \"../redux/\"\nimport { internalActions } from \"../redux/actions\"\nimport path from \"path\"\nimport fs from \"fs-extra\"\nimport { readPageData } from \"./page-data\"\nimport { createContentDigest } from \"gatsby-core-utils\"\n\ninterface INodeManifestPage {\n path?: string\n}\n\n/**\n * This it the output after processing calls to the public unstable_createNodeManifest action\n */\ninterface INodeManifestOut {\n page: INodeManifestPage\n node: {\n id: string\n }\n foundPageBy: FoundPageBy\n pageDataDigest: string | null\n}\n\ntype FoundPageBy =\n | `ownerNodeId`\n | `filesystem-route-api`\n // for these three we warn to use ownerNodeId instead\n | `context.id`\n | `queryTracking`\n | `none`\n\n/**\n * Finds a final built page by nodeId\n *\n * Note that this function wont work properly in `gatsby develop`\n * since develop no longer runs all page queries when creating pages.\n * We use the node id to query mapping to find the right page but\n * this mapping only exists once you've visited a page in your browser.\n * When this fn is being used for routing to previews the user wont necessarily have\n * visited the page in the browser yet.\n */\nasync function findPageOwnedByNodeId({ nodeId }: { nodeId: string }): Promise<{\n page: INodeManifestPage\n foundPageBy: FoundPageBy\n}> {\n const state = store.getState()\n const { pages, nodes } = state\n const { byNode } = state.queries\n\n // in development queries are run on demand so we wont have an accurate nodeId->pages map until those pages are visited in the browser. We want this mapping before the page is visited in the browser so we can route to the right page in the browser.\n // So in development we can just use the Map of all pages (pagePath -> pageNode)\n // but for builds (preview inc builds or regular builds) we will have a full map\n // of all nodeId's to pages they're queried on and we can use that instead since it\n // will be a much smaller list of pages, resulting in better performance for large sites\n const usingPagesMap: boolean = `development` === process.env.NODE_ENV\n\n const pagePathSetOrMap = usingPagesMap\n ? // this is a Map of page path to page node\n pages\n : // this is a Set of page paths\n byNode?.get(nodeId)\n\n // the default page path is the first page found in\n // node id to page query tracking\n let pagePath = byNode?.get(nodeId)?.values()?.next()?.value\n\n let foundPageBy: FoundPageBy = pagePath ? `queryTracking` : `none`\n\n if (pagePathSetOrMap) {\n let ownerPagePath: string | undefined\n let foundOwnerNodeId = false\n\n // for each page this nodeId is queried in\n for (const pathOrPageObject of pagePathSetOrMap.values()) {\n // if we haven't found a page with this nodeId\n // set as page.ownerNodeId then run this logic.\n // this condition is on foundOwnerNodeId instead of ownerPagePath\n // in case we find a page with the nodeId in page.context.id\n // and then later in the loop there's a page with this nodeId\n // set on page.ownerNodeId.\n // We always want to prefer ownerPagePath over context.id\n if (foundOwnerNodeId) {\n break\n }\n\n const path = (\n usingPagesMap\n ? // in development we're using a Map, so the value here is a page object\n (pathOrPageObject as IGatsbyPage).path\n : // in builds we're using a Set so the page path is the value\n pathOrPageObject\n ) as string\n\n const fullPage: IGatsbyPage | undefined = pages.get(path)\n\n foundOwnerNodeId = fullPage?.ownerNodeId === nodeId\n\n const foundPageIdInContext = fullPage?.context.id === nodeId\n\n if (foundOwnerNodeId) {\n foundPageBy = `ownerNodeId`\n } else if (foundPageIdInContext && fullPage) {\n const pageCreatedByPluginName = nodes.get(\n fullPage.pluginCreatorId\n )?.name\n\n const pageCreatedByFilesystemPlugin =\n pageCreatedByPluginName === `gatsby-plugin-page-creator`\n\n foundPageBy = pageCreatedByFilesystemPlugin\n ? `filesystem-route-api`\n : `context.id`\n }\n\n if (\n fullPage &&\n // first check for the ownerNodeId on the page. this is\n // the defacto owner. Can't get more specific than this\n (foundOwnerNodeId ||\n // if there's no specified owner look to see if\n // pageContext has an `id` variable which matches our\n // nodeId. Using an \"id\" as a variable in queries is common\n // and if we don't have an owner this is a better guess\n // of an owner than grabbing the first page query we find\n // that's mapped to this node id.\n // this also makes this work with the filesystem Route API without\n // changing that API.\n foundPageIdInContext)\n ) {\n // save this path to use in our manifest!\n ownerPagePath = fullPage.path\n }\n }\n\n if (ownerPagePath) {\n pagePath = ownerPagePath\n }\n }\n\n return {\n page: {\n path: pagePath || null,\n },\n foundPageBy,\n }\n}\n\n// these id's correspond to error id's in\n// packages/gatsby-cli/src/structured-errors/error-map.ts\nexport const foundPageByToLogIds = {\n none: `11801`,\n [`context.id`]: `11802`,\n queryTracking: `11803`,\n [`filesystem-route-api`]: `success`,\n ownerNodeId: `success`,\n}\n\n/**\n * Takes in some info about a node manifest and the page we did or didn't find for it, then warns and returns the warning string\n */\nexport function warnAboutNodeManifestMappingProblems({\n inputManifest,\n pagePath,\n foundPageBy,\n}: {\n inputManifest: INodeManifest\n pagePath?: string\n foundPageBy: FoundPageBy\n}): { logId: string } {\n let logId: ErrorId | `success`\n\n switch (foundPageBy) {\n case `none`:\n case `context.id`:\n case `queryTracking`: {\n logId = foundPageByToLogIds[foundPageBy]\n reporter.error({\n id: logId,\n context: {\n inputManifest,\n pagePath,\n },\n })\n break\n }\n\n case `filesystem-route-api`:\n case `ownerNodeId`:\n logId = `success`\n break\n\n default: {\n throw Error(`Node Manifest mapping is in an impossible state`)\n }\n }\n\n return {\n logId,\n }\n}\n\n/**\n * Retrieves the content digest of a page-data.json file for use in creating node manifest files.\n */\nexport async function getPageDataDigestForPagePath(\n pagePath?: string,\n directory?: string\n): Promise<string | null> {\n if (\n // if no page was created for the node we're creating a manifest for, there wont be a page path.\n !pagePath ||\n // we only add page data digests to node manifests in production because page-data.json may not exist in development.\n (process.env.NODE_ENV !== `production` && process.env.NODE_ENV !== `test`)\n ) {\n return null\n }\n\n try {\n const publicDirectory = path.join(\n directory || store.getState().program.directory,\n `public`\n )\n const pageData = await readPageData(publicDirectory, pagePath)\n\n const pageDataDigest = createContentDigest(pageData)\n\n return pageDataDigest\n } catch (e) {\n reporter.warn(\n `No page-data.json found for ${pagePath} while processing node manifests.`\n )\n\n return null\n }\n}\n\n/**\n * Prepares and then writes out an individual node manifest file to be used for routing to previews. Manifest files are added via the public unstable_createNodeManifest action\n */\nexport async function processNodeManifest(\n inputManifest: INodeManifest\n): Promise<null | INodeManifestOut> {\n const nodeId = inputManifest.node.id\n const fullNode = getNode(nodeId)\n\n if (!fullNode) {\n reporter.warn(\n `Plugin ${inputManifest.pluginName} called unstable_createNodeManifest for a node which doesn't exist with an id of ${nodeId}.`\n )\n return null\n }\n\n // map the node to a page that was created\n const { page: nodeManifestPage, foundPageBy } = await findPageOwnedByNodeId({\n nodeId,\n })\n\n warnAboutNodeManifestMappingProblems({\n inputManifest,\n pagePath: nodeManifestPage.path,\n foundPageBy,\n })\n\n const pageDataDigest = await getPageDataDigestForPagePath(\n nodeManifestPage.path\n )\n\n const finalManifest: INodeManifestOut = {\n node: inputManifest.node,\n page: nodeManifestPage,\n foundPageBy,\n pageDataDigest,\n }\n\n const gatsbySiteDirectory = store.getState().program.directory\n\n let fileNameBase = inputManifest.manifestId\n\n /**\n * Windows has a handful of special/reserved characters that are not valid in a file path\n * @reference https://superuser.com/questions/358855/what-characters-are-safe-in-cross-platform-file-names-for-linux-windows-and-os\n *\n * The two exceptions to the list linked above are\n * - the colon that is part of the hard disk partition name at the beginning of a file path (i.e. C:)\n * - backslashes. We don't want to replace backslashes because those are used to delineate what the actual file path is\n *\n * During local development, node manifests can be written to disk but are generally unused as they are only used\n * for Content Sync which runs in Gatsby Cloud. Gatsby cloud is a Linux environment in which these special chars are valid in\n * filepaths. To avoid errors on Windows, we replace all instances of the special chars in the filepath (with the exception of the\n * hard disk partition name) with \"-\" to ensure that local Windows development setups do not break when attempting\n * to write one of these manifests to disk.\n */\n if (process.platform === `win32`) {\n fileNameBase = fileNameBase.replace(/:|\\/|\\*|\\?|\"|<|>|\\||\\\\/g, `-`)\n }\n\n // write out the manifest file\n const manifestFilePath = path.join(\n gatsbySiteDirectory,\n `public`,\n `__node-manifests`,\n inputManifest.pluginName,\n `${fileNameBase}.json`\n )\n\n const manifestFileDir = path.dirname(manifestFilePath)\n\n await fs.ensureDir(manifestFileDir)\n await fs.writeJSON(manifestFilePath, finalManifest)\n\n return finalManifest\n}\n\n/**\n * Grabs all pending node manifests, processes them, writes them to disk,\n * and then removes them from the store.\n * Manifest files are added via the public unstable_createNodeManifest action in sourceNodes\n */\nexport async function processNodeManifests(): Promise<void> {\n const { nodeManifests } = store.getState()\n\n const totalManifests = nodeManifests.length\n\n if (totalManifests === 0) {\n return\n }\n\n const processedManifests = await Promise.all(\n nodeManifests.map(manifest => processNodeManifest(manifest))\n )\n\n let totalProcessedManifests = 0\n let totalFailedManifests = 0\n\n processedManifests.forEach(manifest => {\n if (manifest) {\n totalProcessedManifests++\n } else {\n totalFailedManifests++\n }\n })\n\n const pluralize = (length: number): string =>\n length > 1 || length === 0 ? `s` : ``\n\n reporter.info(\n `Wrote out ${totalProcessedManifests} node page manifest file${pluralize(\n totalProcessedManifests\n )}${\n totalFailedManifests > 0\n ? `. ${totalFailedManifests} manifest${pluralize(\n totalFailedManifests\n )} couldn't be processed.`\n : ``\n }`\n )\n\n // clean up all pending manifests from the store\n store.dispatch(internalActions.deleteNodeManifests())\n}\n"],"file":"node-manifest.js"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.6"/><title data-react-helmet="true"></title><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2"/><style>@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff) format("woff");font-display:swap}</style><link as="script" rel="preload" href="/___admin/webpack-runtime-2478a6aa71d7fe140451.js"/><link as="script" rel="preload" href="/___admin/framework-b24cde22b86a9930317b.js"/><link as="script" rel="preload" href="/___admin/app-552da616a99bc886bb71.js"/><link as="script" rel="preload" href="/___admin/e2852b4470dcb2615e49edcd9de2a3c8119d4bec-fdf65cf14f60e302e2d6.js"/><link as="script" rel="preload" href="/___admin/c432bec7e9afb3443fd639df9e5f119e13575cf7-8db0534ff52e363cdb1d.js"/><link as="script" rel="preload" href="/___admin/854a7ef1f34af0aefbdfdd9304a0c00251662775-e2e8402c4d45f5fee48d.js"/><link as="script" rel="preload" href="/___admin/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js"/><link as="fetch" rel="preload" href="/___admin/page-data/index/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="/___admin/page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><style data-emotion-css="ict6so">body{background-color:#ffffff;}body color{header:#000000;primary:#36313d;secondary:#78757a;placeholder:#b7b5bd;}</style><style data-emotion-css="fw25na">*{box-sizing:border-box;}body{margin:0rem;background-color:var(--theme-ui-colors-grey-5,#fbfbfb);}</style><style data-emotion-css="1pf5xd">.css-1pf5xd{box-sizing:border-box;margin:0;min-width:0;color:primary;overflow:visible;}</style><svg viewBox="0 0 32 32" width="48" height="48" stroke-width="4" fill="none" stroke="currentcolor" role="img" class="css-1pf5xd"><title>Loading...</title><circle cx="16" cy="16" r="12" opacity="0.125"></circle><style data-emotion-css="wpcq6n animation-1q8eu9e">.css-wpcq6n{box-sizing:border-box;margin:0;min-width:0;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation-name:animation-1q8eu9e;animation-name:animation-1q8eu9e;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:500ms;animation-duration:500ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}@-webkit-keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style><circle cx="16" cy="16" r="12" stroke-dasharray="75.39822368615503" stroke-dashoffset="56.548667764616276" class="css-wpcq6n"></circle></svg></div><div id="gatsby-announcer" style="position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0" aria-live="assertive" aria-atomic="true"></div></div><script id="gatsby-script-loader">/*<![CDATA[*/window.pagePath="/";/*]]>*/</script><script id="gatsby-chunk-mapping">/*<![CDATA[*/window.___chunkMapping={"polyfill":["/polyfill-85cdcdc6d8017a8c93f4.js"],"app":["/app-552da616a99bc886bb71.js"],"component---src-pages-index-tsx":["/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js"],"component---src-pages-pages-tsx":["/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js"],"component---src-pages-plugins-tsx":["/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js"],"component---src-pages-recipe-js":["/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js"],"component---src-pages-recipes-tsx":["/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js"]};/*]]>*/</script><script src="/___admin/polyfill-85cdcdc6d8017a8c93f4.js" nomodule=""></script><script src="/___admin/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js" async=""></script><script src="/___admin/854a7ef1f34af0aefbdfdd9304a0c00251662775-e2e8402c4d45f5fee48d.js" async=""></script><script src="/___admin/c432bec7e9afb3443fd639df9e5f119e13575cf7-8db0534ff52e363cdb1d.js" async=""></script><script src="/___admin/e2852b4470dcb2615e49edcd9de2a3c8119d4bec-fdf65cf14f60e302e2d6.js" async=""></script><script src="/___admin/app-552da616a99bc886bb71.js" async=""></script><script src="/___admin/framework-b24cde22b86a9930317b.js" async=""></script><script src="/___admin/webpack-runtime-2478a6aa71d7fe140451.js" async=""></script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.6"/><title data-react-helmet="true"></title><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2"/><style>@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff) format("woff");font-display:swap}</style><link as="script" rel="preload" href="/___admin/webpack-runtime-2478a6aa71d7fe140451.js"/><link as="script" rel="preload" href="/___admin/framework-b24cde22b86a9930317b.js"/><link as="script" rel="preload" href="/___admin/app-552da616a99bc886bb71.js"/><link as="script" rel="preload" href="/___admin/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js"/><link as="fetch" rel="preload" href="/___admin/page-data/pages/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="/___admin/page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><style data-emotion-css="ict6so">body{background-color:#ffffff;}body color{header:#000000;primary:#36313d;secondary:#78757a;placeholder:#b7b5bd;}</style><style data-emotion-css="fw25na">*{box-sizing:border-box;}body{margin:0rem;background-color:var(--theme-ui-colors-grey-5,#fbfbfb);}</style><style data-emotion-css="1pf5xd">.css-1pf5xd{box-sizing:border-box;margin:0;min-width:0;color:primary;overflow:visible;}</style><svg viewBox="0 0 32 32" width="48" height="48" stroke-width="4" fill="none" stroke="currentcolor" role="img" class="css-1pf5xd"><title>Loading...</title><circle cx="16" cy="16" r="12" opacity="0.125"></circle><style data-emotion-css="wpcq6n animation-1q8eu9e">.css-wpcq6n{box-sizing:border-box;margin:0;min-width:0;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation-name:animation-1q8eu9e;animation-name:animation-1q8eu9e;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:500ms;animation-duration:500ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}@-webkit-keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style><circle cx="16" cy="16" r="12" stroke-dasharray="75.39822368615503" stroke-dashoffset="56.548667764616276" class="css-wpcq6n"></circle></svg></div><div id="gatsby-announcer" style="position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0" aria-live="assertive" aria-atomic="true"></div></div><script id="gatsby-script-loader">/*<![CDATA[*/window.pagePath="/pages/";/*]]>*/</script><script id="gatsby-chunk-mapping">/*<![CDATA[*/window.___chunkMapping={"polyfill":["/polyfill-85cdcdc6d8017a8c93f4.js"],"app":["/app-552da616a99bc886bb71.js"],"component---src-pages-index-tsx":["/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js"],"component---src-pages-pages-tsx":["/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js"],"component---src-pages-plugins-tsx":["/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js"],"component---src-pages-recipe-js":["/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js"],"component---src-pages-recipes-tsx":["/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js"]};/*]]>*/</script><script src="/___admin/polyfill-85cdcdc6d8017a8c93f4.js" nomodule=""></script><script src="/___admin/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js" async=""></script><script src="/___admin/app-552da616a99bc886bb71.js" async=""></script><script src="/___admin/framework-b24cde22b86a9930317b.js" async=""></script><script src="/___admin/webpack-runtime-2478a6aa71d7fe140451.js" async=""></script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.6"/><title data-react-helmet="true"></title><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2"/><style>@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff) format("woff");font-display:swap}</style><link as="script" rel="preload" href="/___admin/webpack-runtime-2478a6aa71d7fe140451.js"/><link as="script" rel="preload" href="/___admin/framework-b24cde22b86a9930317b.js"/><link as="script" rel="preload" href="/___admin/app-552da616a99bc886bb71.js"/><link as="script" rel="preload" href="/___admin/69bd6bf3-684a0eb07103ce2347bb.js"/><link as="script" rel="preload" href="/___admin/4c744e84-68fce5225c02bf5771b5.js"/><link as="script" rel="preload" href="/___admin/e2852b4470dcb2615e49edcd9de2a3c8119d4bec-fdf65cf14f60e302e2d6.js"/><link as="script" rel="preload" href="/___admin/c432bec7e9afb3443fd639df9e5f119e13575cf7-8db0534ff52e363cdb1d.js"/><link as="script" rel="preload" href="/___admin/784b2cee55c07b638f20445dec340adf9f1888a3-b2fc60100cf82df7f003.js"/><link as="script" rel="preload" href="/___admin/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js"/><link as="fetch" rel="preload" href="/___admin/page-data/plugins/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="/___admin/page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><style data-emotion-css="ict6so">body{background-color:#ffffff;}body color{header:#000000;primary:#36313d;secondary:#78757a;placeholder:#b7b5bd;}</style><style data-emotion-css="fw25na">*{box-sizing:border-box;}body{margin:0rem;background-color:var(--theme-ui-colors-grey-5,#fbfbfb);}</style><style data-emotion-css="1pf5xd">.css-1pf5xd{box-sizing:border-box;margin:0;min-width:0;color:primary;overflow:visible;}</style><svg viewBox="0 0 32 32" width="48" height="48" stroke-width="4" fill="none" stroke="currentcolor" role="img" class="css-1pf5xd"><title>Loading...</title><circle cx="16" cy="16" r="12" opacity="0.125"></circle><style data-emotion-css="wpcq6n animation-1q8eu9e">.css-wpcq6n{box-sizing:border-box;margin:0;min-width:0;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation-name:animation-1q8eu9e;animation-name:animation-1q8eu9e;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:500ms;animation-duration:500ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}@-webkit-keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style><circle cx="16" cy="16" r="12" stroke-dasharray="75.39822368615503" stroke-dashoffset="56.548667764616276" class="css-wpcq6n"></circle></svg></div><div id="gatsby-announcer" style="position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0" aria-live="assertive" aria-atomic="true"></div></div><script id="gatsby-script-loader">/*<![CDATA[*/window.pagePath="/plugins/";/*]]>*/</script><script id="gatsby-chunk-mapping">/*<![CDATA[*/window.___chunkMapping={"polyfill":["/polyfill-85cdcdc6d8017a8c93f4.js"],"app":["/app-552da616a99bc886bb71.js"],"component---src-pages-index-tsx":["/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js"],"component---src-pages-pages-tsx":["/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js"],"component---src-pages-plugins-tsx":["/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js"],"component---src-pages-recipe-js":["/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js"],"component---src-pages-recipes-tsx":["/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js"]};/*]]>*/</script><script src="/___admin/polyfill-85cdcdc6d8017a8c93f4.js" nomodule=""></script><script src="/___admin/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js" async=""></script><script src="/___admin/784b2cee55c07b638f20445dec340adf9f1888a3-b2fc60100cf82df7f003.js" async=""></script><script src="/___admin/c432bec7e9afb3443fd639df9e5f119e13575cf7-8db0534ff52e363cdb1d.js" async=""></script><script src="/___admin/e2852b4470dcb2615e49edcd9de2a3c8119d4bec-fdf65cf14f60e302e2d6.js" async=""></script><script src="/___admin/4c744e84-68fce5225c02bf5771b5.js" async=""></script><script src="/___admin/69bd6bf3-684a0eb07103ce2347bb.js" async=""></script><script src="/___admin/app-552da616a99bc886bb71.js" async=""></script><script src="/___admin/framework-b24cde22b86a9930317b.js" async=""></script><script src="/___admin/webpack-runtime-2478a6aa71d7fe140451.js" async=""></script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.6"/><title data-react-helmet="true"></title><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2"/><style>@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff) format("woff");font-display:swap}</style><link as="script" rel="preload" href="/___admin/webpack-runtime-2478a6aa71d7fe140451.js"/><link as="script" rel="preload" href="/___admin/framework-b24cde22b86a9930317b.js"/><link as="script" rel="preload" href="/___admin/app-552da616a99bc886bb71.js"/><link as="script" rel="preload" href="/___admin/69bd6bf3-684a0eb07103ce2347bb.js"/><link as="script" rel="preload" href="/___admin/854a7ef1f34af0aefbdfdd9304a0c00251662775-e2e8402c4d45f5fee48d.js"/><link as="script" rel="preload" href="/___admin/784b2cee55c07b638f20445dec340adf9f1888a3-b2fc60100cf82df7f003.js"/><link as="script" rel="preload" href="/___admin/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js"/><link as="fetch" rel="preload" href="/___admin/page-data/recipe/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="/___admin/page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><style data-emotion-css="ict6so">body{background-color:#ffffff;}body color{header:#000000;primary:#36313d;secondary:#78757a;placeholder:#b7b5bd;}</style><style data-emotion-css="fw25na">*{box-sizing:border-box;}body{margin:0rem;background-color:var(--theme-ui-colors-grey-5,#fbfbfb);}</style><style data-emotion-css="1pf5xd">.css-1pf5xd{box-sizing:border-box;margin:0;min-width:0;color:primary;overflow:visible;}</style><svg viewBox="0 0 32 32" width="48" height="48" stroke-width="4" fill="none" stroke="currentcolor" role="img" class="css-1pf5xd"><title>Loading...</title><circle cx="16" cy="16" r="12" opacity="0.125"></circle><style data-emotion-css="wpcq6n animation-1q8eu9e">.css-wpcq6n{box-sizing:border-box;margin:0;min-width:0;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation-name:animation-1q8eu9e;animation-name:animation-1q8eu9e;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:500ms;animation-duration:500ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}@-webkit-keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style><circle cx="16" cy="16" r="12" stroke-dasharray="75.39822368615503" stroke-dashoffset="56.548667764616276" class="css-wpcq6n"></circle></svg></div><div id="gatsby-announcer" style="position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0" aria-live="assertive" aria-atomic="true"></div></div><script id="gatsby-script-loader">/*<![CDATA[*/window.pagePath="/recipe/";/*]]>*/</script><script id="gatsby-chunk-mapping">/*<![CDATA[*/window.___chunkMapping={"polyfill":["/polyfill-85cdcdc6d8017a8c93f4.js"],"app":["/app-552da616a99bc886bb71.js"],"component---src-pages-index-tsx":["/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js"],"component---src-pages-pages-tsx":["/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js"],"component---src-pages-plugins-tsx":["/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js"],"component---src-pages-recipe-js":["/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js"],"component---src-pages-recipes-tsx":["/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js"]};/*]]>*/</script><script src="/___admin/polyfill-85cdcdc6d8017a8c93f4.js" nomodule=""></script><script src="/___admin/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js" async=""></script><script src="/___admin/784b2cee55c07b638f20445dec340adf9f1888a3-b2fc60100cf82df7f003.js" async=""></script><script src="/___admin/854a7ef1f34af0aefbdfdd9304a0c00251662775-e2e8402c4d45f5fee48d.js" async=""></script><script src="/___admin/69bd6bf3-684a0eb07103ce2347bb.js" async=""></script><script src="/___admin/app-552da616a99bc886bb71.js" async=""></script><script src="/___admin/framework-b24cde22b86a9930317b.js" async=""></script><script src="/___admin/webpack-runtime-2478a6aa71d7fe140451.js" async=""></script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/><style data-href="/___admin/styles.ac2d3128404ecdaeec67.css" data-identity="gatsby-global-css">/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}</style><meta name="generator" content="Gatsby 3.14.6"/><title data-react-helmet="true"></title><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2"/><link rel="preload" as="font" type="font/woff2" crossorigin="anonymous" href="/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2"/><style>@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hiA.woff2) format("woff2");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:400;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuLyfAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:600;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuGKYAZ9hjg.woff) format("woff");font-display:swap}@font-face{font-family:Inter;font-style:normal;font-weight:800;src:url(/___admin/static/webfonts/s/inter/v7/UcCO3FwrK3iLTeHuS_fvQtMwCp50KnMw2boKoduKmMEVuDyYAZ9hjg.woff) format("woff");font-display:swap}</style><link as="script" rel="preload" href="/___admin/webpack-runtime-2478a6aa71d7fe140451.js"/><link as="script" rel="preload" href="/___admin/framework-b24cde22b86a9930317b.js"/><link as="script" rel="preload" href="/___admin/app-552da616a99bc886bb71.js"/><link as="script" rel="preload" href="/___admin/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js"/><link as="fetch" rel="preload" href="/___admin/page-data/recipes/page-data.json" crossorigin="anonymous"/><link as="fetch" rel="preload" href="/___admin/page-data/app-data.json" crossorigin="anonymous"/></head><body><div id="___gatsby"><div style="outline:none" tabindex="-1" id="gatsby-focus-wrapper"><style data-emotion-css="ict6so">body{background-color:#ffffff;}body color{header:#000000;primary:#36313d;secondary:#78757a;placeholder:#b7b5bd;}</style><style data-emotion-css="fw25na">*{box-sizing:border-box;}body{margin:0rem;background-color:var(--theme-ui-colors-grey-5,#fbfbfb);}</style><style data-emotion-css="1pf5xd">.css-1pf5xd{box-sizing:border-box;margin:0;min-width:0;color:primary;overflow:visible;}</style><svg viewBox="0 0 32 32" width="48" height="48" stroke-width="4" fill="none" stroke="currentcolor" role="img" class="css-1pf5xd"><title>Loading...</title><circle cx="16" cy="16" r="12" opacity="0.125"></circle><style data-emotion-css="wpcq6n animation-1q8eu9e">.css-wpcq6n{box-sizing:border-box;margin:0;min-width:0;-webkit-transform-origin:50% 50%;-ms-transform-origin:50% 50%;transform-origin:50% 50%;-webkit-animation-name:animation-1q8eu9e;animation-name:animation-1q8eu9e;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:500ms;animation-duration:500ms;-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;}@-webkit-keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}@keyframes animation-1q8eu9e{from{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}to{-webkit-transform:rotate(360deg);-ms-transform:rotate(360deg);transform:rotate(360deg);}}</style><circle cx="16" cy="16" r="12" stroke-dasharray="75.39822368615503" stroke-dashoffset="56.548667764616276" class="css-wpcq6n"></circle></svg></div><div id="gatsby-announcer" style="position:absolute;top:0;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border:0" aria-live="assertive" aria-atomic="true"></div></div><script id="gatsby-script-loader">/*<![CDATA[*/window.pagePath="/recipes/";/*]]>*/</script><script id="gatsby-chunk-mapping">/*<![CDATA[*/window.___chunkMapping={"polyfill":["/polyfill-85cdcdc6d8017a8c93f4.js"],"app":["/app-552da616a99bc886bb71.js"],"component---src-pages-index-tsx":["/component---src-pages-index-tsx-ae7aa7efde37ccf72193.js"],"component---src-pages-pages-tsx":["/component---src-pages-pages-tsx-b4a6c93567ec792e0974.js"],"component---src-pages-plugins-tsx":["/component---src-pages-plugins-tsx-c2eb4db8168edfc87864.js"],"component---src-pages-recipe-js":["/component---src-pages-recipe-js-c33ae0ed3a512fe2bdb8.js"],"component---src-pages-recipes-tsx":["/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js"]};/*]]>*/</script><script src="/___admin/polyfill-85cdcdc6d8017a8c93f4.js" nomodule=""></script><script src="/___admin/component---src-pages-recipes-tsx-d347016863bb8d7ed197.js" async=""></script><script src="/___admin/app-552da616a99bc886bb71.js" async=""></script><script src="/___admin/framework-b24cde22b86a9930317b.js" async=""></script><script src="/___admin/webpack-runtime-2478a6aa71d7fe140451.js" async=""></script></body></html>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gatsby",
|
|
3
3
|
"description": "Blazing fast modern site generator for React",
|
|
4
|
-
"version": "3.14.
|
|
4
|
+
"version": "3.14.6",
|
|
5
5
|
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"gatsby": "./cli.js"
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
"find-cache-dir": "^3.3.1",
|
|
78
78
|
"fs-exists-cached": "1.0.0",
|
|
79
79
|
"fs-extra": "^10.0.0",
|
|
80
|
-
"gatsby-cli": "^3.14.
|
|
80
|
+
"gatsby-cli": "^3.14.2",
|
|
81
81
|
"gatsby-core-utils": "^2.14.0",
|
|
82
82
|
"gatsby-graphiql-explorer": "^1.14.0",
|
|
83
83
|
"gatsby-legacy-polyfills": "^1.14.0",
|
|
@@ -116,7 +116,6 @@
|
|
|
116
116
|
"opentracing": "^0.14.4",
|
|
117
117
|
"p-defer": "^3.0.0",
|
|
118
118
|
"parseurl": "^1.3.3",
|
|
119
|
-
"path-to-regexp": "0.1.7",
|
|
120
119
|
"physical-cpu-count": "^2.0.0",
|
|
121
120
|
"platform": "^1.3.6",
|
|
122
121
|
"postcss": "^8.3.5",
|
|
@@ -257,5 +256,5 @@
|
|
|
257
256
|
"yargs": {
|
|
258
257
|
"boolean-negation": false
|
|
259
258
|
},
|
|
260
|
-
"gitHead": "
|
|
259
|
+
"gitHead": "1acb1bcf0f65c3c883c7ff82d39e273744212b65"
|
|
261
260
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|