Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kube/vgql-cli

Package Overview
Dependencies
Maintainers
0
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kube/vgql-cli - npm Package Compare versions

Comparing version 0.0.6 to 0.0.7

15

dist/cli.js
// src/cli.ts
import { program } from "@commander-js/extra-typings";
import { mergeTypeDefs } from "@graphql-tools/merge";
import { print } from "graphql";
import { serializeSchemas } from "@kube/vgql-structype";

@@ -15,7 +17,10 @@ import { toStructypeSchema } from "@kube/vgql-structype-graphql";

program.name("vgql").description("Virtual GraphQL CLI").version("0.0.1");
program.command("generate <file>").option("-w, --watch", "watch mode").requiredOption("-o, --out <path>", "output path").description("Generate Structype from GraphQL Schema").action((fileName, options) => {
program.command("generate <schemaFiles...>").option("-w, --watch", "watch mode").requiredOption("-o, --out <path>", "output path").description("Generate Structype from GraphQL Schema").action((schemaFiles, options) => {
async function transpileAndWrite() {
try {
const fileContent = readFileSync(fileName, "utf-8");
const structype = toStructypeSchema(fileContent);
const filesContent = schemaFiles.map(
(fileName) => readFileSync(fileName, "utf-8")
);
const mergedSchema = print(mergeTypeDefs(filesContent));
const structype = toStructypeSchema(mergedSchema);
const serialized = serializeSchemas(structype);

@@ -34,3 +39,5 @@ const formatted = await format(serialized);

if (options.watch) {
watchFile(fileName, { interval: 200 }, transpileAndWrite);
schemaFiles.forEach(
(fileName) => watchFile(fileName, { interval: 200 }, transpileAndWrite)
);
}

@@ -37,0 +44,0 @@ });

{
"name": "@kube/vgql-cli",
"version": "0.0.6",
"version": "0.0.7",
"author": "Chris Feijoo",

@@ -10,7 +10,9 @@ "license": "MIT",

"@commander-js/extra-typings": "^11.1.0",
"@graphql-tools/merge": "^9.0.4",
"body-parser": "^1.20.2",
"commander": "^11.1.0",
"express": "^4.19.2",
"graphql": "^16.8.1",
"prettier": "^3.2.1",
"@kube/vgql-core": "0.0.5",
"@kube/vgql-core": "0.0.6",
"@kube/vgql-structype": "0.0.5",

@@ -17,0 +19,0 @@ "@kube/vgql-structype-graphql": "0.0.5"

import { program } from "@commander-js/extra-typings";
import { mergeTypeDefs } from "@graphql-tools/merge";
import { print } from "graphql";

@@ -19,11 +21,14 @@ import { serializeSchemas } from "@kube/vgql-structype";

program
.command("generate <file>")
.command("generate <schemaFiles...>")
.option("-w, --watch", "watch mode")
.requiredOption("-o, --out <path>", "output path")
.description("Generate Structype from GraphQL Schema")
.action((fileName, options) => {
.action((schemaFiles, options) => {
async function transpileAndWrite() {
try {
const fileContent = readFileSync(fileName, "utf-8");
const structype = toStructypeSchema(fileContent);
const filesContent = schemaFiles.map((fileName) =>
readFileSync(fileName, "utf-8")
);
const mergedSchema = print(mergeTypeDefs(filesContent));
const structype = toStructypeSchema(mergedSchema);
const serialized = serializeSchemas(structype);

@@ -44,3 +49,6 @@ const formatted = await format(serialized);

if (options.watch) {
watchFile(fileName, { interval: 200 }, transpileAndWrite);
// TODO: Watcher should not be done like that
schemaFiles.forEach((fileName) =>
watchFile(fileName, { interval: 200 }, transpileAndWrite)
);
}

@@ -47,0 +55,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc