@powerlines/plugin-graphql 0.1.606 → 0.1.608
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/dist/index.cjs +53 -41
- package/dist/index.d.cts +8 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +8 -5
- package/dist/index.mjs +52 -42
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.mts +2 -2
- package/dist/types/plugin.d.cts +21 -22
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +21 -22
- package/package.json +11 -11
package/dist/index.cjs
CHANGED
|
@@ -1,65 +1,77 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
2
|
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let
|
|
4
|
-
|
|
5
|
-
let
|
|
6
|
-
let
|
|
3
|
+
let _power_plant_graphql_codegen = require("@power-plant/graphql-codegen");
|
|
4
|
+
_power_plant_graphql_codegen = require_runtime.__toESM(_power_plant_graphql_codegen, 1);
|
|
5
|
+
let _power_plant_graphql_schema_codegen = require("@power-plant/graphql-schema/codegen");
|
|
6
|
+
let _powerlines_plugin_power_plant = require("@powerlines/plugin-power-plant");
|
|
7
|
+
_powerlines_plugin_power_plant = require_runtime.__toESM(_powerlines_plugin_power_plant, 1);
|
|
8
|
+
let _stryke_fs_exists = require("@stryke/fs/exists");
|
|
7
9
|
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
8
|
-
let _stryke_path_replace = require("@stryke/path/replace");
|
|
9
10
|
let defu = require("defu");
|
|
10
11
|
defu = require_runtime.__toESM(defu, 1);
|
|
12
|
+
let graphql = require("graphql");
|
|
11
13
|
let powerlines_plugin_utils = require("powerlines/plugin-utils");
|
|
12
14
|
|
|
13
15
|
//#region src/index.ts
|
|
14
16
|
/**
|
|
15
|
-
* A Powerlines plugin to integrate GraphQL
|
|
17
|
+
* A Powerlines plugin to integrate GraphQL Codegen via Power Plant.
|
|
18
|
+
*
|
|
19
|
+
* @see https://the-guild.dev/graphql/codegen
|
|
20
|
+
* @see https://github.com/storm-software/power-plant/tree/main/packages/generators/graphql-codegen
|
|
16
21
|
*
|
|
17
22
|
* @param options - The plugin options.
|
|
18
|
-
* @returns
|
|
23
|
+
* @returns Powerlines plugin instances.
|
|
19
24
|
*/
|
|
20
25
|
const plugin = (options = {}) => {
|
|
21
|
-
|
|
26
|
+
const generatorConfig = { ..._power_plant_graphql_codegen.default };
|
|
27
|
+
return [(0, _powerlines_plugin_power_plant.default)(generatorConfig), {
|
|
22
28
|
name: "graphql",
|
|
23
29
|
config() {
|
|
24
|
-
let configFile = options.configFile;
|
|
25
|
-
if (!configFile) {
|
|
26
|
-
configFile = (0, powerlines_plugin_utils.getConfigPath)(this, "codegen");
|
|
27
|
-
if (!configFile) {
|
|
28
|
-
configFile = (0, powerlines_plugin_utils.getConfigPath)(this, "graphql-codegen");
|
|
29
|
-
if (!configFile) throw new Error(`No GraphQL Codegen configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
30
|
return { graphql: (0, defu.default)(options, {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
outputPath: (0, _stryke_path_join_paths.joinPaths)("{builtinPath}", "graphql")
|
|
31
|
+
schema: (0, _stryke_path_join_paths.joinPaths)(this.config.cwd ?? "./", this.config.root, "schema.graphql"),
|
|
32
|
+
filename: (0, _stryke_path_join_paths.joinPaths)("{builtinPath}", "graphql", "types.ts"),
|
|
33
|
+
documents: [],
|
|
34
|
+
config: {}
|
|
38
35
|
}) };
|
|
39
36
|
},
|
|
40
37
|
async configResolved() {
|
|
41
38
|
this.dependencies.graphql = "latest";
|
|
42
|
-
this.config.graphql.
|
|
43
|
-
this.graphql
|
|
44
|
-
this.graphql.
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
if (!this.config.graphql.schema) throw new Error("GraphQL schema is required. Please specify it in the plugin options or your Powerlines configuration under \"graphql.schema\".");
|
|
40
|
+
if (!this.config.graphql.plugins?.length) throw new Error("GraphQL Codegen plugins are required. Please specify them in the plugin options or your Powerlines configuration under \"graphql.plugins\".");
|
|
41
|
+
if (!this.config.graphql.pluginMap) throw new Error("GraphQL Codegen pluginMap is required. Please specify it in the plugin options or your Powerlines configuration under \"graphql.pluginMap\".");
|
|
42
|
+
let document;
|
|
43
|
+
if ((0, graphql.isSchema)(this.config.graphql.schema)) document = this.config.graphql.schema;
|
|
44
|
+
else {
|
|
45
|
+
const schemaRef = this.config.graphql.schema.toString();
|
|
46
|
+
if ((0, _stryke_fs_exists.existsSync)(schemaRef)) {
|
|
47
|
+
const sdl = await this.fs.read(schemaRef);
|
|
48
|
+
if (!sdl) throw new Error(`Failed to read GraphQL schema from file: ${schemaRef}`);
|
|
49
|
+
document = (0, graphql.buildSchema)(sdl);
|
|
50
|
+
} else {
|
|
51
|
+
const response = await this.fetch(schemaRef);
|
|
52
|
+
if (!response) throw new Error(`Failed to fetch GraphQL schema from endpoint: ${schemaRef}`);
|
|
53
|
+
document = (0, graphql.buildSchema)(await response.text());
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
this.config.graphql.filename = (0, powerlines_plugin_utils.replacePathTokens)(this, this.config.graphql.filename);
|
|
57
|
+
this.config.graphql.document = document;
|
|
58
|
+
const { schema: _schema, document: loadedDocument, filename, documents, plugins, pluginMap, config, ...rest } = this.config.graphql;
|
|
59
|
+
this.config.powerplant = {
|
|
60
|
+
...generatorConfig,
|
|
61
|
+
input: loadedDocument
|
|
62
|
+
};
|
|
63
|
+
this.powerplant.options = {
|
|
64
|
+
...rest,
|
|
65
|
+
filename,
|
|
66
|
+
documents: documents ?? [],
|
|
67
|
+
plugins,
|
|
68
|
+
pluginMap,
|
|
69
|
+
config: config ?? {},
|
|
70
|
+
schema: (0, _power_plant_graphql_schema_codegen.schemaToCodegenDocument)(loadedDocument),
|
|
71
|
+
schemaAst: loadedDocument
|
|
72
|
+
};
|
|
61
73
|
}
|
|
62
|
-
};
|
|
74
|
+
}];
|
|
63
75
|
};
|
|
64
76
|
|
|
65
77
|
//#endregion
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig } from "./types/plugin.cjs";
|
|
1
|
+
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, PowerPlantGraphQLCodegenOptions } from "./types/plugin.cjs";
|
|
2
2
|
import "./types/index.cjs";
|
|
3
3
|
import { Plugin } from "powerlines";
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -8,12 +8,15 @@ declare module "powerlines" {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* A Powerlines plugin to integrate GraphQL
|
|
11
|
+
* A Powerlines plugin to integrate GraphQL Codegen via Power Plant.
|
|
12
|
+
*
|
|
13
|
+
* @see https://the-guild.dev/graphql/codegen
|
|
14
|
+
* @see https://github.com/storm-software/power-plant/tree/main/packages/generators/graphql-codegen
|
|
12
15
|
*
|
|
13
16
|
* @param options - The plugin options.
|
|
14
|
-
* @returns
|
|
17
|
+
* @returns Powerlines plugin instances.
|
|
15
18
|
*/
|
|
16
|
-
declare const plugin: <TContext extends GraphQLPluginContext = GraphQLPluginContext>(options?: GraphQLPluginOptions) => Plugin<TContext
|
|
19
|
+
declare const plugin: <TContext extends GraphQLPluginContext = GraphQLPluginContext>(options?: GraphQLPluginOptions) => Plugin<TContext>[];
|
|
17
20
|
//#endregion
|
|
18
|
-
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, plugin as default, plugin };
|
|
21
|
+
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, type PowerPlantGraphQLCodegenOptions, plugin as default, plugin };
|
|
19
22
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;YAsCY;IACR,UAAU;;;;;;;;;;;;cAaD,SACX,iBAAiB,uBAAuB,sBAExC,UAAS,yBACR,OAAO"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig } from "./types/plugin.mjs";
|
|
1
|
+
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, PowerPlantGraphQLCodegenOptions } from "./types/plugin.mjs";
|
|
2
2
|
import "./types/index.mjs";
|
|
3
3
|
import { Plugin } from "powerlines";
|
|
4
4
|
//#region src/index.d.ts
|
|
@@ -8,12 +8,15 @@ declare module "powerlines" {
|
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
|
-
* A Powerlines plugin to integrate GraphQL
|
|
11
|
+
* A Powerlines plugin to integrate GraphQL Codegen via Power Plant.
|
|
12
|
+
*
|
|
13
|
+
* @see https://the-guild.dev/graphql/codegen
|
|
14
|
+
* @see https://github.com/storm-software/power-plant/tree/main/packages/generators/graphql-codegen
|
|
12
15
|
*
|
|
13
16
|
* @param options - The plugin options.
|
|
14
|
-
* @returns
|
|
17
|
+
* @returns Powerlines plugin instances.
|
|
15
18
|
*/
|
|
16
|
-
declare const plugin: <TContext extends GraphQLPluginContext = GraphQLPluginContext>(options?: GraphQLPluginOptions) => Plugin<TContext
|
|
19
|
+
declare const plugin: <TContext extends GraphQLPluginContext = GraphQLPluginContext>(options?: GraphQLPluginOptions) => Plugin<TContext>[];
|
|
17
20
|
//#endregion
|
|
18
|
-
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, plugin as default, plugin };
|
|
21
|
+
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, type PowerPlantGraphQLCodegenOptions, plugin as default, plugin };
|
|
19
22
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.mjs
CHANGED
|
@@ -1,62 +1,72 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import graphqlCodegenGenerator from "@power-plant/graphql-codegen";
|
|
2
|
+
import { schemaToCodegenDocument } from "@power-plant/graphql-schema/codegen";
|
|
3
|
+
import powerPlant from "@powerlines/plugin-power-plant";
|
|
4
|
+
import { existsSync } from "@stryke/fs/exists";
|
|
5
5
|
import { joinPaths } from "@stryke/path/join-paths";
|
|
6
|
-
import { replacePath } from "@stryke/path/replace";
|
|
7
6
|
import defu from "defu";
|
|
8
|
-
import {
|
|
7
|
+
import { buildSchema, isSchema } from "graphql";
|
|
8
|
+
import { replacePathTokens } from "powerlines/plugin-utils";
|
|
9
9
|
|
|
10
10
|
//#region src/index.ts
|
|
11
11
|
/**
|
|
12
|
-
* A Powerlines plugin to integrate GraphQL
|
|
12
|
+
* A Powerlines plugin to integrate GraphQL Codegen via Power Plant.
|
|
13
|
+
*
|
|
14
|
+
* @see https://the-guild.dev/graphql/codegen
|
|
15
|
+
* @see https://github.com/storm-software/power-plant/tree/main/packages/generators/graphql-codegen
|
|
13
16
|
*
|
|
14
17
|
* @param options - The plugin options.
|
|
15
|
-
* @returns
|
|
18
|
+
* @returns Powerlines plugin instances.
|
|
16
19
|
*/
|
|
17
20
|
const plugin = (options = {}) => {
|
|
18
|
-
|
|
21
|
+
const generatorConfig = { ...graphqlCodegenGenerator };
|
|
22
|
+
return [powerPlant(generatorConfig), {
|
|
19
23
|
name: "graphql",
|
|
20
24
|
config() {
|
|
21
|
-
let configFile = options.configFile;
|
|
22
|
-
if (!configFile) {
|
|
23
|
-
configFile = getConfigPath(this, "codegen");
|
|
24
|
-
if (!configFile) {
|
|
25
|
-
configFile = getConfigPath(this, "graphql-codegen");
|
|
26
|
-
if (!configFile) throw new Error(`No GraphQL Codegen configuration file found. Please specify a valid config file path in the Biome plugin's \`configFile\` options.`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
25
|
return { graphql: defu(options, {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
outputPath: joinPaths("{builtinPath}", "graphql")
|
|
26
|
+
schema: joinPaths(this.config.cwd ?? "./", this.config.root, "schema.graphql"),
|
|
27
|
+
filename: joinPaths("{builtinPath}", "graphql", "types.ts"),
|
|
28
|
+
documents: [],
|
|
29
|
+
config: {}
|
|
35
30
|
}) };
|
|
36
31
|
},
|
|
37
32
|
async configResolved() {
|
|
38
33
|
this.dependencies.graphql = "latest";
|
|
39
|
-
this.config.graphql.
|
|
40
|
-
this.graphql
|
|
41
|
-
this.graphql.
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
|
|
34
|
+
if (!this.config.graphql.schema) throw new Error("GraphQL schema is required. Please specify it in the plugin options or your Powerlines configuration under \"graphql.schema\".");
|
|
35
|
+
if (!this.config.graphql.plugins?.length) throw new Error("GraphQL Codegen plugins are required. Please specify them in the plugin options or your Powerlines configuration under \"graphql.plugins\".");
|
|
36
|
+
if (!this.config.graphql.pluginMap) throw new Error("GraphQL Codegen pluginMap is required. Please specify it in the plugin options or your Powerlines configuration under \"graphql.pluginMap\".");
|
|
37
|
+
let document;
|
|
38
|
+
if (isSchema(this.config.graphql.schema)) document = this.config.graphql.schema;
|
|
39
|
+
else {
|
|
40
|
+
const schemaRef = this.config.graphql.schema.toString();
|
|
41
|
+
if (existsSync(schemaRef)) {
|
|
42
|
+
const sdl = await this.fs.read(schemaRef);
|
|
43
|
+
if (!sdl) throw new Error(`Failed to read GraphQL schema from file: ${schemaRef}`);
|
|
44
|
+
document = buildSchema(sdl);
|
|
45
|
+
} else {
|
|
46
|
+
const response = await this.fetch(schemaRef);
|
|
47
|
+
if (!response) throw new Error(`Failed to fetch GraphQL schema from endpoint: ${schemaRef}`);
|
|
48
|
+
document = buildSchema(await response.text());
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
this.config.graphql.filename = replacePathTokens(this, this.config.graphql.filename);
|
|
52
|
+
this.config.graphql.document = document;
|
|
53
|
+
const { schema: _schema, document: loadedDocument, filename, documents, plugins, pluginMap, config, ...rest } = this.config.graphql;
|
|
54
|
+
this.config.powerplant = {
|
|
55
|
+
...generatorConfig,
|
|
56
|
+
input: loadedDocument
|
|
57
|
+
};
|
|
58
|
+
this.powerplant.options = {
|
|
59
|
+
...rest,
|
|
60
|
+
filename,
|
|
61
|
+
documents: documents ?? [],
|
|
62
|
+
plugins,
|
|
63
|
+
pluginMap,
|
|
64
|
+
config: config ?? {},
|
|
65
|
+
schema: schemaToCodegenDocument(loadedDocument),
|
|
66
|
+
schemaAst: loadedDocument
|
|
67
|
+
};
|
|
58
68
|
}
|
|
59
|
-
};
|
|
69
|
+
}];
|
|
60
70
|
};
|
|
61
71
|
|
|
62
72
|
//#endregion
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig } from "./plugin.cjs";
|
|
2
|
-
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig };
|
|
1
|
+
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, PowerPlantGraphQLCodegenOptions } from "./plugin.cjs";
|
|
2
|
+
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, type PowerPlantGraphQLCodegenOptions };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig } from "./plugin.mjs";
|
|
2
|
-
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig };
|
|
1
|
+
import { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, PowerPlantGraphQLCodegenOptions } from "./plugin.mjs";
|
|
2
|
+
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, type PowerPlantGraphQLCodegenOptions };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ResolvedConfig, UserConfig } from "powerlines";
|
|
2
|
+
import { Options, Options as PowerPlantGraphQLCodegenOptions } from "@power-plant/graphql-codegen";
|
|
3
|
+
import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
|
|
4
|
+
import { GraphQLSchema } from "graphql";
|
|
3
5
|
//#region src/types/plugin.d.ts
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Options for the GraphQL Powerlines plugin.
|
|
8
|
+
*/
|
|
9
|
+
type GraphQLPluginOptions = Partial<Omit<Options, "schema" | "schemaAst">> & {
|
|
5
10
|
/**
|
|
6
|
-
* The
|
|
11
|
+
* The GraphQL schema to generate from.
|
|
7
12
|
*
|
|
8
13
|
* @remarks
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
configFile?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The path to the output file generated by the plugin.
|
|
14
|
+
* This can be a {@link GraphQLSchema} instance, a local file path, a remote URL
|
|
15
|
+
* string, or a {@link URL} object.
|
|
14
16
|
*
|
|
15
|
-
* @
|
|
16
|
-
* If using the default value, the file can be imported from "powerlines:graphql/schema-name". This field allows the use of the "\{builtinsPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue "\{builtinsPath\}/graphql"
|
|
17
|
+
* @defaultValue "\{projectRoot\}/schema.graphql"
|
|
19
18
|
*/
|
|
20
|
-
|
|
19
|
+
schema?: string | URL | GraphQLSchema;
|
|
21
20
|
};
|
|
22
21
|
type GraphQLPluginUserConfig = UserConfig & {
|
|
23
|
-
graphql?:
|
|
24
|
-
};
|
|
25
|
-
type GraphQLPluginResolvedConfig = ResolvedConfig & {
|
|
26
|
-
graphql: Omit<YamlCliFlags, "config" | "watch" | "project" | "overwrite" | "require"> & Omit<GraphQLPluginOptions, "outputPath" | "configFile"> & Required<Pick<GraphQLPluginOptions, "outputPath" | "configFile">>;
|
|
22
|
+
graphql?: GraphQLPluginOptions;
|
|
27
23
|
};
|
|
28
|
-
type
|
|
29
|
-
graphql: {
|
|
30
|
-
|
|
24
|
+
type GraphQLPluginResolvedConfig = ResolvedConfig & PowerPlantPluginResolvedConfig<GraphQLSchema, Options> & {
|
|
25
|
+
graphql: Omit<GraphQLPluginOptions, "schema" | "filename"> & {
|
|
26
|
+
schema: string | URL | GraphQLSchema;
|
|
27
|
+
filename: string;
|
|
28
|
+
document: GraphQLSchema;
|
|
31
29
|
};
|
|
32
30
|
};
|
|
31
|
+
type GraphQLPluginContext<TResolvedConfig extends GraphQLPluginResolvedConfig = GraphQLPluginResolvedConfig> = PowerPlantPluginContext<GraphQLSchema, Options, TResolvedConfig>;
|
|
33
32
|
//#endregion
|
|
34
|
-
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig };
|
|
33
|
+
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, type PowerPlantGraphQLCodegenOptions };
|
|
35
34
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;;;;;KA+BY,uBAAuB,QACjC,KAAK;;;;;;;;;;EAWL,kBAAkB,MAAM;;KAGd,0BAA0B;EACpC,UAAU;;KAGA,8BAA8B,iBACxC,+BACE,eACA;EAEA,SAAS,KAAK;IACZ,iBAAiB,MAAM;IACvB;IACA,UAAU;;;KAIJ,qBACV,wBAAwB,8BACtB,+BACA,wBACF,eACA,SACA"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,35 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Options, Options as PowerPlantGraphQLCodegenOptions } from "@power-plant/graphql-codegen";
|
|
2
|
+
import { GraphQLSchema } from "graphql";
|
|
3
|
+
import { ResolvedConfig, UserConfig } from "powerlines";
|
|
4
|
+
import { PowerPlantPluginContext, PowerPlantPluginResolvedConfig } from "@powerlines/plugin-power-plant/types/plugin";
|
|
3
5
|
//#region src/types/plugin.d.ts
|
|
4
|
-
|
|
6
|
+
/**
|
|
7
|
+
* Options for the GraphQL Powerlines plugin.
|
|
8
|
+
*/
|
|
9
|
+
type GraphQLPluginOptions = Partial<Omit<Options, "schema" | "schemaAst">> & {
|
|
5
10
|
/**
|
|
6
|
-
* The
|
|
11
|
+
* The GraphQL schema to generate from.
|
|
7
12
|
*
|
|
8
13
|
* @remarks
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
configFile?: string;
|
|
12
|
-
/**
|
|
13
|
-
* The path to the output file generated by the plugin.
|
|
14
|
+
* This can be a {@link GraphQLSchema} instance, a local file path, a remote URL
|
|
15
|
+
* string, or a {@link URL} object.
|
|
14
16
|
*
|
|
15
|
-
* @
|
|
16
|
-
* If using the default value, the file can be imported from "powerlines:graphql/schema-name". This field allows the use of the "\{builtinsPath\}" token to refer to the built-in Powerlines plugins directory - the value will be replaced with the correct file path by the plugin.
|
|
17
|
-
*
|
|
18
|
-
* @defaultValue "\{builtinsPath\}/graphql"
|
|
17
|
+
* @defaultValue "\{projectRoot\}/schema.graphql"
|
|
19
18
|
*/
|
|
20
|
-
|
|
19
|
+
schema?: string | URL | GraphQLSchema;
|
|
21
20
|
};
|
|
22
21
|
type GraphQLPluginUserConfig = UserConfig & {
|
|
23
|
-
graphql?:
|
|
24
|
-
};
|
|
25
|
-
type GraphQLPluginResolvedConfig = ResolvedConfig & {
|
|
26
|
-
graphql: Omit<YamlCliFlags, "config" | "watch" | "project" | "overwrite" | "require"> & Omit<GraphQLPluginOptions, "outputPath" | "configFile"> & Required<Pick<GraphQLPluginOptions, "outputPath" | "configFile">>;
|
|
22
|
+
graphql?: GraphQLPluginOptions;
|
|
27
23
|
};
|
|
28
|
-
type
|
|
29
|
-
graphql: {
|
|
30
|
-
|
|
24
|
+
type GraphQLPluginResolvedConfig = ResolvedConfig & PowerPlantPluginResolvedConfig<GraphQLSchema, Options> & {
|
|
25
|
+
graphql: Omit<GraphQLPluginOptions, "schema" | "filename"> & {
|
|
26
|
+
schema: string | URL | GraphQLSchema;
|
|
27
|
+
filename: string;
|
|
28
|
+
document: GraphQLSchema;
|
|
31
29
|
};
|
|
32
30
|
};
|
|
31
|
+
type GraphQLPluginContext<TResolvedConfig extends GraphQLPluginResolvedConfig = GraphQLPluginResolvedConfig> = PowerPlantPluginContext<GraphQLSchema, Options, TResolvedConfig>;
|
|
33
32
|
//#endregion
|
|
34
|
-
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig };
|
|
33
|
+
export { GraphQLPluginContext, GraphQLPluginOptions, GraphQLPluginResolvedConfig, GraphQLPluginUserConfig, type PowerPlantGraphQLCodegenOptions };
|
|
35
34
|
//# sourceMappingURL=plugin.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-graphql",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.608",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Powerlines plugin to generate project code from GraphQL schemas.",
|
|
6
6
|
"keywords": ["graphql", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -90,20 +90,20 @@
|
|
|
90
90
|
"typings": "dist/index.d.mts",
|
|
91
91
|
"files": ["dist/**/*"],
|
|
92
92
|
"dependencies": {
|
|
93
|
-
"@
|
|
94
|
-
"@
|
|
95
|
-
"@
|
|
96
|
-
"@
|
|
97
|
-
"@stryke/
|
|
93
|
+
"@power-plant/core": "^0.0.23",
|
|
94
|
+
"@power-plant/graphql-codegen": "^0.0.19",
|
|
95
|
+
"@power-plant/graphql-schema": "^0.0.1",
|
|
96
|
+
"@powerlines/plugin-power-plant": "^0.1.2",
|
|
97
|
+
"@stryke/fs": "^0.33.97",
|
|
98
|
+
"@stryke/path": "^0.29.23",
|
|
98
99
|
"defu": "^6.1.7",
|
|
99
|
-
"
|
|
100
|
-
"powerlines": "^0.47.
|
|
100
|
+
"graphql": "^17.0.2",
|
|
101
|
+
"powerlines": "^0.47.146"
|
|
101
102
|
},
|
|
102
103
|
"devDependencies": {
|
|
103
|
-
"@
|
|
104
|
-
"@powerlines/plugin-plugin": "^0.12.556",
|
|
104
|
+
"@powerlines/plugin-plugin": "^0.12.558",
|
|
105
105
|
"@types/node": "^25.9.5"
|
|
106
106
|
},
|
|
107
107
|
"publishConfig": { "access": "public" },
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "e86d6fab3bd4d2e2f9f6d05df8df7a07d399857e"
|
|
109
109
|
}
|