@isograph/babel-plugin 0.0.0-main-c88a0561 → 0.0.0-main-f524690b

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.
@@ -15,14 +15,17 @@ const result = configExplorer.searchSync();
15
15
  if (result) {
16
16
  IsographConfig = result.config;
17
17
  } else {
18
- throw new Error('No config found. Do you have a isograph.config.json file somewhere?');
18
+ throw new Error(
19
+ 'No config found. Do you have a isograph.config.json file somewhere?',
20
+ );
19
21
  }
20
22
 
21
23
  module.exports = function BabelPluginIsograph(context) {
22
24
  const { types: t } = context;
23
25
  if (!t) {
24
26
  throw new Error(
25
- 'BabelPluginIsograph: Expected plugin context to include "types", but got:' + String(context),
27
+ 'BabelPluginIsograph: Expected plugin context to include "types", but got:' +
28
+ String(context),
26
29
  );
27
30
  }
28
31
 
package/compileTag.js CHANGED
@@ -14,19 +14,26 @@ function compileTag(t, path, config) {
14
14
  // No-op
15
15
  return false;
16
16
  } else {
17
- throw new Error("Invalid iso tag usage. Expected 'entrypoint' or 'field'.");
17
+ throw new Error(
18
+ "Invalid iso tag usage. Expected 'entrypoint' or 'field'.",
19
+ );
18
20
  }
19
21
  }
20
22
 
21
23
  return false;
22
24
  }
23
25
 
24
- const typeAndFieldRegex = new RegExp('\\s*(entrypoint|field)\\s*([^\\.\\s]+)\\.([^\\s\\(]+)', 'm');
26
+ const typeAndFieldRegex = new RegExp(
27
+ '\\s*(entrypoint|field)\\s*([^\\.\\s]+)\\.([^\\s\\(]+)',
28
+ 'm',
29
+ );
25
30
 
26
31
  function getTypeAndField(path) {
27
32
  const quasis = path.node.quasi.quasis;
28
33
  if (quasis.length !== 1) {
29
- throw new Error('BabelPluginIsograph: Substitutions are not allowed in iso fragments.');
34
+ throw new Error(
35
+ 'BabelPluginIsograph: Substitutions are not allowed in iso fragments.',
36
+ );
30
37
  }
31
38
 
32
39
  const content = path.node.quasi.quasis[0].value.raw;
@@ -52,11 +59,16 @@ function compileImportStatement(t, path, type, field, artifactType, config) {
52
59
 
53
60
  const fileToArtifactDir = pathModule.relative(folder, artifactDirectory);
54
61
  const artifactDirToArtifact = `/__isograph/${type}/${field}/${artifactType}.isograph.ts`;
55
- const fileToArtifact = pathModule.join(fileToArtifactDir, artifactDirToArtifact);
62
+ const fileToArtifact = pathModule.join(
63
+ fileToArtifactDir,
64
+ artifactDirToArtifact,
65
+ );
56
66
 
57
67
  path.replaceWith(
58
68
  t.memberExpression(
59
- t.CallExpression(t.Identifier('require'), [t.StringLiteral(fileToArtifact)]),
69
+ t.CallExpression(t.Identifier('require'), [
70
+ t.StringLiteral(fileToArtifact),
71
+ ]),
60
72
  t.Identifier('default'),
61
73
  ),
62
74
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@isograph/babel-plugin",
3
3
  "description": "A Babel plugin for use with Isograph applications.",
4
- "version": "0.0.0-main-c88a0561",
4
+ "version": "0.0.0-main-f524690b",
5
5
  "keywords": [
6
6
  "graphql",
7
7
  "isograph",