@graphcommerce/graphql-codegen-near-operation-file 8.1.0-canary.9 → 9.0.0-canary.100
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 +186 -0
- package/dist/directive/env.js +1 -2
- package/dist/directive/injectable.js +3 -4
- package/dist/fragment-resolver.js +2 -3
- package/dist/resolve-document-imports.js +1 -2
- package/dist/utils.js +3 -4
- package/package.json +8 -8
- package/{src/directive → schema}/injectable.graphqls +3 -1
- package/src/directive/injectable.ts +2 -6
- /package/{src/directive → schema}/env.graphqls +0 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,191 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## 9.0.0-canary.100
|
4
|
+
|
5
|
+
## 9.0.0-canary.99
|
6
|
+
|
7
|
+
## 9.0.0-canary.98
|
8
|
+
|
9
|
+
## 9.0.0-canary.97
|
10
|
+
|
11
|
+
## 9.0.0-canary.96
|
12
|
+
|
13
|
+
## 9.0.0-canary.95
|
14
|
+
|
15
|
+
## 9.0.0-canary.94
|
16
|
+
|
17
|
+
## 9.0.0-canary.93
|
18
|
+
|
19
|
+
## 9.0.0-canary.92
|
20
|
+
|
21
|
+
## 9.0.0-canary.91
|
22
|
+
|
23
|
+
## 9.0.0-canary.90
|
24
|
+
|
25
|
+
## 9.0.0-canary.89
|
26
|
+
|
27
|
+
## 9.0.0-canary.88
|
28
|
+
|
29
|
+
## 9.0.0-canary.87
|
30
|
+
|
31
|
+
## 9.0.0-canary.86
|
32
|
+
|
33
|
+
## 9.0.0-canary.85
|
34
|
+
|
35
|
+
## 9.0.0-canary.84
|
36
|
+
|
37
|
+
## 9.0.0-canary.83
|
38
|
+
|
39
|
+
## 9.0.0-canary.82
|
40
|
+
|
41
|
+
## 9.0.0-canary.81
|
42
|
+
|
43
|
+
## 9.0.0-canary.80
|
44
|
+
|
45
|
+
## 9.0.0-canary.79
|
46
|
+
|
47
|
+
## 9.0.0-canary.78
|
48
|
+
|
49
|
+
## 9.0.0-canary.77
|
50
|
+
|
51
|
+
## 9.0.0-canary.76
|
52
|
+
|
53
|
+
## 9.0.0-canary.75
|
54
|
+
|
55
|
+
## 9.0.0-canary.74
|
56
|
+
|
57
|
+
## 9.0.0-canary.73
|
58
|
+
|
59
|
+
## 9.0.0-canary.72
|
60
|
+
|
61
|
+
## 9.0.0-canary.71
|
62
|
+
|
63
|
+
## 9.0.0-canary.70
|
64
|
+
|
65
|
+
## 9.0.0-canary.69
|
66
|
+
|
67
|
+
## 9.0.0-canary.68
|
68
|
+
|
69
|
+
## 9.0.0-canary.67
|
70
|
+
|
71
|
+
## 9.0.0-canary.66
|
72
|
+
|
73
|
+
## 9.0.0-canary.65
|
74
|
+
|
75
|
+
## 9.0.0-canary.64
|
76
|
+
|
77
|
+
## 9.0.0-canary.63
|
78
|
+
|
79
|
+
## 9.0.0-canary.62
|
80
|
+
|
81
|
+
## 9.0.0-canary.61
|
82
|
+
|
83
|
+
## 9.0.0-canary.60
|
84
|
+
|
85
|
+
## 9.0.0-canary.59
|
86
|
+
|
87
|
+
## 9.0.0-canary.58
|
88
|
+
|
89
|
+
## 9.0.0-canary.57
|
90
|
+
|
91
|
+
## 9.0.0-canary.56
|
92
|
+
|
93
|
+
## 9.0.0-canary.55
|
94
|
+
|
95
|
+
## 9.0.0-canary.54
|
96
|
+
|
97
|
+
## 8.1.0-canary.53
|
98
|
+
|
99
|
+
## 8.1.0-canary.52
|
100
|
+
|
101
|
+
## 8.1.0-canary.51
|
102
|
+
|
103
|
+
## 8.1.0-canary.50
|
104
|
+
|
105
|
+
## 8.1.0-canary.49
|
106
|
+
|
107
|
+
## 8.1.0-canary.48
|
108
|
+
|
109
|
+
## 8.1.0-canary.47
|
110
|
+
|
111
|
+
## 8.1.0-canary.46
|
112
|
+
|
113
|
+
## 8.1.0-canary.45
|
114
|
+
|
115
|
+
## 8.1.0-canary.44
|
116
|
+
|
117
|
+
## 8.1.0-canary.43
|
118
|
+
|
119
|
+
## 8.1.0-canary.42
|
120
|
+
|
121
|
+
## 8.1.0-canary.41
|
122
|
+
|
123
|
+
## 8.1.0-canary.40
|
124
|
+
|
125
|
+
## 8.1.0-canary.39
|
126
|
+
|
127
|
+
## 8.1.0-canary.38
|
128
|
+
|
129
|
+
## 8.1.0-canary.37
|
130
|
+
|
131
|
+
## 8.1.0-canary.36
|
132
|
+
|
133
|
+
## 8.1.0-canary.35
|
134
|
+
|
135
|
+
## 8.1.0-canary.34
|
136
|
+
|
137
|
+
## 8.1.0-canary.33
|
138
|
+
|
139
|
+
## 8.1.0-canary.32
|
140
|
+
|
141
|
+
## 8.1.0-canary.31
|
142
|
+
|
143
|
+
## 8.1.0-canary.30
|
144
|
+
|
145
|
+
## 8.1.0-canary.29
|
146
|
+
|
147
|
+
## 8.1.0-canary.28
|
148
|
+
|
149
|
+
## 8.1.0-canary.27
|
150
|
+
|
151
|
+
## 8.1.0-canary.26
|
152
|
+
|
153
|
+
## 8.1.0-canary.25
|
154
|
+
|
155
|
+
## 8.1.0-canary.24
|
156
|
+
|
157
|
+
### Patch Changes
|
158
|
+
|
159
|
+
- [#2289](https://github.com/graphcommerce-org/graphcommerce/pull/2289) [`d2a6f58`](https://github.com/graphcommerce-org/graphcommerce/commit/d2a6f58276abadb132473d4da2d7d25e0b996106) - Do not require fragments to be marked @injectable but always accept @inject directives. ([@paales](https://github.com/paales))
|
160
|
+
|
161
|
+
## 8.1.0-canary.23
|
162
|
+
|
163
|
+
## 8.1.0-canary.22
|
164
|
+
|
165
|
+
## 8.1.0-canary.21
|
166
|
+
|
167
|
+
## 8.1.0-canary.20
|
168
|
+
|
169
|
+
## 8.1.0-canary.19
|
170
|
+
|
171
|
+
## 8.1.0-canary.18
|
172
|
+
|
173
|
+
## 8.1.0-canary.17
|
174
|
+
|
175
|
+
## 8.1.0-canary.16
|
176
|
+
|
177
|
+
## 8.1.0-canary.15
|
178
|
+
|
179
|
+
## 8.1.0-canary.14
|
180
|
+
|
181
|
+
## 8.1.0-canary.13
|
182
|
+
|
183
|
+
## 8.1.0-canary.12
|
184
|
+
|
185
|
+
## 8.1.0-canary.11
|
186
|
+
|
187
|
+
## 8.1.0-canary.10
|
188
|
+
|
3
189
|
## 8.1.0-canary.9
|
4
190
|
|
5
191
|
## 8.1.0-canary.8
|
package/dist/directive/env.js
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.envDirective =
|
3
|
+
exports.envDirective = envDirective;
|
4
4
|
const graphql_1 = require("graphql");
|
5
5
|
/**
|
6
6
|
* Implements the env directive:
|
@@ -24,4 +24,3 @@ function envDirective(documentFiles) {
|
|
24
24
|
return keep;
|
25
25
|
});
|
26
26
|
}
|
27
|
-
exports.envDirective = envDirective;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.injectableDirective =
|
3
|
+
exports.injectableDirective = injectableDirective;
|
4
4
|
const graphql_1 = require("graphql");
|
5
5
|
function isFragment(document) {
|
6
6
|
let is = false;
|
@@ -97,16 +97,15 @@ function injectInjectable(injectables, injector) {
|
|
97
97
|
});
|
98
98
|
});
|
99
99
|
if (!found)
|
100
|
-
throwInjectError(injectVal, `fragment ${target}
|
100
|
+
throwInjectError(injectVal, `fragment ${target} { ... } can not be found`);
|
101
101
|
});
|
102
102
|
}
|
103
103
|
function injectableDirective(documentFiles) {
|
104
104
|
const documents = documentFiles
|
105
105
|
.map(({ document }) => document)
|
106
106
|
.filter((doc) => doc);
|
107
|
-
const injectables = documents.filter((d) => isFragment(d)
|
107
|
+
const injectables = documents.filter((d) => isFragment(d));
|
108
108
|
const injectors = documents.filter((d) => isFragment(d) && hasInjectDirective(d));
|
109
109
|
injectors.forEach((d) => injectInjectable(injectables, d));
|
110
110
|
return documentFiles;
|
111
111
|
}
|
112
|
-
exports.injectableDirective = injectableDirective;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.buildFragmentRegistry =
|
3
|
+
exports.buildFragmentRegistry = buildFragmentRegistry;
|
4
|
+
exports.default = buildFragmentResolver;
|
4
5
|
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
5
6
|
const graphql_1 = require("graphql");
|
6
7
|
const utils_1 = require("./utils");
|
@@ -77,7 +78,6 @@ ${duplicateFragmentNames.join('\n')}\n\n`);
|
|
77
78
|
}
|
78
79
|
return registry;
|
79
80
|
}
|
80
|
-
exports.buildFragmentRegistry = buildFragmentRegistry;
|
81
81
|
/** Builds a fragment "resolver" that collects `externalFragments` definitions and `fragmentImportStatements` */
|
82
82
|
function buildFragmentResolver(collectorOptions, presetOptions, schemaObject) {
|
83
83
|
const fragmentRegistry = buildFragmentRegistry(collectorOptions, presetOptions, schemaObject);
|
@@ -128,4 +128,3 @@ function buildFragmentResolver(collectorOptions, presetOptions, schemaObject) {
|
|
128
128
|
}
|
129
129
|
return resolveFragments;
|
130
130
|
}
|
131
|
-
exports.default = buildFragmentResolver;
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.resolveDocumentImports =
|
26
|
+
exports.resolveDocumentImports = resolveDocumentImports;
|
27
27
|
/* eslint-disable @typescript-eslint/no-non-null-assertion */
|
28
28
|
/* eslint-disable import/no-cycle */
|
29
29
|
const path_1 = require("path");
|
@@ -121,4 +121,3 @@ function resolveDocumentImports(presetOptions, schemaObject, importResolverOptio
|
|
121
121
|
});
|
122
122
|
return resDocuments.filter((result) => result.filename.startsWith((0, path_1.resolve)(baseDir, baseOutputDir).replace(/\\/g, '/')));
|
123
123
|
}
|
124
|
-
exports.resolveDocumentImports = resolveDocumentImports;
|
package/dist/utils.js
CHANGED
@@ -3,7 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
4
|
};
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.
|
6
|
+
exports.defineFilepathSubfolder = defineFilepathSubfolder;
|
7
|
+
exports.appendExtensionToFilePath = appendExtensionToFilePath;
|
8
|
+
exports.extractExternalFragmentsInUse = extractExternalFragmentsInUse;
|
7
9
|
/* eslint-disable import/no-cycle */
|
8
10
|
const path_1 = require("path");
|
9
11
|
const graphql_1 = require("graphql");
|
@@ -12,12 +14,10 @@ function defineFilepathSubfolder(baseFilePath, folder) {
|
|
12
14
|
const parsedPath = (0, parse_filepath_1.default)(baseFilePath);
|
13
15
|
return (0, path_1.join)(parsedPath.dir, folder, parsedPath.base).replace(/\\/g, '/');
|
14
16
|
}
|
15
|
-
exports.defineFilepathSubfolder = defineFilepathSubfolder;
|
16
17
|
function appendExtensionToFilePath(baseFilePath, extension) {
|
17
18
|
const parsedPath = (0, parse_filepath_1.default)(baseFilePath);
|
18
19
|
return (0, path_1.join)(parsedPath.dir, parsedPath.name + extension).replace(/\\/g, '/');
|
19
20
|
}
|
20
|
-
exports.appendExtensionToFilePath = appendExtensionToFilePath;
|
21
21
|
function extractExternalFragmentsInUse(documentNode, fragmentNameToFile, result = {}, level = 0) {
|
22
22
|
const ignoreList = new Set();
|
23
23
|
// First, take all fragments definition from the current file, and mark them as ignored
|
@@ -42,4 +42,3 @@ function extractExternalFragmentsInUse(documentNode, fragmentNameToFile, result
|
|
42
42
|
});
|
43
43
|
return result;
|
44
44
|
}
|
45
|
-
exports.extractExternalFragmentsInUse = extractExternalFragmentsInUse;
|
package/package.json
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
"name": "@graphcommerce/graphql-codegen-near-operation-file",
|
3
3
|
"homepage": "https://www.graphcommerce.org/",
|
4
4
|
"repository": "github:graphcommerce-org/graphcommerce",
|
5
|
-
"version": "
|
5
|
+
"version": "9.0.0-canary.100",
|
6
6
|
"sideEffects": false,
|
7
7
|
"type": "commonjs",
|
8
8
|
"main": "dist/index.js",
|
@@ -20,17 +20,17 @@
|
|
20
20
|
}
|
21
21
|
},
|
22
22
|
"dependencies": {
|
23
|
-
"@graphql-codegen/add": "5.0.
|
24
|
-
"@graphql-codegen/plugin-helpers": "5.0.
|
25
|
-
"@graphql-codegen/visitor-plugin-common": "
|
26
|
-
"@graphql-tools/utils": "^10.
|
23
|
+
"@graphql-codegen/add": "5.0.3",
|
24
|
+
"@graphql-codegen/plugin-helpers": "5.0.4",
|
25
|
+
"@graphql-codegen/visitor-plugin-common": "5.3.1",
|
26
|
+
"@graphql-tools/utils": "^10.3.2",
|
27
27
|
"@types/parse-filepath": "^1.0.2",
|
28
28
|
"parse-filepath": "^1.0.2"
|
29
29
|
},
|
30
30
|
"peerDependencies": {
|
31
|
-
"@graphcommerce/eslint-config-pwa": "^
|
32
|
-
"@graphcommerce/prettier-config-pwa": "^
|
33
|
-
"@graphcommerce/typescript-config-pwa": "^
|
31
|
+
"@graphcommerce/eslint-config-pwa": "^9.0.0-canary.100",
|
32
|
+
"@graphcommerce/prettier-config-pwa": "^9.0.0-canary.100",
|
33
|
+
"@graphcommerce/typescript-config-pwa": "^9.0.0-canary.100",
|
34
34
|
"graphql": "^16.7.1"
|
35
35
|
}
|
36
36
|
}
|
@@ -1,4 +1,6 @@
|
|
1
1
|
"""
|
2
|
+
DEPRECATED, CAN BE COMPLETELY OMITTED
|
3
|
+
|
2
4
|
Defines wheter a Fragment can be injected
|
3
5
|
|
4
6
|
```graphql
|
@@ -10,7 +12,7 @@ fragment MyInjectableFragment on Model @injectable {
|
|
10
12
|
directive @injectable on FRAGMENT_DEFINITION
|
11
13
|
|
12
14
|
"""
|
13
|
-
Defines whether a Fragment injects into
|
15
|
+
Defines whether a Fragment injects into another Fragment
|
14
16
|
|
15
17
|
```graphql
|
16
18
|
fragment MyFragment on Model @inject(into ["MyInjectableFragment"]) {
|
@@ -104,11 +104,7 @@ function injectInjectable(injectables: DocumentNode[], injector: DocumentNode) {
|
|
104
104
|
},
|
105
105
|
})
|
106
106
|
})
|
107
|
-
if (!found)
|
108
|
-
throwInjectError(
|
109
|
-
injectVal,
|
110
|
-
`fragment ${target} @injectable { ... } can not be found or isn't injectable`,
|
111
|
-
)
|
107
|
+
if (!found) throwInjectError(injectVal, `fragment ${target} { ... } can not be found`)
|
112
108
|
})
|
113
109
|
}
|
114
110
|
|
@@ -117,7 +113,7 @@ export function injectableDirective(documentFiles: Types.DocumentFile[]) {
|
|
117
113
|
.map(({ document }) => document)
|
118
114
|
.filter((doc) => doc) as DocumentNode[]
|
119
115
|
|
120
|
-
const injectables = documents.filter((d) => isFragment(d)
|
116
|
+
const injectables = documents.filter((d) => isFragment(d))
|
121
117
|
|
122
118
|
const injectors = documents.filter((d) => isFragment(d) && hasInjectDirective(d))
|
123
119
|
|
File without changes
|