babel-plugin-relay
Advanced tools
Comparing version 0.0.0-main-433c93e4 to 0.0.0-main-4360f69e
/** | ||
* Relay v0.0.0-main-433c93e4 | ||
* Relay v0.0.0-main-4360f69e | ||
*/ | ||
(()=>{"use strict";var e={364:(e,r,i)=>{var n,o=(0,i(193).default)(i(56)),t=i(76),a=i(743),l=i(399),s=l("relay",{searchPlaces:["relay.config.js","relay.config.json","package.json"],loaders:{".json":l.loadJson,".js":l.loadJs,noExt:l.loadYaml}}).searchSync();s&&(n=s.config),e.exports=function(e){var r=e.types;if(!r)throw new Error('BabelPluginRelay: Expected plugin context to include "types", but got:'+String(e));var i={TaggedTemplateExpression:function(e,i){var n=a(e);n&&t(r,e,i,n)}};return{visitor:{Program:function(e,r){e.traverse(i,(0,o.default)((0,o.default)({},r),{},{opts:(0,o.default)((0,o.default)({},n),r.opts)}))}}}}},76:(e,r,i)=>{var n=i(770),o=i(174).print,t=i(315),a=t.dirname,l=t.join,s=t.relative,d=t.resolve;e.exports=function(e,r,i,t){var p,u,c,f,g,v,m;if(1!==t.definitions.length)throw new Error("BabelPluginRelay: Expected exactly one definition per graphql tag.");var x=t.definitions[0];if("FragmentDefinition"!==x.kind&&"OperationDefinition"!==x.kind)throw new Error("BabelPluginRelay: Expected a fragment, mutation, query, or subscription, got `"+x.kind+"`.");var h=null!==(p=null===(u=i.opts)||void 0===u?void 0:u.eagerEsModules)&&void 0!==p&&p,E="haste"===(null===(c=i.opts)||void 0===c?void 0:c.jsModuleFormat),b=null===(f=i.opts)||void 0===f?void 0:f.isDevVariableName;return function(e,r,i,t,p){var u=t.name&&t.name.value;if(!u)throw new Error("GraphQL operations and fragments must contain names");for(var c=u+".graphql",f=function(e){return"win32"===process.platform?e.replace(/\\/g,"/"):e}(p.isHasteMode?c:p.artifactDirectory?function(e,r,i){if(null==e.file)throw new Error("Babel state is missing expected file name");var n=e.file.opts.filename,o=s(a(n),d(r));return(0!==o.length&&o.startsWith(".")?"":"./")+l(o,i)}(r,p.artifactDirectory,c):"./__generated__/"+c),g=n.createHash("md5").update(o(t),"utf8").digest("hex"),v=i.scope;v.parent;)v=v.parent;var m=v.generateUidIdentifier(u),x=e.MemberExpression(e.cloneNode(m),e.Identifier("hash")),h=function(e,r,i){return e.callExpression(e.memberExpression(e.identifier("console"),e.identifier("error")),[e.stringLiteral("The definition of '".concat(r,"' appears to have changed. Run ")+"`"+i+"` to update the generated files to receive the expected data.")])}(e,u,p.buildCommand),E=e.LogicalExpression("&&",e.cloneNode(x),e.LogicalExpression("&&",e.BinaryExpression("!==",x,e.StringLiteral(g)),h));if(p.eagerEsModules){var b=e.ImportDeclaration([e.ImportDefaultSpecifier(m)],e.StringLiteral(f));i.findParent((function(e){return e.isProgram()})).unshiftContainer("body",b);var y,q=e.SequenceExpression([E,e.cloneNode(m)]);y=null!=p.isDevVariable?e.ConditionalExpression(e.Identifier(p.isDevVariable),q,e.cloneNode(m)):p.isDevelopment?q:e.cloneNode(m),i.replaceWith(y)}else{v.push({id:e.cloneNode(m)});var D,w=e.CallExpression(e.Identifier("require"),[e.StringLiteral(f)]),N=e.AssignmentExpression("=",e.cloneNode(m),w),B=e.SequenceExpression([N,E,e.cloneNode(m)]);D=null!=p.isDevVariable?e.ConditionalExpression(e.Identifier(p.isDevVariable),B,N):p.isDevelopment?B:N;var P=e.UnaryExpression("void",e.NumericLiteral(0));i.replaceWith(e.ConditionalExpression(e.BinaryExpression("!==",e.cloneNode(m),P),e.cloneNode(m),e.cloneNode(D)))}}(e,i,r,x,{artifactDirectory:null===(g=i.opts)||void 0===g?void 0:g.artifactDirectory,eagerEsModules:h,buildCommand:null!==(v=null===(m=i.opts)||void 0===m?void 0:m.codegenCommand)&&void 0!==v?v:"relay-compiler",isDevelopment:"production"!==(process.env.BABEL_ENV||"development"),isHasteMode:E,isDevVariable:b})}},743:(e,r,i)=>{var n=i(174);e.exports=function(e){if(!e.get("tag").isIdentifier({name:"graphql"}))return null;var r=e.node.quasi.quasis;if(1!==r.length)throw new Error("BabelPluginRelay: Substitutions are not allowed in graphql fragments. Included fragments should be referenced as `...MyModule_propName`.");var i=r[0].value.raw,o=n.parse(i);if(0===o.definitions.length)throw new Error("BabelPluginRelay: Unexpected empty graphql tag.");return o}},193:e=>{e.exports=require("@babel/runtime/helpers/interopRequireDefault")},56:e=>{e.exports=require("@babel/runtime/helpers/objectSpread2")},399:e=>{e.exports=require("cosmiconfig")},770:e=>{e.exports=require("crypto")},174:e=>{e.exports=require("graphql")},315:e=>{e.exports=require("path")}},r={},i=function i(n){var o=r[n];if(void 0!==o)return o.exports;var t=r[n]={exports:{}};return e[n](t,t.exports,i),t.exports}(364);module.exports.BabelPluginRelay=i})(); |
/** | ||
* Relay v0.0.0-main-433c93e4 | ||
* Relay v0.0.0-main-4360f69e | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. |
/** | ||
* Relay v0.0.0-main-433c93e4 | ||
* Relay v0.0.0-main-4360f69e | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. |
/** | ||
* Relay v0.0.0-main-433c93e4 | ||
* Relay v0.0.0-main-4360f69e | ||
* | ||
@@ -4,0 +4,0 @@ * Copyright (c) Meta Platforms, Inc. and affiliates. |
{ | ||
"name": "babel-plugin-relay", | ||
"description": "A Babel Plugin for use with Relay applications.", | ||
"version": "0.0.0-main-433c93e4", | ||
"version": "0.0.0-main-4360f69e", | ||
"keywords": [ | ||
@@ -25,6 +25,6 @@ "graphql", | ||
"devDependencies": { | ||
"@babel/core": "^7.20.0", | ||
"@babel/core": "^7.25.2", | ||
"prettier": "2.8.8", | ||
"prettier-plugin-hermes-parser": "0.20.1" | ||
"prettier-plugin-hermes-parser": "0.24.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package