### Prepare Scratch Desktop and Install Dependency (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Commands to prepare the scratch-desktop project by pulling latest changes, checking out the develop branch, installing a specific version of scratch-gui as a dev dependency, staging changes, committing, updating the version, and pushing. ```bash cd scratch-desktop git pull --all --tags git checkout develop npm install --save-dev 'scratch-gui@github:scratchfoundation/scratch-gui#scratch-desktop-v3.999.0' git add package.json package-lock.json # Make sure the app works, the diffs look reasonable, etc. git commit -m "bump scratch-gui to scratch-desktop-v3.999.0" npm version 3.999.0 git push git push --tags ``` -------------------------------- ### Create a Packaged Build (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Command to create a fully packaged build of the scratch-desktop application. Note that macOS builds may require specific certificate installations. ```bash npm run dist ``` -------------------------------- ### Build Only NSIS Installer (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Command to build only the NSIS installer for Windows, ensuring that the WIN_CSC_LINK and WIN_CSC_KEY_PASSWORD environment variables are set beforehand. Building the APPX installer will fail if these variables are set. ```bash npm run dist -- -w nsis ``` -------------------------------- ### Install Xcode Command Line Tools Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README.md Installs the latest version of the Xcode command line tools required for development. This is a prerequisite for many development workflows. ```shell xcode-select --install ``` -------------------------------- ### Initialize Fastlane Match Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README-match.md Initializes Fastlane Match by running the `fastlane match init` command. This command is used to set up Fastlane Match for the first time in a new repository clone. It will prompt the user for necessary configuration details. ```bash fastlane match init ``` -------------------------------- ### Run Scratch Desktop in Development Mode (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Command to start the scratch-desktop application in development mode for testing and debugging. ```bash npm start ``` -------------------------------- ### Obtain Distribution Certificates with Fastlane Match Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README-match.md Obtains or updates distribution certificates required for creating release builds. This command is essential for preparing the application for distribution to end-users or app stores. ```bash fastlane match_dist ``` -------------------------------- ### Run fastlane Mac Match for Development Certificates Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README.md Executes the fastlane 'mac match_dev' action to manage and install development certificates. This is typically used in CI/CD pipelines for consistent development builds. ```shell [bundle exec] fastlane mac match_dev ``` -------------------------------- ### Run fastlane Mac Match for Distribution Certificates Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README.md Executes the fastlane 'mac match_dist' action to manage and install distribution certificates. This is essential for creating release builds that can be distributed to app stores. ```shell [bundle exec] fastlane mac match_dist ``` -------------------------------- ### Obtain Development Certificates with Fastlane Match Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README-match.md Obtains or updates development certificates required for creating internal development builds. This command is intended for testing purposes and ensures that the development environment has the necessary signing certificates. ```bash fastlane match_dev ``` -------------------------------- ### Merge Scratch GUI and Tag Version (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Steps to merge changes from the scratch-gui repository, checkout the scratch-desktop branch, merge a specific version, resolve conflicts, tag the merge, and push the changes and tags. ```bash cd scratch-gui git pull --all --tags git checkout scratch-desktop git merge 0.1.0-prerelease.20yymmdd # Resolve conflicts if necessary git tag scratch-desktop-v3.999.0 git push git push --tags ``` -------------------------------- ### Run fastlane Mac CircleCI Build Preparation Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/fastlane/README.md Executes the fastlane 'mac circleci' action to prepare the project for a signed build on CircleCI. This action automates tasks necessary for creating reproducible and signed builds within the CircleCI environment. ```shell [bundle exec] fastlane mac circleci ``` -------------------------------- ### Create a Semi-Packaged Build (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Command to create a semi-packaged build of scratch-desktop. This simulates a packaged build by copying files to a subdirectory within the 'dist' folder, instead of creating a full package. ```bash npm run dist:dir ``` -------------------------------- ### Fetch Media Library Assets (Bash) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Command to fetch media library assets for the scratch-desktop project. This should be re-run anytime scratch-gui is updated or changes affecting media libraries are made. ```bash npm run fetch ``` -------------------------------- ### Node.js Debug Configuration for Scratch Desktop Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md This JSON configuration is used with Visual Studio Code to launch and debug the main process of the Scratch Desktop application. It specifies runtime arguments, source map support, and attachment to child processes. It is designed for debugging Node.js environments within the Electron framework. ```json { "launch": { "version": "0.2.0", "configurations": [ { "name": "Desktop", "type": "node", "request": "launch", "cwd": "${workspaceFolder:scratch-desktop}", "runtimeExecutable": "npm", "autoAttachChildProcesses": true, "runtimeArgs": ["start", "--"], "protocol": "inspector", "skipFiles": [ // it seems like skipFiles only reliably works with 1 entry :( //"/**", "${workspaceFolder:scratch-desktop}/node_modules/electron/dist/resources/*.asar/**" ], "sourceMaps": true, "timeout": 30000, "outputCapture": "std" } ] } } ``` -------------------------------- ### Set Signing Certificate Environment Variable (CMD) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Sets the WIN_CSC_LINK environment variable in the Windows Command Prompt to the path of the P12 digital signing certificate. ```batch set WIN_CSC_LINK=C:/Users/You/Somewhere/Certificate.p12 ``` -------------------------------- ### Set Signing Certificate Environment Variable (PowerShell) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Sets the WIN_CSC_LINK environment variable in PowerShell to the path of the P12 digital signing certificate. ```powershell $env:WIN_CSC_LINK = "C:/Users/You/Somewhere/Certificate.p12" ``` -------------------------------- ### Set Signing Key Password Environment Variable (CMD) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Sets the WIN_CSC_KEY_PASSWORD environment variable in the Windows Command Prompt to the password for the P12 digital signing certificate. ```batch set WIN_CSC_KEY_PASSWORD=superSecret ``` -------------------------------- ### Set Signing Key Password Environment Variable (PowerShell) Source: https://github.com/scratchfoundation/scratch-desktop/blob/develop/README.md Sets the WIN_CSC_KEY_PASSWORD environment variable in PowerShell to the password for the P12 digital signing certificate. ```powershell $env:WIN_CSC_KEY_PASSWORD = "superSecret" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.