@isograph/babel-plugin 0.0.0-main-8fa74274 → 0.0.0-main-c938c1af

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.
@@ -9,12 +9,11 @@ const configExplorer = cosmiconfig('isograph', {
9
9
  '.json': cosmiconfig.loadJson,
10
10
  },
11
11
  });
12
-
13
- /** @type {import("cosmiconfig").Config} */
12
+ /** @type {NonNullable<import("cosmiconfig").CosmiconfigResult>} */
14
13
  let IsographConfig;
15
14
  const result = configExplorer.searchSync();
16
15
  if (result) {
17
- IsographConfig = result.config;
16
+ IsographConfig = result;
18
17
  } else {
19
18
  throw new Error(
20
19
  'No config found. Do you have a isograph.config.json file somewhere?',
package/compileTag.js CHANGED
@@ -7,7 +7,7 @@ const os = require('os');
7
7
  * @typedef {import("@babel/core")} babel
8
8
  * @param {typeof babel.types} t
9
9
  * @param {babel.NodePath<babel.types.CallExpression>} path
10
- * @param {import("cosmiconfig").Config} config
10
+ * @param {NonNullable<import("cosmiconfig").CosmiconfigResult>} config
11
11
  */
12
12
  function compileTag(t, path, config) {
13
13
  const callee = path.node.callee;
@@ -85,15 +85,15 @@ function getTypeAndField(path) {
85
85
  * @param {string} type
86
86
  * @param {string} field
87
87
  * @param {string} artifactType
88
- * @param {import("cosmiconfig").Config} config
88
+ * @param {NonNullable<import("cosmiconfig").CosmiconfigResult>} config
89
89
  */
90
90
  function compileImportStatement(t, path, type, field, artifactType, config) {
91
91
  const filename = path.state.filename;
92
92
  const folder = pathModule.dirname(filename);
93
- const cwd = path.state.cwd;
93
+ const cwd = pathModule.dirname(config.filepath);
94
94
  const artifactDirectory = pathModule.join(
95
95
  cwd,
96
- config['artifact_directory'] ?? config['project_root'],
96
+ config.config['artifact_directory'] ?? config.config['project_root'],
97
97
  );
98
98
 
99
99
  const fileToArtifactDir = pathModule.relative(folder, artifactDirectory);
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@isograph/babel-plugin",
3
3
  "description": "A Babel plugin for use with Isograph applications.",
4
4
  "homepage": "https://isograph.dev",
5
- "version": "0.0.0-main-8fa74274",
5
+ "version": "0.0.0-main-c938c1af",
6
6
  "keywords": [
7
7
  "graphql",
8
8
  "isograph",