You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, subject to the following conditions:
6
+
7
+
1. The original source code of the Software must be used without modification. Distribution of modified source code is prohibited.
8
+
9
+
2. Any output or derivative work produced using the Software may be freely used, modified, and distributed, including for commercial purposes.
10
+
11
+
3. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+
4. Commercial use of the unmodified Software requires a separate agreement with the copyright holder.
14
+
15
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"use strict";varU=Object.create;vari=Object.defineProperty;varq=Object.getOwnPropertyDescriptor;varV=Object.getOwnPropertyNames;varW=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;varD=(t,e)=>{for(varoine)i(t,o,{get:e[o],enumerable:!0})},l=(t,e,o,r)=>{if(e&&typeofe=="object"||typeofe=="function")for(letsofV(e))!A.call(t,s)&&s!==o&&i(t,s,{get:()=>e[s],enumerable:!(r=q(e,s))||r.enumerable});returnt};varn=(t,e,o)=>(o=t!=null?U(W(t)):{},l(e||!t||!t.__esModule?i(o,"default",{value:t,enumerable:!0}):o,t)),z=t=>l(i({},"__esModule",{value:!0}),t);varK={};D(K,{activate:()=>J});module.exports=z(K);varc=n(require("vscode"));varh=n(require("vscode")),d=n(require("path")),a=n(require("fs"));varv=t=>`import { FC } from 'react';
export function ${t}<P = IComponentRequiredProps>(Component: ComponentType<P>) {
24
+
return function(props: P) {
25
+
return (
26
+
<Component { ...props as any } />
27
+
);
28
+
};
29
+
};
30
+
31
+
export default ${t};
32
+
`;varI=t=>{lete=t.fsPath;H.window.showInputBox({prompt:"Enter React hoc name",placeHolder:"withMyHOC"}).then(o=>{if(o){letr=R(o);$.writeFileSync(k.join(e,`${o}.hoc.tsx`),r)}})};varE=n(require("vscode")),p=n(require("fs")),f=n(require("path"));varg=t=>`import { FC } from "react";
`;varj=t=>{lete=t.fsPath;E.window.showInputBox({prompt:"Enter React provider name",placeHolder:"MyProvider (Provider: use same name as context)"}).then(o=>{if(o){letr=`${o}.provider.tsx`,s=g(o),x=m(r);p.mkdirSync(f.join(e,o)),p.writeFileSync(f.join(e,o,r),s),p.writeFileSync(f.join(e,o,"index.ts"),x)}})};varM=n(require("vscode")),b=n(require("fs")),O=n(require("path"));varS=t=>`import { createContext } from "react";
`;varT=t=>{lete=t.fsPath;M.window.showInputBox({prompt:"Enter React context name",placeHolder:"MyContext (A .context prefix is added to the filename.)"}).then(o=>{if(o){letr=S(o);b.writeFileSync(O.join(e,`${o}.context.ts`),r)}})};varB=t=>{G.forEach(e=>{t.subscriptions.push(e)})},G=[c.commands.registerCommand("vscode-react-developer-toolkit.createReactComponent",y),c.commands.registerCommand("vscode-react-developer-toolkit.createReactHOC",I),c.commands.registerCommand("vscode-react-developer-toolkit.createReactHook",P),c.commands.registerCommand("vscode-react-developer-toolkit.createReactProvider",j),c.commands.registerCommand("vscode-react-developer-toolkit.createReactContext",T)];functionJ(t){B(t)}0&&(module.exports={activate});
0 commit comments