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

babel-plugin-inline-import-graphql-ast

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-inline-import-graphql-ast - npm Package Compare versions

Comparing version 2.3.7 to 2.3.8

32

build/index.js

@@ -6,8 +6,2 @@ "use strict";

});
Object.defineProperty(exports, "requireGql", {
enumerable: true,
get: function get() {
return _requireGql.requireGql;
}
});
exports.default = void 0;

@@ -19,4 +13,2 @@

var _core = require("@babel/core");
var _requireGql = require("./requireGql");

@@ -27,3 +19,4 @@

var _default = function _default(_ref) {
var t = _ref.types;
var t = _ref.types,
template = _ref.template;
return {

@@ -41,5 +34,4 @@ manipulateOptions(_ref2) {

exit(curPath, _ref3) {
var babelPath = _ref3.file.opts.filename,
nodePath = _ref3.opts.nodePath;
var importNames = curPath.node.specifiers;
var opts = _ref3.opts,
file = _ref3.file;
var importPath = curPath.node.source.value;

@@ -49,4 +41,4 @@

// Find the file, using node resolution/NODE_PATH if necessary.
var fallbackPaths = nodePath ? nodePath.split(_path.delimiter) : process.env.NODE_PATH;
var absPath = resolve(importPath, babelPath);
var fallbackPaths = opts.nodePath ? opts.nodePath.split(_path.delimiter) : process.env.NODE_PATH;
var absPath = resolve(importPath, file.opts.filename);
if (!(0, _fs.existsSync)(absPath)) absPath = require.resolve(importPath, {

@@ -60,2 +52,3 @@ paths: fallbackPaths

});
var importNames = curPath.node.specifiers;

@@ -93,8 +86,7 @@ if (typeof result === 'string') {

function buildVariableAST(graphqlAST, importName) {
var _transformSync = (0, _core.transformSync)(`var ${importName} = ${JSON.stringify(graphqlAST)}`, {
ast: true
}),
ast = _transformSync.ast;
return ast.program.body[0];
var buildAst = template(`var IMPORT_NAME = AST;`);
return buildAst({
IMPORT_NAME: t.identifier(importName),
AST: t.valueToNode(JSON.parse(JSON.stringify(graphqlAST)))
});
}

@@ -101,0 +93,0 @@ }

# ChangeLog
## v2.3.8 (May 15, 2018)
### Fixes
* Refactor plugin to not have direct dependency on @babel/core (hopefully fixing #30)
* Update package-lock.json that was not updated for version 2.3.7
### Maintenance
* Automate updating of package-lock.json and yarn.lock
* Remove undocumented `requireGql` export
* Update all dependencies
## v2.3.7 (April 26, 2018)

@@ -4,0 +17,0 @@

{
"name": "babel-plugin-inline-import-graphql-ast",
"version": "2.3.7",
"version": "2.3.8",
"description": "Babel plugin to make .gql/.graphql files importable",

@@ -14,3 +14,3 @@ "author": "Alexander Roberts <detrohutt@gmail.com>",

"test": "jest",
"prepublish": "babel plugin --out-dir build"
"prepare": "babel plugin --out-dir build"
},

@@ -23,4 +23,3 @@ "husky": {

"dependencies": {
"@babel/core": "7.0.0-beta.46",
"graphql-tag": "^2.9.1"
"graphql-tag": "^2.9.2"
},

@@ -31,4 +30,5 @@ "peerDependencies": {

"devDependencies": {
"@babel/cli": "^7.0.0-beta.46",
"@babel/preset-env": "^7.0.0-beta.46",
"@babel/cli": "^7.0.0-beta.47",
"@babel/core": "7.0.0-beta.47",
"@babel/preset-env": "^7.0.0-beta.47",
"babel-core": "7.0.0-bridge.0",

@@ -48,3 +48,3 @@ "babel-eslint": "^8.2.3",

"jest": "^22.4.3",
"lint-staged": "^7.0.5",
"lint-staged": "^7.1.0",
"prettier": "^1.12.1"

@@ -51,0 +51,0 @@ },

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