@powerlines/plugin-graphql 0.1.0 → 0.1.1

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,7 @@
1
+ 'use strict';Object.defineProperty(exports,'__esModule',{value:true});var cli=require('@graphql-codegen/cli'),types$1=require('@storm-software/config-tools/types'),filePathFns=require('@stryke/path/file-path-fns'),isParentPath=require('@stryke/path/is-parent-path'),joinPaths=require('@stryke/path/join-paths'),replace=require('@stryke/path/replace'),m=require('defu'),getConfigPath=require('powerlines/plugin-utils/get-config-path'),types=require('./types');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var m__default=/*#__PURE__*/_interopDefault(m);/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ var g=Object.defineProperty;var a=(n,e)=>g(n,"name",{value:e,configurable:true});const P=a((n={})=>({name:"graphql",config(){let e=n.configFile;if(!e&&(e=getConfigPath.getConfigPath(this,"codegen"),!e&&(e=getConfigPath.getConfigPath(this,"graphql-codegen"),!e)))throw new Error("No GraphQL Codegen configuration file found. Please specify a valid config file path in the Biome plugin's `configFile` options.");return {graphql:m__default.default(n,{configFile:e,silent:this.config.logLevel===null,verbose:this.config.logLevel===types$1.LogLevelLabel.DEBUG||this.config.logLevel===types$1.LogLevelLabel.TRACE,debug:this.config.mode==="development",generatedPath:joinPaths.joinPaths("{builtinPath}","graphql")})}},async configResolved(){this.dependencies.graphql="latest",this.config.graphql.generatedPath=this.config.graphql.generatedPath.replace("{builtinPath}",this.builtinsPath),this.graphql??={},this.graphql.codegen=await cli.loadContext(this.config.graphql.configFile),cli.updateContextWithCliFlags(this.graphql.codegen,{require:[],overwrite:true,project:this.config.projectRoot,...this.config.graphql,config:this.config.graphql.configFile,watch:false});},async prepare(){const e=await cli.generate({...this.graphql.codegen,cwd:joinPaths.joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot)},false);isParentPath.isParentPath(this.config.graphql.generatedPath,this.builtinsPath)?await Promise.all(e.map(async i=>this.writeBuiltin(i.content,filePathFns.findFileName(joinPaths.joinPaths(replace.replacePath(this.config.graphql.generatedPath,this.builtinsPath),i.filename),{withExtension:false}),joinPaths.joinPaths(this.config.graphql.generatedPath,i.filename)))):await Promise.all(e.map(async i=>this.fs.writeFile(joinPaths.joinPaths(this.config.graphql.generatedPath,i.filename),i.content)));}}),"plugin");var B=P;exports.default=B;exports.plugin=P;Object.keys(types).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return types[k]}})});
@@ -0,0 +1,33 @@
1
+ import { G as GraphQLPluginContext, a as GraphQLPluginOptions, P as Plugin } from '../index-BYSgwlaN.cjs';
2
+ export { c as GraphQLPluginResolvedConfig, b as GraphQLPluginUserConfig } from '../index-BYSgwlaN.cjs';
3
+ import '@graphql-codegen/cli';
4
+ import '@storm-software/build-tools/types';
5
+ import '@storm-software/config-tools/types';
6
+ import '@storm-software/config/types';
7
+ import '@stryke/types/base';
8
+ import '@stryke/types/configuration';
9
+ import '@stryke/types/file';
10
+ import 'vite';
11
+ import '@stryke/env/get-env-paths';
12
+ import '@stryke/types/package-json';
13
+ import 'jiti';
14
+ import 'oxc-parser';
15
+ import 'semver';
16
+ import 'unplugin';
17
+ import '@stryke/types/tsconfig';
18
+ import 'typescript';
19
+ import '@stryke/json/types';
20
+ import 'memfs';
21
+ import 'node:fs';
22
+ import 'unionfs';
23
+ import '@stryke/types/array';
24
+
25
+ /**
26
+ * A Powerlines plugin to integrate GraphQL for code generation.
27
+ *
28
+ * @param options - The plugin options.
29
+ * @returns A Powerlines plugin instance.
30
+ */
31
+ declare const plugin: <TContext extends GraphQLPluginContext = GraphQLPluginContext>(options?: GraphQLPluginOptions) => Plugin<TContext>;
32
+
33
+ export { GraphQLPluginContext, GraphQLPluginOptions, plugin as default, plugin };
@@ -0,0 +1,33 @@
1
+ import { G as GraphQLPluginContext, a as GraphQLPluginOptions, P as Plugin } from '../index-BYSgwlaN.js';
2
+ export { c as GraphQLPluginResolvedConfig, b as GraphQLPluginUserConfig } from '../index-BYSgwlaN.js';
3
+ import '@graphql-codegen/cli';
4
+ import '@storm-software/build-tools/types';
5
+ import '@storm-software/config-tools/types';
6
+ import '@storm-software/config/types';
7
+ import '@stryke/types/base';
8
+ import '@stryke/types/configuration';
9
+ import '@stryke/types/file';
10
+ import 'vite';
11
+ import '@stryke/env/get-env-paths';
12
+ import '@stryke/types/package-json';
13
+ import 'jiti';
14
+ import 'oxc-parser';
15
+ import 'semver';
16
+ import 'unplugin';
17
+ import '@stryke/types/tsconfig';
18
+ import 'typescript';
19
+ import '@stryke/json/types';
20
+ import 'memfs';
21
+ import 'node:fs';
22
+ import 'unionfs';
23
+ import '@stryke/types/array';
24
+
25
+ /**
26
+ * A Powerlines plugin to integrate GraphQL for code generation.
27
+ *
28
+ * @param options - The plugin options.
29
+ * @returns A Powerlines plugin instance.
30
+ */
31
+ declare const plugin: <TContext extends GraphQLPluginContext = GraphQLPluginContext>(options?: GraphQLPluginOptions) => Plugin<TContext>;
32
+
33
+ export { GraphQLPluginContext, GraphQLPluginOptions, plugin as default, plugin };
@@ -0,0 +1,7 @@
1
+ import {generate,loadContext,updateContextWithCliFlags}from'@graphql-codegen/cli';import {LogLevelLabel}from'@storm-software/config-tools/types';import {findFileName}from'@stryke/path/file-path-fns';import {isParentPath}from'@stryke/path/is-parent-path';import {joinPaths}from'@stryke/path/join-paths';import {replacePath}from'@stryke/path/replace';import m from'defu';import {getConfigPath}from'powerlines/plugin-utils/get-config-path';export*from'./types';/*****************************************
2
+ *
3
+ * ⚡ Built by Storm Software
4
+ *
5
+ *****************************************/
6
+
7
+ var g=Object.defineProperty;var a=(n,e)=>g(n,"name",{value:e,configurable:true});const P=a((n={})=>({name:"graphql",config(){let e=n.configFile;if(!e&&(e=getConfigPath(this,"codegen"),!e&&(e=getConfigPath(this,"graphql-codegen"),!e)))throw new Error("No GraphQL Codegen configuration file found. Please specify a valid config file path in the Biome plugin's `configFile` options.");return {graphql:m(n,{configFile:e,silent:this.config.logLevel===null,verbose:this.config.logLevel===LogLevelLabel.DEBUG||this.config.logLevel===LogLevelLabel.TRACE,debug:this.config.mode==="development",generatedPath:joinPaths("{builtinPath}","graphql")})}},async configResolved(){this.dependencies.graphql="latest",this.config.graphql.generatedPath=this.config.graphql.generatedPath.replace("{builtinPath}",this.builtinsPath),this.graphql??={},this.graphql.codegen=await loadContext(this.config.graphql.configFile),updateContextWithCliFlags(this.graphql.codegen,{require:[],overwrite:true,project:this.config.projectRoot,...this.config.graphql,config:this.config.graphql.configFile,watch:false});},async prepare(){const e=await generate({...this.graphql.codegen,cwd:joinPaths(this.workspaceConfig.workspaceRoot,this.config.projectRoot)},false);isParentPath(this.config.graphql.generatedPath,this.builtinsPath)?await Promise.all(e.map(async i=>this.writeBuiltin(i.content,findFileName(joinPaths(replacePath(this.config.graphql.generatedPath,this.builtinsPath),i.filename),{withExtension:false}),joinPaths(this.config.graphql.generatedPath,i.filename)))):await Promise.all(e.map(async i=>this.fs.writeFile(joinPaths(this.config.graphql.generatedPath,i.filename),i.content)));}}),"plugin");var T=P;export{T as default,P as plugin};
@@ -0,0 +1 @@
1
+ 'use strict';var plugin=require('./plugin');Object.keys(plugin).forEach(function(k){if(k!=='default'&&!Object.prototype.hasOwnProperty.call(exports,k))Object.defineProperty(exports,k,{enumerable:true,get:function(){return plugin[k]}})});
@@ -0,0 +1,22 @@
1
+ export { G as GraphQLPluginContext, a as GraphQLPluginOptions, c as GraphQLPluginResolvedConfig, b as GraphQLPluginUserConfig } from '../index-BYSgwlaN.cjs';
2
+ import '@graphql-codegen/cli';
3
+ import '@storm-software/build-tools/types';
4
+ import '@storm-software/config-tools/types';
5
+ import '@storm-software/config/types';
6
+ import '@stryke/types/base';
7
+ import '@stryke/types/configuration';
8
+ import '@stryke/types/file';
9
+ import 'vite';
10
+ import '@stryke/env/get-env-paths';
11
+ import '@stryke/types/package-json';
12
+ import 'jiti';
13
+ import 'oxc-parser';
14
+ import 'semver';
15
+ import 'unplugin';
16
+ import '@stryke/types/tsconfig';
17
+ import 'typescript';
18
+ import '@stryke/json/types';
19
+ import 'memfs';
20
+ import 'node:fs';
21
+ import 'unionfs';
22
+ import '@stryke/types/array';
@@ -0,0 +1,22 @@
1
+ export { G as GraphQLPluginContext, a as GraphQLPluginOptions, c as GraphQLPluginResolvedConfig, b as GraphQLPluginUserConfig } from '../index-BYSgwlaN.js';
2
+ import '@graphql-codegen/cli';
3
+ import '@storm-software/build-tools/types';
4
+ import '@storm-software/config-tools/types';
5
+ import '@storm-software/config/types';
6
+ import '@stryke/types/base';
7
+ import '@stryke/types/configuration';
8
+ import '@stryke/types/file';
9
+ import 'vite';
10
+ import '@stryke/env/get-env-paths';
11
+ import '@stryke/types/package-json';
12
+ import 'jiti';
13
+ import 'oxc-parser';
14
+ import 'semver';
15
+ import 'unplugin';
16
+ import '@stryke/types/tsconfig';
17
+ import 'typescript';
18
+ import '@stryke/json/types';
19
+ import 'memfs';
20
+ import 'node:fs';
21
+ import 'unionfs';
22
+ import '@stryke/types/array';
@@ -0,0 +1 @@
1
+ export*from'./plugin';
@@ -0,0 +1 @@
1
+ 'use strict';
@@ -0,0 +1,22 @@
1
+ import '@graphql-codegen/cli';
2
+ export { G as GraphQLPluginContext, a as GraphQLPluginOptions, c as GraphQLPluginResolvedConfig, b as GraphQLPluginUserConfig } from '../index-BYSgwlaN.cjs';
3
+ import '@storm-software/build-tools/types';
4
+ import '@storm-software/config-tools/types';
5
+ import '@storm-software/config/types';
6
+ import '@stryke/types/base';
7
+ import '@stryke/types/configuration';
8
+ import '@stryke/types/file';
9
+ import 'vite';
10
+ import '@stryke/env/get-env-paths';
11
+ import '@stryke/types/package-json';
12
+ import 'jiti';
13
+ import 'oxc-parser';
14
+ import 'semver';
15
+ import 'unplugin';
16
+ import '@stryke/types/tsconfig';
17
+ import 'typescript';
18
+ import '@stryke/json/types';
19
+ import 'memfs';
20
+ import 'node:fs';
21
+ import 'unionfs';
22
+ import '@stryke/types/array';
@@ -0,0 +1,22 @@
1
+ import '@graphql-codegen/cli';
2
+ export { G as GraphQLPluginContext, a as GraphQLPluginOptions, c as GraphQLPluginResolvedConfig, b as GraphQLPluginUserConfig } from '../index-BYSgwlaN.js';
3
+ import '@storm-software/build-tools/types';
4
+ import '@storm-software/config-tools/types';
5
+ import '@storm-software/config/types';
6
+ import '@stryke/types/base';
7
+ import '@stryke/types/configuration';
8
+ import '@stryke/types/file';
9
+ import 'vite';
10
+ import '@stryke/env/get-env-paths';
11
+ import '@stryke/types/package-json';
12
+ import 'jiti';
13
+ import 'oxc-parser';
14
+ import 'semver';
15
+ import 'unplugin';
16
+ import '@stryke/types/tsconfig';
17
+ import 'typescript';
18
+ import '@stryke/json/types';
19
+ import 'memfs';
20
+ import 'node:fs';
21
+ import 'unionfs';
22
+ import '@stryke/types/array';
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-graphql",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "description": "A Powerlines plugin to generate project code from GraphQL schemas.",
6
6
  "repository": {
@@ -100,19 +100,19 @@
100
100
  "keywords": ["graphql", "powerlines", "storm-software", "powerlines-plugin"],
101
101
  "dependencies": {
102
102
  "@graphql-codegen/cli": "^6.0.1",
103
- "@stryke/path": "^0.17.0",
103
+ "@stryke/path": "^0.18.5",
104
104
  "@stryke/type-checks": "^0.3.10",
105
105
  "@stryke/types": "^0.10.0",
106
106
  "defu": "^6.1.4",
107
107
  "jiti": "^2.6.1",
108
- "powerlines": "^0.14.1"
108
+ "powerlines": "^0.15.0"
109
109
  },
110
110
  "devDependencies": {
111
- "@powerlines/nx": "^0.9.5",
112
- "@powerlines/plugin-plugin": "^0.11.7",
113
111
  "@graphql-codegen/plugin-helpers": "^6.0.0",
114
- "@types/node": "^22.18.12"
112
+ "@powerlines/nx": "^0.10.0",
113
+ "@powerlines/plugin-plugin": "^0.11.8",
114
+ "@types/node": "^22.19.0"
115
115
  },
116
116
  "publishConfig": { "access": "public" },
117
- "gitHead": "284d279fb9c466a627d4506600e0d16315ec96ac"
117
+ "gitHead": "b64f9a9d53b6eb8054c361da347f6623a7ba9e45"
118
118
  }