From 96a973b9fa2360d662461417e4fd6e3f95bc03a2 Mon Sep 17 00:00:00 2001 From: Christopher Allford <6451942+ObliviousHarmony@users.noreply.github.com> Date: Wed, 6 Dec 2023 09:32:32 -0800 Subject: [PATCH] Refactored Task Infrastructure (#41202) * Fixed NPM packages with invalid names. * Renamed plugin packages. * Standardized package NPM scripts. * Replaced Turborepo with Wireit. --- .github/CONTRIBUTING.md | 4 +- .../setup-woocommerce-monorepo/action.yml | 149 +++---- .../scripts/parse-input-filter.js | 27 +- .../setup-local-test-environment/action.yml | 6 +- .github/workflows/build-live-branch.yml | 2 - .github/workflows/build-release-zip-file.yml | 2 - .github/workflows/ci.yml | 181 ++++---- .../hpos-build-and-e2e-tests-daily.yml | 10 +- .github/workflows/mirrors.yml | 2 - .github/workflows/nightly-builds.yml | 2 - .../non-cot-pr-build-and-e2e-tests.yml | 10 +- .github/workflows/package-release.yml | 3 + .github/workflows/pr-build-and-e2e-tests.yml | 17 +- .github/workflows/pr-build-live-branch.yml | 2 - .github/workflows/pr-highlight-changes.yml | 4 +- .github/workflows/pr-lint-monorepo.yml | 4 +- .github/workflows/pr-smoke-test.yml | 3 + .github/workflows/prepare-package-release.yml | 3 + .github/workflows/release-code-freeze.yml | 18 +- .github/workflows/release-wc-beta-tester.yml | 2 + .github/workflows/smoke-test-daily.yml | 13 +- .github/workflows/smoke-test-pr-merge.yml | 6 +- .github/workflows/smoke-test-release.yml | 24 +- .github/workflows/syncpack.yml | 2 +- .gitignore | 4 +- .pnpmfile.cjs | 256 +++++++++++ .syncpackrc | 11 +- DEVELOPMENT.md | 49 +-- README.md | 4 +- bin/pre-push.sh | 2 +- .../minification-of-SCSS-and-JS.md | 2 +- .../development-environment.md | 2 +- package.json | 58 +-- packages/js/README.md | 3 +- packages/js/admin-e2e-tests/package.json | 101 +++-- packages/js/admin-layout/package.json | 121 +++-- packages/js/ai/package.json | 123 ++++-- packages/js/api-core-tests/package.json | 51 +-- packages/js/api/package.json | 87 ++-- packages/js/block-templates/package.json | 130 ++++-- packages/js/components/.gitignore | 3 - packages/js/components/package.json | 184 ++++++-- .../create-product-editor-block/package.json | 36 +- packages/js/create-woo-extension/.gitignore | 3 - packages/js/create-woo-extension/package.json | 28 +- packages/js/csv-export/.gitignore | 3 - packages/js/csv-export/package.json | 139 ++++-- packages/js/currency/.gitignore | 3 - packages/js/currency/package.json | 126 ++++-- packages/js/customer-effort-score/.gitignore | 3 - .../js/customer-effort-score/package.json | 160 +++++-- packages/js/data/.gitignore | 3 - packages/js/data/package.json | 136 ++++-- packages/js/date/.gitignore | 3 - packages/js/date/package.json | 117 +++-- .../.gitignore | 3 - .../package.json | 46 +- packages/js/e2e-core-tests/package.json | 38 +- packages/js/e2e-environment/external.md | 2 +- packages/js/e2e-environment/package.json | 64 +-- packages/js/e2e-utils/package.json | 38 +- packages/js/eslint-plugin/.gitignore | 3 - packages/js/eslint-plugin/package.json | 52 +-- packages/js/experimental/.gitignore | 3 - packages/js/experimental/package.json | 151 +++++-- packages/js/explat/.gitignore | 3 - packages/js/explat/package.json | 117 +++-- packages/js/explat/tsconfig.json | 2 +- .../js/expression-evaluation/package.json | 111 +++-- .../extend-cart-checkout-block/package.json | 28 +- .../extend-cart-checkout-block/project.json | 5 - packages/js/integrate-plugin/package.json | 98 ++++- packages/js/internal-e2e-builds/package.json | 39 +- packages/js/internal-js-tests/package.json | 90 +++- packages/js/internal-js-tests/project.json | 19 - packages/js/internal-style-build/package.json | 41 +- packages/js/navigation/.gitignore | 3 - packages/js/navigation/package.json | 127 ++++-- packages/js/notices/package.json | 113 +++-- packages/js/notices/project.json | 25 -- packages/js/number/.gitignore | 3 - packages/js/number/package.json | 121 +++-- packages/js/onboarding/.gitignore | 3 - packages/js/onboarding/package.json | 156 +++++-- packages/js/product-editor/package.json | 179 ++++++-- packages/js/tracks/.gitignore | 3 - packages/js/tracks/package.json | 117 +++-- plugins/woo-ai/DEVELOPMENT.md | 6 +- plugins/woo-ai/bin/build-zip.sh | 2 +- plugins/woo-ai/package.json | 119 ++--- .../bin/hook-reference/README.md | 2 +- .../docs/examples/extensions/README.md | 2 +- .../docs/features/navigation.md | 2 +- .../features/payment-gateway-suggestions.md | 2 +- plugins/woocommerce-admin/package.json | 219 ++++++--- plugins/woocommerce-admin/webpack.config.js | 2 +- plugins/woocommerce-beta-tester/README.md | 4 +- .../woocommerce-beta-tester/bin/build-zip.sh | 2 +- plugins/woocommerce-beta-tester/package.json | 135 +++--- plugins/woocommerce-docs/package.json | 16 +- plugins/woocommerce/README.md | 22 +- plugins/woocommerce/assets/css/.gitkeep | 0 plugins/woocommerce/assets/js/.gitkeep | 0 plugins/woocommerce/bin/build-zip.sh | 4 +- .../bin/generate-feature-config.php | 2 +- plugins/woocommerce/bin/package-update.sh | 2 +- .../woocommerce/client/legacy/Gruntfile.js | 4 +- .../woocommerce/client/legacy/package.json | 47 +- .../includes/class-woocommerce.php | 2 +- plugins/woocommerce/package.json | 189 +++++--- .../tests/api-core-tests/README.md | 2 +- plugins/woocommerce/tests/e2e-pw/README.md | 2 +- plugins/woocommerce/tests/e2e/README.md | 20 +- .../woocommerce/tests/performance/README.md | 4 +- pnpm-lock.yaml | 415 +++++++++++------- tools/code-analyzer/.gitignore | 1 - tools/code-analyzer/README.md | 2 +- tools/code-analyzer/package.json | 24 +- .../src/lib/__tests__/fixtures/diff.txt | 102 ++--- tools/code-analyzer/tsconfig.json | 34 +- tools/create-extension/README.md | 2 +- tools/create-extension/package.json | 9 +- tools/monorepo-merge/.gitignore | 1 - tools/monorepo-merge/package.json | 40 +- tools/monorepo-utils/.gitignore | 0 tools/monorepo-utils/package.json | 28 +- .../commands/changelog/lib/index.ts | 2 +- tools/monorepo/check-changelogger-use.php | 4 +- tools/package-release/.gitignore | 1 - tools/package-release/package.json | 38 +- .../src/commands/publish/index.ts | 2 +- tools/release-posts/README.md | 6 +- tools/release-posts/package.json | 33 +- tools/storybook/package.json | 35 +- turbo.json | 97 ---- 135 files changed, 3836 insertions(+), 2103 deletions(-) create mode 100644 .pnpmfile.cjs delete mode 100644 packages/js/components/.gitignore delete mode 100644 packages/js/create-woo-extension/.gitignore delete mode 100644 packages/js/csv-export/.gitignore delete mode 100644 packages/js/currency/.gitignore delete mode 100644 packages/js/customer-effort-score/.gitignore delete mode 100644 packages/js/data/.gitignore delete mode 100644 packages/js/date/.gitignore delete mode 100644 packages/js/dependency-extraction-webpack-plugin/.gitignore delete mode 100644 packages/js/eslint-plugin/.gitignore delete mode 100644 packages/js/experimental/.gitignore delete mode 100644 packages/js/explat/.gitignore delete mode 100644 packages/js/extend-cart-checkout-block/project.json delete mode 100644 packages/js/internal-js-tests/project.json delete mode 100644 packages/js/navigation/.gitignore delete mode 100644 packages/js/notices/project.json delete mode 100644 packages/js/number/.gitignore delete mode 100644 packages/js/onboarding/.gitignore delete mode 100644 packages/js/tracks/.gitignore delete mode 100644 plugins/woocommerce/assets/css/.gitkeep delete mode 100644 plugins/woocommerce/assets/js/.gitkeep delete mode 100644 tools/code-analyzer/.gitignore delete mode 100644 tools/monorepo-merge/.gitignore delete mode 100644 tools/monorepo-utils/.gitignore delete mode 100644 tools/package-release/.gitignore delete mode 100644 turbo.json diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index f5050d06562..5280efb46ba 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -35,7 +35,7 @@ Please take a moment to review the [project readme](https://github.com/woocommer - Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/). - Run our build process described in the document on [how to set up WooCommerce development environment](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment), it will install our pre-commit hook, code sniffs, dependencies, and more. -- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=woocommerce run lint:php:changes:branch`. +- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=@woocommerce/plugin-woocommerce lint:php:changes:branch`. - Whenever possible, please fix pre-existing code standards errors in code that you change. - Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E tests. You can check the following guides for this purpose: - [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#guide-for-writing-unit-tests). @@ -46,7 +46,7 @@ Please take a moment to review the [project readme](https://github.com/woocommer - Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file. - Push the changes to your fork and submit a pull request on the trunk branch of the WooCommerce repository. - Make sure to write good and detailed commit messages (see [this post](https://chris.beams.io/posts/git-commit/) for more on this) and follow all the applicable sections of the pull request template. -- Please create a change file for your changes by running `pnpm --filter= changelog add`. For example, a change file for the WooCommerce Core project would be added by running `pnpm --filter=woocommerce changelog add`. +- Please create a change file for your changes by running `pnpm --filter= changelog add`. For example, a change file for the WooCommerce Core project would be added by running `pnpm --filter=@woocommerce/plugin-woocommerce changelog add`. - Please avoid modifying the changelog directly or updating the .pot files. These will be updated by the WooCommerce team. If you are contributing code to our (Javascript-driven) Gutenberg blocks, please note that they are developed in their [own repository](https://github.com/woocommerce/woocommerce-gutenberg-products-block) and have their [own issue tracker](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues). diff --git a/.github/actions/setup-woocommerce-monorepo/action.yml b/.github/actions/setup-woocommerce-monorepo/action.yml index 245324bfe59..e116ebbd857 100644 --- a/.github/actions/setup-woocommerce-monorepo/action.yml +++ b/.github/actions/setup-woocommerce-monorepo/action.yml @@ -1,91 +1,62 @@ -name: Setup WooCommerce Monorepo -description: Handles the installation, building, and caching of the projects within the monorepo. -permissions: {} - +name: 'Setup WooCommerce Monorepo' +description: 'A composite action bundling together the setup of dependencies and optional installation and building of projects.' inputs: - install: - description: Indicates whether or not the action should install any projects. - default: 'true' - install-filters: - description: The PNPM filter used to decide what projects to install. Supports multiline strings for multiple filters. - default: '' - build: - description: Indicates whether or not the action should build any projects. - default: 'true' - build-filters: - description: The PNPM filter used to decide what projects to build. Supports multiline strings for multiple filters. - default: '' - php-version: - description: The version of PHP that the action should set up. - default: '7.4' - + php-version: + description: 'The PHP version that should be installed. Use "false" to skip PHP installation.' + default: '7.4' + install: + description: 'Given a boolean or PNPM filter, runs the install command for monorepo project(s).' + default: false + build: + description: 'Given a boolean or PNPM filter, runs the build command for monorepo project(s).' + default: false runs: - using: composite - steps: - - name: Parse Action Input - id: parse-input - shell: bash - run: | - echo "INSTALL_FILTERS=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install-filters }}')" >> $GITHUB_OUTPUT - echo "BUILD_FILTERS=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build-filters }}')" >> $GITHUB_OUTPUT - - - name: Setup PNPM - uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd - with: - version: '8.6.7' - - - name: Setup Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c - with: - node-version-file: .nvmrc - cache: pnpm - registry-url: 'https://registry.npmjs.org' - - - name: Setup PHP - uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc - with: - php-version: ${{ inputs.php-version }} - coverage: none - tools: phpcs, sirbrillig/phpcs-changed:2.11.1 - - - name: Cache Composer Dependencies - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: ~/.cache/composer/files - key: ${{ runner.os }}-php-${{ inputs.php-version }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: ${{ runner.os }}-php-${{ inputs.php-version }}-composer- - - - name: Install Node and PHP Dependencies - shell: bash - if: ${{ inputs.install == 'true' }} - env: - PUPPETEER_SKIP_DOWNLOAD: 'true' - run: | - pnpm -w install turbo - pnpm install ${{ steps.parse-input.outputs.INSTALL_FILTERS }} - - - name: Get branch name - id: get_branch - shell: bash - run: | - if [ "${{ github.event_name }}" == "pull_request" ]; then - branch_name=$(echo "${{ github.head_ref }}" | tr '/' '-') - echo "CURRENT_BRANCH_NAME=$branch_name" >> $GITHUB_OUTPUT - else - echo "CURRENT_BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_OUTPUT - fi - - - name: Cache Build Output - if: ${{ inputs.build == 'true' }} - uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 - with: - path: .turbo - key: ${{ runner.os }}-build-output-${{ steps.get_branch.outputs.CURRENT_BRANCH_NAME }}-${{ github.sha }} - restore-keys: | - ${{ runner.os }}-build-output-${{ steps.get_branch.outputs.CURRENT_BRANCH_NAME }} - ${{ runner.os }}-build-output - - - name: Build - if: ${{ inputs.install == 'true' && inputs.build == 'true' }} - shell: bash - run: pnpm -w exec turbo run turbo:build --cache-dir=".turbo" ${{ steps.parse-input.outputs.BUILD_FILTERS }} + using: 'composite' + steps: + - name: 'Setup PNPM' + uses: 'pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598' + with: + version: '8' + - name: 'Setup Node' + uses: 'actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65' + with: + node-version-file: '.nvmrc' + # We only want to use the cache if something is being installed. + cache: ${{ inputs.install != 'false' && 'pnpm' || '' }} + - name: 'Setup PHP' + if: ${{ inputs.php-version != 'false' }} + uses: 'shivammathur/setup-php@a36e1e52ff4a1c9e9c9be31551ee4712a6cb6bd0' + with: + php-version: '${{ inputs.php-version }}' + coverage: 'none' + - name: 'Cache Composer Dependencies' + if: ${{ inputs.php-version != 'false' }} + uses: 'actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84' + with: + path: '~/.cache/composer/files' + key: "${{ runner.os }}-composer-${{ hashFiles( '**/composer.lock' ) }}" + restore-keys: '${{ runner.os }}-composer-' + - name: 'Parse Project Filters' + id: 'project-filters' + shell: 'bash' + run: | + echo "install=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install }}')" >> $GITHUB_OUTPUT + echo "build=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build }}')" >> $GITHUB_OUTPUT + - name: 'Install Project Dependencies' + # Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. + if: ${{ inputs.install == 'true' || steps.project-filters.outputs.install != '' }} + shell: 'bash' + run: 'pnpm install' + # `pnpm install` filtering is broken: https://github.com/pnpm/pnpm/issues/6300 + # run: 'pnpm install ${{ steps.project-filters.outputs.install }}' + # We want to include an option to build projects using this action so that we can make + # sure that the build cache is always used when building projects. + - name: 'Cache Build Output' + # Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. + if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }} + uses: 'google/wireit@f3a3c79c553122e2fe5829eeac7d815326502903' + - name: 'Build' + # Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter. + if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }} + shell: 'bash' + run: 'pnpm ${{ steps.project-filters.outputs.build }} build' diff --git a/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js b/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js index 70d7bf583a6..dd63def2010 100644 --- a/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js +++ b/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js @@ -1,22 +1,27 @@ -const args = process.argv.slice(2); -if (args.length != 1) { - console.error('Filters must be passed as a single string!'); - process.exit(-1); +const args = process.argv.slice( 2 ); +if ( args.length != 1 ) { + console.error( 'Filters must be passed as a single string!' ); + process.exit( -1 ); +} + +// Boolean inputs should not be processed. +if ( args[0] === 'true' || args[0] === 'false' ) { + process.exit(); } // Read all of the given filters and return the full filter options string. -const filterLines = args[0].split("\n"); +const filterLines = args[0].split( "\n" ); let output = ''; -for (const line of filterLines) { - if (line === '') { +for ( const line of filterLines ) { + if ( line === '' ) { continue; } - if (output !== '') { + if ( output !== '' ) { output += ' '; } - output += "--filter='" + line + "'"; + output += `--filter='${ line }'`; } -console.log(output); -process.exit(0); +console.log( output ); +process.exit(); diff --git a/.github/actions/tests/setup-local-test-environment/action.yml b/.github/actions/tests/setup-local-test-environment/action.yml index c5386a32c77..8ca7c4b5ee8 100644 --- a/.github/actions/tests/setup-local-test-environment/action.yml +++ b/.github/actions/tests/setup-local-test-environment/action.yml @@ -18,12 +18,12 @@ runs: if: ( inputs.test-type == 'e2e' ) || ( inputs.test-type == 'api' ) working-directory: plugins/woocommerce shell: bash - run: pnpm run env:test + run: pnpm env:test - name: Load docker images and start containers for k6 performance tests if: inputs.test-type == 'k6' working-directory: plugins/woocommerce shell: bash run: | - pnpm env:dev --filter=woocommerce - pnpm env:performance-init --filter=woocommerce + pnpm --filter=@woocommerce/plugin-woocommerce env:dev + pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init diff --git a/.github/workflows/build-live-branch.yml b/.github/workflows/build-live-branch.yml index d4b72c372ba..f55327cdc51 100644 --- a/.github/workflows/build-live-branch.yml +++ b/.github/workflows/build-live-branch.yml @@ -30,8 +30,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Prepare plugin zips id: prepare diff --git a/.github/workflows/build-release-zip-file.yml b/.github/workflows/build-release-zip-file.yml index f07d234fc40..9499cf2e617 100644 --- a/.github/workflows/build-release-zip-file.yml +++ b/.github/workflows/build-release-zip-file.yml @@ -20,8 +20,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9a03638786a..aa94a7df058 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,91 +9,96 @@ concurrency: group: '${{ github.workflow }}-${{ github.ref }}' cancel-in-progress: true jobs: - project-matrix: - # Since this is a monorepo, not every pull request or change is going to impact every project. - # Instead of running CI tasks on all projects indiscriminately, we use a script to detect - # which projects have changed and what kind of change occurred. This lets us build a - # matrix that we can use to run CI tasks only on the projects that need them. - name: 'Build Project Matrix' - runs-on: 'ubuntu-20.04' - outputs: - matrix: ${{ steps.project-matrix.outputs.matrix }} - steps: - - uses: 'actions/checkout@v3' - name: 'Checkout' - with: - fetch-depth: 0 - - uses: './.github/actions/setup-woocommerce-monorepo' - name: 'Setup Monorepo' - with: - install: true - - uses: actions/github-script@v6 - id: 'project-matrix' - name: 'Build Matrix' - with: - script: | - let baseRef = ${{ toJson( github.base_ref ) }}; - if ( baseRef ) { - baseRef = 'origin/' + baseRef; - } - const buildCIMatrix = require( './.github/workflows/scripts/build-ci-matrix' ); - core.setOutput( 'matrix', JSON.stringify( await buildCIMatrix( baseRef ) ) ); - project-task-matrix: - # This is the actual CI job that will be ran against every project with applicable changes. - # Note that we only run the tasks that have commands set. Our script will set them if - # they are needed and so all the workflow needs to do is run them. - name: '${{ matrix.projectName }} - ${{ matrix.taskName }}' # Note: GitHub doesn't process expressions for skipped jobs so when there's no matrix the name will literally be this. - runs-on: 'ubuntu-20.04' - needs: 'project-matrix' - if: ${{ needs.project-matrix.outputs.matrix != '[]' }} - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - include: ${{ fromJSON( needs.project-matrix.outputs.matrix ) }} - steps: - - uses: 'actions/checkout@v3' - name: 'Checkout' - with: - fetch-depth: 0 - - uses: './.github/actions/setup-woocommerce-monorepo' - id: 'setup-monorepo' - name: 'Setup Monorepo' - with: - # install-filters: '${{ matrix.projectName }}...' - build-filters: '${{ matrix.projectName }}' - - name: 'Lint' - if: ${{ !cancelled() && matrix.lintCommand && steps.setup-monorepo.conclusion == 'success' }} - run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.lintCommand }}' - - name: 'Prepare Test Environment' - id: 'prepare-test-environment' - if: ${{ !cancelled() && matrix.testEnvCommand && steps.setup-monorepo.conclusion == 'success' }} - env: ${{ matrix.testEnvVars }} - run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnvCommand }}' - - name: 'Test - JS' - if: ${{ !cancelled() && matrix.jsTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }} - run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.jsTestCommand }}' - - name: 'Test - PHP' - if: ${{ !cancelled() && matrix.phpTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }} - run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.phpTestCommand }}' - project-task-matrix-evaluation: - # In order to add a required status check we need a consistent job that we can grab onto. - # Since we are dynamically generating a project matrix, however, we can't rely on - # on any specific job being present. We can get around this limitation by using - # a job that runs after all the others and either passes or fails based on the - # results of the other jobs in the workflow. - name: 'Evaluate Project Matrix' - runs-on: 'ubuntu-20.04' - needs: 'project-task-matrix' - if: ${{ always() }} - steps: - - name: 'Check Matrix Success' - run: | - result="${{ needs.project-task-matrix.result }}" - if [[ $result == "success" || $result == "skipped" ]]; then - echo "The matrix has completed successfully." - exit 0 - else - echo "One or more jobs in the matrix has failed." - exit 1 - fi + project-matrix: + # Since this is a monorepo, not every pull request or change is going to impact every project. + # Instead of running CI tasks on all projects indiscriminately, we use a script to detect + # which projects have changed and what kind of change occurred. This lets us build a + # matrix that we can use to run CI tasks only on the projects that need them. + name: 'Build Project Matrix' + runs-on: 'ubuntu-20.04' + outputs: + matrix: ${{ steps.project-matrix.outputs.matrix }} + steps: + - uses: 'actions/checkout@v3' + name: 'Checkout' + with: + fetch-depth: 0 + - uses: './.github/actions/setup-woocommerce-monorepo' + with: + php-version: false # We don't want to waste time installing PHP since we aren't using it in this job. + name: 'Setup Monorepo' + - uses: actions/github-script@v6 + id: 'project-matrix' + name: 'Build Matrix' + with: + script: | + let baseRef = ${{ toJson( github.base_ref ) }}; + if ( baseRef ) { + baseRef = 'origin/' + baseRef; + } + const buildCIMatrix = require( './.github/workflows/scripts/build-ci-matrix' ); + core.setOutput( 'matrix', JSON.stringify( await buildCIMatrix( baseRef ) ) ); + project-task-matrix: + # This is the actual CI job that will be ran against every project with applicable changes. + # Note that we only run the tasks that have commands set. Our script will set them if + # they are needed and so all the workflow needs to do is run them. + name: '${{ matrix.projectName }} - ${{ matrix.taskName }}' # Note: GitHub doesn't process expressions for skipped jobs so when there's no matrix the name will literally be this. + runs-on: 'ubuntu-20.04' + needs: 'project-matrix' + if: ${{ needs.project-matrix.outputs.matrix != '[]' }} + strategy: + fail-fast: false + matrix: + include: ${{ fromJSON( needs.project-matrix.outputs.matrix ) }} + steps: + - uses: 'actions/checkout@v3' + name: 'Checkout' + with: + fetch-depth: 0 + - uses: './.github/actions/setup-woocommerce-monorepo' + id: 'setup-monorepo' + name: 'Setup Monorepo' + with: + install: '${{ matrix.projectName }}...' + build: '${{ matrix.projectName }}' + - name: 'Lint' + if: ${{ ! cancelled() && matrix.lintCommand && steps.setup-monorepo.conclusion == 'success' }} + run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.lintCommand }}' + - name: 'Prepare Test Environment' + id: 'prepare-test-environment' + if: ${{ ! cancelled() && matrix.testEnvCommand && steps.setup-monorepo.conclusion == 'success' }} + env: ${{ matrix.testEnvVars }} + run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnvCommand }}' + - name: 'Test - JS' + if: ${{ ! cancelled() && matrix.jsTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }} + run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.jsTestCommand }}' + - name: 'Test - PHP' + if: ${{ ! cancelled() && matrix.phpTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }} + run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.phpTestCommand }}' + project-task-matrix-evaluation: + # In order to add a required status check we need a consistent job that we can grab onto. + # Since we are dynamically generating a project matrix, however, we can't rely on + # on any specific job being present. We can get around this limitation by using + # a job that runs after all the others and either passes or fails based on the + # results of the other jobs in the workflow. + name: 'Evaluate Project Matrix' + runs-on: 'ubuntu-20.04' + needs: [ + 'project-matrix', + 'project-task-matrix' + ] + if: ${{ always() }} + steps: + - name: 'Check Matrix Success' + run: | + result="${{ needs.project-matrix.result }}" + if [[ $result != "success" && $result != "skipped" ]]; then + echo "An error occurred generating the CI matrix." + exit 1 + fi + result="${{ needs.project-task-matrix.result }}" + if [[ $result != "success" && $result != "skipped" ]]; then + echo "One or more jobs in the matrix has failed." + exit 1 + fi + echo "The matrix has completed successfully." diff --git a/.github/workflows/hpos-build-and-e2e-tests-daily.yml b/.github/workflows/hpos-build-and-e2e-tests-daily.yml index f7230198e2a..06627e6b378 100644 --- a/.github/workflows/hpos-build-and-e2e-tests-daily.yml +++ b/.github/workflows/hpos-build-and-e2e-tests-daily.yml @@ -24,12 +24,15 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers with HPOS enabled. working-directory: plugins/woocommerce env: ENABLE_HPOS: 1 - run: pnpm env:test:cot --filter=woocommerce + run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:cot - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -80,12 +83,15 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers with HPOS enabled. working-directory: plugins/woocommerce env: ENABLE_HPOS: 1 - run: pnpm env:test:cot --filter=woocommerce + run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:cot - name: Run Playwright API tests. id: run_playwright_api_tests diff --git a/.github/workflows/mirrors.yml b/.github/workflows/mirrors.yml index 37ccec1fec0..e0eb15cc71f 100644 --- a/.github/workflows/mirrors.yml +++ b/.github/workflows/mirrors.yml @@ -18,8 +18,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/nightly-builds.yml b/.github/workflows/nightly-builds.yml index 64903cb5075..5f5427257a0 100644 --- a/.github/workflows/nightly-builds.yml +++ b/.github/workflows/nightly-builds.yml @@ -24,8 +24,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/non-cot-pr-build-and-e2e-tests.yml b/.github/workflows/non-cot-pr-build-and-e2e-tests.yml index f54fc1dce89..3ed9fc4ae18 100644 --- a/.github/workflows/non-cot-pr-build-and-e2e-tests.yml +++ b/.github/workflows/non-cot-pr-build-and-e2e-tests.yml @@ -23,10 +23,13 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers working-directory: plugins/woocommerce - run: pnpm env:test --filter=woocommerce + run: pnpm --filter='@woocommerce/plugin-woocommerce' env:test - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -78,10 +81,13 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers working-directory: plugins/woocommerce - run: pnpm env:test --filter=woocommerce + run: pnpm --filter='@woocommerce/plugin-woocommerce' env:test - name: Run Playwright API tests. id: run_playwright_api_tests diff --git a/.github/workflows/package-release.yml b/.github/workflows/package-release.yml index 7f35f937044..7c9b035d882 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -24,6 +24,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: true + build: './tools/package-release' - name: Clean working directory run: git checkout pnpm-lock.yaml # in case for whatever reason the lockfile is out of sync, there won't be interference with npm publish. diff --git a/.github/workflows/pr-build-and-e2e-tests.yml b/.github/workflows/pr-build-and-e2e-tests.yml index 0a2b8d2ae60..41f0149e107 100644 --- a/.github/workflows/pr-build-and-e2e-tests.yml +++ b/.github/workflows/pr-build-and-e2e-tests.yml @@ -27,12 +27,15 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers. working-directory: plugins/woocommerce env: WP_ENV_PHP_VERSION: 7.4 - run: pnpm run env:test + run: pnpm env:test - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -94,12 +97,15 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers. working-directory: plugins/woocommerce env: ENABLE_HPOS: 0 - run: pnpm env:test --filter=woocommerce + run: pnpm --filter=@woocommerce/plugin-woocommerce env:test - name: Run Playwright API tests. id: run_playwright_api_tests @@ -144,14 +150,17 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Load docker images and start containers. working-directory: plugins/woocommerce env: ENABLE_HPOS: 0 run: | - pnpm env:dev --filter=woocommerce - pnpm env:performance-init --filter=woocommerce + pnpm --filter=@woocommerce/plugin-woocommerce env:dev + pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init - name: Install k6 run: | diff --git a/.github/workflows/pr-build-live-branch.yml b/.github/workflows/pr-build-live-branch.yml index 220c7ce3b75..8cc44f98767 100644 --- a/.github/workflows/pr-build-live-branch.yml +++ b/.github/workflows/pr-build-live-branch.yml @@ -31,8 +31,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Prepare plugin zips id: prepare diff --git a/.github/workflows/pr-highlight-changes.yml b/.github/workflows/pr-highlight-changes.yml index 8a9ddabdc7f..c2dea8419c1 100644 --- a/.github/workflows/pr-highlight-changes.yml +++ b/.github/workflows/pr-highlight-changes.yml @@ -28,8 +28,8 @@ jobs: working-directory: tools/code-analyzer run: | HEAD_REF=$(git rev-parse HEAD) - version=$(pnpm run analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1) - pnpm run analyzer "$HEAD_REF" $version -o "github" + version=$(pnpm analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1) + pnpm analyzer "$HEAD_REF" $version -o "github" - name: Check results uses: actions/github-script@v6 with: diff --git a/.github/workflows/pr-lint-monorepo.yml b/.github/workflows/pr-lint-monorepo.yml index 684e8ca1ebd..4a1e72224e4 100644 --- a/.github/workflows/pr-lint-monorepo.yml +++ b/.github/workflows/pr-lint-monorepo.yml @@ -24,8 +24,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Check change files are touched for touched projects env: @@ -34,4 +32,4 @@ jobs: run: php tools/monorepo/check-changelogger-use.php --debug "$BASE" "$HEAD" - name: Run changelog validation - run: pnpm run -r changelog validate + run: pnpm -r changelog validate diff --git a/.github/workflows/pr-smoke-test.yml b/.github/workflows/pr-smoke-test.yml index 897433e8936..23ea248e5cb 100644 --- a/.github/workflows/pr-smoke-test.yml +++ b/.github/workflows/pr-smoke-test.yml @@ -26,6 +26,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Install Jest run: pnpm install -g jest diff --git a/.github/workflows/prepare-package-release.yml b/.github/workflows/prepare-package-release.yml index 0466ea59cf7..237b49afbdd 100644 --- a/.github/workflows/prepare-package-release.yml +++ b/.github/workflows/prepare-package-release.yml @@ -23,6 +23,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: true + build: './tools/package-release' - name: Execute script run: ./tools/package-release/bin/dev prepare ${{ github.event.inputs.packages }} diff --git a/.github/workflows/release-code-freeze.yml b/.github/workflows/release-code-freeze.yml index d5d883a6e77..00d07c06ee4 100644 --- a/.github/workflows/release-code-freeze.yml +++ b/.github/workflows/release-code-freeze.yml @@ -74,35 +74,35 @@ jobs: if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze milestone -o ${{ github.repository_owner }} -m ${{ steps.get-versions.outputs.monthlyMilestone }} + run: pnpm utils code-freeze milestone -o ${{ github.repository_owner }} -m ${{ steps.get-versions.outputs.monthlyMilestone }} - name: Create next monthly release branch id: branch if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} + run: pnpm utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} - name: Create next accelerated release branch id: branch-accel if: steps.get-versions.outputs.isTodayAcceleratedFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} + run: pnpm utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} - name: Bump versions for Beta.1 monthly release id: version-bump if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} -c ${{ steps.get-versions.outputs.monthlyVersion }}-beta.1 + run: pnpm utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} -c ${{ steps.get-versions.outputs.monthlyVersion }}-beta.1 - name: Bump versions for accelerated release id: version-bump-accel if: steps.get-versions.outputs.isTodayAcceleratedFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} -c ${{ steps.get-versions.outputs.acceleratedVersion }} -af + run: pnpm utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} -c ${{ steps.get-versions.outputs.acceleratedVersion }} -af - name: Prep accelerated release id: accel-release-prep @@ -116,14 +116,14 @@ jobs: if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze version-bump ${{ steps.get-versions.outputs.monthlyMilestone }}-dev -o ${{ github.repository_owner }} + run: pnpm utils code-freeze version-bump ${{ steps.get-versions.outputs.monthlyMilestone }}-dev -o ${{ github.repository_owner }} - name: Generate changelog changes id: changelog if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: pnpm run utils code-freeze changelog -c -o ${{ github.repository_owner }} -v ${{ steps.get-versions.outputs.monthlyVersionXY }} + run: pnpm utils code-freeze changelog -c -o ${{ github.repository_owner }} -v ${{ steps.get-versions.outputs.monthlyVersionXY }} notify-slack: @@ -182,8 +182,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Build zip working-directory: plugins/woocommerce @@ -212,8 +210,6 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo - with: - build: false - name: Build zip working-directory: plugins/woocommerce diff --git a/.github/workflows/release-wc-beta-tester.yml b/.github/workflows/release-wc-beta-tester.yml index 84ed3387e46..1b9b74c7257 100644 --- a/.github/workflows/release-wc-beta-tester.yml +++ b/.github/workflows/release-wc-beta-tester.yml @@ -19,6 +19,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce-beta-tester' - name: Lint working-directory: plugins/woocommerce-beta-tester diff --git a/.github/workflows/smoke-test-daily.yml b/.github/workflows/smoke-test-daily.yml index ca97caa9d76..a2c125b037d 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -32,6 +32,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Setup local test environment uses: ./.github/actions/tests/setup-local-test-environment @@ -89,6 +92,9 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Setup local test environment uses: ./.github/actions/tests/setup-local-test-environment @@ -141,8 +147,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install-filters: woocommerce - build: false + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Update performance test site with E2E test id: update-perf-site @@ -218,7 +224,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - build-filters: woocommerce + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Setup local test environment uses: ./.github/actions/tests/setup-local-test-environment diff --git a/.github/workflows/smoke-test-pr-merge.yml b/.github/workflows/smoke-test-pr-merge.yml index 60720ea8454..633accdb418 100644 --- a/.github/workflows/smoke-test-pr-merge.yml +++ b/.github/workflows/smoke-test-pr-merge.yml @@ -28,7 +28,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - build-filters: woocommerce + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Setup local test environment uses: ./.github/actions/tests/setup-local-test-environment @@ -89,7 +90,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - build-filters: woocommerce + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Setup local test environment uses: ./.github/actions/tests/setup-local-test-environment diff --git a/.github/workflows/smoke-test-release.yml b/.github/workflows/smoke-test-release.yml index 0371d3972d3..f9d3c49f4fb 100644 --- a/.github/workflows/smoke-test-release.yml +++ b/.github/workflows/smoke-test-release.yml @@ -54,8 +54,7 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install-filters: woocommerce - build: false + install: '@woocommerce/plugin-woocommerce...' - name: Run E2E tests id: run-e2e-composite-action @@ -130,8 +129,7 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install-filters: woocommerce - build: false + install: '@woocommerce/plugin-woocommerce...' - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -204,8 +202,7 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install-filters: woocommerce - build: false + install: '@woocommerce/plugin-woocommerce...' - name: Run E2E tests id: run-e2e-composite-action @@ -320,11 +317,12 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - build-filters: woocommerce + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Launch WP Env working-directory: plugins/woocommerce - run: pnpm run env:test + run: pnpm env:test env: WP_ENV_CORE: WordPress/WordPress#${{ steps.get-wp-latest-1.outputs.version }} @@ -462,13 +460,14 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - build-filters: woocommerce + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Launch WP Env working-directory: plugins/woocommerce env: WP_ENV_PHP_VERSION: ${{ matrix.php_version }} - run: pnpm run env:test + run: pnpm env:test - name: Verify PHP version working-directory: .github/workflows/scripts @@ -626,11 +625,12 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - build-filters: woocommerce + install: '@woocommerce/plugin-woocommerce...' + build: '@woocommerce/plugin-woocommerce' - name: Launch WP Env working-directory: plugins/woocommerce - run: pnpm run env:test + run: pnpm env:test - name: Download release zip id: download-zip diff --git a/.github/workflows/syncpack.yml b/.github/workflows/syncpack.yml index 3406ae02aee..8f7e92fe4e2 100644 --- a/.github/workflows/syncpack.yml +++ b/.github/workflows/syncpack.yml @@ -33,5 +33,5 @@ jobs: - name: 'Explain Remedy' if: failure() run: | - echo "Dependency version mismatch detected. This can usually be fixed automatically by updating the pinned version in \`.syncpackrc\` and then running: \`pnpm run sync-dependencies\`" + echo "Dependency version mismatch detected. This can usually be fixed automatically by updating the pinned version in \`.syncpackrc\` and then running: \`pnpm sync-dependencies\`" exit 1 diff --git a/.gitignore b/.gitignore index ed180664a57..b89e5cc5990 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ build-style/ build-style.js build-types/ dist/ +oclif.manifest.json # Project files node_modules/ @@ -94,8 +95,9 @@ allure-results changes.json .env -# Turborepo +# Build Cache .turbo +.wireit # Support .gitkeep Files !.gitkeep diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs new file mode 100644 index 00000000000..6bafa1bc4f3 --- /dev/null +++ b/.pnpmfile.cjs @@ -0,0 +1,256 @@ +/** + * External dependencies. + */ +const fs = require( 'fs' ); +const path = require( 'path' ); + +// A cache for package files so that we don't keep loading them unnecessarily. +const packageFileCache = {}; + +/** + * Loads a package file or pull it from the cache. + * + * @param {string} packagePath The path to the package directory. + * + * @return {Object} The package file. + */ +function loadPackageFile( packagePath ) { + // Resolve the absolute path for consistency when loading and updating. + packagePath = path.resolve( __dirname, packagePath ); + + if ( packageFileCache[ packagePath ] ) { + return packageFileCache[ packagePath ]; + } + + const packageFile = JSON.parse( + fs.readFileSync( path.join( packagePath, 'package.json' ), 'utf8' ) + ); + + packageFileCache[ packagePath ] = packageFile; + return packageFile; +} + +/** + * Updates a package file on disk and in the cache. + * + * @param {string} packagePath The path to the package file to update. + * @param {Object} packageFile The new package file contents. + */ +function updatePackageFile( packagePath, packageFile ) { + // Resolve the absolute path for consistency when loading and updating. + packagePath = path.resolve( __dirname, packagePath ); + + packageFileCache[ packagePath ] = packageFile; + + fs.writeFileSync( + path.join( packagePath, 'package.json' ), + // Make sure to keep the newline at the end of the file. + JSON.stringify( packageFile, null, '\t' ) + "\n", + 'utf8' + ); +} + +/** + * Gets the outputs for a given package. + * + * @param {string} packageFile The package file to read file outputs from. + * + * @return {Object.} The include and exclude globs describing the package's files. + */ +function getPackageOutputs( packageFile ) { + // All of the outputs should be relative to the package's path instead of the monorepo root. + // This is how wireit expects the files to be configured. + const basePath = path.join( 'node_modules', packageFile.name ); + + // We're going to construct the package outputs according to the same rules that NPM follows when packaging. + // Note: In order to work with wireit optimally we need to put the excludes at the very end of the list. + const packageOutputs = { + include: [], + exclude: [], + }; + + // Packages that explicitly declare their outputs have made this easy for us. + if ( packageFile.files ) { + // We're going to make the glob relative to the package directory instead of the dependency directory. + // To do this though, we need to transform the path a little bit. + for ( const fileGlob of packageFile.files ) { + let relativeGlob = fileGlob; + + // Negation globs need to move the exclamation point to the beginning of the output glob. + let negation = relativeGlob.startsWith( '!' ) ? true : false; + if ( negation ) { + relativeGlob = relativeGlob.substring( 1 ); + } + + // Remove leading slashes. + if ( relativeGlob.startsWith( '/' ) ) { + relativeGlob = relativeGlob.substring( 1 ); + } + + // Now we can construct a glob relative to the package directory. + if ( negation ) { + packageOutputs.exclude.push( `!${ basePath }/${ relativeGlob }` ); + } else { + packageOutputs.include.push( `${ basePath }/${ relativeGlob }` ); + } + } + } else { + // This is a VERY heavy-handed approach and will simply include every file in the package directory. + packageOutputs.include.push( `${ basePath }/` ); + + // We can make this a little bit smarter by ignoring some common directories. + packageOutputs.exclude.push( `!${ basePath }/node_modules` ); + packageOutputs.exclude.push( `!${ basePath }/.git` ); + packageOutputs.exclude.push( `!${ basePath }/.svn` ); + packageOutputs.exclude.push( `!${ basePath }/src` ); // We generally name our source directories "src" and don't need source files. + } + + return packageOutputs; +} + +/** + * Checks to see if a package is linked and returns the path if it is. + * + * @param {string} packagePath The path to the package we're checking. + * @param {string} lockVersion The package version from the lock file. + * + * @return {string|false} Returns the linked package path or false if the package is not linked. + */ +function isLinkedPackage( packagePath, lockVersion ) { + // We can parse the version that PNPM stores in order to get the relative path to the package. + // file: dependencies use a relative path with dependencies listed in parentheses after it. + // workspace: dependencies just store the relative path from the package itself. + const match = lockVersion.match( /^(?:file:|link:)((?:\.?\/|\.\.\/)[^\^<>:"|?*()]+)/i ); + if ( ! match ) { + return false; + } + + let relativePath = match[ 1 ]; + + // Linked paths are relative to the package instead of the monorepo. + if ( lockVersion.startsWith( 'link:' ) ) { + relativePath = path.join( packagePath, relativePath ); + } + + return relativePath; +} + +/** + * Gets the paths to any packages linked in the lock file. + * + * @param {string} packagePath The path to the package to check. + * @param {Object} lockPackage The package information from the lock file. + * + * @return {Array.} The linked package file keyed by the relative path to the package. + */ +function getLinkedPackages( packagePath, lockPackage ) { + // Include both the dependencies and devDependencies in the list of packages to check. + const possiblePackages = Object.assign( + {}, + lockPackage.dependencies || {}, + lockPackage.devDependencies || {} + ); + + // We need to check all of the possible packages and figure out whether or not they're linked. + const linkedPackages = {}; + for ( const packageName in possiblePackages ) { + const linkedPackagePath = isLinkedPackage( + packagePath, + possiblePackages[ packageName ], + ); + if ( ! linkedPackagePath ) { + continue; + } + + // Load the linked package file and mark it as a dependency. + linkedPackages[ linkedPackagePath ] = + loadPackageFile( linkedPackagePath ); + } + + return Object.values( linkedPackages ); +} + +/** + * Hooks up all of the dependency outputs as file dependencies for wireit to fingerprint them. + * + * @param {Object.} lockPackages The paths to all of the packages we're processing. + * @param {Object} context The hook context object. + * @param {Function.} context.log Logs a message to the console. + */ +function updateWireitDependencies( lockPackages, context ) { + context.log( '[wireit] Updating Dependency Lists' ); + + // Rather than using wireit for task orchestration we are going to rely on PNPM in order to provide a more consistent developer experience. + // In order to achieve this, however, we need to make sure that all of the dependencies are included in the fingerprint. If we don't, then + // changes in dependency packages won't invalidate the cache and downstream packages won't be rebuilt unless they themselves change. This + // is problematic because it means that we can't rely on the cache to be up to date and we'll have to rebuild everything every time. + for ( const packagePath in lockPackages ) { + const packageFile = loadPackageFile( packagePath ); + + // We only care about packages using wireit. + if ( ! packageFile.wireit ) { + continue; + } + + context.log( `[wireit][${ packageFile.name }] Updating Configuration` ); + + // Only the packages that are linked need to be considered. The packages installed from the + // registry are already included in the fingerprint by their very nature. If they are + // changed then the lock file will be updated and the fingerprint will change too. + const linkedPackages = getLinkedPackages( + packagePath, + lockPackages[ packagePath ], + ); + + // In order to make maintaining the list easy we use a wireit-only script named "dependencies" to keep the list up to date. + // This is an automatically generated script and that we own and so we should make sure it's always as-expected. + packageFile.wireit.dependencyOutputs = { + // This is needed so we can reference files in `node_modules`. + allowUsuallyExcludedPaths: true, + + // The files list will include globs for dependency files that we should fingerprint. + files: [ "package.json" ], + }; + + // We're going to spin through all of the dependencies for the package and add + // their outputs to the list. We can then use these are file dependencies for + // wireit and it will fingerprint them for us. + for ( const linkedPackage of linkedPackages ) { + const packageOutputs = getPackageOutputs( linkedPackage ); + // Put includes at the front and excludes at the end. This is important because otherwise + // wireit will blow the call stack due to the way it handles negation globs. + packageFile.wireit.dependencyOutputs.files.unshift( ...packageOutputs.include ); + packageFile.wireit.dependencyOutputs.files.push( ...packageOutputs.exclude ); + + context.log( + `[wireit][${ packageFile.name }] Added '${ linkedPackage.name }' Outputs` + ); + } + updatePackageFile( packagePath, packageFile ); + } + + context.log( '[wireit] Done' ); +} + +/** + * This hook allows for the mutation of the lockfile before it is serialized. + * + * @param {Object} lockfile The lock file that was produced by PNPM. + * @param {string} lockfile.lockfileVersion The version of the lock file spec. + * @param {Object.} lockfile.importers The packages in the workspace that are included in the lock file, keyed by the relative path to the package. + * @param {Object} context The hook context object. + * @param {Function.} context.log Logs a message to the console. + * + * @return {Object} lockfile The updated lockfile. + */ +function afterAllResolved( lockfile, context ) { + updateWireitDependencies( lockfile.importers, context ); + return lockfile; +} + +// Note: The hook function names are important. They are used by PNPM when determining what functions to call. +module.exports = { + hooks: { + afterAllResolved, + }, +}; diff --git a/.syncpackrc b/.syncpackrc index 49a7bc1aff0..99a4319a421 100644 --- a/.syncpackrc +++ b/.syncpackrc @@ -116,7 +116,7 @@ "packages": [ "@woocommerce/block-templates", "@woocommerce/product-editor", - "woocommerce/client/admin", + "@woocommerce/admin-library", "@woocommerce/components" ], "isIgnored": true @@ -224,6 +224,15 @@ ], "pinVersion": "~29.1.1" }, + { + "dependencies": [ + "wireit" + ], + "packages": [ + "**" + ], + "pinVersion": "^0.14.1" + }, { "label": "Only manage versions for these dependencies", "dependencies": [ diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index cb3671f4066..f6b77a94530 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -6,70 +6,47 @@ This document aims to provide as much context as possible to aid in the developm Please refer to [the Getting Started section of the `README.md`](README.md#getting-started) for a general-purpose guide on getting started. The rest of this document will assume that you've installed all of the prequisites and setup described there. -## Turborepo Commands - -Our repository uses [Turborepo](https://turborepo.org) for `build` and `test` commands. This tool ensures that all dependencies of a plugin, package, or tool are prepared before running a command. This is done transparently when running these commands. When using `pnpm run {command}` without any options, it will execute that command against every project in the repository. You can view a list of the commands Turborepo supports in [our turbo.json file](turbo.json). - ### Plugin, Package, and Tool Filtering -If you are interested in running a `turbo` command against a single plugin, package, or tool, you can do so with the `--filter` flag. This flag supports the `"name"` option in `package.json` files, paths, and globs. - -If you would like to read more about the syntax, please check out [the Turborepo filtering documentation](https://turborepo.org/docs/core-concepts/filtering). +In order to run commands on individual projects you will need to utilize [PNPM's --filter flag](https://pnpm.io/filtering). This flag supports `"name"` option in `package.json`, paths, and globs. ### Examples -Here are some examples of the ways you can use Turborepo / pnpm commands: +Here are some examples of the ways you can use `pnpm` commands: ```bash -# Lint and build all plugins, packages, and tools. Note the use of `-r` for lint, -# turbo does not run the lint at this time. -pnpm run -r lint && pnpm run build +# Lint and build all plugins, packages, and tools. +pnpm lint && pnpm build # Build WooCommerce Core and all of its dependencies -pnpm run --filter='woocommerce' build +pnpm --filter='@woocommerce/plugin-woocommerce' build -# Lint the @woocommerce/components package - note the different argument order, turbo scripts -# are not running lints at this point in time. -pnpm run -r --filter='@woocommerce/components' lint +# Lint the @woocommerce/components package +pnpm --filter='@woocommerce/components' lint # Test all of the @woocommerce scoped packages -pnpm run --filter='@woocommerce/*' test +pnpm --filter='@woocommerce/*' test # Build all of the JavaScript packages -pnpm run --filter='./packages/js/*' build +pnpm --filter='./packages/js/*' build # Build everything except WooCommerce Core -pnpm run --filter='!woocommerce' build +pnpm --filter='!@woocommerce/plugin-woocommerce' build # Build everything that has changed since the last commit -pnpm run --filter='[HEAD^1]' build +pnpm --filter='[HEAD^1]' build ``` -### Cache busting Turbo - -In the event that you need to force turbo not to cache a command you can set the env variable `TURBO_FORCE=true`. - -e.g. - -```bash -# Force an uncached build of WooCommerce Core and all of its dependencies -TURBO_FORCE=true pnpm run --filter='woocommerce' build -``` - -## Other Commands - -Outside of the commands in [our turbo.json file](turbo.json), each plugin, package, and tool may have unique scripts in their `package.json` files. In these cases, you can execute those commands using `pnpm {script}` and the same `--filter` syntax as Turborepo. - ### Examples Here are some examples of the commands you will make use of. ```bash # Add a changelog entry for WooCommerce Core -pnpm --filter=woocommerce run changelog add +pnpm --filter='@woocommerce/plugin-woocommerce' changelog add # Create the woocommerce.zip file -pnpm --filter=woocommerce run build:zip +pnpm --filter='@woocommerce/plugin-woocommerce' build:zip ``` ## Plugin Development Environments diff --git a/README.md b/README.md index fbbbb99413e..94f77e93f74 100644 --- a/README.md +++ b/README.md @@ -25,10 +25,10 @@ nvm use # Install the PHP and Composer dependencies for all of the plugins, packages, and tools pnpm install # Build all of the plugins, packages, and tools in the monorepo -pnpm run build +pnpm build ``` -At this point you are now ready to begin developing and testing. All of the build outputs are cached running `pnpm run build` again will only build the plugins, packages, and tools that have changed since the last time you ran the command. +At this point you are now ready to begin developing and testing. All of the build outputs are cached running `pnpm build` again will only build the plugins, packages, and tools that have changed since the last time you ran the command. Check out [our development guide](DEVELOPMENT.md) if you would like a more comprehensive look at working in our repository. diff --git a/bin/pre-push.sh b/bin/pre-push.sh index 563b74c3f48..ec1147be3e7 100755 --- a/bin/pre-push.sh +++ b/bin/pre-push.sh @@ -27,7 +27,7 @@ pnpm exec syncpack -- list-mismatches if [ $? -ne 0 ]; then echo "You must sync the dependencies listed above before you can push this branch." - echo "This can usually be accomplished automatically by updating the pinned version in \`.syncpackrc\` and then running \`pnpm run sync-dependencies\`." + echo "This can usually be accomplished automatically by updating the pinned version in \`.syncpackrc\` and then running \`pnpm sync-dependencies\`." exit 1 fi diff --git a/docs/contributing/minification-of-SCSS-and-JS.md b/docs/contributing/minification-of-SCSS-and-JS.md index c59b27fd417..40cf120ff7c 100644 --- a/docs/contributing/minification-of-SCSS-and-JS.md +++ b/docs/contributing/minification-of-SCSS-and-JS.md @@ -7,7 +7,7 @@ post_title: Minification of SCSS and JS When updating SCSS files in the WooCommerce project, please **commit only your changes to unminified SCSS files**. The minification will be handled as part of the release process. -To get the minified CSS files, run `pnpm -- turbo run build --filter='woocommerce-legacy-assets'` from the repository root directory. To set up the development environment from scratch, see the section on [how to install dependencies and generate assets](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment#install-dependencies-and-generate-assets) in the guide to set up a WooCommerce development environment. +To get the minified CSS files, run `pnpm --filter='@woocommerce/shortcode-assets' build` from the repository root directory. To set up the development environment from scratch, see the section on [how to install dependencies and generate assets](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment#install-dependencies-and-generate-assets) in the guide to set up a WooCommerce development environment. ## Javascript diff --git a/docs/extension-development/development-environment.md b/docs/extension-development/development-environment.md index 3018c983368..84cf4f3b89f 100644 --- a/docs/extension-development/development-environment.md +++ b/docs/extension-development/development-environment.md @@ -99,7 +99,7 @@ pnpm install && composer install ### Build WooCommerce ```sh -pnpm run build +pnpm build ``` Running this script will compile the JavaScript and CSS that WooCommerce needs to operate. If you try to run WooCommerce on your server without generating the compiled assets, you may experience errors and other unwanted side-effects. diff --git a/package.json b/package.json index fe0870840c0..ce35cda5e13 100644 --- a/package.json +++ b/package.json @@ -1,40 +1,43 @@ { "name": "woocommerce-monorepo", - "title": "WooCommerce Monorepo", + "private": true, "description": "Monorepo for the WooCommerce ecosystem", "homepage": "https://woo.com/", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, - "private": true, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "author": "Automattic", "license": "GPL-3.0-or-later", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "author": "Automattic", "bin": { "utils": "./tools/monorepo-utils/bin/run" }, "scripts": { - "build": "pnpm exec turbo run turbo:build", - "test": "pnpm exec turbo run turbo:test", + "build": "pnpm -r build", + "cherry-pick": "node ./tools/cherry-pick/bin/run", "clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i", + "create-extension": "node ./tools/create-extension/index.js", + "git:update-hooks": "if test -d .git; then rm -r .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi", "preinstall": "npx only-allow pnpm", "postinstall": "pnpm git:update-hooks", - "git:update-hooks": "if test -d .git; then rm -r .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi", - "create-extension": "node ./tools/create-extension/index.js", - "cherry-pick": "node ./tools/cherry-pick/bin/run", + "lint": "pnpm -r lint", "sync-dependencies": "pnpm exec syncpack -- fix-mismatches", + "test": "pnpm -r test", "utils": "node ./tools/monorepo-utils/dist/index.js" }, + "dependencies": { + "@babel/core": "7.12.9", + "@wordpress/babel-plugin-import-jsx-pragma": "^3.2.0", + "@wordpress/babel-preset-default": "^6.17.0", + "lodash": "^4.17.21", + "wp-textdomain": "1.0.1" + }, "devDependencies": { - "@babel/preset-env": "^7.20.2", - "@babel/runtime": "^7.21.0", + "@babel/preset-env": "^7.23.3", + "@babel/runtime": "^7.23.4", "@types/node": "^16.18.18", "@woocommerce/eslint-plugin": "workspace:*", "@wordpress/data": "wp-6.0", @@ -43,8 +46,8 @@ "babel-loader": "^8.3.0", "chalk": "^4.1.2", "copy-webpack-plugin": "^10.2.4", - "core-js": "^3.29.1", - "css-loader": "^6.7.3", + "core-js": "^3.33.3", + "css-loader": "^6.8.1", "glob": "^7.2.3", "husky": "^7.0.4", "jest": "~27.5.1", @@ -56,20 +59,16 @@ "prettier": "npm:wp-prettier@^2.8.5", "regenerator-runtime": "^0.13.11", "request": "^2.88.2", - "sass": "^1.59.3", + "sass": "^1.69.5", "sass-loader": "^10.4.1", - "syncpack": "^10.7.3", - "turbo": "^1.10.7", + "syncpack": "^10.9.3", "typescript": "^5.1.6", "url-loader": "^1.1.2", - "webpack": "^5.76.2" + "webpack": "^5.89.0" }, - "dependencies": { - "@babel/core": "7.12.9", - "@wordpress/babel-plugin-import-jsx-pragma": "^3.2.0", - "@wordpress/babel-preset-default": "^6.17.0", - "lodash": "^4.17.21", - "wp-textdomain": "1.0.1" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "pnpm": { "overrides": { @@ -77,5 +76,6 @@ "react": "^17.0.2", "react-resize-aware": "3.1.1" } - } + }, + "title": "WooCommerce Monorepo" } diff --git a/packages/js/README.md b/packages/js/README.md index 5c7dfe15136..5ad5e36e336 100644 --- a/packages/js/README.md +++ b/packages/js/README.md @@ -60,8 +60,7 @@ To create a new package, add a new folder to `/packages`, containing… - Package description - Installation details - Usage example -4. A `src` directory for the source of your module, which will be built by default using the `pnpm run turbo:build` command. Note that you'll want an `index.js` file that exports the package contents, see other packages for examples. - +4. A `src` directory for the source of your module. Note that you'll want an `index.js` file that exports the package contents, see other packages for examples. 5. A blank Changelog file, `changelog.md`. ``` diff --git a/packages/js/admin-e2e-tests/package.json b/packages/js/admin-e2e-tests/package.json index 0ee64540a9f..3e0541ae519 100644 --- a/packages/js/admin-e2e-tests/package.json +++ b/packages/js/admin-e2e-tests/package.json @@ -1,22 +1,19 @@ { "name": "@woocommerce/admin-e2e-tests", "version": "1.0.0", - "author": "Automattic", "description": "E2E tests for the new WooCommerce interface.", - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/admin-e2e-tests/README.md", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "repository": { - "type": "git", - "url": "https://github.com/woocommerce/woocommerce.git" - }, "keywords": [ "woocommerce", "e2e" ], + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/admin-e2e-tests/README.md", + "repository": { + "type": "git", + "url": "https://github.com/woocommerce/woocommerce.git" + }, "license": "GPL-3.0+", + "author": "Automattic", + "sideEffects": false, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -24,18 +21,29 @@ "!*.ts.map", "!*.tsbuildinfo" ], - "sideEffects": false, + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:typescript": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix:lang:js" + ] + }, "dependencies": { "@jest/globals": "^27.5.1", "@types/jest": "^27.4.1", "@woocommerce/e2e-utils": "workspace:*", "config": "3.3.7" }, - "peerDependencies": { - "@woocommerce/e2e-environment": "^0.2.3 || ^0.3.0", - "@woocommerce/e2e-utils": "^0.2.0", - "puppeteer": "^2.0.0" - }, "devDependencies": { "@babel/core": "^7.17.5", "@types/config": "0.0.41", @@ -50,25 +58,54 @@ "jest-mock-extended": "^1.0.18", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "peerDependencies": { + "@woocommerce/e2e-environment": "^0.2.3 || ^0.3.0", + "@woocommerce/e2e-utils": "^0.2.0", + "puppeteer": "^2.0.0" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "publishConfig": { "access": "public" }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "start": "tsc --project tsconfig.json --watch", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "lint:fix": "eslint src --fix", - "prepack": "pnpm run clean && pnpm run build" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "wireit": { + "build:project:typescript": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/e2e-environment/", + "node_modules/@woocommerce/e2e-utils/", + "package.json", + "!node_modules/@woocommerce/e2e-utils/node_modules", + "!node_modules/@woocommerce/e2e-utils/.git", + "!node_modules/@woocommerce/e2e-utils/.svn", + "!node_modules/@woocommerce/e2e-utils/src", + "!node_modules/@woocommerce/e2e-environment/node_modules", + "!node_modules/@woocommerce/e2e-environment/.git", + "!node_modules/@woocommerce/e2e-environment/.svn", + "!node_modules/@woocommerce/e2e-environment/src" + ] + } } } diff --git a/packages/js/admin-layout/package.json b/packages/js/admin-layout/package.json index ca3675518a8..77bb4aaff22 100644 --- a/packages/js/admin-layout/package.json +++ b/packages/js/admin-layout/package.json @@ -2,43 +2,46 @@ "name": "@woocommerce/admin-layout", "version": "1.0.0", "description": "WooCommerce admin layout copmonents and utilities.", - "author": "Automattic", - "license": "GPL-2.0-or-later", "keywords": [ "wordpress", "woocommerce" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/admin-layout/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "main": "build/index.js", - "module": "build-module/index.js", - "types": "build-types", - "react-native": "src/index", + "license": "GPL-2.0-or-later", + "author": "Automattic", "sideEffects": [ "build-style/**", "src/**/*.scss" ], - "publishConfig": { - "access": "public" - }, + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", + "types": "build-types", "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "watch:build": "pnpm build:project --watch" + }, + "dependencies": { + "@woocommerce/components": "workspace:*", + "@wordpress/components": "wp-6.0", + "@wordpress/element": "wp-6.0" }, "devDependencies": { "@types/react": "^17.0.2", @@ -59,16 +62,78 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, "peerDependencies": { "@types/react": "^17.0.2", "react": "^17.0.2", "react-dom": "^17.0.2" }, - "dependencies": { - "@woocommerce/components": "workspace:*", - "@wordpress/components": "wp-6.0", - "@wordpress/element": "wp-6.0" + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/components/", + "package.json", + "!node_modules/@woocommerce/components/node_modules", + "!node_modules/@woocommerce/components/.git", + "!node_modules/@woocommerce/components/.svn", + "!node_modules/@woocommerce/components/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/ai/package.json b/packages/js/ai/package.json index dab723ef30f..2c2503f7a63 100644 --- a/packages/js/ai/package.json +++ b/packages/js/ai/package.json @@ -1,30 +1,45 @@ { "name": "@woocommerce/ai", "version": "0.1.0-beta.0", + "private": true, "description": "Utilities for usage in AI features across WooCommerce.", - "author": "Automattic", - "license": "GPL-2.0-or-later", "keywords": [ "wordpress", "woocommerce" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/ai/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "main": "build/index.js", - "module": "build-module/index.js", - "types": "build-types", - "react-native": "src/index", + "license": "GPL-2.0-or-later", + "author": "Automattic", "sideEffects": [ "build-style/**", "src/**/*.scss" ], - "private": true, + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, "dependencies": { "@wordpress/api-fetch": "wp-6.0", "@wordpress/compose": "wp-6.0", @@ -69,28 +84,82 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" - }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json --passWithNoTests", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name --", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, "peerDependencies": { "@types/react": "^17.0.2", "@wordpress/data": "wp-6.0", "react": "^17.0.2", "react-dom": "^17.0.2" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/api-core-tests/package.json b/packages/js/api-core-tests/package.json index ad3f7f3d2ff..ae41a67dc6d 100644 --- a/packages/js/api-core-tests/package.json +++ b/packages/js/api-core-tests/package.json @@ -2,29 +2,33 @@ "name": "@woocommerce/api-core-tests", "version": "1.0.0", "description": "API tests for WooCommerce", - "main": "index.js", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "scripts": { - "e2e": "jest", - "e2e:api": "jest --group=api", - "e2e:hello": "jest --group=hello", - "make:collection": "node utils/api-collection/build-collection.js", - "report": "allure generate --clean && allure serve", - "lint": "eslint data endpoints tests utils --ext=js,ts,tsx", - "lint:fix": "eslint data endpoints tests utils --ext=js,ts,tsx --fix" + "homepage": "https://github.com/woocommerce/woocommerce#readme", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "main": "index.js", + "bin": { + "wc-api-tests": "bin/wc-api-tests.sh" + }, + "scripts": { + "e2e": "jest", + "e2e:api": "jest --group=api", + "e2e:hello": "jest --group=hello", + "lint": "eslint data endpoints tests utils --ext=js,ts,tsx", + "lint:fix": "eslint data endpoints tests utils --ext=js,ts,tsx --fix", + "make:collection": "node utils/api-collection/build-collection.js", + "report": "allure generate --clean && allure serve" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "eslint --fix" + ] }, - "homepage": "https://github.com/woocommerce/woocommerce#readme", "dependencies": { "allure-commandline": "^2.17.2", "dotenv": "^10.0.0", @@ -36,17 +40,14 @@ }, "devDependencies": { "@woocommerce/eslint-plugin": "workspace:*", - "eslint": "^8.32.0" + "eslint": "^8.32.0", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "publishConfig": { "access": "public" - }, - "bin": { - "wc-api-tests": "bin/wc-api-tests.sh" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "eslint --fix" - ] } } diff --git a/packages/js/api/package.json b/packages/js/api/package.json index e77ed939cc4..0fcfa5631b6 100644 --- a/packages/js/api/package.json +++ b/packages/js/api/package.json @@ -1,22 +1,19 @@ { "name": "@woocommerce/api", "version": "0.3.0", - "author": "Automattic", "description": "A simple interface for interacting with a WooCommerce installation.", - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "repository": { - "type": "git", - "url": "https://github.com/woocommerce/woocommerce.git" - }, "keywords": [ "woocommerce", "e2e" ], + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/api/README.md", + "repository": { + "type": "git", + "url": "https://github.com/woocommerce/woocommerce.git" + }, "license": "GPL-3.0+", + "author": "Automattic", + "sideEffects": false, "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ @@ -28,20 +25,23 @@ "!/dist/**/__snapshops__/", "!/dist/**/__test_data__/" ], - "sideEffects": false, "scripts": { - "turbo:build": "pnpm run clean && npm run compile", - "turbo:test": "jest", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "rm -rf ./dist ./tsconfig.tsbuildinfo", - "compile": "tsc --project tsconfig.json", - "prepack": "pnpm run build", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "lint:fix": "eslint src --fix" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:typescript": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] }, "dependencies": { "axios": "^0.24.0", @@ -59,14 +59,45 @@ "eslint": "^8.32.0", "jest": "~27.5.1", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "publishConfig": { "access": "public" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "wireit": { + "build:project:typescript": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "dist" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.js --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json" + ] + } } } diff --git a/packages/js/block-templates/package.json b/packages/js/block-templates/package.json index 133822e4c0c..0b6a9ba0bc7 100644 --- a/packages/js/block-templates/package.json +++ b/packages/js/block-templates/package.json @@ -2,30 +2,42 @@ "name": "@woocommerce/block-templates", "version": "1.0.0", "description": "Utilities for working with block templates in WooCommerce admin.", - "author": "Automattic", - "license": "GPL-2.0-or-later", "keywords": [ "wordpress", "woocommerce" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/block-templates/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "main": "build/index.js", - "module": "build-module/index.js", - "types": "build-types", - "react-native": "src/index", + "license": "GPL-2.0-or-later", + "author": "Automattic", "sideEffects": [ "build-style/**", "src/**/*.scss" ], - "publishConfig": { - "access": "public" + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" }, "dependencies": { "@woocommerce/expression-evaluation": "workspace:*", @@ -62,27 +74,89 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" - }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, "peerDependencies": { "@types/react": "^17.0.2", "react": "^17.0.2", "react-dom": "^17.0.2" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/expression-evaluation/", + "package.json", + "!node_modules/@woocommerce/expression-evaluation/node_modules", + "!node_modules/@woocommerce/expression-evaluation/.git", + "!node_modules/@woocommerce/expression-evaluation/.svn", + "!node_modules/@woocommerce/expression-evaluation/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/components/.gitignore b/packages/js/components/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/components/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/components/package.json b/packages/js/components/package.json index 56d9c6dc566..a5632df4bf1 100644 --- a/packages/js/components/package.json +++ b/packages/js/components/package.json @@ -2,33 +2,50 @@ "name": "@woocommerce/components", "version": "12.2.0", "description": "UI components for WooCommerce.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", "components" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/components/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "main": "build/index.js", - "module": "build-module/index.js", - "react-native": "src/index", + "license": "GPL-3.0-or-later", + "author": "Automattic", "sideEffects": [ "build-style/**", "src/**/*.scss" ], + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint --ext=js,ts,tsx src --fix", + "lint:lang:js": "eslint --ext=js,ts,tsx src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@automattic/calypso-color-schemes": "^2.1.1", "@automattic/interpolate-components": "^1.2.0", @@ -86,17 +103,6 @@ "react-dates": "^21.8.0", "react-transition-group": "^4.4.2" }, - "peerDependencies": { - "@types/react": "^17.0.2", - "@types/react-dom": "^17.0.2", - "@wordpress/data": "wp-6.0", - "lodash": "^4.17.0", - "react": "^17.0.2", - "react-dom": "^17.0.2" - }, - "publishConfig": { - "access": "public" - }, "devDependencies": { "@babel/core": "^7.17.5", "@babel/runtime": "^7.17.2", @@ -145,30 +151,116 @@ "typescript": "^5.1.6", "uuid": "^8.3.0", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint --ext=js,ts,tsx src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "lint:fix": "eslint --ext=js,ts,tsx src --fix", - "prepack": "pnpm run clean && pnpm run build", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "test:update-snapshots": "pnpm run test -- --updateSnapshot", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" + "peerDependencies": { + "@types/react": "^17.0.2", + "@types/react-dom": "^17.0.2", + "@wordpress/data": "wp-6.0", + "lodash": "^4.17.0", + "react": "^17.0.2", + "react-dom": "^17.0.2" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/navigation/", + "node_modules/@woocommerce/date/", + "node_modules/@woocommerce/data/", + "node_modules/@woocommerce/currency/", + "node_modules/@woocommerce/csv-export/", + "package.json", + "!node_modules/@woocommerce/csv-export/node_modules", + "!node_modules/@woocommerce/csv-export/.git", + "!node_modules/@woocommerce/csv-export/.svn", + "!node_modules/@woocommerce/csv-export/src", + "!node_modules/@woocommerce/currency/node_modules", + "!node_modules/@woocommerce/currency/.git", + "!node_modules/@woocommerce/currency/.svn", + "!node_modules/@woocommerce/currency/src", + "!node_modules/@woocommerce/data/node_modules", + "!node_modules/@woocommerce/data/.git", + "!node_modules/@woocommerce/data/.svn", + "!node_modules/@woocommerce/data/src", + "!node_modules/@woocommerce/date/node_modules", + "!node_modules/@woocommerce/date/.git", + "!node_modules/@woocommerce/date/.svn", + "!node_modules/@woocommerce/date/src", + "!node_modules/@woocommerce/navigation/node_modules", + "!node_modules/@woocommerce/navigation/.git", + "!node_modules/@woocommerce/navigation/.svn", + "!node_modules/@woocommerce/navigation/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/create-product-editor-block/package.json b/packages/js/create-product-editor-block/package.json index ed40b14f2a4..826988dbbef 100644 --- a/packages/js/create-product-editor-block/package.json +++ b/packages/js/create-product-editor-block/package.json @@ -2,29 +2,31 @@ "name": "@woocommerce/create-product-editor-block", "version": "1.1.0", "description": "A template to be used with `@wordpress/create-block` to create a Product Editor block.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "main": "index.js", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "scripts": { - "postinstall": "composer install", - "changelog": "composer exec -- changelogger" + "keywords": [ + "wordpress", + "woocommerce" + ], + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-product-editor-block-extensionv#readme", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, - "keywords": [ - "wordpress", - "woocommerce" - ], - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "license": "GPL-3.0-or-later", + "author": "Automattic", + "main": "index.js", + "scripts": { + "changelog": "composer install && composer exec -- changelogger" + }, + "devDependencies": { + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-product-editor-block-extensionv#readme", "publishConfig": { "access": "public" } diff --git a/packages/js/create-woo-extension/.gitignore b/packages/js/create-woo-extension/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/create-woo-extension/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/create-woo-extension/package.json b/packages/js/create-woo-extension/package.json index b4f688f7769..ec1299695ba 100644 --- a/packages/js/create-woo-extension/package.json +++ b/packages/js/create-woo-extension/package.json @@ -2,24 +2,26 @@ "name": "@woocommerce/create-woo-extension", "version": "1.0.2", "description": "A template to be used with `@wordpress/create-block` to create a WooCommerce extension.", - "main": "index.js", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "scripts": { - "postinstall": "composer install", - "changelog": "composer exec -- changelogger" + "keywords": [], + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-woo-extensionv#readme", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, - "keywords": [], - "author": "", "license": "GPL-3.0+", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "author": "", + "main": "index.js", + "scripts": { + "changelog": "composer install && composer exec -- changelogger" }, - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-woo-extensionv#readme" + "devDependencies": { + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + } } diff --git a/packages/js/csv-export/.gitignore b/packages/js/csv-export/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/csv-export/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/csv-export/package.json b/packages/js/csv-export/package.json index 1d7533012d9..0cd53b7f693 100644 --- a/packages/js/csv-export/package.json +++ b/packages/js/csv-export/package.json @@ -2,69 +2,120 @@ "name": "@woocommerce/csv-export", "version": "1.8.0", "description": "WooCommerce utility library to convert data to CSV files.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", "csv" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/csv-export/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", - "dependencies": { - "@types/node": "^16.18.18", - "browser-filesaver": "^1.1.1", - "moment": "^2.29.1" - }, - "publishConfig": { - "access": "public" - }, + "types": "build-types", "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" - }, - "devDependencies": { - "@babel/core": "^7.17.5", - "@types/jest": "^27.4.1", - "@woocommerce/eslint-plugin": "workspace:*", - "@woocommerce/internal-js-tests": "workspace:*", - "eslint": "^8.32.0", - "jest": "~27.5.1", - "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", - "rimraf": "^3.0.2", - "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" }, "lint-staged": { "*.(t|j)s?(x)": [ "pnpm lint:fix", "pnpm test-staged" ] + }, + "dependencies": { + "@types/node": "^16.18.18", + "browser-filesaver": "^1.1.1", + "moment": "^2.29.1" + }, + "devDependencies": { + "@babel/core": "^7.17.5", + "@types/jest": "^27.4.1", + "@woocommerce/eslint-plugin": "workspace:*", + "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", + "eslint": "^8.32.0", + "jest": "~27.5.1", + "jest-cli": "~27.5.1", + "rimraf": "^3.0.2", + "ts-jest": "~29.1.1", + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/currency/.gitignore b/packages/js/currency/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/currency/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/currency/package.json b/packages/js/currency/package.json index 294cae30ce9..977a0a1e4d3 100644 --- a/packages/js/currency/package.json +++ b/packages/js/currency/package.json @@ -2,29 +2,45 @@ "name": "@woocommerce/currency", "version": "4.2.0", "description": "WooCommerce currency utilities.", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "currency" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/currency/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@woocommerce/number": "workspace:*", "@wordpress/deprecated": "wp-6.0", @@ -33,41 +49,81 @@ "@wordpress/html-entities": "wp-6.0", "@wordpress/i18n": "wp-6.0" }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" - }, "devDependencies": { "@babel/core": "^7.17.5", "@types/jest": "^27.4.1", "@woocommerce/eslint-plugin": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/number/", + "package.json", + "!node_modules/@woocommerce/number/node_modules", + "!node_modules/@woocommerce/number/.git", + "!node_modules/@woocommerce/number/.svn", + "!node_modules/@woocommerce/number/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/customer-effort-score/.gitignore b/packages/js/customer-effort-score/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/customer-effort-score/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/customer-effort-score/package.json b/packages/js/customer-effort-score/package.json index e20150fefd1..50ce6fd4dcc 100644 --- a/packages/js/customer-effort-score/package.json +++ b/packages/js/customer-effort-score/package.json @@ -2,28 +2,45 @@ "name": "@woocommerce/customer-effort-score", "version": "2.2.0", "description": "WooCommerce utility to measure user effort.", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/customer-effort-score/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@woocommerce/experimental": "workspace:*", "@wordpress/components": "wp-6.0", @@ -36,9 +53,6 @@ "prop-types": "^15.8.1", "react-transition-group": "^4.4.2" }, - "publishConfig": { - "access": "public" - }, "devDependencies": { "@babel/core": "^7.17.5", "@testing-library/react": "12.1.3", @@ -49,10 +63,10 @@ "@types/wordpress__data": "6.0.0", "@woocommerce/data": "workspace:*", "@woocommerce/eslint-plugin": "workspace:*", + "@woocommerce/internal-js-tests": "workspace:*", "@woocommerce/internal-style-build": "workspace:*", "@woocommerce/navigation": "workspace:*", "@woocommerce/tracks": "workspace:*", - "@woocommerce/internal-js-tests": "workspace:*", "@wordpress/browserslist-config": "wp-6.0", "concurrently": "^7.0.0", "css-loader": "^3.6.0", @@ -66,33 +80,107 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, "peerDependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/tracks/", + "node_modules/@woocommerce/navigation/", + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/data/", + "node_modules/@woocommerce/experimental/", + "package.json", + "!node_modules/@woocommerce/experimental/node_modules", + "!node_modules/@woocommerce/experimental/.git", + "!node_modules/@woocommerce/experimental/.svn", + "!node_modules/@woocommerce/experimental/src", + "!node_modules/@woocommerce/data/node_modules", + "!node_modules/@woocommerce/data/.git", + "!node_modules/@woocommerce/data/.svn", + "!node_modules/@woocommerce/data/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src", + "!node_modules/@woocommerce/navigation/node_modules", + "!node_modules/@woocommerce/navigation/.git", + "!node_modules/@woocommerce/navigation/.svn", + "!node_modules/@woocommerce/navigation/src", + "!node_modules/@woocommerce/tracks/node_modules", + "!node_modules/@woocommerce/tracks/.git", + "!node_modules/@woocommerce/tracks/.svn", + "!node_modules/@woocommerce/tracks/src" + ] + } } } diff --git a/packages/js/data/.gitignore b/packages/js/data/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/data/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/data/package.json b/packages/js/data/package.json index de0337bd55c..d4813eb0295 100644 --- a/packages/js/data/package.json +++ b/packages/js/data/package.json @@ -2,29 +2,45 @@ "name": "@woocommerce/data", "version": "4.1.0", "description": "WooCommerce Admin data store and utilities", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "data" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/data/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@woocommerce/date": "workspace:*", "@woocommerce/navigation": "workspace:*", @@ -43,9 +59,6 @@ "qs": "^6.10.3", "rememo": "^4.0.0" }, - "publishConfig": { - "access": "public" - }, "devDependencies": { "@automattic/data-stores": "^2.0.1", "@babel/core": "^7.17.5", @@ -55,23 +68,24 @@ "@types/jest": "^27.4.1", "@types/lodash": "^4.14.182", "@types/md5": "^2.3.2", + "@types/node": "^16.18.18", "@types/qs": "^6.9.7", "@types/react": "^17.0.2", - "@types/node": "^16.18.18", "@types/wordpress__compose": "4.0.1", "@types/wordpress__core-data": "2.4.5", "@types/wordpress__data": "6.0.0", "@types/wordpress__data-controls": "~2.2.0", "@woocommerce/eslint-plugin": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "redux": "^4.1.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, "peerDependencies": { "@wordpress/core-data": "wp-6.0", @@ -79,25 +93,77 @@ "react": "^17.0.2", "react-dom": "^17.0.2" }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/tracks/", + "node_modules/@woocommerce/navigation/", + "node_modules/@woocommerce/date/", + "package.json", + "!node_modules/@woocommerce/date/node_modules", + "!node_modules/@woocommerce/date/.git", + "!node_modules/@woocommerce/date/.svn", + "!node_modules/@woocommerce/date/src", + "!node_modules/@woocommerce/navigation/node_modules", + "!node_modules/@woocommerce/navigation/.git", + "!node_modules/@woocommerce/navigation/.svn", + "!node_modules/@woocommerce/navigation/src", + "!node_modules/@woocommerce/tracks/node_modules", + "!node_modules/@woocommerce/tracks/.git", + "!node_modules/@woocommerce/tracks/.svn", + "!node_modules/@woocommerce/tracks/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/date/.gitignore b/packages/js/date/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/date/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/date/package.json b/packages/js/date/package.json index 31b9ee8b5a2..6e99d0dc5f9 100644 --- a/packages/js/date/package.json +++ b/packages/js/date/package.json @@ -2,29 +2,45 @@ "name": "@woocommerce/date", "version": "4.2.0", "description": "WooCommerce date utilities.", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "date" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/date/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@types/d3-time-format": "^2.3.0", "@wordpress/date": "wp-6.0", @@ -35,46 +51,81 @@ }, "devDependencies": { "@babel/core": "^7.17.5", - "@types/node": "^16.18.18", "@types/jest": "^27.4.1", "@types/lodash": "^4.14.182", + "@types/node": "^16.18.18", "@types/qs": "^6.9.7", "@woocommerce/eslint-plugin": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", "d3-time-format": "^2.3.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, "peerDependencies": { "lodash": "^4.17.0" }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, "publishConfig": { "access": "public" }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/dependency-extraction-webpack-plugin/.gitignore b/packages/js/dependency-extraction-webpack-plugin/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/dependency-extraction-webpack-plugin/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/dependency-extraction-webpack-plugin/package.json b/packages/js/dependency-extraction-webpack-plugin/package.json index bfa5382b4e3..a35ce02813d 100644 --- a/packages/js/dependency-extraction-webpack-plugin/package.json +++ b/packages/js/dependency-extraction-webpack-plugin/package.json @@ -2,31 +2,36 @@ "name": "@woocommerce/dependency-extraction-webpack-plugin", "version": "2.3.0", "description": "WooCommerce Dependency Extraction Webpack Plugin", - "author": "Automattic", - "license": "GPL-2.0-or-later", "keywords": [ "wordpress", "woocommerce" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/dependency-extraction-webpack-plugin/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-2.0-or-later", + "author": "Automattic", "main": "src/index.js", + "scripts": { + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "eslint --fix" + ] + }, "dependencies": { "@wordpress/dependency-extraction-webpack-plugin": "^3.3.0" }, - "publishConfig": { - "access": "public" - }, "devDependencies": { "@babel/core": "^7.17.5", "@woocommerce/eslint-plugin": "workspace:*", @@ -37,17 +42,14 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, - "scripts": { - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "lint": "eslint src", - "lint:fix": "eslint src --fix" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "eslint --fix" - ] + "publishConfig": { + "access": "public" } } diff --git a/packages/js/e2e-core-tests/package.json b/packages/js/e2e-core-tests/package.json index 73fd32c61be..f4b529a574d 100644 --- a/packages/js/e2e-core-tests/package.json +++ b/packages/js/e2e-core-tests/package.json @@ -8,10 +8,6 @@ "url": "https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "main": "build/index.js", "module": "build-module/index.js", "files": [ @@ -22,6 +18,19 @@ "installFiles", "CHANGELOG.md" ], + "scripts": { + "build": "./bin/build.sh && pnpm clean && pnpm compile", + "clean": "rm -rf ./build ./build-module", + "compile": "e2e-builds", + "lint": "eslint --ext=js,ts,tsx src", + "lint:fix": "eslint --ext=js,ts,tsx src --fix", + "prepack": "pnpm build" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] + }, "dependencies": { "@jest/globals": "^27.5.1", "@wordpress/deprecated": "wp-6.0", @@ -42,27 +51,18 @@ "@wordpress/babel-preset-default": "3.0.2", "@wordpress/browserslist-config": "wp-6.0", "eslint": "^8.32.0", - "eslint-plugin-jest": "23.20.0" + "eslint-plugin-jest": "23.20.0", + "wireit": "^0.14.1" }, "peerDependencies": { "@woocommerce/api": "^0.2.0", "@woocommerce/e2e-utils": "^0.1.6" }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, "publishConfig": { "access": "public" - }, - "scripts": { - "turbo:build": "./bin/build.sh && pnpm run clean && pnpm run compile", - "prepack": "pnpm run build", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "clean": "rm -rf ./build ./build-module", - "compile": "e2e-builds", - "lint": "eslint --ext=js,ts,tsx src", - "lint:fix": "eslint --ext=js,ts,tsx src --fix" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] } } diff --git a/packages/js/e2e-environment/external.md b/packages/js/e2e-environment/external.md index 66a6cd1c9a1..b147cce6065 100644 --- a/packages/js/e2e-environment/external.md +++ b/packages/js/e2e-environment/external.md @@ -38,7 +38,7 @@ Again, if you don't have shell access to your test site, through WP Admin ensure 3. You have an admin user set up (if their credentials differ from u/ `admin` and p/ `password` be sure to update `/plugins/woocommerce/tests/e2e/config/default.json`) 4. You have a customer user set up named 'Jane Smith'. This user should be a `subscriber` and again make sure their username and password are reflected in `/plugins/woocommerce/tests/e2e/config/default.json`. -You should then be able to run the e2e tests by running `pnpm run e2e --filter=woocommerce`. +You should then be able to run the e2e tests by running `pnpm e2e --filter=@woocommerce/plugin-woocommerce`. ### Test Sequencer Setup diff --git a/packages/js/e2e-environment/package.json b/packages/js/e2e-environment/package.json index 909e0b84ffa..b88a463f3d6 100644 --- a/packages/js/e2e-environment/package.json +++ b/packages/js/e2e-environment/package.json @@ -2,18 +2,12 @@ "name": "@woocommerce/e2e-environment", "version": "0.3.0", "description": "WooCommerce End to End Testing Environment Configuration.", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "e2e", "puppeteer" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment/README.md", "bugs": { "url": "https://github.com/woocommerce/woocommerce/issues" @@ -22,8 +16,34 @@ "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "index.js", "module": "build-module/index.js", + "bin": { + "wc-e2e": "bin/wc-e2e.sh" + }, + "scripts": { + "build": "pnpm clean && pnpm compile", + "clean": "rm -rf ./build ./build-module", + "compile": "e2e-builds", + "docker:clear-all": "docker rmi --force $(docker images -q)", + "docker:down": "./bin/docker-compose.sh down", + "docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash", + "docker:up": "./bin/docker-compose.sh up", + "docker:wait": "bash ./bin/wait-for-build.sh", + "lint": "eslint --ext=js,ts,tsx src", + "lint:fix": "eslint --ext=js,ts,tsx src --fix", + "prepack": "pnpm build", + "test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js", + "test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug", + "test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] + }, "dependencies": { "@automattic/puppeteer-utils": "github:Automattic/puppeteer-utils#0f3ec50", "@jest/test-sequencer": "^27.5.1", @@ -59,34 +79,14 @@ "@wordpress/babel-preset-default": "3.0.2", "@wordpress/browserslist-config": "wp-6.0", "ndb": "^1.1.5", - "semver": "^7.3.2" + "semver": "^7.3.2", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "publishConfig": { "access": "public" - }, - "scripts": { - "turbo:build": "pnpm run clean && pnpm run compile", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "clean": "rm -rf ./build ./build-module", - "compile": "e2e-builds", - "prepack": "pnpm run build", - "docker:up": "./bin/docker-compose.sh up", - "docker:wait": "bash ./bin/wait-for-build.sh", - "docker:down": "./bin/docker-compose.sh down", - "docker:clear-all": "docker rmi --force $(docker images -q)", - "docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash", - "test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js", - "test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug", - "test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev", - "lint": "eslint --ext=js,ts,tsx src", - "lint:fix": "eslint --ext=js,ts,tsx src --fix" - }, - "bin": { - "wc-e2e": "bin/wc-e2e.sh" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] } } diff --git a/packages/js/e2e-utils/package.json b/packages/js/e2e-utils/package.json index bcffca6c2e0..74fb2b04eaf 100644 --- a/packages/js/e2e-utils/package.json +++ b/packages/js/e2e-utils/package.json @@ -8,12 +8,21 @@ "url": "https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "main": "build/index.js", "module": "build-module/index.js", + "scripts": { + "build": "pnpm clean && pnpm compile", + "clean": "rm -rf ./build ./build-module", + "compile": "e2e-builds", + "lint": "eslint --ext=js,ts,tsx src", + "lint:fix": "eslint --ext=js,ts,tsx src --fix", + "prepack": "pnpm build" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] + }, "dependencies": { "@automattic/puppeteer-utils": "github:Automattic/puppeteer-utils#0f3ec50", "@wordpress/deprecated": "wp-6.0", @@ -38,26 +47,17 @@ "@wordpress/babel-preset-default": "3.0.2", "@wordpress/browserslist-config": "wp-6.0", "eslint": "^8.32.0", - "eslint-plugin-jest": "23.20.0" + "eslint-plugin-jest": "23.20.0", + "wireit": "^0.14.1" }, "peerDependencies": { "@woocommerce/api": "^0.2.0" }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, "publishConfig": { "access": "public" - }, - "scripts": { - "turbo:build": "pnpm run clean && pnpm run compile", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "clean": "rm -rf ./build ./build-module", - "compile": "e2e-builds", - "prepack": "pnpm run build", - "lint": "eslint --ext=js,ts,tsx src", - "lint:fix": "eslint --ext=js,ts,tsx src --fix" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] } } diff --git a/packages/js/eslint-plugin/.gitignore b/packages/js/eslint-plugin/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/eslint-plugin/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/eslint-plugin/package.json b/packages/js/eslint-plugin/package.json index a8393a3ee22..67d01b111d3 100644 --- a/packages/js/eslint-plugin/package.json +++ b/packages/js/eslint-plugin/package.json @@ -2,12 +2,6 @@ "name": "@woocommerce/eslint-plugin", "version": "2.2.0", "description": "ESLint plugin for WooCommerce development.", - "author": "Automattic", - "license": "GPL-2.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", @@ -15,37 +9,42 @@ "plugin" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/eslint-plugin/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git", "directory": "packages/eslint-plugin" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-2.0-or-later", + "author": "Automattic", + "main": "index.js", "files": [ "configs", "rules", "index.js" ], - "main": "index.js", + "scripts": { + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint ./rules ./configs --fix", + "lint:lang:js": "eslint ./rules ./configs" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] + }, "dependencies": { - "@typescript-eslint/parser": "^5.54.0", "@typescript-eslint/eslint-plugin": "^5.54.0", + "@typescript-eslint/parser": "^5.54.0", "@wordpress/eslint-plugin": "14.7.0", "eslint-plugin-react-hooks": "^4.6.0", "eslint-plugin-testing-library": "^5.10.2", "prettier": "npm:wp-prettier@^2.8.5" }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "lint": "eslint ./rules ./configs", - "lint:fix": "eslint ./rules ./configs --fix" - }, "devDependencies": { "@babel/core": "^7.17.5", "eslint": "^8.32.0", @@ -53,11 +52,14 @@ "jest-cli": "~27.5.1", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" } } diff --git a/packages/js/experimental/.gitignore b/packages/js/experimental/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/experimental/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/experimental/package.json b/packages/js/experimental/package.json index 2495e01ddd9..50942b0b2e3 100644 --- a/packages/js/experimental/package.json +++ b/packages/js/experimental/package.json @@ -2,33 +2,50 @@ "name": "@woocommerce/experimental", "version": "3.2.0", "description": "WooCommerce experimental components.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", "experimental" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/experimental/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "main": "build/index.js", - "module": "build-module/index.js", - "types": "build-types", - "react-native": "src/index", + "license": "GPL-3.0-or-later", + "author": "Automattic", "sideEffects": [ "build-style/**", "src/**/*.scss" ], + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@woocommerce/components": "workspace:*", "@wordpress/components": "^19.5.0", @@ -43,9 +60,6 @@ "react-transition-group": "^4.4.2", "react-visibility-sensor": "^5.1.1" }, - "publishConfig": { - "access": "public" - }, "devDependencies": { "@babel/core": "^7.17.5", "@babel/runtime": "^7.17.2", @@ -61,8 +75,8 @@ "@types/testing-library__jest-dom": "^5.14.3", "@types/wordpress__components": "^19.10.3", "@woocommerce/eslint-plugin": "workspace:*", - "@woocommerce/internal-style-build": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "@woocommerce/internal-style-build": "workspace:*", "@wordpress/browserslist-config": "wp-6.0", "concurrently": "^7.0.0", "css-loader": "^3.6.0", @@ -76,33 +90,92 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, "peerDependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/components/", + "package.json", + "!node_modules/@woocommerce/components/node_modules", + "!node_modules/@woocommerce/components/.git", + "!node_modules/@woocommerce/components/.svn", + "!node_modules/@woocommerce/components/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/explat/.gitignore b/packages/js/explat/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/explat/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/explat/package.json b/packages/js/explat/package.json index e59391eead1..642d5708857 100644 --- a/packages/js/explat/package.json +++ b/packages/js/explat/package.json @@ -2,12 +2,6 @@ "name": "@woocommerce/explat", "version": "2.3.0", "description": "WooCommerce component and utils for A/B testing.", - "author": "Automattic", - "license": "GPL-2.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", @@ -15,19 +9,38 @@ "explat" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/explat/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-2.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", - "publishConfig": { - "access": "public" + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] }, "dependencies": { "@automattic/explat-client": "^0.0.3", @@ -46,33 +59,71 @@ "@types/react": "^17.0.2", "@woocommerce/eslint-plugin": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/explat/tsconfig.json b/packages/js/explat/tsconfig.json index 7fcb326214a..c5f351a60cc 100644 --- a/packages/js/explat/tsconfig.json +++ b/packages/js/explat/tsconfig.json @@ -10,5 +10,5 @@ "./typings", "./node_modules/@types" ] - }, + } } diff --git a/packages/js/expression-evaluation/package.json b/packages/js/expression-evaluation/package.json index e0f5ac4a1c9..164d0e70a54 100644 --- a/packages/js/expression-evaluation/package.json +++ b/packages/js/expression-evaluation/package.json @@ -2,51 +2,49 @@ "name": "@woocommerce/expression-evaluation", "version": "1.0.0", "description": "Library for evaluating expressions.", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "expression", "evalution" ], - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/expression-evaluation/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@wordpress/i18n": "wp-6.0", "peggy": "^3.0.2" }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" - }, "devDependencies": { "@babel/core": "^7.17.5", "@types/jest": "^27.4.1", @@ -58,12 +56,59 @@ "jest-cli": "~27.5.1", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/extend-cart-checkout-block/package.json b/packages/js/extend-cart-checkout-block/package.json index 17c4f99c569..fc79c178e8f 100644 --- a/packages/js/extend-cart-checkout-block/package.json +++ b/packages/js/extend-cart-checkout-block/package.json @@ -2,24 +2,26 @@ "name": "@woocommerce/extend-cart-checkout-block", "version": "1.2.0", "description": "", - "main": "index.js", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "scripts": { - "postinstall": "composer install", - "changelog": "composer exec -- changelogger" + "keywords": [], + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, - "keywords": [], - "author": "", "license": "ISC", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "author": "", + "main": "index.js", + "scripts": { + "changelog": "composer install && composer exec -- changelogger" }, - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme" + "devDependencies": { + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + } } diff --git a/packages/js/extend-cart-checkout-block/project.json b/packages/js/extend-cart-checkout-block/project.json deleted file mode 100644 index f0a497781bf..00000000000 --- a/packages/js/extend-cart-checkout-block/project.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "root": "packages/js/extend-cart-checkout-block", - "sourceRoot": "packages/js/extend-cart-checkout-block", - "projectType": "library" -} diff --git a/packages/js/integrate-plugin/package.json b/packages/js/integrate-plugin/package.json index 34eac07d00c..6697cc88e90 100644 --- a/packages/js/integrate-plugin/package.json +++ b/packages/js/integrate-plugin/package.json @@ -2,30 +2,41 @@ "name": "@woocommerce/integrate-plugin", "version": "0.1.0", "description": "WooCommerce plugin integration scripts.", - "author": "Automattic", - "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "plugin" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/integrate-plugin/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", + "sideEffects": [], "main": "build/index.js", + "react-native": "src/index", + "types": "build-types", "bin": { "woo-integrate-plugin": "./build/index.js" }, - "types": "build-types", - "react-native": "src/index", - "sideEffects": [], - "publishConfig": { - "access": "public" + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" }, "dependencies": { "@wordpress/create-block": "wp-6.0", @@ -59,18 +70,61 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, - "scripts": { - "turbo:build": "pnpm run build:js", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/internal-e2e-builds/package.json b/packages/js/internal-e2e-builds/package.json index a0094a8f5f0..492fdd4ba5c 100644 --- a/packages/js/internal-e2e-builds/package.json +++ b/packages/js/internal-e2e-builds/package.json @@ -1,28 +1,31 @@ { "name": "@woocommerce/internal-e2e-builds", "version": "0.1.0", - "description": "Utility build files for e2e packages", "private": true, - "main": "build.js", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "bin": { - "e2e-builds": "./build.js" + "description": "Utility build files for e2e packages", + "homepage": "https://github.com/woocommerce/woocommerce#readme", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "main": "build.js", + "bin": { + "e2e-builds": "./build.js" }, - "homepage": "https://github.com/woocommerce/woocommerce#readme", "scripts": { - "lint": "eslint build.js", - "lint:fix": "eslint build.js --fix" + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint build.js --fix", + "lint:lang:js": "eslint build.js" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] }, "devDependencies": { "@babel/core": "7.12.9", @@ -31,11 +34,11 @@ "eslint": "^8.32.0", "glob": "^7.2.0", "lodash": "^4.17.21", - "mkdirp": "^1.0.4" + "mkdirp": "^1.0.4", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" } } diff --git a/packages/js/internal-js-tests/package.json b/packages/js/internal-js-tests/package.json index 77b2e477340..d8725b6b3a0 100644 --- a/packages/js/internal-js-tests/package.json +++ b/packages/js/internal-js-tests/package.json @@ -1,33 +1,38 @@ { "name": "@woocommerce/internal-js-tests", "version": "1.1.0", + "private": true, "description": "JavaScript test tooling.", - "author": "Automattic", - "license": "GPL-2.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/internal-js-tests/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git", "directory": "packages/internal-js-tests" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "private": true, + "license": "GPL-2.0-or-later", + "author": "Automattic", "main": "build/util/index.js", "module": "build-module/util/index.js", "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "ts:check": "tsc --noEmit --project ./tsconfig.json", - "clean": "pnpm exec rimraf *.tsbuildinfo build build-*", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] }, "dependencies": { "@testing-library/jest-dom": "5.16.2", @@ -40,18 +45,57 @@ "devDependencies": { "@babel/core": "^7.17.5", "@woocommerce/eslint-plugin": "workspace:*", + "babel-jest": "~27.5.1", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", "resize-observer-polyfill": "1.5.1", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "babel-jest": "~27.5.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json" + ] + } } } diff --git a/packages/js/internal-js-tests/project.json b/packages/js/internal-js-tests/project.json deleted file mode 100644 index faccb2f296c..00000000000 --- a/packages/js/internal-js-tests/project.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "root": "packages/js/internal-js-tests", - "sourceRoot": "packages/js/internal-js-tests/src", - "projectType": "library", - "targets": { - "build": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "build" - } - }, - "test": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "test" - } - } - } - } \ No newline at end of file diff --git a/packages/js/internal-style-build/package.json b/packages/js/internal-style-build/package.json index 7caab95c880..de6c559a88b 100644 --- a/packages/js/internal-style-build/package.json +++ b/packages/js/internal-style-build/package.json @@ -1,26 +1,34 @@ { "name": "@woocommerce/internal-style-build", "version": "1.0.0", + "private": true, "description": "WooCommerce Components SASS Build", - "author": "Automattic", - "license": "GPL-2.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/internal-style-build/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-2.0-or-later", + "author": "Automattic", "main": "index.js", + "scripts": { + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint index.js --fix", + "lint:lang:js": "eslint index.js" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] + }, "dependencies": { "@automattic/color-studio": "^2.5.0", "@wordpress/base-styles": "wp-6.0", @@ -32,11 +40,6 @@ "webpack-remove-empty-scripts": "^0.7.3", "webpack-rtl-plugin": "^2.0.0" }, - "scripts": { - "lint": "eslint index.js", - "lint:fix": "eslint index.js --fix" - }, - "private": true, "devDependencies": { "@babel/core": "^7.17.5", "@woocommerce/eslint-plugin": "workspace:*", @@ -46,11 +49,11 @@ "rimraf": "^3.0.2", "ts-jest": "~29.1.1", "typescript": "^5.1.6", - "webpack": "^5.70.0" + "webpack": "^5.70.0", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" } } diff --git a/packages/js/navigation/.gitignore b/packages/js/navigation/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/navigation/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/navigation/package.json b/packages/js/navigation/package.json index d20c9ecce55..d29fa79ef55 100644 --- a/packages/js/navigation/package.json +++ b/packages/js/navigation/package.json @@ -2,29 +2,45 @@ "name": "@woocommerce/navigation", "version": "8.1.0", "description": "WooCommerce navigation utilities.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", "navigation" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/navigation/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "@wordpress/api-fetch": "wp-6.0", "@wordpress/components": "wp-6.0", @@ -38,27 +54,6 @@ "qs": "^6.10.3", "react-router-dom": "~6.3.0" }, - "peerDependencies": { - "lodash": "^4.17.0" - }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" - }, "devDependencies": { "@babel/core": "^7.17.5", "@babel/runtime": "^7.17.2", @@ -66,18 +61,74 @@ "@types/qs": "^6.9.7", "@woocommerce/eslint-plugin": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "peerDependencies": { + "lodash": "^4.17.0" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/notices/package.json b/packages/js/notices/package.json index 1b3afd27634..0b78d5c78cd 100644 --- a/packages/js/notices/package.json +++ b/packages/js/notices/package.json @@ -1,54 +1,51 @@ { "name": "@woocommerce/notices", "version": "4.0.1", + "private": true, "description": "State management for notices.", - "author": "The WordPress Contributors", - "license": "GPL-2.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "gutenberg", "notices" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/notices/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerge.git", "directory": "packages/js/notices" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-2.0-or-later", + "author": "The WordPress Contributors", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] + }, "dependencies": { "@wordpress/a11y": "wp-6.0", "@wordpress/data": "wp-6.0", "@wordpress/notices": "wp-6.0" }, - "peerDependencies": { - "lodash": "^4.17.0", - "react": "^17.0.2", - "react-dom": "^17.0.2" - }, - "publishConfig": { - "access": "public" - }, - "private": true, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" - }, "devDependencies": { "@automattic/data-stores": "^2.0.1", "@babel/core": "^7.17.5", @@ -56,18 +53,66 @@ "@types/wordpress__data": "6.0.0", "@types/wordpress__notices": "3.5.0", "@woocommerce/eslint-plugin": "workspace:*", + "concurrently": "^7.0.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "redux": "^4.2.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "peerDependencies": { + "lodash": "^4.17.0", + "react": "^17.0.2", + "react-dom": "^17.0.2" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json" + ] + } } } diff --git a/packages/js/notices/project.json b/packages/js/notices/project.json deleted file mode 100644 index 33f1da11cee..00000000000 --- a/packages/js/notices/project.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "root": "packages/js/notices", - "sourceRoot": "packages/js/notices/src", - "projectType": "library", - "targets": { - "build": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "build" - } - }, - "build-watch": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "start" - } - }, - "test": { - "executor": "@nrwl/workspace:run-script", - "options": { - "script": "test" - } - } - } - } \ No newline at end of file diff --git a/packages/js/number/.gitignore b/packages/js/number/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/number/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/number/package.json b/packages/js/number/package.json index 599e6a21aed..9e21a06fc9a 100644 --- a/packages/js/number/package.json +++ b/packages/js/number/package.json @@ -2,49 +2,47 @@ "name": "@woocommerce/number", "version": "2.4.0", "description": "Number formatting utilities for WooCommerce.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/number/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] + }, "dependencies": { "locutus": "^2.0.16" }, - "publishConfig": { - "access": "public" - }, - "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" - }, "devDependencies": { "@babel/core": "^7.17.5", "@babel/runtime": "^7.17.2", @@ -52,18 +50,71 @@ "@types/lodash": "^4.14.184", "@woocommerce/eslint-plugin": "workspace:*", "@woocommerce/internal-js-tests": "workspace:*", + "concurrently": "^7.0.0", "eslint": "^8.32.0", "jest": "~27.5.1", "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src" + ] + } } } diff --git a/packages/js/onboarding/.gitignore b/packages/js/onboarding/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/onboarding/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/onboarding/package.json b/packages/js/onboarding/package.json index 7e04008de0e..d202a120e47 100644 --- a/packages/js/onboarding/package.json +++ b/packages/js/onboarding/package.json @@ -2,31 +2,45 @@ "name": "@woocommerce/onboarding", "version": "3.4.0", "description": "Onboarding utilities.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", "onboarding" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/onboarding/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", - "publishConfig": { - "access": "public" + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] }, "dependencies": { "@woocommerce/components": "workspace:*", @@ -66,29 +80,103 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix", - "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix", - "pnpm test-staged" - ] + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/tracks/", + "node_modules/@woocommerce/explat/", + "node_modules/@woocommerce/experimental/", + "node_modules/@woocommerce/components/", + "package.json", + "!node_modules/@woocommerce/components/node_modules", + "!node_modules/@woocommerce/components/.git", + "!node_modules/@woocommerce/components/.svn", + "!node_modules/@woocommerce/components/src", + "!node_modules/@woocommerce/experimental/node_modules", + "!node_modules/@woocommerce/experimental/.git", + "!node_modules/@woocommerce/experimental/.svn", + "!node_modules/@woocommerce/experimental/src", + "!node_modules/@woocommerce/explat/node_modules", + "!node_modules/@woocommerce/explat/.git", + "!node_modules/@woocommerce/explat/.svn", + "!node_modules/@woocommerce/explat/src", + "!node_modules/@woocommerce/tracks/node_modules", + "!node_modules/@woocommerce/tracks/.git", + "!node_modules/@woocommerce/tracks/.svn", + "!node_modules/@woocommerce/tracks/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/product-editor/package.json b/packages/js/product-editor/package.json index 2fbefca3cc5..65954ebdbcb 100644 --- a/packages/js/product-editor/package.json +++ b/packages/js/product-editor/package.json @@ -2,30 +2,42 @@ "name": "@woocommerce/product-editor", "version": "1.1.0", "description": "React components for the WooCommerce admin product editor.", - "author": "Automattic", - "license": "GPL-2.0-or-later", "keywords": [ "wordpress", "woocommerce" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/product-editor/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, - "main": "build/index.js", - "module": "build-module/index.js", - "types": "build-types", - "react-native": "src/index", + "license": "GPL-2.0-or-later", + "author": "Automattic", "sideEffects": [ "build-style/**", "src/**/*.scss" ], - "publishConfig": { - "access": "public" + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", + "types": "build-types", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" }, "dependencies": { "@types/lodash": "^4.14.179", @@ -51,8 +63,8 @@ "@wordpress/data": "wp-6.0", "@wordpress/date": "wp-6.0", "@wordpress/deprecated": "wp-6.0", - "@wordpress/editor": "wp-6.0", "@wordpress/edit-post": "wp-6.0", + "@wordpress/editor": "wp-6.0", "@wordpress/element": "wp-6.0", "@wordpress/html-entities": "wp-6.0", "@wordpress/i18n": "wp-6.0", @@ -88,8 +100,8 @@ "@types/wordpress__core-data": "2.4.5", "@types/wordpress__data": "6.0.2", "@types/wordpress__date": "3.3.2", - "@types/wordpress__editor": "13.0.0", "@types/wordpress__edit-post": "7.5.4", + "@types/wordpress__editor": "13.0.0", "@types/wordpress__keycodes": "2.3.1", "@types/wordpress__media-utils": "3.0.0", "@types/wordpress__plugins": "3.0.0", @@ -114,28 +126,135 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12" - }, - "scripts": { - "turbo:build": "pnpm run build:js && pnpm run build:css", - "turbo:test": "jest --config ./jest.config.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "eslint src", - "build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "build:css": "webpack", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" + "webpack-cli": "^3.3.12", + "wireit": "^0.14.1" }, "peerDependencies": { "@types/react": "^17.0.2", "@wordpress/data": "wp-6.0", "react": "^17.0.2", "react-dom": "^17.0.2" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "files": [ + "webpack.config.js", + "src/**/*.scss" + ], + "output": [ + "build-style" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config ./jest.config.json --passWithNoTests", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/tracks/", + "node_modules/@woocommerce/number/", + "node_modules/@woocommerce/navigation/", + "node_modules/@woocommerce/experimental/", + "node_modules/@woocommerce/data/", + "node_modules/@woocommerce/customer-effort-score/", + "node_modules/@woocommerce/currency/", + "node_modules/@woocommerce/components/", + "node_modules/@woocommerce/block-templates/", + "node_modules/@woocommerce/admin-layout/", + "package.json", + "!node_modules/@woocommerce/admin-layout/node_modules", + "!node_modules/@woocommerce/admin-layout/.git", + "!node_modules/@woocommerce/admin-layout/.svn", + "!node_modules/@woocommerce/admin-layout/src", + "!node_modules/@woocommerce/block-templates/node_modules", + "!node_modules/@woocommerce/block-templates/.git", + "!node_modules/@woocommerce/block-templates/.svn", + "!node_modules/@woocommerce/block-templates/src", + "!node_modules/@woocommerce/components/node_modules", + "!node_modules/@woocommerce/components/.git", + "!node_modules/@woocommerce/components/.svn", + "!node_modules/@woocommerce/components/src", + "!node_modules/@woocommerce/currency/node_modules", + "!node_modules/@woocommerce/currency/.git", + "!node_modules/@woocommerce/currency/.svn", + "!node_modules/@woocommerce/currency/src", + "!node_modules/@woocommerce/customer-effort-score/node_modules", + "!node_modules/@woocommerce/customer-effort-score/.git", + "!node_modules/@woocommerce/customer-effort-score/.svn", + "!node_modules/@woocommerce/customer-effort-score/src", + "!node_modules/@woocommerce/data/node_modules", + "!node_modules/@woocommerce/data/.git", + "!node_modules/@woocommerce/data/.svn", + "!node_modules/@woocommerce/data/src", + "!node_modules/@woocommerce/experimental/node_modules", + "!node_modules/@woocommerce/experimental/.git", + "!node_modules/@woocommerce/experimental/.svn", + "!node_modules/@woocommerce/experimental/src", + "!node_modules/@woocommerce/navigation/node_modules", + "!node_modules/@woocommerce/navigation/.git", + "!node_modules/@woocommerce/navigation/.svn", + "!node_modules/@woocommerce/navigation/src", + "!node_modules/@woocommerce/number/node_modules", + "!node_modules/@woocommerce/number/.git", + "!node_modules/@woocommerce/number/.svn", + "!node_modules/@woocommerce/number/src", + "!node_modules/@woocommerce/tracks/node_modules", + "!node_modules/@woocommerce/tracks/.git", + "!node_modules/@woocommerce/tracks/.svn", + "!node_modules/@woocommerce/tracks/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src" + ] + } } } diff --git a/packages/js/tracks/.gitignore b/packages/js/tracks/.gitignore deleted file mode 100644 index 4b894a3e094..00000000000 --- a/packages/js/tracks/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -vendor -node_modules -.turbo diff --git a/packages/js/tracks/package.json b/packages/js/tracks/package.json index 1a9229733b1..4f7c81fbea3 100644 --- a/packages/js/tracks/package.json +++ b/packages/js/tracks/package.json @@ -2,61 +2,104 @@ "name": "@woocommerce/tracks", "version": "1.3.0", "description": "WooCommerce user event tracking utilities for Automattic based projects.", - "author": "Automattic", - "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, "keywords": [ "wordpress", "woocommerce", "tracks" ], "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/tracks/README.md", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "license": "GPL-3.0-or-later", + "author": "Automattic", "main": "build/index.js", "module": "build-module/index.js", - "types": "build-types", "react-native": "src/index", - "dependencies": { - "debug": "^4.3.3" - }, - "publishConfig": { - "access": "public" - }, + "types": "build-types", "scripts": { - "turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json", - "prepare": "composer install", - "changelog": "composer exec -- changelogger", - "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint src", - "start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"", - "prepack": "pnpm run clean && pnpm run build", - "lint:fix": "eslint src --fix" - }, - "devDependencies": { - "@babel/core": "^7.17.5", - "@types/debug": "^4.1.7", - "@woocommerce/eslint-plugin": "workspace:*", - "eslint": "^8.32.0", - "jest": "~27.5.1", - "jest-cli": "~27.5.1", - "concurrently": "^7.0.0", - "rimraf": "^3.0.2", - "ts-jest": "~29.1.1", - "typescript": "^5.1.6" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:cjs": "wireit", + "build:project:esm": "wireit", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:js": "eslint src --fix", + "lint:lang:js": "eslint src", + "prepack": "pnpm build", + "watch:build": "pnpm build:project --watch" }, "lint-staged": { "*.(t|j)s?(x)": [ "pnpm lint:fix" ] + }, + "dependencies": { + "debug": "^4.3.3" + }, + "devDependencies": { + "@babel/core": "^7.17.5", + "@types/debug": "^4.1.7", + "@woocommerce/eslint-plugin": "workspace:*", + "concurrently": "^7.0.0", + "eslint": "^8.32.0", + "jest": "~27.5.1", + "jest-cli": "~27.5.1", + "rimraf": "^3.0.2", + "ts-jest": "~29.1.1", + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "publishConfig": { + "access": "public" + }, + "wireit": { + "build:project:cjs": { + "command": "tsc --project tsconfig-cjs.json", + "files": [ + "tsconfig-cjs.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "build:project:esm": { + "command": "tsc --project tsconfig.json", + "files": [ + "tsconfig.json", + "src/**/*.{js,jsx,ts,tsx}", + "typings/**/*.ts" + ], + "output": [ + "build-module", + "build-types" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "package.json" + ] + } } } diff --git a/plugins/woo-ai/DEVELOPMENT.md b/plugins/woo-ai/DEVELOPMENT.md index 7bceb6726da..a05384e3df6 100644 --- a/plugins/woo-ai/DEVELOPMENT.md +++ b/plugins/woo-ai/DEVELOPMENT.md @@ -28,21 +28,21 @@ To enable Live(Hot) Reload when code is changed, run the following commands: ```text pnpm install -pnpm run start +pnpm start ``` To build the /woo-ai/ plugin directory (when loading the plugin via symlink), run: ```text pnpm install -pnpm run build +pnpm build ``` To build the plugin ZIP file, run: ```text pnpm install -pnpm run build:zip +pnpm build:zip ``` See [wp-scripts](https://github.com/WordPress/gutenberg/tree/master/packages/scripts) for more usage information. diff --git a/plugins/woo-ai/bin/build-zip.sh b/plugins/woo-ai/bin/build-zip.sh index 3bfc34d4f4a..b3c3a8334c9 100755 --- a/plugins/woo-ai/bin/build-zip.sh +++ b/plugins/woo-ai/bin/build-zip.sh @@ -12,7 +12,7 @@ mkdir -p "$DEST_PATH" echo "Installing PHP and JS dependencies..." pnpm install echo "Running JS Build..." -pnpm -w run build --filter=woo-ai || exit "$?" +pnpm --filter='@woocommerce/plugin-woo-ai' build || exit "$?" echo "Syncing files..." rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded diff --git a/plugins/woo-ai/package.json b/plugins/woo-ai/package.json index f135a1c5e7a..504a2b80a41 100644 --- a/plugins/woo-ai/package.json +++ b/plugins/woo-ai/package.json @@ -1,32 +1,48 @@ { - "name": "woo-ai", + "name": "@woocommerce/plugin-woo-ai", + "version": "0.5.0", + "private": true, "description": "Implementing WooCommerce AI Experiments.", - "license": "GPL-2.0", + "homepage": "http://github.com/woocommerce/woo-ai", "repository": { "type": "git", "url": "git://github.com/woocommerce/woo-ai.git" }, - "title": "Woo AI", - "version": "0.5.0", - "homepage": "http://github.com/woocommerce/woo-ai", - "devDependencies": { - "@svgr/webpack": "^8.1.0", - "@types/debug": "^4.1.7", - "@types/jquery": "^3.5.16", - "@types/react": "^17.0.2", - "@types/react-dom": "^17.0.2", - "@types/wordpress__components": "^19.10.3", - "@woocommerce/dependency-extraction-webpack-plugin": "workspace:*", - "@woocommerce/eslint-plugin": "workspace:*", - "@wordpress/data": "wp-6.0", - "@wordpress/env": "^8.2.0", - "@wordpress/prettier-config": "2.17.0", - "@wordpress/scripts": "^19.2.4", - "eslint": "^8.32.0", - "prettier": "npm:wp-prettier@^2.6.2", - "ts-loader": "^9.4.1", - "typescript": "^5.1.6", - "uglify-js": "^3.5.3" + "license": "GPL-2.0", + "scripts": { + "build": "pnpm build:admin && pnpm uglify", + "build:admin": "wp-scripts build", + "build:dev": "pnpm lint:js && pnpm build", + "build:zip": "./bin/build-zip.sh", + "changelog": "composer exec -- changelogger", + "check-engines": "wp-scripts check-engines", + "check-licenses": "wp-scripts check-licenses", + "format:js": "wp-scripts format-js", + "postinstall": "composer install", + "lint:css": "wp-scripts lint-style", + "lint:css:fix": "wp-scripts lint-style --fix", + "lint:js": "wp-scripts lint-js", + "lint:js:fix": "wp-scripts lint-js --fix", + "lint:md:docs": "wp-scripts lint-md-docs", + "lint:md:js": "wp-scripts lint-md-js", + "lint:pkg-json": "wp-scripts lint-pkg-json", + "packages-update": "wp-scripts packages-update", + "start": "wp-scripts start", + "test:e2e": "wp-scripts test-e2e", + "test:unit": "wp-scripts test-unit-js", + "uglify": "rm -f $npm_package_assets_js_min && for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done" + }, + "lint-staged": { + "*.php": [ + "php -d display_errors=1 -l", + "composer run-script phpcs-pre-commit" + ], + "*.(t|j)s?(x)": [ + "npm run lint:js:fix" + ], + "*.scss": [ + "npm run lint:css:fix" + ] }, "dependencies": { "@automattic/tour-kit": "^1.1.1", @@ -49,50 +65,35 @@ "prop-types": "^15.8.1", "react-query": "^3.39.3" }, + "devDependencies": { + "@svgr/webpack": "^8.1.0", + "@types/debug": "^4.1.7", + "@types/jquery": "^3.5.16", + "@types/react": "^17.0.2", + "@types/react-dom": "^17.0.2", + "@types/wordpress__components": "^19.10.3", + "@woocommerce/dependency-extraction-webpack-plugin": "workspace:*", + "@woocommerce/eslint-plugin": "workspace:*", + "@wordpress/data": "wp-6.0", + "@wordpress/env": "^8.2.0", + "@wordpress/prettier-config": "2.17.0", + "@wordpress/scripts": "^19.2.4", + "eslint": "^8.32.0", + "prettier": "npm:wp-prettier@^2.6.2", + "ts-loader": "^9.4.1", + "typescript": "^5.1.6", + "uglify-js": "^3.5.3", + "wireit": "^0.14.1" + }, "peerDependencies": { "@types/react": "^17.0.2", "@types/react-dom": "^17.0.2", "react": "^17.0.2", "react-dom": "^17.0.2" }, - "scripts": { - "postinstall": "composer install", - "changelog": "composer exec -- changelogger", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "turbo:build": "pnpm run build:admin && pnpm run uglify", - "build:admin": "wp-scripts build", - "build:zip": "./bin/build-zip.sh", - "build:dev": "pnpm run lint:js && pnpm run build", - "uglify": "rm -f $npm_package_assets_js_min && for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done", - "check-engines": "wp-scripts check-engines", - "check-licenses": "wp-scripts check-licenses", - "format:js": "wp-scripts format-js", - "lint:css": "wp-scripts lint-style", - "lint:css:fix": "wp-scripts lint-style --fix", - "lint:js": "wp-scripts lint-js", - "lint:js:fix": "wp-scripts lint-js --fix", - "lint:md:docs": "wp-scripts lint-md-docs", - "lint:md:js": "wp-scripts lint-md-js", - "lint:pkg-json": "wp-scripts lint-pkg-json", - "packages-update": "wp-scripts packages-update", - "start": "wp-scripts start", - "test:e2e": "wp-scripts test-e2e", - "test:unit": "wp-scripts test-unit-js" - }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" }, - "lint-staged": { - "*.php": [ - "php -d display_errors=1 -l", - "composer run-script phpcs-pre-commit" - ], - "*.(t|j)s?(x)": [ - "npm run lint:js:fix" - ], - "*.scss": [ - "npm run lint:css:fix" - ] - } + "title": "Woo AI" } diff --git a/plugins/woocommerce-admin/bin/hook-reference/README.md b/plugins/woocommerce-admin/bin/hook-reference/README.md index 3ad83aafd51..30b19c00798 100644 --- a/plugins/woocommerce-admin/bin/hook-reference/README.md +++ b/plugins/woocommerce-admin/bin/hook-reference/README.md @@ -7,7 +7,7 @@ Compile a publishable JSON object of WooCommerce's JavaScript filters and slotFi Generate a new reference found at `bin/hook-reference/data.json` by running the following command. ``` -pnpm run create-hook-reference +pnpm create-hook-reference ``` The data includes references to code in the Github repository by commit hash, so it is essential to commit the resulting data in a pull request to `main` so code references are publicly available. diff --git a/plugins/woocommerce-admin/docs/examples/extensions/README.md b/plugins/woocommerce-admin/docs/examples/extensions/README.md index 26689221298..b73604aaea5 100644 --- a/plugins/woocommerce-admin/docs/examples/extensions/README.md +++ b/plugins/woocommerce-admin/docs/examples/extensions/README.md @@ -14,7 +14,7 @@ Build the example extension by running the pnpm script and passing the example n ```bash -WC_EXT= pnpm --filter=woocommerce/client/admin example +WC_EXT= pnpm --filter=@woocommerce/admin-library example ``` You should see a new directory in `./woocommerce/plugins/{example} path.` Include the output plugin in your `.wp-env.json` or `.wp-env.override.json` and restart the WordPress instance. WooCommerce will now reflect the changes made by the example extension. diff --git a/plugins/woocommerce-admin/docs/features/navigation.md b/plugins/woocommerce-admin/docs/features/navigation.md index bf68adc4d5f..26592cd2442 100644 --- a/plugins/woocommerce-admin/docs/features/navigation.md +++ b/plugins/woocommerce-admin/docs/features/navigation.md @@ -10,7 +10,7 @@ This feature is hidden behind a feature flag and can be turned on or off by visi The fastest way to get started is by creating an example plugin from WooCommerce Admin. Enter the following command: -`WC_EXT=add-navigation-items pnpm example --filter=woocommerce/client/admin` +`WC_EXT=add-navigation-items pnpm example --filter=@woocommerce/admin-library` This will create a new plugin that covers various features of the navigation and helps to register some initial items and categories within the new navigation menu. After running the command above, you can make edits directly to the files at `docs/examples/extensions/add-navigation-items` and they will be built and copied to your `wp-content/add-navigation-items` folder on save. diff --git a/plugins/woocommerce-admin/docs/features/payment-gateway-suggestions.md b/plugins/woocommerce-admin/docs/features/payment-gateway-suggestions.md index b8ea6752f42..692c8681c0f 100644 --- a/plugins/woocommerce-admin/docs/features/payment-gateway-suggestions.md +++ b/plugins/woocommerce-admin/docs/features/payment-gateway-suggestions.md @@ -10,7 +10,7 @@ Gateway suggestions are retrieved from a REST API and can be added via a remote To quickly get started with an example plugin, run the following: -`WC_EXT=payment-gateway-suggestions pnpm example --filter=woocommerce/client/admin` +`WC_EXT=payment-gateway-suggestions pnpm example --filter=@woocommerce/admin-library` This will create a new plugin that when activated will add two new gateway suggestions. The first is a simple gateway demonstrating how configuration fields can be pulled from the gateway class to create a configuration form. The second gateway shows a more customized approach via SlotFill. diff --git a/plugins/woocommerce-admin/package.json b/plugins/woocommerce-admin/package.json index 5a38b64f3ec..64ca37284d5 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -1,59 +1,46 @@ { - "name": "woocommerce/client/admin", + "name": "@woocommerce/admin-library", "version": "3.3.0", - "license": "GPL-3.0-or-later", - "author": "Automattic", + "private": true, "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce-admin/README.md", "repository": { "type": "git", "url": "https://github.com:woocommerce/woocommerce.git" }, + "license": "GPL-3.0-or-later", + "author": "Automattic", + "files": [ + "build" + ], "scripts": { - "changelog": "pnpm --filter=woocommerce -r run changelog ", - "turbo:build": "pnpm run clean && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack", - "turbo:test": "pnpm run test:client", - "analyze": "cross-env NODE_ENV=production ANALYZE=true webpack", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "pnpm run lint:js && pnpm run lint:css", - "build:feature-config": "php ../woocommerce/bin/generate-feature-config.php", - "clean": "rimraf ../woocommerce/assets/client/admin/*", - "client:watch": "cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && cross-env WC_ADMIN_PHASE=development webpack --watch", - "create-hook-reference": "node ./bin/hook-reference/index.js", - "create-wc-extension": "pnpm -w run create-extension", - "dev": "cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && cross-env WC_ADMIN_PHASE=development pnpm -w run build --filter='./packages/js/*' && cross-env WC_ADMIN_PHASE=development webpack", - "example": "webpack --config docs/examples/extensions/examples.config.js --watch", - "preinstall": "npx only-allow pnpm", - "lint:fix": "pnpm lint:js-fix && pnpm lint:css-fix", - "lint:css": "stylelint '**/*.scss'", - "lint:css-fix": "stylelint '**/*.scss' --fix --ip 'storybook/wordpress'", - "lint:js": "eslint ./client --ext=js,ts,tsx", - "lint:js-fix": "pnpm run lint:js --fix --ext=js,ts,tsx", - "lint:js-packages": "eslint ../../packages/js --ext=js,ts,tsx", - "lint:js-pre-commit": "eslint --ext=js,ts,tsx", - "prepack": "pnpm install && pnpm run lint && pnpm run test && cross-env WC_ADMIN_PHASE=core pnpm run build", - "packages:fix:textdomain": "node ./bin/package-update-textdomain.js", - "packages:build": "pnpm run:packages -- build", - "packages:watch": "pnpm run:packages -- start", - "run:packages": "pnpm run --parallel --filter='../../packages/js/**'", - "prestart": "pnpm packages:build && cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config", - "start": "concurrently \"cross-env WC_ADMIN_PHASE=development webpack --watch\" \"cross-env WC_ADMIN_PHASE=development pnpm packages:watch\"", - "start:hot": "pnpm prestart && concurrently \"cross-env HOT=true WC_ADMIN_PHASE=development webpack serve\" \"cross-env WC_ADMIN_PHASE=development pnpm packages:watch\"", - "test-staged": "pnpm run test:client --bail --findRelatedTests", - "test:client": "jest --config client/jest.config.js", - "test:debug": "node --inspect-brk ./node_modules/.bin/jest --config client/jest.config.js --watch --runInBand --no-cache", - "test:help": "wp-scripts test-unit-js --help", - "test:update-snapshots": "pnpm run test:client --updateSnapshot && pnpm run --filter @woocommerce/components test:update-snapshots", - "test:watch": "pnpm run test:client --watch", - "ts:check": "tsc --project tsconfig.json --pretty", - "ts:check:watch": "npm run ts:check -- --watch" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:bundle": "wireit", + "build:project:feature-config": "php ../woocommerce/bin/generate-feature-config.php", + "changelog": "composer install && composer exec -- changelogger", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:css": "stylelint '**/*.scss' --fix --ip 'storybook/wordpress'", + "lint:fix:lang:js": "pnpm lint:js --fix --ext=js,ts,tsx", + "lint:lang:css": "stylelint '**/*.scss'", + "lint:lang:js": "eslint ./client --ext=js,ts,tsx", + "test:js": "wireit", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.scss": [ + "pnpm lint:css-fix" + ], + "client/**/*.(t|j)s?(x)": [ + "pnpm lint:js-pre-commit", + "pnpm test-staged" + ] }, "dependencies": { + "@automattic/components": "^2.0.1", "@automattic/explat-client": "^0.0.3", "@automattic/explat-client-react-helpers": "^0.0.4", "@automattic/interpolate-components": "^1.2.0", - "@automattic/components": "^2.0.1", "@react-spring/web": "^9.4.3", "@types/wordpress__blocks": "11.0.7", "@woocommerce/api": "^0.2.0", @@ -237,22 +224,148 @@ "webpack-dev-server": "^4.11.1", "webpack-fix-style-only-entries": "^0.6.1", "webpack-merge": "^5.8.0", - "webpack-rtl-plugin": "^2.0.0" + "webpack-rtl-plugin": "^2.0.0", + "wireit": "^0.14.1" }, "peerDependencies": { "@wordpress/data": "wp-6.0" }, - "lint-staged": { - "*.scss": [ - "pnpm lint:css-fix" - ], - "client/**/*.(t|j)s?(x)": [ - "pnpm lint:js-pre-commit", - "pnpm test-staged" - ] - }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" + }, + "wireit": { + "build:project:bundle": { + "command": "webpack", + "env": { + "NODE_ENV": "production", + "WC_ADMIN_PHASE": "core" + }, + "files": [ + "webpack.config.js", + "tsconfig.json", + "client/**/*.{js,jsx,ts,tsx}", + "client/**/*.scss" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "test:js": { + "command": "jest --config client/jest.config.js", + "dependencies": [ + "build:project" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/tracks/", + "node_modules/@woocommerce/product-editor/", + "node_modules/@woocommerce/onboarding/", + "node_modules/@woocommerce/number/", + "node_modules/@woocommerce/notices/", + "node_modules/@woocommerce/navigation/", + "node_modules/@woocommerce/internal-style-build/", + "node_modules/@woocommerce/internal-js-tests/", + "node_modules/@woocommerce/explat/", + "node_modules/@woocommerce/experimental/", + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/dependency-extraction-webpack-plugin/", + "node_modules/@woocommerce/date/", + "node_modules/@woocommerce/data/", + "node_modules/@woocommerce/customer-effort-score/", + "node_modules/@woocommerce/currency/", + "node_modules/@woocommerce/csv-export/", + "node_modules/@woocommerce/components/", + "node_modules/@woocommerce/ai/", + "node_modules/@woocommerce/admin-layout/", + "node_modules/@woocommerce/admin-e2e-tests/build/", + "package.json", + "!node_modules/@woocommerce/admin-e2e-tests/*.ts.map", + "!node_modules/@woocommerce/admin-e2e-tests/*.tsbuildinfo", + "!node_modules/@woocommerce/admin-layout/node_modules", + "!node_modules/@woocommerce/admin-layout/.git", + "!node_modules/@woocommerce/admin-layout/.svn", + "!node_modules/@woocommerce/admin-layout/src", + "!node_modules/@woocommerce/ai/node_modules", + "!node_modules/@woocommerce/ai/.git", + "!node_modules/@woocommerce/ai/.svn", + "!node_modules/@woocommerce/ai/src", + "!node_modules/@woocommerce/components/node_modules", + "!node_modules/@woocommerce/components/.git", + "!node_modules/@woocommerce/components/.svn", + "!node_modules/@woocommerce/components/src", + "!node_modules/@woocommerce/csv-export/node_modules", + "!node_modules/@woocommerce/csv-export/.git", + "!node_modules/@woocommerce/csv-export/.svn", + "!node_modules/@woocommerce/csv-export/src", + "!node_modules/@woocommerce/currency/node_modules", + "!node_modules/@woocommerce/currency/.git", + "!node_modules/@woocommerce/currency/.svn", + "!node_modules/@woocommerce/currency/src", + "!node_modules/@woocommerce/customer-effort-score/node_modules", + "!node_modules/@woocommerce/customer-effort-score/.git", + "!node_modules/@woocommerce/customer-effort-score/.svn", + "!node_modules/@woocommerce/customer-effort-score/src", + "!node_modules/@woocommerce/data/node_modules", + "!node_modules/@woocommerce/data/.git", + "!node_modules/@woocommerce/data/.svn", + "!node_modules/@woocommerce/data/src", + "!node_modules/@woocommerce/date/node_modules", + "!node_modules/@woocommerce/date/.git", + "!node_modules/@woocommerce/date/.svn", + "!node_modules/@woocommerce/date/src", + "!node_modules/@woocommerce/dependency-extraction-webpack-plugin/node_modules", + "!node_modules/@woocommerce/dependency-extraction-webpack-plugin/.git", + "!node_modules/@woocommerce/dependency-extraction-webpack-plugin/.svn", + "!node_modules/@woocommerce/dependency-extraction-webpack-plugin/src", + "!node_modules/@woocommerce/experimental/node_modules", + "!node_modules/@woocommerce/experimental/.git", + "!node_modules/@woocommerce/experimental/.svn", + "!node_modules/@woocommerce/experimental/src", + "!node_modules/@woocommerce/explat/node_modules", + "!node_modules/@woocommerce/explat/.git", + "!node_modules/@woocommerce/explat/.svn", + "!node_modules/@woocommerce/explat/src", + "!node_modules/@woocommerce/internal-js-tests/node_modules", + "!node_modules/@woocommerce/internal-js-tests/.git", + "!node_modules/@woocommerce/internal-js-tests/.svn", + "!node_modules/@woocommerce/internal-js-tests/src", + "!node_modules/@woocommerce/internal-style-build/node_modules", + "!node_modules/@woocommerce/internal-style-build/.git", + "!node_modules/@woocommerce/internal-style-build/.svn", + "!node_modules/@woocommerce/internal-style-build/src", + "!node_modules/@woocommerce/navigation/node_modules", + "!node_modules/@woocommerce/navigation/.git", + "!node_modules/@woocommerce/navigation/.svn", + "!node_modules/@woocommerce/navigation/src", + "!node_modules/@woocommerce/notices/node_modules", + "!node_modules/@woocommerce/notices/.git", + "!node_modules/@woocommerce/notices/.svn", + "!node_modules/@woocommerce/notices/src", + "!node_modules/@woocommerce/number/node_modules", + "!node_modules/@woocommerce/number/.git", + "!node_modules/@woocommerce/number/.svn", + "!node_modules/@woocommerce/number/src", + "!node_modules/@woocommerce/onboarding/node_modules", + "!node_modules/@woocommerce/onboarding/.git", + "!node_modules/@woocommerce/onboarding/.svn", + "!node_modules/@woocommerce/onboarding/src", + "!node_modules/@woocommerce/product-editor/node_modules", + "!node_modules/@woocommerce/product-editor/.git", + "!node_modules/@woocommerce/product-editor/.svn", + "!node_modules/@woocommerce/product-editor/src", + "!node_modules/@woocommerce/tracks/node_modules", + "!node_modules/@woocommerce/tracks/.git", + "!node_modules/@woocommerce/tracks/.svn", + "!node_modules/@woocommerce/tracks/src" + ] + } } } diff --git a/plugins/woocommerce-admin/webpack.config.js b/plugins/woocommerce-admin/webpack.config.js index 41777b4637d..75f97393962 100644 --- a/plugins/woocommerce-admin/webpack.config.js +++ b/plugins/woocommerce-admin/webpack.config.js @@ -102,7 +102,7 @@ const webpackConfig = { : `[name]/index${ outputSuffix }.js`; }, chunkFilename: `chunks/[name]${ outputSuffix }.js`, - path: path.join( __dirname, '/../woocommerce/assets/client/admin' ), + path: path.join( __dirname, '/build' ), library: { // Expose the exports of entry points so we can consume the libraries in window.wc.[modulename] with WooCommerceDependencyExtractionWebpackPlugin. name: [ 'wc', '[modulename]' ], diff --git a/plugins/woocommerce-beta-tester/README.md b/plugins/woocommerce-beta-tester/README.md index 65a1889ebfb..7b4f2cfc700 100644 --- a/plugins/woocommerce-beta-tester/README.md +++ b/plugins/woocommerce-beta-tester/README.md @@ -11,8 +11,8 @@ You can either install the latest version from [wp.org](https://wordpress.org/pl To get started, run the following commands: ```text -pnpm install -pnpm run start +pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester install +pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester start ``` See [wp-scripts](https://github.com/WordPress/gutenberg/tree/master/packages/scripts) for more usage information. diff --git a/plugins/woocommerce-beta-tester/bin/build-zip.sh b/plugins/woocommerce-beta-tester/bin/build-zip.sh index 6771e858ba6..bfc53ef34bb 100755 --- a/plugins/woocommerce-beta-tester/bin/build-zip.sh +++ b/plugins/woocommerce-beta-tester/bin/build-zip.sh @@ -12,7 +12,7 @@ mkdir -p "$DEST_PATH" echo "Installing PHP and JS dependencies..." pnpm install echo "Running JS Build..." -pnpm -w run build --filter=woocommerce-beta-tester || exit "$?" +pnpm --filter='@woocommerce/plugin-woocommerce-beta-tester' build || exit "$?" echo "Syncing files..." rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded diff --git a/plugins/woocommerce-beta-tester/package.json b/plugins/woocommerce-beta-tester/package.json index 9b404c9139c..1fbd09aeca7 100644 --- a/plugins/woocommerce-beta-tester/package.json +++ b/plugins/woocommerce-beta-tester/package.json @@ -1,29 +1,59 @@ { - "name": "woocommerce-beta-tester", + "name": "@woocommerce/plugin-woocommerce-beta-tester", + "version": "2.3.0", + "private": true, "description": "Setting up the local beta tester scripts.", - "license": "GPL-2.0", + "homepage": "http://github.com/woocommerce/woocommerce-beta-tester", "repository": { "type": "git", "url": "git://github.com/woocommerce/woocommerce-beta-tester.git" }, - "title": "WooCommerce Beta Tester", - "version": "2.3.0", - "homepage": "http://github.com/woocommerce/woocommerce-beta-tester", - "devDependencies": { - "@types/react": "^17.0.2", - "@types/react-dom": "^17.0.2", - "@types/wordpress__components": "^19.10.3", - "@types/wordpress__plugins": "3.0.0", - "@woocommerce/dependency-extraction-webpack-plugin": "workspace:*", - "@woocommerce/eslint-plugin": "workspace:*", - "@wordpress/env": "^8.2.0", - "@wordpress/prettier-config": "2.17.0", - "@wordpress/scripts": "^19.2.4", - "eslint": "^8.32.0", - "prettier": "npm:wp-prettier@^2.8.5", - "ts-loader": "^9.4.1", - "typescript": "^5.1.6", - "uglify-js": "^3.5.3" + "license": "GPL-2.0", + "assets": { + "js": { + "min": "assets/js/*.min.js", + "js": "assets/js/*.js" + } + }, + "scripts": { + "build": "pnpm build:admin && pnpm uglify", + "build:admin": "wp-scripts build", + "build:dev": "pnpm lint:js && pnpm build", + "build:zip": "./bin/build-zip.sh", + "changelog": "composer exec -- changelogger", + "check-engines": "wp-scripts check-engines", + "check-licenses": "wp-scripts check-licenses", + "format:js": "wp-scripts format-js", + "postinstall": "composer install", + "lint:css": "wp-scripts lint-style", + "lint:css:fix": "wp-scripts lint-style --fix", + "lint:js": "wp-scripts lint-js", + "lint:js:fix": "wp-scripts lint-js --fix", + "lint:md:docs": "wp-scripts lint-md-docs", + "lint:md:js": "wp-scripts lint-md-js", + "lint:php": "composer run-script phpcs", + "lint:php:fix": "composer run-script phpcbf", + "lint:pkg-json": "wp-scripts lint-pkg-json", + "packages-update": "wp-scripts packages-update", + "start": "wp-scripts start", + "test:e2e": "wp-scripts test-e2e", + "test:unit": "wp-scripts test-unit-js", + "uglify": "rm -f $npm_package_assets_js_min && for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done" + }, + "lint-staged": { + "*.php": [ + "php -d display_errors=1 -l", + "composer run-script phpcs-pre-commit" + ], + "*.(t|j)s?(x)": [ + "npm run lint:js:fix" + ], + "*.scss": [ + "npm run lint:css:fix" + ] + }, + "config": { + "build_step": "pnpm build:zip" }, "dependencies": { "@emotion/react": "^11.10.4", @@ -45,61 +75,32 @@ "@wordpress/plugins": "wp-6.0", "prop-types": "^15.8.1" }, + "devDependencies": { + "@types/react": "^17.0.2", + "@types/react-dom": "^17.0.2", + "@types/wordpress__components": "^19.10.3", + "@types/wordpress__plugins": "3.0.0", + "@woocommerce/dependency-extraction-webpack-plugin": "workspace:*", + "@woocommerce/eslint-plugin": "workspace:*", + "@wordpress/env": "^8.2.0", + "@wordpress/prettier-config": "2.17.0", + "@wordpress/scripts": "^19.2.4", + "eslint": "^8.32.0", + "prettier": "npm:wp-prettier@^2.8.5", + "ts-loader": "^9.4.1", + "typescript": "^5.1.6", + "uglify-js": "^3.5.3", + "wireit": "^0.14.1" + }, "peerDependencies": { "@types/react": "^17.0.2", "@types/react-dom": "^17.0.2", "react": "^17.0.2", "react-dom": "^17.0.2" }, - "assets": { - "js": { - "min": "assets/js/*.min.js", - "js": "assets/js/*.js" - } - }, - "config": { - "build_step": "pnpm run build:zip" - }, - "scripts": { - "postinstall": "composer install", - "changelog": "composer exec -- changelogger", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "turbo:build": "pnpm run build:admin && pnpm run uglify", - "build:admin": "wp-scripts build", - "build:zip": "./bin/build-zip.sh", - "build:dev": "pnpm run lint:js && pnpm run build", - "uglify": "rm -f $npm_package_assets_js_min && for f in $npm_package_assets_js_js; do file=${f%.js}; node_modules/.bin/uglifyjs $f -c -m > $file.min.js; done", - "check-engines": "wp-scripts check-engines", - "check-licenses": "wp-scripts check-licenses", - "format:js": "wp-scripts format-js", - "lint:css": "wp-scripts lint-style", - "lint:css:fix": "wp-scripts lint-style --fix", - "lint:php": "composer run-script phpcs", - "lint:php:fix": "composer run-script phpcbf", - "lint:js": "wp-scripts lint-js", - "lint:js:fix": "wp-scripts lint-js --fix", - "lint:md:docs": "wp-scripts lint-md-docs", - "lint:md:js": "wp-scripts lint-md-js", - "lint:pkg-json": "wp-scripts lint-pkg-json", - "packages-update": "wp-scripts packages-update", - "start": "wp-scripts start", - "test:e2e": "wp-scripts test-e2e", - "test:unit": "wp-scripts test-unit-js" - }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" }, - "lint-staged": { - "*.php": [ - "php -d display_errors=1 -l", - "composer run-script phpcs-pre-commit" - ], - "*.(t|j)s?(x)": [ - "npm run lint:js:fix" - ], - "*.scss": [ - "npm run lint:css:fix" - ] - } + "title": "WooCommerce Beta Tester" } diff --git a/plugins/woocommerce-docs/package.json b/plugins/woocommerce-docs/package.json index b015bf0e52c..c1dfe0f166f 100644 --- a/plugins/woocommerce-docs/package.json +++ b/plugins/woocommerce-docs/package.json @@ -1,21 +1,22 @@ { - "name": "woocommerce-docs", + "name": "@woocommerce/plugin-woocommerce-docs", "version": "1.0.0", + "private": true, "description": "WooCommerce Docs Plugin", + "keywords": [], + "license": "GPL-3.0+", + "author": "", "main": "index.js", "scripts": { "build": "wp-scripts build", - "start": "wp-scripts start", "postinstall": "composer install", + "start": "wp-scripts start", "test": "pnpm test:php", + "test:env-setup": "pnpm test:env:start", "test:env:start": "wp-env start && wp-env run cli --env-cwd=wp-content/plugins/woocommerce-docs composer install", "test:php": "wp-env run tests-cli vendor/bin/phpunit --env-cwd=wp-content/plugins/woocommerce-docs", - "test:env-setup": "pnpm test:env:start", "test:unit": "pnpm test:env:start && pnpm test:php" }, - "keywords": [], - "author": "", - "license": "GPL-3.0+", "dependencies": { "@wordpress/api-fetch": "wp-6.0", "@wordpress/components": "wp-6.0", @@ -38,6 +39,7 @@ "prettier": "npm:wp-prettier@^2.6.2", "ts-loader": "^9.4.1", "ts-node": "^10.9.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" } } diff --git a/plugins/woocommerce/README.md b/plugins/woocommerce/README.md index 0c5d2da5b85..8d574308bff 100644 --- a/plugins/woocommerce/README.md +++ b/plugins/woocommerce/README.md @@ -16,7 +16,7 @@ Please make sure you follow the [repository's getting started guide](../../READM ```bash # Make sure that WooCommerce Core and all of its dependencies are built -pnpm run --filter=woocommerce build +pnpm --filter=@woocommerce/plugin-woocommerce build # Make sure you're in the WooCommerce Core directory cd plugins/woocommerce # Start the development environment @@ -32,13 +32,13 @@ in this way to take advantage of caching to prevent unnecessarily performing exp ### `plugins/woocommerce/client/legacy` -This directory contains the CSS and jQuery code for WooCommerce. +This directory contains the CSS and jQuery code for WooCommerce shortcodes. ```bash # Build the assets. -pnpm run --filter=woocommerce/client/legacy build +pnpm --filter=@woocommerce/shortcode-assets build # Lint the assets. -pnpm run --filter=woocommerce/client/legacy lint +pnpm --filter=@woocommerce/shortcode-assets lint ``` ### `plugins/woocommerce-admin` @@ -47,11 +47,11 @@ This directory contains the React-based admin interface. ```bash # Build the React-based admin client. -pnpm run --filter=woocommerce/client/admin build +pnpm --filter=@woocommerce/admin-library build # Lint the React-based admin client. -pnpm run --filter=woocommerce/client/admin lint +pnpm --filter=@woocommerce/admin-library lint # Test the React-based admin client. -pnpm run --filter=woocommerce/client/admin test +pnpm --filter=@woocommerce/admin-library test ``` #### Helper Scripts @@ -60,13 +60,13 @@ Here is a collection of scripts that can help when developing the React-based ad ```bash # Create a develoment build of the React-based admin client. -pnpm --filter=woocommerce/client/admin dev +pnpm --filter=@woocommerce/admin-library dev # Create and watch a development build of the React-based admin client. -pnpm --filter=woocommerce/client/admin start +pnpm --filter=@woocommerce/admin-library start # Watch the tests of the React-based admin client. -pnpm --filter=woocommerce/client/admin test:watch +pnpm --filter=@woocommerce/admin-library test:watch # Run a type check over the React-based admin client's TypeScript files. -pnpm --filter=woocommerce/client/admin ts:check +pnpm --filter=@woocommerce/admin-library ts:check ``` ## Documentation diff --git a/plugins/woocommerce/assets/css/.gitkeep b/plugins/woocommerce/assets/css/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/plugins/woocommerce/assets/js/.gitkeep b/plugins/woocommerce/assets/js/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/plugins/woocommerce/bin/build-zip.sh b/plugins/woocommerce/bin/build-zip.sh index 86e53d51aa4..2b8fc30b0e6 100755 --- a/plugins/woocommerce/bin/build-zip.sh +++ b/plugins/woocommerce/bin/build-zip.sh @@ -15,11 +15,11 @@ find "$PROJECT_PATH/assets/css/." ! -name '.gitkeep' -type f -exec rm -f {} + && echo "Installing PHP and JS dependencies..." pnpm install echo "Running JS Build..." -pnpm -w run build --filter=woocommerce || exit "$?" +pnpm --filter='@woocommerce/plugin-woocommerce' build || exit "$?" echo "Cleaning up PHP dependencies..." composer install --no-dev || exit "$?" echo "Run makepot..." -pnpm -r --filter=woocommerce run makepot || exit "$?" +pnpm --filter=@woocommerce/plugin-woocommerce makepot || exit "$?" echo "Syncing files..." rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded diff --git a/plugins/woocommerce/bin/generate-feature-config.php b/plugins/woocommerce/bin/generate-feature-config.php index ffe637c880b..33e1c331d3f 100644 --- a/plugins/woocommerce/bin/generate-feature-config.php +++ b/plugins/woocommerce/bin/generate-feature-config.php @@ -14,7 +14,7 @@ $phase = getenv( 'WC_ADMIN_PHASE' ); if ( ! in_array( $phase, array( 'development', 'core' ), true ) ) { - $phase = 'core'; // Default to core when running `pnpm run build`. + $phase = 'core'; // Default to core when running `pnpm build`. } $config_json = file_get_contents( __DIR__ . '/../client/admin/config/' . $phase . '.json' ); $config = json_decode( $config_json ); diff --git a/plugins/woocommerce/bin/package-update.sh b/plugins/woocommerce/bin/package-update.sh index 40422b2586d..e3b64007858 100755 --- a/plugins/woocommerce/bin/package-update.sh +++ b/plugins/woocommerce/bin/package-update.sh @@ -30,7 +30,7 @@ if [ -z "$SKIP_UPDATE_TEXTDOMAINS" ]; then output 3 "Updating package PHP textdomains..." # Replace text domains within packages with woocommerce - pnpm run packages:fix:textdomain + pnpm packages:fix:textdomain output 2 "Done!" output 3 "Updating package JS textdomains..." diff --git a/plugins/woocommerce/client/legacy/Gruntfile.js b/plugins/woocommerce/client/legacy/Gruntfile.js index b1dfc981ba6..13fcc2ff340 100644 --- a/plugins/woocommerce/client/legacy/Gruntfile.js +++ b/plugins/woocommerce/client/legacy/Gruntfile.js @@ -6,11 +6,11 @@ module.exports = function ( grunt ) { // Setting folder templates. dirs: { css: 'css', - cssDest: '../../assets/css', + cssDest: 'build/css', fonts: 'assets/fonts', images: 'assets/images', js: 'js', - jsDest: '../../assets/js', + jsDest: 'build/js', php: 'includes', }, diff --git a/plugins/woocommerce/client/legacy/package.json b/plugins/woocommerce/client/legacy/package.json index ab8cd24119d..bd353996afe 100644 --- a/plugins/woocommerce/client/legacy/package.json +++ b/plugins/woocommerce/client/legacy/package.json @@ -1,14 +1,23 @@ { - "name": "woocommerce/client/legacy", + "name": "@woocommerce/shortcode-assets", "version": "1.0.0", - "author": "Automattic", - "license": "GPL-2.0-or-later", "private": true, + "license": "GPL-2.0-or-later", + "author": "Automattic", "main": "Gruntfile.js", + "files": [ + "build" + ], "scripts": { - "turbo:build": "grunt assets", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "start": "nodemon --watch js --watch css -e js,scss --exec pnpm build" + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "pnpm --if-present /^build:project:.*$/", + "build:project:assets": "wireit", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "watch:build": "pnpm build:project --watch" + }, + "dependencies": { + "sourcebuster": "github:woocommerce/sourcebuster-js#v1.1.2" }, "devDependencies": { "@types/node": "^16.18.18", @@ -33,9 +42,29 @@ "gruntify-eslint": "5.0.0", "nodemon": "^2.0.21", "sass": "^1.45.0", - "stylelint": "13.8.0" + "stylelint": "13.8.0", + "wireit": "^0.14.1" }, - "dependencies": { - "sourcebuster": "github:woocommerce/sourcebuster-js#v1.1.2" + "wireit": { + "build:project:assets": { + "command": "grunt assets", + "files": [ + "Gruntfile.js", + "js/**/*.js", + "css/**/*.scss" + ], + "output": [ + "build" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "package.json" + ] + } } } diff --git a/plugins/woocommerce/includes/class-woocommerce.php b/plugins/woocommerce/includes/class-woocommerce.php index f56b733dc6d..fa4943a2e70 100644 --- a/plugins/woocommerce/includes/class-woocommerce.php +++ b/plugins/woocommerce/includes/class-woocommerce.php @@ -1028,7 +1028,7 @@ final class WooCommerce { return; } - $message_one = __( 'You have installed a development version of WooCommerce which requires files to be built and minified. From the plugin directory, run pnpm install and then pnpm run build --filter=woocommerce to build and minify assets.', 'woocommerce' ); + $message_one = __( 'You have installed a development version of WooCommerce which requires files to be built and minified. From the plugin directory, run pnpm install and then pnpm --filter=\'@woocommerce/plugin-woocommerce\' build to build and minify assets.', 'woocommerce' ); $message_two = sprintf( /* translators: 1: URL of WordPress.org Repository 2: URL of the GitHub Repository release page */ __( 'Or you can download a pre-built version of the plugin from the WordPress.org repository or by visiting the releases page in the GitHub repository.', 'woocommerce' ), diff --git a/plugins/woocommerce/package.json b/plugins/woocommerce/package.json index 6b18e717e83..34181b42a46 100644 --- a/plugins/woocommerce/package.json +++ b/plugins/woocommerce/package.json @@ -1,16 +1,70 @@ { - "name": "woocommerce", - "title": "WooCommerce", + "name": "@woocommerce/plugin-woocommerce", "version": "8.3.0", + "private": true, "homepage": "https://woo.com/", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", + "scripts": { + "build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project", + "build:project": "wireit", + "build:zip": "./bin/build-zip.sh", + "changelog": "composer exec -- changelogger", + "docker:down": "pnpm exec wc-e2e docker:down", + "docker:ssh": "pnpm exec wc-e2e docker:ssh", + "docker:up": "pnpm exec wc-e2e docker:up", + "e2e": "pnpm exec wc-e2e test:e2e", + "e2e:debug": "pnpm exec wc-e2e test:e2e-debug", + "e2e:dev": "pnpm exec wc-e2e test:e2e-dev", + "env:destroy": "pnpm wp-env destroy", + "env:dev": "pnpm wp-env start --update", + "env:down": "pnpm wp-env stop", + "env:performance-init": "./tests/performance/bin/init-sample-products.sh", + "env:restart": "pnpm wp-env destroy && pnpm wp-env start --update", + "env:start": "pnpm wp-env start", + "env:stop": "pnpm wp-env stop", + "env:test": "WP_ENV_LIFECYCLE_SCRIPT_AFTER_START='./tests/e2e-pw/bin/test-env-setup.sh' && pnpm env:dev", + "env:test:cot": "WP_ENV_LIFECYCLE_SCRIPT_AFTER_START='ENABLE_HPOS=1 ./tests/e2e-pw/bin/test-env-setup.sh' && ENABLE_HPOS=1 pnpm env:dev", + "preinstall": "npx only-allow pnpm", + "postinstall": "composer install", + "lint": "pnpm --if-present '/^lint:lang:.*$/'", + "lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'", + "lint:fix:lang:php": "composer run-script phpcbf", + "lint:lang:php": "composer run-script phpcs", + "lint:php": "composer run-script phpcs", + "lint:php:changes": "composer run-script lint", + "lint:php:changes:branch": "composer run-script lint-branch", + "lint:php:changes:staged": "composer run-script lint-staged", + "lint:php:fix": "composer run-script phpcbf", + "make:collection": "pnpm exec wc-api-tests make:collection", + "makepot": "composer run-script makepot", + "packages:fix:textdomain": "node ./bin/package-update-textdomain.js", + "test": "pnpm test:unit", + "test:api": "API_TEST_REPORT_DIR=\"$PWD/tests/api\" pnpm exec wc-api-tests test api", + "test:api-pw": "USE_WP_ENV=1 pnpm playwright test --config=tests/api-core-tests/playwright.config.js", + "test:e2e-pw": "USE_WP_ENV=1 pnpm playwright test --config=tests/e2e-pw/playwright.config.js", + "test:env:start": "pnpm env:test", + "test:php": "./vendor/bin/phpunit -c ./phpunit.xml", + "test:php:env": "wp-env run --env-cwd='wp-content/plugins/woocommerce' tests-cli vendor/bin/phpunit -c phpunit.xml --verbose", + "test:unit": "pnpm test:php", + "test:unit:env": "pnpm test:php:env", + "update-wp-env": "php ./tests/e2e-pw/bin/update-wp-env.php", + "watch:build": "pnpm build:project --watch" + }, + "lint-staged": { + "*.php": [ + "php -d display_errors=1 -l", + "composer run-script lint-staged" + ], + "!(*min).js": [ + "eslint --fix" + ] + }, "config": { - "wp_org_slug": "woocommerce", - "build_step": "pnpm run build:zip", + "build_step": "pnpm build:zip", "ci": { "name": "WP: latest", "customCommands": { @@ -59,51 +113,18 @@ } } ] - } + }, + "wp_org_slug": "woocommerce" }, - "scripts": { - "e2e": "pnpm exec wc-e2e test:e2e", - "turbo:test": "pnpm test:unit", - "preinstall": "npx only-allow pnpm", - "postinstall": "composer install", - "changelog": "composer exec -- changelogger", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "test": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "lint": "pnpm lint:php", - "build:feature-config": "php bin/generate-feature-config.php", - "build:zip": "./bin/build-zip.sh", - "lint:fix": "pnpm lint:js:fix && pnpm lint:php:fix", - "lint:php": "composer run-script phpcs", - "lint:php:fix": "composer run-script phpcbf", - "lint:php:changes": "composer run-script lint", - "lint:php:changes:staged": "composer run-script lint-staged", - "lint:php:changes:branch": "composer run-script lint-branch", - "docker:down": "pnpm exec wc-e2e docker:down", - "docker:ssh": "pnpm exec wc-e2e docker:ssh", - "docker:up": "pnpm exec wc-e2e docker:up", - "env:dev": "pnpm wp-env start --update", - "update-wp-env": "php ./tests/e2e-pw/bin/update-wp-env.php", - "env:test": "WP_ENV_LIFECYCLE_SCRIPT_AFTER_START='./tests/e2e-pw/bin/test-env-setup.sh' && pnpm run env:dev", - "test:e2e-pw": "USE_WP_ENV=1 pnpm playwright test --config=tests/e2e-pw/playwright.config.js", - "test:api-pw": "USE_WP_ENV=1 pnpm playwright test --config=tests/api-core-tests/playwright.config.js", - "env:start": "pnpm wp-env start", - "env:restart": "pnpm wp-env destroy && pnpm wp-env start --update", - "env:stop": "pnpm wp-env stop", - "env:test:cot": "WP_ENV_LIFECYCLE_SCRIPT_AFTER_START='ENABLE_HPOS=1 ./tests/e2e-pw/bin/test-env-setup.sh' && ENABLE_HPOS=1 pnpm run env:dev", - "env:performance-init": "./tests/performance/bin/init-sample-products.sh", - "env:down": "pnpm wp-env stop", - "env:destroy": "pnpm wp-env destroy", - "test:api": "API_TEST_REPORT_DIR=\"$PWD/tests/api\" pnpm exec wc-api-tests test api", - "make:collection": "pnpm exec wc-api-tests make:collection", - "e2e:debug": "pnpm exec wc-e2e test:e2e-debug", - "e2e:dev": "pnpm exec wc-e2e test:e2e-dev", - "test:env:start": "pnpm env:test", - "test:php": "./vendor/bin/phpunit -c ./phpunit.xml", - "test:php:env": "wp-env run --env-cwd='wp-content/plugins/woocommerce' tests-cli vendor/bin/phpunit -c phpunit.xml --verbose", - "test:unit": "pnpm test:php", - "test:unit:env": "pnpm test:php:env", - "makepot": "composer run-script makepot", - "packages:fix:textdomain": "node ./bin/package-update-textdomain.js" + "browserslist": [ + "> 0.1%", + "ie 8", + "ie 9" + ], + "dependencies": { + "@woocommerce/admin-library": "workspace:*", + "@woocommerce/shortcode-assets": "workspace:*", + "@wordpress/browserslist-config": "wp-6.0" }, "devDependencies": { "@babel/cli": "7.12.8", @@ -148,27 +169,67 @@ "uuid": "^8.3.2", "webpack": "5.70.0", "webpack-cli": "3.3.12", + "wireit": "^0.14.1", "wp-textdomain": "1.0.1" }, - "lint-staged": { - "*.php": [ - "php -d display_errors=1 -l", - "composer run-script lint-staged" - ], - "!(*min).js": [ - "eslint --fix" - ] - }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" }, - "browserslist": [ - "> 0.1%", - "ie 8", - "ie 9" - ], - "dependencies": { - "@wordpress/browserslist-config": "wp-6.0" + "title": "WooCommerce", + "wireit": { + "build:project": { + "command": "rm -rf assets/client/admin assets/js assets/css && cp -r ../woocommerce-admin/build assets/client/admin && cp -r client/legacy/build/js assets/js && cp -r client/legacy/build/css assets/css", + "files": [], + "output": [ + "assets/client/admin", + "assets/js", + "assets/css" + ], + "dependencies": [ + "dependencyOutputs" + ] + }, + "dependencyOutputs": { + "allowUsuallyExcludedPaths": true, + "files": [ + "node_modules/@woocommerce/eslint-plugin/configs", + "node_modules/@woocommerce/eslint-plugin/rules", + "node_modules/@woocommerce/eslint-plugin/index.js", + "node_modules/@woocommerce/e2e-utils/", + "node_modules/@woocommerce/e2e-environment/", + "node_modules/@woocommerce/e2e-core-tests/build", + "node_modules/@woocommerce/e2e-core-tests/build-module", + "node_modules/@woocommerce/e2e-core-tests/test-data", + "node_modules/@woocommerce/e2e-core-tests/core-tests-root.js", + "node_modules/@woocommerce/e2e-core-tests/installFiles", + "node_modules/@woocommerce/e2e-core-tests/CHANGELOG.md", + "node_modules/@woocommerce/api-core-tests/", + "node_modules/@woocommerce/api/dist/", + "node_modules/@woocommerce/admin-e2e-tests/build/", + "node_modules/@woocommerce/admin-library/build", + "package.json", + "!node_modules/@woocommerce/admin-e2e-tests/*.ts.map", + "!node_modules/@woocommerce/admin-e2e-tests/*.tsbuildinfo", + "!node_modules/@woocommerce/api/*.ts.map", + "!node_modules/@woocommerce/api/*.tsbuildinfo", + "!node_modules/@woocommerce/api/dist/**/__tests__/", + "!node_modules/@woocommerce/api/dist/**/__mocks__/", + "!node_modules/@woocommerce/api/dist/**/__snapshops__/", + "!node_modules/@woocommerce/api/dist/**/__test_data__/", + "!node_modules/@woocommerce/api-core-tests/node_modules", + "!node_modules/@woocommerce/api-core-tests/.git", + "!node_modules/@woocommerce/api-core-tests/.svn", + "!node_modules/@woocommerce/api-core-tests/src", + "!node_modules/@woocommerce/e2e-environment/node_modules", + "!node_modules/@woocommerce/e2e-environment/.git", + "!node_modules/@woocommerce/e2e-environment/.svn", + "!node_modules/@woocommerce/e2e-environment/src", + "!node_modules/@woocommerce/e2e-utils/node_modules", + "!node_modules/@woocommerce/e2e-utils/.git", + "!node_modules/@woocommerce/e2e-utils/.svn", + "!node_modules/@woocommerce/e2e-utils/src" + ] + } } } diff --git a/plugins/woocommerce/tests/api-core-tests/README.md b/plugins/woocommerce/tests/api-core-tests/README.md index 747e672b086..b26220270f4 100644 --- a/plugins/woocommerce/tests/api-core-tests/README.md +++ b/plugins/woocommerce/tests/api-core-tests/README.md @@ -38,7 +38,7 @@ WooCommerce's `api-core-tests` are powered by Playwright. The test site is spun - `nvm use` - `pnpm install` -- `pnpm run build --filter=woocommerce` +- `pnpm --filter='@woocommerce/plugin-woocommerce' build` - `cd plugins/woocommerce` - `pnpm env:test` - `pnpm test:api-pw` diff --git a/plugins/woocommerce/tests/e2e-pw/README.md b/plugins/woocommerce/tests/e2e-pw/README.md index d80d8db6992..e92ecdaa6a4 100644 --- a/plugins/woocommerce/tests/e2e-pw/README.md +++ b/plugins/woocommerce/tests/e2e-pw/README.md @@ -36,7 +36,7 @@ End-to-end tests are powered by Playwright. The test site is spinned up using `w - `nvm use` (uses the default node version you have set in NVM) - `pnpm install` (installs dependencies) -- `pnpm run build --filter=woocommerce` (builds WooCommerce locally) +- `pnpm --filter='@woocommerce/plugin-woocommerce' build` (builds WooCommerce locally) - `cd plugins/woocommerce` (changes into the WooCommerce plugin folder) - `npx playwright install` (installs the latest Playwright version) - `pnpm env:start` (starts the local environment) diff --git a/plugins/woocommerce/tests/e2e/README.md b/plugins/woocommerce/tests/e2e/README.md index 397d0a592fa..0eb955bada6 100644 --- a/plugins/woocommerce/tests/e2e/README.md +++ b/plugins/woocommerce/tests/e2e/README.md @@ -120,11 +120,11 @@ Run the following in a terminal/command line window - `pnpm install` -- `pnpm run build --filter=woocommerce` +- `pnpm --filter='@woocommerce/plugin-woocommerce' build` - `npm install jest --global` (this only needs to be done once) -- `pnpm docker:up --filter=woocommerce` (this will build the test site using Docker) +- `pnpm --filter='@woocommerce/plugin-woocommerce' docker:up` (this will build the test site using Docker) - Use `docker ps` to confirm that the Docker containers are running. You should see a log similar to one below indicating that everything had been built as expected: @@ -150,16 +150,16 @@ Username: admin PW: password ``` -- Run `pnpm docker:down --filter=woocommerce` when you are done with running e2e tests and before making any changes to test site configuration. +- Run `pnpm docker:down --filter=@woocommerce/plugin-woocommerce` when you are done with running e2e tests and before making any changes to test site configuration. -Note that running `pnpm docker:down --filter=woocommerce` and then `pnpm docker:up --filter=woocommerce` re-initializes the test container. +Note that running `pnpm docker:down --filter=@woocommerce/plugin-woocommerce` and then `pnpm docker:up --filter=@woocommerce/plugin-woocommerce` re-initializes the test container. ### How to run tests in headless mode To run e2e tests in headless mode use the following command: ```bash -pnpm run e2e --filter=woocommerce +pnpm e2e --filter=@woocommerce/plugin-woocommerce ``` ### How to run tests in non-headless mode @@ -167,7 +167,7 @@ pnpm run e2e --filter=woocommerce Tests run in headless mode by default. However, sometimes it's useful to observe the browser while running or developing tests. To do so, you can run tests in a non-headless (dev) mode: ```bash -pnpm run e2e:dev --filter=woocommerce +pnpm e2e:dev --filter=@woocommerce/plugin-woocommerce ``` The dev mode also enables SlowMo mode. SlowMo slows down Puppeteer’s operations. This makes it easier to see what is happening in the browser. @@ -175,7 +175,7 @@ The dev mode also enables SlowMo mode. SlowMo slows down Puppeteer’s operation By default, SlowMo mode adds a 50 millisecond delay between test steps. If you'd like to override the length of the delay and have the tests run faster or slower in the `-dev` mode, pass `PUPPETEER_SLOWMO` variable when running tests as shown below: ``` -PUPPETEER_SLOWMO=10 pnpm run e2e:dev --filter=woocommerce +PUPPETEER_SLOWMO=10 pnpm e2e:dev --filter=@woocommerce/plugin-woocommerce ``` The faster you want the tests to run, the lower the value should be of `PUPPETEER_SLOWMO` should be. @@ -199,7 +199,7 @@ E2E_RETRY_TIMES=2 pnpm exec wc-e2e test:e2e Tests run in headless mode by default. While writing tests it may be useful to have the debugger loaded while running a test in non-headless mode. To run tests in debug mode: ```bash -pnpm run e2e:debug --filter=woocommerce +pnpm e2e:debug --filter=@woocommerce/plugin-woocommerce ``` When all tests have been completed the debugger remains active. Control doesn't return to the command line until the debugger is closed. Otherwise, debug mode functions the same as non-headless mode. @@ -270,7 +270,7 @@ The following variables can be used to specify the versions of WordPress, PHP an The full command to build the site will look as follows: ``` -TRAVIS_MARIADB_VERSION=10.5.3 TRAVIS_PHP_VERSION=7.4.5 WP_VERSION=5.4.1 pnpm docker:up --filter=woocommerce +TRAVIS_MARIADB_VERSION=10.5.3 TRAVIS_PHP_VERSION=7.4.5 WP_VERSION=5.4.1 pnpm docker:up --filter=@woocommerce/plugin-woocommerce ``` ## Guide for writing e2e tests @@ -378,6 +378,6 @@ The [WooCommerce E2E Tests Boilerplate repo](https://github.com/woocommerce/wooc ## Debugging tests -The test sequencer (`pnpm run e2e --filter=woocommerce`) includes support for saving [screenshots on test errors](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#test-screenshots) which can be sent to a Slack channel via a [Slackbot](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#slackbot-setup). +The test sequencer (`pnpm e2e --filter=@woocommerce/plugin-woocommerce`) includes support for saving [screenshots on test errors](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#test-screenshots) which can be sent to a Slack channel via a [Slackbot](https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/e2e-environment#slackbot-setup). For Puppeteer debugging, follow [Google's documentation](https://developers.google.com/web/tools/puppeteer/debugging). diff --git a/plugins/woocommerce/tests/performance/README.md b/plugins/woocommerce/tests/performance/README.md index 2364ed7df08..659003bc54d 100644 --- a/plugins/woocommerce/tests/performance/README.md +++ b/plugins/woocommerce/tests/performance/README.md @@ -57,8 +57,8 @@ Before using the tests a test environment is needed to run against. We first spin up an environment using `wp-env` and configure that environment with the necessary plugins and data using the Initialization Script [`init-sample-products.sh`](https://github.com/woocommerce/woocommerce/tree/trunk/plugins/woocommerce/tests/performance/bin/init-sample-products.sh) that will set up a shop with sample products imported and the shop settings (payment method, permalinks, address etc) needed for the tests already set. It is recommended using this to just see the tests in action. ```sh -pnpm run env:dev --filter=woocommerce -pnpm run env:performance-init --filter=woocommerce +pnpm env:dev --filter=@woocommerce/plugin-woocommerce +pnpm env:performance-init --filter=@woocommerce/plugin-woocommerce ``` If using a different environment the details can be changed in `config.js`. diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 3b98d7feb09..99d3128acfc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,10 +30,10 @@ importers: version: 1.0.1 devDependencies: '@babel/preset-env': - specifier: ^7.20.2 + specifier: ^7.23.3 version: 7.23.5(@babel/core@7.12.9) '@babel/runtime': - specifier: ^7.21.0 + specifier: ^7.23.4 version: 7.23.5 '@types/node': specifier: ^16.18.18 @@ -60,10 +60,10 @@ importers: specifier: ^10.2.4 version: 10.2.4(webpack@5.89.0) core-js: - specifier: ^3.29.1 - version: 3.33.3 + specifier: ^3.33.3 + version: 3.34.0 css-loader: - specifier: ^6.7.3 + specifier: ^6.8.1 version: 6.8.1(webpack@5.89.0) glob: specifier: ^7.2.3 @@ -99,17 +99,14 @@ importers: specifier: ^2.88.2 version: 2.88.2 sass: - specifier: ^1.59.3 + specifier: ^1.69.5 version: 1.69.5 sass-loader: specifier: ^10.4.1 version: 10.4.1(sass@1.69.5)(webpack@5.89.0) syncpack: - specifier: ^10.7.3 + specifier: ^10.9.3 version: 10.9.3 - turbo: - specifier: ^1.10.7 - version: 1.10.16 typescript: specifier: ^5.1.6 version: 5.3.2 @@ -117,7 +114,7 @@ importers: specifier: ^1.1.2 version: 1.1.2(webpack@5.89.0) webpack: - specifier: ^5.76.2 + specifier: ^5.89.0 version: 5.89.0(webpack-cli@5.1.4) packages/js/admin-e2e-tests: @@ -183,6 +180,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/admin-layout: dependencies: @@ -253,6 +253,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/ai: dependencies: @@ -386,6 +389,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/api: dependencies: @@ -432,12 +438,15 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/api-core-tests: dependencies: allure-commandline: specifier: ^2.17.2 - version: 2.24.1 + version: 2.25.0 dotenv: specifier: ^10.0.0 version: 10.0.0 @@ -463,6 +472,9 @@ importers: eslint: specifier: ^8.32.0 version: 8.55.0 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/block-templates: dependencies: @@ -566,6 +578,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/components: dependencies: @@ -691,7 +706,7 @@ importers: version: 2.3.2 core-js: specifier: ^3.21.1 - version: 3.33.3 + version: 3.34.0 d3-axis: specifier: ^1.0.12 version: 1.0.12 @@ -891,10 +906,21 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 - packages/js/create-product-editor-block: {} + packages/js/create-product-editor-block: + devDependencies: + wireit: + specifier: ^0.14.1 + version: 0.14.1 - packages/js/create-woo-extension: {} + packages/js/create-woo-extension: + devDependencies: + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/csv-export: dependencies: @@ -941,6 +967,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/currency: dependencies: @@ -996,6 +1025,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/customer-effort-score: dependencies: @@ -1117,6 +1149,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/data: dependencies: @@ -1253,6 +1288,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/date: dependencies: @@ -1323,6 +1361,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/dependency-extraction-webpack-plugin: dependencies: @@ -1360,6 +1401,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/e2e-core-tests: dependencies: @@ -1424,6 +1468,9 @@ importers: eslint-plugin-jest: specifier: 23.20.0 version: 23.20.0(eslint@8.55.0)(typescript@5.3.2) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/e2e-environment: dependencies: @@ -1527,6 +1574,9 @@ importers: semver: specifier: ^7.3.2 version: 7.5.4 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/e2e-utils: dependencies: @@ -1600,6 +1650,9 @@ importers: eslint-plugin-jest: specifier: 23.20.0 version: 23.20.0(eslint@8.55.0)(typescript@5.3.2) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/eslint-plugin: dependencies: @@ -1643,6 +1696,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/experimental: dependencies: @@ -1721,7 +1777,7 @@ importers: version: 27.5.2 '@types/react-transition-group': specifier: ^4.4.4 - version: 4.4.9 + version: 4.4.10 '@types/testing-library__jest-dom': specifier: ^5.14.3 version: 5.14.9 @@ -1779,6 +1835,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/explat: dependencies: @@ -1846,6 +1905,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/expression-evaluation: dependencies: @@ -1889,8 +1951,15 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 - packages/js/extend-cart-checkout-block: {} + packages/js/extend-cart-checkout-block: + devDependencies: + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/integrate-plugin: dependencies: @@ -1982,6 +2051,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/internal-e2e-builds: devDependencies: @@ -2006,6 +2078,9 @@ importers: mkdirp: specifier: ^1.0.4 version: 1.0.4 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/internal-js-tests: dependencies: @@ -2058,6 +2133,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/internal-style-build: dependencies: @@ -2116,6 +2194,9 @@ importers: webpack: specifier: ^5.70.0 version: 5.89.0(webpack-cli@5.1.4) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/navigation: dependencies: @@ -2195,6 +2276,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/notices: dependencies: @@ -2259,6 +2343,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/number: dependencies: @@ -2305,6 +2392,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/onboarding: dependencies: @@ -2417,6 +2507,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/product-editor: dependencies: @@ -2670,6 +2763,9 @@ importers: webpack-cli: specifier: ^3.3.12 version: 3.3.12(webpack@5.89.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages/js/tracks: dependencies: @@ -2707,6 +2803,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 plugins/woo-ai: dependencies: @@ -2825,9 +2924,18 @@ importers: uglify-js: specifier: ^3.5.3 version: 3.17.4 + wireit: + specifier: ^0.14.1 + version: 0.14.1 plugins/woocommerce: dependencies: + '@woocommerce/admin-library': + specifier: workspace:* + version: link:../woocommerce-admin + '@woocommerce/shortcode-assets': + specifier: workspace:* + version: link:client/legacy '@wordpress/browserslist-config': specifier: wp-6.0 version: 4.1.3 @@ -2894,7 +3002,7 @@ importers: version: 19.1.0(stylelint@13.8.0) allure-commandline: specifier: ^2.17.2 - version: 2.24.1 + version: 2.25.0 allure-playwright: specifier: ^2.0.0-beta.16 version: 2.9.2 @@ -2958,6 +3066,9 @@ importers: webpack-cli: specifier: 3.3.12 version: 3.3.12(webpack@5.70.0) + wireit: + specifier: ^0.14.1 + version: 0.14.1 wp-textdomain: specifier: 1.0.1 version: 1.0.1 @@ -3080,7 +3191,7 @@ importers: version: 2.3.2 core-js: specifier: ^3.21.1 - version: 3.33.3 + version: 3.34.0 debug: specifier: ^4.3.3 version: 4.3.4(supports-color@9.4.0) @@ -3219,7 +3330,7 @@ importers: version: 5.3.3 '@types/react-transition-group': specifier: ^4.4.4 - version: 4.4.9 + version: 4.4.10 '@types/testing-library__jest-dom': specifier: ^5.14.3 version: 5.14.9 @@ -3526,6 +3637,9 @@ importers: webpack-rtl-plugin: specifier: ^2.0.0 version: 2.0.0 + wireit: + specifier: ^0.14.1 + version: 0.14.1 plugins/woocommerce-beta-tester: dependencies: @@ -3632,6 +3746,9 @@ importers: uglify-js: specifier: ^3.5.3 version: 3.17.4 + wireit: + specifier: ^0.14.1 + version: 0.14.1 plugins/woocommerce-docs: dependencies: @@ -3696,6 +3813,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 plugins/woocommerce/client/legacy: dependencies: @@ -3772,6 +3892,9 @@ importers: stylelint: specifier: 13.8.0 version: 13.8.0 + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/code-analyzer: dependencies: @@ -3833,6 +3956,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/create-extension: dependencies: @@ -3845,6 +3971,10 @@ importers: promptly: specifier: ^3.2.0 version: 3.2.0 + devDependencies: + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/monorepo-merge: dependencies: @@ -3894,6 +4024,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/monorepo-utils: dependencies: @@ -3991,6 +4124,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/package-release: dependencies: @@ -4034,6 +4170,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/release-posts: dependencies: @@ -4107,6 +4246,9 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 + wireit: + specifier: ^0.14.1 + version: 0.14.1 tools/storybook: dependencies: @@ -4189,6 +4331,9 @@ importers: webpack: specifier: ^5.70.0 version: 5.89.0(webpack-cli@5.1.4) + wireit: + specifier: ^0.14.1 + version: 0.14.1 packages: @@ -6984,7 +7129,7 @@ packages: '@babel/plugin-transform-unicode-regex': 7.23.3(@babel/core@7.12.9) '@babel/preset-modules': 0.1.6(@babel/core@7.12.9) '@babel/types': 7.23.5 - core-js-compat: 3.33.3 + core-js-compat: 3.34.0 semver: 5.7.2 /@babel/preset-env@7.23.5(@babel/core@7.12.9): @@ -7072,7 +7217,7 @@ packages: babel-plugin-polyfill-corejs2: 0.4.6(@babel/core@7.12.9) babel-plugin-polyfill-corejs3: 0.8.6(@babel/core@7.12.9) babel-plugin-polyfill-regenerator: 0.5.3(@babel/core@7.12.9) - core-js-compat: 3.33.3 + core-js-compat: 3.34.0 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -7163,7 +7308,7 @@ packages: babel-plugin-polyfill-corejs2: 0.4.6(@babel/core@7.23.5) babel-plugin-polyfill-corejs3: 0.8.6(@babel/core@7.23.5) babel-plugin-polyfill-regenerator: 0.5.3(@babel/core@7.23.5) - core-js-compat: 3.33.3 + core-js-compat: 3.34.0 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -9827,7 +9972,7 @@ packages: dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 - core-js-pure: 3.33.3 + core-js-pure: 3.34.0 error-stack-parser: 2.1.4 find-up: 5.0.0 html-entities: 2.4.0 @@ -9866,7 +10011,7 @@ packages: dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 - core-js-pure: 3.33.3 + core-js-pure: 3.34.0 error-stack-parser: 2.1.4 find-up: 5.0.0 html-entities: 2.4.0 @@ -11376,7 +11521,7 @@ packages: '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) axe-core: 4.8.2 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 lodash: 4.17.21 react: 17.0.2 @@ -11405,7 +11550,7 @@ packages: '@storybook/core-events': 6.5.17-alpha.0 '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11450,7 +11595,7 @@ packages: '@storybook/node-logger': 6.5.17-alpha.0 '@storybook/store': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 lodash: 4.17.21 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -11497,7 +11642,7 @@ packages: '@storybook/store': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) babel-loader: 8.3.0(@babel/core@7.23.5)(webpack@5.89.0) - core-js: 3.33.3 + core-js: 3.34.0 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11542,7 +11687,7 @@ packages: '@storybook/core-events': 6.5.17-alpha.0 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) copy-to-clipboard: 3.3.3 - core-js: 3.33.3 + core-js: 3.34.0 escape-html: 1.0.3 fast-deep-equal: 3.1.3 global: 4.4.0 @@ -11578,7 +11723,7 @@ packages: '@storybook/core-events': 7.6.3 '@storybook/theming': 7.6.3(react-dom@16.14.0)(react@17.0.2) copy-to-clipboard: 3.3.3 - core-js: 3.33.3 + core-js: 3.34.0 escape-html: 1.0.3 fast-deep-equal: 3.1.3 global: 4.4.0 @@ -11611,7 +11756,7 @@ packages: '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/router': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@types/qs': 6.9.10 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 prop-types: 15.8.1 qs: 6.11.2 @@ -11639,7 +11784,7 @@ packages: '@storybook/router': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/source-loader': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 estraverse: 5.3.0 loader-utils: 2.0.4 prop-types: 15.8.1 @@ -11666,7 +11811,7 @@ packages: '@storybook/components': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/core-events': 6.5.17-alpha.0 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 memoizerific: 1.11.3 prop-types: 15.8.1 @@ -11689,7 +11834,7 @@ packages: '@storybook/router': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@types/webpack-env': 1.18.4 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -11720,7 +11865,7 @@ packages: '@storybook/router': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/semver': 7.3.2 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11776,7 +11921,7 @@ packages: autoprefixer: 9.8.6 babel-loader: 8.3.0(@babel/core@7.23.5)(webpack@4.47.0) case-sensitive-paths-webpack-plugin: 2.4.0 - core-js: 3.33.3 + core-js: 3.34.0 css-loader: 3.6.0(webpack@4.47.0) file-loader: 6.2.0(webpack@4.47.0) find-up: 5.0.0 @@ -11844,7 +11989,7 @@ packages: babel-plugin-named-exports-order: 0.0.2 browser-assert: 1.2.1 case-sensitive-paths-webpack-plugin: 2.4.0 - core-js: 3.33.3 + core-js: 3.34.0 css-loader: 5.2.7(webpack@5.89.0) fork-ts-checker-webpack-plugin: 6.5.3(eslint@8.55.0)(typescript@5.3.2)(webpack@5.89.0) glob: 7.2.3 @@ -11881,7 +12026,7 @@ packages: '@storybook/channels': 6.5.17-alpha.0 '@storybook/client-logger': 6.5.17-alpha.0 '@storybook/core-events': 6.5.17-alpha.0 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 qs: 6.11.2 telejson: 6.0.8 @@ -11892,7 +12037,7 @@ packages: dependencies: '@storybook/channels': 6.5.17-alpha.0 '@storybook/client-logger': 6.5.17-alpha.0 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 telejson: 6.0.8 dev: true @@ -11900,7 +12045,7 @@ packages: /@storybook/channels@6.5.17-alpha.0: resolution: {integrity: sha512-yfMGsvtWVFK27FO7orjCZmzoq0Zk/48A5CyqFz9lgyttuzKfltUOIwUpu7mvk/56lJFgDv9yRigD6iVltIMAeA==} dependencies: - core-js: 3.33.3 + core-js: 3.34.0 ts-dedent: 2.2.0 util-deprecate: 1.0.2 dev: true @@ -11931,7 +12076,7 @@ packages: '@storybook/store': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@types/qs': 6.9.10 '@types/webpack-env': 1.18.4 - core-js: 3.33.3 + core-js: 3.34.0 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11949,7 +12094,7 @@ packages: /@storybook/client-logger@6.5.17-alpha.0: resolution: {integrity: sha512-1g9cGPlp016xKsOv05U4NfhdOrVN7ra6gkkovYy/sZhzOH3ouXGebMw2dMMCGPXBx0MNXK0jnDEj+r3mXPP6BQ==} dependencies: - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 dev: true @@ -11968,7 +12113,7 @@ packages: '@storybook/client-logger': 6.5.17-alpha.0 '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 memoizerific: 1.11.3 qs: 6.11.2 react: 17.0.2 @@ -12023,7 +12168,7 @@ packages: '@storybook/ui': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) airbnb-js-shims: 2.2.1 ansi-to-html: 0.6.15 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 lodash: 4.17.21 qs: 6.11.2 @@ -12060,7 +12205,7 @@ packages: '@storybook/ui': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) airbnb-js-shims: 2.2.1 ansi-to-html: 0.6.15 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 lodash: 4.17.21 qs: 6.11.2 @@ -12114,7 +12259,7 @@ packages: babel-plugin-macros: 3.1.0 babel-plugin-polyfill-corejs3: 0.1.7(@babel/core@7.23.5) chalk: 4.1.2 - core-js: 3.33.3 + core-js: 3.34.0 express: 4.18.2 file-system-cache: 1.1.0 find-up: 5.0.0 @@ -12148,7 +12293,7 @@ packages: /@storybook/core-events@6.5.17-alpha.0: resolution: {integrity: sha512-L2QV/isJymOBZp6Q1Q1GMZnLDIs2blwyzCh8auAnVBbluVzpUs8WULvXLvBhSwXULpGZVujt8ToL+aoVTHleFA==} dependencies: - core-js: 3.33.3 + core-js: 3.34.0 dev: true /@storybook/core-events@7.6.3: @@ -12197,7 +12342,7 @@ packages: cli-table3: 0.6.3 commander: 6.2.1 compression: 1.7.4 - core-js: 3.33.3 + core-js: 3.34.0 cpy: 8.1.2 detect-port: 1.5.1 express: 4.18.2 @@ -12274,7 +12419,7 @@ packages: cli-table3: 0.6.3 commander: 6.2.1 compression: 1.7.4 - core-js: 3.33.3 + core-js: 3.34.0 cpy: 8.1.2 detect-port: 1.5.1 express: 4.18.2 @@ -12404,7 +12549,7 @@ packages: '@babel/types': 7.23.5 '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/mdx1-csf': 0.0.1(@babel/core@7.23.5) - core-js: 3.33.3 + core-js: 3.34.0 fs-extra: 9.1.0 global: 4.4.0 regenerator-runtime: 0.13.11 @@ -12431,7 +12576,7 @@ packages: '@babel/core': 7.23.5 '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/store': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 doctrine: 3.0.0 lodash: 4.17.21 regenerator-runtime: 0.13.11 @@ -12492,7 +12637,7 @@ packages: babel-loader: 8.3.0(@babel/core@7.23.5)(webpack@4.47.0) case-sensitive-paths-webpack-plugin: 2.4.0 chalk: 4.1.2 - core-js: 3.33.3 + core-js: 3.34.0 css-loader: 3.6.0(webpack@4.47.0) express: 4.18.2 file-loader: 6.2.0(webpack@4.47.0) @@ -12549,7 +12694,7 @@ packages: babel-loader: 8.3.0(@babel/core@7.23.5)(webpack@5.89.0) case-sensitive-paths-webpack-plugin: 2.4.0 chalk: 4.1.2 - core-js: 3.33.3 + core-js: 3.34.0 css-loader: 5.2.7(webpack@5.89.0) express: 4.18.2 find-up: 5.0.0 @@ -12607,7 +12752,7 @@ packages: dependencies: '@types/npmlog': 4.1.6 chalk: 4.1.2 - core-js: 3.33.3 + core-js: 3.34.0 npmlog: 5.0.1 pretty-hrtime: 1.0.3 dev: true @@ -12615,7 +12760,7 @@ packages: /@storybook/postinstall@6.5.17-alpha.0: resolution: {integrity: sha512-ipK7F0Yz7igGgxg1KfJYN++U7XGA0eNqB93CPK4nux7OLbbI+w4LaH22OmnFt+je/TXaKyIt/DZKYP0qVYk7iQ==} dependencies: - core-js: 3.33.3 + core-js: 3.34.0 dev: true /@storybook/preview-api@7.6.3: @@ -12650,7 +12795,7 @@ packages: '@storybook/csf': 0.0.2--canary.4566f4d.1 '@storybook/store': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) ansi-to-html: 0.6.15 - core-js: 3.33.3 + core-js: 3.34.0 global: 4.4.0 lodash: 4.17.21 qs: 6.11.2 @@ -12734,7 +12879,7 @@ packages: acorn-walk: 7.2.0 babel-plugin-add-react-displayname: 0.0.5 babel-plugin-react-docgen: 4.2.1 - core-js: 3.33.3 + core-js: 3.34.0 escodegen: 2.1.0 fs-extra: 9.1.0 global: 4.4.0 @@ -12824,7 +12969,7 @@ packages: acorn-walk: 7.2.0 babel-plugin-add-react-displayname: 0.0.5 babel-plugin-react-docgen: 4.2.1 - core-js: 3.33.3 + core-js: 3.34.0 escodegen: 2.1.0 fs-extra: 9.1.0 global: 4.4.0 @@ -12871,7 +13016,7 @@ packages: react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: '@storybook/client-logger': 6.5.17-alpha.0 - core-js: 3.33.3 + core-js: 3.34.0 memoizerific: 1.11.3 qs: 6.11.2 react: 17.0.2 @@ -12892,7 +13037,7 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - core-js: 3.33.3 + core-js: 3.34.0 find-up: 4.1.0 dev: true @@ -12905,7 +13050,7 @@ packages: '@storybook/addons': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/client-logger': 6.5.17-alpha.0 '@storybook/csf': 0.0.2--canary.4566f4d.1 - core-js: 3.33.3 + core-js: 3.34.0 estraverse: 5.3.0 global: 4.4.0 loader-utils: 2.0.4 @@ -12926,7 +13071,7 @@ packages: '@storybook/client-logger': 6.5.17-alpha.0 '@storybook/core-events': 6.5.17-alpha.0 '@storybook/csf': 0.0.2--canary.4566f4d.1 - core-js: 3.33.3 + core-js: 3.34.0 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -12947,7 +13092,7 @@ packages: '@storybook/client-logger': 6.5.17-alpha.0 '@storybook/core-common': 6.5.17-alpha.0(eslint@8.55.0)(react-dom@17.0.2)(react@17.0.2)(typescript@5.3.2)(webpack-cli@3.3.12) chalk: 4.1.2 - core-js: 3.33.3 + core-js: 3.34.0 detect-package-manager: 2.0.1 fetch-retry: 5.0.6 fs-extra: 9.1.0 @@ -12975,7 +13120,7 @@ packages: react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 dependencies: '@storybook/client-logger': 6.5.17-alpha.0 - core-js: 3.33.3 + core-js: 3.34.0 memoizerific: 1.11.3 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -13020,7 +13165,7 @@ packages: '@storybook/router': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) '@storybook/semver': 7.3.2 '@storybook/theming': 6.5.17-alpha.0(react-dom@17.0.2)(react@17.0.2) - core-js: 3.33.3 + core-js: 3.34.0 memoizerific: 1.11.3 qs: 6.11.2 react: 17.0.2 @@ -13964,8 +14109,8 @@ packages: '@types/react': 17.0.71 dev: true - /@types/react-transition-group@4.4.9: - resolution: {integrity: sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==} + /@types/react-transition-group@4.4.10: + resolution: {integrity: sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==} dependencies: '@types/react': 17.0.71 dev: true @@ -15379,7 +15524,7 @@ packages: '@wordpress/browserslist-config': 2.7.0 '@wordpress/element': 2.20.3 '@wordpress/warning': 1.4.2 - core-js: 3.33.3 + core-js: 3.34.0 transitivePeerDependencies: - supports-color dev: true @@ -15399,7 +15544,7 @@ packages: '@wordpress/element': 4.20.0 '@wordpress/warning': 2.47.0 browserslist: 4.19.3 - core-js: 3.33.3 + core-js: 3.34.0 transitivePeerDependencies: - supports-color @@ -15417,7 +15562,7 @@ packages: '@wordpress/browserslist-config': 5.30.0 '@wordpress/warning': 2.47.0 browserslist: 4.22.2 - core-js: 3.33.3 + core-js: 3.34.0 react: 17.0.2 transitivePeerDependencies: - supports-color @@ -16236,7 +16381,7 @@ packages: dom-scroll-into-view: 1.2.1 downshift: 6.1.12(react@17.0.2) fast-deep-equal: 3.1.3 - framer-motion: 10.16.12(react-dom@17.0.2)(react@17.0.2) + framer-motion: 10.16.14(react-dom@17.0.2)(react@17.0.2) gradient-parser: 0.1.5 highlight-words-core: 1.2.2 is-plain-object: 5.0.0 @@ -19038,8 +19183,8 @@ packages: require-from-string: 2.0.2 uri-js: 4.4.1 - /allure-commandline@2.24.1: - resolution: {integrity: sha512-eNto3ipBq+O2B/f8/OwiS3E8R7jYENs3qv8jT7wMZmziYLANsISC9tX/FfEqR3FDiQlEOjkP7iyTEZ3ph53FPg==} + /allure-commandline@2.25.0: + resolution: {integrity: sha512-HYMQwuX/8ySTrXqgr6ZY830c6xgRbSusxVwZIBbDyNTCDb3mqK2b1ENjsD8yhl/7/8S02NZCDAwJFxt3f8qL9Q==} hasBin: true /allure-js-commons@1.3.2: @@ -19622,8 +19767,8 @@ packages: resolution: {integrity: sha512-BQUiyBLScS0+YPnnCZZGjb78mZ8sQ8aKgxarDPNw05rpbaCS7VIQSLy2tgjZKct9Dn1xLbKMXOpA98OWei90zA==} dev: true - /aws-sdk@2.1511.0: - resolution: {integrity: sha512-LikcMeIzA1fu+j8qElVmPDpWBFsMzd8pwQoo33xXhIwtWaMoaBMI5vGGz/cvdn3LnjkRcEntWZeE8haULsy+bA==} + /aws-sdk@2.1512.0: + resolution: {integrity: sha512-+YYS18VsMUdUaZdsVsE+heJmrAwbxcbyw/9B6Ck90ehlRjjU2SELKH7zhpxbgRH00z8Z4ltaLwRhsp69kLHflQ==} engines: {node: '>= 10.0.0'} dependencies: buffer: 4.9.2 @@ -20114,7 +20259,7 @@ packages: dependencies: '@babel/core': 7.23.5 '@babel/helper-define-polyfill-provider': 0.1.5(@babel/core@7.23.5) - core-js-compat: 3.33.3 + core-js-compat: 3.34.0 transitivePeerDependencies: - supports-color dev: true @@ -20126,7 +20271,7 @@ packages: dependencies: '@babel/core': 7.12.9 '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.12.9) - core-js-compat: 3.33.3 + core-js-compat: 3.34.0 transitivePeerDependencies: - supports-color @@ -20137,7 +20282,7 @@ packages: dependencies: '@babel/core': 7.23.5 '@babel/helper-define-polyfill-provider': 0.4.3(@babel/core@7.23.5) - core-js-compat: 3.33.3 + core-js-compat: 3.34.0 transitivePeerDependencies: - supports-color @@ -20832,7 +20977,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001146 - electron-to-chromium: 1.4.603 + electron-to-chromium: 1.4.604 dev: true /browserslist@4.19.3: @@ -20841,7 +20986,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001566 - electron-to-chromium: 1.4.603 + electron-to-chromium: 1.4.604 escalade: 3.1.1 node-releases: 2.0.14 picocolors: 1.0.0 @@ -20852,7 +20997,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001566 - electron-to-chromium: 1.4.603 + electron-to-chromium: 1.4.604 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) @@ -22312,13 +22457,13 @@ packages: webpack: 5.89.0(webpack-cli@3.3.12) dev: true - /core-js-compat@3.33.3: - resolution: {integrity: sha512-cNzGqFsh3Ot+529GIXacjTJ7kegdt5fPXxCBVS1G0iaZpuo/tBz399ymceLJveQhFFZ8qThHiP3fzuoQjKN2ow==} + /core-js-compat@3.34.0: + resolution: {integrity: sha512-4ZIyeNbW/Cn1wkMMDy+mvrRUxrwFNjKwbhCfQpDd+eLgYipDqp8oGFGtLmhh18EDPKA0g3VUBYOxQGGwvWLVpA==} dependencies: browserslist: 4.22.2 - /core-js-pure@3.33.3: - resolution: {integrity: sha512-taJ00IDOP+XYQEA2dAe4ESkmHt1fL8wzYDo3mRWQey8uO9UojlBFMneA65kMyxfYP7106c6LzWaq7/haDT6BCQ==} + /core-js-pure@3.34.0: + resolution: {integrity: sha512-pmhivkYXkymswFfbXsANmBAewXx86UBfmagP+w0wkK06kLsLlTK5oQmsURPivzMkIBQiYq2cjamcZExIwlFQIg==} requiresBuild: true dev: true @@ -22332,8 +22477,8 @@ packages: deprecated: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js. requiresBuild: true - /core-js@3.33.3: - resolution: {integrity: sha512-lo0kOocUlLKmm6kv/FswQL8zbkH7mVsLJ/FULClOhv8WRVmKLVcs6XPNQAzstfeJTCHMyButEwG+z1kHxHoDZw==} + /core-js@3.34.0: + resolution: {integrity: sha512-aDdvlDder8QmY91H88GzNi9EtQi2TjvQhpCX6B1v/dAZHU1AuLgHvRh54RiOerpEhEW46Tkf+vgAViB/CWC0ag==} requiresBuild: true /core-util-is@1.0.2: @@ -23923,8 +24068,8 @@ packages: dependencies: jake: 10.8.7 - /electron-to-chromium@1.4.603: - resolution: {integrity: sha512-Dvo5OGjnl7AZTU632dFJtWj0uJK835eeOVQIuRcmBmsFsTNn3cL05FqOyHAfGQDIoHfLhyJ1Tya3PJ0ceMz54g==} + /electron-to-chromium@1.4.604: + resolution: {integrity: sha512-JAJ4lyLJYudlgJPYJicimU9R+qZ/3iyeyQS99bfT7PWi7psYWeN84lPswTjpHxQueU34PKxM/IJzQS6poYlovQ==} /element-resize-detector@1.2.4: resolution: {integrity: sha512-Fl5Ftk6WwXE0wqCgNoseKWndjzZlDCwuPTcoVZfCP9R3EHQF8qUtr3YUPNETegRBOKqQKPW3n4kiIWngGi8tKg==} @@ -26535,8 +26680,8 @@ packages: dependencies: map-cache: 0.2.2 - /framer-motion@10.16.12(react-dom@17.0.2)(react@17.0.2): - resolution: {integrity: sha512-w7Yzx0OzQ5Uh6uNkxaX+4TuAPuOKz3haSbjmHpdrqDpGuCJCpq6YP9Dy7JJWdZ6mJjndrg3Ao3vUwDajKNikCA==} + /framer-motion@10.16.14(react-dom@17.0.2)(react@17.0.2): + resolution: {integrity: sha512-poovsXtR7doXRfjqVjUai82Zl2z5yMUFKtYWHnQK+xsDVPhHVUJEU+Kr2kqEnUV4gry+LcRdrDzcMI7OdJlDMg==} peerDependencies: react: ^17.0.2 react-dom: ^18.0.0 @@ -32308,7 +32453,7 @@ packages: dependencies: '@babel/runtime': 7.23.5 app-root-dir: 1.0.2 - core-js: 3.33.3 + core-js: 3.34.0 dotenv: 8.6.0 dotenv-expand: 5.1.0 dev: true @@ -35182,7 +35327,7 @@ packages: '@oclif/plugin-help': 5.2.20(@types/node@16.18.67)(typescript@5.3.2) '@oclif/plugin-not-found': 2.4.3(@types/node@16.18.67)(typescript@5.3.2) '@oclif/plugin-warn-if-update-available': 2.1.1(@types/node@16.18.67)(typescript@5.3.2) - aws-sdk: 2.1511.0 + aws-sdk: 2.1512.0 concurrently: 7.6.0 debug: 4.3.4(supports-color@9.4.0) find-yarn-workspace-root: 2.0.0 @@ -37494,6 +37639,14 @@ packages: object-assign: 4.1.1 react-is: 16.13.1 + /proper-lockfile@4.1.2: + resolution: {integrity: sha512-TjNPblN4BwAWMXU8s9AEz4JmQxnD1NNL7bNOY/AKUzyamc379FWASUhc/K1pL2noVb+XmZKLL68cjzLsiOAMaA==} + dependencies: + graceful-fs: 4.2.11 + retry: 0.12.0 + signal-exit: 3.0.7 + dev: true + /properties@1.2.1: resolution: {integrity: sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==} engines: {node: '>=0.10'} @@ -38555,7 +38708,7 @@ packages: '@emotion/cache': 11.11.0 '@emotion/react': 11.11.1(@types/react@17.0.71)(react@17.0.2) '@floating-ui/dom': 1.5.3 - '@types/react-transition-group': 4.4.9 + '@types/react-transition-group': 4.4.10 memoize-one: 6.0.0 prop-types: 15.8.1 react: 17.0.2 @@ -42385,66 +42538,6 @@ packages: /turbo-combine-reducers@1.0.2: resolution: {integrity: sha512-gHbdMZlA6Ym6Ur5pSH/UWrNQMIM9IqTH6SoL1DbHpqEdQ8i+cFunSmSlFykPt0eGQwZ4d/XTHOl74H0/kFBVWw==} - /turbo-darwin-64@1.10.16: - resolution: {integrity: sha512-+Jk91FNcp9e9NCLYlvDDlp2HwEDp14F9N42IoW3dmHI5ZkGSXzalbhVcrx3DOox3QfiNUHxzWg4d7CnVNCuuMg==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /turbo-darwin-arm64@1.10.16: - resolution: {integrity: sha512-jqGpFZipIivkRp/i+jnL8npX0VssE6IAVNKtu573LXtssZdV/S+fRGYA16tI46xJGxSAivrZ/IcgZrV6Jk80bw==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-64@1.10.16: - resolution: {integrity: sha512-PpqEZHwLoizQ6sTUvmImcRmACyRk9EWLXGlqceogPZsJ1jTRK3sfcF9fC2W56zkSIzuLEP07k5kl+ZxJd8JMcg==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-linux-arm64@1.10.16: - resolution: {integrity: sha512-TMjFYz8to1QE0fKVXCIvG/4giyfnmqcQIwjdNfJvKjBxn22PpbjeuFuQ5kNXshUTRaTJihFbuuCcb5OYFNx4uw==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-64@1.10.16: - resolution: {integrity: sha512-+jsf68krs0N66FfC4/zZvioUap/Tq3sPFumnMV+EBo8jFdqs4yehd6+MxIwYTjSQLIcpH8KoNMB0gQYhJRLZzw==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo-windows-arm64@1.10.16: - resolution: {integrity: sha512-sKm3hcMM1bl0B3PLG4ifidicOGfoJmOEacM5JtgBkYM48ncMHjkHfFY7HrJHZHUnXM4l05RQTpLFoOl/uIo2HQ==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /turbo@1.10.16: - resolution: {integrity: sha512-2CEaK4FIuSZiP83iFa9GqMTQhroW2QryckVqUydmg4tx78baftTOS0O+oDAhvo9r9Nit4xUEtC1RAHoqs6ZEtg==} - hasBin: true - optionalDependencies: - turbo-darwin-64: 1.10.16 - turbo-darwin-arm64: 1.10.16 - turbo-linux-64: 1.10.16 - turbo-linux-arm64: 1.10.16 - turbo-windows-64: 1.10.16 - turbo-windows-arm64: 1.10.16 - dev: true - /tweetnacl@0.14.5: resolution: {integrity: sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==} @@ -44542,6 +44635,18 @@ packages: hasBin: true dev: true + /wireit@0.14.1: + resolution: {integrity: sha512-q5sixPM/vKQEpyaub6J9QoHAFAF9g4zBdnjoYelH9/RLAekcUf3x1dmFLACGZ6nYjqehCsTlXC1irmzU7znPhA==} + engines: {node: '>=14.14.0'} + hasBin: true + dependencies: + braces: 3.0.2 + chokidar: 3.5.3 + fast-glob: 3.3.2 + jsonc-parser: 3.2.0 + proper-lockfile: 4.1.2 + dev: true + /word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} diff --git a/tools/code-analyzer/.gitignore b/tools/code-analyzer/.gitignore deleted file mode 100644 index 8cd56546876..00000000000 --- a/tools/code-analyzer/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/oclif.manifest.json diff --git a/tools/code-analyzer/README.md b/tools/code-analyzer/README.md index cf5c98dae08..bda687da59d 100644 --- a/tools/code-analyzer/README.md +++ b/tools/code-analyzer/README.md @@ -16,7 +16,7 @@ Here is an example `analyzer` command, run from this directory: In this command we compare the `release/6.7` and `release/6.8` branches to find differences, and we're looking for changes introduced since `6.8.0` (using the `@since` tag). -To find out more about the other arguments to the command you can run `pnpm run analyzer -- --help` +To find out more about the other arguments to the command you can run `pnpm analyzer -- --help` 2. `major-minor`. This simple CLI tool gives you the latest `.0` major/minor released version of a plugin's mainfile based on Woo release conventions. diff --git a/tools/code-analyzer/package.json b/tools/code-analyzer/package.json index 9052bf102d2..da3e15b91a3 100644 --- a/tools/code-analyzer/package.json +++ b/tools/code-analyzer/package.json @@ -2,10 +2,17 @@ "name": "code-analyzer", "version": "1.0.0", "description": "A tool to analyze code changes in WooCommerce Monorepo.", - "author": "Automattic", "homepage": "https://github.com/woocommerce/woocommerce", - "license": "GPLv2", "repository": "woocommerce/woocommerce", + "license": "GPLv2", + "author": "Automattic", + "types": "dist/index.d.ts", + "scripts": { + "analyzer": "node -r ts-node/register ./src/commands/analyzer/index.ts", + "lint": "eslint . --ext .ts", + "test": "pnpm test:js", + "test:js": "jest" + }, "dependencies": { "@actions/core": "^1.10.0", "@commander-js/extra-typings": "^10.0.3", @@ -27,18 +34,11 @@ "ts-jest": "~29.1.1", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "^5.1.6" - }, - "scripts": { - "lint": "eslint . --ext .ts", - "turbo:test": "jest", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name", - "analyzer": "node -r ts-node/register ./src/commands/analyzer/index.ts" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" - }, - "types": "dist/index.d.ts" + } } diff --git a/tools/code-analyzer/src/lib/__tests__/fixtures/diff.txt b/tools/code-analyzer/src/lib/__tests__/fixtures/diff.txt index 5be564df04a..188fc34debd 100644 --- a/tools/code-analyzer/src/lib/__tests__/fixtures/diff.txt +++ b/tools/code-analyzer/src/lib/__tests__/fixtures/diff.txt @@ -965,7 +965,7 @@ index 99b4cbaff3..b8304993ff 100644 @@ -20,7 +20,8 @@ "git:update-hooks": "rm -r .git/hooks && mkdir -p .git/hooks && husky install", "storybook": "./tools/storybook/import-wp-css-storybook.sh && BABEL_ENV=storybook STORYBOOK=true start-storybook -c ./tools/storybook/.storybook -p 6007 --ci", - "storybook-rtl": "USE_RTL_STYLE=true pnpm run storybook", + "storybook-rtl": "USE_RTL_STYLE=true pnpm storybook", - "create-extension": "node ./tools/create-extension/index.js" + "create-extension": "node ./tools/create-extension/index.js", + "cherry-pick": "node ./tools/cherry-pick/bin/run" @@ -1148,7 +1148,7 @@ index 8ac33e230f..924001b401 100644 - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", - "prepack": "pnpm run clean && pnpm run build" + "prepack": "pnpm clean && pnpm build" }, diff --git a/packages/js/admin-e2e-tests/src/fixtures/reset.ts b/packages/js/admin-e2e-tests/src/fixtures/reset.ts index c7cc5d07c2..594bba9447 100644 @@ -2552,9 +2552,9 @@ index 198eaf1da4..d085d34e04 100644 "changelog": "composer exec -- changelogger", "clean": "rm -rf ./dist ./tsconfig.tsbuildinfo", "compile": "tsc -b", -- "build": "pnpm run clean && npm run compile", -+ "build": "node ./node_modules/require-turbo && pnpm run clean && npm run compile", - "prepack": "pnpm run build", +- "build": "pnpm clean && npm run compile", ++ "build": "node ./node_modules/require-turbo && pnpm clean && npm run compile", + "prepack": "pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -2776,19 +2776,19 @@ index ea6075e85a..2fd271b525 100644 - "postinstall": "composer install", + "prepare": "composer install", "changelog": "composer exec -- changelogger", -- "build": "pnpm run build:js && pnpm run build:css", -+ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", +- "build": "pnpm build:js && pnpm build:css", ++ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", - "lint": "eslint src --ext=js,ts,tsx", + "lint": "node ./node_modules/require-turbo && eslint src --ext=js,ts,tsx", "lint:fix": "eslint src --ext=js,ts,tsx --fix", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", "start": "concurrently \"tsc --build ./tsconfig.json --watch\" \"webpack --watch\"", - "test": "jest --config ./jest.config.json", + "test": "node ./node_modules/require-turbo && jest --config ./jest.config.json", - "test:update-snapshots": "pnpm run test -- --updateSnapshot", + "test:update-snapshots": "pnpm test -- --updateSnapshot", "test-staged": "jest --bail --config ./jest.config.json --findRelatedTests" }, diff --git a/packages/js/components/src/advanced-filters/number-filter.js b/packages/js/components/src/advanced-filters/number-filter.js @@ -5658,7 +5658,7 @@ index 95495e5704..0be79e99d1 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -5828,7 +5828,7 @@ index fa7a005989..d345c7c650 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -6019,12 +6019,12 @@ index 6fca5bcfad..fa98da90ca 100644 + "prepare": "composer install", "changelog": "composer exec -- changelogger", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", -- "build": "pnpm run build:js && pnpm run build:css", -+ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", +- "build": "pnpm build:js && pnpm build:css", ++ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --build --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -6258,7 +6258,7 @@ index f48317de96..a54c8d20dc 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -9984,7 +9984,7 @@ index 95332d773e..04cae8d409 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -13641,12 +13641,12 @@ index 9473aafe90..65fa856783 100644 + "prepare": "composer install", "changelog": "composer exec -- changelogger", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", -- "build": "pnpm run build:js && pnpm run build:css", -+ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", +- "build": "pnpm build:js && pnpm build:css", ++ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --build --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -13882,7 +13882,7 @@ index f6b8445735..9ffa693eb9 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -14231,7 +14231,7 @@ index 7a0c3d89a4..2de6535838 100644 + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "ts:check": "tsc --noEmit --project ./tsconfig.json", "clean": "pnpm exec rimraf *.tsbuildinfo build build-*", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix" @@ -14443,7 +14443,7 @@ index c03f52779c..c613d8b175 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -14510,7 +14510,7 @@ index e019f5a245..c12e93bb11 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix" @@ -14743,7 +14743,7 @@ index 08ff35b9c8..875c2b3697 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix", @@ -14928,12 +14928,12 @@ index 787aa626ec..7bd577f1c0 100644 + "prepare": "composer install", "changelog": "composer exec -- changelogger", "clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*", -- "build": "pnpm run build:js && pnpm run build:css", -+ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", +- "build": "pnpm build:js && pnpm build:css", ++ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --build --watch\" \"webpack --watch\"", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix" @@ -16269,7 +16269,7 @@ index a3a3230e93..12094a3bc3 100644 - "build": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", + "build": "node ./node_modules/require-turbo && tsc --build ./tsconfig.json ./tsconfig-cjs.json", "start": "tsc --build --watch", - "prepack": "pnpm run clean && pnpm run build", + "prepack": "pnpm clean && pnpm build", - "lint": "eslint src", + "lint": "node ./node_modules/require-turbo && eslint src", "lint:fix": "eslint src --fix" @@ -23305,47 +23305,47 @@ index fcc67ba38a..5d959e3d34 100644 }, "scripts": { "analyze": "cross-env NODE_ENV=production ANALYZE=true webpack", -- "build": "pnpm run install-if-deps-outdated && pnpm run clean && WC_ADMIN_PHASE=core pnpm run build:packages && WC_ADMIN_PHASE=core pnpm run build:feature-config && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack", -+ "build": "node ./node_modules/require-turbo && pnpm run install-if-deps-outdated && pnpm run clean && WC_ADMIN_PHASE=core pnpm run build:packages && WC_ADMIN_PHASE=core pnpm run build:feature-config && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack", +- "build": "pnpm install-if-deps-outdated && pnpm clean && WC_ADMIN_PHASE=core pnpm build:packages && WC_ADMIN_PHASE=core pnpm build:feature-config && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack", ++ "build": "node ./node_modules/require-turbo && pnpm install-if-deps-outdated && pnpm clean && WC_ADMIN_PHASE=core pnpm build:packages && WC_ADMIN_PHASE=core pnpm build:feature-config && cross-env NODE_ENV=production WC_ADMIN_PHASE=core webpack", "build:feature-config": "php ../woocommerce/bin/generate-feature-config.php", - "build:packages": "cross-env NODE_ENV=production pnpm run:packages -- build", + "build:packages": "cross-env NODE_ENV=production pnpm -w exec turbo run build --filter='./packages/js/*'", "clean": "rimraf ../woocommerce/assets/client/admin/* && pnpm run:packages -- clean --parallel", - "client:watch": "cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && cross-env WC_ADMIN_PHASE=development webpack --watch", + "client:watch": "cross-env WC_ADMIN_PHASE=development pnpm build:feature-config && cross-env WC_ADMIN_PHASE=development webpack --watch", "create-hook-reference": "node ./bin/hook-reference/index.js", @@ -22,14 +22,14 @@ "preinstall": "npx only-allow pnpm", "install-if-deps-outdated": "node bin/install-if-deps-outdated.js", "install-if-no-packages": "node bin/install-if-no-packages.js", -- "lint": "pnpm run lint:js && pnpm run lint:css", -+ "lint": "node ./node_modules/require-turbo && pnpm run lint:js && pnpm run lint:css", +- "lint": "pnpm lint:js && pnpm lint:css", ++ "lint": "node ./node_modules/require-turbo && pnpm lint:js && pnpm lint:css", "lint:fix": "pnpm lint:js-fix && pnpm lint:css-fix", "lint:css": "stylelint '**/*.scss'", "lint:css-fix": "stylelint '**/*.scss' --fix --ip 'storybook/wordpress'", - "lint:js": "wp-scripts lint-js ./client --ext=js,ts,tsx", + "lint:js": "eslint ./client --ext=js,ts,tsx", - "lint:js-fix": "pnpm run lint:js -- --fix --ext=js,ts,tsx", + "lint:js-fix": "pnpm lint:js -- --fix --ext=js,ts,tsx", - "lint:js-packages": "wp-scripts lint-js ../../packages/js --ext=js,ts,tsx", - "lint:js-pre-commit": "wp-scripts lint-js --ext=js,ts,tsx", + "lint:js-packages": "eslint ../../packages/js --ext=js,ts,tsx", + "lint:js-pre-commit": "eslint --ext=js,ts,tsx", - "prepack": "pnpm install && pnpm run lint && pnpm run test && cross-env WC_ADMIN_PHASE=core pnpm run build", + "prepack": "pnpm install && pnpm lint && pnpm test && cross-env WC_ADMIN_PHASE=core pnpm build", "packages:fix:textdomain": "node ./bin/package-update-textdomain.js", "packages:watch": "cross-env WC_ADMIN_PHASE=development pnpm run:packages -- start --parallel", @@ -42,12 +42,12 @@ - "start": "pnpm run install-if-deps-outdated && cross-env WC_ADMIN_PHASE=development pnpm run build:packages && cross-env WC_ADMIN_PHASE=development pnpm run build:feature-config && concurrently \"cross-env WC_ADMIN_PHASE=development webpack --watch\" \"cross-env WC_ADMIN_PHASE=development pnpm run:packages -- start --parallel\"", + "start": "pnpm install-if-deps-outdated && cross-env WC_ADMIN_PHASE=development pnpm build:packages && cross-env WC_ADMIN_PHASE=development pnpm build:feature-config && concurrently \"cross-env WC_ADMIN_PHASE=development webpack --watch\" \"cross-env WC_ADMIN_PHASE=development pnpm run:packages -- start --parallel\"", "start:package": "pnpm run:packages -- start --parallel", - "pretest": "pnpm run -s install-if-no-packages", -- "test": "pnpm run test:client", -+ "test": "node ./node_modules/require-turbo && pnpm run test:client", - "test-staged": "pnpm run test:client -- --bail --findRelatedTests", + "pretest": "pnpm -s install-if-no-packages", +- "test": "pnpm test:client", ++ "test": "node ./node_modules/require-turbo && pnpm test:client", + "test-staged": "pnpm test:client -- --bail --findRelatedTests", "test:client": "jest --config client/jest.config.js", "test:debug": "node --inspect-brk ./node_modules/.bin/jest --config client/jest.config.js --watch --runInBand --no-cache", "test:help": "wp-scripts test-unit-js --help", -- "test:packages": "pnpm run --filter ../../packages/js/ --filter !api-core-tests test", +- "test:packages": "pnpm --filter ../../packages/js/ --filter !api-core-tests test", + "test:packages": "pnpm -w exec turbo run test --filter='./packages/js/*'", - "test:update-snapshots": "pnpm run test:client -- --updateSnapshot && pnpm run --filter @woocommerce/components test:update-snapshots", - "test:watch": "pnpm run test:client -- --watch", + "test:update-snapshots": "pnpm test:client -- --updateSnapshot && pnpm --filter @woocommerce/components test:update-snapshots", + "test:watch": "pnpm test:client -- --watch", "ts:check": "tsc --build ./tsconfig.json --pretty", @@ -204,6 +204,7 @@ "raw-loader": "^4.0.2", @@ -23436,7 +23436,7 @@ index d3523fce96..b580ff8c87 100755 echo "Installing PHP and JS dependencies..." pnpm install echo "Running JS Build..." --pnpm run build +-pnpm build +pnpm -w exec turbo run build --filter=woocommerce-beta-tester || exit "$?" echo "Syncing files..." @@ -23881,7 +23881,7 @@ index 227f668ec7..4570ee348a 100644 + "version": "2.1.0", "homepage": "http://github.com/woocommerce/woocommerce-beta-tester", - "config": { -- "build_step": "pnpm run build:zip" +- "build_step": "pnpm build:zip" - }, "devDependencies": { "@woocommerce/dependency-extraction-webpack-plugin": "workspace:*", @@ -23897,18 +23897,18 @@ index 227f668ec7..4570ee348a 100644 "scripts": { "postinstall": "composer install", "changelog": "composer exec -- changelogger", -- "build": "pnpm run build:admin && pnpm run uglify", -+ "build": "node ./node_modules/require-turbo && pnpm run build:admin && pnpm run uglify", +- "build": "pnpm build:admin && pnpm uglify", ++ "build": "node ./node_modules/require-turbo && pnpm build:admin && pnpm uglify", "build:admin": "wp-scripts build", "build:zip": "./bin/build-zip.sh", - "build:dev": "pnpm run lint:js && pnpm run build", + "build:dev": "pnpm lint:js && pnpm build", @@ -66,12 +64,13 @@ }, "woorelease": { "svn_reauth": "true", - "wp_org_slug": "woocommerce-beta-tester" + "wp_org_slug": "woocommerce-beta-tester", -+ "build_step": "pnpm run build:zip" ++ "build_step": "pnpm build:zip" }, "lint-staged": { "*.php": [ @@ -33961,8 +33961,8 @@ index ce20f1478b..b77d6042ab 100644 "preinstall": "npx only-allow pnpm", "postinstall": "composer install", "changelog": "composer exec -- changelogger", -- "build": "WC_ADMIN_PHASE=core pnpm run build:feature-config", -+ "build": "node ./node_modules/require-turbo && WC_ADMIN_PHASE=core pnpm run build:feature-config", +- "build": "WC_ADMIN_PHASE=core pnpm build:feature-config", ++ "build": "node ./node_modules/require-turbo && WC_ADMIN_PHASE=core pnpm build:feature-config", "build:feature-config": "php bin/generate-feature-config.php", "build:zip": "./bin/build-zip.sh", - "lint": "pnpm lint:js && pnpm lint:php", diff --git a/tools/code-analyzer/tsconfig.json b/tools/code-analyzer/tsconfig.json index dba65d041b6..695ca06cb31 100644 --- a/tools/code-analyzer/tsconfig.json +++ b/tools/code-analyzer/tsconfig.json @@ -1,18 +1,18 @@ { - "extends": "./node_modules/@tsconfig/node16/tsconfig.json", - "compilerOptions": { - "module": "Node16", - "moduleResolution": "Node16", - "typeRoots": [ - "./typings", - "./node_modules/@types" - ] - }, - "ts-node": { - "transpileOnly": true, - "files": true, - }, - "include": [ - "src/**/*" - ] -} + "extends": "./node_modules/@tsconfig/node16/tsconfig.json", + "compilerOptions": { + "module": "Node16", + "moduleResolution": "Node16", + "typeRoots": [ + "./typings", + "./node_modules/@types" + ] + }, + "ts-node": { + "transpileOnly": true, + "files": true, + }, + "include": [ + "src/**/*" + ] +} \ No newline at end of file diff --git a/tools/create-extension/README.md b/tools/create-extension/README.md index 8c8e64d835a..a53c89e6399 100644 --- a/tools/create-extension/README.md +++ b/tools/create-extension/README.md @@ -11,7 +11,7 @@ Scaffold a modern JavaScript WordPress plugin with WooCommerce tooling. ### Usage ``` -pnpm run create-extension +pnpm create-extension ``` The script will create a sibling directory by a name of your choosing. Once you change directories into the new folder, install dependencies and start a development build. diff --git a/tools/create-extension/package.json b/tools/create-extension/package.json index 9cfc851944c..408b972c3fc 100644 --- a/tools/create-extension/package.json +++ b/tools/create-extension/package.json @@ -2,16 +2,19 @@ "name": "create-extension", "version": "0.0.0", "description": "A tool to scaffold out an Admin ready WooCommerce extension", - "author": "Automattic", "homepage": "https://github.com/woocommerce/woocommerce", - "license": "GPLv2", - "main": "index.js", "repository": "woocommerce/woocommerce", + "license": "GPLv2", + "author": "Automattic", + "main": "index.js", "dependencies": { "chalk": "^4.1.2", "fs-extra": "10.1.0", "promptly": "^3.2.0" }, + "devDependencies": { + "wireit": "^0.14.1" + }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" diff --git a/tools/monorepo-merge/.gitignore b/tools/monorepo-merge/.gitignore deleted file mode 100644 index 8cd56546876..00000000000 --- a/tools/monorepo-merge/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/oclif.manifest.json diff --git a/tools/monorepo-merge/package.json b/tools/monorepo-merge/package.json index 32a1bd39644..4adcd12a020 100644 --- a/tools/monorepo-merge/package.json +++ b/tools/monorepo-merge/package.json @@ -2,20 +2,28 @@ "name": "monorepo-merge", "version": "0.0.0", "description": "A tool for merging repositories into the WooCommerce Monorepo.", + "homepage": "https://github.com/woocommerce/woocommerce", + "repository": "woocommerce/woocommerce", + "license": "GPLv2", "author": "Automattic", + "main": "dist/index.js", + "types": "dist/index.d.ts", "bin": { "monorepo-merge": "./bin/run" }, - "homepage": "https://github.com/woocommerce/woocommerce", - "license": "GPLv2", - "main": "dist/index.js", - "repository": "woocommerce/woocommerce", "files": [ "/bin", "/dist", "/npm-shrinkwrap.json", "/oclif.manifest.json" ], + "scripts": { + "build": "shx rm -rf dist && tsc --project tsconfig.json", + "lint": "eslint . --ext .ts", + "prepack": "pnpm build && oclif manifest", + "postpack": "shx rm -f oclif.manifest.json", + "posttest": "pnpm lint" + }, "dependencies": { "@oclif/core": "^1", "@oclif/plugin-help": "^5", @@ -24,8 +32,8 @@ }, "devDependencies": { "@octokit/request-error": "^3.0.1", - "@woocommerce/eslint-plugin": "workspace:*", "@types/node": "^16.18.18", + "@woocommerce/eslint-plugin": "workspace:*", "eslint": "^8.32.0", "globby": "^11", "jscodeshift": "^0.13.1", @@ -33,7 +41,12 @@ "shx": "^0.3.3", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "oclif": { "bin": "monorepo-merge", @@ -52,18 +65,5 @@ "description": "Transfers issues from other repositories into the monorepo." } } - }, - "scripts": { - "turbo:build": "shx rm -rf dist && tsc --project tsconfig.json", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint . --ext .ts", - "postpack": "shx rm -f oclif.manifest.json", - "posttest": "pnpm lint", - "prepack": "pnpm build && oclif manifest" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "types": "dist/index.d.ts" + } } diff --git a/tools/monorepo-utils/.gitignore b/tools/monorepo-utils/.gitignore deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/tools/monorepo-utils/package.json b/tools/monorepo-utils/package.json index 47404495166..a216a0ece3b 100644 --- a/tools/monorepo-utils/package.json +++ b/tools/monorepo-utils/package.json @@ -2,11 +2,20 @@ "name": "@woocommerce/monorepo-utils", "version": "0.0.1", "description": "WooCommerce Monorepo utility tooling.", - "author": "Automattic", "homepage": "https://github.com/woocommerce/woocommerce", - "license": "GPLv2", "repository": "woocommerce/woocommerce", + "license": "GPLv2", + "author": "Automattic", "main": "dist/index.js", + "types": "dist/index.d.ts", + "scripts": { + "build": "tsc", + "postinstall": "pnpm build", + "lint": "eslint . --ext .ts", + "start": "tsc --watch", + "test": "pnpm test:js", + "test:js": "jest" + }, "dependencies": { "@actions/core": "^1.10.0", "@commander-js/extra-typings": "^10.0.3", @@ -40,20 +49,11 @@ "eslint": "^8.32.0", "jest": "~27.5.1", "ts-jest": "~29.1.1", - "typescript": "^5.1.6" - }, - "scripts": { - "build": "tsc", - "start": "tsc --watch", - "lint": "eslint . --ext .ts", - "postinstall": "pnpm run build", - "turbo:test": "jest", - "test": "pnpm test:js", - "test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name" + "typescript": "^5.1.6", + "wireit": "^0.14.1" }, "engines": { "node": "^16.14.1", "pnpm": "^8.6.7" - }, - "types": "dist/index.d.ts" + } } diff --git a/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts b/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts index 63a7d78a550..10296304150 100644 --- a/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts +++ b/tools/monorepo-utils/src/code-freeze/commands/changelog/lib/index.ts @@ -113,7 +113,7 @@ export const updateReleaseBranchChangelogs = async ( Logger.notice( `Running the changelog script in ${ tmpRepoPath }` ); execSync( - `pnpm --filter=woocommerce run changelog write --add-pr-num -n -vvv --use-version ${ version }`, + `pnpm --filter=@woocommerce/plugin-woocommerce changelog write --add-pr-num -n -vvv --use-version ${ version }`, { cwd: tmpRepoPath, stdio: 'inherit', diff --git a/tools/monorepo/check-changelogger-use.php b/tools/monorepo/check-changelogger-use.php index 2c58f284178..f1abc4f9cb2 100644 --- a/tools/monorepo/check-changelogger-use.php +++ b/tools/monorepo/check-changelogger-use.php @@ -216,7 +216,7 @@ foreach ( $touched_projects as $slug => $files ) { } elseif ( getenv( 'CI' ) ) { printf( "---\n" ); // Bracket message containing newlines for better visibility in GH's logs. printf( - "::error::Project %s is being changed, but no change file in %s is touched!\n\nUse `pnpm --filter=./%s run changelog add` to add a change file.\n", + "::error::Project %s is being changed, but no change file in %s is touched!\n\nUse `pnpm --filter=./%s changelog add` to add a change file.\n", $slug, "$slug/{$changelogger_projects[ $slug ]['changes-dir']}/", $slug @@ -234,7 +234,7 @@ foreach ( $touched_projects as $slug => $files ) { } } if ( $exit && ! getenv( 'CI' ) && ! $list ) { - printf( "\e[32mUse `pnpm --filter={project} run changelog add` to add a change file for each project.\e[0m\n" ); + printf( "\e[32mUse `pnpm --filter={project} changelog add` to add a change file for each project.\e[0m\n" ); } exit( $exit ); diff --git a/tools/package-release/.gitignore b/tools/package-release/.gitignore deleted file mode 100644 index 8cd56546876..00000000000 --- a/tools/package-release/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/oclif.manifest.json diff --git a/tools/package-release/package.json b/tools/package-release/package.json index e4e9fcc3241..ffbe70e5c38 100644 --- a/tools/package-release/package.json +++ b/tools/package-release/package.json @@ -2,20 +2,28 @@ "name": "package-release", "version": "0.1.0", "description": "A tool to Monorepo JS packages.", + "homepage": "https://github.com/woocommerce/woocommerce", + "repository": "woocommerce/woocommerce", + "license": "GPLv2", "author": "Automattic", + "main": "dist/index.js", + "types": "dist/index.d.ts", "bin": { "package-release": "./bin/run" }, - "homepage": "https://github.com/woocommerce/woocommerce", - "license": "GPLv2", - "main": "dist/index.js", - "repository": "woocommerce/woocommerce", "files": [ "/bin", "/dist", "/npm-shrinkwrap.json", "/oclif.manifest.json" ], + "scripts": { + "build": "shx rm -rf dist && tsc --project tsconfig.json", + "lint": "eslint . --ext .ts --config .eslintrc", + "prepack": "pnpm build && oclif manifest", + "postpack": "shx rm -f oclif.manifest.json", + "posttest": "pnpm lint" + }, "dependencies": { "@oclif/core": "^1", "@oclif/plugin-help": "^5", @@ -31,7 +39,12 @@ "shx": "^0.3.3", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "^5.1.6" + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, "oclif": { "bin": "package-release", @@ -47,18 +60,5 @@ "description": "Releases JS packages" } } - }, - "scripts": { - "turbo:build": "shx rm -rf dist && tsc --project tsconfig.json", - "build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name", - "lint": "eslint . --ext .ts --config .eslintrc", - "postpack": "shx rm -f oclif.manifest.json", - "posttest": "pnpm lint", - "prepack": "pnpm build && oclif manifest" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "types": "dist/index.d.ts" + } } diff --git a/tools/package-release/src/commands/publish/index.ts b/tools/package-release/src/commands/publish/index.ts index 6f8a3e3c8a1..9a12656244d 100644 --- a/tools/package-release/src/commands/publish/index.ts +++ b/tools/package-release/src/commands/publish/index.ts @@ -129,7 +129,7 @@ export default class PackageRelease extends Command { if ( isValidUpdate( name, initialRelease ) ) { const cwd = getFilepathFromPackageName( name ); execSync( - `SKIP_TURBO=true pnpm publish ${ + `pnpm publish ${ dryRun ? '--dry-run' : '' } --publish-branch=${ branch }`, { diff --git a/tools/release-posts/README.md b/tools/release-posts/README.md index 18023f61a65..c9bd55b86a8 100644 --- a/tools/release-posts/README.md +++ b/tools/release-posts/README.md @@ -12,8 +12,8 @@ don't have access to a WordPress.com auth token. 2. Make sure you have added a `.env` file with the env variables set. WCCOM_TOKEN is optional if you're using `--outputOnly`, but the `GITHUB_ACCESS_TOKEN` is required. If you need help generating a token see [the docs](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token). To silence all CLI output, set `LOGGER_LEVEL` to `"silent"`. 3. Note that the env file should live at the same path that you're running the command from. -4. Run the tool via the npm script, e.g. `pnpm run release-post release "6.8.0" --outputOnly` -5. For more help on individual options, run the help `pnpm run release-post --help`. e.g. `pnpm run release-post rc --help` +4. Run the tool via the npm script, e.g. `pnpm release-post release "6.8.0" --outputOnly` +5. For more help on individual options, run the help `pnpm release-post --help`. e.g. `pnpm release-post rc --help` ## Publishing Draft Posts @@ -37,7 +37,7 @@ This tool will publish draft posts to `https://developer.woo.com` for you if you If you don't have a final release yet you can generate an HTML contributors list that you can copy paste into a blank post. -To do that simply run `pnpm run release-post contributors "" ""` +To do that simply run `pnpm release-post contributors "" ""` ## Advanced diff --git a/tools/release-posts/package.json b/tools/release-posts/package.json index 5d975d4f01e..76ba6bfd2e8 100644 --- a/tools/release-posts/package.json +++ b/tools/release-posts/package.json @@ -2,27 +2,13 @@ "name": "release-posts", "version": "0.0.1", "description": "Automate release post generation for Wordpress plugins", + "license": "GPL-2.0-or-later", + "author": "Automattic", "main": " ", "scripts": { "lint": "tsc --noEmit", "release-post": "node -r ts-node/register ./commands/release-post/index.ts" }, - "author": "Automattic", - "license": "GPL-2.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "devDependencies": { - "@tsconfig/node16": "^1.0.3", - "@types/ejs": "^3.1.1", - "@types/express": "^4.17.13", - "@types/lodash.shuffle": "^4.2.7", - "@types/node": "^16.18.18", - "@types/node-fetch": "^2.6.2", - "@types/semver": "^7.3.10", - "typescript": "^5.1.6" - }, "dependencies": { "@commander-js/extra-typings": "^0.1.0", "@octokit/rest": "^19.0.4", @@ -39,5 +25,20 @@ "open": "^8.4.0", "semver": "^7.3.2", "ts-node": "^10.9.1" + }, + "devDependencies": { + "@tsconfig/node16": "^1.0.3", + "@types/ejs": "^3.1.1", + "@types/express": "^4.17.13", + "@types/lodash.shuffle": "^4.2.7", + "@types/node": "^16.18.18", + "@types/node-fetch": "^2.6.2", + "@types/semver": "^7.3.10", + "typescript": "^5.1.6", + "wireit": "^0.14.1" + }, + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" } } diff --git a/tools/storybook/package.json b/tools/storybook/package.json index e3b5a7f4084..1f0d2e9b72a 100644 --- a/tools/storybook/package.json +++ b/tools/storybook/package.json @@ -1,28 +1,26 @@ { "name": "@woocommerce/storybook", - "title": "WooCommerce Storybook", + "private": true, "description": "Storybook implementation for WooCommerce", "homepage": "https://woocommerce.github.io/woocommerce-admin/#/components/", - "private": true, + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "author": "Automattic", "license": "GPL-3.0-or-later", - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "author": "Automattic", "scripts": { "build-storybook": "build-storybook -c ./.storybook", + "build-woocommerce": "pnpm --filter=@woocommerce/plugin-woocommerce build", "preinstall": "npx only-allow pnpm", - "build-woocommerce": "pnpm --filter=woocommerce run build", - "storybook": "pnpm run build-woocommerce && ./import-wp-css-storybook.sh && BABEL_ENV=storybook STORYBOOK=true start-storybook -c ./.storybook -p 6007 --ci", - "storybook-rtl": "USE_RTL_STYLE=true pnpm run storybook" + "storybook": "pnpm build-woocommerce && ./import-wp-css-storybook.sh && BABEL_ENV=storybook STORYBOOK=true start-storybook -c ./.storybook -p 6007 --ci", + "storybook-rtl": "USE_RTL_STYLE=true pnpm storybook" + }, + "dependencies": { + "@babel/preset-typescript": "^7.16.7" }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.16.7", @@ -49,9 +47,12 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "typescript": "^5.1.6", - "webpack": "^5.70.0" + "webpack": "^5.70.0", + "wireit": "^0.14.1" }, - "dependencies": { - "@babel/preset-typescript": "^7.16.7" - } + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "title": "WooCommerce Storybook" } diff --git a/turbo.json b/turbo.json deleted file mode 100644 index 528d18835f0..00000000000 --- a/turbo.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "$schema": "https://turborepo.org/schema.json", - "pipeline": { - "build:feature-config": { - "cache": false - }, - "turbo:build": { - "dependsOn": [ - "build:feature-config", - "^turbo:build" - ], - "env": [ - "WC_ADMIN_PHASE" - ], - "inputs": [ - "src/**/*.js", - "src/**/*.jsx", - "src/**/*.ts", - "src/**/*.tsx", - "src/**/*.php", - "includes/**/*.php", - "webpack.config.js", - "tsconfig.json" - ], - "outputs": [ - "dist/**", - "build/**", - "build-module/**", - "build-style/**", - "build-types/**" - ], - "outputMode": "new-only" - }, - - "woocommerce#turbo:build": { - "dependsOn": [ - "build:feature-config", - "^turbo:build", - "woocommerce/client/admin#turbo:build", - "woocommerce/client/legacy#turbo:build" - ], - "outputs": [], - "inputs": [ - "src/**/*.php", - "includes/**/*.php" - ], - "outputMode": "new-only" - }, - - "woocommerce/client/legacy#turbo:build": { - "dependsOn": [ - "^turbo:build" - ], - "outputs": [ - "../../assets/js/**", - "../../assets/css/**" - ], - "inputs": [ - "css/**/*.scss", - "css/**/*.css", - "js/**/*.js" - ], - "outputMode": "new-only" - }, - - "woocommerce/client/admin#turbo:build": { - "dependsOn": [ - "build:feature-config", - "^turbo:build" - ], - "env": [ - "WC_ADMIN_PHASE" - ], - "outputs": [ - "../woocommerce/assets/client/admin/**" - ], - "inputs": [ - "client/**/*.js", - "client/**/*.jsx", - "client/**/*.ts", - "client/**/*.tsx", - "client/**/*.scss", - "webpack.config.js", - "tsconfig.json" - ], - "outputMode": "new-only" - }, - - "turbo:test": { - "cache": false, - "dependsOn": [ - "turbo:build" - ], - "outputs": [] - } - } -}