@atlaspack/transformer-graphql 2.14.5-canary.138 → 2.14.5-canary.139

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.
@@ -0,0 +1,3 @@
1
+ import { Transformer } from '@atlaspack/plugin';
2
+ declare const _default: Transformer<unknown>;
3
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaspack/transformer-graphql",
3
- "version": "2.14.5-canary.138+eda07caaf",
3
+ "version": "2.14.5-canary.139+d2fd84977",
4
4
  "license": "(MIT OR Apache-2.0)",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -9,16 +9,20 @@
9
9
  "type": "git",
10
10
  "url": "https://github.com/atlassian-labs/atlaspack.git"
11
11
  },
12
- "main": "lib/GraphQLTransformer.js",
13
- "source": "src/GraphQLTransformer.js",
12
+ "main": "./lib/GraphQLTransformer.js",
13
+ "source": "./src/GraphQLTransformer.ts",
14
+ "types": "./lib/GraphQLTransformer.d.ts",
14
15
  "engines": {
15
16
  "node": ">= 16.0.0"
16
17
  },
17
18
  "dependencies": {
18
- "@atlaspack/plugin": "2.14.5-canary.138+eda07caaf",
19
+ "@atlaspack/plugin": "2.14.5-canary.139+d2fd84977",
19
20
  "graphql": "^15.0.0",
20
21
  "graphql-import-macro": "^1.0.0"
21
22
  },
22
23
  "type": "commonjs",
23
- "gitHead": "eda07caafd2ebb814bbdbfd0ec12fa63124e213f"
24
- }
24
+ "scripts": {
25
+ "check-ts": "tsc --emitDeclarationOnly --rootDir src"
26
+ },
27
+ "gitHead": "d2fd849770fe6305e9c694bd97b1bd905abd9d94"
28
+ }
@@ -1,14 +1,13 @@
1
- // @flow
2
1
  import {Transformer} from '@atlaspack/plugin';
3
2
  import {parse, print, Source, stripIgnoredCharacters} from 'graphql';
4
3
  import {processDocumentImports} from 'graphql-import-macro';
5
4
 
6
- export default (new Transformer({
5
+ export default new Transformer({
7
6
  async transform({asset, options, resolve}) {
8
7
  const document = parse(new Source(await asset.getCode(), asset.filePath));
9
8
  const expandedDocument = await processDocumentImports(document, loadImport);
10
9
 
11
- async function loadImport(to, from) {
10
+ async function loadImport(to: any, from: any) {
12
11
  const filePath = await resolve(to, from);
13
12
 
14
13
  asset.invalidateOnFileChange(filePath);
@@ -27,4 +26,4 @@ export default (new Transformer({
27
26
 
28
27
  return [asset];
29
28
  },
30
- }): Transformer<mixed>);
29
+ }) as Transformer<unknown>;
package/tsconfig.json ADDED
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "../../../tsconfig.json",
3
+ "include": ["src"]
4
+ }