diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 5280efb46ba..f5050d06562 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/plugin-woocommerce 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 run 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/plugin-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 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 e116ebbd857..245324bfe59 100644 --- a/.github/actions/setup-woocommerce-monorepo/action.yml +++ b/.github/actions/setup-woocommerce-monorepo/action.yml @@ -1,62 +1,91 @@ -name: 'Setup WooCommerce Monorepo' -description: 'A composite action bundling together the setup of dependencies and optional installation and building of projects.' +name: Setup WooCommerce Monorepo +description: Handles the installation, building, and caching of the projects within the monorepo. +permissions: {} + inputs: - 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 + 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' + runs: - 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' + 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 }} 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 dd63def2010..70d7bf583a6 100644 --- a/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js +++ b/.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js @@ -1,27 +1,22 @@ -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(); +const args = process.argv.slice(2); +if (args.length != 1) { + console.error('Filters must be passed as a single string!'); + process.exit(-1); } // 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(); +console.log(output); +process.exit(0); diff --git a/.github/actions/tests/setup-local-test-environment/action.yml b/.github/actions/tests/setup-local-test-environment/action.yml index 8ca7c4b5ee8..c5386a32c77 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 env:test + run: pnpm run 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 --filter=@woocommerce/plugin-woocommerce env:dev - pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init + pnpm env:dev --filter=woocommerce + pnpm env:performance-init --filter=woocommerce diff --git a/.github/workflows/build-live-branch.yml b/.github/workflows/build-live-branch.yml index f55327cdc51..d4b72c372ba 100644 --- a/.github/workflows/build-live-branch.yml +++ b/.github/workflows/build-live-branch.yml @@ -30,6 +30,8 @@ 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 9499cf2e617..f07d234fc40 100644 --- a/.github/workflows/build-release-zip-file.yml +++ b/.github/workflows/build-release-zip-file.yml @@ -20,6 +20,8 @@ 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 aa94a7df058..9a03638786a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,96 +9,91 @@ 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' - 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." + 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 diff --git a/.github/workflows/hpos-build-and-e2e-tests-daily.yml b/.github/workflows/hpos-build-and-e2e-tests-daily.yml index 06627e6b378..f7230198e2a 100644 --- a/.github/workflows/hpos-build-and-e2e-tests-daily.yml +++ b/.github/workflows/hpos-build-and-e2e-tests-daily.yml @@ -24,15 +24,12 @@ 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 --filter=@woocommerce/plugin-woocommerce env:test:cot + run: pnpm env:test:cot --filter=woocommerce - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -83,15 +80,12 @@ 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 --filter=@woocommerce/plugin-woocommerce env:test:cot + run: pnpm env:test:cot --filter=woocommerce - name: Run Playwright API tests. id: run_playwright_api_tests diff --git a/.github/workflows/mirrors.yml b/.github/workflows/mirrors.yml index e0eb15cc71f..37ccec1fec0 100644 --- a/.github/workflows/mirrors.yml +++ b/.github/workflows/mirrors.yml @@ -18,6 +18,8 @@ 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 5f5427257a0..64903cb5075 100644 --- a/.github/workflows/nightly-builds.yml +++ b/.github/workflows/nightly-builds.yml @@ -24,6 +24,8 @@ 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 3ed9fc4ae18..f54fc1dce89 100644 --- a/.github/workflows/non-cot-pr-build-and-e2e-tests.yml +++ b/.github/workflows/non-cot-pr-build-and-e2e-tests.yml @@ -23,13 +23,10 @@ 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 --filter='@woocommerce/plugin-woocommerce' env:test + run: pnpm env:test --filter=woocommerce - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -81,13 +78,10 @@ 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 --filter='@woocommerce/plugin-woocommerce' env:test + run: pnpm env:test --filter=woocommerce - 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 7c9b035d882..7f35f937044 100644 --- a/.github/workflows/package-release.yml +++ b/.github/workflows/package-release.yml @@ -24,9 +24,6 @@ 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 41f0149e107..0a2b8d2ae60 100644 --- a/.github/workflows/pr-build-and-e2e-tests.yml +++ b/.github/workflows/pr-build-and-e2e-tests.yml @@ -27,15 +27,12 @@ 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 env:test + run: pnpm run env:test - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -97,15 +94,12 @@ 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 --filter=@woocommerce/plugin-woocommerce env:test + run: pnpm env:test --filter=woocommerce - name: Run Playwright API tests. id: run_playwright_api_tests @@ -150,17 +144,14 @@ 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 --filter=@woocommerce/plugin-woocommerce env:dev - pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init + pnpm env:dev --filter=woocommerce + pnpm env:performance-init --filter=woocommerce - name: Install k6 run: | diff --git a/.github/workflows/pr-build-live-branch.yml b/.github/workflows/pr-build-live-branch.yml index 8cc44f98767..220c7ce3b75 100644 --- a/.github/workflows/pr-build-live-branch.yml +++ b/.github/workflows/pr-build-live-branch.yml @@ -31,6 +31,8 @@ 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 c2dea8419c1..8a9ddabdc7f 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 analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1) - pnpm analyzer "$HEAD_REF" $version -o "github" + version=$(pnpm run analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1) + pnpm run 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 4a1e72224e4..684e8ca1ebd 100644 --- a/.github/workflows/pr-lint-monorepo.yml +++ b/.github/workflows/pr-lint-monorepo.yml @@ -24,6 +24,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + build: false - name: Check change files are touched for touched projects env: @@ -32,4 +34,4 @@ jobs: run: php tools/monorepo/check-changelogger-use.php --debug "$BASE" "$HEAD" - name: Run changelog validation - run: pnpm -r changelog validate + run: pnpm run -r changelog validate diff --git a/.github/workflows/pr-smoke-test.yml b/.github/workflows/pr-smoke-test.yml index 23ea248e5cb..897433e8936 100644 --- a/.github/workflows/pr-smoke-test.yml +++ b/.github/workflows/pr-smoke-test.yml @@ -26,9 +26,6 @@ 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 237b49afbdd..0466ea59cf7 100644 --- a/.github/workflows/prepare-package-release.yml +++ b/.github/workflows/prepare-package-release.yml @@ -23,9 +23,6 @@ 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 00d07c06ee4..d5d883a6e77 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 utils code-freeze milestone -o ${{ github.repository_owner }} -m ${{ steps.get-versions.outputs.monthlyMilestone }} + run: pnpm run 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 utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} + run: pnpm run 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 utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} + run: pnpm run 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 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 run 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 utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} -c ${{ steps.get-versions.outputs.acceleratedVersion }} -af + 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 - 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 utils code-freeze version-bump ${{ steps.get-versions.outputs.monthlyMilestone }}-dev -o ${{ github.repository_owner }} + run: pnpm run 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 utils code-freeze changelog -c -o ${{ github.repository_owner }} -v ${{ steps.get-versions.outputs.monthlyVersionXY }} + run: pnpm run utils code-freeze changelog -c -o ${{ github.repository_owner }} -v ${{ steps.get-versions.outputs.monthlyVersionXY }} notify-slack: @@ -182,6 +182,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo + with: + build: false - name: Build zip working-directory: plugins/woocommerce @@ -210,6 +212,8 @@ 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 1b9b74c7257..84ed3387e46 100644 --- a/.github/workflows/release-wc-beta-tester.yml +++ b/.github/workflows/release-wc-beta-tester.yml @@ -19,8 +19,6 @@ 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 a2c125b037d..ca97caa9d76 100644 --- a/.github/workflows/smoke-test-daily.yml +++ b/.github/workflows/smoke-test-daily.yml @@ -32,9 +32,6 @@ 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 @@ -92,9 +89,6 @@ 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 @@ -147,8 +141,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + install-filters: woocommerce + build: false - name: Update performance test site with E2E test id: update-perf-site @@ -224,8 +218,7 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + build-filters: 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 633accdb418..60720ea8454 100644 --- a/.github/workflows/smoke-test-pr-merge.yml +++ b/.github/workflows/smoke-test-pr-merge.yml @@ -28,8 +28,7 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + build-filters: woocommerce - name: Setup local test environment uses: ./.github/actions/tests/setup-local-test-environment @@ -90,8 +89,7 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + build-filters: 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 f9d3c49f4fb..0371d3972d3 100644 --- a/.github/workflows/smoke-test-release.yml +++ b/.github/workflows/smoke-test-release.yml @@ -54,7 +54,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' + install-filters: woocommerce + build: false - name: Run E2E tests id: run-e2e-composite-action @@ -129,7 +130,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' + install-filters: woocommerce + build: false - name: Download and install Chromium browser. working-directory: plugins/woocommerce @@ -202,7 +204,8 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' + install-filters: woocommerce + build: false - name: Run E2E tests id: run-e2e-composite-action @@ -317,12 +320,11 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + build-filters: woocommerce - name: Launch WP Env working-directory: plugins/woocommerce - run: pnpm env:test + run: pnpm run env:test env: WP_ENV_CORE: WordPress/WordPress#${{ steps.get-wp-latest-1.outputs.version }} @@ -460,14 +462,13 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + build-filters: woocommerce - name: Launch WP Env working-directory: plugins/woocommerce env: WP_ENV_PHP_VERSION: ${{ matrix.php_version }} - run: pnpm env:test + run: pnpm run env:test - name: Verify PHP version working-directory: .github/workflows/scripts @@ -625,12 +626,11 @@ jobs: - name: Setup WooCommerce Monorepo uses: ./.github/actions/setup-woocommerce-monorepo with: - install: '@woocommerce/plugin-woocommerce...' - build: '@woocommerce/plugin-woocommerce' + build-filters: woocommerce - name: Launch WP Env working-directory: plugins/woocommerce - run: pnpm env:test + run: pnpm run env:test - name: Download release zip id: download-zip diff --git a/.github/workflows/syncpack.yml b/.github/workflows/syncpack.yml index 8f7e92fe4e2..3406ae02aee 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 sync-dependencies\`" + 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\`" exit 1 diff --git a/.gitignore b/.gitignore index b89e5cc5990..ed180664a57 100644 --- a/.gitignore +++ b/.gitignore @@ -44,7 +44,6 @@ build-style/ build-style.js build-types/ dist/ -oclif.manifest.json # Project files node_modules/ @@ -95,9 +94,8 @@ allure-results changes.json .env -# Build Cache +# Turborepo .turbo -.wireit # Support .gitkeep Files !.gitkeep diff --git a/.pnpmfile.cjs b/.pnpmfile.cjs deleted file mode 100644 index 6bafa1bc4f3..00000000000 --- a/.pnpmfile.cjs +++ /dev/null @@ -1,256 +0,0 @@ -/** - * 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 99a4319a421..49a7bc1aff0 100644 --- a/.syncpackrc +++ b/.syncpackrc @@ -116,7 +116,7 @@ "packages": [ "@woocommerce/block-templates", "@woocommerce/product-editor", - "@woocommerce/admin-library", + "woocommerce/client/admin", "@woocommerce/components" ], "isIgnored": true @@ -224,15 +224,6 @@ ], "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 f6b77a94530..cb3671f4066 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -6,47 +6,70 @@ 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 -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. +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). ### Examples -Here are some examples of the ways you can use `pnpm` commands: +Here are some examples of the ways you can use Turborepo / pnpm commands: ```bash -# Lint and build all plugins, packages, and tools. -pnpm lint && pnpm build +# 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 # Build WooCommerce Core and all of its dependencies -pnpm --filter='@woocommerce/plugin-woocommerce' build +pnpm run --filter='woocommerce' build -# Lint the @woocommerce/components package -pnpm --filter='@woocommerce/components' lint +# 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 # Test all of the @woocommerce scoped packages -pnpm --filter='@woocommerce/*' test +pnpm run --filter='@woocommerce/*' test # Build all of the JavaScript packages -pnpm --filter='./packages/js/*' build +pnpm run --filter='./packages/js/*' build # Build everything except WooCommerce Core -pnpm --filter='!@woocommerce/plugin-woocommerce' build +pnpm run --filter='!woocommerce' build # Build everything that has changed since the last commit -pnpm --filter='[HEAD^1]' build +pnpm run --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/plugin-woocommerce' changelog add +pnpm --filter=woocommerce run changelog add # Create the woocommerce.zip file -pnpm --filter='@woocommerce/plugin-woocommerce' build:zip +pnpm --filter=woocommerce run build:zip ``` ## Plugin Development Environments diff --git a/README.md b/README.md index 94f77e93f74..fbbbb99413e 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 build +pnpm run build ``` -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. +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. 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 ec1147be3e7..563b74c3f48 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 sync-dependencies\`." + echo "This can usually be accomplished automatically by updating the pinned version in \`.syncpackrc\` and then running \`pnpm run 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 40cf120ff7c..c59b27fd417 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 --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. +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. ## Javascript diff --git a/docs/extension-development/development-environment.md b/docs/extension-development/development-environment.md index 84cf4f3b89f..3018c983368 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 build +pnpm run 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 ce35cda5e13..fe0870840c0 100644 --- a/package.json +++ b/package.json @@ -1,43 +1,40 @@ { "name": "woocommerce-monorepo", - "private": true, + "title": "WooCommerce Monorepo", "description": "Monorepo for the WooCommerce ecosystem", "homepage": "https://woo.com/", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, + "private": true, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", "author": "Automattic", + "license": "GPL-3.0-or-later", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "bin": { "utils": "./tools/monorepo-utils/bin/run" }, "scripts": { - "build": "pnpm -r build", - "cherry-pick": "node ./tools/cherry-pick/bin/run", + "build": "pnpm exec turbo run turbo:build", + "test": "pnpm exec turbo run turbo:test", "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", - "lint": "pnpm -r lint", + "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", "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.23.3", - "@babel/runtime": "^7.23.4", + "@babel/preset-env": "^7.20.2", + "@babel/runtime": "^7.21.0", "@types/node": "^16.18.18", "@woocommerce/eslint-plugin": "workspace:*", "@wordpress/data": "wp-6.0", @@ -46,8 +43,8 @@ "babel-loader": "^8.3.0", "chalk": "^4.1.2", "copy-webpack-plugin": "^10.2.4", - "core-js": "^3.33.3", - "css-loader": "^6.8.1", + "core-js": "^3.29.1", + "css-loader": "^6.7.3", "glob": "^7.2.3", "husky": "^7.0.4", "jest": "~27.5.1", @@ -59,16 +56,20 @@ "prettier": "npm:wp-prettier@^2.8.5", "regenerator-runtime": "^0.13.11", "request": "^2.88.2", - "sass": "^1.69.5", + "sass": "^1.59.3", "sass-loader": "^10.4.1", - "syncpack": "^10.9.3", + "syncpack": "^10.7.3", + "turbo": "^1.10.7", "typescript": "^5.1.6", "url-loader": "^1.1.2", - "webpack": "^5.89.0" + "webpack": "^5.76.2" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "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" }, "pnpm": { "overrides": { @@ -76,6 +77,5 @@ "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 5ad5e36e336..5c7dfe15136 100644 --- a/packages/js/README.md +++ b/packages/js/README.md @@ -60,7 +60,8 @@ 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. 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, 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. + 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 3e0541ae519..0ee64540a9f 100644 --- a/packages/js/admin-e2e-tests/package.json +++ b/packages/js/admin-e2e-tests/package.json @@ -1,19 +1,22 @@ { "name": "@woocommerce/admin-e2e-tests", "version": "1.0.0", + "author": "Automattic", "description": "E2E tests for the new WooCommerce interface.", - "keywords": [ - "woocommerce", - "e2e" - ], "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" + ], "license": "GPL-3.0+", - "author": "Automattic", - "sideEffects": false, "main": "build/index.js", "types": "build/index.d.ts", "files": [ @@ -21,29 +24,18 @@ "!*.ts.map", "!*.tsbuildinfo" ], - "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" - ] - }, + "sideEffects": false, "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", @@ -58,54 +50,25 @@ "jest-mock-extended": "^1.0.18", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "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" + "typescript": "^5.1.6" }, "publishConfig": { "access": "public" }, - "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" - ] - } + "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" + ] } } diff --git a/packages/js/admin-layout/package.json b/packages/js/admin-layout/package.json index 77bb4aaff22..ca3675518a8 100644 --- a/packages/js/admin-layout/package.json +++ b/packages/js/admin-layout/package.json @@ -2,46 +2,43 @@ "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "types": "build-types", + "react-native": "src/index", "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", - "watch:build": "pnpm build:project --watch" + "publishConfig": { + "access": "public" }, - "dependencies": { - "@woocommerce/components": "workspace:*", - "@wordpress/components": "wp-6.0", - "@wordpress/element": "wp-6.0" + "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" }, "devDependencies": { "@types/react": "^17.0.2", @@ -62,78 +59,16 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, "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" - ] - }, - "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" - ] - } + "dependencies": { + "@woocommerce/components": "workspace:*", + "@wordpress/components": "wp-6.0", + "@wordpress/element": "wp-6.0" } } diff --git a/packages/js/ai/package.json b/packages/js/ai/package.json index 2c2503f7a63..dab723ef30f 100644 --- a/packages/js/ai/package.json +++ b/packages/js/ai/package.json @@ -1,45 +1,30 @@ { "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "types": "build-types", + "react-native": "src/index", "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" - }, + "private": true, "dependencies": { "@wordpress/api-fetch": "wp-6.0", "@wordpress/compose": "wp-6.0", @@ -84,82 +69,28 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "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" }, "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 ae41a67dc6d..ad3f7f3d2ff 100644 --- a/packages/js/api-core-tests/package.json +++ b/packages/js/api-core-tests/package.json @@ -2,33 +2,29 @@ "name": "@woocommerce/api-core-tests", "version": "1.0.0", "description": "API tests for WooCommerce", - "homepage": "https://github.com/woocommerce/woocommerce#readme", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "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" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", - "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" - ] + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, + "homepage": "https://github.com/woocommerce/woocommerce#readme", "dependencies": { "allure-commandline": "^2.17.2", "dotenv": "^10.0.0", @@ -40,14 +36,17 @@ }, "devDependencies": { "@woocommerce/eslint-plugin": "workspace:*", - "eslint": "^8.32.0", - "wireit": "^0.14.1" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "eslint": "^8.32.0" }, "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 0fcfa5631b6..e77ed939cc4 100644 --- a/packages/js/api/package.json +++ b/packages/js/api/package.json @@ -1,19 +1,22 @@ { "name": "@woocommerce/api", "version": "0.3.0", + "author": "Automattic", "description": "A simple interface for interacting with a WooCommerce installation.", - "keywords": [ - "woocommerce", - "e2e" - ], "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" + ], "license": "GPL-3.0+", - "author": "Automattic", - "sideEffects": false, "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ @@ -25,23 +28,20 @@ "!/dist/**/__snapshops__/", "!/dist/**/__test_data__/" ], + "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", - "test:js": "wireit", - "watch:build": "pnpm build:project --watch" - }, - "lint-staged": { - "*.(t|j)s?(x)": [ - "pnpm lint:fix" - ] + "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" }, "dependencies": { "axios": "^0.24.0", @@ -59,45 +59,14 @@ "eslint": "^8.32.0", "jest": "~27.5.1", "ts-jest": "~29.1.1", - "typescript": "^5.1.6", - "wireit": "^0.14.1" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "typescript": "^5.1.6" }, "publishConfig": { "access": "public" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/packages/js/block-templates/package.json b/packages/js/block-templates/package.json index 0b6a9ba0bc7..133822e4c0c 100644 --- a/packages/js/block-templates/package.json +++ b/packages/js/block-templates/package.json @@ -2,42 +2,30 @@ "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "types": "build-types", + "react-native": "src/index", "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" + "publishConfig": { + "access": "public" }, "dependencies": { "@woocommerce/expression-evaluation": "workspace:*", @@ -74,89 +62,27 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "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" }, "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 new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/components/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/components/package.json b/packages/js/components/package.json index a5632df4bf1..56d9c6dc566 100644 --- a/packages/js/components/package.json +++ b/packages/js/components/package.json @@ -2,50 +2,33 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "react-native": "src/index", "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", @@ -103,6 +86,17 @@ "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", @@ -151,116 +145,30 @@ "typescript": "^5.1.6", "uuid": "^8.3.0", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, - "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" + "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" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/create-product-editor-block/package.json b/packages/js/create-product-editor-block/package.json index 826988dbbef..ed40b14f2a4 100644 --- a/packages/js/create-product-editor-block/package.json +++ b/packages/js/create-product-editor-block/package.json @@ -2,31 +2,29 @@ "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.", - "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" + "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" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, - "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" + "keywords": [ + "wordpress", + "woocommerce" + ], + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, + "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 new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/create-woo-extension/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/create-woo-extension/package.json b/packages/js/create-woo-extension/package.json index ec1299695ba..b4f688f7769 100644 --- a/packages/js/create-woo-extension/package.json +++ b/packages/js/create-woo-extension/package.json @@ -2,26 +2,24 @@ "name": "@woocommerce/create-woo-extension", "version": "1.0.2", "description": "A template to be used with `@wordpress/create-block` to create a WooCommerce extension.", - "keywords": [], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-woo-extensionv#readme", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "main": "index.js", + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "scripts": { + "postinstall": "composer install", + "changelog": "composer exec -- changelogger" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0+", + "keywords": [], "author": "", - "main": "index.js", - "scripts": { - "changelog": "composer install && composer exec -- changelogger" + "license": "GPL-3.0+", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, - "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-woo-extensionv#readme" } diff --git a/packages/js/csv-export/.gitignore b/packages/js/csv-export/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/csv-export/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/csv-export/package.json b/packages/js/csv-export/package.json index 0cd53b7f693..1d7533012d9 100644 --- a/packages/js/csv-export/package.json +++ b/packages/js/csv-export/package.json @@ -2,120 +2,69 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "dependencies": { "@types/node": "^16.18.18", "browser-filesaver": "^1.1.1", "moment": "^2.29.1" }, + "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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/currency/.gitignore b/packages/js/currency/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/currency/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/currency/package.json b/packages/js/currency/package.json index 977a0a1e4d3..294cae30ce9 100644 --- a/packages/js/currency/package.json +++ b/packages/js/currency/package.json @@ -2,45 +2,29 @@ "name": "@woocommerce/currency", "version": "4.2.0", "description": "WooCommerce currency utilities.", + "author": "Automattic", + "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "currency" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/currency/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/currency/README.md", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "dependencies": { "@woocommerce/number": "workspace:*", "@wordpress/deprecated": "wp-6.0", @@ -49,81 +33,41 @@ "@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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/customer-effort-score/.gitignore b/packages/js/customer-effort-score/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/customer-effort-score/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/customer-effort-score/package.json b/packages/js/customer-effort-score/package.json index 50ce6fd4dcc..e20150fefd1 100644 --- a/packages/js/customer-effort-score/package.json +++ b/packages/js/customer-effort-score/package.json @@ -2,45 +2,28 @@ "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" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/customer-effort-score/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/customer-effort-score/README.md", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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" - ] - }, + "react-native": "src/index", "dependencies": { "@woocommerce/experimental": "workspace:*", "@wordpress/components": "wp-6.0", @@ -53,6 +36,9 @@ "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", @@ -63,10 +49,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", @@ -80,107 +66,33 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, "peerDependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "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" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/data/.gitignore b/packages/js/data/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/data/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/data/package.json b/packages/js/data/package.json index d4813eb0295..de0337bd55c 100644 --- a/packages/js/data/package.json +++ b/packages/js/data/package.json @@ -2,45 +2,29 @@ "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" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/data/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/data/README.md", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "dependencies": { "@woocommerce/date": "workspace:*", "@woocommerce/navigation": "workspace:*", @@ -59,6 +43,9 @@ "qs": "^6.10.3", "rememo": "^4.0.0" }, + "publishConfig": { + "access": "public" + }, "devDependencies": { "@automattic/data-stores": "^2.0.1", "@babel/core": "^7.17.5", @@ -68,24 +55,23 @@ "@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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, "peerDependencies": { "@wordpress/core-data": "wp-6.0", @@ -93,77 +79,25 @@ "react": "^17.0.2", "react-dom": "^17.0.2" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "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" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/date/.gitignore b/packages/js/date/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/date/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/date/package.json b/packages/js/date/package.json index 6e99d0dc5f9..31b9ee8b5a2 100644 --- a/packages/js/date/package.json +++ b/packages/js/date/package.json @@ -2,45 +2,29 @@ "name": "@woocommerce/date", "version": "4.2.0", "description": "WooCommerce date utilities.", + "author": "Automattic", + "license": "GPL-3.0-or-later", "keywords": [ "wordpress", "woocommerce", "date" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/date/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/date/README.md", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "dependencies": { "@types/d3-time-format": "^2.3.0", "@wordpress/date": "wp-6.0", @@ -51,81 +35,46 @@ }, "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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, "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" - ] - } + "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" + ] } } diff --git a/packages/js/dependency-extraction-webpack-plugin/.gitignore b/packages/js/dependency-extraction-webpack-plugin/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/dependency-extraction-webpack-plugin/.gitignore @@ -0,0 +1,3 @@ +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 a35ce02813d..bfa5382b4e3 100644 --- a/packages/js/dependency-extraction-webpack-plugin/package.json +++ b/packages/js/dependency-extraction-webpack-plugin/package.json @@ -2,36 +2,31 @@ "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" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/dependency-extraction-webpack-plugin/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "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", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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:*", @@ -42,14 +37,17 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "scripts": { + "prepare": "composer install", + "changelog": "composer exec -- changelogger", + "lint": "eslint src", + "lint:fix": "eslint src --fix" }, - "publishConfig": { - "access": "public" + "lint-staged": { + "*.(t|j)s?(x)": [ + "eslint --fix" + ] } } diff --git a/packages/js/e2e-core-tests/package.json b/packages/js/e2e-core-tests/package.json index f4b529a574d..73fd32c61be 100644 --- a/packages/js/e2e-core-tests/package.json +++ b/packages/js/e2e-core-tests/package.json @@ -8,6 +8,10 @@ "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": [ @@ -18,19 +22,6 @@ "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", @@ -51,18 +42,27 @@ "@wordpress/babel-preset-default": "3.0.2", "@wordpress/browserslist-config": "wp-6.0", "eslint": "^8.32.0", - "eslint-plugin-jest": "23.20.0", - "wireit": "^0.14.1" + "eslint-plugin-jest": "23.20.0" }, "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 b147cce6065..66a6cd1c9a1 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 e2e --filter=@woocommerce/plugin-woocommerce`. +You should then be able to run the e2e tests by running `pnpm run e2e --filter=woocommerce`. ### Test Sequencer Setup diff --git a/packages/js/e2e-environment/package.json b/packages/js/e2e-environment/package.json index b88a463f3d6..909e0b84ffa 100644 --- a/packages/js/e2e-environment/package.json +++ b/packages/js/e2e-environment/package.json @@ -2,12 +2,18 @@ "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" @@ -16,34 +22,8 @@ "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", @@ -79,14 +59,34 @@ "@wordpress/babel-preset-default": "3.0.2", "@wordpress/browserslist-config": "wp-6.0", "ndb": "^1.1.5", - "semver": "^7.3.2", - "wireit": "^0.14.1" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "semver": "^7.3.2" }, "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 74fb2b04eaf..bcffca6c2e0 100644 --- a/packages/js/e2e-utils/package.json +++ b/packages/js/e2e-utils/package.json @@ -8,21 +8,12 @@ "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", @@ -47,17 +38,26 @@ "@wordpress/babel-preset-default": "3.0.2", "@wordpress/browserslist-config": "wp-6.0", "eslint": "^8.32.0", - "eslint-plugin-jest": "23.20.0", - "wireit": "^0.14.1" + "eslint-plugin-jest": "23.20.0" }, "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 new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/eslint-plugin/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/eslint-plugin/package.json b/packages/js/eslint-plugin/package.json index 67d01b111d3..a8393a3ee22 100644 --- a/packages/js/eslint-plugin/package.json +++ b/packages/js/eslint-plugin/package.json @@ -2,6 +2,12 @@ "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", @@ -9,42 +15,37 @@ "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", - "main": "index.js", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "files": [ "configs", "rules", "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" - ] - }, + "main": "index.js", "dependencies": { - "@typescript-eslint/eslint-plugin": "^5.54.0", "@typescript-eslint/parser": "^5.54.0", + "@typescript-eslint/eslint-plugin": "^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", @@ -52,14 +53,11 @@ "jest-cli": "~27.5.1", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "publishConfig": { - "access": "public" + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/packages/js/experimental/.gitignore b/packages/js/experimental/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/experimental/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/experimental/package.json b/packages/js/experimental/package.json index 50942b0b2e3..2495e01ddd9 100644 --- a/packages/js/experimental/package.json +++ b/packages/js/experimental/package.json @@ -2,50 +2,33 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "types": "build-types", + "react-native": "src/index", "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", @@ -60,6 +43,9 @@ "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", @@ -75,8 +61,8 @@ "@types/testing-library__jest-dom": "^5.14.3", "@types/wordpress__components": "^19.10.3", "@woocommerce/eslint-plugin": "workspace:*", - "@woocommerce/internal-js-tests": "workspace:*", "@woocommerce/internal-style-build": "workspace:*", + "@woocommerce/internal-js-tests": "workspace:*", "@wordpress/browserslist-config": "wp-6.0", "concurrently": "^7.0.0", "css-loader": "^3.6.0", @@ -90,92 +76,33 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, "peerDependencies": { "react": "^17.0.2", "react-dom": "^17.0.2" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "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" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/explat/.gitignore b/packages/js/explat/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/explat/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/explat/package.json b/packages/js/explat/package.json index 642d5708857..e59391eead1 100644 --- a/packages/js/explat/package.json +++ b/packages/js/explat/package.json @@ -2,6 +2,12 @@ "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", @@ -9,38 +15,19 @@ "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] + "react-native": "src/index", + "publishConfig": { + "access": "public" }, "dependencies": { "@automattic/explat-client": "^0.0.3", @@ -59,71 +46,33 @@ "@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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "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" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/explat/tsconfig.json b/packages/js/explat/tsconfig.json index c5f351a60cc..7fcb326214a 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 164d0e70a54..e0f5ac4a1c9 100644 --- a/packages/js/expression-evaluation/package.json +++ b/packages/js/expression-evaluation/package.json @@ -2,49 +2,51 @@ "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" ], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/expression-evaluation/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" }, + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/expression-evaluation/README.md", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "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", @@ -56,59 +58,12 @@ "jest-cli": "~27.5.1", "rimraf": "^3.0.2", "ts-jest": "~29.1.1", - "typescript": "^5.1.6", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/extend-cart-checkout-block/package.json b/packages/js/extend-cart-checkout-block/package.json index fc79c178e8f..17c4f99c569 100644 --- a/packages/js/extend-cart-checkout-block/package.json +++ b/packages/js/extend-cart-checkout-block/package.json @@ -2,26 +2,24 @@ "name": "@woocommerce/extend-cart-checkout-block", "version": "1.2.0", "description": "", - "keywords": [], - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "main": "index.js", + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "scripts": { + "postinstall": "composer install", + "changelog": "composer exec -- changelogger" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, - "license": "ISC", + "keywords": [], "author": "", - "main": "index.js", - "scripts": { - "changelog": "composer install && composer exec -- changelogger" + "license": "ISC", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, - "devDependencies": { - "wireit": "^0.14.1" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - } + "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme" } diff --git a/packages/js/extend-cart-checkout-block/project.json b/packages/js/extend-cart-checkout-block/project.json new file mode 100644 index 00000000000..f0a497781bf --- /dev/null +++ b/packages/js/extend-cart-checkout-block/project.json @@ -0,0 +1,5 @@ +{ + "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 6697cc88e90..34eac07d00c 100644 --- a/packages/js/integrate-plugin/package.json +++ b/packages/js/integrate-plugin/package.json @@ -2,41 +2,30 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", - "sideEffects": [], + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "main": "build/index.js", - "react-native": "src/index", - "types": "build-types", "bin": { "woo-integrate-plugin": "./build/index.js" }, - "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" + "types": "build-types", + "react-native": "src/index", + "sideEffects": [], + "publishConfig": { + "access": "public" }, "dependencies": { "@wordpress/create-block": "wp-6.0", @@ -70,61 +59,18 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, - "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" - ] - } + "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" } } diff --git a/packages/js/internal-e2e-builds/package.json b/packages/js/internal-e2e-builds/package.json index 492fdd4ba5c..a0094a8f5f0 100644 --- a/packages/js/internal-e2e-builds/package.json +++ b/packages/js/internal-e2e-builds/package.json @@ -1,31 +1,28 @@ { "name": "@woocommerce/internal-e2e-builds", "version": "0.1.0", - "private": true, "description": "Utility build files for e2e packages", - "homepage": "https://github.com/woocommerce/woocommerce#readme", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "private": true, + "main": "build.js", + "engines": { + "node": "^16.14.1", + "pnpm": "^8.6.7" + }, + "bin": { + "e2e-builds": "./build.js" }, "repository": { "type": "git", "url": "git+https://github.com/woocommerce/woocommerce.git" }, "license": "GPL-3.0+", - "main": "build.js", - "bin": { - "e2e-builds": "./build.js" + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" }, + "homepage": "https://github.com/woocommerce/woocommerce#readme", "scripts": { - "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" - ] + "lint": "eslint build.js", + "lint:fix": "eslint build.js --fix" }, "devDependencies": { "@babel/core": "7.12.9", @@ -34,11 +31,11 @@ "eslint": "^8.32.0", "glob": "^7.2.0", "lodash": "^4.17.21", - "mkdirp": "^1.0.4", - "wireit": "^0.14.1" + "mkdirp": "^1.0.4" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/packages/js/internal-js-tests/package.json b/packages/js/internal-js-tests/package.json index d8725b6b3a0..77b2e477340 100644 --- a/packages/js/internal-js-tests/package.json +++ b/packages/js/internal-js-tests/package.json @@ -1,38 +1,33 @@ { "name": "@woocommerce/internal-js-tests", "version": "1.1.0", - "private": true, "description": "JavaScript test tooling.", - "homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/internal-js-tests/README.md", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" + "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", "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git", "directory": "packages/internal-js-tests" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "private": true, "main": "build/util/index.js", "module": "build-module/util/index.js", "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" - ] + "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" }, "dependencies": { "@testing-library/jest-dom": "5.16.2", @@ -45,57 +40,18 @@ "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", - "typescript": "^5.1.6", - "wireit": "^0.14.1" + "babel-jest": "~27.5.1", + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/packages/js/internal-js-tests/project.json b/packages/js/internal-js-tests/project.json new file mode 100644 index 00000000000..faccb2f296c --- /dev/null +++ b/packages/js/internal-js-tests/project.json @@ -0,0 +1,19 @@ +{ + "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 de6c559a88b..7caab95c880 100644 --- a/packages/js/internal-style-build/package.json +++ b/packages/js/internal-style-build/package.json @@ -1,34 +1,26 @@ { "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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", @@ -40,6 +32,11 @@ "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:*", @@ -49,11 +46,11 @@ "rimraf": "^3.0.2", "ts-jest": "~29.1.1", "typescript": "^5.1.6", - "webpack": "^5.70.0", - "wireit": "^0.14.1" + "webpack": "^5.70.0" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/packages/js/navigation/.gitignore b/packages/js/navigation/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/navigation/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/navigation/package.json b/packages/js/navigation/package.json index d29fa79ef55..d20c9ecce55 100644 --- a/packages/js/navigation/package.json +++ b/packages/js/navigation/package.json @@ -2,45 +2,29 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "dependencies": { "@wordpress/api-fetch": "wp-6.0", "@wordpress/components": "wp-6.0", @@ -54,6 +38,27 @@ "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", @@ -61,74 +66,18 @@ "@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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/notices/package.json b/packages/js/notices/package.json index 0b78d5c78cd..1b3afd27634 100644 --- a/packages/js/notices/package.json +++ b/packages/js/notices/package.json @@ -1,51 +1,54 @@ { "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" }, - "license": "GPL-2.0-or-later", - "author": "The WordPress Contributors", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "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", @@ -53,66 +56,18 @@ "@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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/packages/js/notices/project.json b/packages/js/notices/project.json new file mode 100644 index 00000000000..33f1da11cee --- /dev/null +++ b/packages/js/notices/project.json @@ -0,0 +1,25 @@ +{ + "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 new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/number/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/number/package.json b/packages/js/number/package.json index 9e21a06fc9a..599e6a21aed 100644 --- a/packages/js/number/package.json +++ b/packages/js/number/package.json @@ -2,47 +2,49 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "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", @@ -50,71 +52,18 @@ "@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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/onboarding/.gitignore b/packages/js/onboarding/.gitignore new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/onboarding/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/onboarding/package.json b/packages/js/onboarding/package.json index d202a120e47..7e04008de0e 100644 --- a/packages/js/onboarding/package.json +++ b/packages/js/onboarding/package.json @@ -2,45 +2,31 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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" - ] + "react-native": "src/index", + "publishConfig": { + "access": "public" }, "dependencies": { "@woocommerce/components": "workspace:*", @@ -80,103 +66,29 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "webpack-cli": "^3.3.12" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "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" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix", + "pnpm test-staged" + ] } } diff --git a/packages/js/product-editor/package.json b/packages/js/product-editor/package.json index 65954ebdbcb..2fbefca3cc5 100644 --- a/packages/js/product-editor/package.json +++ b/packages/js/product-editor/package.json @@ -2,42 +2,30 @@ "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" }, - "license": "GPL-2.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, + "main": "build/index.js", + "module": "build-module/index.js", + "types": "build-types", + "react-native": "src/index", "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" + "publishConfig": { + "access": "public" }, "dependencies": { "@types/lodash": "^4.14.179", @@ -63,8 +51,8 @@ "@wordpress/data": "wp-6.0", "@wordpress/date": "wp-6.0", "@wordpress/deprecated": "wp-6.0", - "@wordpress/edit-post": "wp-6.0", "@wordpress/editor": "wp-6.0", + "@wordpress/edit-post": "wp-6.0", "@wordpress/element": "wp-6.0", "@wordpress/html-entities": "wp-6.0", "@wordpress/i18n": "wp-6.0", @@ -100,8 +88,8 @@ "@types/wordpress__core-data": "2.4.5", "@types/wordpress__data": "6.0.2", "@types/wordpress__date": "3.3.2", - "@types/wordpress__edit-post": "7.5.4", "@types/wordpress__editor": "13.0.0", + "@types/wordpress__edit-post": "7.5.4", "@types/wordpress__keycodes": "2.3.1", "@types/wordpress__media-utils": "3.0.0", "@types/wordpress__plugins": "3.0.0", @@ -126,135 +114,28 @@ "ts-jest": "~29.1.1", "typescript": "^5.1.6", "webpack": "^5.70.0", - "webpack-cli": "^3.3.12", - "wireit": "^0.14.1" + "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" }, "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 new file mode 100644 index 00000000000..4b894a3e094 --- /dev/null +++ b/packages/js/tracks/.gitignore @@ -0,0 +1,3 @@ +vendor +node_modules +.turbo diff --git a/packages/js/tracks/package.json b/packages/js/tracks/package.json index 4f7c81fbea3..1a9229733b1 100644 --- a/packages/js/tracks/package.json +++ b/packages/js/tracks/package.json @@ -2,104 +2,61 @@ "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" }, - "license": "GPL-3.0-or-later", - "author": "Automattic", + "bugs": { + "url": "https://github.com/woocommerce/woocommerce/issues" + }, "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: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" - ] - }, + "react-native": "src/index", "dependencies": { "debug": "^4.3.3" }, + "publishConfig": { + "access": "public" + }, + "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:*", - "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", - "wireit": "^0.14.1" + "typescript": "^5.1.6" }, - "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" - ] - } + "lint-staged": { + "*.(t|j)s?(x)": [ + "pnpm lint:fix" + ] } } diff --git a/plugins/woo-ai/DEVELOPMENT.md b/plugins/woo-ai/DEVELOPMENT.md index a05384e3df6..7bceb6726da 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 start +pnpm run start ``` To build the /woo-ai/ plugin directory (when loading the plugin via symlink), run: ```text pnpm install -pnpm build +pnpm run build ``` To build the plugin ZIP file, run: ```text pnpm install -pnpm build:zip +pnpm run 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 b3c3a8334c9..3bfc34d4f4a 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 --filter='@woocommerce/plugin-woo-ai' build || exit "$?" +pnpm -w run build --filter=woo-ai || 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 504a2b80a41..f135a1c5e7a 100644 --- a/plugins/woo-ai/package.json +++ b/plugins/woo-ai/package.json @@ -1,48 +1,32 @@ { - "name": "@woocommerce/plugin-woo-ai", - "version": "0.5.0", - "private": true, + "name": "woo-ai", "description": "Implementing WooCommerce AI Experiments.", - "homepage": "http://github.com/woocommerce/woo-ai", + "license": "GPL-2.0", "repository": { "type": "git", "url": "git://github.com/woocommerce/woo-ai.git" }, - "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" - ] + "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" }, "dependencies": { "@automattic/tour-kit": "^1.1.1", @@ -65,35 +49,50 @@ "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" }, - "title": "Woo AI" + "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" + ] + } } diff --git a/plugins/woocommerce-admin/bin/hook-reference/README.md b/plugins/woocommerce-admin/bin/hook-reference/README.md index 30b19c00798..3ad83aafd51 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 create-hook-reference +pnpm run 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 b73604aaea5..26689221298 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/admin-library example +WC_EXT= pnpm --filter=woocommerce/client/admin 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 26592cd2442..bf68adc4d5f 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/admin-library` +`WC_EXT=add-navigation-items pnpm example --filter=woocommerce/client/admin` 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 692c8681c0f..b8ea6752f42 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/admin-library` +`WC_EXT=payment-gateway-suggestions pnpm example --filter=woocommerce/client/admin` 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 64ca37284d5..5a38b64f3ec 100644 --- a/plugins/woocommerce-admin/package.json +++ b/plugins/woocommerce-admin/package.json @@ -1,46 +1,59 @@ { - "name": "@woocommerce/admin-library", + "name": "woocommerce/client/admin", "version": "3.3.0", - "private": true, + "license": "GPL-3.0-or-later", + "author": "Automattic", "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": { - "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" - ] + "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" }, "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", @@ -224,148 +237,22 @@ "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", - "wireit": "^0.14.1" + "webpack-rtl-plugin": "^2.0.0" }, "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 75f97393962..41777b4637d 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, '/build' ), + path: path.join( __dirname, '/../woocommerce/assets/client/admin' ), 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 7b4f2cfc700..65a1889ebfb 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 --filter=@woocommerce/plugin-woocommerce-beta-tester install -pnpm --filter=@woocommerce/plugin-woocommerce-beta-tester start +pnpm install +pnpm run 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 bfc53ef34bb..6771e858ba6 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 --filter='@woocommerce/plugin-woocommerce-beta-tester' build || exit "$?" +pnpm -w run build --filter=woocommerce-beta-tester || 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 1fbd09aeca7..9b404c9139c 100644 --- a/plugins/woocommerce-beta-tester/package.json +++ b/plugins/woocommerce-beta-tester/package.json @@ -1,59 +1,29 @@ { - "name": "@woocommerce/plugin-woocommerce-beta-tester", - "version": "2.3.0", - "private": true, + "name": "woocommerce-beta-tester", "description": "Setting up the local beta tester scripts.", - "homepage": "http://github.com/woocommerce/woocommerce-beta-tester", + "license": "GPL-2.0", "repository": { "type": "git", "url": "git://github.com/woocommerce/woocommerce-beta-tester.git" }, - "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" + "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" }, "dependencies": { "@emotion/react": "^11.10.4", @@ -75,32 +45,61 @@ "@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" }, - "title": "WooCommerce Beta Tester" + "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" + ] + } } diff --git a/plugins/woocommerce-docs/package.json b/plugins/woocommerce-docs/package.json index c1dfe0f166f..b015bf0e52c 100644 --- a/plugins/woocommerce-docs/package.json +++ b/plugins/woocommerce-docs/package.json @@ -1,22 +1,21 @@ { - "name": "@woocommerce/plugin-woocommerce-docs", + "name": "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", - "postinstall": "composer install", "start": "wp-scripts start", + "postinstall": "composer install", "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", @@ -39,7 +38,6 @@ "prettier": "npm:wp-prettier@^2.6.2", "ts-loader": "^9.4.1", "ts-node": "^10.9.1", - "typescript": "^5.1.6", - "wireit": "^0.14.1" + "typescript": "^5.1.6" } } diff --git a/plugins/woocommerce/README.md b/plugins/woocommerce/README.md index 8d574308bff..0c5d2da5b85 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 --filter=@woocommerce/plugin-woocommerce build +pnpm run --filter=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 shortcodes. +This directory contains the CSS and jQuery code for WooCommerce. ```bash # Build the assets. -pnpm --filter=@woocommerce/shortcode-assets build +pnpm run --filter=woocommerce/client/legacy build # Lint the assets. -pnpm --filter=@woocommerce/shortcode-assets lint +pnpm run --filter=woocommerce/client/legacy lint ``` ### `plugins/woocommerce-admin` @@ -47,11 +47,11 @@ This directory contains the React-based admin interface. ```bash # Build the React-based admin client. -pnpm --filter=@woocommerce/admin-library build +pnpm run --filter=woocommerce/client/admin build # Lint the React-based admin client. -pnpm --filter=@woocommerce/admin-library lint +pnpm run --filter=woocommerce/client/admin lint # Test the React-based admin client. -pnpm --filter=@woocommerce/admin-library test +pnpm run --filter=woocommerce/client/admin 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/admin-library dev +pnpm --filter=woocommerce/client/admin dev # Create and watch a development build of the React-based admin client. -pnpm --filter=@woocommerce/admin-library start +pnpm --filter=woocommerce/client/admin start # Watch the tests of the React-based admin client. -pnpm --filter=@woocommerce/admin-library test:watch +pnpm --filter=woocommerce/client/admin test:watch # Run a type check over the React-based admin client's TypeScript files. -pnpm --filter=@woocommerce/admin-library ts:check +pnpm --filter=woocommerce/client/admin ts:check ``` ## Documentation diff --git a/plugins/woocommerce/assets/css/.gitkeep b/plugins/woocommerce/assets/css/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/plugins/woocommerce/assets/js/.gitkeep b/plugins/woocommerce/assets/js/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/plugins/woocommerce/bin/build-zip.sh b/plugins/woocommerce/bin/build-zip.sh index 2b8fc30b0e6..86e53d51aa4 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 --filter='@woocommerce/plugin-woocommerce' build || exit "$?" +pnpm -w run build --filter=woocommerce || exit "$?" echo "Cleaning up PHP dependencies..." composer install --no-dev || exit "$?" echo "Run makepot..." -pnpm --filter=@woocommerce/plugin-woocommerce makepot || exit "$?" +pnpm -r --filter=woocommerce run 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 33e1c331d3f..ffe637c880b 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 build`. + $phase = 'core'; // Default to core when running `pnpm run 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 e3b64007858..40422b2586d 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 packages:fix:textdomain + pnpm run 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 13fcc2ff340..b1dfc981ba6 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: 'build/css', + cssDest: '../../assets/css', fonts: 'assets/fonts', images: 'assets/images', js: 'js', - jsDest: 'build/js', + jsDest: '../../assets/js', php: 'includes', }, diff --git a/plugins/woocommerce/client/legacy/package.json b/plugins/woocommerce/client/legacy/package.json index bd353996afe..ab8cd24119d 100644 --- a/plugins/woocommerce/client/legacy/package.json +++ b/plugins/woocommerce/client/legacy/package.json @@ -1,23 +1,14 @@ { - "name": "@woocommerce/shortcode-assets", + "name": "woocommerce/client/legacy", "version": "1.0.0", - "private": true, - "license": "GPL-2.0-or-later", "author": "Automattic", + "license": "GPL-2.0-or-later", + "private": true, "main": "Gruntfile.js", - "files": [ - "build" - ], "scripts": { - "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" + "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" }, "devDependencies": { "@types/node": "^16.18.18", @@ -42,29 +33,9 @@ "gruntify-eslint": "5.0.0", "nodemon": "^2.0.21", "sass": "^1.45.0", - "stylelint": "13.8.0", - "wireit": "^0.14.1" + "stylelint": "13.8.0" }, - "wireit": { - "build:project:assets": { - "command": "grunt assets", - "files": [ - "Gruntfile.js", - "js/**/*.js", - "css/**/*.scss" - ], - "output": [ - "build" - ], - "dependencies": [ - "dependencyOutputs" - ] - }, - "dependencyOutputs": { - "allowUsuallyExcludedPaths": true, - "files": [ - "package.json" - ] - } + "dependencies": { + "sourcebuster": "github:woocommerce/sourcebuster-js#v1.1.2" } } diff --git a/plugins/woocommerce/includes/class-woocommerce.php b/plugins/woocommerce/includes/class-woocommerce.php index fa4943a2e70..f56b733dc6d 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 --filter=\'@woocommerce/plugin-woocommerce\' build 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 run build --filter=woocommerce 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 34181b42a46..6b18e717e83 100644 --- a/plugins/woocommerce/package.json +++ b/plugins/woocommerce/package.json @@ -1,70 +1,16 @@ { - "name": "@woocommerce/plugin-woocommerce", + "name": "woocommerce", + "title": "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": { - "build_step": "pnpm build:zip", + "wp_org_slug": "woocommerce", + "build_step": "pnpm run build:zip", "ci": { "name": "WP: latest", "customCommands": { @@ -113,18 +59,51 @@ } } ] - }, - "wp_org_slug": "woocommerce" + } }, - "browserslist": [ - "> 0.1%", - "ie 8", - "ie 9" - ], - "dependencies": { - "@woocommerce/admin-library": "workspace:*", - "@woocommerce/shortcode-assets": "workspace:*", - "@wordpress/browserslist-config": "wp-6.0" + "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" }, "devDependencies": { "@babel/cli": "7.12.8", @@ -169,67 +148,27 @@ "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" }, - "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" - ] - } + "browserslist": [ + "> 0.1%", + "ie 8", + "ie 9" + ], + "dependencies": { + "@wordpress/browserslist-config": "wp-6.0" } } diff --git a/plugins/woocommerce/tests/api-core-tests/README.md b/plugins/woocommerce/tests/api-core-tests/README.md index b26220270f4..747e672b086 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 --filter='@woocommerce/plugin-woocommerce' build` +- `pnpm run build --filter=woocommerce` - `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 e92ecdaa6a4..d80d8db6992 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 --filter='@woocommerce/plugin-woocommerce' build` (builds WooCommerce locally) +- `pnpm run build --filter=woocommerce` (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 0eb955bada6..397d0a592fa 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 --filter='@woocommerce/plugin-woocommerce' build` +- `pnpm run build --filter=woocommerce` - `npm install jest --global` (this only needs to be done once) -- `pnpm --filter='@woocommerce/plugin-woocommerce' docker:up` (this will build the test site using Docker) +- `pnpm docker:up --filter=woocommerce` (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/plugin-woocommerce` when you are done with running e2e tests and before making any changes to test site configuration. +- Run `pnpm docker:down --filter=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/plugin-woocommerce` and then `pnpm docker:up --filter=@woocommerce/plugin-woocommerce` re-initializes the test container. +Note that running `pnpm docker:down --filter=woocommerce` and then `pnpm docker:up --filter=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 e2e --filter=@woocommerce/plugin-woocommerce +pnpm run e2e --filter=woocommerce ``` ### How to run tests in non-headless mode @@ -167,7 +167,7 @@ pnpm e2e --filter=@woocommerce/plugin-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 e2e:dev --filter=@woocommerce/plugin-woocommerce +pnpm run e2e:dev --filter=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 e2e:dev --filter=@woocommerce/plugin-woocommerce +PUPPETEER_SLOWMO=10 pnpm run e2e:dev --filter=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 e2e:debug --filter=@woocommerce/plugin-woocommerce +pnpm run e2e:debug --filter=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/plugin-woocommerce +TRAVIS_MARIADB_VERSION=10.5.3 TRAVIS_PHP_VERSION=7.4.5 WP_VERSION=5.4.1 pnpm docker:up --filter=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 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). +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). 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 659003bc54d..2364ed7df08 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 env:dev --filter=@woocommerce/plugin-woocommerce -pnpm env:performance-init --filter=@woocommerce/plugin-woocommerce +pnpm run env:dev --filter=woocommerce +pnpm run env:performance-init --filter=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 99d3128acfc..3b98d7feb09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,10 +30,10 @@ importers: version: 1.0.1 devDependencies: '@babel/preset-env': - specifier: ^7.23.3 + specifier: ^7.20.2 version: 7.23.5(@babel/core@7.12.9) '@babel/runtime': - specifier: ^7.23.4 + specifier: ^7.21.0 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.33.3 - version: 3.34.0 + specifier: ^3.29.1 + version: 3.33.3 css-loader: - specifier: ^6.8.1 + specifier: ^6.7.3 version: 6.8.1(webpack@5.89.0) glob: specifier: ^7.2.3 @@ -99,14 +99,17 @@ importers: specifier: ^2.88.2 version: 2.88.2 sass: - specifier: ^1.69.5 + specifier: ^1.59.3 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.9.3 + specifier: ^10.7.3 version: 10.9.3 + turbo: + specifier: ^1.10.7 + version: 1.10.16 typescript: specifier: ^5.1.6 version: 5.3.2 @@ -114,7 +117,7 @@ importers: specifier: ^1.1.2 version: 1.1.2(webpack@5.89.0) webpack: - specifier: ^5.89.0 + specifier: ^5.76.2 version: 5.89.0(webpack-cli@5.1.4) packages/js/admin-e2e-tests: @@ -180,9 +183,6 @@ 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,9 +253,6 @@ 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: @@ -389,9 +386,6 @@ 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: @@ -438,15 +432,12 @@ 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.25.0 + version: 2.24.1 dotenv: specifier: ^10.0.0 version: 10.0.0 @@ -472,9 +463,6 @@ importers: eslint: specifier: ^8.32.0 version: 8.55.0 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/block-templates: dependencies: @@ -578,9 +566,6 @@ 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: @@ -706,7 +691,7 @@ importers: version: 2.3.2 core-js: specifier: ^3.21.1 - version: 3.34.0 + version: 3.33.3 d3-axis: specifier: ^1.0.12 version: 1.0.12 @@ -906,21 +891,10 @@ 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: - devDependencies: - wireit: - specifier: ^0.14.1 - version: 0.14.1 + packages/js/create-product-editor-block: {} - packages/js/create-woo-extension: - devDependencies: - wireit: - specifier: ^0.14.1 - version: 0.14.1 + packages/js/create-woo-extension: {} packages/js/csv-export: dependencies: @@ -967,9 +941,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/currency: dependencies: @@ -1025,9 +996,6 @@ 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: @@ -1149,9 +1117,6 @@ 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: @@ -1288,9 +1253,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/date: dependencies: @@ -1361,9 +1323,6 @@ 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: @@ -1401,9 +1360,6 @@ 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: @@ -1468,9 +1424,6 @@ 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: @@ -1574,9 +1527,6 @@ importers: semver: specifier: ^7.3.2 version: 7.5.4 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/e2e-utils: dependencies: @@ -1650,9 +1600,6 @@ 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: @@ -1696,9 +1643,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/experimental: dependencies: @@ -1777,7 +1721,7 @@ importers: version: 27.5.2 '@types/react-transition-group': specifier: ^4.4.4 - version: 4.4.10 + version: 4.4.9 '@types/testing-library__jest-dom': specifier: ^5.14.3 version: 5.14.9 @@ -1835,9 +1779,6 @@ 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: @@ -1905,9 +1846,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/expression-evaluation: dependencies: @@ -1951,15 +1889,8 @@ 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: - devDependencies: - wireit: - specifier: ^0.14.1 - version: 0.14.1 + packages/js/extend-cart-checkout-block: {} packages/js/integrate-plugin: dependencies: @@ -2051,9 +1982,6 @@ 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: @@ -2078,9 +2006,6 @@ 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: @@ -2133,9 +2058,6 @@ 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: @@ -2194,9 +2116,6 @@ 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: @@ -2276,9 +2195,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/notices: dependencies: @@ -2343,9 +2259,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/number: dependencies: @@ -2392,9 +2305,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 packages/js/onboarding: dependencies: @@ -2507,9 +2417,6 @@ 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: @@ -2763,9 +2670,6 @@ 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: @@ -2803,9 +2707,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 plugins/woo-ai: dependencies: @@ -2924,18 +2825,9 @@ 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 @@ -3002,7 +2894,7 @@ importers: version: 19.1.0(stylelint@13.8.0) allure-commandline: specifier: ^2.17.2 - version: 2.25.0 + version: 2.24.1 allure-playwright: specifier: ^2.0.0-beta.16 version: 2.9.2 @@ -3066,9 +2958,6 @@ 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 @@ -3191,7 +3080,7 @@ importers: version: 2.3.2 core-js: specifier: ^3.21.1 - version: 3.34.0 + version: 3.33.3 debug: specifier: ^4.3.3 version: 4.3.4(supports-color@9.4.0) @@ -3330,7 +3219,7 @@ importers: version: 5.3.3 '@types/react-transition-group': specifier: ^4.4.4 - version: 4.4.10 + version: 4.4.9 '@types/testing-library__jest-dom': specifier: ^5.14.3 version: 5.14.9 @@ -3637,9 +3526,6 @@ 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: @@ -3746,9 +3632,6 @@ importers: uglify-js: specifier: ^3.5.3 version: 3.17.4 - wireit: - specifier: ^0.14.1 - version: 0.14.1 plugins/woocommerce-docs: dependencies: @@ -3813,9 +3696,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 plugins/woocommerce/client/legacy: dependencies: @@ -3892,9 +3772,6 @@ importers: stylelint: specifier: 13.8.0 version: 13.8.0 - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/code-analyzer: dependencies: @@ -3956,9 +3833,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/create-extension: dependencies: @@ -3971,10 +3845,6 @@ importers: promptly: specifier: ^3.2.0 version: 3.2.0 - devDependencies: - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/monorepo-merge: dependencies: @@ -4024,9 +3894,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/monorepo-utils: dependencies: @@ -4124,9 +3991,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/package-release: dependencies: @@ -4170,9 +4034,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/release-posts: dependencies: @@ -4246,9 +4107,6 @@ importers: typescript: specifier: ^5.1.6 version: 5.3.2 - wireit: - specifier: ^0.14.1 - version: 0.14.1 tools/storybook: dependencies: @@ -4331,9 +4189,6 @@ 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: @@ -7129,7 +6984,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.34.0 + core-js-compat: 3.33.3 semver: 5.7.2 /@babel/preset-env@7.23.5(@babel/core@7.12.9): @@ -7217,7 +7072,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.34.0 + core-js-compat: 3.33.3 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -7308,7 +7163,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.34.0 + core-js-compat: 3.33.3 semver: 6.3.1 transitivePeerDependencies: - supports-color @@ -9972,7 +9827,7 @@ packages: dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 - core-js-pure: 3.34.0 + core-js-pure: 3.33.3 error-stack-parser: 2.1.4 find-up: 5.0.0 html-entities: 2.4.0 @@ -10011,7 +9866,7 @@ packages: dependencies: ansi-html-community: 0.0.8 common-path-prefix: 3.0.0 - core-js-pure: 3.34.0 + core-js-pure: 3.33.3 error-stack-parser: 2.1.4 find-up: 5.0.0 html-entities: 2.4.0 @@ -11521,7 +11376,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.34.0 + core-js: 3.33.3 global: 4.4.0 lodash: 4.17.21 react: 17.0.2 @@ -11550,7 +11405,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.34.0 + core-js: 3.33.3 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11595,7 +11450,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.34.0 + core-js: 3.33.3 lodash: 4.17.21 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -11642,7 +11497,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.34.0 + core-js: 3.33.3 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11687,7 +11542,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.34.0 + core-js: 3.33.3 escape-html: 1.0.3 fast-deep-equal: 3.1.3 global: 4.4.0 @@ -11723,7 +11578,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.34.0 + core-js: 3.33.3 escape-html: 1.0.3 fast-deep-equal: 3.1.3 global: 4.4.0 @@ -11756,7 +11611,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.34.0 + core-js: 3.33.3 global: 4.4.0 prop-types: 15.8.1 qs: 6.11.2 @@ -11784,7 +11639,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.34.0 + core-js: 3.33.3 estraverse: 5.3.0 loader-utils: 2.0.4 prop-types: 15.8.1 @@ -11811,7 +11666,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.34.0 + core-js: 3.33.3 global: 4.4.0 memoizerific: 1.11.3 prop-types: 15.8.1 @@ -11834,7 +11689,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.34.0 + core-js: 3.33.3 global: 4.4.0 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -11865,7 +11720,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.34.0 + core-js: 3.33.3 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -11921,7 +11776,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.34.0 + core-js: 3.33.3 css-loader: 3.6.0(webpack@4.47.0) file-loader: 6.2.0(webpack@4.47.0) find-up: 5.0.0 @@ -11989,7 +11844,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.34.0 + core-js: 3.33.3 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 @@ -12026,7 +11881,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.34.0 + core-js: 3.33.3 global: 4.4.0 qs: 6.11.2 telejson: 6.0.8 @@ -12037,7 +11892,7 @@ packages: dependencies: '@storybook/channels': 6.5.17-alpha.0 '@storybook/client-logger': 6.5.17-alpha.0 - core-js: 3.34.0 + core-js: 3.33.3 global: 4.4.0 telejson: 6.0.8 dev: true @@ -12045,7 +11900,7 @@ packages: /@storybook/channels@6.5.17-alpha.0: resolution: {integrity: sha512-yfMGsvtWVFK27FO7orjCZmzoq0Zk/48A5CyqFz9lgyttuzKfltUOIwUpu7mvk/56lJFgDv9yRigD6iVltIMAeA==} dependencies: - core-js: 3.34.0 + core-js: 3.33.3 ts-dedent: 2.2.0 util-deprecate: 1.0.2 dev: true @@ -12076,7 +11931,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.34.0 + core-js: 3.33.3 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -12094,7 +11949,7 @@ packages: /@storybook/client-logger@6.5.17-alpha.0: resolution: {integrity: sha512-1g9cGPlp016xKsOv05U4NfhdOrVN7ra6gkkovYy/sZhzOH3ouXGebMw2dMMCGPXBx0MNXK0jnDEj+r3mXPP6BQ==} dependencies: - core-js: 3.34.0 + core-js: 3.33.3 global: 4.4.0 dev: true @@ -12113,7 +11968,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.34.0 + core-js: 3.33.3 memoizerific: 1.11.3 qs: 6.11.2 react: 17.0.2 @@ -12168,7 +12023,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.34.0 + core-js: 3.33.3 global: 4.4.0 lodash: 4.17.21 qs: 6.11.2 @@ -12205,7 +12060,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.34.0 + core-js: 3.33.3 global: 4.4.0 lodash: 4.17.21 qs: 6.11.2 @@ -12259,7 +12114,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.34.0 + core-js: 3.33.3 express: 4.18.2 file-system-cache: 1.1.0 find-up: 5.0.0 @@ -12293,7 +12148,7 @@ packages: /@storybook/core-events@6.5.17-alpha.0: resolution: {integrity: sha512-L2QV/isJymOBZp6Q1Q1GMZnLDIs2blwyzCh8auAnVBbluVzpUs8WULvXLvBhSwXULpGZVujt8ToL+aoVTHleFA==} dependencies: - core-js: 3.34.0 + core-js: 3.33.3 dev: true /@storybook/core-events@7.6.3: @@ -12342,7 +12197,7 @@ packages: cli-table3: 0.6.3 commander: 6.2.1 compression: 1.7.4 - core-js: 3.34.0 + core-js: 3.33.3 cpy: 8.1.2 detect-port: 1.5.1 express: 4.18.2 @@ -12419,7 +12274,7 @@ packages: cli-table3: 0.6.3 commander: 6.2.1 compression: 1.7.4 - core-js: 3.34.0 + core-js: 3.33.3 cpy: 8.1.2 detect-port: 1.5.1 express: 4.18.2 @@ -12549,7 +12404,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.34.0 + core-js: 3.33.3 fs-extra: 9.1.0 global: 4.4.0 regenerator-runtime: 0.13.11 @@ -12576,7 +12431,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.34.0 + core-js: 3.33.3 doctrine: 3.0.0 lodash: 4.17.21 regenerator-runtime: 0.13.11 @@ -12637,7 +12492,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.34.0 + core-js: 3.33.3 css-loader: 3.6.0(webpack@4.47.0) express: 4.18.2 file-loader: 6.2.0(webpack@4.47.0) @@ -12694,7 +12549,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.34.0 + core-js: 3.33.3 css-loader: 5.2.7(webpack@5.89.0) express: 4.18.2 find-up: 5.0.0 @@ -12752,7 +12607,7 @@ packages: dependencies: '@types/npmlog': 4.1.6 chalk: 4.1.2 - core-js: 3.34.0 + core-js: 3.33.3 npmlog: 5.0.1 pretty-hrtime: 1.0.3 dev: true @@ -12760,7 +12615,7 @@ packages: /@storybook/postinstall@6.5.17-alpha.0: resolution: {integrity: sha512-ipK7F0Yz7igGgxg1KfJYN++U7XGA0eNqB93CPK4nux7OLbbI+w4LaH22OmnFt+je/TXaKyIt/DZKYP0qVYk7iQ==} dependencies: - core-js: 3.34.0 + core-js: 3.33.3 dev: true /@storybook/preview-api@7.6.3: @@ -12795,7 +12650,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.34.0 + core-js: 3.33.3 global: 4.4.0 lodash: 4.17.21 qs: 6.11.2 @@ -12879,7 +12734,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.34.0 + core-js: 3.33.3 escodegen: 2.1.0 fs-extra: 9.1.0 global: 4.4.0 @@ -12969,7 +12824,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.34.0 + core-js: 3.33.3 escodegen: 2.1.0 fs-extra: 9.1.0 global: 4.4.0 @@ -13016,7 +12871,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.34.0 + core-js: 3.33.3 memoizerific: 1.11.3 qs: 6.11.2 react: 17.0.2 @@ -13037,7 +12892,7 @@ packages: engines: {node: '>=10'} hasBin: true dependencies: - core-js: 3.34.0 + core-js: 3.33.3 find-up: 4.1.0 dev: true @@ -13050,7 +12905,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.34.0 + core-js: 3.33.3 estraverse: 5.3.0 global: 4.4.0 loader-utils: 2.0.4 @@ -13071,7 +12926,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.34.0 + core-js: 3.33.3 fast-deep-equal: 3.1.3 global: 4.4.0 lodash: 4.17.21 @@ -13092,7 +12947,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.34.0 + core-js: 3.33.3 detect-package-manager: 2.0.1 fetch-retry: 5.0.6 fs-extra: 9.1.0 @@ -13120,7 +12975,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.34.0 + core-js: 3.33.3 memoizerific: 1.11.3 react: 17.0.2 react-dom: 17.0.2(react@17.0.2) @@ -13165,7 +13020,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.34.0 + core-js: 3.33.3 memoizerific: 1.11.3 qs: 6.11.2 react: 17.0.2 @@ -14109,8 +13964,8 @@ packages: '@types/react': 17.0.71 dev: true - /@types/react-transition-group@4.4.10: - resolution: {integrity: sha512-hT/+s0VQs2ojCX823m60m5f0sL5idt9SO6Tj6Dg+rdphGPIeJbJ6CxvBYkgkGKrYeDjvIpKTR38UzmtHJOGW3Q==} + /@types/react-transition-group@4.4.9: + resolution: {integrity: sha512-ZVNmWumUIh5NhH8aMD9CR2hdW0fNuYInlocZHaZ+dgk/1K49j1w/HoAuK1ki+pgscQrOFRTlXeoURtuzEkV3dg==} dependencies: '@types/react': 17.0.71 dev: true @@ -15524,7 +15379,7 @@ packages: '@wordpress/browserslist-config': 2.7.0 '@wordpress/element': 2.20.3 '@wordpress/warning': 1.4.2 - core-js: 3.34.0 + core-js: 3.33.3 transitivePeerDependencies: - supports-color dev: true @@ -15544,7 +15399,7 @@ packages: '@wordpress/element': 4.20.0 '@wordpress/warning': 2.47.0 browserslist: 4.19.3 - core-js: 3.34.0 + core-js: 3.33.3 transitivePeerDependencies: - supports-color @@ -15562,7 +15417,7 @@ packages: '@wordpress/browserslist-config': 5.30.0 '@wordpress/warning': 2.47.0 browserslist: 4.22.2 - core-js: 3.34.0 + core-js: 3.33.3 react: 17.0.2 transitivePeerDependencies: - supports-color @@ -16381,7 +16236,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.14(react-dom@17.0.2)(react@17.0.2) + framer-motion: 10.16.12(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 @@ -19183,8 +19038,8 @@ packages: require-from-string: 2.0.2 uri-js: 4.4.1 - /allure-commandline@2.25.0: - resolution: {integrity: sha512-HYMQwuX/8ySTrXqgr6ZY830c6xgRbSusxVwZIBbDyNTCDb3mqK2b1ENjsD8yhl/7/8S02NZCDAwJFxt3f8qL9Q==} + /allure-commandline@2.24.1: + resolution: {integrity: sha512-eNto3ipBq+O2B/f8/OwiS3E8R7jYENs3qv8jT7wMZmziYLANsISC9tX/FfEqR3FDiQlEOjkP7iyTEZ3ph53FPg==} hasBin: true /allure-js-commons@1.3.2: @@ -19767,8 +19622,8 @@ packages: resolution: {integrity: sha512-BQUiyBLScS0+YPnnCZZGjb78mZ8sQ8aKgxarDPNw05rpbaCS7VIQSLy2tgjZKct9Dn1xLbKMXOpA98OWei90zA==} dev: true - /aws-sdk@2.1512.0: - resolution: {integrity: sha512-+YYS18VsMUdUaZdsVsE+heJmrAwbxcbyw/9B6Ck90ehlRjjU2SELKH7zhpxbgRH00z8Z4ltaLwRhsp69kLHflQ==} + /aws-sdk@2.1511.0: + resolution: {integrity: sha512-LikcMeIzA1fu+j8qElVmPDpWBFsMzd8pwQoo33xXhIwtWaMoaBMI5vGGz/cvdn3LnjkRcEntWZeE8haULsy+bA==} engines: {node: '>= 10.0.0'} dependencies: buffer: 4.9.2 @@ -20259,7 +20114,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.34.0 + core-js-compat: 3.33.3 transitivePeerDependencies: - supports-color dev: true @@ -20271,7 +20126,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.34.0 + core-js-compat: 3.33.3 transitivePeerDependencies: - supports-color @@ -20282,7 +20137,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.34.0 + core-js-compat: 3.33.3 transitivePeerDependencies: - supports-color @@ -20977,7 +20832,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001146 - electron-to-chromium: 1.4.604 + electron-to-chromium: 1.4.603 dev: true /browserslist@4.19.3: @@ -20986,7 +20841,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001566 - electron-to-chromium: 1.4.604 + electron-to-chromium: 1.4.603 escalade: 3.1.1 node-releases: 2.0.14 picocolors: 1.0.0 @@ -20997,7 +20852,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001566 - electron-to-chromium: 1.4.604 + electron-to-chromium: 1.4.603 node-releases: 2.0.14 update-browserslist-db: 1.0.13(browserslist@4.22.2) @@ -22457,13 +22312,13 @@ packages: webpack: 5.89.0(webpack-cli@3.3.12) dev: true - /core-js-compat@3.34.0: - resolution: {integrity: sha512-4ZIyeNbW/Cn1wkMMDy+mvrRUxrwFNjKwbhCfQpDd+eLgYipDqp8oGFGtLmhh18EDPKA0g3VUBYOxQGGwvWLVpA==} + /core-js-compat@3.33.3: + resolution: {integrity: sha512-cNzGqFsh3Ot+529GIXacjTJ7kegdt5fPXxCBVS1G0iaZpuo/tBz399ymceLJveQhFFZ8qThHiP3fzuoQjKN2ow==} dependencies: browserslist: 4.22.2 - /core-js-pure@3.34.0: - resolution: {integrity: sha512-pmhivkYXkymswFfbXsANmBAewXx86UBfmagP+w0wkK06kLsLlTK5oQmsURPivzMkIBQiYq2cjamcZExIwlFQIg==} + /core-js-pure@3.33.3: + resolution: {integrity: sha512-taJ00IDOP+XYQEA2dAe4ESkmHt1fL8wzYDo3mRWQey8uO9UojlBFMneA65kMyxfYP7106c6LzWaq7/haDT6BCQ==} requiresBuild: true dev: true @@ -22477,8 +22332,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.34.0: - resolution: {integrity: sha512-aDdvlDder8QmY91H88GzNi9EtQi2TjvQhpCX6B1v/dAZHU1AuLgHvRh54RiOerpEhEW46Tkf+vgAViB/CWC0ag==} + /core-js@3.33.3: + resolution: {integrity: sha512-lo0kOocUlLKmm6kv/FswQL8zbkH7mVsLJ/FULClOhv8WRVmKLVcs6XPNQAzstfeJTCHMyButEwG+z1kHxHoDZw==} requiresBuild: true /core-util-is@1.0.2: @@ -24068,8 +23923,8 @@ packages: dependencies: jake: 10.8.7 - /electron-to-chromium@1.4.604: - resolution: {integrity: sha512-JAJ4lyLJYudlgJPYJicimU9R+qZ/3iyeyQS99bfT7PWi7psYWeN84lPswTjpHxQueU34PKxM/IJzQS6poYlovQ==} + /electron-to-chromium@1.4.603: + resolution: {integrity: sha512-Dvo5OGjnl7AZTU632dFJtWj0uJK835eeOVQIuRcmBmsFsTNn3cL05FqOyHAfGQDIoHfLhyJ1Tya3PJ0ceMz54g==} /element-resize-detector@1.2.4: resolution: {integrity: sha512-Fl5Ftk6WwXE0wqCgNoseKWndjzZlDCwuPTcoVZfCP9R3EHQF8qUtr3YUPNETegRBOKqQKPW3n4kiIWngGi8tKg==} @@ -26680,8 +26535,8 @@ packages: dependencies: map-cache: 0.2.2 - /framer-motion@10.16.14(react-dom@17.0.2)(react@17.0.2): - resolution: {integrity: sha512-poovsXtR7doXRfjqVjUai82Zl2z5yMUFKtYWHnQK+xsDVPhHVUJEU+Kr2kqEnUV4gry+LcRdrDzcMI7OdJlDMg==} + /framer-motion@10.16.12(react-dom@17.0.2)(react@17.0.2): + resolution: {integrity: sha512-w7Yzx0OzQ5Uh6uNkxaX+4TuAPuOKz3haSbjmHpdrqDpGuCJCpq6YP9Dy7JJWdZ6mJjndrg3Ao3vUwDajKNikCA==} peerDependencies: react: ^17.0.2 react-dom: ^18.0.0 @@ -32453,7 +32308,7 @@ packages: dependencies: '@babel/runtime': 7.23.5 app-root-dir: 1.0.2 - core-js: 3.34.0 + core-js: 3.33.3 dotenv: 8.6.0 dotenv-expand: 5.1.0 dev: true @@ -35327,7 +35182,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.1512.0 + aws-sdk: 2.1511.0 concurrently: 7.6.0 debug: 4.3.4(supports-color@9.4.0) find-yarn-workspace-root: 2.0.0 @@ -37639,14 +37494,6 @@ 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'} @@ -38708,7 +38555,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.10 + '@types/react-transition-group': 4.4.9 memoize-one: 6.0.0 prop-types: 15.8.1 react: 17.0.2 @@ -42538,6 +42385,66 @@ 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==} @@ -44635,18 +44542,6 @@ 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 new file mode 100644 index 00000000000..8cd56546876 --- /dev/null +++ b/tools/code-analyzer/.gitignore @@ -0,0 +1 @@ +/oclif.manifest.json diff --git a/tools/code-analyzer/README.md b/tools/code-analyzer/README.md index bda687da59d..cf5c98dae08 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 analyzer -- --help` +To find out more about the other arguments to the command you can run `pnpm run 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 da3e15b91a3..9052bf102d2 100644 --- a/tools/code-analyzer/package.json +++ b/tools/code-analyzer/package.json @@ -2,17 +2,10 @@ "name": "code-analyzer", "version": "1.0.0", "description": "A tool to analyze code changes in WooCommerce Monorepo.", - "homepage": "https://github.com/woocommerce/woocommerce", - "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" - }, + "homepage": "https://github.com/woocommerce/woocommerce", + "license": "GPLv2", + "repository": "woocommerce/woocommerce", "dependencies": { "@actions/core": "^1.10.0", "@commander-js/extra-typings": "^10.0.3", @@ -34,11 +27,18 @@ "ts-jest": "~29.1.1", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "^5.1.6", - "wireit": "^0.14.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" }, "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 188fc34debd..5be564df04a 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 storybook", + "storybook-rtl": "USE_RTL_STYLE=true pnpm run 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 clean && pnpm build" + "prepack": "pnpm run clean && pnpm run 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 clean && npm run compile", -+ "build": "node ./node_modules/require-turbo && pnpm clean && npm run compile", - "prepack": "pnpm build", +- "build": "pnpm run clean && npm run compile", ++ "build": "node ./node_modules/require-turbo && pnpm run clean && npm run compile", + "prepack": "pnpm run 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 build:js && pnpm build:css", -+ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", +- "build": "pnpm run build:js && pnpm run build:css", ++ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 test -- --updateSnapshot", + "test:update-snapshots": "pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 build:js && pnpm build:css", -+ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", +- "build": "pnpm run build:js && pnpm run build:css", ++ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --build --watch\" \"webpack --watch\"", - "prepack": "pnpm clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 build:js && pnpm build:css", -+ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", +- "build": "pnpm run build:js && pnpm run build:css", ++ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --build --watch\" \"webpack --watch\"", - "prepack": "pnpm clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 build:js && pnpm build:css", -+ "build": "node ./node_modules/require-turbo && pnpm build:js && pnpm build:css", +- "build": "pnpm run build:js && pnpm run build:css", ++ "build": "node ./node_modules/require-turbo && pnpm run build:js && pnpm run build:css", "build:js": "tsc --build ./tsconfig.json ./tsconfig-cjs.json", "build:css": "webpack", "start": "concurrently \"tsc --build --watch\" \"webpack --watch\"", - "prepack": "pnpm clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 clean && pnpm build", + "prepack": "pnpm run clean && pnpm run 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 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": "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: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 build:feature-config && cross-env WC_ADMIN_PHASE=development webpack --watch", + "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", @@ -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 lint:js && pnpm lint:css", -+ "lint": "node ./node_modules/require-turbo && pnpm lint:js && pnpm lint:css", +- "lint": "pnpm run lint:js && pnpm run lint:css", ++ "lint": "node ./node_modules/require-turbo && pnpm run lint:js && pnpm run 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 lint:js -- --fix --ext=js,ts,tsx", + "lint:js-fix": "pnpm run 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 lint && pnpm test && cross-env WC_ADMIN_PHASE=core pnpm build", + "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:watch": "cross-env WC_ADMIN_PHASE=development pnpm run:packages -- start --parallel", @@ -42,12 +42,12 @@ - "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": "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:package": "pnpm run:packages -- start --parallel", - "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", + "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", "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 --filter ../../packages/js/ --filter !api-core-tests test", +- "test:packages": "pnpm run --filter ../../packages/js/ --filter !api-core-tests test", + "test:packages": "pnpm -w exec turbo run test --filter='./packages/js/*'", - "test:update-snapshots": "pnpm test:client -- --updateSnapshot && pnpm --filter @woocommerce/components test:update-snapshots", - "test:watch": "pnpm test:client -- --watch", + "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 --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 build +-pnpm run 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 build:zip" +- "build_step": "pnpm run 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 build:admin && pnpm uglify", -+ "build": "node ./node_modules/require-turbo && pnpm build:admin && pnpm uglify", +- "build": "pnpm run build:admin && pnpm run uglify", ++ "build": "node ./node_modules/require-turbo && pnpm run build:admin && pnpm run uglify", "build:admin": "wp-scripts build", "build:zip": "./bin/build-zip.sh", - "build:dev": "pnpm lint:js && pnpm build", + "build:dev": "pnpm run lint:js && pnpm run build", @@ -66,12 +64,13 @@ }, "woorelease": { "svn_reauth": "true", - "wp_org_slug": "woocommerce-beta-tester" + "wp_org_slug": "woocommerce-beta-tester", -+ "build_step": "pnpm build:zip" ++ "build_step": "pnpm run 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 build:feature-config", -+ "build": "node ./node_modules/require-turbo && WC_ADMIN_PHASE=core pnpm build:feature-config", +- "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: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 695ca06cb31..dba65d041b6 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/**/*" - ] -} \ No newline at end of file + "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/**/*" + ] +} diff --git a/tools/create-extension/README.md b/tools/create-extension/README.md index a53c89e6399..8c8e64d835a 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 create-extension +pnpm run 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 408b972c3fc..9cfc851944c 100644 --- a/tools/create-extension/package.json +++ b/tools/create-extension/package.json @@ -2,19 +2,16 @@ "name": "create-extension", "version": "0.0.0", "description": "A tool to scaffold out an Admin ready WooCommerce extension", - "homepage": "https://github.com/woocommerce/woocommerce", - "repository": "woocommerce/woocommerce", - "license": "GPLv2", "author": "Automattic", + "homepage": "https://github.com/woocommerce/woocommerce", + "license": "GPLv2", "main": "index.js", + "repository": "woocommerce/woocommerce", "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 new file mode 100644 index 00000000000..8cd56546876 --- /dev/null +++ b/tools/monorepo-merge/.gitignore @@ -0,0 +1 @@ +/oclif.manifest.json diff --git a/tools/monorepo-merge/package.json b/tools/monorepo-merge/package.json index 4adcd12a020..32a1bd39644 100644 --- a/tools/monorepo-merge/package.json +++ b/tools/monorepo-merge/package.json @@ -2,28 +2,20 @@ "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", @@ -32,8 +24,8 @@ }, "devDependencies": { "@octokit/request-error": "^3.0.1", - "@types/node": "^16.18.18", "@woocommerce/eslint-plugin": "workspace:*", + "@types/node": "^16.18.18", "eslint": "^8.32.0", "globby": "^11", "jscodeshift": "^0.13.1", @@ -41,12 +33,7 @@ "shx": "^0.3.3", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "^5.1.6", - "wireit": "^0.14.1" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "typescript": "^5.1.6" }, "oclif": { "bin": "monorepo-merge", @@ -65,5 +52,18 @@ "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 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/tools/monorepo-utils/package.json b/tools/monorepo-utils/package.json index a216a0ece3b..47404495166 100644 --- a/tools/monorepo-utils/package.json +++ b/tools/monorepo-utils/package.json @@ -2,20 +2,11 @@ "name": "@woocommerce/monorepo-utils", "version": "0.0.1", "description": "WooCommerce Monorepo utility tooling.", - "homepage": "https://github.com/woocommerce/woocommerce", - "repository": "woocommerce/woocommerce", - "license": "GPLv2", "author": "Automattic", + "homepage": "https://github.com/woocommerce/woocommerce", + "license": "GPLv2", + "repository": "woocommerce/woocommerce", "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", @@ -49,11 +40,20 @@ "eslint": "^8.32.0", "jest": "~27.5.1", "ts-jest": "~29.1.1", - "typescript": "^5.1.6", - "wireit": "^0.14.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" }, "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 10296304150..63a7d78a550 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/plugin-woocommerce changelog write --add-pr-num -n -vvv --use-version ${ version }`, + `pnpm --filter=woocommerce run 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 f1abc4f9cb2..2c58f284178 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 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 run 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} changelog add` to add a change file for each project.\e[0m\n" ); + printf( "\e[32mUse `pnpm --filter={project} run 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 new file mode 100644 index 00000000000..8cd56546876 --- /dev/null +++ b/tools/package-release/.gitignore @@ -0,0 +1 @@ +/oclif.manifest.json diff --git a/tools/package-release/package.json b/tools/package-release/package.json index ffbe70e5c38..e4e9fcc3241 100644 --- a/tools/package-release/package.json +++ b/tools/package-release/package.json @@ -2,28 +2,20 @@ "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", @@ -39,12 +31,7 @@ "shx": "^0.3.3", "ts-node": "^10.2.1", "tslib": "^2.3.1", - "typescript": "^5.1.6", - "wireit": "^0.14.1" - }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" + "typescript": "^5.1.6" }, "oclif": { "bin": "package-release", @@ -60,5 +47,18 @@ "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 9a12656244d..6f8a3e3c8a1 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( - `pnpm publish ${ + `SKIP_TURBO=true pnpm publish ${ dryRun ? '--dry-run' : '' } --publish-branch=${ branch }`, { diff --git a/tools/release-posts/README.md b/tools/release-posts/README.md index c9bd55b86a8..18023f61a65 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 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` +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` ## 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 release-post contributors "" ""` +To do that simply run `pnpm run release-post contributors "" ""` ## Advanced diff --git a/tools/release-posts/package.json b/tools/release-posts/package.json index 76ba6bfd2e8..5d975d4f01e 100644 --- a/tools/release-posts/package.json +++ b/tools/release-posts/package.json @@ -2,13 +2,27 @@ "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", @@ -25,20 +39,5 @@ "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 1f0d2e9b72a..e3b5a7f4084 100644 --- a/tools/storybook/package.json +++ b/tools/storybook/package.json @@ -1,26 +1,28 @@ { "name": "@woocommerce/storybook", - "private": true, + "title": "WooCommerce Storybook", "description": "Storybook implementation for WooCommerce", "homepage": "https://woocommerce.github.io/woocommerce-admin/#/components/", - "bugs": { - "url": "https://github.com/woocommerce/woocommerce/issues" - }, + "private": true, "repository": { "type": "git", "url": "https://github.com/woocommerce/woocommerce.git" }, - "license": "GPL-3.0-or-later", "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" + }, "scripts": { "build-storybook": "build-storybook -c ./.storybook", - "build-woocommerce": "pnpm --filter=@woocommerce/plugin-woocommerce build", "preinstall": "npx only-allow pnpm", - "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" + "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" }, "devDependencies": { "@babel/plugin-proposal-class-properties": "^7.16.7", @@ -47,12 +49,9 @@ "react": "^17.0.2", "react-dom": "^17.0.2", "typescript": "^5.1.6", - "webpack": "^5.70.0", - "wireit": "^0.14.1" + "webpack": "^5.70.0" }, - "engines": { - "node": "^16.14.1", - "pnpm": "^8.6.7" - }, - "title": "WooCommerce Storybook" + "dependencies": { + "@babel/preset-typescript": "^7.16.7" + } } diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000000..528d18835f0 --- /dev/null +++ b/turbo.json @@ -0,0 +1,97 @@ +{ + "$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": [] + } + } +}