@atlaspack/transformer-graphql 2.14.5-canary.17 → 2.14.5-canary.171
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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,158 @@
|
|
|
1
1
|
# @atlaspack/transformer-graphql
|
|
2
2
|
|
|
3
|
+
## 2.14.27
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies []:
|
|
8
|
+
- @atlaspack/plugin@2.14.27
|
|
9
|
+
|
|
10
|
+
## 2.14.26
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#742](https://github.com/atlassian-labs/atlaspack/pull/742) [`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd) Thanks [@yamadapc](https://github.com/yamadapc)! - Internal changes and bug fixes to environmentDeduplication flag
|
|
15
|
+
|
|
16
|
+
- Updated dependencies [[`ee040bb`](https://github.com/atlassian-labs/atlaspack/commit/ee040bb6428f29b57d892ddd8107e29077d08ffd)]:
|
|
17
|
+
- @atlaspack/plugin@2.14.26
|
|
18
|
+
|
|
19
|
+
## 2.14.25
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies []:
|
|
24
|
+
- @atlaspack/plugin@2.14.25
|
|
25
|
+
|
|
26
|
+
## 2.14.24
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies []:
|
|
31
|
+
- @atlaspack/plugin@2.14.24
|
|
32
|
+
|
|
33
|
+
## 2.14.23
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Updated dependencies []:
|
|
38
|
+
- @atlaspack/plugin@2.14.23
|
|
39
|
+
|
|
40
|
+
## 2.14.22
|
|
41
|
+
|
|
42
|
+
### Patch Changes
|
|
43
|
+
|
|
44
|
+
- [#720](https://github.com/atlassian-labs/atlaspack/pull/720) [`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94) Thanks [@alshdavid](https://github.com/alshdavid)! - Migrate to TypeScript
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [[`d2fd849`](https://github.com/atlassian-labs/atlaspack/commit/d2fd849770fe6305e9c694bd97b1bd905abd9d94)]:
|
|
47
|
+
- @atlaspack/plugin@2.14.22
|
|
48
|
+
|
|
49
|
+
## 2.14.21
|
|
50
|
+
|
|
51
|
+
### Patch Changes
|
|
52
|
+
|
|
53
|
+
- Updated dependencies []:
|
|
54
|
+
- @atlaspack/plugin@2.14.21
|
|
55
|
+
|
|
56
|
+
## 2.14.20
|
|
57
|
+
|
|
58
|
+
### Patch Changes
|
|
59
|
+
|
|
60
|
+
- [#702](https://github.com/atlassian-labs/atlaspack/pull/702) [`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa) Thanks [@alshdavid](https://github.com/alshdavid)! - Fixes to Flow types
|
|
61
|
+
|
|
62
|
+
- Updated dependencies [[`daaa768`](https://github.com/atlassian-labs/atlaspack/commit/daaa7688786772d7e3713b71c5bba6b89ec704aa)]:
|
|
63
|
+
- @atlaspack/plugin@2.14.20
|
|
64
|
+
|
|
65
|
+
## 2.14.19
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies []:
|
|
70
|
+
- @atlaspack/plugin@2.14.19
|
|
71
|
+
|
|
72
|
+
## 2.14.18
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies []:
|
|
77
|
+
- @atlaspack/plugin@2.14.18
|
|
78
|
+
|
|
79
|
+
## 2.14.17
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Updated dependencies []:
|
|
84
|
+
- @atlaspack/plugin@2.14.17
|
|
85
|
+
|
|
86
|
+
## 2.14.16
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies []:
|
|
91
|
+
- @atlaspack/plugin@2.14.16
|
|
92
|
+
|
|
93
|
+
## 2.14.15
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Updated dependencies []:
|
|
98
|
+
- @atlaspack/plugin@2.14.15
|
|
99
|
+
|
|
100
|
+
## 2.14.14
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies []:
|
|
105
|
+
- @atlaspack/plugin@2.14.14
|
|
106
|
+
|
|
107
|
+
## 2.14.13
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- Updated dependencies []:
|
|
112
|
+
- @atlaspack/plugin@2.14.13
|
|
113
|
+
|
|
114
|
+
## 2.14.12
|
|
115
|
+
|
|
116
|
+
### Patch Changes
|
|
117
|
+
|
|
118
|
+
- Updated dependencies []:
|
|
119
|
+
- @atlaspack/plugin@2.14.12
|
|
120
|
+
|
|
121
|
+
## 2.14.11
|
|
122
|
+
|
|
123
|
+
### Patch Changes
|
|
124
|
+
|
|
125
|
+
- Updated dependencies []:
|
|
126
|
+
- @atlaspack/plugin@2.14.11
|
|
127
|
+
|
|
128
|
+
## 2.14.10
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- Updated dependencies []:
|
|
133
|
+
- @atlaspack/plugin@2.14.10
|
|
134
|
+
|
|
135
|
+
## 2.14.9
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- Updated dependencies []:
|
|
140
|
+
- @atlaspack/plugin@2.14.9
|
|
141
|
+
|
|
142
|
+
## 2.14.8
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- Updated dependencies []:
|
|
147
|
+
- @atlaspack/plugin@2.14.8
|
|
148
|
+
|
|
149
|
+
## 2.14.7
|
|
150
|
+
|
|
151
|
+
### Patch Changes
|
|
152
|
+
|
|
153
|
+
- Updated dependencies []:
|
|
154
|
+
- @atlaspack/plugin@2.14.7
|
|
155
|
+
|
|
3
156
|
## 2.14.6
|
|
4
157
|
|
|
5
158
|
### Patch Changes
|
|
@@ -32,11 +32,12 @@ var _default = exports.default = new (_plugin().Transformer)({
|
|
|
32
32
|
resolve
|
|
33
33
|
}) {
|
|
34
34
|
const document = (0, _graphql().parse)(new (_graphql().Source)(await asset.getCode(), asset.filePath));
|
|
35
|
-
const expandedDocument = await (0, _graphqlImportMacro().processDocumentImports)(document,
|
|
35
|
+
const expandedDocument = await (0, _graphqlImportMacro().processDocumentImports)(document, loadImport);
|
|
36
|
+
async function loadImport(to, from) {
|
|
36
37
|
const filePath = await resolve(to, from);
|
|
37
38
|
asset.invalidateOnFileChange(filePath);
|
|
38
39
|
return (0, _graphql().parse)(new (_graphql().Source)(await options.inputFS.readFile(filePath, 'utf-8'), filePath));
|
|
39
|
-
}
|
|
40
|
+
}
|
|
40
41
|
const generated = asset.env.shouldOptimize ? (0, _graphql().stripIgnoredCharacters)((0, _graphql().print)(expandedDocument)) : (0, _graphql().print)(expandedDocument);
|
|
41
42
|
asset.type = 'js';
|
|
42
43
|
asset.setCode(`module.exports=${JSON.stringify(generated)};`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaspack/transformer-graphql",
|
|
3
|
-
"version": "2.14.5-canary.
|
|
3
|
+
"version": "2.14.5-canary.171+f0349a6b9",
|
|
4
4
|
"license": "(MIT OR Apache-2.0)",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,16 +9,21 @@
|
|
|
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.
|
|
12
|
+
"main": "./lib/GraphQLTransformer.js",
|
|
13
|
+
"source": "./src/GraphQLTransformer.ts",
|
|
14
|
+
"types": "./lib/types/GraphQLTransformer.d.ts",
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">= 16.0.0"
|
|
16
17
|
},
|
|
17
18
|
"dependencies": {
|
|
18
|
-
"@atlaspack/plugin": "2.14.5-canary.
|
|
19
|
+
"@atlaspack/plugin": "2.14.5-canary.171+f0349a6b9",
|
|
19
20
|
"graphql": "^15.0.0",
|
|
20
21
|
"graphql-import-macro": "^1.0.0"
|
|
21
22
|
},
|
|
22
23
|
"type": "commonjs",
|
|
23
|
-
"
|
|
24
|
+
"scripts": {
|
|
25
|
+
"check-ts": "tsc --emitDeclarationOnly --rootDir src",
|
|
26
|
+
"build:lib": "gulp build --gulpfile ../../../gulpfile.js --cwd ."
|
|
27
|
+
},
|
|
28
|
+
"gitHead": "f0349a6b9b04755088f121095ca6301a2ada3767"
|
|
24
29
|
}
|
|
@@ -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
|
|
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
|
-
})
|
|
29
|
+
}) as Transformer<unknown>;
|
package/tsconfig.json
ADDED