|
| 1 | +import { WalkthroughDefinition } from '@remix-api' |
| 2 | + |
| 3 | +/** |
| 4 | + * Built-in walkthrough definitions for Remix IDE. |
| 5 | + * These are registered automatically when the walkthrough plugin activates. |
| 6 | + * Additional walkthroughs can be registered by any plugin via the API. |
| 7 | + */ |
| 8 | + |
| 9 | +export const builtinWalkthroughs: WalkthroughDefinition[] = [ |
| 10 | + { |
| 11 | + id: 'remix-intro-basics', |
| 12 | + name: 'Getting Started with Remix', |
| 13 | + description: 'A quick tour of the Remix IDE interface and basic features.', |
| 14 | + sourcePlugin: 'walkthrough', |
| 15 | + steps: [ |
| 16 | + { |
| 17 | + targetSelector: '[data-id="verticalIconsHomeIcon"]', |
| 18 | + title: 'Welcome to Remix IDE', |
| 19 | + content: 'This is your home button. Click it anytime to return to the landing page with quick links and resources.', |
| 20 | + placement: 'right', |
| 21 | + }, |
| 22 | + { |
| 23 | + targetSelector: '[plugin="filePanel"]', |
| 24 | + title: 'File Explorer', |
| 25 | + content: 'The File Explorer lets you create, open, and manage your Solidity files and workspaces.', |
| 26 | + placement: 'right', |
| 27 | + preAction: { |
| 28 | + plugin: 'menuicons', |
| 29 | + method: 'select', |
| 30 | + args: ['filePanel'], |
| 31 | + }, |
| 32 | + }, |
| 33 | + { |
| 34 | + targetSelector: '[plugin="solidity"]', |
| 35 | + title: 'Solidity Compiler', |
| 36 | + content: 'Compile your contracts here. You can configure compiler versions, optimization, and more.', |
| 37 | + placement: 'right', |
| 38 | + preAction: { |
| 39 | + plugin: 'menuicons', |
| 40 | + method: 'select', |
| 41 | + args: ['solidity'], |
| 42 | + }, |
| 43 | + }, |
| 44 | + { |
| 45 | + targetSelector: '[plugin="udapp"]', |
| 46 | + title: 'Deploy & Run', |
| 47 | + content: 'Deploy your compiled contracts and interact with them. Choose between Remix VM, injected providers (MetaMask), or external providers.', |
| 48 | + placement: 'right', |
| 49 | + preAction: { |
| 50 | + plugin: 'menuicons', |
| 51 | + method: 'select', |
| 52 | + args: ['udapp'], |
| 53 | + }, |
| 54 | + }, |
| 55 | + { |
| 56 | + targetSelector: '[plugin="remixaiassistant"]', |
| 57 | + title: 'AI Assistant', |
| 58 | + content: 'Remix has a built-in <b>AI assistant</b> that can explain code, find bugs, suggest fixes, and even generate contracts from a prompt. Open it anytime to chat with AI about your Solidity code.', |
| 59 | + placement: 'right', |
| 60 | + preAction: { |
| 61 | + plugin: 'menuicons', |
| 62 | + method: 'select', |
| 63 | + args: ['remixaiassistant'], |
| 64 | + }, |
| 65 | + }, |
| 66 | + { |
| 67 | + targetSelector: '[plugin="dgit"]', |
| 68 | + title: 'Git Integration', |
| 69 | + content: 'The <b>Git plugin</b> lets you initialize repos, commit changes, push/pull to GitHub, and manage branches — all without leaving the IDE.', |
| 70 | + placement: 'right', |
| 71 | + preAction: { |
| 72 | + plugin: 'menuicons', |
| 73 | + method: 'select', |
| 74 | + args: ['dgit'], |
| 75 | + }, |
| 76 | + }, |
| 77 | + { |
| 78 | + targetSelector: '[data-id="github-dropdown-toggle-login"]', |
| 79 | + title: 'GitHub Login', |
| 80 | + content: 'Click here to <b>sign in with GitHub</b>. Once connected you can clone private repos, push changes, and publish Gists directly from Remix.', |
| 81 | + placement: 'bottom', |
| 82 | + } |
| 83 | + ], |
| 84 | + }, |
| 85 | + { |
| 86 | + id: 'remix-compile-deploy', |
| 87 | + name: 'Compile & Deploy a Contract', |
| 88 | + description: 'Step-by-step guide to compiling and deploying your first smart contract.', |
| 89 | + sourcePlugin: 'walkthrough', |
| 90 | + steps: [ |
| 91 | + { |
| 92 | + targetSelector: '[plugin="filePanel"]', |
| 93 | + title: 'Step 1: Create a Workspace', |
| 94 | + content: 'We\'ll create a fresh workspace with a sample contract for you. A new <b>"LearnDeploy"</b> workspace is being set up with the default Remix template.', |
| 95 | + placement: 'right', |
| 96 | + preAction: [ |
| 97 | + { plugin: 'filePanel', method: 'createWorkspace', args: ['LearnDeploy', 'remixDefault', false] }, |
| 98 | + { plugin: 'menuicons', method: 'select', args: ['filePanel'] }, |
| 99 | + ], |
| 100 | + }, |
| 101 | + { |
| 102 | + targetSelector: '#editor-container', |
| 103 | + title: 'Step 2: Open the Contract', |
| 104 | + content: 'Here is <b>1_Storage.sol</b> — a simple contract that stores and retrieves a number. Take a look at the code!', |
| 105 | + placement: 'left', |
| 106 | + preAction: { |
| 107 | + plugin: 'fileManager', |
| 108 | + method: 'open', |
| 109 | + args: ['contracts/1_Storage.sol'], |
| 110 | + }, |
| 111 | + }, |
| 112 | + { |
| 113 | + targetSelector: '[plugin="solidity"]', |
| 114 | + title: 'Step 3: Open the Compiler', |
| 115 | + content: 'Click the <b>Solidity Compiler</b> icon in the side panel to open the compilation view.', |
| 116 | + placement: 'right', |
| 117 | + preAction: { |
| 118 | + plugin: 'menuicons', |
| 119 | + method: 'select', |
| 120 | + args: ['solidity'], |
| 121 | + }, |
| 122 | + }, |
| 123 | + { |
| 124 | + targetSelector: '#compileBtn', |
| 125 | + title: 'Step 4: Compile the Contract', |
| 126 | + content: 'We\'re compiling <b>1_Storage.sol</b> for you now. Watch the compiler panel — when it succeeds you\'ll see a green check mark.', |
| 127 | + placement: 'bottom', |
| 128 | + preAction: { |
| 129 | + plugin: 'solidity', |
| 130 | + method: 'compile', |
| 131 | + args: ['contracts/1_Storage.sol'], |
| 132 | + }, |
| 133 | + clickDelay: 1000, |
| 134 | + }, |
| 135 | + { |
| 136 | + targetSelector: '[plugin="udapp"]', |
| 137 | + title: 'Step 5: Open the Deploy Panel', |
| 138 | + content: 'Now switch to <b>Deploy & Run Transactions</b>. This is where you deploy compiled contracts and interact with them.', |
| 139 | + placement: 'right', |
| 140 | + preAction: { |
| 141 | + plugin: 'menuicons', |
| 142 | + method: 'select', |
| 143 | + args: ['udapp'], |
| 144 | + }, |
| 145 | + }, |
| 146 | + { |
| 147 | + targetSelector: '[data-id="Deploy - transact (not payable)"]', |
| 148 | + title: 'Step 6: Deploy!', |
| 149 | + content: 'We\'re deploying the Storage contract to the <b>Remix VM</b> for you — a simulated blockchain running in your browser. No real funds needed!', |
| 150 | + placement: 'bottom', |
| 151 | + clickSelector: '[data-id="deployAndRunClearInstances"]', |
| 152 | + clickDelay: 500, |
| 153 | + }, |
| 154 | + { |
| 155 | + targetSelector: '*[data-shared="universalDappUiInstance"]', |
| 156 | + title: 'Step 7: Interact with Your Contract', |
| 157 | + content: 'Your contract is now deployed! The instance appears here. You can call <b>store()</b> to save a number and <b>retrieve()</b> to read it back. Try it out!', |
| 158 | + placement: 'top', |
| 159 | + clickSelector: '[data-id="Deploy - transact (not payable)"]', |
| 160 | + clickDelay: 2000, |
| 161 | + }, |
| 162 | + { |
| 163 | + targetSelector: '*[data-id="universalDappUiContractActionWrapper"]', |
| 164 | + title: 'Step 8: Contract Functions', |
| 165 | + content: 'Here are all the functions of your contract. <b>Orange</b> buttons are write functions (transactions) and <b>blue</b> buttons are read-only (free calls). Try calling <b>store()</b> with a number and then <b>retrieve()</b> to read it back! 🎉', |
| 166 | + placement: 'top', |
| 167 | + clickSelector: '[data-id="universalDappUiTitleExpander0"]', |
| 168 | + clickDelay: 500, |
| 169 | + }, |
| 170 | + ], |
| 171 | + }, |
| 172 | + ] |
0 commit comments