gatsby 5.3.1 → 5.3.2
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/bootstrap/get-config-file.js +1 -1
- package/dist/bootstrap/get-config-file.js.map +1 -1
- package/dist/bootstrap/resolve-js-file-path.d.ts +6 -0
- package/dist/bootstrap/resolve-js-file-path.js +12 -0
- package/dist/bootstrap/resolve-js-file-path.js.map +1 -1
- package/dist/bootstrap/resolve-module-exports.js +1 -1
- package/dist/bootstrap/resolve-module-exports.js.map +1 -1
- package/dist/utils/import-gatsby-plugin.js +1 -1
- package/dist/utils/import-gatsby-plugin.js.map +1 -1
- package/package.json +2 -2
|
@@ -45,7 +45,7 @@ async function attemptImport(siteDirectory, configPath) {
|
|
|
45
45
|
};
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
const importedModule = await import(configFilePath);
|
|
48
|
+
const importedModule = await import((0, _resolveJsFilePath.maybeAddFileProtocol)(configFilePath));
|
|
49
49
|
const configModule = (0, _preferDefault.preferDefault)(importedModule);
|
|
50
50
|
return {
|
|
51
51
|
configFilePath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-config-file.js","names":["getConfigFile","siteDirectory","configName","distance","compiledResult","attemptImportCompiled","configModule","configFilePath","uncompiledResult","attemptImportUncompiled","attemptImport","configPath","resolveJSFilepath","rootDir","filePath","undefined","importedModule","preferDefault","compiledConfigPath","path","join","COMPILED_CACHE_DIR","error","report","panic","id","context","message","uncompiledConfigPath","testImportError","Error","tsConfig","nearMatch","checkTsAndNearMatch","isTSX","endsWith","isInSrcDir","warn","files","fs","readdir","file","name","ext","parse","isNearMatch"],"sources":["../../src/bootstrap/get-config-file.ts"],"sourcesContent":["import fs from \"fs-extra\"\nimport { testImportError } from \"../utils/test-import-error\"\nimport report from \"gatsby-cli/lib/reporter\"\nimport path from \"path\"\nimport { COMPILED_CACHE_DIR } from \"../utils/parcel/compile-gatsby-files\"\nimport { isNearMatch } from \"../utils/is-near-match\"\nimport { resolveJSFilepath } from \"./resolve-js-file-path\"\nimport { preferDefault } from \"./prefer-default\"\n\nexport async function getConfigFile(\n siteDirectory: string,\n configName: string,\n distance: number = 3\n): Promise<{\n configModule: any\n configFilePath: string\n}> {\n const compiledResult = await attemptImportCompiled(siteDirectory, configName)\n\n if (compiledResult?.configModule && compiledResult?.configFilePath) {\n return compiledResult\n }\n\n const uncompiledResult = await attemptImportUncompiled(\n siteDirectory,\n configName,\n distance\n )\n\n return uncompiledResult || {}\n}\n\nasync function attemptImport(\n siteDirectory: string,\n configPath: string\n): Promise<{\n configModule: unknown\n configFilePath: string\n}> {\n const configFilePath = await resolveJSFilepath({\n rootDir: siteDirectory,\n filePath: configPath,\n })\n\n // The file does not exist, no sense trying to import it\n if (!configFilePath) {\n return { configFilePath: ``, configModule: undefined }\n }\n\n const importedModule = await import(configFilePath)\n const configModule = preferDefault(importedModule)\n\n return { configFilePath, configModule }\n}\n\nasync function attemptImportCompiled(\n siteDirectory: string,\n configName: string\n): Promise<{\n configModule: unknown\n configFilePath: string\n}> {\n let compiledResult\n\n try {\n const compiledConfigPath = path.join(\n `${siteDirectory}/${COMPILED_CACHE_DIR}`,\n configName\n )\n compiledResult = await attemptImport(siteDirectory, compiledConfigPath)\n } catch (error) {\n report.panic({\n id: `11902`,\n error: error,\n context: {\n configName,\n message: error.message,\n },\n })\n }\n\n return compiledResult\n}\n\nasync function attemptImportUncompiled(\n siteDirectory: string,\n configName: string,\n distance: number\n): Promise<{\n configModule: unknown\n configFilePath: string\n}> {\n let uncompiledResult\n\n const uncompiledConfigPath = path.join(siteDirectory, configName)\n\n try {\n uncompiledResult = await attemptImport(siteDirectory, uncompiledConfigPath)\n } catch (error) {\n if (!testImportError(uncompiledConfigPath, error)) {\n report.panic({\n id: `10123`,\n error,\n context: {\n configName,\n message: error.message,\n },\n })\n }\n }\n\n if (uncompiledResult?.configFilePath) {\n return uncompiledResult\n }\n\n const error = new Error(`Cannot find package '${uncompiledConfigPath}'`)\n\n const { tsConfig, nearMatch } = await checkTsAndNearMatch(\n siteDirectory,\n configName,\n distance\n )\n\n // gatsby-config.ts exists but compiled gatsby-config.js does not\n if (tsConfig) {\n report.panic({\n id: `10127`,\n error,\n context: {\n configName,\n },\n })\n }\n\n // gatsby-config is misnamed\n if (nearMatch) {\n const isTSX = nearMatch.endsWith(`.tsx`)\n report.panic({\n id: `10124`,\n error,\n context: {\n configName,\n nearMatch,\n isTSX,\n },\n })\n }\n\n // gatsby-config is incorrectly located in src directory\n const isInSrcDir = await resolveJSFilepath({\n rootDir: siteDirectory,\n filePath: path.join(siteDirectory, `src`, configName),\n warn: false,\n })\n\n if (isInSrcDir) {\n report.panic({\n id: `10125`,\n context: {\n configName,\n },\n })\n }\n\n return uncompiledResult\n}\n\nasync function checkTsAndNearMatch(\n siteDirectory: string,\n configName: string,\n distance: number\n): Promise<{\n tsConfig: boolean\n nearMatch: string\n}> {\n const files = await fs.readdir(siteDirectory)\n\n let tsConfig = false\n let nearMatch = ``\n\n for (const file of files) {\n if (tsConfig || nearMatch) {\n break\n }\n\n const { name, ext } = path.parse(file)\n\n if (name === configName && ext === `.ts`) {\n tsConfig = true\n break\n }\n\n if (isNearMatch(name, configName, distance)) {\n nearMatch = file\n }\n }\n\n return {\n tsConfig,\n nearMatch,\n }\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,eAAeA,aAAf,CACLC,aADK,EAELC,UAFK,EAGLC,QAAgB,GAAG,CAHd,EAOJ;EACD,MAAMC,cAAc,GAAG,MAAMC,qBAAqB,CAACJ,aAAD,EAAgBC,UAAhB,CAAlD;;EAEA,IAAIE,cAAc,SAAd,IAAAA,cAAc,WAAd,IAAAA,cAAc,CAAEE,YAAhB,IAAgCF,cAAhC,aAAgCA,cAAhC,eAAgCA,cAAc,CAAEG,cAApD,EAAoE;IAClE,OAAOH,cAAP;EACD;;EAED,MAAMI,gBAAgB,GAAG,MAAMC,uBAAuB,CACpDR,aADoD,EAEpDC,UAFoD,EAGpDC,QAHoD,CAAtD;EAMA,OAAOK,gBAAgB,IAAI,EAA3B;AACD;;AAED,eAAeE,aAAf,CACET,aADF,EAEEU,UAFF,EAMG;EACD,MAAMJ,cAAc,GAAG,MAAM,IAAAK,oCAAA,EAAkB;IAC7CC,OAAO,EAAEZ,aADoC;IAE7Ca,QAAQ,EAAEH;EAFmC,CAAlB,CAA7B,CADC,CAMD;;EACA,IAAI,CAACJ,cAAL,EAAqB;IACnB,OAAO;MAAEA,cAAc,EAAG,EAAnB;MAAsBD,YAAY,EAAES;IAApC,CAAP;EACD;;EAED,MAAMC,cAAc,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"get-config-file.js","names":["getConfigFile","siteDirectory","configName","distance","compiledResult","attemptImportCompiled","configModule","configFilePath","uncompiledResult","attemptImportUncompiled","attemptImport","configPath","resolveJSFilepath","rootDir","filePath","undefined","importedModule","maybeAddFileProtocol","preferDefault","compiledConfigPath","path","join","COMPILED_CACHE_DIR","error","report","panic","id","context","message","uncompiledConfigPath","testImportError","Error","tsConfig","nearMatch","checkTsAndNearMatch","isTSX","endsWith","isInSrcDir","warn","files","fs","readdir","file","name","ext","parse","isNearMatch"],"sources":["../../src/bootstrap/get-config-file.ts"],"sourcesContent":["import fs from \"fs-extra\"\nimport { testImportError } from \"../utils/test-import-error\"\nimport report from \"gatsby-cli/lib/reporter\"\nimport path from \"path\"\nimport { COMPILED_CACHE_DIR } from \"../utils/parcel/compile-gatsby-files\"\nimport { isNearMatch } from \"../utils/is-near-match\"\nimport { resolveJSFilepath, maybeAddFileProtocol } from \"./resolve-js-file-path\"\nimport { preferDefault } from \"./prefer-default\"\n\nexport async function getConfigFile(\n siteDirectory: string,\n configName: string,\n distance: number = 3\n): Promise<{\n configModule: any\n configFilePath: string\n}> {\n const compiledResult = await attemptImportCompiled(siteDirectory, configName)\n\n if (compiledResult?.configModule && compiledResult?.configFilePath) {\n return compiledResult\n }\n\n const uncompiledResult = await attemptImportUncompiled(\n siteDirectory,\n configName,\n distance\n )\n\n return uncompiledResult || {}\n}\n\nasync function attemptImport(\n siteDirectory: string,\n configPath: string\n): Promise<{\n configModule: unknown\n configFilePath: string\n}> {\n const configFilePath = await resolveJSFilepath({\n rootDir: siteDirectory,\n filePath: configPath,\n })\n\n // The file does not exist, no sense trying to import it\n if (!configFilePath) {\n return { configFilePath: ``, configModule: undefined }\n }\n\n const importedModule = await import(maybeAddFileProtocol(configFilePath))\n const configModule = preferDefault(importedModule)\n\n return { configFilePath, configModule }\n}\n\nasync function attemptImportCompiled(\n siteDirectory: string,\n configName: string\n): Promise<{\n configModule: unknown\n configFilePath: string\n}> {\n let compiledResult\n\n try {\n const compiledConfigPath = path.join(\n `${siteDirectory}/${COMPILED_CACHE_DIR}`,\n configName\n )\n compiledResult = await attemptImport(siteDirectory, compiledConfigPath)\n } catch (error) {\n report.panic({\n id: `11902`,\n error: error,\n context: {\n configName,\n message: error.message,\n },\n })\n }\n\n return compiledResult\n}\n\nasync function attemptImportUncompiled(\n siteDirectory: string,\n configName: string,\n distance: number\n): Promise<{\n configModule: unknown\n configFilePath: string\n}> {\n let uncompiledResult\n\n const uncompiledConfigPath = path.join(siteDirectory, configName)\n\n try {\n uncompiledResult = await attemptImport(siteDirectory, uncompiledConfigPath)\n } catch (error) {\n if (!testImportError(uncompiledConfigPath, error)) {\n report.panic({\n id: `10123`,\n error,\n context: {\n configName,\n message: error.message,\n },\n })\n }\n }\n\n if (uncompiledResult?.configFilePath) {\n return uncompiledResult\n }\n\n const error = new Error(`Cannot find package '${uncompiledConfigPath}'`)\n\n const { tsConfig, nearMatch } = await checkTsAndNearMatch(\n siteDirectory,\n configName,\n distance\n )\n\n // gatsby-config.ts exists but compiled gatsby-config.js does not\n if (tsConfig) {\n report.panic({\n id: `10127`,\n error,\n context: {\n configName,\n },\n })\n }\n\n // gatsby-config is misnamed\n if (nearMatch) {\n const isTSX = nearMatch.endsWith(`.tsx`)\n report.panic({\n id: `10124`,\n error,\n context: {\n configName,\n nearMatch,\n isTSX,\n },\n })\n }\n\n // gatsby-config is incorrectly located in src directory\n const isInSrcDir = await resolveJSFilepath({\n rootDir: siteDirectory,\n filePath: path.join(siteDirectory, `src`, configName),\n warn: false,\n })\n\n if (isInSrcDir) {\n report.panic({\n id: `10125`,\n context: {\n configName,\n },\n })\n }\n\n return uncompiledResult\n}\n\nasync function checkTsAndNearMatch(\n siteDirectory: string,\n configName: string,\n distance: number\n): Promise<{\n tsConfig: boolean\n nearMatch: string\n}> {\n const files = await fs.readdir(siteDirectory)\n\n let tsConfig = false\n let nearMatch = ``\n\n for (const file of files) {\n if (tsConfig || nearMatch) {\n break\n }\n\n const { name, ext } = path.parse(file)\n\n if (name === configName && ext === `.ts`) {\n tsConfig = true\n break\n }\n\n if (isNearMatch(name, configName, distance)) {\n nearMatch = file\n }\n }\n\n return {\n tsConfig,\n nearMatch,\n }\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAEO,eAAeA,aAAf,CACLC,aADK,EAELC,UAFK,EAGLC,QAAgB,GAAG,CAHd,EAOJ;EACD,MAAMC,cAAc,GAAG,MAAMC,qBAAqB,CAACJ,aAAD,EAAgBC,UAAhB,CAAlD;;EAEA,IAAIE,cAAc,SAAd,IAAAA,cAAc,WAAd,IAAAA,cAAc,CAAEE,YAAhB,IAAgCF,cAAhC,aAAgCA,cAAhC,eAAgCA,cAAc,CAAEG,cAApD,EAAoE;IAClE,OAAOH,cAAP;EACD;;EAED,MAAMI,gBAAgB,GAAG,MAAMC,uBAAuB,CACpDR,aADoD,EAEpDC,UAFoD,EAGpDC,QAHoD,CAAtD;EAMA,OAAOK,gBAAgB,IAAI,EAA3B;AACD;;AAED,eAAeE,aAAf,CACET,aADF,EAEEU,UAFF,EAMG;EACD,MAAMJ,cAAc,GAAG,MAAM,IAAAK,oCAAA,EAAkB;IAC7CC,OAAO,EAA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AAP;AACD;;AAED,eAAe0B,mBAAf,CACEjC,aADF,EAEEC,UAFF,EAGEC,QAHF,EAOG;EACD,MAAMoC,KAAK,GAAG,MAAMC,gBAAA,CAAGC,OAAH,CAAWxC,aAAX,CAApB;EAEA,IAAI+B,QAAQ,GAAG,KAAf;EACA,IAAIC,SAAS,GAAI,EAAjB;;EAEA,KAAK,MAAMS,IAAX,IAAmBH,KAAnB,EAA0B;IACxB,IAAIP,QAAQ,IAAIC,SAAhB,EAA2B;MACzB;IACD;;IAED,MAAM;MAAEU,IAAF;MAAQC;IAAR,IAAgBxB,aAAA,CAAKyB,KAAL,CAAWH,IAAX,CAAtB;;IAEA,IAAIC,IAAI,KAAKzC,UAAT,IAAuB0C,GAAG,KAAM,KAApC,EAA0C;MACxCZ,QAAQ,GAAG,IAAX;MACA;IACD;;IAED,IAAI,IAAAc,wBAAA,EAAYH,IAAZ,EAAkBzC,UAAlB,EAA8BC,QAA9B,CAAJ,EAA6C;MAC3C8B,SAAS,GAAGS,IAAZ;IACD;EACF;;EAED,OAAO;IACLV,QADK;IAELC;EAFK,CAAP;AAID"}
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* On Windows, the file protocol is required for the path to be resolved correctly.
|
|
3
|
+
* On other platforms, the file protocol is not required, but supported, so we want to just always use it.
|
|
4
|
+
* Except jest doesn't work with that and in that environment we never add the file protocol.
|
|
5
|
+
*/
|
|
6
|
+
export declare const maybeAddFileProtocol: (module: string) => string;
|
|
1
7
|
/**
|
|
2
8
|
* Figure out if the file path is .js or .mjs without relying on the fs module, and return the file path if it exists.
|
|
3
9
|
*/
|
|
@@ -3,15 +3,27 @@
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
5
|
exports.__esModule = true;
|
|
6
|
+
exports.maybeAddFileProtocol = void 0;
|
|
6
7
|
exports.resolveJSFilepath = resolveJSFilepath;
|
|
7
8
|
|
|
8
9
|
var _path = _interopRequireDefault(require("path"));
|
|
9
10
|
|
|
11
|
+
var _url = require("url");
|
|
12
|
+
|
|
10
13
|
var _reporter = _interopRequireDefault(require("gatsby-cli/lib/reporter"));
|
|
11
14
|
|
|
15
|
+
/**
|
|
16
|
+
* On Windows, the file protocol is required for the path to be resolved correctly.
|
|
17
|
+
* On other platforms, the file protocol is not required, but supported, so we want to just always use it.
|
|
18
|
+
* Except jest doesn't work with that and in that environment we never add the file protocol.
|
|
19
|
+
*/
|
|
20
|
+
const maybeAddFileProtocol = process.env.JEST_WORKER_ID ? module => module : module => (0, _url.pathToFileURL)(module).href;
|
|
12
21
|
/**
|
|
13
22
|
* Figure out if the file path is .js or .mjs without relying on the fs module, and return the file path if it exists.
|
|
14
23
|
*/
|
|
24
|
+
|
|
25
|
+
exports.maybeAddFileProtocol = maybeAddFileProtocol;
|
|
26
|
+
|
|
15
27
|
async function resolveJSFilepath({
|
|
16
28
|
rootDir,
|
|
17
29
|
filePath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-js-file-path.js","names":["resolveJSFilepath","rootDir","filePath","warn","filePathWithJSExtension","endsWith","filePathWithMJSExtension","require","resolve","report","path","relative","_"],"sources":["../../src/bootstrap/resolve-js-file-path.ts"],"sourcesContent":["import path from \"path\"\nimport report from \"gatsby-cli/lib/reporter\"\n\n/**\n * Figure out if the file path is .js or .mjs without relying on the fs module, and return the file path if it exists.\n */\nexport async function resolveJSFilepath({\n rootDir,\n filePath,\n warn = true,\n}: {\n rootDir: string\n filePath: string\n warn?: boolean\n}): Promise<string> {\n const filePathWithJSExtension = filePath.endsWith(`.js`)\n ? filePath\n : `${filePath}.js`\n const filePathWithMJSExtension = filePath.endsWith(`.mjs`)\n ? filePath\n : `${filePath}.mjs`\n\n // Check if both variants exist\n try {\n if (\n require.resolve(filePathWithJSExtension) &&\n require.resolve(filePathWithMJSExtension)\n ) {\n if (warn) {\n report.warn(\n `The file '${path.relative(\n rootDir,\n filePath\n )}' has both .js and .mjs variants, please use one or the other. Using .js by default.`\n )\n }\n return filePathWithJSExtension\n }\n } catch (_) {\n // Do nothing\n }\n\n // Check if .js variant exists\n try {\n if (require.resolve(filePathWithJSExtension)) {\n return filePathWithJSExtension\n }\n } catch (_) {\n // Do nothing\n }\n\n try {\n if (require.resolve(filePathWithMJSExtension)) {\n return filePathWithMJSExtension\n }\n } catch (_) {\n // Do nothing\n }\n\n return ``\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-js-file-path.js","names":["maybeAddFileProtocol","process","env","JEST_WORKER_ID","module","pathToFileURL","href","resolveJSFilepath","rootDir","filePath","warn","filePathWithJSExtension","endsWith","filePathWithMJSExtension","require","resolve","report","path","relative","_"],"sources":["../../src/bootstrap/resolve-js-file-path.ts"],"sourcesContent":["import path from \"path\"\nimport { pathToFileURL } from \"url\"\nimport report from \"gatsby-cli/lib/reporter\"\n\n/**\n * On Windows, the file protocol is required for the path to be resolved correctly.\n * On other platforms, the file protocol is not required, but supported, so we want to just always use it.\n * Except jest doesn't work with that and in that environment we never add the file protocol.\n */\nexport const maybeAddFileProtocol = process.env.JEST_WORKER_ID\n ? (module: string): string => module\n : (module: string): string => pathToFileURL(module).href\n\n/**\n * Figure out if the file path is .js or .mjs without relying on the fs module, and return the file path if it exists.\n */\nexport async function resolveJSFilepath({\n rootDir,\n filePath,\n warn = true,\n}: {\n rootDir: string\n filePath: string\n warn?: boolean\n}): Promise<string> {\n const filePathWithJSExtension = filePath.endsWith(`.js`)\n ? filePath\n : `${filePath}.js`\n const filePathWithMJSExtension = filePath.endsWith(`.mjs`)\n ? filePath\n : `${filePath}.mjs`\n\n // Check if both variants exist\n try {\n if (\n require.resolve(filePathWithJSExtension) &&\n require.resolve(filePathWithMJSExtension)\n ) {\n if (warn) {\n report.warn(\n `The file '${path.relative(\n rootDir,\n filePath\n )}' has both .js and .mjs variants, please use one or the other. Using .js by default.`\n )\n }\n return filePathWithJSExtension\n }\n } catch (_) {\n // Do nothing\n }\n\n // Check if .js variant exists\n try {\n if (require.resolve(filePathWithJSExtension)) {\n return filePathWithJSExtension\n }\n } catch (_) {\n // Do nothing\n }\n\n try {\n if (require.resolve(filePathWithMJSExtension)) {\n return filePathWithMJSExtension\n }\n } catch (_) {\n // Do nothing\n }\n\n return ``\n}\n"],"mappings":";;;;;;;;AAAA;;AACA;;AACA;;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMA,oBAAoB,GAAGC,OAAO,CAACC,GAAR,CAAYC,cAAZ,GAC/BC,MAAD,IAA4BA,MADI,GAE/BA,MAAD,IAA4B,IAAAC,kBAAA,EAAcD,MAAd,EAAsBE,IAF/C;AAIP;AACA;AACA;;;;AACO,eAAeC,iBAAf,CAAiC;EACtCC,OADsC;EAEtCC,QAFsC;EAGtCC,IAAI,GAAG;AAH+B,CAAjC,EAQa;EAClB,MAAMC,uBAAuB,GAAGF,QAAQ,CAACG,QAAT,CAAmB,KAAnB,IAC5BH,QAD4B,GAE3B,GAAEA,QAAS,KAFhB;EAGA,MAAMI,wBAAwB,GAAGJ,QAAQ,CAACG,QAAT,CAAmB,MAAnB,IAC7BH,QAD6B,GAE5B,GAAEA,QAAS,MAFhB,CAJkB,CAQlB;;EACA,IAAI;IACF,IACEK,OAAO,CAACC,OAAR,CAAgBJ,uBAAhB,KACAG,OAAO,CAACC,OAAR,CAAgBF,wBAAhB,CAFF,EAGE;MACA,IAAIH,IAAJ,EAAU;QACRM,iBAAA,CAAON,IAAP,CACG,aAAYO,aAAA,CAAKC,QAAL,CACXV,OADW,EAEXC,QAFW,CAGX,sFAJJ;MAMD;;MACD,OAAOE,uBAAP;IACD;EACF,CAfD,CAeE,OAAOQ,CAAP,EAAU,CACV;EACD,CA1BiB,CA4BlB;;;EACA,IAAI;IACF,IAAIL,OAAO,CAACC,OAAR,CAAgBJ,uBAAhB,CAAJ,EAA8C;MAC5C,OAAOA,uBAAP;IACD;EACF,CAJD,CAIE,OAAOQ,CAAP,EAAU,CACV;EACD;;EAED,IAAI;IACF,IAAIL,OAAO,CAACC,OAAR,CAAgBF,wBAAhB,CAAJ,EAA+C;MAC7C,OAAOA,wBAAP;IACD;EACF,CAJD,CAIE,OAAOM,CAAP,EAAU,CACV;EACD;;EAED,OAAQ,EAAR;AACD"}
|
|
@@ -200,7 +200,7 @@ async function resolveModuleExports(modulePath, {
|
|
|
200
200
|
return [];
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
-
const rawImportedModule = await import(moduleFilePath); // If the module is cjs, the properties we care about are nested under a top-level `default` property
|
|
203
|
+
const rawImportedModule = await import((0, _resolveJsFilePath.maybeAddFileProtocol)(moduleFilePath)); // If the module is cjs, the properties we care about are nested under a top-level `default` property
|
|
204
204
|
|
|
205
205
|
const importedModule = (0, _preferDefault.preferDefault)(rawImportedModule);
|
|
206
206
|
return Object.keys(importedModule).filter(exportName => exportName !== `__esModule`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-module-exports.js","names":["staticallyAnalyzeExports","modulePath","resolver","resolveModule","absPath","exportNames","err","code","fs","readFileSync","ast","babelParseToAst","SyntaxError","codeFrame","codeFrameColumns","start","loc","highlightCode","report","panic","message","isCommonJS","isES6","traverse","ImportDeclaration","ExportNamedDeclaration","astPath","declaration","node","type","declarations","id","push","name","ExportSpecifier","exp","exported","exportName","ExportDefaultDeclaration","t","isIdentifier","isArrowFunctionExpression","isFunctionDeclaration","AssignmentExpression","nodeLeft","left","isMemberExpression","property","object","process","env","NODE_ENV","resolveModuleExports","mode","rootDir","cwd","moduleFilePath","resolveJSFilepath","filePath","rawImportedModule","importedModule","preferDefault","Object","keys","filter","error","testImportError"],"sources":["../../src/bootstrap/resolve-module-exports.ts"],"sourcesContent":["import * as fs from \"fs-extra\"\nimport * as t from \"@babel/types\"\nimport traverse from \"@babel/traverse\"\nimport { codeFrameColumns, SourceLocation } from \"@babel/code-frame\"\nimport report from \"gatsby-cli/lib/reporter\"\nimport { babelParseToAst } from \"../utils/babel-parse-to-ast\"\nimport { testImportError } from \"../utils/test-import-error\"\nimport { resolveModule, ModuleResolver } from \"../utils/module-resolver\"\nimport { resolveJSFilepath } from \"./resolve-js-file-path\"\nimport { preferDefault } from \"./prefer-default\"\n\nconst staticallyAnalyzeExports = (\n modulePath: string,\n resolver = resolveModule\n): Array<string> => {\n let absPath: string | undefined\n const exportNames: Array<string> = []\n\n try {\n absPath = resolver(modulePath) as string\n } catch (err) {\n return exportNames // doesn't exist\n }\n const code = fs.readFileSync(absPath, `utf8`) // get file contents\n\n let ast\n try {\n ast = babelParseToAst(code, absPath)\n } catch (err) {\n if (err instanceof SyntaxError) {\n // Pretty print syntax errors\n const codeFrame = codeFrameColumns(\n code,\n {\n start: (err as unknown as { loc: SourceLocation[\"start\"] }).loc,\n },\n {\n highlightCode: true,\n }\n )\n\n report.panic(\n `Syntax error in \"${absPath}\":\\n${err.message}\\n${codeFrame}`\n )\n } else {\n // if it's not syntax error, just throw it\n throw err\n }\n }\n\n let isCommonJS = false\n let isES6 = false\n\n // extract names of exports from file\n traverse(ast, {\n // Check if the file is using ES6 imports\n ImportDeclaration: function ImportDeclaration() {\n isES6 = true\n },\n\n ExportNamedDeclaration: function ExportNamedDeclaration(astPath) {\n const declaration = astPath.node.declaration\n\n // get foo from `export const foo = bar`\n if (\n declaration?.type === `VariableDeclaration` &&\n declaration.declarations[0]?.id.type === `Identifier`\n ) {\n isES6 = true\n exportNames.push(declaration.declarations[0].id.name)\n }\n\n // get foo from `export function foo()`\n if (\n declaration?.type === `FunctionDeclaration` &&\n declaration.id?.type === `Identifier`\n ) {\n isES6 = true\n exportNames.push(declaration.id.name)\n }\n },\n\n // get foo from `export { foo } from 'bar'`\n // get foo from `export { foo }`\n ExportSpecifier: function ExportSpecifier(astPath) {\n isES6 = true\n const exp = astPath?.node?.exported\n if (!exp) {\n return\n }\n if (exp.type === `Identifier`) {\n const exportName = exp.name\n if (exportName) {\n exportNames.push(exportName)\n }\n }\n },\n\n // export default () => {}\n // export default function() {}\n // export default function foo() {}\n // const foo = () => {}; export default foo\n ExportDefaultDeclaration: function ExportDefaultDeclaration(astPath) {\n const declaration = astPath.node.declaration\n if (\n !t.isIdentifier(declaration) &&\n !t.isArrowFunctionExpression(declaration) &&\n !t.isFunctionDeclaration(declaration)\n ) {\n return\n }\n\n let name = ``\n if (t.isIdentifier(declaration)) {\n name = declaration.name\n } else if (t.isFunctionDeclaration(declaration) && declaration.id) {\n name = declaration.id.name\n }\n\n const exportName = `export default${name ? ` ${name}` : ``}`\n isES6 = true\n exportNames.push(exportName)\n },\n\n AssignmentExpression: function AssignmentExpression(astPath) {\n const nodeLeft = astPath.node.left\n\n if (!t.isMemberExpression(nodeLeft)) {\n return\n }\n\n // ignore marker property `__esModule`\n if (\n t.isIdentifier(nodeLeft.property) &&\n nodeLeft.property.name === `__esModule`\n ) {\n return\n }\n\n // get foo from `exports.foo = bar`\n if (\n t.isIdentifier(nodeLeft.object) &&\n nodeLeft.object.name === `exports`\n ) {\n isCommonJS = true\n exportNames.push((nodeLeft.property as t.Identifier).name)\n }\n\n // get foo from `module.exports.foo = bar`\n if (t.isMemberExpression(nodeLeft.object)) {\n const exp: t.MemberExpression = nodeLeft.object\n\n if (\n t.isIdentifier(exp.object) &&\n t.isIdentifier(exp.property) &&\n exp.object.name === `module` &&\n exp.property.name === `exports`\n ) {\n isCommonJS = true\n exportNames.push((nodeLeft.property as t.Identifier).name)\n }\n }\n },\n })\n\n if (isES6 && isCommonJS && process.env.NODE_ENV !== `test`) {\n report.panic(\n `This plugin file is using both CommonJS and ES6 module systems together which we don't support.\nYou'll need to edit the file to use just one or the other.\n\nplugin: ${modulePath}.js\n\nThis didn't cause a problem in Gatsby v1 so you might want to review the migration doc for this:\nhttps://gatsby.dev/no-mixed-modules\n `\n )\n }\n return exportNames\n}\n\ninterface IResolveModuleExportsOptions {\n mode?: `analysis` | `import`\n resolver?: ModuleResolver\n rootDir?: string\n}\n\n/**\n * Given a path to a module, return an array of the module's exports.\n *\n * It can run in two modes:\n * 1. `analysis` mode gets exports via static analysis by traversing the file's AST with babel\n * 2. `import` mode gets exports by directly importing the module and accessing its properties\n *\n * At the time of writing, analysis mode is used for files that can be jsx (e.g. gatsby-browser, gatsby-ssr)\n * and import mode is used for files that can be js or mjs.\n *\n * Returns [] for invalid paths and modules without exports.\n */\nexport async function resolveModuleExports(\n modulePath: string,\n {\n mode = `analysis`,\n resolver = resolveModule,\n rootDir = process.cwd(),\n }: IResolveModuleExportsOptions = {}\n): Promise<Array<string>> {\n if (mode === `import`) {\n try {\n const moduleFilePath = await resolveJSFilepath({\n rootDir,\n filePath: modulePath,\n })\n\n if (!moduleFilePath) {\n return []\n }\n\n const rawImportedModule = await import(moduleFilePath)\n\n // If the module is cjs, the properties we care about are nested under a top-level `default` property\n const importedModule = preferDefault(rawImportedModule)\n\n return Object.keys(importedModule).filter(\n exportName => exportName !== `__esModule`\n )\n } catch (error) {\n if (!testImportError(modulePath, error)) {\n // if module exists, but requiring it cause errors,\n // show the error to the user and terminate build\n report.panic(`Error in \"${modulePath}\":`, error)\n }\n }\n } else {\n return staticallyAnalyzeExports(modulePath, resolver)\n }\n\n return []\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,wBAAwB,GAAG,CAC/BC,UAD+B,EAE/BC,QAAQ,GAAGC,6BAFoB,KAGb;EAClB,IAAIC,OAAJ;EACA,MAAMC,WAA0B,GAAG,EAAnC;;EAEA,IAAI;IACFD,OAAO,GAAGF,QAAQ,CAACD,UAAD,CAAlB;EACD,CAFD,CAEE,OAAOK,GAAP,EAAY;IACZ,OAAOD,WAAP,CADY,CACO;EACpB;;EACD,MAAME,IAAI,GAAGC,EAAE,CAACC,YAAH,CAAgBL,OAAhB,EAA0B,MAA1B,CAAb,CATkB,CAS4B;;EAE9C,IAAIM,GAAJ;;EACA,IAAI;IACFA,GAAG,GAAG,IAAAC,gCAAA,EAAgBJ,IAAh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AYC,QAAZ,KAA0B,MAArD,EAA4D;IAC1DjC,iBAAA,CAAOC,KAAP,CACG;AACP;AACA;AACA,UAAUlB,UAAW;AACrB;AACA;AACA;AACA,OARI;EAUD;;EACD,OAAOI,WAAP;AACD,CAvKD;;AA+KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,eAAe+C,oBAAf,CACLnD,UADK,EAEL;EACEoD,IAAI,GAAI,UADV;EAEEnD,QAAQ,GAAGC,6BAFb;EAGEmD,OAAO,GAAGL,OAAO,CAACM,GAAR;AAHZ,IAIkC,EAN7B,EAOmB;EACxB,IAAIF,IAAI,KAAM,QAAd,EAAuB;IACrB,IAAI;MACF,MAAMG,cAAc,GAAG,MAAM,IAAAC,oCAAA,EAAkB;QAC7CH,OAD6C;QAE7CI,QAAQ,EAAEzD;MAFmC,CAAlB,CAA7B;;MAKA,IAAI,CAACuD,cAAL,EAAqB;QACnB,OAAO,EAAP;MACD;;MAED,MAAMG,iBAAiB,GAAG,MAAM,OAAOH,cAAP,CAAhC,CAVE,CAYF;;MACA,MAAMI,cAAc,GAAG,IAAAC,4BAAA,EAAcF,iBAAd,CAAvB;MAEA,OAAOG,MAAM,CAACC,IAAP,CAAYH,cAAZ,EAA4BI,MAA5B,CACL3B,UAAU,IAAIA,UAAU,KAAM,YADzB,CAAP;IAGD,CAlBD,CAkBE,OAAO4B,KAAP,EAAc;MACd,IAAI,CAAC,IAAAC,gCAAA,EAAgBjE,UAAhB,EAA4BgE,KAA5B,CAAL,EAAyC;QACvC;QACA;QACA/C,iBAAA,CAAOC,KAAP,CAAc,aAAYlB,UAAW,IAArC,EAA0CgE,KAA1C;MACD;IACF;EACF,CA1BD,MA0BO;IACL,OAAOjE,wBAAwB,CAACC,UAAD,EAAaC,QAAb,CAA/B;EACD;;EAED,OAAO,EAAP;AACD"}
|
|
1
|
+
{"version":3,"file":"resolve-module-exports.js","names":["staticallyAnalyzeExports","modulePath","resolver","resolveModule","absPath","exportNames","err","code","fs","readFileSync","ast","babelParseToAst","SyntaxError","codeFrame","codeFrameColumns","start","loc","highlightCode","report","panic","message","isCommonJS","isES6","traverse","ImportDeclaration","ExportNamedDeclaration","astPath","declaration","node","type","declarations","id","push","name","ExportSpecifier","exp","exported","exportName","ExportDefaultDeclaration","t","isIdentifier","isArrowFunctionExpression","isFunctionDeclaration","AssignmentExpression","nodeLeft","left","isMemberExpression","property","object","process","env","NODE_ENV","resolveModuleExports","mode","rootDir","cwd","moduleFilePath","resolveJSFilepath","filePath","rawImportedModule","maybeAddFileProtocol","importedModule","preferDefault","Object","keys","filter","error","testImportError"],"sources":["../../src/bootstrap/resolve-module-exports.ts"],"sourcesContent":["import * as fs from \"fs-extra\"\nimport * as t from \"@babel/types\"\nimport traverse from \"@babel/traverse\"\nimport { codeFrameColumns, SourceLocation } from \"@babel/code-frame\"\nimport report from \"gatsby-cli/lib/reporter\"\nimport { babelParseToAst } from \"../utils/babel-parse-to-ast\"\nimport { testImportError } from \"../utils/test-import-error\"\nimport { resolveModule, ModuleResolver } from \"../utils/module-resolver\"\nimport { maybeAddFileProtocol, resolveJSFilepath } from \"./resolve-js-file-path\"\nimport { preferDefault } from \"./prefer-default\"\n\nconst staticallyAnalyzeExports = (\n modulePath: string,\n resolver = resolveModule\n): Array<string> => {\n let absPath: string | undefined\n const exportNames: Array<string> = []\n\n try {\n absPath = resolver(modulePath) as string\n } catch (err) {\n return exportNames // doesn't exist\n }\n const code = fs.readFileSync(absPath, `utf8`) // get file contents\n\n let ast\n try {\n ast = babelParseToAst(code, absPath)\n } catch (err) {\n if (err instanceof SyntaxError) {\n // Pretty print syntax errors\n const codeFrame = codeFrameColumns(\n code,\n {\n start: (err as unknown as { loc: SourceLocation[\"start\"] }).loc,\n },\n {\n highlightCode: true,\n }\n )\n\n report.panic(\n `Syntax error in \"${absPath}\":\\n${err.message}\\n${codeFrame}`\n )\n } else {\n // if it's not syntax error, just throw it\n throw err\n }\n }\n\n let isCommonJS = false\n let isES6 = false\n\n // extract names of exports from file\n traverse(ast, {\n // Check if the file is using ES6 imports\n ImportDeclaration: function ImportDeclaration() {\n isES6 = true\n },\n\n ExportNamedDeclaration: function ExportNamedDeclaration(astPath) {\n const declaration = astPath.node.declaration\n\n // get foo from `export const foo = bar`\n if (\n declaration?.type === `VariableDeclaration` &&\n declaration.declarations[0]?.id.type === `Identifier`\n ) {\n isES6 = true\n exportNames.push(declaration.declarations[0].id.name)\n }\n\n // get foo from `export function foo()`\n if (\n declaration?.type === `FunctionDeclaration` &&\n declaration.id?.type === `Identifier`\n ) {\n isES6 = true\n exportNames.push(declaration.id.name)\n }\n },\n\n // get foo from `export { foo } from 'bar'`\n // get foo from `export { foo }`\n ExportSpecifier: function ExportSpecifier(astPath) {\n isES6 = true\n const exp = astPath?.node?.exported\n if (!exp) {\n return\n }\n if (exp.type === `Identifier`) {\n const exportName = exp.name\n if (exportName) {\n exportNames.push(exportName)\n }\n }\n },\n\n // export default () => {}\n // export default function() {}\n // export default function foo() {}\n // const foo = () => {}; export default foo\n ExportDefaultDeclaration: function ExportDefaultDeclaration(astPath) {\n const declaration = astPath.node.declaration\n if (\n !t.isIdentifier(declaration) &&\n !t.isArrowFunctionExpression(declaration) &&\n !t.isFunctionDeclaration(declaration)\n ) {\n return\n }\n\n let name = ``\n if (t.isIdentifier(declaration)) {\n name = declaration.name\n } else if (t.isFunctionDeclaration(declaration) && declaration.id) {\n name = declaration.id.name\n }\n\n const exportName = `export default${name ? ` ${name}` : ``}`\n isES6 = true\n exportNames.push(exportName)\n },\n\n AssignmentExpression: function AssignmentExpression(astPath) {\n const nodeLeft = astPath.node.left\n\n if (!t.isMemberExpression(nodeLeft)) {\n return\n }\n\n // ignore marker property `__esModule`\n if (\n t.isIdentifier(nodeLeft.property) &&\n nodeLeft.property.name === `__esModule`\n ) {\n return\n }\n\n // get foo from `exports.foo = bar`\n if (\n t.isIdentifier(nodeLeft.object) &&\n nodeLeft.object.name === `exports`\n ) {\n isCommonJS = true\n exportNames.push((nodeLeft.property as t.Identifier).name)\n }\n\n // get foo from `module.exports.foo = bar`\n if (t.isMemberExpression(nodeLeft.object)) {\n const exp: t.MemberExpression = nodeLeft.object\n\n if (\n t.isIdentifier(exp.object) &&\n t.isIdentifier(exp.property) &&\n exp.object.name === `module` &&\n exp.property.name === `exports`\n ) {\n isCommonJS = true\n exportNames.push((nodeLeft.property as t.Identifier).name)\n }\n }\n },\n })\n\n if (isES6 && isCommonJS && process.env.NODE_ENV !== `test`) {\n report.panic(\n `This plugin file is using both CommonJS and ES6 module systems together which we don't support.\nYou'll need to edit the file to use just one or the other.\n\nplugin: ${modulePath}.js\n\nThis didn't cause a problem in Gatsby v1 so you might want to review the migration doc for this:\nhttps://gatsby.dev/no-mixed-modules\n `\n )\n }\n return exportNames\n}\n\ninterface IResolveModuleExportsOptions {\n mode?: `analysis` | `import`\n resolver?: ModuleResolver\n rootDir?: string\n}\n\n/**\n * Given a path to a module, return an array of the module's exports.\n *\n * It can run in two modes:\n * 1. `analysis` mode gets exports via static analysis by traversing the file's AST with babel\n * 2. `import` mode gets exports by directly importing the module and accessing its properties\n *\n * At the time of writing, analysis mode is used for files that can be jsx (e.g. gatsby-browser, gatsby-ssr)\n * and import mode is used for files that can be js or mjs.\n *\n * Returns [] for invalid paths and modules without exports.\n */\nexport async function resolveModuleExports(\n modulePath: string,\n {\n mode = `analysis`,\n resolver = resolveModule,\n rootDir = process.cwd(),\n }: IResolveModuleExportsOptions = {}\n): Promise<Array<string>> {\n if (mode === `import`) {\n try {\n const moduleFilePath = await resolveJSFilepath({\n rootDir,\n filePath: modulePath,\n })\n\n if (!moduleFilePath) {\n return []\n }\n\n const rawImportedModule = await import(\n maybeAddFileProtocol(moduleFilePath)\n )\n\n // If the module is cjs, the properties we care about are nested under a top-level `default` property\n const importedModule = preferDefault(rawImportedModule)\n\n return Object.keys(importedModule).filter(\n exportName => exportName !== `__esModule`\n )\n } catch (error) {\n if (!testImportError(modulePath, error)) {\n // if module exists, but requiring it cause errors,\n // show the error to the user and terminate build\n report.panic(`Error in \"${modulePath}\":`, error)\n }\n }\n } else {\n return staticallyAnalyzeExports(modulePath, resolver)\n }\n\n return []\n}\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;AAEA,MAAMA,wBAAwB,GAAG,CAC/BC,UAD+B,EAE/BC,QAAQ,GAAGC,6BAFoB,KAGb;EAClB,IAAIC,OAAJ;EACA,MAAMC,WAA0B,GAAG,EAAnC;;EAEA,IAAI;IACFD,OAAO,GAAGF,QAAQ,CAACD,UAAD,CAAlB;EACD,CAFD,CAEE,OAAOK,GAAP,EAAY;IACZ,OAAOD,WAAP,CADY,CACO;EACpB;;EACD,MAAME,IAAI,GAAGC,EAAE,CAACC,YAAH,CAAgBL,OAAhB,EAA0B,MAA1B,CAAb,CATkB,CAS4B;;EAE9C,IAAIM,GAAJ;;EACA,IAAI;IACFA,GAAG,GAAG,IAAAC,gCAAA,EAAgBJ,IAAhB,EAAsBH,OAAtB,CAAN;EACD,CAFD,CAEE,OAAOE,GAAP,EAAY;IACZ,IAAIA,GAAG,YAAYM,WAAnB,EAAgC;MAC9B;MACA,MAAMC,SAAS,GAAG,IAAAC,2BAAA,EAChBP,IADgB,EAEhB;QACEQ,KAAK,EAAGT,GAAD,CAAqDU;MAD9D,CAFgB,EAKhB;QACEC,aAAa,EAAE;MADjB,CALgB,CAAlB;;MAUAC,iBAAA,CAAOC,KAAP,CACG,oBAAmBf,OAAQ,OAAME,GAAG,CAACc,OAAQ,KAAIP,SAAU,EAD9D;IAGD,CAfD,MAeO;MACL;MACA,MAAMP,GAAN;IACD;EACF;;EAED,IAAIe,UAAU,GAAG,KAAjB;EACA,IAAIC,KAAK,GAAG,KAAZ,CArCkB,CAuClB;;EACA,IAAAC,iBAAA,EAASb,GAAT,EAAc;IACZ;IACAc,iBAAiB,EAAE,SAASA,iBAAT,GAA6B;MAC9CF,KAAK,GAAG,IAAR;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ACD;;MAED,MAAMG,iBAAiB,GAAG,MAAM,OAC9B,IAAAC,uCAAA,EAAqBJ,cAArB,CAD8B,CAAhC,CAVE,CAcF;;MACA,MAAMK,cAAc,GAAG,IAAAC,4BAAA,EAAcH,iBAAd,CAAvB;MAEA,OAAOI,MAAM,CAACC,IAAP,CAAYH,cAAZ,EAA4BI,MAA5B,CACL5B,UAAU,IAAIA,UAAU,KAAM,YADzB,CAAP;IAGD,CApBD,CAoBE,OAAO6B,KAAP,EAAc;MACd,IAAI,CAAC,IAAAC,gCAAA,EAAgBlE,UAAhB,EAA4BiE,KAA5B,CAAL,EAAyC;QACvC;QACA;QACAhD,iBAAA,CAAOC,KAAP,CAAc,aAAYlB,UAAW,IAArC,EAA0CiE,KAA1C;MACD;IACF;EACF,CA5BD,MA4BO;IACL,OAAOlE,wBAAwB,CAACC,UAAD,EAAaC,QAAb,CAA/B;EACD;;EAED,OAAO,EAAP;AACD"}
|
|
@@ -32,7 +32,7 @@ async function importGatsbyPlugin(plugin, module) {
|
|
|
32
32
|
rootDir: process.cwd(),
|
|
33
33
|
filePath: importPluginModulePath
|
|
34
34
|
});
|
|
35
|
-
const rawPluginModule = await import(pluginFilePath); // If the module is cjs, the properties we care about are nested under a top-level `default` property
|
|
35
|
+
const rawPluginModule = await import((0, _resolveJsFilePath.maybeAddFileProtocol)(pluginFilePath)); // If the module is cjs, the properties we care about are nested under a top-level `default` property
|
|
36
36
|
|
|
37
37
|
pluginModule = (0, _preferDefault.preferDefault)(rawPluginModule);
|
|
38
38
|
pluginModuleCache.set(key, pluginModule);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-gatsby-plugin.js","names":["pluginModuleCache","Map","setGatsbyPluginCache","plugin","module","moduleObject","key","name","set","importGatsbyPlugin","pluginModule","get","importPluginModulePath","resolvedCompiledGatsbyNode","resolve","pluginFilePath","resolveJSFilepath","rootDir","process","cwd","filePath","rawPluginModule","preferDefault"],"sources":["../../src/utils/import-gatsby-plugin.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"import-gatsby-plugin.js","names":["pluginModuleCache","Map","setGatsbyPluginCache","plugin","module","moduleObject","key","name","set","importGatsbyPlugin","pluginModule","get","importPluginModulePath","resolvedCompiledGatsbyNode","resolve","pluginFilePath","resolveJSFilepath","rootDir","process","cwd","filePath","rawPluginModule","maybeAddFileProtocol","preferDefault"],"sources":["../../src/utils/import-gatsby-plugin.ts"],"sourcesContent":["import {\n resolveJSFilepath,\n maybeAddFileProtocol,\n} from \"../bootstrap/resolve-js-file-path\"\nimport { preferDefault } from \"../bootstrap/prefer-default\"\n\nconst pluginModuleCache = new Map<string, any>()\n\nexport function setGatsbyPluginCache(\n plugin: { name: string; resolve: string },\n module: string,\n moduleObject: any\n): void {\n const key = `${plugin.name}/${module}`\n pluginModuleCache.set(key, moduleObject)\n}\n\nexport async function importGatsbyPlugin(\n plugin: {\n name: string\n resolve: string\n resolvedCompiledGatsbyNode?: string\n },\n module: string\n): Promise<any> {\n const key = `${plugin.name}/${module}`\n\n let pluginModule = pluginModuleCache.get(key)\n\n if (!pluginModule) {\n let importPluginModulePath: string\n\n if (module === `gatsby-node` && plugin.resolvedCompiledGatsbyNode) {\n importPluginModulePath = plugin.resolvedCompiledGatsbyNode\n } else {\n importPluginModulePath = `${plugin.resolve}/${module}`\n }\n\n const pluginFilePath = await resolveJSFilepath({\n rootDir: process.cwd(),\n filePath: importPluginModulePath,\n })\n\n const rawPluginModule = await import(maybeAddFileProtocol(pluginFilePath))\n\n // If the module is cjs, the properties we care about are nested under a top-level `default` property\n pluginModule = preferDefault(rawPluginModule)\n\n pluginModuleCache.set(key, pluginModule)\n }\n\n return pluginModule\n}\n"],"mappings":";;;;;;AAAA;;AAIA;;AAEA,MAAMA,iBAAiB,GAAG,IAAIC,GAAJ,EAA1B;;AAEO,SAASC,oBAAT,CACLC,MADK,EAELC,MAFK,EAGLC,YAHK,EAIC;EACN,MAAMC,GAAG,GAAI,GAAEH,MAAM,CAACI,IAAK,IAAGH,MAAO,EAArC;EACAJ,iBAAiB,CAACQ,GAAlB,CAAsBF,GAAtB,EAA2BD,YAA3B;AACD;;AAEM,eAAeI,kBAAf,CACLN,MADK,EAMLC,MANK,EAOS;EACd,MAAME,GAAG,GAAI,GAAEH,MAAM,CAACI,IAAK,IAAGH,MAAO,EAArC;EAEA,IAAIM,YAAY,GAAGV,iBAAiB,CAACW,GAAlB,CAAsBL,GAAtB,CAAnB;;EAEA,IAAI,CAACI,YAAL,EAAmB;IACjB,IAAIE,sBAAJ;;IAEA,IAAIR,MAAM,KAAM,aAAZ,IAA4BD,MAAM,CAACU,0BAAvC,EAAmE;MACjED,sBAAsB,GAAGT,MAAM,CAACU,0BAAhC;IACD,CAFD,MAEO;MACLD,sBAAsB,GAAI,GAAET,MAAM,CAACW,OAAQ,IAAGV,MAAO,EAArD;IACD;;IAED,MAAMW,cAAc,GAAG,MAAM,IAAAC,oCAAA,EAAkB;MAC7CC,OAAO,EAAEC,OAAO,CAACC,GAAR,EADoC;MAE7CC,QAAQ,EAAER;IAFmC,CAAlB,CAA7B;IAKA,MAAMS,eAAe,GAAG,MAAM,OAAO,IAAAC,uCAAA,EAAqBP,cAArB,CAAP,CAA9B,CAdiB,CAgBjB;;IACAL,YAAY,GAAG,IAAAa,4BAAA,EAAcF,eAAd,CAAf;IAEArB,iBAAiB,CAACQ,GAAlB,CAAsBF,GAAtB,EAA2BI,YAA3B;EACD;;EAED,OAAOA,YAAP;AACD"}
|
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": "5.3.
|
|
4
|
+
"version": "5.3.2",
|
|
5
5
|
"author": "Kyle Mathews <mathews.kyle@gmail.com>",
|
|
6
6
|
"bin": {
|
|
7
7
|
"gatsby": "./cli.js"
|
|
@@ -277,5 +277,5 @@
|
|
|
277
277
|
"yargs": {
|
|
278
278
|
"boolean-negation": false
|
|
279
279
|
},
|
|
280
|
-
"gitHead": "
|
|
280
|
+
"gitHead": "98cbee12f2f8a303b11c338fa3f980cb6c5f5d6c"
|
|
281
281
|
}
|