From 67296baa29f2c8d05d5924f5d24b8324946282f5 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 9 Jan 2025 09:32:15 -0600 Subject: [PATCH 01/29] Adding a docker-based dev env --- .github/workflows/build-docker-monorepo.yml | 94 +++++++++++ .gitignore | 3 + pnpm-lock.yaml | 9 ++ projects/js-packages/jetpack-cli/bin/jp.js | 150 ++++++++++++++++++ projects/js-packages/jetpack-cli/package.json | 19 +++ tools/cli/commands/docker.js | 31 ++++ tools/docker/Dockerfile.monorepo | 61 +++++++ tools/docker/bin/monorepo | 48 ++++++ tools/docker/bin/monorepo-entrypoint.sh | 13 ++ tools/docker/docker-compose.yml | 13 ++ 10 files changed, 441 insertions(+) create mode 100644 .github/workflows/build-docker-monorepo.yml create mode 100755 projects/js-packages/jetpack-cli/bin/jp.js create mode 100644 projects/js-packages/jetpack-cli/package.json create mode 100644 tools/docker/Dockerfile.monorepo create mode 100755 tools/docker/bin/monorepo create mode 100644 tools/docker/bin/monorepo-entrypoint.sh diff --git a/.github/workflows/build-docker-monorepo.yml b/.github/workflows/build-docker-monorepo.yml new file mode 100644 index 0000000000000..fc191eb40c38e --- /dev/null +++ b/.github/workflows/build-docker-monorepo.yml @@ -0,0 +1,94 @@ +name: Build Monorepo Docker +on: + push: + branches: [ 'trunk' ] + paths: + - 'tools/docker/Dockerfile.monorepo' + - 'tools/docker/bin/monorepo' + - '.github/versions.sh' + - '.github/workflows/build-docker-monorepo.yml' + pull_request: + paths: + - 'tools/docker/Dockerfile.monorepo' + - 'tools/docker/bin/monorepo' + - '.github/versions.sh' + - '.github/workflows/build-docker-monorepo.yml' +concurrency: + group: build-docker-monorepo-${{ github.event_name }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build and publish Jetpack Monorepo Environment + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + timeout-minutes: 60 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v3 + with: + username: matticbot + password: ${{ secrets.DOCKER_HUB_MATTICBOT_TOKEN }} + + - name: Log in to GitHub Packages + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Fetch build args + id: buildargs + run: | + source .github/versions.sh + source .github/files/gh-funcs.sh + + gh_set_output php-version "$PHP_VERSION" + gh_set_output composer-version "$COMPOSER_VERSION" + gh_set_output node-version "$NODE_VERSION" + gh_set_output pnpm-version "$PNPM_VERSION" + + if [[ "$GITHUB_EVENT_NAME" == "push" ]]; then + gh_set_output tags "type=raw,latest" + gh_set_output images $'automattic/jetpack-monorepo\nghcr.io/automattic/jetpack-monorepo' + elif [[ "$GITHUB_EVENT_NAME" == "pull_request" ]]; then + gh_set_output tags "type=ref,event=pr" + gh_set_output images "ghcr.io/automattic/jetpack-monorepo" + else + echo "Unknown GITHUB_EVENT_NAME $GITHUB_EVENT_NAME" + exit 1 + fi + + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@v5 + with: + flavor: latest=false + tags: ${{ steps.buildargs.outputs.tags }} + images: ${{ steps.buildargs.outputs.images }} + labels: | + org.opencontainers.image.title=Jetpack Monorepo Environment + org.opencontainers.image.description=Environment for building and testing the Jetpack Monorepo. + org.opencontainers.image.documentation=${{ github.server_url }}/${{ github.repository }}/blob/trunk/tools/docker/README.md + + - name: Build and push Docker image + uses: docker/build-push-action@v6 + with: + context: tools/docker + file: tools/docker/Dockerfile.monorepo + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + build-args: | + PHP_VERSION=${{ steps.buildargs.outputs.php-version }} + COMPOSER_VERSION=${{ steps.buildargs.outputs.composer-version }} + NODE_VERSION=${{ steps.buildargs.outputs.node-version }} + PNPM_VERSION=${{ steps.buildargs.outputs.pnpm-version }} diff --git a/.gitignore b/.gitignore index b8679993e4841..21e579240fd2a 100644 --- a/.gitignore +++ b/.gitignore @@ -57,3 +57,6 @@ phpcs.xml # VS Code setting files *.code-workspace /.vscode/settings.json + +.pnpm-debug.log +.pnpm-error.log diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 381294a9066fb..a9ab00c2a5fa1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -938,6 +938,15 @@ importers: specifier: 4.9.1 version: 4.9.1(webpack@5.94.0) + projects/js-packages/jetpack-cli: + dependencies: + chalk: + specifier: ^4.1.2 + version: 4.1.2 + prompts: + specifier: ^2.4.2 + version: 2.4.2 + projects/js-packages/licensing: dependencies: '@automattic/jetpack-analytics': diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js new file mode 100755 index 0000000000000..b955faeae8120 --- /dev/null +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -0,0 +1,150 @@ +#!/usr/bin/env node + +import { spawnSync } from 'child_process'; +import fs from 'fs'; +import { dirname, resolve } from 'path'; +import process from 'process'; +import chalk from 'chalk'; +import prompts from 'prompts'; + +/** + * Check if a directory is the monorepo root. + * + * @param {string} dir - Directory to check + * @return {boolean} True if this is the monorepo root + */ +const isMonorepoRoot = dir => { + try { + return fs.existsSync( resolve( dir, 'tools/docker/bin/monorepo' ) ); + } catch { + return false; + } +}; + +/** + * Find monorepo root from a starting directory. + * + * @param {string} startDir - Directory to start searching from + * @return {string|null} Path to monorepo root, or null if not found + */ +const findMonorepoRoot = startDir => { + let dir = startDir; + while ( dir !== '/' ) { + if ( isMonorepoRoot( dir ) ) { + return dir; + } + dir = dirname( dir ); + } + return null; +}; + +/** + * Clone the monorepo. + * + * @param {string} targetDir - Directory to clone into + * @throws {Error} If clone fails + */ +const cloneMonorepo = async targetDir => { + // eslint-disable-next-line no-console + console.log( chalk.blue( 'Cloning Jetpack monorepo...' ) ); + const result = spawnSync( + 'git', + [ 'clone', 'https://github.com/Automattic/jetpack.git', targetDir ], + { stdio: 'inherit' } + ); + + if ( result.status !== 0 ) { + throw new Error( 'Failed to clone repository' ); + } +}; + +/** + * Initialize a new Jetpack development environment. + * + * @throws {Error} If initialization fails + */ +const initJetpack = async () => { + const response = await prompts( { + type: 'text', + name: 'directory', + message: 'Where would you like to clone the Jetpack monorepo?', + initial: './jetpack', + } ); + + if ( ! response.directory ) { + throw new Error( 'Setup cancelled' ); + } + + const targetDir = resolve( process.cwd(), response.directory ); + + if ( fs.existsSync( targetDir ) ) { + throw new Error( `Directory ${ targetDir } already exists` ); + } + + try { + await cloneMonorepo( targetDir ); + // eslint-disable-next-line no-console + console.log( chalk.green( '\nJetpack monorepo has been cloned successfully!' ) ); + // eslint-disable-next-line no-console + console.log( '\nNext steps:' ); + // eslint-disable-next-line no-console + console.log( '1. cd', response.directory ); + // eslint-disable-next-line no-console + console.log( '2. jp docker up' ); + // eslint-disable-next-line no-console + console.log( '3. jp docker install' ); + } catch ( error ) { + throw new Error( `Failed to initialize Jetpack: ${ error.message }` ); + } +}; + +// Main execution +const main = async () => { + try { + const args = process.argv.slice( 2 ); + + // Handle 'init' command specially + if ( args[ 0 ] === 'init' ) { + await initJetpack(); + return; + } + + // Try to find monorepo root from current directory + const monorepoRoot = findMonorepoRoot( process.cwd() ); + + if ( ! monorepoRoot ) { + // eslint-disable-next-line no-console + console.error( chalk.red( 'Could not find Jetpack monorepo.' ) ); + // eslint-disable-next-line no-console + console.log( '\nTo get started:' ); + // eslint-disable-next-line no-console + console.log( '1. Run', chalk.blue( 'jp init' ), 'to clone the repository' ); + // eslint-disable-next-line no-console + console.log( ' OR' ); + // eslint-disable-next-line no-console + console.log( '2. Navigate to an existing Jetpack monorepo directory' ); + throw new Error( 'Monorepo not found' ); + } + + // Run the monorepo script with the original arguments + const result = spawnSync( + resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), + [ 'pnpm', 'jetpack', ...args ], + { + stdio: 'inherit', + shell: true, + cwd: monorepoRoot, // Ensure we're in the monorepo root when running commands + } + ); + + if ( result.status !== 0 ) { + throw new Error( `Command failed with status ${ result.status }` ); + } + } catch ( error ) { + // eslint-disable-next-line no-console + console.error( chalk.red( error.message ) ); + process.exitCode = 1; + } +}; + +main(); diff --git a/projects/js-packages/jetpack-cli/package.json b/projects/js-packages/jetpack-cli/package.json new file mode 100644 index 0000000000000..aa1e4d78e476e --- /dev/null +++ b/projects/js-packages/jetpack-cli/package.json @@ -0,0 +1,19 @@ +{ + "name": "@automattic/jetpack-cli", + "version": "0.1.0-beta.1", + "description": "Docker-based CLI for Jetpack development", + "bin": { + "jp": "bin/jp.js" + }, + "files": [ + "bin" + ], + "type": "module", + "dependencies": { + "chalk": "^4.1.2", + "prompts": "^2.4.2" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/tools/cli/commands/docker.js b/tools/cli/commands/docker.js index 938f3e8d25a19..9d0291aee259c 100644 --- a/tools/cli/commands/docker.js +++ b/tools/cli/commands/docker.js @@ -63,6 +63,13 @@ const buildEnv = argv => { } envOpts.COMPOSE_PROJECT_NAME = getProjectName( argv ); + + // Add versions from versions.sh + const versions = envfile.parse( + fs.readFileSync( `${ dockerFolder }/../../.github/versions.sh`, 'utf8' ) + ); + Object.assign( envOpts, versions ); + return envOpts; }; @@ -801,6 +808,30 @@ export function dockerDefine( yargs ) { command: 'jt-config', description: 'Set jurassic tube config', handler: argv => execJtCmdHandler( argv ), + } ) + .command( { + command: 'monorepo', + description: 'Run commands in monorepo container', + builder: yargCmd => + defaultOpts( yargCmd ).option( 'cmd', { + alias: 'c', + describe: 'Command to run', + type: 'string', + demandOption: true, + } ), + handler: argv => { + const opts = buildComposeFiles().concat( [ + 'run', + '--rm', + 'monorepo', + 'bash', + '-c', + argv.cmd, + ] ); + + const envOpts = buildEnv( argv ); + composeExecutor( argv, opts, envOpts ); + }, } ); }, } ); diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo new file mode 100644 index 0000000000000..9517dd98e3f53 --- /dev/null +++ b/tools/docker/Dockerfile.monorepo @@ -0,0 +1,61 @@ +FROM ubuntu:24.04 + +# Import version variables from .github/versions.sh +ARG PHP_VERSION +ARG COMPOSER_VERSION +ARG NODE_VERSION +ARG PNPM_VERSION + +ENV LANG=en_US.UTF-8 \ + LC_ALL=en_US.UTF-8 + +WORKDIR /app + +# Install basic packages and PHP +RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ + export DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get install -y curl gpg language-pack-en-base software-properties-common \ + && add-apt-repository ppa:ondrej/php \ + && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + && apt-get update \ + && apt-get --purge install -y \ + git \ + unzip \ + zip \ + "php${PHP_VERSION}" \ + "php${PHP_VERSION}-cli" \ + "php${PHP_VERSION}-curl" \ + "php${PHP_VERSION}-dom" \ + "php${PHP_VERSION}-mbstring" \ + "php${PHP_VERSION}-xml" \ + "php${PHP_VERSION}-zip" \ + && apt-get remove --purge --auto-remove -y gpg software-properties-common \ + && find /var/ -name '*-old' -delete && rm -rf /var/log/dpkg.log /var/log/alternatives.log /var/log/apt/ ~/.launchpadlib + +# Install Composer +RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ + && php composer-setup.php --install-dir=/usr/local/bin --filename=composer --version=$COMPOSER_VERSION \ + && php -r "unlink('composer-setup.php');" + +# Install Node.js +RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ + export DEBIAN_FRONTEND=noninteractive \ + && N=${NODE_VERSION%%.*} \ + && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$N.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \ + && apt-get -q update \ + && VER="$(apt-cache show nodejs | sed -n "/^Version: ${NODE_VERSION}-/ { s/^Version: /=/p; q }" )" \ + && apt-get install -y nodejs$VER + +# Install pnpm +RUN npm install --global pnpm@$PNPM_VERSION \ + && SHELL=/bin/bash pnpm setup + +WORKDIR /workspace + +# Add entrypoint script +COPY bin/monorepo-entrypoint.sh /usr/local/bin/ +RUN chmod +x /usr/local/bin/monorepo-entrypoint.sh + +ENTRYPOINT ["/usr/local/bin/monorepo-entrypoint.sh"] +CMD ["bash"] diff --git a/tools/docker/bin/monorepo b/tools/docker/bin/monorepo new file mode 100755 index 0000000000000..0dbd651285523 --- /dev/null +++ b/tools/docker/bin/monorepo @@ -0,0 +1,48 @@ +#!/bin/bash + +# Enable debug mode if DEBUG environment variable is set +if [ "${DEBUG:-}" = "1" ]; then + set -x +fi + +# Get the absolute path to the monorepo root +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +MONOREPO_ROOT="$( cd "$SCRIPT_DIR/../../.." && pwd )" + +echo "Running command in monorepo container: $*" + +# Source the versions file +source "$MONOREPO_ROOT/.github/versions.sh" + +# Build the image if it doesn't exist +if ! docker image inspect jetpack-monorepo:latest >/dev/null 2>&1; then + if [ "${BUILD_LOCAL:-}" = "1" ]; then + echo "Building monorepo image locally..." + docker build \ + --build-arg PHP_VERSION="$PHP_VERSION" \ + --build-arg COMPOSER_VERSION="$COMPOSER_VERSION" \ + --build-arg NODE_VERSION="$NODE_VERSION" \ + --build-arg PNPM_VERSION="$PNPM_VERSION" \ + -t jetpack-monorepo:latest \ + -f "$MONOREPO_ROOT/tools/docker/Dockerfile.monorepo" \ + "$MONOREPO_ROOT/tools/docker" + else + echo "Pulling monorepo image..." + docker pull automattic/jetpack-monorepo:latest + docker tag automattic/jetpack-monorepo:latest jetpack-monorepo:latest + fi +fi + +# Run the command in the container +docker run --rm -it \ + -v "$MONOREPO_ROOT:/workspace" \ + -v "$MONOREPO_ROOT/tools/docker/data/monorepo:/root" \ + -w /workspace \ + -e TERM=$TERM \ + -e COLORTERM=$COLORTERM \ + -e NPM_CONFIG_USERCONFIG=/root/.npmrc \ + -e NPM_CONFIG_CACHE=/root/.npm \ + -e PNPM_HOME=/root/.local/share/pnpm \ + -e PNPM_STORE_DIR=/root/.pnpm-store \ + jetpack-monorepo:latest \ + "$@" diff --git a/tools/docker/bin/monorepo-entrypoint.sh b/tools/docker/bin/monorepo-entrypoint.sh new file mode 100644 index 0000000000000..d9ed98e14776e --- /dev/null +++ b/tools/docker/bin/monorepo-entrypoint.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +# Exit on error +set -e + +# Check if jetpack command is available +if ! pnpm jetpack --help >/dev/null 2>&1; then + echo "Setting up Jetpack CLI..." + pnpm install +fi + +# Execute the passed command +exec "$@" diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index ed3b73fae43e4..f0eb1ac222808 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -49,3 +49,16 @@ services: environment: - HOST_PORT=${PORT_WORDPRESS:-80} - COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME + + monorepo: + build: + context: . + dockerfile: Dockerfile.monorepo + args: + PHP_VERSION: ${PHP_VERSION} + COMPOSER_VERSION: ${COMPOSER_VERSION} + NODE_VERSION: ${NODE_VERSION} + PNPM_VERSION: ${PNPM_VERSION} + volumes: + - ../..:${WORKSPACE_PATH:-/workspace} + working_dir: ${WORKSPACE_PATH:-/workspace} From 439122464fbaffa993abd3f41c05962746404a5e Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 9 Jan 2025 13:03:21 -0600 Subject: [PATCH 02/29] New CLI works with docker now -- commands will run on the local host unless specified to the dev container, like build-image --- pnpm-lock.yaml | 13 +- .../js-packages/jetpack-cli/.gitattributes | 6 + projects/js-packages/jetpack-cli/.gitignore | 2 + projects/js-packages/jetpack-cli/CHANGELOG.md | 7 + projects/js-packages/jetpack-cli/README.md | 18 ++ projects/js-packages/jetpack-cli/bin/jp.js | 162 ++++++++++++++++-- .../jetpack-cli/changelog/.gitkeep | 0 .../jetpack-cli/changelog/initial-version | 4 + .../js-packages/jetpack-cli/composer.json | 37 ++++ .../js-packages/jetpack-cli/eslint.config.mjs | 11 ++ projects/js-packages/jetpack-cli/package.json | 5 +- .../js-packages/jetpack-cli/src/index.jsx | 2 + .../jetpack-cli/tests/index.test.js | 7 + .../jetpack-cli/tests/jest.config.cjs | 7 + tools/cli/commands/docker.js | 21 ++- tools/docker/Dockerfile.monorepo | 7 + tools/docker/bin/monorepo | 7 + tools/docker/docker-compose.yml | 6 +- 18 files changed, 299 insertions(+), 23 deletions(-) create mode 100644 projects/js-packages/jetpack-cli/.gitattributes create mode 100644 projects/js-packages/jetpack-cli/.gitignore create mode 100644 projects/js-packages/jetpack-cli/CHANGELOG.md create mode 100644 projects/js-packages/jetpack-cli/README.md create mode 100644 projects/js-packages/jetpack-cli/changelog/.gitkeep create mode 100644 projects/js-packages/jetpack-cli/changelog/initial-version create mode 100644 projects/js-packages/jetpack-cli/composer.json create mode 100644 projects/js-packages/jetpack-cli/eslint.config.mjs create mode 100644 projects/js-packages/jetpack-cli/src/index.jsx create mode 100644 projects/js-packages/jetpack-cli/tests/index.test.js create mode 100644 projects/js-packages/jetpack-cli/tests/jest.config.cjs diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a9ab00c2a5fa1..a51262c2ff014 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -941,8 +941,11 @@ importers: projects/js-packages/jetpack-cli: dependencies: chalk: - specifier: ^4.1.2 - version: 4.1.2 + specifier: ^5.4.1 + version: 5.4.1 + dotenv: + specifier: ^16.3.1 + version: 16.4.7 prompts: specifier: ^2.4.2 version: 2.4.2 @@ -9588,6 +9591,10 @@ packages: resolution: {integrity: sha512-JvpYKUmzQhYoIFgK2MOnF3bciIZoItIIoryihy0rIA+H4Jy0FmgyKYAHCTN98P5ybGSJcIFbh6QKeJdtZd1qhA==} engines: {node: '>=12'} + dotenv@16.4.7: + resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} + engines: {node: '>=12'} + dunder-proto@1.0.0: resolution: {integrity: sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==} engines: {node: '>= 0.4'} @@ -21746,6 +21753,8 @@ snapshots: dotenv@16.0.2: {} + dotenv@16.4.7: {} + dunder-proto@1.0.0: dependencies: call-bind-apply-helpers: 1.0.1 diff --git a/projects/js-packages/jetpack-cli/.gitattributes b/projects/js-packages/jetpack-cli/.gitattributes new file mode 100644 index 0000000000000..992b114f7ffa8 --- /dev/null +++ b/projects/js-packages/jetpack-cli/.gitattributes @@ -0,0 +1,6 @@ +# Files not needed to be distributed in the package. +.gitattributes export-ignore +node_modules export-ignore + +# Files to exclude from the mirror repo +/changelog/** production-exclude diff --git a/projects/js-packages/jetpack-cli/.gitignore b/projects/js-packages/jetpack-cli/.gitignore new file mode 100644 index 0000000000000..140fd587d2d52 --- /dev/null +++ b/projects/js-packages/jetpack-cli/.gitignore @@ -0,0 +1,2 @@ +vendor/ +node_modules/ diff --git a/projects/js-packages/jetpack-cli/CHANGELOG.md b/projects/js-packages/jetpack-cli/CHANGELOG.md new file mode 100644 index 0000000000000..721294abd00ad --- /dev/null +++ b/projects/js-packages/jetpack-cli/CHANGELOG.md @@ -0,0 +1,7 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + diff --git a/projects/js-packages/jetpack-cli/README.md b/projects/js-packages/jetpack-cli/README.md new file mode 100644 index 0000000000000..71453fa986d24 --- /dev/null +++ b/projects/js-packages/jetpack-cli/README.md @@ -0,0 +1,18 @@ +# Jetpack + + +## How to install Jetpack plugin on your site +### Installation From Git Repo + +## Contribute + +## Get Help + +## Security + +Need to report a security vulnerability? Go to [https://automattic.com/security/](https://automattic.com/security/) or directly to our security bug bounty site [https://hackerone.com/automattic](https://hackerone.com/automattic). + +## License + +Licensed under [GNU General Public License v2 (or later)](./LICENSE.txt). + diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index b955faeae8120..4c98478ae1975 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -1,12 +1,18 @@ #!/usr/bin/env node import { spawnSync } from 'child_process'; -import fs from 'fs'; +import fs, { readFileSync } from 'fs'; import { dirname, resolve } from 'path'; import process from 'process'; +import { fileURLToPath } from 'url'; import chalk from 'chalk'; +import dotenv from 'dotenv'; import prompts from 'prompts'; +// Get package.json path relative to this file +const __dirname = dirname( fileURLToPath( import.meta.url ) ); +const packageJson = JSON.parse( readFileSync( resolve( __dirname, '../package.json' ), 'utf8' ) ); + /** * Check if a directory is the monorepo root. * @@ -45,7 +51,6 @@ const findMonorepoRoot = startDir => { * @throws {Error} If clone fails */ const cloneMonorepo = async targetDir => { - // eslint-disable-next-line no-console console.log( chalk.blue( 'Cloning Jetpack monorepo...' ) ); const result = spawnSync( 'git', @@ -83,15 +88,15 @@ const initJetpack = async () => { try { await cloneMonorepo( targetDir ); - // eslint-disable-next-line no-console + console.log( chalk.green( '\nJetpack monorepo has been cloned successfully!' ) ); - // eslint-disable-next-line no-console + console.log( '\nNext steps:' ); - // eslint-disable-next-line no-console + console.log( '1. cd', response.directory ); - // eslint-disable-next-line no-console + console.log( '2. jp docker up' ); - // eslint-disable-next-line no-console + console.log( '3. jp docker install' ); } catch ( error ) { throw new Error( `Failed to initialize Jetpack: ${ error.message }` ); @@ -103,6 +108,12 @@ const main = async () => { try { const args = process.argv.slice( 2 ); + // Handle version flag + if ( args[ 0 ] === '--version' || args[ 0 ] === '-v' ) { + console.log( chalk.green( packageJson.version ) ); + return; + } + // Handle 'init' command specially if ( args[ 0 ] === 'init' ) { await initJetpack(); @@ -113,19 +124,145 @@ const main = async () => { const monorepoRoot = findMonorepoRoot( process.cwd() ); if ( ! monorepoRoot ) { - // eslint-disable-next-line no-console console.error( chalk.red( 'Could not find Jetpack monorepo.' ) ); - // eslint-disable-next-line no-console + console.log( '\nTo get started:' ); - // eslint-disable-next-line no-console + console.log( '1. Run', chalk.blue( 'jp init' ), 'to clone the repository' ); - // eslint-disable-next-line no-console + console.log( ' OR' ); - // eslint-disable-next-line no-console + console.log( '2. Navigate to an existing Jetpack monorepo directory' ); throw new Error( 'Monorepo not found' ); } + // Handle docker commands on the host + if ( args[ 0 ] === 'docker' ) { + // Commands that should run in the container + const containerCommands = [ 'build-image', 'install' ]; + if ( containerCommands.includes( args[ 1 ] ) ) { + const result = spawnSync( + resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), + [ 'pnpm', 'jetpack', ...args ], + { + stdio: 'inherit', + shell: true, + cwd: monorepoRoot, + } + ); + + if ( result.status !== 0 ) { + throw new Error( `Command failed with status ${ result.status }` ); + } + return; + } + + // Run config generation first if this is an 'up' command + if ( args[ 1 ] === 'up' ) { + // Create required directories + fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/data/jetpack_dev_mysql' ), { + recursive: true, + } ); + fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/data/ssh.keys' ), { recursive: true } ); + fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/wordpress' ), { recursive: true } ); + + const images = [ + { name: 'mariadb:lts' }, + { name: 'automattic/jetpack-wordpress-dev:latest' }, + { name: 'phpmyadmin/phpmyadmin:latest', platform: 'linux/amd64' }, + { name: 'maildev/maildev', platform: 'linux/amd64' }, + { name: 'atmoz/sftp', platform: 'linux/amd64' }, + ]; + + for ( const image of images ) { + const inspect = spawnSync( 'docker', [ 'image', 'inspect', image.name ], { + stdio: 'ignore', + } ); + if ( inspect.status !== 0 ) { + console.log( chalk.blue( `Pulling ${ image.name }...` ) ); + const pullArgs = [ 'pull', image.name ]; + if ( image.platform ) { + pullArgs.splice( 1, 0, '--platform', image.platform ); + } + const pull = spawnSync( 'docker', pullArgs, { stdio: 'inherit' } ); + if ( pull.status !== 0 ) { + throw new Error( `Failed to pull ${ image.name }` ); + } + } + } + + const configResult = spawnSync( + resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), + [ 'pnpm', 'jetpack', 'docker', 'config' ], + { + stdio: 'inherit', + shell: true, + cwd: monorepoRoot, + } + ); + + if ( configResult.status !== 0 ) { + throw new Error( 'Failed to generate Docker config' ); + } + } + + // Get project name (from docker.js) + const projectName = args.includes( '--type=e2e' ) ? 'jetpack_e2e' : 'jetpack_dev'; + + // Load versions from .github/versions.sh + const versionsPath = resolve( monorepoRoot, '.github/versions.sh' ); + const versions = fs.readFileSync( versionsPath, 'utf8' ); + const versionVars = {}; + versions.split( '\n' ).forEach( line => { + const match = line.match( /^([A-Z_]+)=(.+)$/ ); + if ( match ) { + versionVars[ match[ 1 ] ] = match[ 2 ].replace( /['"]/g, '' ); + } + } ); + + // Build environment variables (from docker.js) + const envVars = { + ...process.env, + // Load from default.env + ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) + ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) ) + : {} ), + // Load from .env if it exists + ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) + ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) ) + : {} ), + HOST_CWD: monorepoRoot, + PHP_VERSION: versionVars.PHP_VERSION, + COMPOSER_VERSION: versionVars.COMPOSER_VERSION, + NODE_VERSION: versionVars.NODE_VERSION, + PNPM_VERSION: versionVars.PNPM_VERSION, + COMPOSE_PROJECT_NAME: projectName, + PORT_WORDPRESS: args.includes( '--type=e2e' ) ? '8889' : '80', + }; + + // Build the list of compose files to use + const composeFiles = [ + '-f', + resolve( monorepoRoot, 'tools/docker/docker-compose.yml' ), + '-f', + resolve( monorepoRoot, 'tools/docker/compose-mappings.built.yml' ), + '-f', + resolve( monorepoRoot, 'tools/docker/compose-extras.built.yml' ), + ]; + + const result = spawnSync( 'docker', [ 'compose', ...composeFiles, ...args.slice( 1 ) ], { + stdio: 'inherit', + shell: true, + cwd: resolve( monorepoRoot, 'tools/docker' ), + env: envVars, + } ); + + if ( result.status !== 0 ) { + throw new Error( `Docker command failed with status ${ result.status }` ); + } + return; + } + // Run the monorepo script with the original arguments const result = spawnSync( resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), @@ -141,7 +278,6 @@ const main = async () => { throw new Error( `Command failed with status ${ result.status }` ); } } catch ( error ) { - // eslint-disable-next-line no-console console.error( chalk.red( error.message ) ); process.exitCode = 1; } diff --git a/projects/js-packages/jetpack-cli/changelog/.gitkeep b/projects/js-packages/jetpack-cli/changelog/.gitkeep new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/projects/js-packages/jetpack-cli/changelog/initial-version b/projects/js-packages/jetpack-cli/changelog/initial-version new file mode 100644 index 0000000000000..fb1837c901e51 --- /dev/null +++ b/projects/js-packages/jetpack-cli/changelog/initial-version @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Initial version. diff --git a/projects/js-packages/jetpack-cli/composer.json b/projects/js-packages/jetpack-cli/composer.json new file mode 100644 index 0000000000000..42127f0f1f562 --- /dev/null +++ b/projects/js-packages/jetpack-cli/composer.json @@ -0,0 +1,37 @@ +{ + "name": "automattic/jetpack-cli", + "description": "Development tools for the Jetpack monorepo", + "type": "library", + "license": "GPL-2.0-or-later", + "require": {}, + "require-dev": { + "automattic/jetpack-changelogger": "@dev" + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "scripts": { + "phpunit": [ + "./vendor/phpunit/phpunit/phpunit --colors=always" + ], + "test-coverage": [ + "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"" + ], + "test-php": [ + "@composer phpunit" + ] + }, + "repositories": [ + { + "type": "path", + "url": "../../packages/*", + "options": { + "monorepo": true + } + } + ], + "minimum-stability": "dev", + "prefer-stable": true +} diff --git a/projects/js-packages/jetpack-cli/eslint.config.mjs b/projects/js-packages/jetpack-cli/eslint.config.mjs new file mode 100644 index 0000000000000..5ad3c9460cc3f --- /dev/null +++ b/projects/js-packages/jetpack-cli/eslint.config.mjs @@ -0,0 +1,11 @@ +import makeBaseConfig from 'jetpack-js-tools/eslintrc/base.mjs'; + +export default [ + ...makeBaseConfig( import.meta.url, { envs: [ 'node' ] } ), + { + rules: { + 'no-console': 'off', + 'n/no-process-exit': 'off', + }, + }, +]; diff --git a/projects/js-packages/jetpack-cli/package.json b/projects/js-packages/jetpack-cli/package.json index aa1e4d78e476e..bd1ea239b98cc 100644 --- a/projects/js-packages/jetpack-cli/package.json +++ b/projects/js-packages/jetpack-cli/package.json @@ -1,6 +1,6 @@ { "name": "@automattic/jetpack-cli", - "version": "0.1.0-beta.1", + "version": "0.1.0-alpha", "description": "Docker-based CLI for Jetpack development", "bin": { "jp": "bin/jp.js" @@ -10,7 +10,8 @@ ], "type": "module", "dependencies": { - "chalk": "^4.1.2", + "chalk": "^5.4.1", + "dotenv": "^16.3.1", "prompts": "^2.4.2" }, "publishConfig": { diff --git a/projects/js-packages/jetpack-cli/src/index.jsx b/projects/js-packages/jetpack-cli/src/index.jsx new file mode 100644 index 0000000000000..9ad1e06860e5c --- /dev/null +++ b/projects/js-packages/jetpack-cli/src/index.jsx @@ -0,0 +1,2 @@ +// Put your code in this `src/` folder! +// Feel free to delete or rename this file. diff --git a/projects/js-packages/jetpack-cli/tests/index.test.js b/projects/js-packages/jetpack-cli/tests/index.test.js new file mode 100644 index 0000000000000..d34c1ab3fc541 --- /dev/null +++ b/projects/js-packages/jetpack-cli/tests/index.test.js @@ -0,0 +1,7 @@ +// We recommend using `jest` for testing. If you're testing React code, we recommend `@testing-library/react` and related packages. +// Please match the versions used elsewhere in the monorepo. +// +// Please don't add new uses of `mocha`, `chai`, `sinon`, `enzyme`, and so on. We're trying to standardize on one testing framework. +// +// The default setup is to have files named like "name.test.js" (or .jsx, .ts, or .tsx) in this `tests/` directory. +// But you could instead put them in `src/`, or put files like "name.js" (or .jsx, .ts, or .tsx) in `test` or `__tests__` directories somewhere. diff --git a/projects/js-packages/jetpack-cli/tests/jest.config.cjs b/projects/js-packages/jetpack-cli/tests/jest.config.cjs new file mode 100644 index 0000000000000..b5ceacda1f7e0 --- /dev/null +++ b/projects/js-packages/jetpack-cli/tests/jest.config.cjs @@ -0,0 +1,7 @@ +const path = require( 'path' ); +const baseConfig = require( 'jetpack-js-tools/jest/config.base.js' ); + +module.exports = { + ...baseConfig, + rootDir: path.join( __dirname, '..' ), +}; diff --git a/tools/cli/commands/docker.js b/tools/cli/commands/docker.js index 9d0291aee259c..8626a47a37427 100644 --- a/tools/cli/commands/docker.js +++ b/tools/cli/commands/docker.js @@ -554,6 +554,15 @@ const execJtCmdHandler = argv => { } }; +/** + * Generate Docker configuration files. + * + * @param {object} argv - The command line arguments + */ +async function generateConfig( argv ) { + await setConfig( argv ); +} + /** * Definition for the Docker commands. * @@ -561,7 +570,7 @@ const execJtCmdHandler = argv => { * @return {object} Yargs with the Docker commands defined. */ export function dockerDefine( yargs ) { - yargs.command( { + return yargs.command( { command: 'docker ', description: 'Docker stuff', builder: yarg => { @@ -832,9 +841,15 @@ export function dockerDefine( yargs ) { const envOpts = buildEnv( argv ); composeExecutor( argv, opts, envOpts ); }, + } ) + .command( { + command: 'config', + description: 'Generate Docker configuration files', + builder: yargCmd => defaultOpts( yargCmd ), + handler: async argv => { + await generateConfig( argv ); + }, } ); }, } ); - - return yargs; } diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo index 9517dd98e3f53..6214b49eec44c 100644 --- a/tools/docker/Dockerfile.monorepo +++ b/tools/docker/Dockerfile.monorepo @@ -16,6 +16,11 @@ RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y curl gpg language-pack-en-base software-properties-common \ + # Install Docker CLI + && install -m 0755 -d /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ + && chmod a+r /etc/apt/keyrings/docker.gpg \ + && echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" > /etc/apt/sources.list.d/docker.list \ && add-apt-repository ppa:ondrej/php \ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ && apt-get update \ @@ -23,6 +28,8 @@ RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ git \ unzip \ zip \ + docker-ce-cli \ + docker-compose-plugin \ "php${PHP_VERSION}" \ "php${PHP_VERSION}-cli" \ "php${PHP_VERSION}-curl" \ diff --git a/tools/docker/bin/monorepo b/tools/docker/bin/monorepo index 0dbd651285523..8a6cc39d39c8d 100755 --- a/tools/docker/bin/monorepo +++ b/tools/docker/bin/monorepo @@ -14,6 +14,9 @@ echo "Running command in monorepo container: $*" # Source the versions file source "$MONOREPO_ROOT/.github/versions.sh" +# Export variables needed by docker-compose +export HOST_CWD="$MONOREPO_ROOT" + # Build the image if it doesn't exist if ! docker image inspect jetpack-monorepo:latest >/dev/null 2>&1; then if [ "${BUILD_LOCAL:-}" = "1" ]; then @@ -37,9 +40,13 @@ fi docker run --rm -it \ -v "$MONOREPO_ROOT:/workspace" \ -v "$MONOREPO_ROOT/tools/docker/data/monorepo:/root" \ + -v /var/run/docker.sock:/var/run/docker.sock \ -w /workspace \ -e TERM=$TERM \ -e COLORTERM=$COLORTERM \ + -e DOCKER_ROOT="$MONOREPO_ROOT/tools/docker" \ + -e HOST_CWD="$MONOREPO_ROOT" \ + -e WORKSPACE_PATH="$MONOREPO_ROOT" \ -e NPM_CONFIG_USERCONFIG=/root/.npmrc \ -e NPM_CONFIG_CACHE=/root/.npm \ -e PNPM_HOME=/root/.local/share/pnpm \ diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index f0eb1ac222808..9e22a06fe6a17 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -52,7 +52,7 @@ services: monorepo: build: - context: . + context: ${HOST_CWD}/tools/docker dockerfile: Dockerfile.monorepo args: PHP_VERSION: ${PHP_VERSION} @@ -60,5 +60,5 @@ services: NODE_VERSION: ${NODE_VERSION} PNPM_VERSION: ${PNPM_VERSION} volumes: - - ../..:${WORKSPACE_PATH:-/workspace} - working_dir: ${WORKSPACE_PATH:-/workspace} + - ${HOST_CWD}:/usr/local/src/jetpack-monorepo + working_dir: /usr/local/src/jetpack-monorepo From 40d5719947e86e3395000d5ce9edb67f56f1120b Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 9 Jan 2025 22:15:29 -0600 Subject: [PATCH 03/29] Remove unneeded Docker from the dev container and put the pnpm store in the docker/data dir --- tools/docker/Dockerfile.monorepo | 7 ------- tools/docker/bin/monorepo-entrypoint.sh | 10 ++++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo index 6214b49eec44c..9517dd98e3f53 100644 --- a/tools/docker/Dockerfile.monorepo +++ b/tools/docker/Dockerfile.monorepo @@ -16,11 +16,6 @@ RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y curl gpg language-pack-en-base software-properties-common \ - # Install Docker CLI - && install -m 0755 -d /etc/apt/keyrings \ - && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ - && chmod a+r /etc/apt/keyrings/docker.gpg \ - && echo "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" > /etc/apt/sources.list.d/docker.list \ && add-apt-repository ppa:ondrej/php \ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ && apt-get update \ @@ -28,8 +23,6 @@ RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ git \ unzip \ zip \ - docker-ce-cli \ - docker-compose-plugin \ "php${PHP_VERSION}" \ "php${PHP_VERSION}-cli" \ "php${PHP_VERSION}-curl" \ diff --git a/tools/docker/bin/monorepo-entrypoint.sh b/tools/docker/bin/monorepo-entrypoint.sh index d9ed98e14776e..0266f90a9ad67 100644 --- a/tools/docker/bin/monorepo-entrypoint.sh +++ b/tools/docker/bin/monorepo-entrypoint.sh @@ -3,6 +3,16 @@ # Exit on error set -e +# Check and set PNPM store location +EXPECTED_STORE="/usr/local/src/jetpack-monorepo/tools/docker/data/pnpm-store" +CURRENT_STORE=$(pnpm config get store-dir) + +if [ "$CURRENT_STORE" != "$EXPECTED_STORE" ]; then + echo "Setting PNPM store directory to $EXPECTED_STORE" + mkdir -p "$EXPECTED_STORE" + pnpm config set store-dir "$EXPECTED_STORE" +fi + # Check if jetpack command is available if ! pnpm jetpack --help >/dev/null 2>&1; then echo "Setting up Jetpack CLI..." From 551097490ee0434b793f59ead6eaf25cd10cafad Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Thu, 9 Jan 2025 22:32:06 -0600 Subject: [PATCH 04/29] Confusing the different monorepo containers, let's use the right one --- tools/docker/bin/monorepo-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/bin/monorepo-entrypoint.sh b/tools/docker/bin/monorepo-entrypoint.sh index 0266f90a9ad67..960237c703087 100644 --- a/tools/docker/bin/monorepo-entrypoint.sh +++ b/tools/docker/bin/monorepo-entrypoint.sh @@ -4,7 +4,7 @@ set -e # Check and set PNPM store location -EXPECTED_STORE="/usr/local/src/jetpack-monorepo/tools/docker/data/pnpm-store" +EXPECTED_STORE="/workspace/tools/docker/data/pnpm-store" CURRENT_STORE=$(pnpm config get store-dir) if [ "$CURRENT_STORE" != "$EXPECTED_STORE" ]; then From d244c27cf0846260ce4061aed0e586c8e3492678 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 08:21:04 -0600 Subject: [PATCH 05/29] No tests yet --- projects/js-packages/jetpack-cli/composer.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/projects/js-packages/jetpack-cli/composer.json b/projects/js-packages/jetpack-cli/composer.json index 42127f0f1f562..032cc3380b832 100644 --- a/projects/js-packages/jetpack-cli/composer.json +++ b/projects/js-packages/jetpack-cli/composer.json @@ -14,13 +14,16 @@ }, "scripts": { "phpunit": [ - "./vendor/phpunit/phpunit/phpunit --colors=always" + "echo 'no phpunit yet'" ], "test-coverage": [ - "php -dpcov.directory=. ./vendor/bin/phpunit --coverage-php \"$COVERAGE_DIR/php.cov\"" + "echo 'no php'" ], "test-php": [ - "@composer phpunit" + "echo 'no php'" + ], + "test-js": [ + "echo 'no tests yet'" ] }, "repositories": [ From 6fbd4185830b4eaa23f5cfe853b4aa6c2b95e3e2 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 08:43:31 -0600 Subject: [PATCH 06/29] Try to fix the e2e tests --- .github/workflows/e2e-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 98e01159a7ad4..3e1b9d303f588 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -211,6 +211,7 @@ jobs: CONFIG_KEY: ${{ secrets.E2E_CONFIG_KEY }} SUITE: ${{ matrix.suite }} PROJECT_NAME: ${{ matrix.project }} + HOST_CWD: ${{ github.workspace }} run: | echo "::group::Decrypt config" pnpm run config:decrypt From f3ba0e7c3bf6557152b2704eeaee22b8862f8e89 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 09:26:55 -0600 Subject: [PATCH 07/29] Ensure docker is available within the container for interacting with ther other containers --- tools/docker/Dockerfile.monorepo | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo index 9517dd98e3f53..c67318fe59a53 100644 --- a/tools/docker/Dockerfile.monorepo +++ b/tools/docker/Dockerfile.monorepo @@ -15,14 +15,26 @@ WORKDIR /app RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ - && apt-get install -y curl gpg language-pack-en-base software-properties-common \ + && apt-get install -y curl gpg language-pack-en-base software-properties-common ca-certificates \ && add-apt-repository ppa:ondrej/php \ && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \ + # Add Docker's official GPG key + && install -m 0755 -d /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc \ + && chmod a+r /etc/apt/keyrings/docker.asc \ + # Add Docker repository + && echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ + $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ + tee /etc/apt/sources.list.d/docker.list > /dev/null \ && apt-get update \ && apt-get --purge install -y \ git \ unzip \ zip \ + docker-ce-cli \ + docker-buildx-plugin \ + docker-compose-plugin \ "php${PHP_VERSION}" \ "php${PHP_VERSION}-cli" \ "php${PHP_VERSION}-curl" \ From 2c460cd801a1ce83f8355fe307566968c2bf5e21 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 09:40:24 -0600 Subject: [PATCH 08/29] Switch logic to all docker commands run in the container, except for up, down, stop, clean --- projects/js-packages/jetpack-cli/bin/jp.js | 243 +++++++++++---------- 1 file changed, 130 insertions(+), 113 deletions(-) diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 4c98478ae1975..7a5f5f5607712 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -136,131 +136,148 @@ const main = async () => { throw new Error( 'Monorepo not found' ); } - // Handle docker commands on the host + // Handle docker commands that must run on the host machine if ( args[ 0 ] === 'docker' ) { - // Commands that should run in the container - const containerCommands = [ 'build-image', 'install' ]; - if ( containerCommands.includes( args[ 1 ] ) ) { - const result = spawnSync( - resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), - [ 'pnpm', 'jetpack', ...args ], - { - stdio: 'inherit', - shell: true, - cwd: monorepoRoot, - } - ); - - if ( result.status !== 0 ) { - throw new Error( `Command failed with status ${ result.status }` ); - } - return; - } - - // Run config generation first if this is an 'up' command - if ( args[ 1 ] === 'up' ) { - // Create required directories - fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/data/jetpack_dev_mysql' ), { - recursive: true, - } ); - fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/data/ssh.keys' ), { recursive: true } ); - fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/wordpress' ), { recursive: true } ); - - const images = [ - { name: 'mariadb:lts' }, - { name: 'automattic/jetpack-wordpress-dev:latest' }, - { name: 'phpmyadmin/phpmyadmin:latest', platform: 'linux/amd64' }, - { name: 'maildev/maildev', platform: 'linux/amd64' }, - { name: 'atmoz/sftp', platform: 'linux/amd64' }, - ]; - - for ( const image of images ) { - const inspect = spawnSync( 'docker', [ 'image', 'inspect', image.name ], { - stdio: 'ignore', + const hostCommands = [ 'up', 'down', 'stop', 'clean' ]; + if ( hostCommands.includes( args[ 1 ] ) ) { + // Handle command-specific setup/cleanup + if ( args[ 1 ] === 'up' ) { + // Create required directories + fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/data/jetpack_dev_mysql' ), { + recursive: true, } ); - if ( inspect.status !== 0 ) { - console.log( chalk.blue( `Pulling ${ image.name }...` ) ); - const pullArgs = [ 'pull', image.name ]; - if ( image.platform ) { - pullArgs.splice( 1, 0, '--platform', image.platform ); + fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/data/ssh.keys' ), { + recursive: true, + } ); + fs.mkdirSync( resolve( monorepoRoot, 'tools/docker/wordpress' ), { recursive: true } ); + + // Create empty .env file + fs.writeFileSync( resolve( monorepoRoot, 'tools/docker/.env' ), '' ); + + const images = [ + { name: 'mariadb:lts' }, + { name: 'automattic/jetpack-wordpress-dev:latest' }, + { name: 'phpmyadmin/phpmyadmin:latest', platform: 'linux/amd64' }, + { name: 'maildev/maildev', platform: 'linux/amd64' }, + { name: 'atmoz/sftp', platform: 'linux/amd64' }, + ]; + + for ( const image of images ) { + const inspect = spawnSync( 'docker', [ 'image', 'inspect', image.name ], { + stdio: 'ignore', + } ); + if ( inspect.status !== 0 ) { + console.log( chalk.blue( `Pulling ${ image.name }...` ) ); + const pullArgs = [ 'pull', image.name ]; + if ( image.platform ) { + pullArgs.splice( 1, 0, '--platform', image.platform ); + } + const pull = spawnSync( 'docker', pullArgs, { stdio: 'inherit' } ); + if ( pull.status !== 0 ) { + throw new Error( `Failed to pull ${ image.name }` ); + } } - const pull = spawnSync( 'docker', pullArgs, { stdio: 'inherit' } ); - if ( pull.status !== 0 ) { - throw new Error( `Failed to pull ${ image.name }` ); + } + + const configResult = spawnSync( + resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), + [ 'pnpm', 'jetpack', 'docker', 'config' ], + { + stdio: 'inherit', + shell: true, + cwd: monorepoRoot, } + ); + + if ( configResult.status !== 0 ) { + throw new Error( 'Failed to generate Docker config' ); } + } else if ( args[ 1 ] === 'clean' ) { + // After docker-compose down -v, also remove local files + const projectName = args.includes( '--type=e2e' ) ? 'jetpack_e2e' : 'jetpack_dev'; + const cleanupPaths = [ + resolve( monorepoRoot, 'tools/docker/wordpress/' ), + resolve( monorepoRoot, 'tools/docker/wordpress-develop/*' ), + resolve( monorepoRoot, 'tools/docker/logs/', projectName ), + resolve( monorepoRoot, 'tools/docker/data/', `${ projectName }_mysql` ), + ]; + + // Function to clean up after docker-compose down + const cleanupFiles = () => { + for ( const path of cleanupPaths ) { + try { + fs.rmSync( path, { recursive: true, force: true } ); + } catch ( error ) { + console.warn( + chalk.yellow( `Warning: Could not remove ${ path }: ${ error.message }` ) + ); + } + } + }; + + // Add cleanup to process events to ensure it runs after docker-compose + process.once( 'beforeExit', cleanupFiles ); + + // Replace 'clean' with 'down -v' in the arguments + args.splice( 1, 1, 'down', '-v' ); } - const configResult = spawnSync( - resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), - [ 'pnpm', 'jetpack', 'docker', 'config' ], - { - stdio: 'inherit', - shell: true, - cwd: monorepoRoot, + // Get project name (from docker.js) + const projectName = args.includes( '--type=e2e' ) ? 'jetpack_e2e' : 'jetpack_dev'; + + // Load versions from .github/versions.sh + const versionsPath = resolve( monorepoRoot, '.github/versions.sh' ); + const versions = fs.readFileSync( versionsPath, 'utf8' ); + const versionVars = {}; + versions.split( '\n' ).forEach( line => { + const match = line.match( /^([A-Z_]+)=(.+)$/ ); + if ( match ) { + versionVars[ match[ 1 ] ] = match[ 2 ].replace( /['"]/g, '' ); } - ); + } ); - if ( configResult.status !== 0 ) { - throw new Error( 'Failed to generate Docker config' ); - } - } + // Build environment variables (from docker.js) + const envVars = { + ...process.env, + // Load from default.env + ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) + ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) ) + : {} ), + // Load from .env if it exists + ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) + ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) ) + : {} ), + HOST_CWD: monorepoRoot, + PHP_VERSION: versionVars.PHP_VERSION, + COMPOSER_VERSION: versionVars.COMPOSER_VERSION, + NODE_VERSION: versionVars.NODE_VERSION, + PNPM_VERSION: versionVars.PNPM_VERSION, + COMPOSE_PROJECT_NAME: projectName, + PORT_WORDPRESS: args.includes( '--type=e2e' ) ? '8889' : '80', + }; + + // Build the list of compose files to use + const composeFiles = [ + '-f', + resolve( monorepoRoot, 'tools/docker/docker-compose.yml' ), + '-f', + resolve( monorepoRoot, 'tools/docker/compose-mappings.built.yml' ), + '-f', + resolve( monorepoRoot, 'tools/docker/compose-extras.built.yml' ), + ]; - // Get project name (from docker.js) - const projectName = args.includes( '--type=e2e' ) ? 'jetpack_e2e' : 'jetpack_dev'; - - // Load versions from .github/versions.sh - const versionsPath = resolve( monorepoRoot, '.github/versions.sh' ); - const versions = fs.readFileSync( versionsPath, 'utf8' ); - const versionVars = {}; - versions.split( '\n' ).forEach( line => { - const match = line.match( /^([A-Z_]+)=(.+)$/ ); - if ( match ) { - versionVars[ match[ 1 ] ] = match[ 2 ].replace( /['"]/g, '' ); - } - } ); - - // Build environment variables (from docker.js) - const envVars = { - ...process.env, - // Load from default.env - ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) - ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) ) - : {} ), - // Load from .env if it exists - ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) - ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) ) - : {} ), - HOST_CWD: monorepoRoot, - PHP_VERSION: versionVars.PHP_VERSION, - COMPOSER_VERSION: versionVars.COMPOSER_VERSION, - NODE_VERSION: versionVars.NODE_VERSION, - PNPM_VERSION: versionVars.PNPM_VERSION, - COMPOSE_PROJECT_NAME: projectName, - PORT_WORDPRESS: args.includes( '--type=e2e' ) ? '8889' : '80', - }; - - // Build the list of compose files to use - const composeFiles = [ - '-f', - resolve( monorepoRoot, 'tools/docker/docker-compose.yml' ), - '-f', - resolve( monorepoRoot, 'tools/docker/compose-mappings.built.yml' ), - '-f', - resolve( monorepoRoot, 'tools/docker/compose-extras.built.yml' ), - ]; - - const result = spawnSync( 'docker', [ 'compose', ...composeFiles, ...args.slice( 1 ) ], { - stdio: 'inherit', - shell: true, - cwd: resolve( monorepoRoot, 'tools/docker' ), - env: envVars, - } ); + const result = spawnSync( 'docker', [ 'compose', ...composeFiles, ...args.slice( 1 ) ], { + stdio: 'inherit', + shell: true, + cwd: resolve( monorepoRoot, 'tools/docker' ), + env: envVars, + } ); - if ( result.status !== 0 ) { - throw new Error( `Docker command failed with status ${ result.status }` ); + if ( result.status !== 0 ) { + throw new Error( `Docker command failed with status ${ result.status }` ); + } + return; } - return; } // Run the monorepo script with the original arguments From 0db9170da92ce95738671279a620bb776ef344f8 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 09:56:06 -0600 Subject: [PATCH 09/29] Add notification system for updates --- pnpm-lock.yaml | 255 ++++++++++++++++++ projects/js-packages/jetpack-cli/bin/jp.js | 15 ++ projects/js-packages/jetpack-cli/package.json | 3 +- 3 files changed, 272 insertions(+), 1 deletion(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a51262c2ff014..af9ec180595ee 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -949,6 +949,9 @@ importers: prompts: specifier: ^2.4.2 version: 2.4.2 + update-notifier: + specifier: ^7.0.0 + version: 7.3.1 projects/js-packages/licensing: dependencies: @@ -6460,6 +6463,18 @@ packages: engines: {node: '>=18'} hasBin: true + '@pnpm/config.env-replace@1.1.0': + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + + '@pnpm/network.ca-file@1.0.2': + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + + '@pnpm/npm-conf@2.3.1': + resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} + engines: {node: '>=12'} + '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} @@ -8379,6 +8394,9 @@ packages: allure-playwright@2.9.2: resolution: {integrity: sha512-N0X1c1GGLg74vdDAuq86KCekuvQ5BaqqpgcBpJj5x3y/RlQPBn84wlg8PT/ViKQM4EdbNFMXOXpa5Opufv6qCg==} + ansi-align@3.0.1: + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -8713,6 +8731,10 @@ packages: bounding-client-rect@1.0.5: resolution: {integrity: sha512-3OVNM56TuMbHZYjbIbAkHZ7VHYVK9RPLr3s2nZucuJm1HgDBFEY6twJce4dCNwF0MO3ySOyA9KUZ+pObCd4mow==} + boxen@8.0.1: + resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==} + engines: {node: '>=18'} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -8798,6 +8820,10 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + camelcase@8.0.0: + resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} + engines: {node: '>=16'} + camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} @@ -8913,6 +8939,10 @@ packages: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} + cli-boxes@3.0.0: + resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} + engines: {node: '>=10'} + cli-cursor@2.1.0: resolution: {integrity: sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==} engines: {node: '>=4'} @@ -9062,6 +9092,9 @@ packages: engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} hasBin: true + config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + config@3.3.12: resolution: {integrity: sha512-Vmx389R/QVM3foxqBzXO8t2tUikYZP64Q6vQxGrsMpREeJc/aWRnPRERXWsYzOHAumx/AOoILWe6nU3ZJL+6Sw==} engines: {node: '>= 10.0.0'} @@ -9420,6 +9453,10 @@ packages: resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==} engines: {node: '>= 0.4'} + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -9628,6 +9665,9 @@ packages: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@7.0.3: resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} @@ -9768,6 +9808,10 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-goat@4.0.0: + resolution: {integrity: sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==} + engines: {node: '>=12'} + escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -10361,6 +10405,10 @@ packages: get-document@1.0.0: resolution: {integrity: sha512-8E7H2Xxibav+/rQTTtm6gFlSQwDoAQg667yheA+vWQr/amxEuswChzGo4MIbOJJoR0SMpDyhbUqWp3FpIfwD9A==} + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + engines: {node: '>=18'} + get-intrinsic@1.2.5: resolution: {integrity: sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==} engines: {node: '>= 0.4'} @@ -10430,6 +10478,10 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported + global-directory@4.0.1: + resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} + engines: {node: '>=18'} + global-modules@0.2.3: resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} engines: {node: '>=0.10.0'} @@ -10477,6 +10529,9 @@ packages: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -10714,6 +10769,10 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + ini@4.1.1: + resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + internal-slot@1.0.7: resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} engines: {node: '>= 0.4'} @@ -10833,6 +10892,15 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-in-ci@1.0.0: + resolution: {integrity: sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==} + engines: {node: '>=18'} + hasBin: true + + is-installed-globally@1.0.0: + resolution: {integrity: sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==} + engines: {node: '>=18'} + is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -10844,6 +10912,10 @@ packages: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} + is-npm@6.0.0: + resolution: {integrity: sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-number-object@1.1.0: resolution: {integrity: sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==} engines: {node: '>= 0.4'} @@ -10860,6 +10932,10 @@ packages: resolution: {integrity: sha512-NqCa4Sa2d+u7BWc6CukaObG3Fh+CU9bvixbpcXYhy2VvYS7vVGIdAgnIS5Ks3A/cqk4rebLJ9s8zBstT2aKnIA==} engines: {node: '>=4'} + is-path-inside@4.0.0: + resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} + engines: {node: '>=12'} + is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} @@ -11314,6 +11390,10 @@ packages: kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + ky@1.7.4: + resolution: {integrity: sha512-zYEr/gh7uLW2l4su11bmQ2M9xLgQLjyvx58UyNM/6nuqyWFHPX5ktMjvpev3F8QWdjSsHUpnWew4PBCswBNuMQ==} + engines: {node: '>=18'} + language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} @@ -11321,6 +11401,10 @@ packages: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} + latest-version@9.0.0: + resolution: {integrity: sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==} + engines: {node: '>=18'} + leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -12109,6 +12193,10 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + package-json@10.0.1: + resolution: {integrity: sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==} + engines: {node: '>=18'} + param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -12613,6 +12701,9 @@ packages: resolution: {integrity: sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==} engines: {node: '>=0.10'} + proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + protocol-buffers-schema@3.6.0: resolution: {integrity: sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==} @@ -12644,6 +12735,10 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + pupa@3.1.0: + resolution: {integrity: sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==} + engines: {node: '>=12.20'} + puppeteer-core@22.15.0: resolution: {integrity: sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==} engines: {node: '>=18'} @@ -12702,6 +12797,10 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + re-resizable@6.10.3: resolution: {integrity: sha512-zvWb7X3RJMA4cuSrqoxgs3KR+D+pEXnGrD2FAD6BMYAULnZsSF4b7AOVyG6pC3VVNVOtlagGDCDmZSwWLjjBBw==} peerDependencies: @@ -12945,6 +13044,14 @@ packages: resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} engines: {node: '>=4'} + registry-auth-token@5.0.3: + resolution: {integrity: sha512-1bpc9IyC+e+CNFRaWyn77tk4xGG4PPUyfakSmA6F6cvUDjrm58dfyJ3II+9yb10EDkHoy1LaPSmHaWLOH3m6HA==} + engines: {node: '>=14'} + + registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} @@ -13606,6 +13713,10 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + string.prototype.includes@2.0.1: resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} engines: {node: '>= 0.4'} @@ -13675,6 +13786,10 @@ packages: resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==} engines: {node: '>=12'} + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -14217,6 +14332,10 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + update-notifier@7.3.1: + resolution: {integrity: sha512-+dwUY4L35XFYEzE+OAL3sarJdUioVovq+8f7lcIJ7wnmnYQV5UD1Y/lcwaMSyaQ6Bj3JMj1XSTjZbNLHn/19yA==} + engines: {node: '>=18'} + uplot-react@1.1.4: resolution: {integrity: sha512-qO1UkQwjVKdj5vTm3O3yldvu1T6hwY4++rH4KznLhjqpnLdncq1zsRxq/zQz/HUHPVD0j7WBcEISbNM61JsuAQ==} engines: {node: '>=8.10'} @@ -14479,6 +14598,10 @@ packages: engines: {node: '>= 8'} hasBin: true + widest-line@5.0.0: + resolution: {integrity: sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==} + engines: {node: '>=18'} + wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} @@ -14525,6 +14648,10 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -16401,6 +16528,18 @@ snapshots: dependencies: playwright: 1.48.2 + '@pnpm/config.env-replace@1.1.0': {} + + '@pnpm/network.ca-file@1.0.2': + dependencies: + graceful-fs: 4.2.10 + + '@pnpm/npm-conf@2.3.1': + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + '@popperjs/core@2.11.8': {} '@preact/signals-core@1.8.0': {} @@ -20344,6 +20483,10 @@ snapshots: dependencies: allure-js-commons: 2.9.2 + ansi-align@3.0.1: + dependencies: + string-width: 4.2.3 + ansi-colors@4.1.3: {} ansi-escapes@3.2.0: {} @@ -20753,6 +20896,17 @@ snapshots: dependencies: get-document: 1.0.0 + boxen@8.0.1: + dependencies: + ansi-align: 3.0.1 + camelcase: 8.0.0 + chalk: 5.4.1 + cli-boxes: 3.0.0 + string-width: 7.2.0 + type-fest: 4.31.0 + widest-line: 5.0.0 + wrap-ansi: 9.0.0 + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -20839,6 +20993,8 @@ snapshots: camelcase@6.3.0: {} + camelcase@8.0.0: {} + camelize@1.0.1: {} caniuse-api@3.0.0: @@ -20998,6 +21154,8 @@ snapshots: clean-stack@2.2.0: {} + cli-boxes@3.0.0: {} + cli-cursor@2.1.0: dependencies: restore-cursor: 2.0.0 @@ -21183,6 +21341,11 @@ snapshots: tree-kill: 1.2.2 yargs: 17.6.2 + config-chain@1.1.13: + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + config@3.3.12: dependencies: json5: 2.2.3 @@ -21583,6 +21746,8 @@ snapshots: which-collection: 1.0.2 which-typed-array: 1.1.16 + deep-extend@0.6.0: {} + deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -21779,6 +21944,8 @@ snapshots: emittery@0.13.1: {} + emoji-regex@10.4.0: {} + emoji-regex@7.0.3: {} emoji-regex@8.0.0: {} @@ -22016,6 +22183,8 @@ snapshots: escalade@3.2.0: {} + escape-goat@4.0.0: {} + escape-html@1.0.3: {} escape-string-regexp@1.0.5: {} @@ -22739,6 +22908,8 @@ snapshots: get-document@1.0.0: {} + get-east-asian-width@1.3.0: {} + get-intrinsic@1.2.5: dependencies: call-bind-apply-helpers: 1.0.1 @@ -22825,6 +22996,10 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 + global-directory@4.0.1: + dependencies: + ini: 4.1.1 + global-modules@0.2.3: dependencies: global-prefix: 0.1.5 @@ -22879,6 +23054,8 @@ snapshots: gopd@1.2.0: {} + graceful-fs@4.2.10: {} + graceful-fs@4.2.11: {} gradient-parser@0.1.5: {} @@ -23111,6 +23288,8 @@ snapshots: ini@1.3.8: {} + ini@4.1.1: {} + internal-slot@1.0.7: dependencies: es-errors: 1.3.0 @@ -23218,12 +23397,21 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-in-ci@1.0.0: {} + + is-installed-globally@1.0.0: + dependencies: + global-directory: 4.0.1 + is-path-inside: 4.0.0 + is-map@2.0.3: {} is-module@1.0.0: {} is-negative-zero@2.0.3: {} + is-npm@6.0.0: {} + is-number-object@1.1.0: dependencies: call-bind: 1.0.8 @@ -23237,6 +23425,8 @@ snapshots: dependencies: symbol-observable: 1.2.0 + is-path-inside@4.0.0: {} + is-plain-obj@2.1.0: {} is-plain-obj@4.1.0: {} @@ -23989,12 +24179,18 @@ snapshots: kuler@2.0.0: {} + ky@1.7.4: {} + language-subtag-registry@0.3.23: {} language-tags@1.0.9: dependencies: language-subtag-registry: 0.3.23 + latest-version@9.0.0: + dependencies: + package-json: 10.0.1 + leven@3.1.0: {} levn@0.4.1: @@ -25037,6 +25233,13 @@ snapshots: package-json-from-dist@1.0.1: {} + package-json@10.0.1: + dependencies: + ky: 1.7.4 + registry-auth-token: 5.0.3 + registry-url: 6.0.1 + semver: 7.6.3 + param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -25504,6 +25707,8 @@ snapshots: properties@1.2.1: {} + proto-list@1.2.4: {} + protocol-buffers-schema@3.6.0: {} proxy-addr@2.0.7: @@ -25541,6 +25746,10 @@ snapshots: punycode@2.3.1: {} + pupa@3.1.0: + dependencies: + escape-goat: 4.0.0 + puppeteer-core@22.15.0: dependencies: '@puppeteer/browsers': 2.3.0 @@ -25609,6 +25818,13 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + re-resizable@6.10.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 @@ -25906,6 +26122,14 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.2.0 + registry-auth-token@5.0.3: + dependencies: + '@pnpm/npm-conf': 2.3.1 + + registry-url@6.0.1: + dependencies: + rc: 1.2.8 + regjsgen@0.8.0: {} regjsparser@0.12.0: @@ -26593,6 +26817,12 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.3.0 + strip-ansi: 7.1.0 + string.prototype.includes@2.0.1: dependencies: call-bind: 1.0.8 @@ -26678,6 +26908,8 @@ snapshots: dependencies: min-indent: 1.0.1 + strip-json-comments@2.0.1: {} + strip-json-comments@3.1.1: {} strip@3.0.0: {} @@ -27194,6 +27426,19 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + update-notifier@7.3.1: + dependencies: + boxen: 8.0.1 + chalk: 5.4.1 + configstore: 7.0.0 + is-in-ci: 1.0.0 + is-installed-globally: 1.0.0 + is-npm: 6.0.0 + latest-version: 9.0.0 + pupa: 3.1.0 + semver: 7.6.3 + xdg-basedir: 5.1.0 + uplot-react@1.1.4(react@18.3.1)(uplot@1.6.31): dependencies: react: 18.3.1 @@ -27519,6 +27764,10 @@ snapshots: dependencies: isexe: 2.0.0 + widest-line@5.0.0: + dependencies: + string-width: 7.2.0 + wildcard@2.0.1: {} winston-transport@4.9.0: @@ -27586,6 +27835,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrappy@1.0.2: {} write-file-atomic@3.0.3: diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 7a5f5f5607712..345cb35da56cb 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -8,11 +8,26 @@ import { fileURLToPath } from 'url'; import chalk from 'chalk'; import dotenv from 'dotenv'; import prompts from 'prompts'; +import updateNotifier from 'update-notifier'; // Get package.json path relative to this file const __dirname = dirname( fileURLToPath( import.meta.url ) ); const packageJson = JSON.parse( readFileSync( resolve( __dirname, '../package.json' ), 'utf8' ) ); +// Check for updates +const notifier = updateNotifier( { + pkg: packageJson, + updateCheckInterval: 1000 * 60 * 60 * 24, // Check once per day +} ); + +// Show update notification +notifier.notify( { + message: + 'Update available for Jetpack CLI: {currentVersion} → {latestVersion}\n' + + 'Run {updateCommand} to update', + isGlobal: true, +} ); + /** * Check if a directory is the monorepo root. * diff --git a/projects/js-packages/jetpack-cli/package.json b/projects/js-packages/jetpack-cli/package.json index bd1ea239b98cc..c5b9dd32df106 100644 --- a/projects/js-packages/jetpack-cli/package.json +++ b/projects/js-packages/jetpack-cli/package.json @@ -12,7 +12,8 @@ "dependencies": { "chalk": "^5.4.1", "dotenv": "^16.3.1", - "prompts": "^2.4.2" + "prompts": "^2.4.2", + "update-notifier": "^7.0.0" }, "publishConfig": { "access": "public" From 308d4560a5723dce0fa5b107006e51f31de0af5d Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 09:56:26 -0600 Subject: [PATCH 10/29] We're never expecting to have PHP tests --- projects/js-packages/jetpack-cli/composer.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/projects/js-packages/jetpack-cli/composer.json b/projects/js-packages/jetpack-cli/composer.json index 032cc3380b832..734918225c692 100644 --- a/projects/js-packages/jetpack-cli/composer.json +++ b/projects/js-packages/jetpack-cli/composer.json @@ -13,15 +13,6 @@ ] }, "scripts": { - "phpunit": [ - "echo 'no phpunit yet'" - ], - "test-coverage": [ - "echo 'no php'" - ], - "test-php": [ - "echo 'no php'" - ], "test-js": [ "echo 'no tests yet'" ] From e098e69567eee44d64c62eff51c67b1dbdd8b416 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 10:08:10 -0600 Subject: [PATCH 11/29] Ensure traditional jetpack docker up works --- tools/docker/docker-compose.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index 9e22a06fe6a17..d79132dabddf9 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -52,7 +52,7 @@ services: monorepo: build: - context: ${HOST_CWD}/tools/docker + context: ${HOST_CWD:-.}/tools/docker dockerfile: Dockerfile.monorepo args: PHP_VERSION: ${PHP_VERSION} @@ -60,5 +60,5 @@ services: NODE_VERSION: ${NODE_VERSION} PNPM_VERSION: ${PNPM_VERSION} volumes: - - ${HOST_CWD}:/usr/local/src/jetpack-monorepo + - ${HOST_CWD:-.}:/usr/local/src/jetpack-monorepo working_dir: /usr/local/src/jetpack-monorepo From 06a24a4a70e28c8152baa8797767b2248dd24d52 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 10:10:48 -0600 Subject: [PATCH 12/29] Simplify Co-authored-by: Brad Jorsch --- tools/docker/bin/monorepo-entrypoint.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/docker/bin/monorepo-entrypoint.sh b/tools/docker/bin/monorepo-entrypoint.sh index 960237c703087..262b10b292298 100644 --- a/tools/docker/bin/monorepo-entrypoint.sh +++ b/tools/docker/bin/monorepo-entrypoint.sh @@ -14,7 +14,7 @@ if [ "$CURRENT_STORE" != "$EXPECTED_STORE" ]; then fi # Check if jetpack command is available -if ! pnpm jetpack --help >/dev/null 2>&1; then +if ! pnpm jetpack --help &>/dev/null; then echo "Setting up Jetpack CLI..." pnpm install fi From 409396baef2993e595154e52d76932dfd765e7f8 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 10:21:42 -0600 Subject: [PATCH 13/29] Build for arm64 and amd64 when we're doing that --- .github/workflows/build-docker-monorepo.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-docker-monorepo.yml b/.github/workflows/build-docker-monorepo.yml index fc191eb40c38e..b2d1d1687bb2d 100644 --- a/.github/workflows/build-docker-monorepo.yml +++ b/.github/workflows/build-docker-monorepo.yml @@ -87,6 +87,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + platform: linux/arm64,linux/amd64 build-args: | PHP_VERSION=${{ steps.buildargs.outputs.php-version }} COMPOSER_VERSION=${{ steps.buildargs.outputs.composer-version }} From 5e8d7789fcb2cc7409b00d23c1682d9872a5a446 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 10:55:32 -0600 Subject: [PATCH 14/29] Support .env for custom vars --- projects/js-packages/jetpack-cli/bin/jp.js | 81 ++++++++++++++-------- 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 345cb35da56cb..132c9e2d1e77d 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -240,37 +240,64 @@ const main = async () => { // Get project name (from docker.js) const projectName = args.includes( '--type=e2e' ) ? 'jetpack_e2e' : 'jetpack_dev'; - // Load versions from .github/versions.sh - const versionsPath = resolve( monorepoRoot, '.github/versions.sh' ); - const versions = fs.readFileSync( versionsPath, 'utf8' ); - const versionVars = {}; - versions.split( '\n' ).forEach( line => { - const match = line.match( /^([A-Z_]+)=(.+)$/ ); - if ( match ) { - versionVars[ match[ 1 ] ] = match[ 2 ].replace( /['"]/g, '' ); - } - } ); - // Build environment variables (from docker.js) const envVars = { - ...process.env, - // Load from default.env - ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) - ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) ) - : {} ), - // Load from .env if it exists - ...( fs.existsSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) - ? dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) ) - : {} ), - HOST_CWD: monorepoRoot, - PHP_VERSION: versionVars.PHP_VERSION, - COMPOSER_VERSION: versionVars.COMPOSER_VERSION, - NODE_VERSION: versionVars.NODE_VERSION, - PNPM_VERSION: versionVars.PNPM_VERSION, - COMPOSE_PROJECT_NAME: projectName, - PORT_WORDPRESS: args.includes( '--type=e2e' ) ? '8889' : '80', + ...process.env, // Start with process.env }; + // Add default env vars if they exist + if ( fs.existsSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) ) { + Object.assign( + envVars, + dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/default.env' ) ) ) + ); + } + + // Add user overrides from .env if they exist + if ( fs.existsSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) ) { + Object.assign( + envVars, + dotenv.parse( fs.readFileSync( resolve( monorepoRoot, 'tools/docker/.env' ) ) ) + ); + } + + // Only set these specific vars if they're not already set in .env + if ( ! envVars.COMPOSE_PROJECT_NAME ) { + envVars.COMPOSE_PROJECT_NAME = projectName; + } + if ( ! envVars.PORT_WORDPRESS ) { + envVars.PORT_WORDPRESS = args.includes( '--type=e2e' ) ? '8889' : '80'; + } + + // Load versions from .github/versions.sh if not already set + if ( + ! ( + envVars.PHP_VERSION && + envVars.COMPOSER_VERSION && + envVars.NODE_VERSION && + envVars.PNPM_VERSION + ) + ) { + const versionsPath = resolve( monorepoRoot, '.github/versions.sh' ); + const versions = fs.readFileSync( versionsPath, 'utf8' ); + const versionVars = {}; + versions.split( '\n' ).forEach( line => { + const match = line.match( /^([A-Z_]+)=(.+)$/ ); + if ( match ) { + versionVars[ match[ 1 ] ] = match[ 2 ].replace( /['"]/g, '' ); + } + } ); + + // Only set version vars if they're not already set + if ( ! envVars.PHP_VERSION ) envVars.PHP_VERSION = versionVars.PHP_VERSION; + if ( ! envVars.COMPOSER_VERSION ) envVars.COMPOSER_VERSION = versionVars.COMPOSER_VERSION; + if ( ! envVars.NODE_VERSION ) envVars.NODE_VERSION = versionVars.NODE_VERSION; + if ( ! envVars.PNPM_VERSION ) envVars.PNPM_VERSION = versionVars.PNPM_VERSION; + } + + // Always set HOST_CWD as it's required for Docker context + envVars.HOST_CWD = monorepoRoot; + // Build the list of compose files to use const composeFiles = [ '-f', From 0dd5ba80f3356d54203d8bf5fc5802ddf01268ca Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 12:13:35 -0600 Subject: [PATCH 15/29] Transverse the dir tree without assuming unix dir structure --- projects/js-packages/jetpack-cli/bin/jp.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 132c9e2d1e77d..0ccfaeaab8fc1 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -50,10 +50,13 @@ const isMonorepoRoot = dir => { */ const findMonorepoRoot = startDir => { let dir = startDir; - while ( dir !== '/' ) { + let prevDir; + while ( dir !== prevDir ) { + // Keep going until dirname() stops changing the path if ( isMonorepoRoot( dir ) ) { return dir; } + prevDir = dir; dir = dirname( dir ); } return null; From 3f5a8756c2d80a0fc188d6fa21a398753f217086 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 12:47:17 -0600 Subject: [PATCH 16/29] Remove prepull. Possibly other issues, can't repro --- projects/js-packages/jetpack-cli/bin/jp.js | 25 ---------------------- 1 file changed, 25 deletions(-) diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 0ccfaeaab8fc1..6ed8663eeae6e 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -172,31 +172,6 @@ const main = async () => { // Create empty .env file fs.writeFileSync( resolve( monorepoRoot, 'tools/docker/.env' ), '' ); - const images = [ - { name: 'mariadb:lts' }, - { name: 'automattic/jetpack-wordpress-dev:latest' }, - { name: 'phpmyadmin/phpmyadmin:latest', platform: 'linux/amd64' }, - { name: 'maildev/maildev', platform: 'linux/amd64' }, - { name: 'atmoz/sftp', platform: 'linux/amd64' }, - ]; - - for ( const image of images ) { - const inspect = spawnSync( 'docker', [ 'image', 'inspect', image.name ], { - stdio: 'ignore', - } ); - if ( inspect.status !== 0 ) { - console.log( chalk.blue( `Pulling ${ image.name }...` ) ); - const pullArgs = [ 'pull', image.name ]; - if ( image.platform ) { - pullArgs.splice( 1, 0, '--platform', image.platform ); - } - const pull = spawnSync( 'docker', pullArgs, { stdio: 'inherit' } ); - if ( pull.status !== 0 ) { - throw new Error( `Failed to pull ${ image.name }` ); - } - } - } - const configResult = spawnSync( resolve( monorepoRoot, 'tools/docker/bin/monorepo' ), [ 'pnpm', 'jetpack', 'docker', 'config' ], From 91a0a0d974759ba7731238b0653b6601cf8d45b5 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 12:49:07 -0600 Subject: [PATCH 17/29] Update .github/workflows/build-docker-monorepo.yml Co-authored-by: Brad Jorsch --- .github/workflows/build-docker-monorepo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-docker-monorepo.yml b/.github/workflows/build-docker-monorepo.yml index b2d1d1687bb2d..aaf97566f9a5e 100644 --- a/.github/workflows/build-docker-monorepo.yml +++ b/.github/workflows/build-docker-monorepo.yml @@ -87,7 +87,7 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - platform: linux/arm64,linux/amd64 + platforms: linux/arm64,linux/amd64 build-args: | PHP_VERSION=${{ steps.buildargs.outputs.php-version }} COMPOSER_VERSION=${{ steps.buildargs.outputs.composer-version }} From a8266cf7d84f6f775c6d05557ee86b5e34d75f0e Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 12:52:17 -0600 Subject: [PATCH 18/29] add qemu --- .github/workflows/build-docker-monorepo.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-docker-monorepo.yml b/.github/workflows/build-docker-monorepo.yml index b2d1d1687bb2d..37d03160d604e 100644 --- a/.github/workflows/build-docker-monorepo.yml +++ b/.github/workflows/build-docker-monorepo.yml @@ -29,6 +29,11 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Set up qemu + uses: docker/setup-qemu-action@v3 + with: + platforms: arm64 + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 From 71f3eab0d05080ec3fab86a61788125c05a1b6a6 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 14:47:04 -0600 Subject: [PATCH 19/29] Only spin up monorepo via the executable package entry --- projects/js-packages/jetpack-cli/bin/jp.js | 5 ++++- tools/docker/docker-compose.yml | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 6ed8663eeae6e..3d524b110af77 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -286,7 +286,10 @@ const main = async () => { resolve( monorepoRoot, 'tools/docker/compose-extras.built.yml' ), ]; - const result = spawnSync( 'docker', [ 'compose', ...composeFiles, ...args.slice( 1 ) ], { + // Add dev profile for monorepo service + const composeArgs = [ 'compose', '--profile', 'dev', ...composeFiles, ...args.slice( 1 ) ]; + + const result = spawnSync( 'docker', composeArgs, { stdio: 'inherit', shell: true, cwd: resolve( monorepoRoot, 'tools/docker' ), diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index d79132dabddf9..7464aff89d667 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -51,6 +51,8 @@ services: - COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME monorepo: + profiles: + - dev build: context: ${HOST_CWD:-.}/tools/docker dockerfile: Dockerfile.monorepo From c4ca2f0faaeb6f2b51c53b1820b5fb91a7d73e94 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Fri, 10 Jan 2025 16:35:35 -0600 Subject: [PATCH 20/29] Separate docker-compose.yml --- projects/js-packages/jetpack-cli/bin/jp.js | 19 +++++++++++-------- tools/docker/Dockerfile.monorepo | 15 +++++++++++++++ tools/docker/docker-compose.yml | 15 --------------- 3 files changed, 26 insertions(+), 23 deletions(-) diff --git a/projects/js-packages/jetpack-cli/bin/jp.js b/projects/js-packages/jetpack-cli/bin/jp.js index 3d524b110af77..ae2ec21d48e6f 100755 --- a/projects/js-packages/jetpack-cli/bin/jp.js +++ b/projects/js-packages/jetpack-cli/bin/jp.js @@ -277,14 +277,17 @@ const main = async () => { envVars.HOST_CWD = monorepoRoot; // Build the list of compose files to use - const composeFiles = [ - '-f', - resolve( monorepoRoot, 'tools/docker/docker-compose.yml' ), - '-f', - resolve( monorepoRoot, 'tools/docker/compose-mappings.built.yml' ), - '-f', - resolve( monorepoRoot, 'tools/docker/compose-extras.built.yml' ), - ]; + const composeFiles = + args[ 0 ] === 'docker' && [ 'build-image', 'install' ].includes( args[ 1 ] ) + ? [ '-f', resolve( monorepoRoot, 'tools/docker/docker-compose-monorepo.yml' ) ] + : [ + '-f', + resolve( monorepoRoot, 'tools/docker/docker-compose.yml' ), + '-f', + resolve( monorepoRoot, 'tools/docker/compose-mappings.built.yml' ), + '-f', + resolve( monorepoRoot, 'tools/docker/compose-extras.built.yml' ), + ]; // Add dev profile for monorepo service const composeArgs = [ 'compose', '--profile', 'dev', ...composeFiles, ...args.slice( 1 ) ]; diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo index c67318fe59a53..b18a91a463b08 100644 --- a/tools/docker/Dockerfile.monorepo +++ b/tools/docker/Dockerfile.monorepo @@ -69,5 +69,20 @@ WORKDIR /workspace COPY bin/monorepo-entrypoint.sh /usr/local/bin/ RUN chmod +x /usr/local/bin/monorepo-entrypoint.sh +# Set up locale properly +RUN apt-get update && apt-get install -y locales \ + && locale-gen en_US.UTF-8 \ + && update-locale LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 + +ENV LANG=en_US.UTF-8 +ENV LC_ALL=en_US.UTF-8 + +# Set up PNPM global directory +ENV PNPM_HOME=/usr/local/pnpm +ENV PATH="${PNPM_HOME}:${PATH}" + +RUN mkdir -p "$PNPM_HOME" \ + && chmod 777 "$PNPM_HOME" + ENTRYPOINT ["/usr/local/bin/monorepo-entrypoint.sh"] CMD ["bash"] diff --git a/tools/docker/docker-compose.yml b/tools/docker/docker-compose.yml index 7464aff89d667..ed3b73fae43e4 100644 --- a/tools/docker/docker-compose.yml +++ b/tools/docker/docker-compose.yml @@ -49,18 +49,3 @@ services: environment: - HOST_PORT=${PORT_WORDPRESS:-80} - COMPOSE_PROJECT_NAME=$COMPOSE_PROJECT_NAME - - monorepo: - profiles: - - dev - build: - context: ${HOST_CWD:-.}/tools/docker - dockerfile: Dockerfile.monorepo - args: - PHP_VERSION: ${PHP_VERSION} - COMPOSER_VERSION: ${COMPOSER_VERSION} - NODE_VERSION: ${NODE_VERSION} - PNPM_VERSION: ${PNPM_VERSION} - volumes: - - ${HOST_CWD:-.}:/usr/local/src/jetpack-monorepo - working_dir: /usr/local/src/jetpack-monorepo From c20cb23022a47934ed35c06835c95698b9a8a14e Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Sat, 11 Jan 2025 13:16:54 -0600 Subject: [PATCH 21/29] Add new docker-composer :) --- tools/docker/docker-compose-monorepo.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tools/docker/docker-compose-monorepo.yml diff --git a/tools/docker/docker-compose-monorepo.yml b/tools/docker/docker-compose-monorepo.yml new file mode 100644 index 0000000000000..3b5d83341ff25 --- /dev/null +++ b/tools/docker/docker-compose-monorepo.yml @@ -0,0 +1,15 @@ +services: + monorepo: + profiles: + - dev + build: + context: ${HOST_CWD:-.}/tools/docker + dockerfile: Dockerfile.monorepo + args: + PHP_VERSION: ${PHP_VERSION} + COMPOSER_VERSION: ${COMPOSER_VERSION} + NODE_VERSION: ${NODE_VERSION} + PNPM_VERSION: ${PNPM_VERSION} + volumes: + - ${HOST_CWD:-.}:/usr/local/src/jetpack-monorepo + working_dir: /usr/local/src/jetpack-monorepo From 4a74468f30bdccbb289341d1143b77fc3b90ce26 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Sat, 11 Jan 2025 13:42:33 -0600 Subject: [PATCH 22/29] First attempt at some documentation updates --- docs/monorepo.md | 27 ++++---- docs/quick-start.md | 137 ++++++++++++++++---------------------- tools/docker/README.md | 145 +++++++++++++++++++++++++++++++---------- 3 files changed, 180 insertions(+), 129 deletions(-) diff --git a/docs/monorepo.md b/docs/monorepo.md index 99214f513a8b6..95e1c6a2f8899 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -47,19 +47,20 @@ All projects should be compatible with PHP versions WordPress supports. That's c First time working with the monorepo? We got you covered. -For the first time only: +Install the Jetpack CLI: -* From the root of the repo, run `pnpm install && pnpm jetpack cli link` (if you want the `jetpack` CLI tool installed globally) or `pnpm install` (if you don't). -* That’s it. You won’t need to do that again unless you nuke your node_modules directory. +```bash +npm install -g @automattic/jetpack-cli +``` -Once you’ve done that, it’s easy: run `jetpack` (or `pnpm jetpack`) while anywhere in the Jetpack repo. To explore on your own, run `jetpack --help` to see the available commands. +Once installed, you can run `jp` anywhere in the Jetpack repo. Run `jp --help` to see all available commands. ## Jetpack Generate Wizard Starting a new project? Great! Let the Jetpack Generate Wizard help jumpstart the files you need. To get started: * Make sure you're checked out to the branch you want. -* Use the CLI command `jetpack generate` to start the process. +* Use the CLI command `jp generate` to start the process. * The wizard will walk you through the steps of starting a new package, plugin, or Github action. ### Accepted Arguments @@ -69,7 +70,7 @@ The wizard accepts a few arguments to speed things up: * `[project type]` - Accepted values: `package`, `plugin`, `github-action` * `--name`, `--n` - The name of your project (no spaces) -Example: `jetpack generate plugin --name my_cool_plugin` will generate plugin files for a plugin called `my_cool_plugin` under `../jetpack/projects/plugins` +Example: `jp generate plugin --name my_cool_plugin` will generate plugin files for a plugin called `my_cool_plugin` under `../jetpack/projects/plugins` ### What's Included @@ -456,29 +457,29 @@ The body is separated from the headers by a blank line, and is the text that act The changelogger tool can be used via [Jetpack's CLI tool](#first-time). You may use the following command to generate changelog entries for each project that needs one: -`jetpack changelog add` +`jp changelog add` **Does it matter what the change file is named?** Starting the file name with `.` should not be used. Also consider avoiding names that have extensions like `.php` or `.js` to avoid confusing other tools. -**What if a change is so trivial that it doesn’t need a changelog entry?** The change file is still required. If you specify the significance as “patch”, changelogger will allow the body section to be empty so as to not generate an entry in the changelog. In this case, use the “Comment” header instead, for example: +**What if a change is so trivial that it doesn't need a changelog entry?** The change file is still required. If you specify the significance as "patch", changelogger will allow the body section to be empty so as to not generate an entry in the changelog. In this case, use the "Comment" header instead, for example: -``` +```bash Significance: patch Type: compat Comment: Update composer.lock, no need for a changelog entry ``` -**Adding the first PR to a project after a release?** If a PR is the first to Jetpack after a release, version numbers may need to be bumped. This also applies to the first semantic versioning “minor” or “major” change to any projects that use semantic versioning. +**Adding the first PR to a project after a release?** If a PR is the first to Jetpack after a release, version numbers may need to be bumped. This also applies to the first semantic versioning "minor" or "major" change to any projects that use semantic versioning. -The “Linting / Changelogger validity” GitHub Actions check will help in making sure that all these version numbers are in sync with the version inferred from the changelog and change files. You can also check this locally with `tools/changelogger-validate-all.sh`. +The "Linting / Changelogger validity" GitHub Actions check will help in making sure that all these version numbers are in sync with the version inferred from the changelog and change files. You can also check this locally with `tools/changelogger-validate-all.sh`. -Within a single project, changlogger’s `version next` command can tell you the next version, and the monorepo script `tools/project-version.sh` can be used to check and update the version numbers. +Within a single project, changlogger's `version next` command can tell you the next version, and the monorepo script `tools/project-version.sh` can be used to check and update the version numbers. ## New Projects To begin, * For Automatticians, drop us a line in #jetpack-crew to discuss your needs, just to be sure we don't have something already. For others, it would probably be best to open an issue to discuss it. -* Use the `jetpack generate` command to create a skeleton project. +* Use the `jp generate` command to create a skeleton project. * Create your project based on the skeleton and submit a PR as usual. Once we're sure that the project will be created and what its name will be, someone (you or the Crew team) does the following: diff --git a/docs/quick-start.md b/docs/quick-start.md index 029c6feaf2907..d4d01204358c1 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -2,81 +2,74 @@ ## Overview -This guide is designed to get you up and running working with the Jetpack Monorepo quickly following recommended and supported guidelines. +This guide will get you up and running with Jetpack development as quickly as possible using our recommended tools. -**This guide assumes you are using MacOS or a Linux machine and are an Automattician**. For more detailed information, including setting up local dev environments for all contributors, running unit tests, best coding practices, and more, you can use the [full Development Environment guide here](development-environment.md#clone-the-repository). +**Prerequisites**: You'll need: +- Node.js installed (any recent LTS version) +- Git installed and configured +- Docker installed and running ## Installation -### Using the installation script - -To speed up the installation process, you may use our monorepo installation script. To do so: - -- Clone the Jetpack Monorepo: - - Using a public SSH key ([recommended](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)): `git clone git@github.com:Automattic/jetpack.git` - - Or use HTTPS: `git clone https://github.com/Automattic/jetpack.git` - - Note that the monorepo should not be cloned into the WordPress plugins directory. If you plan on not using the provided Docker environment, read the [full Development Environment guide here](development-environment.md#clone-the-repository) to find out how to add symlinks. -- `cd` into the cloned `jetpack` folder. -- Run `tools/install-monorepo.sh` from the monorepo root. -- You can use the [environment checker script](#check-if-your-environment-is-ready-for-jetpack-development) to confirm that all required tools are installed. +1. Install the Jetpack CLI: +```bash +npm install -g @automattic/jetpack-cli +``` -Once the installation is complete, continue onto the section [Running Jetpack locally](#running-jetpack-locally). +2. Initialize Jetpack: +```bash +jp init +``` -### Installing manually +This will: +- Clone the Jetpack monorepo to your chosen location +- Guide you through the next steps to get started -Prior to installation, we recommend using [`Homebrew`](https://brew.sh/) to manage installations and [`nvm`](https://github.com/nvm-sh/nvm/) to manage Node.js versions. If you don't already have those installed, you can do so by copy/pasting each of the following commands and running them in your terminal: +## Development Workflow -- Homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` -- nvm: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash` +Build and test your changes: +```bash +# Build a specific project with dependencies +jp build plugins/jetpack --deps -The Jetpack Monorepo requires various software to be installed on your machine. +# Or watch for changes +jp watch plugins/jetpack -- Clone the Jetpack Monorepo: - - Using a public SSH key ([recommended](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)): `git clone git@github.com:Automattic/jetpack.git` - - Or use HTTPS: `git clone https://github.com/Automattic/jetpack.git` - - Note that the monorepo should not be cloned into the WordPress plugins directory. If you plan on not using the provided Docker environment, read the [full Development Environment guide here](development-environment.md#clone-the-repository) to find out how to add symlinks. -- This software needs to be installed or updated system-wide: - - Bash (will need to be updated from default Mac version): `brew install bash` - - jq (JSON processor used in scripts): `brew install jq` -- To install or update the following software, cd into the Jetpack directory that was created when cloning the repo: `cd jetpack`: - - Node.js (used for build process and our CLI): `nvm install && nvm use` - - PNPM (a Node.js package manager): `npm install -g pnpm` - - PHP (the language at the core of the WordPress ecosystem): `source .github/versions.sh && brew install php@$PHP_VERSION` - - Composer (our PHP package manager): `brew install composer` - - Jetpack CLI (an internal tool that assists with development): `pnpm install && pnpm jetpack cli link` - - [You can read more about using the CLI here](https://github.com/Automattic/jetpack/blob/trunk/tools/cli/README.md). +# Run tests +jp test +``` -### Check if your environment is ready for Jetpack development +## Testing with Docker -We provide a script to help you in assessing if everything's ready on your system to contribute to Jetpack. +Jetpack includes a testing environment using Docker. To start testing: -```sh -tools/check-development-environment.sh +1. Start the testing environment: +```bash +jp docker up -d ``` -Running the script will tell you if you have your environment already set up and what you need to do in order to get it ready for Jetpack development: +2. Install WordPress (first time only): +```bash +jp docker install +``` -- All green `YES` or `OK` messages mean you're ready to start -- Red `NO` messages mean something is wrong or missing, and a link will be provided to help you with a fix. -- Yellow messages indicate something optional is broken or missing. +3. Visit http://localhost to see your site! -## Running Jetpack locally +## Testing WordPress.com Features -After everything is installed, you're ready to run Jetpack locally! While there are other supported methods of doing this, we recommend and support using Docker containers. +To test features requiring a WordPress.com connection: -To setup Docker: -- Install Docker: - - Mac: `brew install --cask docker` (This will take a while!) - - Linux: `brew install docker` - - `open -a Docker` (or open the app from your Applications folder) to open the GUI application. You will likely need to enter your device password and accept their terms for a first time setup. -- Copy the settings file from within the monorepo root: `cp tools/docker/default.env tools/docker/.env` -- Open `tools/docker/.env` and make any modifications you'd like. - - It's strongly recommend you at least change `WP_ADMIN_PASSWORD` to something more secure. -- Start the Docker container using `jetpack docker up -d` (this may take some time for the first setup) -- Install WordPress in your Docker container using `jetpack docker install` -- Open up http://localhost to see your site! +### For Automatticians: +Use Jurassic Tube: +```bash +jp docker jt-up +``` -For more in depth Docker instructions, follow the [Docker environment for Jetpack Development guide](../tools/docker/README.md). +### For External Contributors: +Use ngrok: +```bash +jp docker ngrok-up +``` ## Setting up Jurassic Tube @@ -84,34 +77,18 @@ In order to test features that require a WordPress.com connection and other netw Note: This is for Automattician use only. For other methods, check out [ngrok](../tools/docker/README.md#using-ngrok-with-jetpack) or [another similar service](https://alternativeto.net/software/ngrok/). -**Warning: This creates a tunnel to your local machine which should not be trusted as secure. If it is compromised, so is your computer and everything it has access to. Only `jetpack docker jt-up` when needed for testing things that require the site to be publicly accessible, and `jetpack docker jt-down` when completed.** +**Warning: This creates a tunnel to your local machine which should not be trusted as secure. If it is compromised, so is your computer and everything it has access to. Only `jp docker jt-up` when needed for testing things that require +the site to be publicly accessible, and `jp docker jt-down` when completed.** - Visit the [jurassic.tube](https://jurassic.tube/) homepage to create a subdomain -- Make sure you've run `pnpm install && pnpm jetpack cli link` -- Make sure Docker is running `jetpack docker up -d` +- Make sure you've run `npm install -g @automattic/jetpack-cli` +- Make sure Docker is running `jp docker up -d` - Stand on the monorepo root in your terminal and run `mkdir tools/docker/bin/jt` -- Stop and restart the docker env: `jetpack docker stop && jetpack docker up -d` +- Stop and restart the docker env: `jp docker stop && jp docker up -d` - Download and run the installation script: `curl "https://jurassic.tube/get-installer.php?env=jetpack" -o tools/docker/bin/jt/installer.sh && chmod +x tools/docker/bin/jt/installer.sh && tools/docker/bin/jt/installer.sh` -- Set your username: `jetpack docker jt-config username [your-username-here e.g david]` -- Set your subdomain: `jetpack docker jt-config subdomain [your-subdomain-here e.g. spaceman]` -- Now, you can start your site with `jetpack docker jt-up` +- Set your username: `jp docker jt-config username [your-username-here e.g david]` +- Set your subdomain: `jp docker jt-config subdomain [your-subdomain-here e.g. spaceman]` +- Now, you can start your site with `jp docker jt-up` - Your site should be available at `https://custom-subdomain.jurassic.tube` -## Development Workflow - -Once you have a local copy of Jetpack and all development tools installed, you can start developing. - -1. Make sure the plugin you're developing is activated on your WordPress site. -2. [Build your project](development-environment.md#building-your-project) using `jetpack build [type/project]` and including its dependencies, such as `jetpack build plugins/jetpack --deps` -3. Access the plugin's dashboard in your browser. - -By default the development build above will run once and if you change any of the files, you need to run `jetpack build` again to see the changes on the site. If you want to avoid that, you can run a continuous build that will rebuild anytime it sees any changes on your local filesystem. To run it, use: - -```sh -jetpack watch -``` -### Running Tests - -To run PHP, JS, and coverage tests, you can use the Jetpack CLI: `jetpack test` and then choose the project and type of test you'd like to run. - -That's all! +That's all! For more detailed information, see the [Development Environment guide](development-environment.md). diff --git a/tools/docker/README.md b/tools/docker/README.md index ff3ed2d622385..7f8d72dc58720 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -1,6 +1,19 @@ # Docker environment for Jetpack Development -Unified environment for developing Jetpack using Docker containers providing following goodies: +Jetpack development uses two Docker environments: + +## Development Environment + +A separate monorepo container provides development tools: + +* PHP and Composer for PHP development +* Node.js and pnpm for JavaScript development +* All build tools and dependencies needed for development +* Automatically used by the [`jp` CLI](../../projects/js-packages/jetpack-cli/README.md) for building and testing + +## Testing Environment + +The main WordPress testing environment provides: * An Ubuntu base operating system. * Latest stable version of WordPress. @@ -9,7 +22,7 @@ Unified environment for developing Jetpack using Docker containers providing fol * WP-CLI installed. * MailDev to catch all the emails leaving WordPress so that you can observe them from browser. * phpMyAdmin to aid in viewing the database. -* Handy shorthand commands like `jetpack docker up` and `jetpack docker phpunit` to simplify the usage. +* Handy shorthand commands like `jp docker up` and `jp docker phpunit` to simplify the usage. ## To get started @@ -35,12 +48,12 @@ Anything you put in `.env` overrides values in `default.env`. You should modify Once you're all set with the above, spin up the containers: ```sh -jetpack docker up +jp docker up ``` Non-installed WordPress is running at [http://localhost](http://localhost) now. To install WordPress and configure some useful defaults, run ```sh -jetpack docker install +jp docker install ``` At this point, to connect Jetpack, you'd need to set up a service that can create local HTTP tunnels, such as [the Jurassic Tube Tunneling Service](#jurassic-tube-tunneling-service) (available to Automatticians only), [ngrok](#using-ngrok-with-jetpack), or [another similar service](https://alternativeto.net/software/ngrok/). @@ -99,7 +112,7 @@ The default config file `tools/docker/jetpack-docker-config-default.yml` include You can just quickly install WordPress and activate Jetpack via command line. Ensure you have your domain modified in `.env` file, spin up the containers and then run: ```sh -jetpack docker install +jp docker install ``` This will give you a single site with user/pass `wordpress` (unless you changed these from `./tools/docker/.env` file). You will still have to connect Jetpack to WordPress.com manually. @@ -107,19 +120,19 @@ This will give you a single site with user/pass `wordpress` (unless you changed To convert installed single site into a multisite, run: ```sh -jetpack docker multisite-convert +jp docker multisite-convert ``` To remove WordPress installation and start over, run: ```sh -jetpack docker uninstall +jp docker uninstall ``` ### Start containers ```sh -jetpack docker up +jp docker up ``` Start the containers (WordPress, MySQL and MailDev) defined in `docker-compose.yml`. @@ -129,19 +142,19 @@ This command will rebuild the WordPress container if you made any changes to `do For running the containers in the background, use: ```sh -jetpack docker up -d +jp docker up -d ``` ### Stop containers ```sh -jetpack docker stop +jp docker stop ``` Stops all containers. ```sh -jetpack docker down +jp docker down ``` Will stop all of the containers created by this Docker compose configuration and remove them, too. It won’t remove the images. Just the containers that have just been stopped. @@ -151,18 +164,18 @@ Will stop all of the containers created by this Docker compose configuration and These commands require the WordPress container to be running. ```sh -jetpack docker phpunit +jp docker phpunit ``` This will run unit tests for Jetpack. You can pass arguments to `phpunit` like so: ```sh -jetpack docker phpunit -- --filter=Protect +jp docker phpunit -- --filter=Protect ``` This command runs the tests as a multi site install ```sh -jetpack docker phpunit-multisite -- --filter=Protect +jp docker phpunit-multisite -- --filter=Protect ``` To run tests for specific packages, you can run the tests locally, from within the package's directory: @@ -176,7 +189,7 @@ composer phpunit To remove all docker images, all MySQL data, and all docker-related files from your local machine run: ```sh -jetpack docker clean +jp docker clean ``` **Note:** this command does not work in Windows. @@ -186,22 +199,22 @@ jetpack docker clean You can run [WP CLI](https://make.wordpress.org/cli/) commands inside WordPress container: ```sh -jetpack docker wp COMMAND +jp docker wp COMMAND ``` For example run [`cron event list`](https://developer.wordpress.org/cli/commands/cron/event/list/): ```sh -jetpack docker wp cron event list +jp docker wp cron event list ``` [`shell`](https://developer.wordpress.org/cli/commands/shell/) is a handy WP-CLI command you can use like so: ```bash -jetpack docker wp shell +jp docker wp shell ``` -By default it will use rich REPL [`PsySH`](https://psysh.org/), to run the default REPL use `jetpack docker wp shell --basic` +By default it will use rich REPL [`PsySH`](https://psysh.org/), to run the default REPL use `jp docker wp shell --basic` Shell allows you to evaluate PHP code while having your installed WordPress loaded, so you could do things like: @@ -220,7 +233,7 @@ You can also access it via phpMyAdmin at [http://localhost:8181](http://localhos Another way to accessing the database is MySQL client using the following command: ```sh -jetpack docker db +jp docker db command "show tables;" ``` This command utilizes credentials from the config file (`~/.my.cnf`) to log you into MySQL without entering any connection information. @@ -256,29 +269,29 @@ define( 'JETPACK__SANDBOX_DOMAIN', '{your sandbox}.wordpress.com' ); This is for Automatticians only. More information: PCYsg-snO-p2. -If you have persistent trouble with the `jetpack docker jt-*` commands complaining that "Tunneling scripts are not installed", it could be because Docker wasn't running properly when you ran the installer. +If you have persistent trouble with the `jp docker jt-*` commands complaining that "Tunneling scripts are not installed", it could be because Docker wasn't running properly when you ran the installer. To solve this problem, run these commands from the repo root: ``` -jetpack docker up -d +jp docker up -d chmod +x tools/docker/bin/jt/installer.sh && tools/docker/bin/jt/installer.sh ``` Once you have successfull installed Jurassic Tube, you can use these commands during development: -* Start the tunnel: `jetpack docker jt-up your-username your-subdomain` -* Break the connection: `jetpack docker jt-down` +* Start the tunnel: `jp docker jt-up your-username your-subdomain` +* Break the connection: `jp docker jt-down` You can also set default values: ```shell script -jetpack docker jt-config username your-username -jetpack docker jt-config subdomain your-subdomain +jp docker jt-config username your-username +jp docker jt-config subdomain your-subdomain ``` That will let you omit those parameters while initiating the connection: ```shell script -jetpack docker jt-up +jp docker jt-up ``` ## Using Ngrok with Jetpack @@ -309,7 +322,7 @@ tunnels: ngrok support is integrated into a jetpack cli, so to start a docker container with mapped tunnel, simply run: ```bash -jetpack docker up --ngrok +jp docker up --ngrok ``` ### Ngrok SFTP Tunnel with Jetpack @@ -332,7 +345,7 @@ See more configuration options from [Ngrok documentation](https://ngrok.com/docs You can now start both tunnels: ```bash -jetpack docker up --ngrok sftp +jp docker up --ngrok sftp ``` You can inspect traffic between your WordPress/Jetpack container and WordPress.com using [the inspector](https://ngrok.com/docs#inspect). @@ -354,7 +367,7 @@ Jetpack Docker environment can be wonderful for developing your own plugins and Since everything under `mu-plugins` and `wordpress/wp-content` is git-ignored, you'll want to keep those folders outside Jetpack repository folder and link them as volumes to your Docker instance. -1. First ensure your containers are stopped (`jetpack docker stop`). +1. First ensure your containers are stopped (`jp docker stop`). 2. Edit `tools/docker/jetpack-docker-config.yml`. Changes to this file won't be tracked by git. 3. To add a single custom plugin, you would for example have this in that file: ```yml @@ -368,11 +381,11 @@ Since everything under `mu-plugins` and `wordpress/wp-content` is git-ignored, y ``` 4. Start containers and include your custom volumes by running: ```bash - jetpack docker up + jp docker up ``` Note that any folder within the `projects/plugins` directory will be automatically linked. -If you're starting a new monorepo plugin, you may need to `jetpack docker stop` and `jetpack docker up` to re-run the initial linking step so it can be added. +If you're starting a new monorepo plugin, you may need to `jp docker stop` and `jp docker up` to re-run the initial linking step so it can be added. You can add your plugin to the list of plugins not allowed to be deleted or updated by adding this to a new file at `tools/docker/mu-plugins`: @@ -399,7 +412,7 @@ Logs are stored in your file system under `./tools/docker/logs` directory. To `tail -f` the PHP error log, run: ```sh -jetpack docker tail +jp docker tail ``` #### MySQL Slow Query Log @@ -412,7 +425,7 @@ We recommend to regularly review the log to make sure performance issues don't g ### Debugging emails -Emails don’t leave your WordPress and are caught by [MailDev](http://danfarrelly.nyc/MailDev/) SMTP server container instead. +Emails don't leave your WordPress and are caught by [MailDev](http://danfarrelly.nyc/MailDev/) SMTP server container instead. To debug emails via web-interface, open [http://localhost:1080](http://localhost:1080) @@ -422,7 +435,7 @@ To debug emails via web-interface, open [http://localhost:1080](http://localhost You can use the [WP CLI](https://make.wordpress.org/cli/) to update the version of WordPress running inside the Docker container. Example command: ``` -jetpack docker wp core update --version=5.3.4 --force +jp docker wp core update --version=5.3.4 --force ``` This is useful if you want to check your code is compatible with the minimum version of WP Jetpack supports, which can be found in the [readme.txt](../readme.txt). We always support the latest patched version of the branch we specify as "Requires at least" in the readme file. You can match it with the exact version on the [WordPress Releases page](https://wordpress.org/download/releases/). @@ -431,7 +444,7 @@ This is useful if you want to check your code is compatible with the minimum ver The WordPress image is leveraged with Xdebug present as a PHP Extension. -You’ll likely need to install a browser extension like the following: +You'll likely need to install a browser extension like the following: * [The easiest Xdebug](https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/) for Mozilla Firefox * [Xdebug Helper](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) for Google Chrome @@ -546,3 +559,63 @@ function my_plugin_add_profile_parameter( $should_add, $url, $host ) { return $should_add; } ``` + +### Using ngrok with Jetpack + +```sh +jp docker ngrok-up +``` + +This command will start ngrok tunnel for you. The configuration for the tunnel can be found in `tools/docker/ngrok.yml`. + +To stop the tunnel: + +```sh +jp docker ngrok-down +``` + +### Using Jurassic Tube with Jetpack + +```sh +jp docker jt-up +``` + +This command will start Jurassic Tube tunnel for you. + +To stop the tunnel: + +```sh +jp docker jt-down +``` + +### Using Xdebug + +To use Xdebug with PHPStorm you can run: + +```sh +XDEBUG_CONFIG="remote_host=host.docker.internal" jp docker phpunit --filter=Protect +``` + +### Running a shell inside the container + +```sh +jp docker exec -- bash +``` + +### Running wp-cli commands + +```sh +jp docker wp cli info +``` + +### Watching for changes + +```sh +jp docker watch +``` + +### Building assets + +```sh +jp docker build plugins/jetpack +``` From 14bceb157e8d7d15c862ab32efbdc96226ce07be Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 13 Jan 2025 11:20:30 -0600 Subject: [PATCH 23/29] Add env to check if in monorepo env and disable jetpack cli {link|unlink} commands within monorepo env --- pnpm-lock.yaml | 290 ++++++++++++++++++++++++++++++- tools/cli/commands/cli.js | 12 ++ tools/docker/Dockerfile.monorepo | 3 +- 3 files changed, 300 insertions(+), 5 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3e859a95425fd..88012f8b875d8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -959,6 +959,21 @@ importers: specifier: 4.9.1 version: 4.9.1(webpack@5.94.0) + projects/js-packages/jetpack-cli: + dependencies: + chalk: + specifier: ^5.4.1 + version: 5.4.1 + dotenv: + specifier: ^16.3.1 + version: 16.4.7 + prompts: + specifier: ^2.4.2 + version: 2.4.2 + update-notifier: + specifier: ^7.0.0 + version: 7.3.1 + projects/js-packages/licensing: dependencies: '@automattic/jetpack-analytics': @@ -6129,6 +6144,10 @@ packages: resolution: {integrity: sha512-fo6Mtm5mWyKjA/Chy1BYTdn5mGJoDNjC7C64ug20ADsRDGrA85bN3uK3MaKbeRkRuuIEAR5N33Jr1pbm411/PA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.10.0': + resolution: {integrity: sha512-gFHJ+xBOo4G3WRlR1e/3G8A6/KZAH6zcE/hkLRCZTi/B9avAG365QhFA8uOGzTMqgTghpn7/fSnscW++dpMSAw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@0.9.1': resolution: {integrity: sha512-GuUdqkyyzQI5RMIWkHhvTWLCyLo1jNK3vzkSyaExH5kHPDHcuL2VOpHjmMY+y3+NC69qAKToBqldTBgYeLSr9Q==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -6145,8 +6164,8 @@ packages: resolution: {integrity: sha512-o0bhxnL89h5Bae5T318nFoFzGy+YE5i/gGkoPAgkmTVdRKTiv3p8JHevPiPaMwoloKfEiiaHlawCqaZMqRm+XQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.2.4': - resolution: {integrity: sha512-zSkKow6H5Kdm0ZUQUB2kV5JIXqoG0+uH5YADhaEHswm664N9Db8dXSi0nMJpacpMf+MyyglF1vnZohpEg5yUtg==} + '@eslint/plugin-kit@0.2.5': + resolution: {integrity: sha512-lB05FkqEdUg2AA0xEbUz0SnkXT1LcCTa438W4IWTUh4hdOnVbQyOJ81OrDXsJk/LSiJHubgGEFoR5EHq1NsH1A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@fastify/busboy@2.1.1': @@ -6469,6 +6488,18 @@ packages: engines: {node: '>=18'} hasBin: true + '@pnpm/config.env-replace@1.1.0': + resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} + engines: {node: '>=12.22.0'} + + '@pnpm/network.ca-file@1.0.2': + resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} + engines: {node: '>=12.22.0'} + + '@pnpm/npm-conf@2.3.1': + resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} + engines: {node: '>=12'} + '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} @@ -8413,6 +8444,9 @@ packages: allure-playwright@2.9.2: resolution: {integrity: sha512-N0X1c1GGLg74vdDAuq86KCekuvQ5BaqqpgcBpJj5x3y/RlQPBn84wlg8PT/ViKQM4EdbNFMXOXpa5Opufv6qCg==} + ansi-align@3.0.1: + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -8755,6 +8789,10 @@ packages: bounding-client-rect@1.0.5: resolution: {integrity: sha512-3OVNM56TuMbHZYjbIbAkHZ7VHYVK9RPLr3s2nZucuJm1HgDBFEY6twJce4dCNwF0MO3ySOyA9KUZ+pObCd4mow==} + boxen@8.0.1: + resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==} + engines: {node: '>=18'} + brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -8840,6 +8878,10 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + camelcase@8.0.0: + resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} + engines: {node: '>=16'} + camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} @@ -8961,6 +9003,10 @@ packages: peerDependencies: webpack: '>=4.0.0 <6.0.0' + cli-boxes@3.0.0: + resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} + engines: {node: '>=10'} + cli-cursor@2.1.0: resolution: {integrity: sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==} engines: {node: '>=4'} @@ -9114,6 +9160,9 @@ packages: engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} hasBin: true + config-chain@1.1.13: + resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} + config@3.3.12: resolution: {integrity: sha512-Vmx389R/QVM3foxqBzXO8t2tUikYZP64Q6vQxGrsMpREeJc/aWRnPRERXWsYzOHAumx/AOoILWe6nU3ZJL+6Sw==} engines: {node: '>= 10.0.0'} @@ -9472,6 +9521,10 @@ packages: resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==} engines: {node: '>= 0.4'} + deep-extend@0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -9647,6 +9700,10 @@ packages: resolution: {integrity: sha512-JvpYKUmzQhYoIFgK2MOnF3bciIZoItIIoryihy0rIA+H4Jy0FmgyKYAHCTN98P5ybGSJcIFbh6QKeJdtZd1qhA==} engines: {node: '>=12'} + dotenv@16.4.7: + resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} + engines: {node: '>=12'} + dunder-proto@1.0.0: resolution: {integrity: sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==} engines: {node: '>= 0.4'} @@ -9680,6 +9737,9 @@ packages: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} + emoji-regex@10.4.0: + resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} + emoji-regex@7.0.3: resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} @@ -9820,6 +9880,10 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} + escape-goat@4.0.0: + resolution: {integrity: sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==} + engines: {node: '>=12'} + escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -10413,6 +10477,10 @@ packages: get-document@1.0.0: resolution: {integrity: sha512-8E7H2Xxibav+/rQTTtm6gFlSQwDoAQg667yheA+vWQr/amxEuswChzGo4MIbOJJoR0SMpDyhbUqWp3FpIfwD9A==} + get-east-asian-width@1.3.0: + resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} + engines: {node: '>=18'} + get-intrinsic@1.2.5: resolution: {integrity: sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==} engines: {node: '>= 0.4'} @@ -10482,6 +10550,10 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported + global-directory@4.0.1: + resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} + engines: {node: '>=18'} + global-modules@0.2.3: resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} engines: {node: '>=0.10.0'} @@ -10533,6 +10605,9 @@ packages: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} + graceful-fs@4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -10770,6 +10845,10 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} + ini@4.1.1: + resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + internal-slot@1.0.7: resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} engines: {node: '>= 0.4'} @@ -10893,6 +10972,15 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} + is-in-ci@1.0.0: + resolution: {integrity: sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==} + engines: {node: '>=18'} + hasBin: true + + is-installed-globally@1.0.0: + resolution: {integrity: sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==} + engines: {node: '>=18'} + is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -10904,6 +10992,10 @@ packages: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} + is-npm@6.0.0: + resolution: {integrity: sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + is-number-object@1.1.0: resolution: {integrity: sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==} engines: {node: '>= 0.4'} @@ -10932,6 +11024,10 @@ packages: resolution: {integrity: sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==} engines: {node: '>=6'} + is-path-inside@4.0.0: + resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} + engines: {node: '>=12'} + is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} @@ -11390,6 +11486,10 @@ packages: kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} + ky@1.7.4: + resolution: {integrity: sha512-zYEr/gh7uLW2l4su11bmQ2M9xLgQLjyvx58UyNM/6nuqyWFHPX5ktMjvpev3F8QWdjSsHUpnWew4PBCswBNuMQ==} + engines: {node: '>=18'} + language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} @@ -11397,6 +11497,10 @@ packages: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} + latest-version@9.0.0: + resolution: {integrity: sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==} + engines: {node: '>=18'} + leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -12185,6 +12289,10 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} + package-json@10.0.1: + resolution: {integrity: sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==} + engines: {node: '>=18'} + param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -12715,6 +12823,9 @@ packages: resolution: {integrity: sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==} engines: {node: '>=0.10'} + proto-list@1.2.4: + resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} + protocol-buffers-schema@3.6.0: resolution: {integrity: sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==} @@ -12746,6 +12857,10 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + pupa@3.1.0: + resolution: {integrity: sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==} + engines: {node: '>=12.20'} + puppeteer-core@22.15.0: resolution: {integrity: sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==} engines: {node: '>=18'} @@ -12804,6 +12919,10 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} + rc@1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + re-resizable@6.10.3: resolution: {integrity: sha512-zvWb7X3RJMA4cuSrqoxgs3KR+D+pEXnGrD2FAD6BMYAULnZsSF4b7AOVyG6pC3VVNVOtlagGDCDmZSwWLjjBBw==} peerDependencies: @@ -13051,6 +13170,14 @@ packages: resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} engines: {node: '>=4'} + registry-auth-token@5.0.3: + resolution: {integrity: sha512-1bpc9IyC+e+CNFRaWyn77tk4xGG4PPUyfakSmA6F6cvUDjrm58dfyJ3II+9yb10EDkHoy1LaPSmHaWLOH3m6HA==} + engines: {node: '>=14'} + + registry-url@6.0.1: + resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} + engines: {node: '>=12'} + regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} @@ -13724,6 +13851,10 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} + string-width@7.2.0: + resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} + engines: {node: '>=18'} + string.prototype.includes@2.0.1: resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} engines: {node: '>= 0.4'} @@ -13793,6 +13924,10 @@ packages: resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==} engines: {node: '>=12'} + strip-json-comments@2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -14339,6 +14474,10 @@ packages: peerDependencies: browserslist: '>= 4.21.0' + update-notifier@7.3.1: + resolution: {integrity: sha512-+dwUY4L35XFYEzE+OAL3sarJdUioVovq+8f7lcIJ7wnmnYQV5UD1Y/lcwaMSyaQ6Bj3JMj1XSTjZbNLHn/19yA==} + engines: {node: '>=18'} + uplot-react@1.1.4: resolution: {integrity: sha512-qO1UkQwjVKdj5vTm3O3yldvu1T6hwY4++rH4KznLhjqpnLdncq1zsRxq/zQz/HUHPVD0j7WBcEISbNM61JsuAQ==} engines: {node: '>=8.10'} @@ -14618,6 +14757,10 @@ packages: engines: {node: '>= 8'} hasBin: true + widest-line@5.0.0: + resolution: {integrity: sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==} + engines: {node: '>=18'} + wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} @@ -14664,6 +14807,10 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} + wrap-ansi@9.0.0: + resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} + engines: {node: '>=18'} + wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -16087,6 +16234,10 @@ snapshots: transitivePeerDependencies: - supports-color + '@eslint/core@0.10.0': + dependencies: + '@types/json-schema': 7.0.15 + '@eslint/core@0.9.1': dependencies: '@types/json-schema': 7.0.15 @@ -16109,8 +16260,9 @@ snapshots: '@eslint/object-schema@2.1.5': {} - '@eslint/plugin-kit@0.2.4': + '@eslint/plugin-kit@0.2.5': dependencies: + '@eslint/core': 0.10.0 levn: 0.4.1 '@fastify/busboy@2.1.1': {} @@ -16540,6 +16692,18 @@ snapshots: dependencies: playwright: 1.48.2 + '@pnpm/config.env-replace@1.1.0': {} + + '@pnpm/network.ca-file@1.0.2': + dependencies: + graceful-fs: 4.2.10 + + '@pnpm/npm-conf@2.3.1': + dependencies: + '@pnpm/config.env-replace': 1.1.0 + '@pnpm/network.ca-file': 1.0.2 + config-chain: 1.1.13 + '@popperjs/core@2.11.8': {} '@preact/signals-core@1.8.0': {} @@ -20489,6 +20653,10 @@ snapshots: dependencies: allure-js-commons: 2.9.2 + ansi-align@3.0.1: + dependencies: + string-width: 4.2.3 + ansi-colors@4.1.3: {} ansi-escapes@3.2.0: {} @@ -20904,6 +21072,17 @@ snapshots: dependencies: get-document: 1.0.0 + boxen@8.0.1: + dependencies: + ansi-align: 3.0.1 + camelcase: 8.0.0 + chalk: 5.4.1 + cli-boxes: 3.0.0 + string-width: 7.2.0 + type-fest: 4.31.0 + widest-line: 5.0.0 + wrap-ansi: 9.0.0 + brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -20990,6 +21169,8 @@ snapshots: camelcase@6.3.0: {} + camelcase@8.0.0: {} + camelize@1.0.1: {} caniuse-api@3.0.0: @@ -21154,6 +21335,8 @@ snapshots: del: 4.1.1 webpack: 5.94.0(webpack-cli@5.1.4) + cli-boxes@3.0.0: {} + cli-cursor@2.1.0: dependencies: restore-cursor: 2.0.0 @@ -21341,6 +21524,11 @@ snapshots: tree-kill: 1.2.2 yargs: 17.6.2 + config-chain@1.1.13: + dependencies: + ini: 1.3.8 + proto-list: 1.2.4 + config@3.3.12: dependencies: json5: 2.2.3 @@ -21750,6 +21938,8 @@ snapshots: which-collection: 1.0.2 which-typed-array: 1.1.16 + deep-extend@0.6.0: {} + deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -21930,6 +22120,8 @@ snapshots: dotenv@16.0.2: {} + dotenv@16.4.7: {} + dunder-proto@1.0.0: dependencies: call-bind-apply-helpers: 1.0.1 @@ -21954,6 +22146,8 @@ snapshots: emittery@0.13.1: {} + emoji-regex@10.4.0: {} + emoji-regex@7.0.3: {} emoji-regex@8.0.0: {} @@ -22191,6 +22385,8 @@ snapshots: escalade@3.2.0: {} + escape-goat@4.0.0: {} + escape-html@1.0.3: {} escape-string-regexp@1.0.5: {} @@ -22452,7 +22648,7 @@ snapshots: '@eslint/core': 0.9.1 '@eslint/eslintrc': 3.2.0 '@eslint/js': 9.16.0 - '@eslint/plugin-kit': 0.2.4 + '@eslint/plugin-kit': 0.2.5 '@humanfs/node': 0.16.6 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.1 @@ -22931,6 +23127,8 @@ snapshots: get-document@1.0.0: {} + get-east-asian-width@1.3.0: {} + get-intrinsic@1.2.5: dependencies: call-bind-apply-helpers: 1.0.1 @@ -23017,6 +23215,10 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 + global-directory@4.0.1: + dependencies: + ini: 4.1.1 + global-modules@0.2.3: dependencies: global-prefix: 0.1.5 @@ -23079,6 +23281,8 @@ snapshots: gopd@1.2.0: {} + graceful-fs@4.2.10: {} + graceful-fs@4.2.11: {} gradient-parser@0.1.5: {} @@ -23311,6 +23515,8 @@ snapshots: ini@1.3.8: {} + ini@4.1.1: {} + internal-slot@1.0.7: dependencies: es-errors: 1.3.0 @@ -23420,12 +23626,21 @@ snapshots: dependencies: is-extglob: 2.1.1 + is-in-ci@1.0.0: {} + + is-installed-globally@1.0.0: + dependencies: + global-directory: 4.0.1 + is-path-inside: 4.0.0 + is-map@2.0.3: {} is-module@1.0.0: {} is-negative-zero@2.0.3: {} + is-npm@6.0.0: {} + is-number-object@1.1.0: dependencies: call-bind: 1.0.8 @@ -23449,6 +23664,8 @@ snapshots: dependencies: path-is-inside: 1.0.2 + is-path-inside@4.0.0: {} + is-plain-obj@2.1.0: {} is-plain-obj@4.1.0: {} @@ -24203,12 +24420,18 @@ snapshots: kuler@2.0.0: {} + ky@1.7.4: {} + language-subtag-registry@0.3.23: {} language-tags@1.0.9: dependencies: language-subtag-registry: 0.3.23 + latest-version@9.0.0: + dependencies: + package-json: 10.0.1 + leven@3.1.0: {} levn@0.4.1: @@ -25251,6 +25474,13 @@ snapshots: package-json-from-dist@1.0.1: {} + package-json@10.0.1: + dependencies: + ky: 1.7.4 + registry-auth-token: 5.0.3 + registry-url: 6.0.1 + semver: 7.6.3 + param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -25740,6 +25970,8 @@ snapshots: properties@1.2.1: {} + proto-list@1.2.4: {} + protocol-buffers-schema@3.6.0: {} proxy-addr@2.0.7: @@ -25777,6 +26009,10 @@ snapshots: punycode@2.3.1: {} + pupa@3.1.0: + dependencies: + escape-goat: 4.0.0 + puppeteer-core@22.15.0: dependencies: '@puppeteer/browsers': 2.3.0 @@ -25845,6 +26081,13 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 + rc@1.2.8: + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + re-resizable@6.10.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 @@ -26146,6 +26389,14 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.2.0 + registry-auth-token@5.0.3: + dependencies: + '@pnpm/npm-conf': 2.3.1 + + registry-url@6.0.1: + dependencies: + rc: 1.2.8 + regjsgen@0.8.0: {} regjsparser@0.12.0: @@ -26833,6 +27084,12 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 + string-width@7.2.0: + dependencies: + emoji-regex: 10.4.0 + get-east-asian-width: 1.3.0 + strip-ansi: 7.1.0 + string.prototype.includes@2.0.1: dependencies: call-bind: 1.0.8 @@ -26918,6 +27175,8 @@ snapshots: dependencies: min-indent: 1.0.1 + strip-json-comments@2.0.1: {} + strip-json-comments@3.1.1: {} strip@3.0.0: {} @@ -27441,6 +27700,19 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 + update-notifier@7.3.1: + dependencies: + boxen: 8.0.1 + chalk: 5.4.1 + configstore: 7.0.0 + is-in-ci: 1.0.0 + is-installed-globally: 1.0.0 + is-npm: 6.0.0 + latest-version: 9.0.0 + pupa: 3.1.0 + semver: 7.6.3 + xdg-basedir: 5.1.0 + uplot-react@1.1.4(react@18.3.1)(uplot@1.6.31): dependencies: react: 18.3.1 @@ -27815,6 +28087,10 @@ snapshots: dependencies: isexe: 2.0.0 + widest-line@5.0.0: + dependencies: + string-width: 7.2.0 + wildcard@2.0.1: {} winston-transport@4.9.0: @@ -27882,6 +28158,12 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 + wrap-ansi@9.0.0: + dependencies: + ansi-styles: 6.2.1 + string-width: 7.2.0 + strip-ansi: 7.1.0 + wrappy@1.0.2: {} write-file-atomic@3.0.3: diff --git a/tools/cli/commands/cli.js b/tools/cli/commands/cli.js index 5810da97138f9..692079b2427c6 100644 --- a/tools/cli/commands/cli.js +++ b/tools/cli/commands/cli.js @@ -132,6 +132,12 @@ export function cliDefine( yargs ) { 'Symlink the CLI for global use or development.', () => {}, argv => { + if ( process.env.JETPACK_MONOREPO_ENV ) { + console.log( + chalk.yellow( 'CLI linking is not needed within the monorepo container.' ) + ); + return; + } cliLink( argv ); if ( argv.v ) { console.log( argv ); @@ -143,6 +149,12 @@ export function cliDefine( yargs ) { 'Unlink the CLI.', () => {}, argv => { + if ( process.env.JETPACK_MONOREPO_ENV ) { + console.log( + chalk.yellow( 'CLI unlinking is not needed within the monorepo container.' ) + ); + return; + } cliUnlink( argv ); if ( argv.v ) { console.log( argv ); diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo index b18a91a463b08..c4c87b4727569 100644 --- a/tools/docker/Dockerfile.monorepo +++ b/tools/docker/Dockerfile.monorepo @@ -7,7 +7,8 @@ ARG NODE_VERSION ARG PNPM_VERSION ENV LANG=en_US.UTF-8 \ - LC_ALL=en_US.UTF-8 + LC_ALL=en_US.UTF-8 \ + JETPACK_MONOREPO_ENV=1 WORKDIR /app From 29be249ee467739296e2274112247b484d6d92cd Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 13 Jan 2025 11:28:31 -0600 Subject: [PATCH 24/29] Enable rsync support --- tools/docker/Dockerfile.monorepo | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/docker/Dockerfile.monorepo b/tools/docker/Dockerfile.monorepo index c4c87b4727569..7d9bc62343575 100644 --- a/tools/docker/Dockerfile.monorepo +++ b/tools/docker/Dockerfile.monorepo @@ -36,6 +36,7 @@ RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ docker-ce-cli \ docker-buildx-plugin \ docker-compose-plugin \ + jq \ "php${PHP_VERSION}" \ "php${PHP_VERSION}-cli" \ "php${PHP_VERSION}-curl" \ @@ -43,6 +44,7 @@ RUN --mount=type=cache,target=/var/lib/apt/lists/,sharing=private \ "php${PHP_VERSION}-mbstring" \ "php${PHP_VERSION}-xml" \ "php${PHP_VERSION}-zip" \ + rsync \ && apt-get remove --purge --auto-remove -y gpg software-properties-common \ && find /var/ -name '*-old' -delete && rm -rf /var/log/dpkg.log /var/log/alternatives.log /var/log/apt/ ~/.launchpadlib From c5cde21be38eea502e76c4caf26066bd59200f27 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 13 Jan 2025 15:31:13 -0600 Subject: [PATCH 25/29] When testing building with npm, let's ignore the lock file too. --- projects/js-packages/jetpack-cli/.gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/projects/js-packages/jetpack-cli/.gitignore b/projects/js-packages/jetpack-cli/.gitignore index 140fd587d2d52..27aef833f6a2a 100644 --- a/projects/js-packages/jetpack-cli/.gitignore +++ b/projects/js-packages/jetpack-cli/.gitignore @@ -1,2 +1,3 @@ vendor/ node_modules/ +package-lock.json From 2048987e317a0fd08062b84ca48a20d6363b5a7a Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Mon, 13 Jan 2025 22:58:57 -0600 Subject: [PATCH 26/29] Remove the new CLI from the pnpm workspace --- pnpm-lock.yaml | 273 -------------------------------------------- pnpm-workspace.yaml | 1 + 2 files changed, 1 insertion(+), 273 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 88012f8b875d8..f4ab306ed67a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -959,21 +959,6 @@ importers: specifier: 4.9.1 version: 4.9.1(webpack@5.94.0) - projects/js-packages/jetpack-cli: - dependencies: - chalk: - specifier: ^5.4.1 - version: 5.4.1 - dotenv: - specifier: ^16.3.1 - version: 16.4.7 - prompts: - specifier: ^2.4.2 - version: 2.4.2 - update-notifier: - specifier: ^7.0.0 - version: 7.3.1 - projects/js-packages/licensing: dependencies: '@automattic/jetpack-analytics': @@ -6488,18 +6473,6 @@ packages: engines: {node: '>=18'} hasBin: true - '@pnpm/config.env-replace@1.1.0': - resolution: {integrity: sha512-htyl8TWnKL7K/ESFa1oW2UB5lVDxuF5DpM7tBi6Hu2LNL3mWkIzNLG6N4zoCUP1lCKNxWy/3iu8mS8MvToGd6w==} - engines: {node: '>=12.22.0'} - - '@pnpm/network.ca-file@1.0.2': - resolution: {integrity: sha512-YcPQ8a0jwYU9bTdJDpXjMi7Brhkr1mXsXrUJvjqM2mQDgkRiz8jFaQGOdaLxgjtUfQgZhKy/O3cG/YwmgKaxLA==} - engines: {node: '>=12.22.0'} - - '@pnpm/npm-conf@2.3.1': - resolution: {integrity: sha512-c83qWb22rNRuB0UaVCI0uRPNRr8Z0FWnEIvT47jiHAmOIUHbBOg5XvV7pM5x+rKn9HRpjxquDbXYSXr3fAKFcw==} - engines: {node: '>=12'} - '@popperjs/core@2.11.8': resolution: {integrity: sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==} @@ -8444,9 +8417,6 @@ packages: allure-playwright@2.9.2: resolution: {integrity: sha512-N0X1c1GGLg74vdDAuq86KCekuvQ5BaqqpgcBpJj5x3y/RlQPBn84wlg8PT/ViKQM4EdbNFMXOXpa5Opufv6qCg==} - ansi-align@3.0.1: - resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} - ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -8789,10 +8759,6 @@ packages: bounding-client-rect@1.0.5: resolution: {integrity: sha512-3OVNM56TuMbHZYjbIbAkHZ7VHYVK9RPLr3s2nZucuJm1HgDBFEY6twJce4dCNwF0MO3ySOyA9KUZ+pObCd4mow==} - boxen@8.0.1: - resolution: {integrity: sha512-F3PH5k5juxom4xktynS7MoFY+NUWH5LC4CnH11YB8NPew+HLpmBLCybSAEyb2F+4pRXhuhWqFesoQd6DAyc2hw==} - engines: {node: '>=18'} - brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} @@ -8878,10 +8844,6 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} - camelcase@8.0.0: - resolution: {integrity: sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==} - engines: {node: '>=16'} - camelize@1.0.1: resolution: {integrity: sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==} @@ -9003,10 +8965,6 @@ packages: peerDependencies: webpack: '>=4.0.0 <6.0.0' - cli-boxes@3.0.0: - resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} - engines: {node: '>=10'} - cli-cursor@2.1.0: resolution: {integrity: sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==} engines: {node: '>=4'} @@ -9160,9 +9118,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.0 || >=16.0.0} hasBin: true - config-chain@1.1.13: - resolution: {integrity: sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==} - config@3.3.12: resolution: {integrity: sha512-Vmx389R/QVM3foxqBzXO8t2tUikYZP64Q6vQxGrsMpREeJc/aWRnPRERXWsYzOHAumx/AOoILWe6nU3ZJL+6Sw==} engines: {node: '>= 10.0.0'} @@ -9521,10 +9476,6 @@ packages: resolution: {integrity: sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA==} engines: {node: '>= 0.4'} - deep-extend@0.6.0: - resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} - engines: {node: '>=4.0.0'} - deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -9700,10 +9651,6 @@ packages: resolution: {integrity: sha512-JvpYKUmzQhYoIFgK2MOnF3bciIZoItIIoryihy0rIA+H4Jy0FmgyKYAHCTN98P5ybGSJcIFbh6QKeJdtZd1qhA==} engines: {node: '>=12'} - dotenv@16.4.7: - resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==} - engines: {node: '>=12'} - dunder-proto@1.0.0: resolution: {integrity: sha512-9+Sj30DIu+4KvHqMfLUGLFYL2PkURSYMVXJyXe92nFRvlYq5hBjLEhblKB+vkd/WVlUYMWigiY07T91Fkk0+4A==} engines: {node: '>= 0.4'} @@ -9737,9 +9684,6 @@ packages: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} - emoji-regex@10.4.0: - resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} - emoji-regex@7.0.3: resolution: {integrity: sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==} @@ -9880,10 +9824,6 @@ packages: resolution: {integrity: sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==} engines: {node: '>=6'} - escape-goat@4.0.0: - resolution: {integrity: sha512-2Sd4ShcWxbx6OY1IHyla/CVNwvg7XwZVoXZHcSu9w9SReNP1EzzD5T8NWKIR38fIqEns9kDWKUQTXXAmlDrdPg==} - engines: {node: '>=12'} - escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -10477,10 +10417,6 @@ packages: get-document@1.0.0: resolution: {integrity: sha512-8E7H2Xxibav+/rQTTtm6gFlSQwDoAQg667yheA+vWQr/amxEuswChzGo4MIbOJJoR0SMpDyhbUqWp3FpIfwD9A==} - get-east-asian-width@1.3.0: - resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} - engines: {node: '>=18'} - get-intrinsic@1.2.5: resolution: {integrity: sha512-Y4+pKa7XeRUPWFNvOOYHkRYrfzW07oraURSvjDmRVOJ748OrVmeXtpE4+GCEHncjCjkTxPNRt8kEbxDhsn6VTg==} engines: {node: '>= 0.4'} @@ -10550,10 +10486,6 @@ packages: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} deprecated: Glob versions prior to v9 are no longer supported - global-directory@4.0.1: - resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} - engines: {node: '>=18'} - global-modules@0.2.3: resolution: {integrity: sha512-JeXuCbvYzYXcwE6acL9V2bAOeSIGl4dD+iwLY9iUx2VBJJ80R18HCn+JCwHM9Oegdfya3lEkGCdaRkSyc10hDA==} engines: {node: '>=0.10.0'} @@ -10605,9 +10537,6 @@ packages: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} - graceful-fs@4.2.10: - resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} - graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} @@ -10845,10 +10774,6 @@ packages: ini@1.3.8: resolution: {integrity: sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==} - ini@4.1.1: - resolution: {integrity: sha512-QQnnxNyfvmHFIsj7gkPcYymR8Jdw/o7mp5ZFihxn6h8Ci6fh3Dx4E1gPjpQEpIuPo9XVNY/ZUwh4BPMjGyL01g==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - internal-slot@1.0.7: resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} engines: {node: '>= 0.4'} @@ -10972,15 +10897,6 @@ packages: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} - is-in-ci@1.0.0: - resolution: {integrity: sha512-eUuAjybVTHMYWm/U+vBO1sY/JOCgoPCXRxzdju0K+K0BiGW0SChEL1MLC0PoCIR1OlPo5YAp8HuQoUlsWEICwg==} - engines: {node: '>=18'} - hasBin: true - - is-installed-globally@1.0.0: - resolution: {integrity: sha512-K55T22lfpQ63N4KEN57jZUAaAYqYHEe8veb/TycJRk9DdSCLLcovXz/mL6mOnhQaZsQGwPhuFopdQIlqGSEjiQ==} - engines: {node: '>=18'} - is-map@2.0.3: resolution: {integrity: sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw==} engines: {node: '>= 0.4'} @@ -10992,10 +10908,6 @@ packages: resolution: {integrity: sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==} engines: {node: '>= 0.4'} - is-npm@6.0.0: - resolution: {integrity: sha512-JEjxbSmtPSt1c8XTkVrlujcXdKV1/tvuQ7GwKcAlyiVLeYFQ2VHat8xfrDJsIkhCdF/tZ7CiIR3sy141c6+gPQ==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - is-number-object@1.1.0: resolution: {integrity: sha512-KVSZV0Dunv9DTPkhXwcZ3Q+tUc9TsaE1ZwX5J2WMvsSGS6Md8TFPun5uwh0yRdrNerI6vf/tbJxqSx4c1ZI1Lw==} engines: {node: '>= 0.4'} @@ -11024,10 +10936,6 @@ packages: resolution: {integrity: sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==} engines: {node: '>=6'} - is-path-inside@4.0.0: - resolution: {integrity: sha512-lJJV/5dYS+RcL8uQdBDW9c9uWFLLBNRyFhnAKXw5tVqLlKZ4RMGZKv+YQ/IA3OhD+RpbJa1LLFM1FQPGyIXvOA==} - engines: {node: '>=12'} - is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} engines: {node: '>=8'} @@ -11486,10 +11394,6 @@ packages: kuler@2.0.0: resolution: {integrity: sha512-Xq9nH7KlWZmXAtodXDDRE7vs6DU1gTU8zYDHDiWLSip45Egwq3plLHzPn27NgvzL2r1LMPC1vdqh98sQxtqj4A==} - ky@1.7.4: - resolution: {integrity: sha512-zYEr/gh7uLW2l4su11bmQ2M9xLgQLjyvx58UyNM/6nuqyWFHPX5ktMjvpev3F8QWdjSsHUpnWew4PBCswBNuMQ==} - engines: {node: '>=18'} - language-subtag-registry@0.3.23: resolution: {integrity: sha512-0K65Lea881pHotoGEa5gDlMxt3pctLi2RplBb7Ezh4rRdLEOtgi7n4EwK9lamnUCkKBqaeKRVebTq6BAxSkpXQ==} @@ -11497,10 +11401,6 @@ packages: resolution: {integrity: sha512-MbjN408fEndfiQXbFQ1vnd+1NoLDsnQW41410oQBXiyXDMYH5z505juWa4KUE1LqxRC7DgOgZDbKLxHIwm27hA==} engines: {node: '>=0.10'} - latest-version@9.0.0: - resolution: {integrity: sha512-7W0vV3rqv5tokqkBAFV1LbR7HPOWzXQDpDgEuib/aJ1jsZZx6x3c2mBI+TJhJzOhkGeaLbCKEHXEXLfirtG2JA==} - engines: {node: '>=18'} - leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -12289,10 +12189,6 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - package-json@10.0.1: - resolution: {integrity: sha512-ua1L4OgXSBdsu1FPb7F3tYH0F48a6kxvod4pLUlGY9COeJAJQNX/sNH2IiEmsxw7lqYiAwrdHMjz1FctOsyDQg==} - engines: {node: '>=18'} - param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -12823,9 +12719,6 @@ packages: resolution: {integrity: sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==} engines: {node: '>=0.10'} - proto-list@1.2.4: - resolution: {integrity: sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==} - protocol-buffers-schema@3.6.0: resolution: {integrity: sha512-TdDRD+/QNdrCGCE7v8340QyuXd4kIWIgapsE2+n/SaGiSSbomYl4TjHlvIoCWRpE7wFt02EpB35VVA2ImcBVqw==} @@ -12857,10 +12750,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - pupa@3.1.0: - resolution: {integrity: sha512-FLpr4flz5xZTSJxSeaheeMKN/EDzMdK7b8PTOC6a5PYFKTucWbdqjgqaEyH0shFiSJrVB1+Qqi4Tk19ccU6Aug==} - engines: {node: '>=12.20'} - puppeteer-core@22.15.0: resolution: {integrity: sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==} engines: {node: '>=18'} @@ -12919,10 +12808,6 @@ packages: resolution: {integrity: sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==} engines: {node: '>= 0.8'} - rc@1.2.8: - resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} - hasBin: true - re-resizable@6.10.3: resolution: {integrity: sha512-zvWb7X3RJMA4cuSrqoxgs3KR+D+pEXnGrD2FAD6BMYAULnZsSF4b7AOVyG6pC3VVNVOtlagGDCDmZSwWLjjBBw==} peerDependencies: @@ -13170,14 +13055,6 @@ packages: resolution: {integrity: sha512-H66BPQMrv+V16t8xtmq+UC0CBpiTBA60V8ibS1QVReIp8T1z8hwFxqcGzm9K6lgsN7sB5edVH8a+ze6Fqm4weA==} engines: {node: '>=4'} - registry-auth-token@5.0.3: - resolution: {integrity: sha512-1bpc9IyC+e+CNFRaWyn77tk4xGG4PPUyfakSmA6F6cvUDjrm58dfyJ3II+9yb10EDkHoy1LaPSmHaWLOH3m6HA==} - engines: {node: '>=14'} - - registry-url@6.0.1: - resolution: {integrity: sha512-+crtS5QjFRqFCoQmvGduwYWEBng99ZvmFvF+cUJkGYF1L1BfU8C6Zp9T7f5vPAwyLkUExpvK+ANVZmGU49qi4Q==} - engines: {node: '>=12'} - regjsgen@0.8.0: resolution: {integrity: sha512-RvwtGe3d7LvWiDQXeQw8p5asZUmfU1G/l6WbUXeHta7Y2PEIvBTwH6E2EfmYUK8pxcxEdEmaomqyp0vZZ7C+3Q==} @@ -13851,10 +13728,6 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - string.prototype.includes@2.0.1: resolution: {integrity: sha512-o7+c9bW6zpAdJHTtujeePODAhkuicdAryFsfVKwA+wGw89wJ4GTY484WTucM9hLtDEOpOvI+aHnzqnC5lHp4Rg==} engines: {node: '>= 0.4'} @@ -13924,10 +13797,6 @@ packages: resolution: {integrity: sha512-mnVSV2l+Zv6BLpSD/8V87CW/y9EmmbYzGCIavsnsI6/nwn26DwffM/yztm30Z/I2DY9wdS3vXVCMnHDgZaVNoA==} engines: {node: '>=12'} - strip-json-comments@2.0.1: - resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} - engines: {node: '>=0.10.0'} - strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -14474,10 +14343,6 @@ packages: peerDependencies: browserslist: '>= 4.21.0' - update-notifier@7.3.1: - resolution: {integrity: sha512-+dwUY4L35XFYEzE+OAL3sarJdUioVovq+8f7lcIJ7wnmnYQV5UD1Y/lcwaMSyaQ6Bj3JMj1XSTjZbNLHn/19yA==} - engines: {node: '>=18'} - uplot-react@1.1.4: resolution: {integrity: sha512-qO1UkQwjVKdj5vTm3O3yldvu1T6hwY4++rH4KznLhjqpnLdncq1zsRxq/zQz/HUHPVD0j7WBcEISbNM61JsuAQ==} engines: {node: '>=8.10'} @@ -14757,10 +14622,6 @@ packages: engines: {node: '>= 8'} hasBin: true - widest-line@5.0.0: - resolution: {integrity: sha512-c9bZp7b5YtRj2wOe6dlj32MK+Bx/M/d+9VB2SHM1OtsUHR0aV0tdP6DWh/iMt0kWi1t5g1Iudu6hQRNd1A4PVA==} - engines: {node: '>=18'} - wildcard@2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} @@ -14807,10 +14668,6 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.0: - resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} - engines: {node: '>=18'} - wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -16692,18 +16549,6 @@ snapshots: dependencies: playwright: 1.48.2 - '@pnpm/config.env-replace@1.1.0': {} - - '@pnpm/network.ca-file@1.0.2': - dependencies: - graceful-fs: 4.2.10 - - '@pnpm/npm-conf@2.3.1': - dependencies: - '@pnpm/config.env-replace': 1.1.0 - '@pnpm/network.ca-file': 1.0.2 - config-chain: 1.1.13 - '@popperjs/core@2.11.8': {} '@preact/signals-core@1.8.0': {} @@ -20653,10 +20498,6 @@ snapshots: dependencies: allure-js-commons: 2.9.2 - ansi-align@3.0.1: - dependencies: - string-width: 4.2.3 - ansi-colors@4.1.3: {} ansi-escapes@3.2.0: {} @@ -21072,17 +20913,6 @@ snapshots: dependencies: get-document: 1.0.0 - boxen@8.0.1: - dependencies: - ansi-align: 3.0.1 - camelcase: 8.0.0 - chalk: 5.4.1 - cli-boxes: 3.0.0 - string-width: 7.2.0 - type-fest: 4.31.0 - widest-line: 5.0.0 - wrap-ansi: 9.0.0 - brace-expansion@1.1.11: dependencies: balanced-match: 1.0.2 @@ -21169,8 +20999,6 @@ snapshots: camelcase@6.3.0: {} - camelcase@8.0.0: {} - camelize@1.0.1: {} caniuse-api@3.0.0: @@ -21335,8 +21163,6 @@ snapshots: del: 4.1.1 webpack: 5.94.0(webpack-cli@5.1.4) - cli-boxes@3.0.0: {} - cli-cursor@2.1.0: dependencies: restore-cursor: 2.0.0 @@ -21524,11 +21350,6 @@ snapshots: tree-kill: 1.2.2 yargs: 17.6.2 - config-chain@1.1.13: - dependencies: - ini: 1.3.8 - proto-list: 1.2.4 - config@3.3.12: dependencies: json5: 2.2.3 @@ -21938,8 +21759,6 @@ snapshots: which-collection: 1.0.2 which-typed-array: 1.1.16 - deep-extend@0.6.0: {} - deep-is@0.1.4: {} deepmerge@4.3.1: {} @@ -22120,8 +21939,6 @@ snapshots: dotenv@16.0.2: {} - dotenv@16.4.7: {} - dunder-proto@1.0.0: dependencies: call-bind-apply-helpers: 1.0.1 @@ -22146,8 +21963,6 @@ snapshots: emittery@0.13.1: {} - emoji-regex@10.4.0: {} - emoji-regex@7.0.3: {} emoji-regex@8.0.0: {} @@ -22385,8 +22200,6 @@ snapshots: escalade@3.2.0: {} - escape-goat@4.0.0: {} - escape-html@1.0.3: {} escape-string-regexp@1.0.5: {} @@ -23127,8 +22940,6 @@ snapshots: get-document@1.0.0: {} - get-east-asian-width@1.3.0: {} - get-intrinsic@1.2.5: dependencies: call-bind-apply-helpers: 1.0.1 @@ -23215,10 +23026,6 @@ snapshots: once: 1.4.0 path-is-absolute: 1.0.1 - global-directory@4.0.1: - dependencies: - ini: 4.1.1 - global-modules@0.2.3: dependencies: global-prefix: 0.1.5 @@ -23281,8 +23088,6 @@ snapshots: gopd@1.2.0: {} - graceful-fs@4.2.10: {} - graceful-fs@4.2.11: {} gradient-parser@0.1.5: {} @@ -23515,8 +23320,6 @@ snapshots: ini@1.3.8: {} - ini@4.1.1: {} - internal-slot@1.0.7: dependencies: es-errors: 1.3.0 @@ -23626,21 +23429,12 @@ snapshots: dependencies: is-extglob: 2.1.1 - is-in-ci@1.0.0: {} - - is-installed-globally@1.0.0: - dependencies: - global-directory: 4.0.1 - is-path-inside: 4.0.0 - is-map@2.0.3: {} is-module@1.0.0: {} is-negative-zero@2.0.3: {} - is-npm@6.0.0: {} - is-number-object@1.1.0: dependencies: call-bind: 1.0.8 @@ -23664,8 +23458,6 @@ snapshots: dependencies: path-is-inside: 1.0.2 - is-path-inside@4.0.0: {} - is-plain-obj@2.1.0: {} is-plain-obj@4.1.0: {} @@ -24420,18 +24212,12 @@ snapshots: kuler@2.0.0: {} - ky@1.7.4: {} - language-subtag-registry@0.3.23: {} language-tags@1.0.9: dependencies: language-subtag-registry: 0.3.23 - latest-version@9.0.0: - dependencies: - package-json: 10.0.1 - leven@3.1.0: {} levn@0.4.1: @@ -25474,13 +25260,6 @@ snapshots: package-json-from-dist@1.0.1: {} - package-json@10.0.1: - dependencies: - ky: 1.7.4 - registry-auth-token: 5.0.3 - registry-url: 6.0.1 - semver: 7.6.3 - param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -25970,8 +25749,6 @@ snapshots: properties@1.2.1: {} - proto-list@1.2.4: {} - protocol-buffers-schema@3.6.0: {} proxy-addr@2.0.7: @@ -26009,10 +25786,6 @@ snapshots: punycode@2.3.1: {} - pupa@3.1.0: - dependencies: - escape-goat: 4.0.0 - puppeteer-core@22.15.0: dependencies: '@puppeteer/browsers': 2.3.0 @@ -26081,13 +25854,6 @@ snapshots: iconv-lite: 0.4.24 unpipe: 1.0.0 - rc@1.2.8: - dependencies: - deep-extend: 0.6.0 - ini: 1.3.8 - minimist: 1.2.8 - strip-json-comments: 2.0.1 - re-resizable@6.10.3(react-dom@18.3.1(react@18.3.1))(react@18.3.1): dependencies: react: 18.3.1 @@ -26389,14 +26155,6 @@ snapshots: unicode-match-property-ecmascript: 2.0.0 unicode-match-property-value-ecmascript: 2.2.0 - registry-auth-token@5.0.3: - dependencies: - '@pnpm/npm-conf': 2.3.1 - - registry-url@6.0.1: - dependencies: - rc: 1.2.8 - regjsgen@0.8.0: {} regjsparser@0.12.0: @@ -27084,12 +26842,6 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 - string-width@7.2.0: - dependencies: - emoji-regex: 10.4.0 - get-east-asian-width: 1.3.0 - strip-ansi: 7.1.0 - string.prototype.includes@2.0.1: dependencies: call-bind: 1.0.8 @@ -27175,8 +26927,6 @@ snapshots: dependencies: min-indent: 1.0.1 - strip-json-comments@2.0.1: {} - strip-json-comments@3.1.1: {} strip@3.0.0: {} @@ -27700,19 +27450,6 @@ snapshots: escalade: 3.2.0 picocolors: 1.1.1 - update-notifier@7.3.1: - dependencies: - boxen: 8.0.1 - chalk: 5.4.1 - configstore: 7.0.0 - is-in-ci: 1.0.0 - is-installed-globally: 1.0.0 - is-npm: 6.0.0 - latest-version: 9.0.0 - pupa: 3.1.0 - semver: 7.6.3 - xdg-basedir: 5.1.0 - uplot-react@1.1.4(react@18.3.1)(uplot@1.6.31): dependencies: react: 18.3.1 @@ -28087,10 +27824,6 @@ snapshots: dependencies: isexe: 2.0.0 - widest-line@5.0.0: - dependencies: - string-width: 7.2.0 - wildcard@2.0.1: {} winston-transport@4.9.0: @@ -28158,12 +27891,6 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 - wrap-ansi@9.0.0: - dependencies: - ansi-styles: 6.2.1 - string-width: 7.2.0 - strip-ansi: 7.1.0 - wrappy@1.0.2: {} write-file-atomic@3.0.3: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 6efa0c329a846..61003850e0eef 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,5 +1,6 @@ packages: - 'projects/*/*' + - '!projects/js-packages/jetpack-cli' - 'projects/plugins/*/tests/e2e' - 'tools/cli' - 'tools/e2e-commons' From 38ed1b1c49128bc39b14fcc286e52dd01f18e363 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Tue, 14 Jan 2025 07:30:26 -0600 Subject: [PATCH 27/29] Revert "First attempt at some documentation updates" This reverts commit 4a74468f30bdccbb289341d1143b77fc3b90ce26. --- docs/monorepo.md | 27 ++++---- docs/quick-start.md | 137 ++++++++++++++++++++++---------------- tools/docker/README.md | 145 ++++++++++------------------------------- 3 files changed, 129 insertions(+), 180 deletions(-) diff --git a/docs/monorepo.md b/docs/monorepo.md index 95e1c6a2f8899..99214f513a8b6 100644 --- a/docs/monorepo.md +++ b/docs/monorepo.md @@ -47,20 +47,19 @@ All projects should be compatible with PHP versions WordPress supports. That's c First time working with the monorepo? We got you covered. -Install the Jetpack CLI: +For the first time only: -```bash -npm install -g @automattic/jetpack-cli -``` +* From the root of the repo, run `pnpm install && pnpm jetpack cli link` (if you want the `jetpack` CLI tool installed globally) or `pnpm install` (if you don't). +* That’s it. You won’t need to do that again unless you nuke your node_modules directory. -Once installed, you can run `jp` anywhere in the Jetpack repo. Run `jp --help` to see all available commands. +Once you’ve done that, it’s easy: run `jetpack` (or `pnpm jetpack`) while anywhere in the Jetpack repo. To explore on your own, run `jetpack --help` to see the available commands. ## Jetpack Generate Wizard Starting a new project? Great! Let the Jetpack Generate Wizard help jumpstart the files you need. To get started: * Make sure you're checked out to the branch you want. -* Use the CLI command `jp generate` to start the process. +* Use the CLI command `jetpack generate` to start the process. * The wizard will walk you through the steps of starting a new package, plugin, or Github action. ### Accepted Arguments @@ -70,7 +69,7 @@ The wizard accepts a few arguments to speed things up: * `[project type]` - Accepted values: `package`, `plugin`, `github-action` * `--name`, `--n` - The name of your project (no spaces) -Example: `jp generate plugin --name my_cool_plugin` will generate plugin files for a plugin called `my_cool_plugin` under `../jetpack/projects/plugins` +Example: `jetpack generate plugin --name my_cool_plugin` will generate plugin files for a plugin called `my_cool_plugin` under `../jetpack/projects/plugins` ### What's Included @@ -457,29 +456,29 @@ The body is separated from the headers by a blank line, and is the text that act The changelogger tool can be used via [Jetpack's CLI tool](#first-time). You may use the following command to generate changelog entries for each project that needs one: -`jp changelog add` +`jetpack changelog add` **Does it matter what the change file is named?** Starting the file name with `.` should not be used. Also consider avoiding names that have extensions like `.php` or `.js` to avoid confusing other tools. -**What if a change is so trivial that it doesn't need a changelog entry?** The change file is still required. If you specify the significance as "patch", changelogger will allow the body section to be empty so as to not generate an entry in the changelog. In this case, use the "Comment" header instead, for example: +**What if a change is so trivial that it doesn’t need a changelog entry?** The change file is still required. If you specify the significance as “patch”, changelogger will allow the body section to be empty so as to not generate an entry in the changelog. In this case, use the “Comment” header instead, for example: -```bash +``` Significance: patch Type: compat Comment: Update composer.lock, no need for a changelog entry ``` -**Adding the first PR to a project after a release?** If a PR is the first to Jetpack after a release, version numbers may need to be bumped. This also applies to the first semantic versioning "minor" or "major" change to any projects that use semantic versioning. +**Adding the first PR to a project after a release?** If a PR is the first to Jetpack after a release, version numbers may need to be bumped. This also applies to the first semantic versioning “minor” or “major” change to any projects that use semantic versioning. -The "Linting / Changelogger validity" GitHub Actions check will help in making sure that all these version numbers are in sync with the version inferred from the changelog and change files. You can also check this locally with `tools/changelogger-validate-all.sh`. +The “Linting / Changelogger validity” GitHub Actions check will help in making sure that all these version numbers are in sync with the version inferred from the changelog and change files. You can also check this locally with `tools/changelogger-validate-all.sh`. -Within a single project, changlogger's `version next` command can tell you the next version, and the monorepo script `tools/project-version.sh` can be used to check and update the version numbers. +Within a single project, changlogger’s `version next` command can tell you the next version, and the monorepo script `tools/project-version.sh` can be used to check and update the version numbers. ## New Projects To begin, * For Automatticians, drop us a line in #jetpack-crew to discuss your needs, just to be sure we don't have something already. For others, it would probably be best to open an issue to discuss it. -* Use the `jp generate` command to create a skeleton project. +* Use the `jetpack generate` command to create a skeleton project. * Create your project based on the skeleton and submit a PR as usual. Once we're sure that the project will be created and what its name will be, someone (you or the Crew team) does the following: diff --git a/docs/quick-start.md b/docs/quick-start.md index d4d01204358c1..029c6feaf2907 100644 --- a/docs/quick-start.md +++ b/docs/quick-start.md @@ -2,74 +2,81 @@ ## Overview -This guide will get you up and running with Jetpack development as quickly as possible using our recommended tools. +This guide is designed to get you up and running working with the Jetpack Monorepo quickly following recommended and supported guidelines. -**Prerequisites**: You'll need: -- Node.js installed (any recent LTS version) -- Git installed and configured -- Docker installed and running +**This guide assumes you are using MacOS or a Linux machine and are an Automattician**. For more detailed information, including setting up local dev environments for all contributors, running unit tests, best coding practices, and more, you can use the [full Development Environment guide here](development-environment.md#clone-the-repository). ## Installation -1. Install the Jetpack CLI: -```bash -npm install -g @automattic/jetpack-cli -``` +### Using the installation script -2. Initialize Jetpack: -```bash -jp init -``` +To speed up the installation process, you may use our monorepo installation script. To do so: -This will: -- Clone the Jetpack monorepo to your chosen location -- Guide you through the next steps to get started +- Clone the Jetpack Monorepo: + - Using a public SSH key ([recommended](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)): `git clone git@github.com:Automattic/jetpack.git` + - Or use HTTPS: `git clone https://github.com/Automattic/jetpack.git` + - Note that the monorepo should not be cloned into the WordPress plugins directory. If you plan on not using the provided Docker environment, read the [full Development Environment guide here](development-environment.md#clone-the-repository) to find out how to add symlinks. +- `cd` into the cloned `jetpack` folder. +- Run `tools/install-monorepo.sh` from the monorepo root. +- You can use the [environment checker script](#check-if-your-environment-is-ready-for-jetpack-development) to confirm that all required tools are installed. -## Development Workflow +Once the installation is complete, continue onto the section [Running Jetpack locally](#running-jetpack-locally). -Build and test your changes: -```bash -# Build a specific project with dependencies -jp build plugins/jetpack --deps +### Installing manually -# Or watch for changes -jp watch plugins/jetpack +Prior to installation, we recommend using [`Homebrew`](https://brew.sh/) to manage installations and [`nvm`](https://github.com/nvm-sh/nvm/) to manage Node.js versions. If you don't already have those installed, you can do so by copy/pasting each of the following commands and running them in your terminal: -# Run tests -jp test -``` +- Homebrew: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"` +- nvm: `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash` -## Testing with Docker +The Jetpack Monorepo requires various software to be installed on your machine. -Jetpack includes a testing environment using Docker. To start testing: +- Clone the Jetpack Monorepo: + - Using a public SSH key ([recommended](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account)): `git clone git@github.com:Automattic/jetpack.git` + - Or use HTTPS: `git clone https://github.com/Automattic/jetpack.git` + - Note that the monorepo should not be cloned into the WordPress plugins directory. If you plan on not using the provided Docker environment, read the [full Development Environment guide here](development-environment.md#clone-the-repository) to find out how to add symlinks. +- This software needs to be installed or updated system-wide: + - Bash (will need to be updated from default Mac version): `brew install bash` + - jq (JSON processor used in scripts): `brew install jq` +- To install or update the following software, cd into the Jetpack directory that was created when cloning the repo: `cd jetpack`: + - Node.js (used for build process and our CLI): `nvm install && nvm use` + - PNPM (a Node.js package manager): `npm install -g pnpm` + - PHP (the language at the core of the WordPress ecosystem): `source .github/versions.sh && brew install php@$PHP_VERSION` + - Composer (our PHP package manager): `brew install composer` + - Jetpack CLI (an internal tool that assists with development): `pnpm install && pnpm jetpack cli link` + - [You can read more about using the CLI here](https://github.com/Automattic/jetpack/blob/trunk/tools/cli/README.md). -1. Start the testing environment: -```bash -jp docker up -d -``` +### Check if your environment is ready for Jetpack development -2. Install WordPress (first time only): -```bash -jp docker install +We provide a script to help you in assessing if everything's ready on your system to contribute to Jetpack. + +```sh +tools/check-development-environment.sh ``` -3. Visit http://localhost to see your site! +Running the script will tell you if you have your environment already set up and what you need to do in order to get it ready for Jetpack development: -## Testing WordPress.com Features +- All green `YES` or `OK` messages mean you're ready to start +- Red `NO` messages mean something is wrong or missing, and a link will be provided to help you with a fix. +- Yellow messages indicate something optional is broken or missing. -To test features requiring a WordPress.com connection: +## Running Jetpack locally -### For Automatticians: -Use Jurassic Tube: -```bash -jp docker jt-up -``` +After everything is installed, you're ready to run Jetpack locally! While there are other supported methods of doing this, we recommend and support using Docker containers. -### For External Contributors: -Use ngrok: -```bash -jp docker ngrok-up -``` +To setup Docker: +- Install Docker: + - Mac: `brew install --cask docker` (This will take a while!) + - Linux: `brew install docker` + - `open -a Docker` (or open the app from your Applications folder) to open the GUI application. You will likely need to enter your device password and accept their terms for a first time setup. +- Copy the settings file from within the monorepo root: `cp tools/docker/default.env tools/docker/.env` +- Open `tools/docker/.env` and make any modifications you'd like. + - It's strongly recommend you at least change `WP_ADMIN_PASSWORD` to something more secure. +- Start the Docker container using `jetpack docker up -d` (this may take some time for the first setup) +- Install WordPress in your Docker container using `jetpack docker install` +- Open up http://localhost to see your site! + +For more in depth Docker instructions, follow the [Docker environment for Jetpack Development guide](../tools/docker/README.md). ## Setting up Jurassic Tube @@ -77,18 +84,34 @@ In order to test features that require a WordPress.com connection and other netw Note: This is for Automattician use only. For other methods, check out [ngrok](../tools/docker/README.md#using-ngrok-with-jetpack) or [another similar service](https://alternativeto.net/software/ngrok/). -**Warning: This creates a tunnel to your local machine which should not be trusted as secure. If it is compromised, so is your computer and everything it has access to. Only `jp docker jt-up` when needed for testing things that require -the site to be publicly accessible, and `jp docker jt-down` when completed.** +**Warning: This creates a tunnel to your local machine which should not be trusted as secure. If it is compromised, so is your computer and everything it has access to. Only `jetpack docker jt-up` when needed for testing things that require the site to be publicly accessible, and `jetpack docker jt-down` when completed.** - Visit the [jurassic.tube](https://jurassic.tube/) homepage to create a subdomain -- Make sure you've run `npm install -g @automattic/jetpack-cli` -- Make sure Docker is running `jp docker up -d` +- Make sure you've run `pnpm install && pnpm jetpack cli link` +- Make sure Docker is running `jetpack docker up -d` - Stand on the monorepo root in your terminal and run `mkdir tools/docker/bin/jt` -- Stop and restart the docker env: `jp docker stop && jp docker up -d` +- Stop and restart the docker env: `jetpack docker stop && jetpack docker up -d` - Download and run the installation script: `curl "https://jurassic.tube/get-installer.php?env=jetpack" -o tools/docker/bin/jt/installer.sh && chmod +x tools/docker/bin/jt/installer.sh && tools/docker/bin/jt/installer.sh` -- Set your username: `jp docker jt-config username [your-username-here e.g david]` -- Set your subdomain: `jp docker jt-config subdomain [your-subdomain-here e.g. spaceman]` -- Now, you can start your site with `jp docker jt-up` +- Set your username: `jetpack docker jt-config username [your-username-here e.g david]` +- Set your subdomain: `jetpack docker jt-config subdomain [your-subdomain-here e.g. spaceman]` +- Now, you can start your site with `jetpack docker jt-up` - Your site should be available at `https://custom-subdomain.jurassic.tube` -That's all! For more detailed information, see the [Development Environment guide](development-environment.md). +## Development Workflow + +Once you have a local copy of Jetpack and all development tools installed, you can start developing. + +1. Make sure the plugin you're developing is activated on your WordPress site. +2. [Build your project](development-environment.md#building-your-project) using `jetpack build [type/project]` and including its dependencies, such as `jetpack build plugins/jetpack --deps` +3. Access the plugin's dashboard in your browser. + +By default the development build above will run once and if you change any of the files, you need to run `jetpack build` again to see the changes on the site. If you want to avoid that, you can run a continuous build that will rebuild anytime it sees any changes on your local filesystem. To run it, use: + +```sh +jetpack watch +``` +### Running Tests + +To run PHP, JS, and coverage tests, you can use the Jetpack CLI: `jetpack test` and then choose the project and type of test you'd like to run. + +That's all! diff --git a/tools/docker/README.md b/tools/docker/README.md index 7f8d72dc58720..ff3ed2d622385 100644 --- a/tools/docker/README.md +++ b/tools/docker/README.md @@ -1,19 +1,6 @@ # Docker environment for Jetpack Development -Jetpack development uses two Docker environments: - -## Development Environment - -A separate monorepo container provides development tools: - -* PHP and Composer for PHP development -* Node.js and pnpm for JavaScript development -* All build tools and dependencies needed for development -* Automatically used by the [`jp` CLI](../../projects/js-packages/jetpack-cli/README.md) for building and testing - -## Testing Environment - -The main WordPress testing environment provides: +Unified environment for developing Jetpack using Docker containers providing following goodies: * An Ubuntu base operating system. * Latest stable version of WordPress. @@ -22,7 +9,7 @@ The main WordPress testing environment provides: * WP-CLI installed. * MailDev to catch all the emails leaving WordPress so that you can observe them from browser. * phpMyAdmin to aid in viewing the database. -* Handy shorthand commands like `jp docker up` and `jp docker phpunit` to simplify the usage. +* Handy shorthand commands like `jetpack docker up` and `jetpack docker phpunit` to simplify the usage. ## To get started @@ -48,12 +35,12 @@ Anything you put in `.env` overrides values in `default.env`. You should modify Once you're all set with the above, spin up the containers: ```sh -jp docker up +jetpack docker up ``` Non-installed WordPress is running at [http://localhost](http://localhost) now. To install WordPress and configure some useful defaults, run ```sh -jp docker install +jetpack docker install ``` At this point, to connect Jetpack, you'd need to set up a service that can create local HTTP tunnels, such as [the Jurassic Tube Tunneling Service](#jurassic-tube-tunneling-service) (available to Automatticians only), [ngrok](#using-ngrok-with-jetpack), or [another similar service](https://alternativeto.net/software/ngrok/). @@ -112,7 +99,7 @@ The default config file `tools/docker/jetpack-docker-config-default.yml` include You can just quickly install WordPress and activate Jetpack via command line. Ensure you have your domain modified in `.env` file, spin up the containers and then run: ```sh -jp docker install +jetpack docker install ``` This will give you a single site with user/pass `wordpress` (unless you changed these from `./tools/docker/.env` file). You will still have to connect Jetpack to WordPress.com manually. @@ -120,19 +107,19 @@ This will give you a single site with user/pass `wordpress` (unless you changed To convert installed single site into a multisite, run: ```sh -jp docker multisite-convert +jetpack docker multisite-convert ``` To remove WordPress installation and start over, run: ```sh -jp docker uninstall +jetpack docker uninstall ``` ### Start containers ```sh -jp docker up +jetpack docker up ``` Start the containers (WordPress, MySQL and MailDev) defined in `docker-compose.yml`. @@ -142,19 +129,19 @@ This command will rebuild the WordPress container if you made any changes to `do For running the containers in the background, use: ```sh -jp docker up -d +jetpack docker up -d ``` ### Stop containers ```sh -jp docker stop +jetpack docker stop ``` Stops all containers. ```sh -jp docker down +jetpack docker down ``` Will stop all of the containers created by this Docker compose configuration and remove them, too. It won’t remove the images. Just the containers that have just been stopped. @@ -164,18 +151,18 @@ Will stop all of the containers created by this Docker compose configuration and These commands require the WordPress container to be running. ```sh -jp docker phpunit +jetpack docker phpunit ``` This will run unit tests for Jetpack. You can pass arguments to `phpunit` like so: ```sh -jp docker phpunit -- --filter=Protect +jetpack docker phpunit -- --filter=Protect ``` This command runs the tests as a multi site install ```sh -jp docker phpunit-multisite -- --filter=Protect +jetpack docker phpunit-multisite -- --filter=Protect ``` To run tests for specific packages, you can run the tests locally, from within the package's directory: @@ -189,7 +176,7 @@ composer phpunit To remove all docker images, all MySQL data, and all docker-related files from your local machine run: ```sh -jp docker clean +jetpack docker clean ``` **Note:** this command does not work in Windows. @@ -199,22 +186,22 @@ jp docker clean You can run [WP CLI](https://make.wordpress.org/cli/) commands inside WordPress container: ```sh -jp docker wp COMMAND +jetpack docker wp COMMAND ``` For example run [`cron event list`](https://developer.wordpress.org/cli/commands/cron/event/list/): ```sh -jp docker wp cron event list +jetpack docker wp cron event list ``` [`shell`](https://developer.wordpress.org/cli/commands/shell/) is a handy WP-CLI command you can use like so: ```bash -jp docker wp shell +jetpack docker wp shell ``` -By default it will use rich REPL [`PsySH`](https://psysh.org/), to run the default REPL use `jp docker wp shell --basic` +By default it will use rich REPL [`PsySH`](https://psysh.org/), to run the default REPL use `jetpack docker wp shell --basic` Shell allows you to evaluate PHP code while having your installed WordPress loaded, so you could do things like: @@ -233,7 +220,7 @@ You can also access it via phpMyAdmin at [http://localhost:8181](http://localhos Another way to accessing the database is MySQL client using the following command: ```sh -jp docker db command "show tables;" +jetpack docker db ``` This command utilizes credentials from the config file (`~/.my.cnf`) to log you into MySQL without entering any connection information. @@ -269,29 +256,29 @@ define( 'JETPACK__SANDBOX_DOMAIN', '{your sandbox}.wordpress.com' ); This is for Automatticians only. More information: PCYsg-snO-p2. -If you have persistent trouble with the `jp docker jt-*` commands complaining that "Tunneling scripts are not installed", it could be because Docker wasn't running properly when you ran the installer. +If you have persistent trouble with the `jetpack docker jt-*` commands complaining that "Tunneling scripts are not installed", it could be because Docker wasn't running properly when you ran the installer. To solve this problem, run these commands from the repo root: ``` -jp docker up -d +jetpack docker up -d chmod +x tools/docker/bin/jt/installer.sh && tools/docker/bin/jt/installer.sh ``` Once you have successfull installed Jurassic Tube, you can use these commands during development: -* Start the tunnel: `jp docker jt-up your-username your-subdomain` -* Break the connection: `jp docker jt-down` +* Start the tunnel: `jetpack docker jt-up your-username your-subdomain` +* Break the connection: `jetpack docker jt-down` You can also set default values: ```shell script -jp docker jt-config username your-username -jp docker jt-config subdomain your-subdomain +jetpack docker jt-config username your-username +jetpack docker jt-config subdomain your-subdomain ``` That will let you omit those parameters while initiating the connection: ```shell script -jp docker jt-up +jetpack docker jt-up ``` ## Using Ngrok with Jetpack @@ -322,7 +309,7 @@ tunnels: ngrok support is integrated into a jetpack cli, so to start a docker container with mapped tunnel, simply run: ```bash -jp docker up --ngrok +jetpack docker up --ngrok ``` ### Ngrok SFTP Tunnel with Jetpack @@ -345,7 +332,7 @@ See more configuration options from [Ngrok documentation](https://ngrok.com/docs You can now start both tunnels: ```bash -jp docker up --ngrok sftp +jetpack docker up --ngrok sftp ``` You can inspect traffic between your WordPress/Jetpack container and WordPress.com using [the inspector](https://ngrok.com/docs#inspect). @@ -367,7 +354,7 @@ Jetpack Docker environment can be wonderful for developing your own plugins and Since everything under `mu-plugins` and `wordpress/wp-content` is git-ignored, you'll want to keep those folders outside Jetpack repository folder and link them as volumes to your Docker instance. -1. First ensure your containers are stopped (`jp docker stop`). +1. First ensure your containers are stopped (`jetpack docker stop`). 2. Edit `tools/docker/jetpack-docker-config.yml`. Changes to this file won't be tracked by git. 3. To add a single custom plugin, you would for example have this in that file: ```yml @@ -381,11 +368,11 @@ Since everything under `mu-plugins` and `wordpress/wp-content` is git-ignored, y ``` 4. Start containers and include your custom volumes by running: ```bash - jp docker up + jetpack docker up ``` Note that any folder within the `projects/plugins` directory will be automatically linked. -If you're starting a new monorepo plugin, you may need to `jp docker stop` and `jp docker up` to re-run the initial linking step so it can be added. +If you're starting a new monorepo plugin, you may need to `jetpack docker stop` and `jetpack docker up` to re-run the initial linking step so it can be added. You can add your plugin to the list of plugins not allowed to be deleted or updated by adding this to a new file at `tools/docker/mu-plugins`: @@ -412,7 +399,7 @@ Logs are stored in your file system under `./tools/docker/logs` directory. To `tail -f` the PHP error log, run: ```sh -jp docker tail +jetpack docker tail ``` #### MySQL Slow Query Log @@ -425,7 +412,7 @@ We recommend to regularly review the log to make sure performance issues don't g ### Debugging emails -Emails don't leave your WordPress and are caught by [MailDev](http://danfarrelly.nyc/MailDev/) SMTP server container instead. +Emails don’t leave your WordPress and are caught by [MailDev](http://danfarrelly.nyc/MailDev/) SMTP server container instead. To debug emails via web-interface, open [http://localhost:1080](http://localhost:1080) @@ -435,7 +422,7 @@ To debug emails via web-interface, open [http://localhost:1080](http://localhost You can use the [WP CLI](https://make.wordpress.org/cli/) to update the version of WordPress running inside the Docker container. Example command: ``` -jp docker wp core update --version=5.3.4 --force +jetpack docker wp core update --version=5.3.4 --force ``` This is useful if you want to check your code is compatible with the minimum version of WP Jetpack supports, which can be found in the [readme.txt](../readme.txt). We always support the latest patched version of the branch we specify as "Requires at least" in the readme file. You can match it with the exact version on the [WordPress Releases page](https://wordpress.org/download/releases/). @@ -444,7 +431,7 @@ This is useful if you want to check your code is compatible with the minimum ver The WordPress image is leveraged with Xdebug present as a PHP Extension. -You'll likely need to install a browser extension like the following: +You’ll likely need to install a browser extension like the following: * [The easiest Xdebug](https://addons.mozilla.org/en-US/firefox/addon/the-easiest-xdebug/) for Mozilla Firefox * [Xdebug Helper](https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc) for Google Chrome @@ -559,63 +546,3 @@ function my_plugin_add_profile_parameter( $should_add, $url, $host ) { return $should_add; } ``` - -### Using ngrok with Jetpack - -```sh -jp docker ngrok-up -``` - -This command will start ngrok tunnel for you. The configuration for the tunnel can be found in `tools/docker/ngrok.yml`. - -To stop the tunnel: - -```sh -jp docker ngrok-down -``` - -### Using Jurassic Tube with Jetpack - -```sh -jp docker jt-up -``` - -This command will start Jurassic Tube tunnel for you. - -To stop the tunnel: - -```sh -jp docker jt-down -``` - -### Using Xdebug - -To use Xdebug with PHPStorm you can run: - -```sh -XDEBUG_CONFIG="remote_host=host.docker.internal" jp docker phpunit --filter=Protect -``` - -### Running a shell inside the container - -```sh -jp docker exec -- bash -``` - -### Running wp-cli commands - -```sh -jp docker wp cli info -``` - -### Watching for changes - -```sh -jp docker watch -``` - -### Building assets - -```sh -jp docker build plugins/jetpack -``` From 0bf7446db892490ec90de1778c3b24346b6547ad Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Tue, 14 Jan 2025 07:38:08 -0600 Subject: [PATCH 28/29] Remove left over jetpack docker monorepo command --- tools/cli/commands/docker.js | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/tools/cli/commands/docker.js b/tools/cli/commands/docker.js index 8626a47a37427..0d46d986746a7 100644 --- a/tools/cli/commands/docker.js +++ b/tools/cli/commands/docker.js @@ -818,30 +818,6 @@ export function dockerDefine( yargs ) { description: 'Set jurassic tube config', handler: argv => execJtCmdHandler( argv ), } ) - .command( { - command: 'monorepo', - description: 'Run commands in monorepo container', - builder: yargCmd => - defaultOpts( yargCmd ).option( 'cmd', { - alias: 'c', - describe: 'Command to run', - type: 'string', - demandOption: true, - } ), - handler: argv => { - const opts = buildComposeFiles().concat( [ - 'run', - '--rm', - 'monorepo', - 'bash', - '-c', - argv.cmd, - ] ); - - const envOpts = buildEnv( argv ); - composeExecutor( argv, opts, envOpts ); - }, - } ) .command( { command: 'config', description: 'Generate Docker configuration files', From 155120fb96fdeda47f90d54b14044261feca2a21 Mon Sep 17 00:00:00 2001 From: Brandon Kraft Date: Tue, 14 Jan 2025 10:18:58 -0600 Subject: [PATCH 29/29] Remove unused docker composer file --- tools/docker/docker-compose-monorepo.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 tools/docker/docker-compose-monorepo.yml diff --git a/tools/docker/docker-compose-monorepo.yml b/tools/docker/docker-compose-monorepo.yml deleted file mode 100644 index 3b5d83341ff25..0000000000000 --- a/tools/docker/docker-compose-monorepo.yml +++ /dev/null @@ -1,15 +0,0 @@ -services: - monorepo: - profiles: - - dev - build: - context: ${HOST_CWD:-.}/tools/docker - dockerfile: Dockerfile.monorepo - args: - PHP_VERSION: ${PHP_VERSION} - COMPOSER_VERSION: ${COMPOSER_VERSION} - NODE_VERSION: ${NODE_VERSION} - PNPM_VERSION: ${PNPM_VERSION} - volumes: - - ${HOST_CWD:-.}:/usr/local/src/jetpack-monorepo - working_dir: /usr/local/src/jetpack-monorepo