1 | System.register(["path","@babel/template"],function(u){"use strict";var o,m;return{setters:[function(a){o=a.default},function(a){m=a.default}],execute:function(){u("default",f);function a(t,i,e=[]){const r=[...d,...e];if(t.isIdentifier(i)&&r.includes(i.name))return!0;if(t.isMemberExpression(i)){const{property:n}=i;if(t.isIdentifier(n)&&r.includes(n.name))return!0}return!1}const d=["atom","atomFamily","atomWithDefault","atomWithObservable","atomWithReducer","atomWithReset","atomWithStorage","freezeAtom","loadable","selectAtom","splitAtom","unstable_unwrap","atomWithMachine","atomWithImmer","atomWithProxy","atomWithQuery","atomWithMutation","atomWithSubscription","atomWithStore","atomWithHash","atomWithLocation","focusAtom","atomWithValidate","validateAtoms","atomWithCache","atomWithRecoilValue"],c=m.default||m;function f({types:t},i){return{visitor:{ExportDefaultDeclaration(e,r){const{node:n}=e;if(t.isCallExpression(n.declaration)&&a(t,n.declaration.callee,i==null?void 0:i.customAtomNames)){const s=r.filename||"unknown";let l=o.basename(s,o.extname(s));l==="index"&&(l=o.basename(o.dirname(s)));const h=c(`
|
4 | `)({atomIdentifier:t.identifier(l),atom:n.declaration});e.replaceWithMultiple(h)}},VariableDeclarator(e){t.isIdentifier(e.node.id)&&t.isCallExpression(e.node.init)&&a(t,e.node.init.callee,i==null?void 0:i.customAtomNames)&&e.parentPath.insertAfter(t.expressionStatement(t.assignmentExpression("=",t.memberExpression(t.identifier(e.node.id.name),t.identifier("debugLabel")),t.stringLiteral(e.node.id.name))))}}}}}}});
|