@ttoss/graphql-api-cli 0.9.3 → 0.9.5
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/esm/index.js +12 -7
- package/package.json +2 -2
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
/** Powered by @ttoss/config. https://ttoss.dev/docs/modules/packages/config/ */
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
4
|
+
value,
|
|
5
|
+
configurable: true
|
|
6
|
+
});
|
|
2
7
|
|
|
3
8
|
// src/index.ts
|
|
4
9
|
import * as fs from "fs";
|
|
@@ -13,7 +18,7 @@ import log from "npmlog";
|
|
|
13
18
|
// package.json
|
|
14
19
|
var package_default = {
|
|
15
20
|
name: "@ttoss/graphql-api-cli",
|
|
16
|
-
version: "0.9.
|
|
21
|
+
version: "0.9.4",
|
|
17
22
|
description: "A library for building GraphQL APIs types and schema.",
|
|
18
23
|
license: "MIT",
|
|
19
24
|
author: "ttoss",
|
|
@@ -56,7 +61,7 @@ var package_default = {
|
|
|
56
61
|
|
|
57
62
|
// src/index.ts
|
|
58
63
|
var logPrefix = "graphql-api";
|
|
59
|
-
var importSchemaComposer = async ({
|
|
64
|
+
var importSchemaComposer = /* @__PURE__ */__name(async ({
|
|
60
65
|
external = [],
|
|
61
66
|
schemaComposerPath
|
|
62
67
|
}) => {
|
|
@@ -64,7 +69,7 @@ var importSchemaComposer = async ({
|
|
|
64
69
|
const filename = lastEntryPointName?.split(".")[0];
|
|
65
70
|
const outfile = path.resolve(process.cwd(), "out", filename + ".js");
|
|
66
71
|
const packageJsonPath = path.resolve(process.cwd(), "package.json");
|
|
67
|
-
const getPackageDependencies = packageJsonPath2 => {
|
|
72
|
+
const getPackageDependencies = /* @__PURE__ */__name(packageJsonPath2 => {
|
|
68
73
|
const packageJson = fs.readFileSync(packageJsonPath2, "utf-8");
|
|
69
74
|
const parsedPackageJson = JSON.parse(packageJson);
|
|
70
75
|
const dependencies2 = [];
|
|
@@ -81,7 +86,7 @@ var importSchemaComposer = async ({
|
|
|
81
86
|
dependencies2.push(dependency);
|
|
82
87
|
}
|
|
83
88
|
return dependencies2;
|
|
84
|
-
};
|
|
89
|
+
}, "getPackageDependencies");
|
|
85
90
|
const dependencies = getPackageDependencies(packageJsonPath).filter((dep, index, self) => {
|
|
86
91
|
return self.indexOf(dep) === index;
|
|
87
92
|
}).sort((a, b) => {
|
|
@@ -107,8 +112,8 @@ var importSchemaComposer = async ({
|
|
|
107
112
|
console.error("Failed importing build config file: ", filename);
|
|
108
113
|
throw error;
|
|
109
114
|
}
|
|
110
|
-
};
|
|
111
|
-
var buildSchema = async ({
|
|
115
|
+
}, "importSchemaComposer");
|
|
116
|
+
var buildSchema = /* @__PURE__ */__name(async ({
|
|
112
117
|
directory,
|
|
113
118
|
external
|
|
114
119
|
}) => {
|
|
@@ -154,7 +159,7 @@ var buildSchema = async ({
|
|
|
154
159
|
await fs.promises.writeFile("schema/types.ts", `${typesOutputIgnore}
|
|
155
160
|
${typesOutput}`);
|
|
156
161
|
log.info(logPrefix, "Schema and types generated!");
|
|
157
|
-
};
|
|
162
|
+
}, "buildSchema");
|
|
158
163
|
var program = new Command();
|
|
159
164
|
program.name("ttoss-graphql-api").version(package_default.version, "-v, --version", "Output the current version of the GraphQL API");
|
|
160
165
|
program.command("build-schema").option("-d, --directory <directory>", "Schema composer directory", "src").option("--external <external...>", "External dependencies to ignore during build").action(options => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/graphql-api-cli",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "A library for building GraphQL APIs types and schema.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "ttoss",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"tsup": "^8.5.0",
|
|
36
|
-
"@ttoss/config": "^1.35.
|
|
36
|
+
"@ttoss/config": "^1.35.8"
|
|
37
37
|
},
|
|
38
38
|
"keywords": [
|
|
39
39
|
"api",
|