@graphql-codegen/typescript-stencil-apollo 2.3.6 → 3.0.0-alpha-20230524082546-d7e1d0a4a

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/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StencilApolloVisitor = exports.validate = exports.plugin = void 0;
4
- const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
4
+ const path_1 = require("path");
5
5
  const graphql_1 = require("graphql");
6
+ const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
6
7
  const visitor_js_1 = require("./visitor.js");
7
8
  Object.defineProperty(exports, "StencilApolloVisitor", { enumerable: true, get: function () { return visitor_js_1.StencilApolloVisitor; } });
8
- const path_1 = require("path");
9
9
  const plugin = (schema, documents, config) => {
10
10
  const allAst = (0, graphql_1.concatAST)(documents.map(v => v.document));
11
11
  const allFragments = [
@@ -21,7 +21,11 @@ const plugin = (schema, documents, config) => {
21
21
  const visitorResult = (0, plugin_helpers_1.oldVisit)(allAst, { leave: visitor });
22
22
  return {
23
23
  prepend: visitor.getImports(),
24
- content: ['', visitor.fragments, ...visitorResult.definitions.filter(t => typeof t === 'string')].join('\n'),
24
+ content: [
25
+ '',
26
+ visitor.fragments,
27
+ ...visitorResult.definitions.filter(t => typeof t === 'string'),
28
+ ].join('\n'),
25
29
  };
26
30
  };
27
31
  exports.plugin = plugin;
package/cjs/visitor.js CHANGED
@@ -2,10 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StencilApolloVisitor = void 0;
4
4
  const tslib_1 = require("tslib");
5
- const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
6
- const config_js_1 = require("./config.js");
7
5
  const auto_bind_1 = tslib_1.__importDefault(require("auto-bind"));
8
6
  const change_case_all_1 = require("change-case-all");
7
+ const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
8
+ const config_js_1 = require("./config.js");
9
9
  class StencilApolloVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor {
10
10
  constructor(schema, fragments, rawConfig) {
11
11
  super(schema, fragments, rawConfig, {
@@ -34,7 +34,8 @@ class StencilApolloVisitor extends visitor_plugin_common_1.ClientSideBaseVisitor
34
34
  _buildOperationFunctionalComponent(node, documentVariableName, operationType, operationResultType, operationVariablesTypes) {
35
35
  const operationName = this.convertName(node.name.value);
36
36
  const propsTypeName = this.convertName(operationName + 'Props');
37
- const rendererSignature = (0, change_case_all_1.pascalCase)(`${operationType}Renderer`) + `<${operationResultType}, ${operationVariablesTypes}>`;
37
+ const rendererSignature = (0, change_case_all_1.pascalCase)(`${operationType}Renderer`) +
38
+ `<${operationResultType}, ${operationVariablesTypes}>`;
38
39
  const apolloStencilComponentTag = (0, change_case_all_1.paramCase)(`Apollo${operationType}`);
39
40
  const componentName = this.convertName(`${operationName}Component`);
40
41
  const propsVar = `
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import { oldVisit } from '@graphql-codegen/plugin-helpers';
1
+ import { extname } from 'path';
2
2
  import { concatAST, Kind } from 'graphql';
3
+ import { oldVisit } from '@graphql-codegen/plugin-helpers';
3
4
  import { StencilApolloVisitor } from './visitor.js';
4
- import { extname } from 'path';
5
5
  export const plugin = (schema, documents, config) => {
6
6
  const allAst = concatAST(documents.map(v => v.document));
7
7
  const allFragments = [
@@ -17,7 +17,11 @@ export const plugin = (schema, documents, config) => {
17
17
  const visitorResult = oldVisit(allAst, { leave: visitor });
18
18
  return {
19
19
  prepend: visitor.getImports(),
20
- content: ['', visitor.fragments, ...visitorResult.definitions.filter(t => typeof t === 'string')].join('\n'),
20
+ content: [
21
+ '',
22
+ visitor.fragments,
23
+ ...visitorResult.definitions.filter(t => typeof t === 'string'),
24
+ ].join('\n'),
21
25
  };
22
26
  };
23
27
  export const validate = async (schema, documents, config, outputFile) => {
package/esm/visitor.js CHANGED
@@ -1,7 +1,7 @@
1
- import { ClientSideBaseVisitor, getConfigValue, } from '@graphql-codegen/visitor-plugin-common';
2
- import { StencilComponentType } from './config.js';
3
1
  import autoBind from 'auto-bind';
4
2
  import { paramCase, pascalCase } from 'change-case-all';
3
+ import { ClientSideBaseVisitor, getConfigValue, } from '@graphql-codegen/visitor-plugin-common';
4
+ import { StencilComponentType } from './config.js';
5
5
  export class StencilApolloVisitor extends ClientSideBaseVisitor {
6
6
  constructor(schema, fragments, rawConfig) {
7
7
  super(schema, fragments, rawConfig, {
@@ -30,7 +30,8 @@ export class StencilApolloVisitor extends ClientSideBaseVisitor {
30
30
  _buildOperationFunctionalComponent(node, documentVariableName, operationType, operationResultType, operationVariablesTypes) {
31
31
  const operationName = this.convertName(node.name.value);
32
32
  const propsTypeName = this.convertName(operationName + 'Props');
33
- const rendererSignature = pascalCase(`${operationType}Renderer`) + `<${operationResultType}, ${operationVariablesTypes}>`;
33
+ const rendererSignature = pascalCase(`${operationType}Renderer`) +
34
+ `<${operationResultType}, ${operationVariablesTypes}>`;
34
35
  const apolloStencilComponentTag = paramCase(`Apollo${operationType}`);
35
36
  const componentName = this.convertName(`${operationName}Component`);
36
37
  const propsVar = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/typescript-stencil-apollo",
3
- "version": "2.3.6",
3
+ "version": "3.0.0-alpha-20230524082546-d7e1d0a4a",
4
4
  "description": "GraphQL Code Generator plugin for generating Stencil Components based on GraphQL operations",
5
5
  "peerDependencies": {
6
6
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0",
@@ -8,18 +8,21 @@
8
8
  "stencil-apollo": "^0.1.3"
9
9
  },
10
10
  "dependencies": {
11
- "@graphql-codegen/plugin-helpers": "^2.7.2",
11
+ "@graphql-codegen/plugin-helpers": "^3.0.0",
12
12
  "@graphql-codegen/visitor-plugin-common": "2.13.1",
13
13
  "auto-bind": "~4.0.0",
14
- "change-case-all": "1.0.14",
14
+ "change-case-all": "1.0.15",
15
15
  "tslib": "~2.4.0"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
19
- "url": "https://github.com/dotansimha/graphql-code-generator.git",
19
+ "url": "https://github.com/dotansimha/graphql-code-generator-community.git",
20
20
  "directory": "packages/plugins/typescript/stencil-apollo"
21
21
  },
22
22
  "license": "MIT",
23
+ "engines": {
24
+ "node": ">= 16.0.0"
25
+ },
23
26
  "main": "cjs/index.js",
24
27
  "module": "esm/index.js",
25
28
  "typings": "typings/index.d.ts",
@@ -1,6 +1,6 @@
1
- import { PluginValidateFn, PluginFunction } from '@graphql-codegen/plugin-helpers';
2
- import { StencilApolloVisitor } from './visitor.cjs';
1
+ import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
3
2
  import { StencilApolloRawPluginConfig } from './config.cjs';
3
+ import { StencilApolloVisitor } from './visitor.cjs';
4
4
  export declare const plugin: PluginFunction<StencilApolloRawPluginConfig>;
5
5
  export declare const validate: PluginValidateFn<any>;
6
6
  export { StencilApolloVisitor };
@@ -1,6 +1,6 @@
1
- import { PluginValidateFn, PluginFunction } from '@graphql-codegen/plugin-helpers';
2
- import { StencilApolloVisitor } from './visitor.js';
1
+ import { PluginFunction, PluginValidateFn } from '@graphql-codegen/plugin-helpers';
3
2
  import { StencilApolloRawPluginConfig } from './config.js';
3
+ import { StencilApolloVisitor } from './visitor.js';
4
4
  export declare const plugin: PluginFunction<StencilApolloRawPluginConfig>;
5
5
  export declare const validate: PluginValidateFn<any>;
6
6
  export { StencilApolloVisitor };
@@ -1,6 +1,6 @@
1
- import { ClientSideBaseVisitor, ClientSideBasePluginConfig, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
2
- import { StencilComponentType, StencilApolloRawPluginConfig } from './config.cjs';
3
- import { OperationDefinitionNode, GraphQLSchema } from 'graphql';
1
+ import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
2
+ import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
3
+ import { StencilApolloRawPluginConfig, StencilComponentType } from './config.cjs';
4
4
  export interface StencilApolloPluginConfig extends ClientSideBasePluginConfig {
5
5
  componentType: StencilComponentType;
6
6
  }
@@ -1,6 +1,6 @@
1
- import { ClientSideBaseVisitor, ClientSideBasePluginConfig, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
2
- import { StencilComponentType, StencilApolloRawPluginConfig } from './config.js';
3
- import { OperationDefinitionNode, GraphQLSchema } from 'graphql';
1
+ import { GraphQLSchema, OperationDefinitionNode } from 'graphql';
2
+ import { ClientSideBasePluginConfig, ClientSideBaseVisitor, LoadedFragment } from '@graphql-codegen/visitor-plugin-common';
3
+ import { StencilApolloRawPluginConfig, StencilComponentType } from './config.js';
4
4
  export interface StencilApolloPluginConfig extends ClientSideBasePluginConfig {
5
5
  componentType: StencilComponentType;
6
6
  }