diff --git a/dist/getWriter.js b/dist/getWriter.js index 0c72047..d711be4 100644 --- a/dist/getWriter.js +++ b/dist/getWriter.js @@ -30,9 +30,9 @@ var _default = (languagePlugin, config) => ({ sourceControl, reporter }) => _relayCompiler.FileWriter.writeAll({ - config: _objectSpread({ + config: _objectSpread(_objectSpread({ customScalars: {} - }, config, { + }, config), {}, { compilerTransforms: { commonTransforms, codegenTransforms, diff --git a/dist/index.js b/dist/index.js index 1512d32..aac71c1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,39 +1,231 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=118)}([function(e,t,n){"use strict";var r=function(e){if(void 0===e)throw new Error("invariant(...): Second argument must be a string.")};e.exports=function(e,t){for(var n=arguments.length,i=new Array(n>2?n-2:0),a=2;a-1}))),n&&(f=null!=f?[n].concat((0,r.default)(f)):[n]),null===f?c:h(c,p(f,t))},getStorageKey:function(e,t){if(e.storageKey)return e.storageKey;var n=e.args,r=e.name;return n&&0!==n.length?h(r,p(n,t)):r},getStableStorageKey:function(e,t){return h(e,l(t))},getModuleComponentKey:function(e){return"".concat("__module_component_").concat(e)},getModuleOperationKey:function(e){return"".concat("__module_operation_").concat(e)}};e.exports=v},function(e,t,n){"use strict";var r=n(69);e.exports=r},function(e,t,n){var r=n(12);e.exports=function(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:u,r=e.operation,a=i(r,t),c=s(e,a),f={fragment:l(e.fragment,n,a,c),request:c,root:o(r,n,a)};return f},createRequestDescriptor:s}},function(e,t,n){"use strict";var r=n(13),i=n(76),a=n(77),o=function(){function e(t){return e.create(t)}return e.create=function(e){return new(r.USE_RECORD_SOURCE_MAP_IMPL?i:a)(e)},e}();e.exports=o},function(e,t,n){"use strict";e.exports={EXISTENT:"EXISTENT",NONEXISTENT:"NONEXISTENT",UNKNOWN:"UNKNOWN"}},function(e,t,n){"use strict";var r={after:!0,before:!0,find:!0,first:!0,last:!0,surrounds:!0},i={CLIENT_MUTATION_ID:"clientMutationId",CURSOR:"cursor",EDGES:"edges",END_CURSOR:"endCursor",HAS_NEXT_PAGE:"hasNextPage",HAS_PREV_PAGE:"hasPreviousPage",NODE:"node",PAGE_INFO_TYPE:"PageInfo",PAGE_INFO:"pageInfo",START_CURSOR:"startCursor"},a={inject:function(e){i=e},get:function(){return i},isConnectionCall:function(e){return r.hasOwnProperty(e.name)}};e.exports=a},function(e,t,n){"use strict";var r=n(30),i=(n(4),Object.freeze({RANGE_ADD:"RANGE_ADD",RANGE_DELETE:"RANGE_DELETE",NODE_DELETE:"NODE_DELETE"})),a=Object.freeze({APPEND:"append",PREPEND:"prepend"});function o(e){return e.fragment.selections&&e.fragment.selections.length>0&&"LinkedField"===e.fragment.selections[0].kind?e.fragment.selections[0].name:null}e.exports={MutationTypes:i,RangeOperations:a,convert:function(e,t,n,i){var a=n?[n]:[],l=i?[i]:[];return e.forEach((function(e){switch(e.type){case"NODE_DELETE":var n=function(e,t){var n=e.deletedIDFieldName,r=o(t);if(!r)return null;return function(e,t){var i=e.getRootField(r);if(i){var a=i.getValue(n);(Array.isArray(a)?a:[a]).forEach((function(t){t&&"string"==typeof t&&e.delete(t)}))}}}(e,t);n&&(a.push(n),l.push(n));break;case"RANGE_ADD":var i=function(e,t){var n=e.parentID,i=e.connectionInfo,a=e.edgeName;if(!n)return null;var l=o(t);if(!i||!l)return null;return function(e,t){var o=e.get(n);if(o){var u=e.getRootField(l);if(u){var s=u.getLinkedRecord(a),c=!0,f=!1,d=void 0;try{for(var p,h=i[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var v=p.value;if(s){var m=r.getConnection(o,v.key,v.filters);if(m){var g=r.buildConnectionEdge(e,m,s);if(g)switch(v.rangeBehavior){case"append":r.insertEdgeAfter(m,g);break;case"prepend":r.insertEdgeBefore(m,g)}}}}}catch(e){f=!0,d=e}finally{try{c||null==h.return||h.return()}finally{if(f)throw d}}}}}}(e,t);i&&(a.push(i),l.push(i));break;case"RANGE_DELETE":var u=function(e,t){var n=e.parentID,i=e.connectionKeys,a=e.pathToConnection,l=e.deletedIDFieldName;if(!n)return null;var u=o(t);if(!u)return null;return function(e,t){if(t){var o=[],s=t[u];if(s&&Array.isArray(l)){var c=!0,f=!1,d=void 0;try{for(var p,h=l[Symbol.iterator]();!(c=(p=h.next()).done);c=!0){var v=p.value;s&&"object"==typeof s&&(s=s[v])}}catch(e){f=!0,d=e}finally{try{c||null==h.return||h.return()}finally{if(f)throw d}}Array.isArray(s)?s.forEach((function(e){e&&e.id&&"object"==typeof e&&"string"==typeof e.id&&o.push(e.id)})):s&&s.id&&"string"==typeof s.id&&o.push(s.id)}else s&&"string"==typeof l&&"object"==typeof s&&("string"==typeof(s=s[l])?o.push(s):Array.isArray(s)&&s.forEach((function(e){"string"==typeof e&&o.push(e)})));!function(e,t,n,i,a){var o=i.get(e);if(!o)return;if(n.length<2)return;for(var l=o,u=1;u0,r=a.hasOwnProperty(e);if(r||n){for(var i,o=r&&n?a[e].concat(a["*"]):r?a[e]:a["*"],u=o.length-1;u>=0;u--){var s=(0,o[u])(e,t);(i=i||[]).unshift(s)}return{stop:function(e){i&&i.forEach((function(t){return t(e)}))}}}return l},attachProfileHandler:function(e,t){u(e)&&(a.hasOwnProperty(e)||(a[e]=[]),a[e].push(t))},detachProfileHandler:function(e,t){u(e)&&a.hasOwnProperty(e)&&c(a[e],t)}};function c(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}e.exports=s},function(e,t,n){"use strict";var r=(0,n(8).generateClientID)(n(3).ROOT_ID,"viewer");e.exports={VIEWER_ID:r,VIEWER_TYPE:"Viewer"}},function(e,t,n){"use strict";e.exports=function(e){return Boolean(e&&e["@@RelayModernEnvironment"])}},function(e,t){e.exports=function(e,t){if(null==e)return{};var n,r,i={},a=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}},function(e,t){e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}},function(e,t,n){"use strict";var r=n(2)(n(38)),i=n(1),a=n(16),o=n(106),l=n(0),u=n(61),s=n(107),c=n(28),f=c.getComponentName,d=c.getContainerName,p=n(6).getFragment;e.exports=function(e,t,n){var c=d(e);o(f(e),t);var h=n(e,u(t,p));function v(e,t){var n=s(a);return null==n&&l(!1),i.createElement(h,(0,r.default)({},e,{__relayContext:n,componentRef:e.componentRef||t}))}return h.displayName=c,v.displayName=c,i.forwardRef(v)}},function(e,t){function n(){return e.exports=n=Object.assign||function(e){for(var t=1;t0?r.add(s):n.add(s))}}catch(e){a=!0,o=e}finally{try{i||null==u.return||u.return()}finally{if(a)throw o}}var f=!0,d=!1,p=void 0;try{for(var h,v=n[Symbol.iterator]();!(f=(h=v.next()).done);f=!0){var m=h.value;this._resolveOwnerResolvers(m),this._ownersToPendingOperations.delete(m)}}catch(e){d=!0,p=e}finally{try{f||null==v.return||v.return()}finally{if(d)throw p}}var g=!0,_=!1,y=void 0;try{for(var b,E=r[Symbol.iterator]();!(g=(b=E.next()).done);g=!0){var k=b.value;this._resolveOwnerResolvers(k)}}catch(e){_=!0,y=e}finally{try{g||null==E.return||E.return()}finally{if(_)throw y}}this._pendingOperationsToOwners.delete(e)}},t._resolveOwnerResolvers=function(e){var t=this._ownersToPromise.get(e);null!=t&&t.resolve(),this._ownersToPromise.delete(e)},t.getPromiseForPendingOperationsAffectingOwner=function(e){if(!this._ownersToPendingOperations.has(e))return null;var t,n=this._ownersToPromise.get(e);if(null!=n)return n.promise;var i=new Promise((function(e){t=e}));return null==t&&r(!1),this._ownersToPromise.set(e,{promise:i,resolve:t}),i},e}();e.exports=i},function(e,t,n){"use strict";var r=n(26),i=n(9),a=n(0),o=n(11),l=o.CLIENT_EXTENSION,u=o.CONNECTION,s=o.CONDITION,c=o.DEFER,f=o.FRAGMENT_SPREAD,d=o.INLINE_DATA_FRAGMENT_SPREAD,p=o.INLINE_FRAGMENT,h=o.LINKED_FIELD,v=o.MODULE_IMPORT,m=o.SCALAR_FIELD,g=o.STREAM,_=n(3),y=_.FRAGMENTS_KEY,b=_.FRAGMENT_OWNER_KEY,E=_.FRAGMENT_PROP_NAME_KEY,k=_.ID_KEY,S=_.MODULE_COMPONENT_KEY,w=_.getArgumentValues,x=_.getStorageKey,T=_.getModuleComponentKey;var C=function(){function e(e,t){this._isMissingData=!1,this._owner=t.owner,this._recordSource=e,this._seenRecords={},this._selector=t,this._variables=t.variables}var t=e.prototype;return t.read=function(){var e=this._selector,t=e.node,n=e.dataID;return{data:this._traverse(t,n,null),isMissingData:this._isMissingData,seenRecords:this._seenRecords,selector:this._selector}},t._traverse=function(e,t,n){var r=this._recordSource.get(t);if(this._seenRecords[t]=r,null==r)return void 0===r&&(this._isMissingData=!0),r;var i=n||{};return this._traverseSelections(e.selections,r,i),i},t._getVariableValue=function(e){return this._variables.hasOwnProperty(e)||a(!1),this._variables[e]},t._traverseSelections=function(e,t,n){for(var r=0;rP.length&&P.push(e)}function F(e,t,n){return null==e?0:function e(t,n,r,i){var l=typeof t;"undefined"!==l&&"boolean"!==l||(t=null);var u=!1;if(null===t)u=!0;else switch(l){case"string":case"number":u=!0;break;case"object":switch(t.$$typeof){case a:case o:u=!0}}if(u)return r(i,t,""===n?"."+L(t,0):n),1;if(u=0,n=""===n?".":n+":",Array.isArray(t))for(var s=0;s