Skip to content

Commit

Permalink
chore: De-Duplicate lock file (#35823)
Browse files Browse the repository at this point in the history
  • Loading branch information
LekoArts authored Jun 2, 2022
1 parent 5e6c808 commit 9fc9eb2
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 537 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ exports[`babel-plugin-remove-graphql-queries transforms exported variable querie
var _interopRequireDefault = require(\\"@babel/runtime/helpers/interopRequireDefault\\");
exports.__esModule = true;
exports.default = exports.query = void 0;
exports.query = exports.default = void 0;
var _ = _interopRequireDefault(require(\\"../../public/static/d/426988268.json\\"));
Expand Down
5 changes: 3 additions & 2 deletions packages/babel-plugin-remove-graphql-queries/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,17 @@ function getGraphQLTag(
const normalizedText: string = graphql.stripIgnoredCharacters(text)

const hash: number = murmurhash(normalizedText, 0)
const location = quasis[0].loc as SourceLocation | null

try {
const ast = graphql.parse(text)

if (ast.definitions.length === 0) {
throw new EmptyGraphQLTagError(quasis[0].loc)
throw new EmptyGraphQLTagError(location)
}
return { ast, text: normalizedText, hash, isGlobal }
} catch (err) {
throw new GraphQLSyntaxError(text, err, quasis[0].loc)
throw new GraphQLSyntaxError(text, err, location)
}
}

Expand Down
12 changes: 6 additions & 6 deletions packages/gatsby-worker/src/__tests__/integration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ describe(`gatsby-worker`, () => {
// as it's not a function
expect(exposedMethodsSingle).toMatchInlineSnapshot(`
Array [
"sync",
"async",
"pid",
"neverEnding",
"syncThrow",
"asyncThrow",
"async100ms",
"setupPingPongMessages",
"asyncThrow",
"getWasPonged",
"neverEnding",
"pid",
"setupPingPongMessages",
"sync",
"syncThrow",
]
`)
// .all and .single should have same methods
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`Resolve module exports Show meaningful error message for invalid JavaScript 1`] = `
Array [
"Syntax error in \\"/bad/file\\":
'Const declarations' require an initialization value. (1:13)
Missing initializer in const declaration. (1:13)
> 1 | const exports.blah = () = }}}
| ^",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ Array [
"id": "",
"name": "functions",
"nodeAPIs": Array [
"onPreBootstrap",
"onCreateDevServer",
"onPreBootstrap",
],
"pluginOptions": Object {
"plugins": Array [],
Expand Down Expand Up @@ -420,8 +420,8 @@ Array [
"id": "",
"name": "functions",
"nodeAPIs": Array [
"onPreBootstrap",
"onCreateDevServer",
"onPreBootstrap",
],
"pluginOptions": Object {
"plugins": Array [],
Expand Down Expand Up @@ -782,8 +782,8 @@ Array [
"id": "",
"name": "functions",
"nodeAPIs": Array [
"onPreBootstrap",
"onCreateDevServer",
"onPreBootstrap",
],
"pluginOptions": Object {
"plugins": Array [],
Expand Down
Loading

0 comments on commit 9fc9eb2

Please sign in to comment.