Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

sort-graphql-sdl

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sort-graphql-sdl - npm Package Compare versions

Comparing version
1.0.0
to
1.1.0
+11
-7
dist/bin/index.js

@@ -5,2 +5,4 @@ "use strict";

var _path = _interopRequireDefault(require("path"));
var _yargs = _interopRequireDefault(require("yargs"));

@@ -12,10 +14,10 @@

const argv = _yargs.default.env('SGS').help().usage('Sort GraphQL schema definition language (SDL) document.\nUsage: $0 -f <sdl-path>').options({
'sdl-path': {
demand: true,
const argv = _yargs.default.env('SGS').help().usage('$0 <sdl-path>', 'Sort GraphQL schema definition language (SDL) document.', command => {
command.positional('sdl-path', {
description: 'Path to the GraphQL schema definition (SDL) document.',
type: 'string'
},
});
}).options({
write: {
demand: true,
default: false,
description: 'Overrides contents of the SDL document.',

@@ -26,8 +28,10 @@ type: 'string'

const inputSdl = _fs.default.readFileSync(argv.sdlPath, 'utf8');
const resolvedPath = _path.default.resolve(argv.sdlPath);
const inputSdl = _fs.default.readFileSync(resolvedPath, 'utf8');
const outputSdl = (0, _utilities.formatSdl)(inputSdl);
if (argv.write) {
_fs.default.writeFileSync(argv.sdlPath, outputSdl); // eslint-disable-next-line no-console
_fs.default.writeFileSync(resolvedPath, outputSdl); // eslint-disable-next-line no-console

@@ -34,0 +38,0 @@

@@ -1,1 +0,1 @@

{"version":3,"sources":["../../src/bin/index.js"],"names":["argv","yargs","env","help","usage","options","demand","description","type","write","parse","inputSdl","fs","readFileSync","sdlPath","outputSdl","writeFileSync","console","log"],"mappings":";;AAEA;;AACA;;AACA;;;;AAIA,MAAMA,IAAI,GAAGC,eACVC,GADU,CACN,KADM,EAEVC,IAFU,GAGVC,KAHU,CAGJ,kFAHI,EAIVC,OAJU,CAIF;AACP,cAAY;AACVC,IAAAA,MAAM,EAAE,IADE;AAEVC,IAAAA,WAAW,EAAE,uDAFH;AAGVC,IAAAA,IAAI,EAAE;AAHI,GADL;AAMPC,EAAAA,KAAK,EAAE;AACLH,IAAAA,MAAM,EAAE,IADH;AAELC,IAAAA,WAAW,EAAE,yCAFR;AAGLC,IAAAA,IAAI,EAAE;AAHD;AANA,CAJE,EAgBVE,KAhBU,EAAb;;AAkBA,MAAMC,QAAQ,GAAGC,YAAGC,YAAH,CAAgBb,IAAI,CAACc,OAArB,EAA8B,MAA9B,CAAjB;;AAEA,MAAMC,SAAS,GAAG,0BAAUJ,QAAV,CAAlB;;AAEA,IAAIX,IAAI,CAACS,KAAT,EAAgB;AACdG,cAAGI,aAAH,CAAiBhB,IAAI,CAACc,OAAtB,EAA+BC,SAA/B,EADc,CAGd;;;AACAE,EAAAA,OAAO,CAACC,GAAR,CAAY,gEAAZ;AACD,CALD,MAKO;AACL;AACAD,EAAAA,OAAO,CAACC,GAAR,CAAYH,SAAZ;AACD","sourcesContent":["// @flow\n\nimport fs from 'fs';\nimport yargs from 'yargs';\nimport {\n formatSdl,\n} from '../utilities';\n\nconst argv = yargs\n .env('SGS')\n .help()\n .usage('Sort GraphQL schema definition language (SDL) document.\\nUsage: $0 -f <sdl-path>')\n .options({\n 'sdl-path': {\n demand: true,\n description: 'Path to the GraphQL schema definition (SDL) document.',\n type: 'string',\n },\n write: {\n demand: true,\n description: 'Overrides contents of the SDL document.',\n type: 'string',\n },\n })\n .parse();\n\nconst inputSdl = fs.readFileSync(argv.sdlPath, 'utf8');\n\nconst outputSdl = formatSdl(inputSdl);\n\nif (argv.write) {\n fs.writeFileSync(argv.sdlPath, outputSdl);\n\n // eslint-disable-next-line no-console\n console.log('Target SDL document has been overriden with the formatted SDL.');\n} else {\n // eslint-disable-next-line no-console\n console.log(outputSdl);\n}\n"],"file":"index.js"}
{"version":3,"sources":["../../src/bin/index.js"],"names":["argv","yargs","env","help","usage","command","positional","description","type","options","write","default","parse","resolvedPath","path","resolve","sdlPath","inputSdl","fs","readFileSync","outputSdl","writeFileSync","console","log"],"mappings":";;AAEA;;AACA;;AACA;;AACA;;;;AAIA,MAAMA,IAAI,GAAGC,eACVC,GADU,CACN,KADM,EAEVC,IAFU,GAGVC,KAHU,CAGJ,eAHI,EAGa,yDAHb,EAGyEC,OAAD,IAAa;AAC9FA,EAAAA,OAAO,CAACC,UAAR,CAAmB,UAAnB,EAA+B;AAC7BC,IAAAA,WAAW,EAAE,uDADgB;AAE7BC,IAAAA,IAAI,EAAE;AAFuB,GAA/B;AAID,CARU,EASVC,OATU,CASF;AACPC,EAAAA,KAAK,EAAE;AACLC,IAAAA,OAAO,EAAE,KADJ;AAELJ,IAAAA,WAAW,EAAE,yCAFR;AAGLC,IAAAA,IAAI,EAAE;AAHD;AADA,CATE,EAgBVI,KAhBU,EAAb;;AAkBA,MAAMC,YAAY,GAAGC,cAAKC,OAAL,CAAaf,IAAI,CAACgB,OAAlB,CAArB;;AAEA,MAAMC,QAAQ,GAAGC,YAAGC,YAAH,CAAgBN,YAAhB,EAA8B,MAA9B,CAAjB;;AAEA,MAAMO,SAAS,GAAG,0BAAUH,QAAV,CAAlB;;AAEA,IAAIjB,IAAI,CAACU,KAAT,EAAgB;AACdQ,cAAGG,aAAH,CAAiBR,YAAjB,EAA+BO,SAA/B,EADc,CAGd;;;AACAE,EAAAA,OAAO,CAACC,GAAR,CAAY,gEAAZ;AACD,CALD,MAKO;AACL;AACAD,EAAAA,OAAO,CAACC,GAAR,CAAYH,SAAZ;AACD","sourcesContent":["// @flow\n\nimport fs from 'fs';\nimport path from 'path';\nimport yargs from 'yargs';\nimport {\n formatSdl,\n} from '../utilities';\n\nconst argv = yargs\n .env('SGS')\n .help()\n .usage('$0 <sdl-path>', 'Sort GraphQL schema definition language (SDL) document.', (command) => {\n command.positional('sdl-path', {\n description: 'Path to the GraphQL schema definition (SDL) document.',\n type: 'string',\n });\n })\n .options({\n write: {\n default: false,\n description: 'Overrides contents of the SDL document.',\n type: 'string',\n },\n })\n .parse();\n\nconst resolvedPath = path.resolve(argv.sdlPath);\n\nconst inputSdl = fs.readFileSync(resolvedPath, 'utf8');\n\nconst outputSdl = formatSdl(inputSdl);\n\nif (argv.write) {\n fs.writeFileSync(resolvedPath, outputSdl);\n\n // eslint-disable-next-line no-console\n console.log('Target SDL document has been overriden with the formatted SDL.');\n} else {\n // eslint-disable-next-line no-console\n console.log(outputSdl);\n}\n"],"file":"index.js"}

@@ -90,3 +90,3 @@ {

},
"version": "1.0.0"
"version": "1.1.0"
}

Sorry, the diff of this file is not supported yet