### Install Project Dependencies Source: https://github.com/xpf0000/flyenv/wiki/Development Installs all the necessary Node.js packages and their dependencies listed in the project's `package.json` file. This command should be run in the root directory of the cloned repository. ```bash npm install ``` -------------------------------- ### Install node-gyp Globally Source: https://github.com/xpf0000/flyenv/wiki/Development Installs the node-gyp tool globally, which is a prerequisite for compiling Node.js native addon modules. This command requires npm (Node Package Manager) to be installed. ```bash npm install -g node-gyp ``` -------------------------------- ### Install FlyEnv Dependencies Source: https://github.com/xpf0000/flyenv/blob/master/README.md Navigates into the cloned FlyEnv directory and installs project dependencies using Yarn. This command requires Node.js and Yarn to be installed. ```bash cd FlyEnv yarn install ``` -------------------------------- ### Launch Development Mode Source: https://github.com/xpf0000/flyenv/wiki/Development Starts the application in development mode, typically enabling features like hot-reloading and debugging. This command is defined in the project's `package.json` scripts. ```bash npm run dev ``` -------------------------------- ### Clone Repository using Git Source: https://github.com/xpf0000/flyenv/wiki/Development This command is used to clone the project repository from a remote source. Ensure you have Git installed and replace `` with the actual URL of the repository. ```bash git clone ``` -------------------------------- ### Module Definition in Forked Process (TypeScript) Source: https://github.com/xpf0000/flyenv/blob/master/DEV.md Defines the structure and methods for a service module within the forked asynchronous process. It includes interfaces for installed software and methods for starting/stopping services, fetching versions, and installation. This code is essential for managing background services. ```typescript interface SoftInstalled { version: string; // Service version bin: string; // Executable file for the service path: string; // Installation path of the service } class Module extends Base { constructor() { super(); this.type = 'apache'; } /** * Start the service * @param version - The service version to start */ async _startServer(version: SoftInstalled) { // Start services using Node.js's child_process.exec/spawn } /** * Stop the service * @param version - The service version to stop */ async _stopService(version: SoftInstalled) { // Stop the service by identifying the process and sending a termination signal } /** * Fetch all available online packages */ async fetchAllOnlineVersion() { // Parse the official download page or GitHub release API } /** * Download and install an online package */ async installSoft() {} } ``` -------------------------------- ### Install FlyEnv via Homebrew (macOS) Source: https://github.com/xpf0000/flyenv/blob/master/README.md This command uses the Homebrew package manager to install the FlyEnv tool on macOS. Homebrew simplifies the installation and management of software on Apple's operating system. ```bash brew install flyenv ``` -------------------------------- ### TypeScript Module Class Structure for Forked Process Source: https://github.com/xpf0000/flyenv/wiki/Development Defines a TypeScript class structure for a module within the forked asynchronous process. It includes methods for starting/stopping services, fetching online versions, and installing software, utilizing Node.js's `child_process` module. ```typescript interface SoftInstalled { version: string; // Service version bin: string; // Executable file for the service path: string; // Installation path of the service } class Module extends Base { constructor() { super(); this.type = 'apache'; } /** * Start the service * @param version - The service version to start */ async _startServer(version: SoftInstalled) { // Start services using Node.js's child_process.exec/spawn } /** * Stop the service * @param version - The service version to stop */ async _stopService(version: SoftInstalled) { // Stop the service by identifying the process and sending a termination signal } /** * Fetch all available online packages */ async fetchAllOnLineVersion() { // Parse the official download page or GitHub release API } /** * Download and install an online package */ async installSoft() {} } ``` -------------------------------- ### Regular Expression Character Sets Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/RegexCheatsheet/regex-memo.content.md Illustrates the use of character sets `[]` for matching specific characters or ranges, and negation `^` within sets. Key for defining custom character matching patterns. ```regex [xyz] ``` ```regex [^xyz] ``` ```regex [1-3] ``` ```regex [^1-3] ``` -------------------------------- ### Regular Expression Matching Operators Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/RegexCheatsheet/regex-memo.content.md Demonstrates advanced matching techniques using alternation `|` and lookarounds (positive and negative lookahead/lookbehind). Useful for conditional pattern matching. ```regex foo\|bar ``` ```regex foo(?=bar) ``` ```regex foo(?!bar) ``` ```regex (?<=bar)foo ``` ```regex (? Menu Show/Hide & Tray Window icon?: any; // Module icon displayed in Tray Window aside: any; // Left aside module component asideIndex: number; // Sort order in the left aside index: any; // Module home page component isService?: boolean; // Whether the module is a service (can be started/stopped) isTray?: boolean; // Whether the module is shown in the tray window }; ``` -------------------------------- ### Regular Expression Escaping Characters Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/RegexCheatsheet/regex-memo.content.md Shows how to escape special characters in regular expressions to match them literally. This is crucial when your pattern needs to include characters that have special meaning in regex syntax. ```regex \. ``` ```regex \^ ``` ```regex \$ ``` ```regex \| ``` ```regex \\ ``` ```regex \/ ``` ```regex \( ``` ```regex \) ``` ```regex \[ ``` ```regex \] ``` ```regex \{ ``` ```regex \} ``` ```regex \] ``` ```regex \\ ``` -------------------------------- ### App Module Item Definition (Vue/TypeScript) Source: https://github.com/xpf0000/flyenv/blob/master/DEV.md Defines the structure for a Vue module item used in the rendering process. It specifies properties like type flag, label, icon, components for aside and index views, sorting order, and service/tray status. ```typescript import { defineAsyncComponent } from 'vue'; import type { AppModuleItem } from '@/core/type'; const module: AppModuleItem = { typeFlag: 'redis', label: 'Redis', icon: import('@/svg/redis.svg?raw'), index: defineAsyncComponent(() => import('./Index.vue')), aside: defineAsyncComponent(() => import('./aside.vue')), asideIndex: 11, isService: true, isTray: true, }; export default module; ``` -------------------------------- ### App Module Enum Definition (TypeScript) Source: https://github.com/xpf0000/flyenv/blob/master/DEV.md Defines an enumeration for application module types within the rendering process. This is used to register and identify different modules like 'caddy', 'nginx', 'php', etc., for the application's interface. ```typescript export enum AppModuleEnum { caddy = 'caddy', nginx = 'nginx', php = 'php', mysql = 'mysql', // ... other modules } ``` -------------------------------- ### Configure PHP CA Certificate Path in php.ini Source: https://github.com/xpf0000/flyenv/wiki/Questions-&-Answers Specifies the path to the CA certificates file in the php.ini configuration. This is necessary for PHP to establish secure connections to remote machines, often a problem with new installations. Ensure the path is correctly set to your 'cacert.pem' file. ```ini openssl.cafile=C:/Program Files/PhpWebStudy-Data/server/CA/cacert.pem ``` -------------------------------- ### Initialize and Clone Git Repositories Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/GitCheatsheet/git-memo.content.md Commands to initialize a new Git repository in the current directory or clone an existing one from a remote URL. 'git init' creates a new repo, and 'git clone' requires a URL as input. ```shell git init git clone [url] ``` -------------------------------- ### Clone FlyEnv Repository Source: https://github.com/xpf0000/flyenv/blob/master/README.md Clones the FlyEnv project repository from GitHub using Git. This is the first step in setting up the project for development. ```bash git clone git@github.com:xpf0000/FlyEnv.git ``` -------------------------------- ### Build FlyEnv Project Source: https://github.com/xpf0000/flyenv/blob/master/README.md Builds the FlyEnv project for production using Yarn. This command compiles and optimizes the project assets. ```bash yarn run build ``` -------------------------------- ### Configure Git Global User Information Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/GitCheatsheet/git-memo.content.md Set your username and email address globally for Git. This information is used in your commit metadata. No external dependencies are required, and the commands take the user's name and email as string inputs. ```shell git config --global user.name "[name]" git config --global user.email "[email]" ``` -------------------------------- ### Manage Git Commits Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/GitCheatsheet/git-memo.content.md Commands for committing changes to a Git repository. 'git commit -am' stages and commits all tracked changes with a message. 'git commit --amend' allows modifying the last commit. ```shell git commit -am "[commit message]" git commit --amend --no-edit ``` -------------------------------- ### Reset Git Commits and Branch State Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/GitCheatsheet/git-memo.content.md Commands to undo commits and synchronize the local branch with the remote. 'git reset HEAD~N' undoes N commits while keeping changes. 'git reset --hard origin/[branch-name]' discards all local changes and resets to the remote state. ```shell git reset HEAD~N git fetch origin git reset --hard origin/[branch-name] ``` -------------------------------- ### Rename Git Branch Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/GitCheatsheet/git-memo.content.md Command to rename the current local branch from 'master' to 'main'. This is a common practice for aligning with modern Git conventions. No specific inputs are required beyond the branch names. ```shell git branch -m master main ``` -------------------------------- ### Modify Last Git Commit Source: https://github.com/xpf0000/flyenv/blob/master/src/render/components/Tools/GitCheatsheet/git-memo.content.md Used to alter the most recent commit. 'git commit --amend' allows changing the commit message. For more drastic changes including reverting the commit entirely while keeping changes, 'git reset HEAD~1' is used. ```shell git commit --amend git reset HEAD~1 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.