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

@graphql-tools/code-file-loader

Package Overview
Dependencies
Maintainers
3
Versions
1119
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graphql-tools/code-file-loader - npm Package Compare versions

Comparing version 8.0.1 to 8.0.2-alpha-20230724181141-6f9a4c07

35

cjs/index.js

@@ -5,14 +5,25 @@ "use strict";

const tslib_1 = require("tslib");
const fs_1 = require("fs");
const module_1 = require("module");
const path_1 = require("path");
const process_1 = require("process");
const globby_1 = tslib_1.__importDefault(require("globby"));
const graphql_1 = require("graphql");
const unixify_1 = tslib_1.__importDefault(require("unixify"));
const graphql_tag_pluck_1 = require("@graphql-tools/graphql-tag-pluck");
const utils_1 = require("@graphql-tools/utils");
const graphql_tag_pluck_1 = require("@graphql-tools/graphql-tag-pluck");
const globby_1 = tslib_1.__importDefault(require("globby"));
const unixify_1 = tslib_1.__importDefault(require("unixify"));
const load_from_module_js_1 = require("./load-from-module.js");
const path_1 = require("path");
const process_1 = require("process");
const fs_1 = require("fs");
const module_1 = require("module");
const { readFile, access } = fs_1.promises;
const FILE_EXTENSIONS = ['.ts', '.mts', '.cts', '.tsx', '.js', '.mjs', 'cjs', '.jsx', '.vue', '.svelte'];
const FILE_EXTENSIONS = [
'.ts',
'.mts',
'.cts',
'.tsx',
'.js',
'.mjs',
'cjs',
'.jsx',
'.vue',
'.svelte',
];
function createGlobbyOptions(options) {

@@ -52,3 +63,5 @@ return { absolute: true, ...options, ignore: [] };

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = (0, path_1.isAbsolute)(pointer) ? pointer : (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
const normalizedFilePath = (0, path_1.isAbsolute)(pointer)
? pointer
: (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
try {

@@ -69,3 +82,5 @@ await access(normalizedFilePath);

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = (0, path_1.isAbsolute)(pointer) ? pointer : (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
const normalizedFilePath = (0, path_1.isAbsolute)(pointer)
? pointer
: (0, path_1.resolve)(options.cwd || (0, process_1.cwd)(), pointer);
return (0, fs_1.existsSync)(normalizedFilePath);

@@ -72,0 +87,0 @@ }

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

import { parse, buildClientSchema, isSchema } from 'graphql';
import { buildClientSchema, isSchema, parse, } from 'graphql';
import { isSchemaAst, isSchemaJson, isSchemaText, isWrappedSchemaJson, pick } from './helpers.js';

@@ -3,0 +3,0 @@ const identifiersToLookFor = ['default', 'schema', 'typeDefs', 'data'];

@@ -0,13 +1,24 @@

import { existsSync, promises as fsPromises, readFileSync } from 'fs';
import { createRequire } from 'module';
import { isAbsolute, resolve } from 'path';
import { cwd, env } from 'process';
import globby from 'globby';
import { isSchema, parse } from 'graphql';
import { asArray, isValidPath, parseGraphQLSDL, isDocumentNode, } from '@graphql-tools/utils';
import unixify from 'unixify';
import { gqlPluckFromCodeString, gqlPluckFromCodeStringSync, } from '@graphql-tools/graphql-tag-pluck';
import globby from 'globby';
import unixify from 'unixify';
import { asArray, isDocumentNode, isValidPath, parseGraphQLSDL, } from '@graphql-tools/utils';
import { tryToLoadFromExport, tryToLoadFromExportSync } from './load-from-module.js';
import { isAbsolute, resolve } from 'path';
import { cwd, env } from 'process';
import { readFileSync, promises as fsPromises, existsSync } from 'fs';
import { createRequire } from 'module';
const { readFile, access } = fsPromises;
const FILE_EXTENSIONS = ['.ts', '.mts', '.cts', '.tsx', '.js', '.mjs', 'cjs', '.jsx', '.vue', '.svelte'];
const FILE_EXTENSIONS = [
'.ts',
'.mts',
'.cts',
'.tsx',
'.js',
'.mjs',
'cjs',
'.jsx',
'.vue',
'.svelte',
];
function createGlobbyOptions(options) {

@@ -47,3 +58,5 @@ return { absolute: true, ...options, ignore: [] };

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = isAbsolute(pointer) ? pointer : resolve(options.cwd || cwd(), pointer);
const normalizedFilePath = isAbsolute(pointer)
? pointer
: resolve(options.cwd || cwd(), pointer);
try {

@@ -64,3 +77,5 @@ await access(normalizedFilePath);

if (FILE_EXTENSIONS.find(extension => pointer.endsWith(extension))) {
const normalizedFilePath = isAbsolute(pointer) ? pointer : resolve(options.cwd || cwd(), pointer);
const normalizedFilePath = isAbsolute(pointer)
? pointer
: resolve(options.cwd || cwd(), pointer);
return existsSync(normalizedFilePath);

@@ -67,0 +82,0 @@ }

{
"name": "@graphql-tools/code-file-loader",
"version": "8.0.1",
"version": "8.0.2-alpha-20230724181141-6f9a4c07",
"description": "A set of utils for faster development of GraphQL tools",

@@ -10,4 +10,4 @@ "sideEffects": false,

"dependencies": {
"@graphql-tools/graphql-tag-pluck": "8.0.2-alpha-20230724181141-6f9a4c07",
"@graphql-tools/utils": "^10.0.0",
"@graphql-tools/graphql-tag-pluck": "8.0.1",
"globby": "^11.0.3",

@@ -14,0 +14,0 @@ "tslib": "^2.4.0",

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

import { Source, BaseLoaderOptions, Loader } from '@graphql-tools/utils';
import { GraphQLTagPluckOptions } from '@graphql-tools/graphql-tag-pluck';
import { BaseLoaderOptions, Loader, Source } from '@graphql-tools/utils';
export type CodeFileLoaderConfig = {

@@ -4,0 +4,0 @@ pluckConfig?: GraphQLTagPluckOptions;

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