├── .eslintrc.json ├── .gitignore ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── .vscodeignore ├── CHANGELOG.md ├── LICENSE ├── README.md ├── flutterflow-code-export-0.0.9.vsix ├── images └── icon.png ├── out ├── commands │ ├── codeDownload.js │ └── codeDownload.js.map ├── extension.js ├── extension.js.map ├── helperFunctions │ ├── codedownload.js │ ├── codedownload.js.map │ ├── executeShell.js │ ├── executeShell.js.map │ ├── gitHelpers.js │ ├── gitHelpers.js.map │ ├── pathHelpers.js │ └── pathHelpers.js.map ├── helperMethods │ ├── executeShellCmd.js │ └── executeShellCmd.js.map └── test │ ├── runTest.js │ ├── runTest.js.map │ └── suite │ ├── extension.test.js │ ├── extension.test.js.map │ ├── index.js │ └── index.js.map ├── package-lock.json ├── package.json ├── src ├── extension.ts ├── helperFunctions │ ├── codedownload.ts │ ├── executeShell.ts │ └── pathHelpers.ts └── test │ ├── runTest.ts │ └── suite │ ├── extension.test.ts │ └── index.ts └── tsconfig.json /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "root": true, 3 | "parser": "@typescript-eslint/parser", 4 | "parserOptions": { 5 | "ecmaVersion": 6, 6 | "sourceType": "module" 7 | }, 8 | "plugins": [ 9 | "@typescript-eslint" 10 | ], 11 | "rules": { 12 | "@typescript-eslint/naming-convention": "warn", 13 | "@typescript-eslint/semi": "warn", 14 | "curly": "warn", 15 | "eqeqeq": "warn", 16 | "no-throw-literal": "warn", 17 | "semi": "off" 18 | }, 19 | "ignorePatterns": [ 20 | "out", 21 | "dist", 22 | "**/*.d.ts" 23 | ] 24 | } 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See http://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "dbaeumer.vscode-eslint" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | // A launch configuration that compiles the extension and then opens it inside a new window 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | { 6 | "version": "0.2.0", 7 | "configurations": [ 8 | { 9 | "name": "Run Extension", 10 | "type": "extensionHost", 11 | "request": "launch", 12 | "args": [ 13 | "--extensionDevelopmentPath=${workspaceFolder}" 14 | ], 15 | "outFiles": [ 16 | "${workspaceFolder}/out/**/*.js" 17 | ], 18 | "preLaunchTask": "${defaultBuildTask}" 19 | }, 20 | { 21 | "name": "Extension Tests", 22 | "type": "extensionHost", 23 | "request": "launch", 24 | "args": [ 25 | "--extensionDevelopmentPath=${workspaceFolder}", 26 | "--extensionTestsPath=${workspaceFolder}/out/test/suite/index" 27 | ], 28 | "outFiles": [ 29 | "${workspaceFolder}/out/test/**/*.js" 30 | ], 31 | "preLaunchTask": "${defaultBuildTask}" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | // Place your settings in this file to overwrite default and user settings. 2 | { 3 | "files.exclude": { 4 | "out": false // set this to true to hide the "out" folder with the compiled JS files 5 | }, 6 | "search.exclude": { 7 | "out": true // set this to false to include "out" folder in search results 8 | }, 9 | // Turn off tsc task auto detection since we have the necessary tasks as npm scripts 10 | "typescript.tsc.autoDetect": "off" 11 | } -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | // See https://go.microsoft.com/fwlink/?LinkId=733558 2 | // for the documentation about the tasks.json format 3 | { 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "type": "npm", 8 | "script": "watch", 9 | "problemMatcher": "$tsc-watch", 10 | "isBackground": true, 11 | "presentation": { 12 | "reveal": "never" 13 | }, 14 | "group": { 15 | "kind": "build", 16 | "isDefault": true 17 | } 18 | } 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | .vscode/** 2 | .vscode-test/** 3 | src/** 4 | .gitignore 5 | .yarnrc 6 | vsc-extension-quickstart.md 7 | **/tsconfig.json 8 | **/.eslintrc.json 9 | **/*.map 10 | **/*.ts 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | All notable changes to the "flutterflow-code" extension will be documented in this file. 4 | 5 | ## [v0.0.7] 6 | Fixed a pescky path bug that recursively copied code 7 | Some code refactoring 8 | ## [v0.0.5] 9 | Fixed a folder rename bug 10 | ## [v0.0.4] 11 | 12 | - Added support for windows devices 13 | - Added support to initiate a flutter run session 14 | - Added support to initialize git locally 15 | ## [v0.0.3] 16 | 17 | - Added support for code download without assets 18 | ## [v0.0.2] 19 | 20 | - Initial release -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Abhishek Pathak 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FlutterFlow Code Export 2 | 3 | Simple plugin to easily download your flutterflow project code. 4 | 5 | **This is not an official FlutterFlow plugin** 6 | 7 | ## Features 8 | 9 | Download code of your FlutterFlow Project 10 | 11 | * Run code locally (no more waiting for test mode) 12 | * Better control over code management (works even without github) 13 | 14 | More details are [here](https://community.flutterflow.io/c/show-your-work/vs-code-plugin-for-flutterflow-code-download) 15 | 16 | ## Requirements 17 | 18 | dart and flutter need to be installed and dart should be in $PATH. 19 | 20 | ## Extension Settings 21 | 22 | This extension contributes the following settings: 23 | 24 | * `flutterflow.userApiToken`: Set the FlutterFlow API token 25 | * `flutterflow.activeProject`: Set the active project ID to sync 26 | * `flutterflow.baseDirectory`: Full path to a local folder that you want to use to download project code 27 | * `flutterflow.useGit`: Flag to enable local git repo 28 | * `flutterflow.openDirectory`: Flag to automatically open downloaded code in a window 29 | * `flutterflow.device`: Device ID to be used with flutter run -d 30 | 31 | ## Known Issues 32 | 33 | Please raise issues at : https://github.com/krabhishek/flutterflow-vscode-extension/issues 34 | 35 | ## Release Notes 36 | 37 | * Download flutterflow project code. Uses flutterflow_cli : https://pub.dev/packages/flutterflow_cli 38 | 39 | ### 0.0.7 40 | Fixed a bug with recursive folder 41 | ### 0.0.4 42 | Added support for windows devices and use local git repo 43 | Also added shortcut to start a local debugging session 44 | ### 0.0.3 45 | 46 | Added support to download code without assets (can speedup code download for projects with lots of assets) 47 | ### 0.0.2 48 | 49 | Initial release of FlutterFlow Code Export plugin 50 | 51 | **Enjoy!** 52 | -------------------------------------------------------------------------------- /flutterflow-code-export-0.0.9.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krabhishek/flutterflow-vscode-extension/8e9329b49efc40f96a70c50836ede3edf830049f/flutterflow-code-export-0.0.9.vsix -------------------------------------------------------------------------------- /images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/krabhishek/flutterflow-vscode-extension/8e9329b49efc40f96a70c50836ede3edf830049f/images/icon.png -------------------------------------------------------------------------------- /out/commands/codeDownload.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.downloadCode = void 0; 4 | const vscode = require("vscode"); 5 | const os_1 = require("os"); 6 | const executeShellCmd_1 = require("../helperMethods/executeShellCmd"); 7 | async function downloadCode(config) { 8 | vscode.window.showInformationMessage("Starting flutterflow code download..."); 9 | const token = process.env.FLUTTERFLOW_API_TOKEN || 10 | vscode.workspace.getConfiguration("flutterflow").get("userApiToken"); 11 | const projectId = process.env.FLUTTERFLOW_ACTIVE_PROJECT_ID || 12 | vscode.workspace.getConfiguration("flutterflow").get("activeProject"); 13 | let path = process.env.FLUTTERFLOW_WORKING_DIR || 14 | vscode.workspace.getConfiguration("flutterflow").get("workingDirectory"); 15 | try { 16 | if (token === "" || token === undefined) { 17 | vscode.window.showErrorMessage("Your FlutterFlow API token is not set. Please set in vscode settings."); 18 | const err = "FlutterFlow API token not set"; 19 | throw err; 20 | } 21 | if (projectId === "" || projectId === undefined) { 22 | vscode.window.showErrorMessage("Your flutterflow project ID not set. Please set Please set in vscode settings."); 23 | const err = "FlutterFlow project ID not set"; 24 | throw err; 25 | } 26 | if (path === "" || path === undefined) { 27 | vscode.window.showErrorMessage("Your flutterflow working directory is not set. Please set in vscode settings."); 28 | const err = "FlutterFlow working directory not set"; 29 | throw err; 30 | } 31 | const activateCli = await (0, executeShellCmd_1.execShell)("dart pub global activate flutterflow_cli"); 32 | const randomPathSuffix = Math.floor(Math.random() * 100000000); 33 | const tmpPath = `${(0, os_1.tmpdir)()}/${randomPathSuffix}`; 34 | if (config.withAssets == true) { 35 | await (0, executeShellCmd_1.execShell)(`dart pub global run flutterflow_cli export-code --project ${projectId} --dest ${tmpPath} --include-assets --token ${token}`); 36 | } 37 | else { 38 | await (0, executeShellCmd_1.execShell)(`dart pub global run flutterflow_cli export-code --project ${projectId} --dest ${tmpPath} --no-include-assets --token ${token}`); 39 | } 40 | const folderName = (await (0, executeShellCmd_1.execShell)(`cd ${tmpPath} && ls`)).trim(); 41 | await (0, executeShellCmd_1.execShell)(`cp -rf ${tmpPath}/${folderName}/ ${path}`); 42 | await (0, executeShellCmd_1.execShell)(`rm -rf ${tmpPath}`); 43 | vscode.window.showInformationMessage("Code download successful"); 44 | } 45 | catch (err) { 46 | console.error(` 47 | Could not sync code \n 48 | ${err} 49 | `); 50 | vscode.window.showErrorMessage(`Could not download code \n 51 | ${err} 52 | `); 53 | console.error(err); 54 | } 55 | if (vscode.workspace.getConfiguration("flutterflow").get("openDirectory")) { 56 | await vscode.commands.executeCommand("vscode.openFolder", vscode.Uri.file(`${path}`)); 57 | } 58 | } 59 | exports.downloadCode = downloadCode; 60 | //# sourceMappingURL=codeDownload.js.map -------------------------------------------------------------------------------- /out/commands/codeDownload.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"codeDownload.js","sourceRoot":"","sources":["../../src/commands/codeDownload.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,2BAA4B;AAC5B,sEAA6D;AAEtD,KAAK,UAAU,YAAY,CAAC,MAA+B;IAChE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,uCAAuC,CAAC,CAAC;IAC9E,MAAM,KAAK,GACT,OAAO,CAAC,GAAG,CAAC,qBAAqB;QACjC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IACvE,MAAM,SAAS,GACb,OAAO,CAAC,GAAG,CAAC,6BAA6B;QACzC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IACxE,IAAI,IAAI,GACN,OAAO,CAAC,GAAG,CAAC,uBAAuB;QACnC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAA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AA,2BAAS,EAAC,UAAU,OAAO,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC,CAAC;QAE5D,MAAM,IAAA,2BAAS,EAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QAErC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;KAClE;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC;;IAEd,GAAG;KACF,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAC/B,GAAG;KACF,CAAC,CAAC;QACH,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACpB;IACD,IAAI,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,EAAE;QACzE,MAAM,MAAM,CAAC,QAAQ,CAAC,cAAc,CAClC,mBAAmB,EACnB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC,CAC3B,CAAC;KACH;AACH,CAAC;AAzED,oCAyEC"} -------------------------------------------------------------------------------- /out/extension.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.deactivate = exports.activate = void 0; 4 | const vscode = require("vscode"); 5 | const codedownload_1 = require("./helperFunctions/codedownload"); 6 | const pathHelpers_1 = require("./helperFunctions/pathHelpers"); 7 | function activate(context) { 8 | const syncWithAssets = vscode.commands.registerCommand("flutterflow-code-export.sync", async () => { 9 | (0, codedownload_1.downloadCode)({ withAssets: true }); 10 | }); 11 | const syncWithoutAssets = vscode.commands.registerCommand("flutterflow-code-export.syncFast", async () => { 12 | (0, codedownload_1.downloadCode)({ withAssets: false }); 13 | }); 14 | const flutterRun = vscode.commands.registerCommand("flutterflow-code-export.run", async () => { 15 | const selectedDevice = vscode.workspace 16 | .getConfiguration("flutterflow") 17 | .get("device"); 18 | if (selectedDevice === undefined) { 19 | vscode.window.showErrorMessage("Device for flutter run is not defined"); 20 | } 21 | let projectId = process.env.FLUTTERFLOW_ACTIVE_PROJECT_ID || 22 | vscode.workspace.getConfiguration("flutterflow").get("activeProject"); 23 | if (projectId === "" || projectId === undefined) { 24 | const userInput = await vscode.window.showInputBox({ 25 | placeHolder: "Your FlutterFlow Project ID", 26 | prompt: "Please enter your FlutterFlow project ID", 27 | }); 28 | projectId = userInput; 29 | } 30 | let baseDir = process.env.FLUTTERFLOW_HOME_DIR || 31 | vscode.workspace.getConfiguration("flutterflow").get("baseDirectory"); 32 | if (baseDir === "" || baseDir === undefined) { 33 | vscode.window.showInformationMessage("Your FlutterFlow HOME is not set. \nDownloading it current directory"); 34 | baseDir = "."; 35 | } 36 | if (projectId !== "" || projectId !== undefined) { 37 | const term = vscode.window.createTerminal("flutterflow"); 38 | term.show(true); 39 | term.sendText(`cd "${(0, pathHelpers_1.getProjectWorkingDir)(projectId, baseDir)}"`); 40 | term.sendText(`flutter run -d ${selectedDevice}`); 41 | } 42 | else { 43 | vscode.window.showErrorMessage("Your FlutterFlow project ID is not set."); 44 | } 45 | }); 46 | context.subscriptions.push(syncWithAssets); 47 | context.subscriptions.push(syncWithoutAssets); 48 | } 49 | exports.activate = activate; 50 | // This method is called when your extension is deactivated 51 | function deactivate() { } 52 | exports.deactivate = deactivate; 53 | //# sourceMappingURL=extension.js.map -------------------------------------------------------------------------------- /out/extension.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.js","sourceRoot":"","sources":["../src/extension.ts"],"names":[],"mappings":";;;AACA,iCAAiC;AACjC,iEAA8D;AAC9D,+DAEuC;AAEvC,SAAgB,QAAQ,CAAC,OAAgC;IACvD,MAAM,cAAc,GAAG,MAAM,CAAC,QAAQ,CAAC,eAAe,CACpD,8BAA8B,EAC9B,KAAK,IAAI,EAAE;QACT,IAAA,2BAAY,EAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;IACrC,CAAC,CACF,CAAC;IAEF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AAK,SAAS,EAAE;YAC9C,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;YACzD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAChB,IAAI,CAAC,QAAQ,CAAC,OAAO,IAAA,kCAAoB,EAAC,SAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;YACnE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,cAAc,EAAE,CAAC,CAAC;SACnD;aAAM;YACL,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,yCAAyC,CAAC,CAAC;SAC3E;IAED,CAAC,CACF,CAAC;IAEF,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3C,OAAO,CAAC,aAAa,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AAChD,CAAC;AA3DD,4BA2DC;AAED,2DAA2D;AAC3D,SAAgB,UAAU,KAAI,CAAC;AAA/B,gCAA+B"} -------------------------------------------------------------------------------- /out/helperFunctions/codedownload.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.downloadCode = void 0; 4 | const vscode = require("vscode"); 5 | const executeShell_1 = require("./executeShell"); 6 | const pathHelpers_1 = require("./pathHelpers"); 7 | const downloadCode = async (config) => { 8 | vscode.window.showInformationMessage("Starting flutterflow code download..."); 9 | let token = process.env.FLUTTERFLOW_API_TOKEN || 10 | vscode.workspace.getConfiguration("flutterflow").get("userApiToken"); 11 | if (token === "" || token === undefined) { 12 | const userInput = await vscode.window.showInputBox({ 13 | placeHolder: "Your FlutterFlow API token", 14 | prompt: "Please enter your FlutterFlow API token", 15 | }); 16 | token = userInput; 17 | } 18 | let projectId = process.env.FLUTTERFLOW_ACTIVE_PROJECT_ID || 19 | vscode.workspace.getConfiguration("flutterflow").get("activeProject"); 20 | if (projectId === "" || projectId === undefined) { 21 | const userInput = await vscode.window.showInputBox({ 22 | placeHolder: "Your FlutterFlow Project ID", 23 | prompt: "Please enter your FlutterFlow project ID", 24 | }); 25 | projectId = userInput; 26 | } 27 | const openWindow = process.env.FLUTTERFLOW_OPEN_DIR || 28 | vscode.workspace 29 | .getConfiguration("flutterflow") 30 | .get("openDirectory"); 31 | let path = process.env.FLUTTERFLOW_BASE_DIR || 32 | vscode.workspace.getConfiguration("flutterflow").get("baseDirectory"); 33 | if (path === "" || path === undefined) { 34 | const userInput = await vscode.window.showInputBox({ 35 | placeHolder: "Your FlutterFlow home directory", 36 | prompt: "Please enter your FlutterFlow home directory", 37 | }); 38 | path = userInput; 39 | } 40 | try { 41 | if (token === "" || token === undefined) { 42 | vscode.window.showErrorMessage("Your FlutterFlow API token is not set. Please set in vscode settings."); 43 | const err = "FlutterFlow API token not set"; 44 | throw err; 45 | } 46 | if (projectId === "" || projectId === undefined) { 47 | vscode.window.showErrorMessage("Your flutterflow project ID not set. Please set Please set in vscode settings."); 48 | const err = "FlutterFlow project ID not set"; 49 | throw err; 50 | } 51 | if (path === "" || path === undefined) { 52 | const err = "FlutterFlow Home directory is not set"; 53 | throw err; 54 | } 55 | await (0, executeShell_1.execShell)("dart pub global activate flutterflow_cli"); 56 | if (config.withAssets === true) { 57 | await (0, executeShell_1.execShell)(`dart pub global run flutterflow_cli export-code --project ${projectId} --dest ${(0, pathHelpers_1.getProjectWorkingDir)(projectId, path)} --include-assets --token ${token} --no-parent-folder`); 58 | } 59 | else { 60 | await (0, executeShell_1.execShell)(`dart pub global run flutterflow_cli export-code --project ${projectId} --dest ${(0, pathHelpers_1.getProjectWorkingDir)(projectId, path)} --no-include-assets --token ${token} --no-parent-folder`); 61 | } 62 | if (openWindow === true) { 63 | const folderUri = vscode.Uri.file((0, pathHelpers_1.getProjectWorkingDir)(projectId, path)); 64 | vscode.commands.executeCommand(`vscode.openFolder`, folderUri); 65 | } 66 | vscode.window.showInformationMessage("Code download successful"); 67 | } 68 | catch (err) { 69 | console.error(` 70 | Could not sync code \n 71 | ${err} 72 | `); 73 | vscode.window.showErrorMessage(`Could not download code \n 74 | ${err} 75 | `); 76 | console.error(err); 77 | } 78 | }; 79 | exports.downloadCode = downloadCode; 80 | //# sourceMappingURL=codedownload.js.map -------------------------------------------------------------------------------- /out/helperFunctions/codedownload.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"codedownload.js","sourceRoot":"","sources":["../../src/helperFunctions/codedownload.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AACjC,iDAA2C;AAC3C,+CAEuB;AAEvB,MAAM,YAAY,GAAG,KAAK,EAAE,MAA+B,EAAE,EAAE;IAC7D,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,uCAAuC,CAAC,CAAC;IAC9E,IAAI,KAAK,GACP,OAAO,CAAC,GAAG,CAAC,qBAAqB;QACjC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;IAErE,IAAG,KAAK,KAAM,EAAE,IAAI,KAAK,KAAK,SAAS,EAAE;QACvC,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YACjD,WAAW,EAAE,4BAA4B;YACzC,MAAM,EAAE,yCAAyC;SAClD,CAAC,CAAC;QACH,KAAK,GAAG,SAAS,CAAC;KACnB;IACH,IAAI,SAAS,GACX,OAAO,CAAC,GAAG,CAAC,6BAA6B;QACzC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;IAEtE,IAAG,SAAS,KAAM,EAAE,IAAI,SAAS,KAAK,SAAS,EAAE;QAC/C,MAAM,SAAS,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC;YACjD,WAAW,EAAE,6BAA6B;YAC1C,MAAM,EAAE,0CAA0C;SACnD,CAAC,CAAC;QACH,SAAS,GAAG,SAAS,CAAC;KACvB;IAEH,MAAM,UAAU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AC,6BAA6B,KAAK,qBAAqB,CAC9K,CAAC;SACH;aAAM;YACL,MAAM,IAAA,wBAAS,EACb,6DAA6D,SAAS,WAAW,IAAA,kCAAoB,EAAC,SAAS,EAAE,IAAI,CAAC,gCAAgC,KAAK,qBAAqB,CACjL,CAAC;SACH;QAED,IAAI,UAAU,KAAK,IAAI,EAAE;YACvB,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,IAAA,kCAAoB,EAAC,SAAS,EAAE,IAAI,CAAE,CAAC,CAAC;YAC1E,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;SAChE;QAED,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,0BAA0B,CAAC,CAAC;KAClE;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,KAAK,CAAC;;QAEV,GAAG;SACF,CAAC,CAAC;QACP,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAC3B,GAAG;SACF,CAAC,CAAC;QACP,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;KACpB;AACH,CAAC,CAAC;AAEO,oCAAY"} -------------------------------------------------------------------------------- /out/helperFunctions/executeShell.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.execShell = void 0; 4 | const cp = require("child_process"); 5 | // this function would execute the shell commands 6 | const execShell = (cmd) => new Promise((resolve, reject) => { 7 | cp.exec(cmd, (err, out) => { 8 | if (err) { 9 | return reject(err); 10 | } 11 | return resolve(out); 12 | }); 13 | }); 14 | exports.execShell = execShell; 15 | //# sourceMappingURL=executeShell.js.map -------------------------------------------------------------------------------- /out/helperFunctions/executeShell.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"executeShell.js","sourceRoot":"","sources":["../../src/helperFunctions/executeShell.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AAEpC,iDAAiD;AACjD,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CAChC,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACtC,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxB,IAAI,GAAG,EAAE;YACP,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;SACpB;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEK,8BAAS"} -------------------------------------------------------------------------------- /out/helperFunctions/gitHelpers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.gitStash = exports.shouldStash = exports.isGitinitalized = exports.initalizeGit = void 0; 4 | const vscode = require("vscode"); 5 | const executeShell_1 = require("./executeShell"); 6 | const pathHelpers_1 = require("./pathHelpers"); 7 | async function initalizeGit() { 8 | const projectWorkingDir = (0, pathHelpers_1.getProjectWorkingDir)(); 9 | try { 10 | if (!(await isGitinitalized())) { 11 | console.log(`cd "${projectWorkingDir}" && git init`); 12 | const status = await (0, executeShell_1.execShell)(`cd "${projectWorkingDir}" && git init`); 13 | console.log(status); 14 | vscode.window.showInformationMessage("Successfully initalized git"); 15 | } 16 | else { 17 | vscode.window.showInformationMessage("Git is already initialized"); 18 | } 19 | } 20 | catch (err) { 21 | vscode.window.showErrorMessage("Git Initalize failed"); 22 | vscode.window.showErrorMessage(err); 23 | throw err; 24 | } 25 | } 26 | exports.initalizeGit = initalizeGit; 27 | async function isGitinitalized() { 28 | const projectWorkingDir = (0, pathHelpers_1.getProjectWorkingDir)(); 29 | try { 30 | await (0, executeShell_1.execShell)(`cd "${projectWorkingDir}" && git status`); 31 | return true; 32 | } 33 | catch (err) { 34 | return false; 35 | } 36 | } 37 | exports.isGitinitalized = isGitinitalized; 38 | async function shouldStash() { 39 | let shouldStashFlag = false; 40 | const projectWorkingDir = (0, pathHelpers_1.getProjectWorkingDir)(); 41 | try { 42 | if (!(await isGitinitalized())) { 43 | return false; 44 | } 45 | const status = await (0, executeShell_1.execShell)(`cd "${projectWorkingDir}" && git status`); 46 | if (status.includes("Untracked files")) { 47 | console.log(status.includes("Untracked files")); 48 | shouldStashFlag = true; 49 | } 50 | if (status.includes("Changes to be committed")) { 51 | console.log(status.includes("Changes to be committed")); 52 | shouldStashFlag = true; 53 | } 54 | return shouldStashFlag; 55 | } 56 | catch (err) { 57 | throw err; 58 | } 59 | } 60 | exports.shouldStash = shouldStash; 61 | async function gitStash() { 62 | const projectWorkingDir = (0, pathHelpers_1.getProjectWorkingDir)(); 63 | try { 64 | if (await shouldStash()) { 65 | const status = await (0, executeShell_1.execShell)(`cd "${projectWorkingDir}" && git stash`); 66 | vscode.window.showInformationMessage("Stashed changes. Use git stash pop to restore"); 67 | } 68 | } 69 | catch (err) { 70 | vscode.window.showErrorMessage("Could not stashed changes"); 71 | throw err; 72 | } 73 | } 74 | exports.gitStash = gitStash; 75 | //# sourceMappingURL=gitHelpers.js.map -------------------------------------------------------------------------------- /out/helperFunctions/gitHelpers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"gitHelpers.js","sourceRoot":"","sources":["../../src/helperFunctions/gitHelpers.ts"],"names":[],"mappings":";;;AACA,iCAAiC;AACjC,iDAA2C;AAC3C,+CAAqD;AAErD,KAAK,UAAU,YAAY;IACzB,MAAM,iBAAiB,GAAG,IAAA,kCAAoB,GAAE,CAAC;IACjD,IAAI;QACF,IAAI,CAAC,CAAC,MAAM,eAAe,EAAE,CAAC,EAAE;YAC9B,OAAO,CAAC,GAAG,CAAC,OAAO,iBAAiB,eAAe,CAAC,CAAC;YACrD,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,OAAO,iBAAiB,eAAe,CAAC,CAAC;YACxE,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;YACpB,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAA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ACD,OAAO,eAAe,CAAC;KACxB;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAiBuC,kCAAW;AAfnD,KAAK,UAAU,QAAQ;IACrB,MAAM,iBAAiB,GAAG,IAAA,kCAAoB,GAAE,CAAC;IACjD,IAAI;QACF,IAAI,MAAM,WAAW,EAAE,EAAE;YACvB,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,OAAO,iBAAiB,gBAAgB,CAAC,CAAC;YACzE,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAClC,+CAA+C,CAChD,CAAC;SACH;KACF;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,2BAA2B,CAAC,CAAC;QAC5D,MAAM,GAAG,CAAC;KACX;AACH,CAAC;AAEoD,4BAAQ"} -------------------------------------------------------------------------------- /out/helperFunctions/pathHelpers.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.validateProjectConfig = exports.getProjectWorkingDir = void 0; 4 | const os = require("os"); 5 | const vscode = require("vscode"); 6 | function validateProjectConfig(projectId) { 7 | if (projectId === "" || projectId === undefined) { 8 | vscode.window.showErrorMessage("Your flutterflow project ID not set. Please set Please set in vscode settings."); 9 | return false; 10 | } 11 | return true; 12 | } 13 | exports.validateProjectConfig = validateProjectConfig; 14 | function getProjectWorkingDir(projectId, baseDir) { 15 | if (!validateProjectConfig(projectId)) { 16 | return undefined; 17 | } 18 | if (baseDir === "" || baseDir === undefined) { 19 | baseDir = "."; 20 | } 21 | if (os.platform() === "win32") { 22 | console.log(`getProjectWorkingDir : ${baseDir}\\${projectId} `); 23 | return `${baseDir}\\${projectId}`; 24 | } 25 | else { 26 | console.log(`getProjectWorkingDir : ${baseDir}/${projectId} `); 27 | return `${baseDir}/${projectId}`; 28 | } 29 | } 30 | exports.getProjectWorkingDir = getProjectWorkingDir; 31 | //# sourceMappingURL=pathHelpers.js.map -------------------------------------------------------------------------------- /out/helperFunctions/pathHelpers.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"pathHelpers.js","sourceRoot":"","sources":["../../src/helperFunctions/pathHelpers.ts"],"names":[],"mappings":";;;AAAA,yBAAyB;AACzB,iCAAiC;AAGjC,SAAS,qBAAqB,CAAC,SAAiB;IAC9C,IAAI,SAAS,KAAK,EAAE,IAAI,SAAS,KAAK,SAAS,EAAE;QAC/C,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAC5B,gFAAgF,CACjF,CAAC;QACF,OAAO,KAAK,CAAC;KACd;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAuBC,sDAAqB;AArBvB,SAAS,oBAAoB,CAAC,SAAiB,EAAE,OAAe;IAC9D,IAAI,CAAC,qBAAqB,CAAC,SAAS,CAAC,EAAE;QACrC,OAAO,SAAS,CAAC;KAClB;IAED,IAAG,OAAO,KAAK,EAAE,IAAI,OAAO,KAAK,SAAS,EAAE;QAC1C,OAAO,GAAG,GAAG,CAAC;KACf;IAED,IAAI,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,EAAE;QAC7B,OAAO,CAAC,GAAG,CAAC,0BAA0B,OAAO,KAAK,SAAS,GAAG,CAAC,CAAC;QAChE,OAAO,GAAG,OAAO,KAAK,SAAS,EAAE,CAAC;KACnC;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,0BAA0B,OAAO,IAAI,SAAS,GAAG,CAAC,CAAC;QAC/D,OAAO,GAAG,OAAO,IAAI,SAAS,EAAE,CAAC;KAClC;AACH,CAAC;AAIC,oDAAoB"} -------------------------------------------------------------------------------- /out/helperMethods/executeShellCmd.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.execShell = void 0; 4 | const cp = require("child_process"); 5 | // this function would execute the shell commands 6 | const execShell = (cmd) => new Promise((resolve, reject) => { 7 | cp.exec(cmd, (err, out) => { 8 | if (err) { 9 | return reject(err); 10 | } 11 | return resolve(out); 12 | }); 13 | }); 14 | exports.execShell = execShell; 15 | //# sourceMappingURL=executeShellCmd.js.map -------------------------------------------------------------------------------- /out/helperMethods/executeShellCmd.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"executeShellCmd.js","sourceRoot":"","sources":["../../src/helperMethods/executeShellCmd.ts"],"names":[],"mappings":";;;AAAA,oCAAoC;AAEpC,iDAAiD;AAC1C,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,EAAE,CACvC,IAAI,OAAO,CAAS,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IACtC,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;QACxB,IAAI,GAAG,EAAE;YACP,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC;SACpB;QACD,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;IACtB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AARQ,QAAA,SAAS,aAQjB"} -------------------------------------------------------------------------------- /out/test/runTest.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const path = require("path"); 4 | const test_electron_1 = require("@vscode/test-electron"); 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, '../../'); 10 | // The path to test runner 11 | // Passed to --extensionTestsPath 12 | const extensionTestsPath = path.resolve(__dirname, './suite/index'); 13 | // Download VS Code, unzip it and run the integration test 14 | await (0, test_electron_1.runTests)({ extensionDevelopmentPath, extensionTestsPath }); 15 | } 16 | catch (err) { 17 | console.error('Failed to run tests'); 18 | process.exit(1); 19 | } 20 | } 21 | main(); 22 | //# sourceMappingURL=runTest.js.map -------------------------------------------------------------------------------- /out/test/runTest.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"runTest.js","sourceRoot":"","sources":["../../src/test/runTest.ts"],"names":[],"mappings":";;AAAA,6BAA6B;AAE7B,yDAAiD;AAEjD,KAAK,UAAU,IAAI;IAClB,IAAI;QACH,4DAA4D;QAC5D,yCAAyC;QACzC,MAAM,wBAAwB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAEnE,0BAA0B;QAC1B,iCAAiC;QACjC,MAAM,kBAAkB,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QAEpE,0DAA0D;QAC1D,MAAM,IAAA,wBAAQ,EAAC,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,CAAC,CAAC;KACjE;IAAC,OAAO,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KAChB;AACF,CAAC;AAED,IAAI,EAAE,CAAC"} -------------------------------------------------------------------------------- /out/test/suite/extension.test.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | const assert = require("assert"); 4 | // You can import and use all API from the 'vscode' module 5 | // as well as import your extension to test it 6 | const vscode = require("vscode"); 7 | // import * as myExtension from '../../extension'; 8 | suite('Extension Test Suite', () => { 9 | vscode.window.showInformationMessage('Start all tests.'); 10 | test('Sample test', () => { 11 | assert.strictEqual(-1, [1, 2, 3].indexOf(5)); 12 | assert.strictEqual(-1, [1, 2, 3].indexOf(0)); 13 | }); 14 | }); 15 | //# sourceMappingURL=extension.test.js.map -------------------------------------------------------------------------------- /out/test/suite/extension.test.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"extension.test.js","sourceRoot":"","sources":["../../../src/test/suite/extension.test.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AAEjC,0DAA0D;AAC1D,8CAA8C;AAC9C,iCAAiC;AACjC,kDAAkD;AAElD,KAAK,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,MAAM,CAAC,MAAM,CAAC,sBAAsB,CAAC,kBAAkB,CAAC,CAAC;IAEzD,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE;QACxB,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"} -------------------------------------------------------------------------------- /out/test/suite/index.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | Object.defineProperty(exports, "__esModule", { value: true }); 3 | exports.run = void 0; 4 | const path = require("path"); 5 | const Mocha = require("mocha"); 6 | const glob = require("glob"); 7 | function run() { 8 | // Create the mocha test 9 | const mocha = new Mocha({ 10 | ui: 'tdd', 11 | color: true 12 | }); 13 | const testsRoot = path.resolve(__dirname, '..'); 14 | return new Promise((c, e) => { 15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { 16 | if (err) { 17 | return e(err); 18 | } 19 | // Add files to the test suite 20 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); 21 | try { 22 | // Run the mocha test 23 | mocha.run(failures => { 24 | if (failures > 0) { 25 | e(new Error(`${failures} tests failed.`)); 26 | } 27 | else { 28 | c(); 29 | } 30 | }); 31 | } 32 | catch (err) { 33 | console.error(err); 34 | e(err); 35 | } 36 | }); 37 | }); 38 | } 39 | exports.run = run; 40 | //# sourceMappingURL=index.js.map -------------------------------------------------------------------------------- /out/test/suite/index.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/test/suite/index.ts"],"names":[],"mappings":";;;AAAA,6BAA6B;AAC7B,+BAA+B;AAC/B,6BAA6B;AAE7B,SAAgB,GAAG;IAClB,wBAAwB;IACxB,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC;QACvB,EAAE,EAAE,KAAK;QACT,KAAK,EAAE,IAAI;KACX,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;IAEhD,OAAO,IAAI,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;QAC3B,IAAI,CAAC,eAAe,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YACxD,IAAI,GAAG,EAAE;gBACR,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC;aACd;YAED,8BAA8B;YAC9B,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;YAE9D,IAAI;gBACH,qBAAqB;gBACrB,KAAK,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE;oBACpB,IAAI,QAAQ,GAAG,CAAC,EAAE;wBACjB,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,QAAQ,gBAAgB,CAAC,CAAC,CAAC;qBAC1C;yBAAM;wBACN,CAAC,EAAE,CAAC;qBACJ;gBACF,CAAC,CAAC,CAAC;aACH;YAAC,OAAO,GAAG,EAAE;gBACb,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACnB,CAAC,CAAC,GAAG,CAAC,CAAC;aACP;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC;AAjCD,kBAiCC"} -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "flutterflow-code-export", 3 | "displayName": "FlutterFlow Code Export", 4 | "description": "Allows to easily manage code exports for your flutterflow projects.", 5 | "icon": "images/icon.png", 6 | "publisher": "krabhishek", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/krabhishek/flutterflow-vscode-extension.git" 10 | }, 11 | "version": "0.0.9", 12 | "engines": { 13 | "vscode": "^1.74.0" 14 | }, 15 | "categories": [ 16 | "Other" 17 | ], 18 | "activationEvents": [ 19 | "onCommand:flutterflow-code-export.sync", 20 | "onCommand:flutterflow-code-export.syncFast" 21 | ], 22 | "main": "./out/extension.js", 23 | "contributes": { 24 | "commands": [ 25 | { 26 | "command": "flutterflow-code-export.sync", 27 | "title": "Download project code with assets", 28 | "category": "FlutterFlow Code" 29 | }, 30 | { 31 | "command": "flutterflow-code-export.syncFast", 32 | "title": "Download project code without assets (faster)", 33 | "category": "FlutterFlow Code" 34 | }, 35 | { 36 | "command": "flutterflow-code-export.run", 37 | "title": "Start a flutter run session in integrated terminal", 38 | "category": "FlutterFlow Code" 39 | } 40 | ], 41 | "keybindings": [ 42 | { 43 | "command": "flutterflow-code-export.sync", 44 | "key": "ctrl+alt+shift+s", 45 | "mac": "cmd+ctrl+shift+s" 46 | }, 47 | { 48 | "command": "flutterflow-code-export.syncFast", 49 | "key": "ctrl+alt+shift+f", 50 | "mac": "cmd+ctrl+shift+f" 51 | }, 52 | { 53 | "command": "flutterflow-code-export.run", 54 | "key": "ctrl+alt+shift+r", 55 | "mac": "cmd+ctrl+shift+r" 56 | } 57 | ], 58 | "configuration": { 59 | "title": "FlutterFlow", 60 | "properties": { 61 | "flutterflow.userApiToken": { 62 | "type": "string", 63 | "description": "Your FlutterFlow API Token. You can find it on your API token in your flutteflow account page." 64 | }, 65 | "flutterflow.activeProject": { 66 | "type": "string", 67 | "description": "Project ID of your flutterflow project to download." 68 | }, 69 | "flutterflow.baseDirectory": { 70 | "type": "string", 71 | "description": "Full path of base directory where you want the code to be saved." 72 | }, 73 | "flutterflow.openDirectory": { 74 | "type": "boolean", 75 | "description": "Open the working directory after downloading code.", 76 | "default": true 77 | }, 78 | "flutterflow.device": { 79 | "type": "string", 80 | "description": "Device ID to be used with flutter run" 81 | } 82 | } 83 | } 84 | }, 85 | "scripts": { 86 | "vscode:prepublish": "npm run compile", 87 | "compile": "tsc -p ./", 88 | "watch": "tsc -watch -p ./", 89 | "pretest": "npm run compile && npm run lint", 90 | "lint": "eslint src --ext ts", 91 | "test": "node ./out/test/runTest.js" 92 | }, 93 | "devDependencies": { 94 | "@types/glob": "^8.0.0", 95 | "@types/mocha": "^10.0.1", 96 | "@types/node": "16.x", 97 | "@types/vscode": "^1.74.0", 98 | "@typescript-eslint/eslint-plugin": "^5.45.0", 99 | "@typescript-eslint/parser": "^5.45.0", 100 | "@vscode/test-electron": "^2.2.0", 101 | "eslint": "^8.28.0", 102 | "glob": "^8.0.3", 103 | "mocha": "^10.1.0", 104 | "typescript": "^4.9.3" 105 | }, 106 | "dependencies": { 107 | "child_process": "^1.0.2" 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /src/extension.ts: -------------------------------------------------------------------------------- 1 | import * as os from "os"; 2 | import * as vscode from "vscode"; 3 | import { downloadCode } from "./helperFunctions/codedownload"; 4 | import { 5 | getProjectWorkingDir, 6 | } from "./helperFunctions/pathHelpers"; 7 | 8 | export function activate(context: vscode.ExtensionContext) { 9 | const syncWithAssets = vscode.commands.registerCommand( 10 | "flutterflow-code-export.sync", 11 | async () => { 12 | downloadCode({ withAssets: true }); 13 | } 14 | ); 15 | 16 | const syncWithoutAssets = vscode.commands.registerCommand( 17 | "flutterflow-code-export.syncFast", 18 | async () => { 19 | downloadCode({ withAssets: false }); 20 | } 21 | ); 22 | 23 | const flutterRun = vscode.commands.registerCommand( 24 | "flutterflow-code-export.run", 25 | async () => { 26 | const selectedDevice = vscode.workspace 27 | .getConfiguration("flutterflow") 28 | .get("device"); 29 | if (selectedDevice === undefined) { 30 | vscode.window.showErrorMessage("Device for flutter run is not defined"); 31 | } 32 | let projectId = 33 | process.env.FLUTTERFLOW_ACTIVE_PROJECT_ID || 34 | vscode.workspace.getConfiguration("flutterflow").get("activeProject"); 35 | 36 | if(projectId === "" || projectId === undefined) { 37 | const userInput = await vscode.window.showInputBox({ 38 | placeHolder: "Your FlutterFlow Project ID", 39 | prompt: "Please enter your FlutterFlow project ID", 40 | }); 41 | projectId = userInput; 42 | } 43 | 44 | let baseDir = 45 | process.env.FLUTTERFLOW_HOME_DIR || 46 | vscode.workspace.getConfiguration("flutterflow").get("baseDirectory"); 47 | 48 | if(baseDir === "" || baseDir === undefined) { 49 | vscode.window.showInformationMessage("Your FlutterFlow HOME is not set. \nDownloading it current directory"); 50 | baseDir = "."; 51 | } 52 | 53 | if(projectId !== "" || projectId !== undefined) { 54 | const term = vscode.window.createTerminal("flutterflow"); 55 | term.show(true); 56 | term.sendText(`cd "${getProjectWorkingDir(projectId!, baseDir)}"`); 57 | term.sendText(`flutter run -d ${selectedDevice}`); 58 | } else { 59 | vscode.window.showErrorMessage("Your FlutterFlow project ID is not set."); 60 | } 61 | 62 | } 63 | ); 64 | 65 | context.subscriptions.push(syncWithAssets); 66 | context.subscriptions.push(syncWithoutAssets); 67 | } 68 | 69 | // This method is called when your extension is deactivated 70 | export function deactivate() {} 71 | -------------------------------------------------------------------------------- /src/helperFunctions/codedownload.ts: -------------------------------------------------------------------------------- 1 | import * as vscode from "vscode"; 2 | import { execShell } from "./executeShell"; 3 | import { 4 | getProjectWorkingDir, 5 | } from "./pathHelpers"; 6 | 7 | const downloadCode = async (config: { withAssets: boolean }) => { 8 | vscode.window.showInformationMessage("Starting flutterflow code download..."); 9 | let token = 10 | process.env.FLUTTERFLOW_API_TOKEN || 11 | vscode.workspace.getConfiguration("flutterflow").get("userApiToken"); 12 | 13 | if(token === "" || token === undefined) { 14 | const userInput = await vscode.window.showInputBox({ 15 | placeHolder: "Your FlutterFlow API token", 16 | prompt: "Please enter your FlutterFlow API token", 17 | }); 18 | token = userInput; 19 | } 20 | let projectId = 21 | process.env.FLUTTERFLOW_ACTIVE_PROJECT_ID || 22 | vscode.workspace.getConfiguration("flutterflow").get("activeProject"); 23 | 24 | if(projectId === "" || projectId === undefined) { 25 | const userInput = await vscode.window.showInputBox({ 26 | placeHolder: "Your FlutterFlow Project ID", 27 | prompt: "Please enter your FlutterFlow project ID", 28 | }); 29 | projectId = userInput; 30 | } 31 | 32 | const openWindow = 33 | (process.env.FLUTTERFLOW_OPEN_DIR as unknown as boolean) || 34 | (vscode.workspace 35 | .getConfiguration("flutterflow") 36 | .get("openDirectory") as boolean); 37 | 38 | 39 | let path = 40 | process.env.FLUTTERFLOW_BASE_DIR || 41 | vscode.workspace.getConfiguration("flutterflow").get("baseDirectory"); 42 | 43 | if(path === "" || path === undefined) { 44 | const userInput = await vscode.window.showInputBox({ 45 | placeHolder: "Your FlutterFlow home directory", 46 | prompt: "Please enter your FlutterFlow home directory", 47 | }); 48 | path = userInput; 49 | } 50 | 51 | try { 52 | if (token === "" || token === undefined) { 53 | vscode.window.showErrorMessage( 54 | "Your FlutterFlow API token is not set. Please set in vscode settings." 55 | ); 56 | const err = "FlutterFlow API token not set"; 57 | throw err; 58 | } 59 | if (projectId === "" || projectId === undefined) { 60 | vscode.window.showErrorMessage( 61 | "Your flutterflow project ID not set. Please set Please set in vscode settings." 62 | ); 63 | const err = "FlutterFlow project ID not set"; 64 | throw err; 65 | } 66 | if (path === "" || path === undefined) { 67 | const err = "FlutterFlow Home directory is not set"; 68 | throw err; 69 | } 70 | await execShell("dart pub global activate flutterflow_cli"); 71 | 72 | if (config.withAssets === true) { 73 | await execShell( 74 | `dart pub global run flutterflow_cli export-code --project ${projectId} --dest ${getProjectWorkingDir(projectId, path)} --include-assets --token ${token} --no-parent-folder` 75 | ); 76 | } else { 77 | await execShell( 78 | `dart pub global run flutterflow_cli export-code --project ${projectId} --dest ${getProjectWorkingDir(projectId, path)} --no-include-assets --token ${token} --no-parent-folder` 79 | ); 80 | } 81 | 82 | if (openWindow === true) { 83 | const folderUri = vscode.Uri.file(getProjectWorkingDir(projectId, path)!); 84 | vscode.commands.executeCommand(`vscode.openFolder`, folderUri); 85 | } 86 | 87 | vscode.window.showInformationMessage("Code download successful"); 88 | } catch (err) { 89 | console.error(` 90 | Could not sync code \n 91 | ${err} 92 | `); 93 | vscode.window.showErrorMessage(`Could not download code \n 94 | ${err} 95 | `); 96 | console.error(err); 97 | } 98 | }; 99 | 100 | export { downloadCode }; 101 | -------------------------------------------------------------------------------- /src/helperFunctions/executeShell.ts: -------------------------------------------------------------------------------- 1 | import * as cp from "child_process"; 2 | 3 | // this function would execute the shell commands 4 | const execShell = (cmd: string) => 5 | new Promise((resolve, reject) => { 6 | cp.exec(cmd, (err, out) => { 7 | if (err) { 8 | return reject(err); 9 | } 10 | return resolve(out); 11 | }); 12 | }); 13 | 14 | export {execShell}; -------------------------------------------------------------------------------- /src/helperFunctions/pathHelpers.ts: -------------------------------------------------------------------------------- 1 | import * as os from "os"; 2 | import * as vscode from "vscode"; 3 | 4 | 5 | function validateProjectConfig(projectId: string): boolean { 6 | if (projectId === "" || projectId === undefined) { 7 | vscode.window.showErrorMessage( 8 | "Your flutterflow project ID not set. Please set Please set in vscode settings." 9 | ); 10 | return false; 11 | } 12 | return true; 13 | } 14 | 15 | function getProjectWorkingDir(projectId: string, baseDir: string): string | undefined { 16 | if (!validateProjectConfig(projectId)) { 17 | return undefined; 18 | } 19 | 20 | if(baseDir === "" || baseDir === undefined) { 21 | baseDir = "."; 22 | } 23 | 24 | if (os.platform() === "win32") { 25 | console.log(`getProjectWorkingDir : ${baseDir}\\${projectId} `); 26 | return `${baseDir}\\${projectId}`; 27 | } else { 28 | console.log(`getProjectWorkingDir : ${baseDir}/${projectId} `); 29 | return `${baseDir}/${projectId}`; 30 | } 31 | } 32 | 33 | 34 | export { 35 | getProjectWorkingDir, 36 | validateProjectConfig 37 | }; 38 | -------------------------------------------------------------------------------- /src/test/runTest.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | 3 | import { runTests } from '@vscode/test-electron'; 4 | 5 | async function main() { 6 | try { 7 | // The folder containing the Extension Manifest package.json 8 | // Passed to `--extensionDevelopmentPath` 9 | const extensionDevelopmentPath = path.resolve(__dirname, '../../'); 10 | 11 | // The path to test runner 12 | // Passed to --extensionTestsPath 13 | const extensionTestsPath = path.resolve(__dirname, './suite/index'); 14 | 15 | // Download VS Code, unzip it and run the integration test 16 | await runTests({ extensionDevelopmentPath, extensionTestsPath }); 17 | } catch (err) { 18 | console.error('Failed to run tests'); 19 | process.exit(1); 20 | } 21 | } 22 | 23 | main(); 24 | -------------------------------------------------------------------------------- /src/test/suite/extension.test.ts: -------------------------------------------------------------------------------- 1 | import * as assert from 'assert'; 2 | 3 | // You can import and use all API from the 'vscode' module 4 | // as well as import your extension to test it 5 | import * as vscode from 'vscode'; 6 | // import * as myExtension from '../../extension'; 7 | 8 | suite('Extension Test Suite', () => { 9 | vscode.window.showInformationMessage('Start all tests.'); 10 | 11 | test('Sample test', () => { 12 | assert.strictEqual(-1, [1, 2, 3].indexOf(5)); 13 | assert.strictEqual(-1, [1, 2, 3].indexOf(0)); 14 | }); 15 | }); 16 | -------------------------------------------------------------------------------- /src/test/suite/index.ts: -------------------------------------------------------------------------------- 1 | import * as path from 'path'; 2 | import * as Mocha from 'mocha'; 3 | import * as glob from 'glob'; 4 | 5 | export function run(): Promise { 6 | // Create the mocha test 7 | const mocha = new Mocha({ 8 | ui: 'tdd', 9 | color: true 10 | }); 11 | 12 | const testsRoot = path.resolve(__dirname, '..'); 13 | 14 | return new Promise((c, e) => { 15 | glob('**/**.test.js', { cwd: testsRoot }, (err, files) => { 16 | if (err) { 17 | return e(err); 18 | } 19 | 20 | // Add files to the test suite 21 | files.forEach(f => mocha.addFile(path.resolve(testsRoot, f))); 22 | 23 | try { 24 | // Run the mocha test 25 | mocha.run(failures => { 26 | if (failures > 0) { 27 | e(new Error(`${failures} tests failed.`)); 28 | } else { 29 | c(); 30 | } 31 | }); 32 | } catch (err) { 33 | console.error(err); 34 | e(err); 35 | } 36 | }); 37 | }); 38 | } 39 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "ES2020", 5 | "outDir": "out", 6 | "lib": [ 7 | "ES2020" 8 | ], 9 | "sourceMap": true, 10 | "rootDir": "src", 11 | "strict": true /* enable all strict type-checking options */ 12 | /* Additional Checks */ 13 | // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ 14 | // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ 15 | // "noUnusedParameters": true, /* Report errors on unused parameters. */ 16 | } 17 | } 18 | --------------------------------------------------------------------------------