@graphql-tools/graphql-tag-pluck 7.4.5 → 7.4.6
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/cjs/config.js +4 -0
- package/cjs/index.js +17 -3
- package/esm/config.js +4 -0
- package/esm/index.js +17 -3
- package/package.json +1 -1
- package/typings/index.d.cts +2 -2
- package/typings/index.d.ts +2 -2
package/cjs/config.js
CHANGED
|
@@ -33,6 +33,8 @@ function generateConfig(filePath, code, _options) {
|
|
|
33
33
|
const fileExt = (0, extname_js_1.getExtNameFromFilePath)(filePath);
|
|
34
34
|
switch (fileExt) {
|
|
35
35
|
case '.ts':
|
|
36
|
+
case '.cts':
|
|
37
|
+
case '.mts':
|
|
36
38
|
plugins.push('typescript');
|
|
37
39
|
plugins.push('importAssertions');
|
|
38
40
|
break;
|
|
@@ -44,6 +46,8 @@ function generateConfig(filePath, code, _options) {
|
|
|
44
46
|
// (unlike .tsx) and because people are seem to use it with regular file extensions
|
|
45
47
|
// (e.g. .js) see https://github.com/dotansimha/graphql-code-generator/issues/1967
|
|
46
48
|
case '.js':
|
|
49
|
+
case '.mjs':
|
|
50
|
+
case '.cjs':
|
|
47
51
|
plugins.push('jsx', ...dynamicFlowPlugins);
|
|
48
52
|
break;
|
|
49
53
|
case '.jsx':
|
package/cjs/index.js
CHANGED
|
@@ -13,7 +13,21 @@ function getDefault(module) {
|
|
|
13
13
|
return module.default || module;
|
|
14
14
|
}
|
|
15
15
|
const traverse = getDefault(traverse_1.default);
|
|
16
|
-
const supportedExtensions = [
|
|
16
|
+
const supportedExtensions = [
|
|
17
|
+
'.js',
|
|
18
|
+
'.mjs',
|
|
19
|
+
'.cjs',
|
|
20
|
+
'.jsx',
|
|
21
|
+
'.ts',
|
|
22
|
+
'.mts',
|
|
23
|
+
'.cts',
|
|
24
|
+
'.tsx',
|
|
25
|
+
'.flow',
|
|
26
|
+
'.flow.js',
|
|
27
|
+
'.flow.jsx',
|
|
28
|
+
'.vue',
|
|
29
|
+
'.svelte',
|
|
30
|
+
];
|
|
17
31
|
// tslint:disable-next-line: no-implicit-dependencies
|
|
18
32
|
function parseWithVue(vueTemplateCompiler, fileData) {
|
|
19
33
|
const { descriptor } = vueTemplateCompiler.parse(fileData);
|
|
@@ -29,7 +43,7 @@ function parseWithSvelte(svelte2tsx, fileData) {
|
|
|
29
43
|
/**
|
|
30
44
|
* Asynchronously plucks GraphQL template literals from a single file.
|
|
31
45
|
*
|
|
32
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
46
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
33
47
|
*
|
|
34
48
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
35
49
|
* @param code The contents of the file being parsed.
|
|
@@ -50,7 +64,7 @@ exports.gqlPluckFromCodeString = gqlPluckFromCodeString;
|
|
|
50
64
|
/**
|
|
51
65
|
* Synchronously plucks GraphQL template literals from a single file
|
|
52
66
|
*
|
|
53
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
67
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mjs`, `.cjs`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
54
68
|
*
|
|
55
69
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
56
70
|
* @param code The contents of the file being parsed.
|
package/esm/config.js
CHANGED
|
@@ -31,6 +31,8 @@ export default function generateConfig(filePath, code, _options) {
|
|
|
31
31
|
const fileExt = getExtNameFromFilePath(filePath);
|
|
32
32
|
switch (fileExt) {
|
|
33
33
|
case '.ts':
|
|
34
|
+
case '.cts':
|
|
35
|
+
case '.mts':
|
|
34
36
|
plugins.push('typescript');
|
|
35
37
|
plugins.push('importAssertions');
|
|
36
38
|
break;
|
|
@@ -42,6 +44,8 @@ export default function generateConfig(filePath, code, _options) {
|
|
|
42
44
|
// (unlike .tsx) and because people are seem to use it with regular file extensions
|
|
43
45
|
// (e.g. .js) see https://github.com/dotansimha/graphql-code-generator/issues/1967
|
|
44
46
|
case '.js':
|
|
47
|
+
case '.mjs':
|
|
48
|
+
case '.cjs':
|
|
45
49
|
plugins.push('jsx', ...dynamicFlowPlugins);
|
|
46
50
|
break;
|
|
47
51
|
case '.jsx':
|
package/esm/index.js
CHANGED
|
@@ -9,7 +9,21 @@ function getDefault(module) {
|
|
|
9
9
|
return module.default || module;
|
|
10
10
|
}
|
|
11
11
|
const traverse = getDefault(traversePkg);
|
|
12
|
-
const supportedExtensions = [
|
|
12
|
+
const supportedExtensions = [
|
|
13
|
+
'.js',
|
|
14
|
+
'.mjs',
|
|
15
|
+
'.cjs',
|
|
16
|
+
'.jsx',
|
|
17
|
+
'.ts',
|
|
18
|
+
'.mts',
|
|
19
|
+
'.cts',
|
|
20
|
+
'.tsx',
|
|
21
|
+
'.flow',
|
|
22
|
+
'.flow.js',
|
|
23
|
+
'.flow.jsx',
|
|
24
|
+
'.vue',
|
|
25
|
+
'.svelte',
|
|
26
|
+
];
|
|
13
27
|
// tslint:disable-next-line: no-implicit-dependencies
|
|
14
28
|
function parseWithVue(vueTemplateCompiler, fileData) {
|
|
15
29
|
const { descriptor } = vueTemplateCompiler.parse(fileData);
|
|
@@ -25,7 +39,7 @@ function parseWithSvelte(svelte2tsx, fileData) {
|
|
|
25
39
|
/**
|
|
26
40
|
* Asynchronously plucks GraphQL template literals from a single file.
|
|
27
41
|
*
|
|
28
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
42
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
29
43
|
*
|
|
30
44
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
31
45
|
* @param code The contents of the file being parsed.
|
|
@@ -45,7 +59,7 @@ export const gqlPluckFromCodeString = async (filePath, code, options = {}) => {
|
|
|
45
59
|
/**
|
|
46
60
|
* Synchronously plucks GraphQL template literals from a single file
|
|
47
61
|
*
|
|
48
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
62
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mjs`, `.cjs`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
49
63
|
*
|
|
50
64
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
51
65
|
* @param code The contents of the file being parsed.
|
package/package.json
CHANGED
package/typings/index.d.cts
CHANGED
|
@@ -104,7 +104,7 @@ export interface GraphQLTagPluckOptions {
|
|
|
104
104
|
/**
|
|
105
105
|
* Asynchronously plucks GraphQL template literals from a single file.
|
|
106
106
|
*
|
|
107
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
107
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
108
108
|
*
|
|
109
109
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
110
110
|
* @param code The contents of the file being parsed.
|
|
@@ -114,7 +114,7 @@ export declare const gqlPluckFromCodeString: (filePath: string, code: string, op
|
|
|
114
114
|
/**
|
|
115
115
|
* Synchronously plucks GraphQL template literals from a single file
|
|
116
116
|
*
|
|
117
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
117
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mjs`, `.cjs`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
118
118
|
*
|
|
119
119
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
120
120
|
* @param code The contents of the file being parsed.
|
package/typings/index.d.ts
CHANGED
|
@@ -104,7 +104,7 @@ export interface GraphQLTagPluckOptions {
|
|
|
104
104
|
/**
|
|
105
105
|
* Asynchronously plucks GraphQL template literals from a single file.
|
|
106
106
|
*
|
|
107
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
107
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
108
108
|
*
|
|
109
109
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
110
110
|
* @param code The contents of the file being parsed.
|
|
@@ -114,7 +114,7 @@ export declare const gqlPluckFromCodeString: (filePath: string, code: string, op
|
|
|
114
114
|
/**
|
|
115
115
|
* Synchronously plucks GraphQL template literals from a single file
|
|
116
116
|
*
|
|
117
|
-
* Supported file extensions include: `.js`, `.jsx`, `.ts`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
117
|
+
* Supported file extensions include: `.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mjs`, `.cjs`, `.tsx`, `.flow`, `.flow.js`, `.flow.jsx`, `.vue`, `.svelte`
|
|
118
118
|
*
|
|
119
119
|
* @param filePath Path to the file containing the code. Required to detect the file type
|
|
120
120
|
* @param code The contents of the file being parsed.
|