Refactor Task Infrastructure (#41988)
This commit is contained in:
commit
4c8649e3db
|
@ -35,7 +35,7 @@ Please take a moment to review the [project readme](https://github.com/woocommer
|
|||
|
||||
- Ensure you stick to the [WordPress Coding Standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/).
|
||||
- Run our build process described in the document on [how to set up WooCommerce development environment](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment), it will install our pre-commit hook, code sniffs, dependencies, and more.
|
||||
- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=woocommerce run lint:php:changes:branch`.
|
||||
- Before pushing commits to GitHub, check your code against our code standards. For PHP code in the WooCommerce Core project you can do this by running `pnpm --filter=@woocommerce/plugin-woocommerce lint:php:changes:branch`.
|
||||
- Whenever possible, please fix pre-existing code standards errors in code that you change.
|
||||
- Please consider adding appropriate tests related to your change if applicable such as unit, API and E2E tests. You can check the following guides for this purpose:
|
||||
- [Writing unit tests](https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/tests/README.md#guide-for-writing-unit-tests).
|
||||
|
@ -46,7 +46,7 @@ Please take a moment to review the [project readme](https://github.com/woocommer
|
|||
- Ensure that your code supports the minimum supported versions of PHP and WordPress; this is shown at the top of the `readme.txt` file.
|
||||
- Push the changes to your fork and submit a pull request on the trunk branch of the WooCommerce repository.
|
||||
- Make sure to write good and detailed commit messages (see [this post](https://chris.beams.io/posts/git-commit/) for more on this) and follow all the applicable sections of the pull request template.
|
||||
- Please create a change file for your changes by running `pnpm --filter=<project> changelog add`. For example, a change file for the WooCommerce Core project would be added by running `pnpm --filter=woocommerce changelog add`.
|
||||
- Please create a change file for your changes by running `pnpm --filter=<project> changelog add`. For example, a change file for the WooCommerce Core project would be added by running `pnpm --filter=@woocommerce/plugin-woocommerce changelog add`.
|
||||
- Please avoid modifying the changelog directly or updating the .pot files. These will be updated by the WooCommerce team.
|
||||
|
||||
If you are contributing code to our (Javascript-driven) Gutenberg blocks, please note that they are developed in their [own repository](https://github.com/woocommerce/woocommerce-gutenberg-products-block) and have their [own issue tracker](https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues).
|
||||
|
|
|
@ -1,91 +1,62 @@
|
|||
name: Setup WooCommerce Monorepo
|
||||
description: Handles the installation, building, and caching of the projects within the monorepo.
|
||||
permissions: {}
|
||||
|
||||
name: 'Setup WooCommerce Monorepo'
|
||||
description: 'A composite action bundling together the setup of dependencies and optional installation and building of projects.'
|
||||
inputs:
|
||||
install:
|
||||
description: Indicates whether or not the action should install any projects.
|
||||
default: 'true'
|
||||
install-filters:
|
||||
description: The PNPM filter used to decide what projects to install. Supports multiline strings for multiple filters.
|
||||
default: ''
|
||||
build:
|
||||
description: Indicates whether or not the action should build any projects.
|
||||
default: 'true'
|
||||
build-filters:
|
||||
description: The PNPM filter used to decide what projects to build. Supports multiline strings for multiple filters.
|
||||
default: ''
|
||||
php-version:
|
||||
description: The version of PHP that the action should set up.
|
||||
default: '7.4'
|
||||
|
||||
php-version:
|
||||
description: 'The PHP version that should be installed. Use "false" to skip PHP installation.'
|
||||
default: '7.4'
|
||||
install:
|
||||
description: 'Given a boolean or PNPM filter, runs the install command for monorepo project(s).'
|
||||
default: false
|
||||
build:
|
||||
description: 'Given a boolean or PNPM filter, runs the build command for monorepo project(s).'
|
||||
default: false
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Parse Action Input
|
||||
id: parse-input
|
||||
shell: bash
|
||||
run: |
|
||||
echo "INSTALL_FILTERS=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install-filters }}')" >> $GITHUB_OUTPUT
|
||||
echo "BUILD_FILTERS=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build-filters }}')" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Setup PNPM
|
||||
uses: pnpm/action-setup@c3b53f6a16e57305370b4ae5a540c2077a1d50dd
|
||||
with:
|
||||
version: '8.6.7'
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
cache: pnpm
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@8e2ac35f639d3e794c1da1f28999385ab6fdf0fc
|
||||
with:
|
||||
php-version: ${{ inputs.php-version }}
|
||||
coverage: none
|
||||
tools: phpcs, sirbrillig/phpcs-changed:2.11.1
|
||||
|
||||
- name: Cache Composer Dependencies
|
||||
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
|
||||
with:
|
||||
path: ~/.cache/composer/files
|
||||
key: ${{ runner.os }}-php-${{ inputs.php-version }}-composer-${{ hashFiles('**/composer.lock') }}
|
||||
restore-keys: ${{ runner.os }}-php-${{ inputs.php-version }}-composer-
|
||||
|
||||
- name: Install Node and PHP Dependencies
|
||||
shell: bash
|
||||
if: ${{ inputs.install == 'true' }}
|
||||
env:
|
||||
PUPPETEER_SKIP_DOWNLOAD: 'true'
|
||||
run: |
|
||||
pnpm -w install turbo
|
||||
pnpm install ${{ steps.parse-input.outputs.INSTALL_FILTERS }}
|
||||
|
||||
- name: Get branch name
|
||||
id: get_branch
|
||||
shell: bash
|
||||
run: |
|
||||
if [ "${{ github.event_name }}" == "pull_request" ]; then
|
||||
branch_name=$(echo "${{ github.head_ref }}" | tr '/' '-')
|
||||
echo "CURRENT_BRANCH_NAME=$branch_name" >> $GITHUB_OUTPUT
|
||||
else
|
||||
echo "CURRENT_BRANCH_NAME=${{ github.ref_name }}" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
- name: Cache Build Output
|
||||
if: ${{ inputs.build == 'true' }}
|
||||
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8
|
||||
with:
|
||||
path: .turbo
|
||||
key: ${{ runner.os }}-build-output-${{ steps.get_branch.outputs.CURRENT_BRANCH_NAME }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-output-${{ steps.get_branch.outputs.CURRENT_BRANCH_NAME }}
|
||||
${{ runner.os }}-build-output
|
||||
|
||||
- name: Build
|
||||
if: ${{ inputs.install == 'true' && inputs.build == 'true' }}
|
||||
shell: bash
|
||||
run: pnpm -w exec turbo run turbo:build --cache-dir=".turbo" ${{ steps.parse-input.outputs.BUILD_FILTERS }}
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: 'Setup PNPM'
|
||||
uses: 'pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598'
|
||||
with:
|
||||
version: '8'
|
||||
- name: 'Setup Node'
|
||||
uses: 'actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65'
|
||||
with:
|
||||
node-version-file: '.nvmrc'
|
||||
# We only want to use the cache if something is being installed.
|
||||
cache: ${{ inputs.install != 'false' && 'pnpm' || '' }}
|
||||
- name: 'Setup PHP'
|
||||
if: ${{ inputs.php-version != 'false' }}
|
||||
uses: 'shivammathur/setup-php@a36e1e52ff4a1c9e9c9be31551ee4712a6cb6bd0'
|
||||
with:
|
||||
php-version: '${{ inputs.php-version }}'
|
||||
coverage: 'none'
|
||||
- name: 'Cache Composer Dependencies'
|
||||
if: ${{ inputs.php-version != 'false' }}
|
||||
uses: 'actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84'
|
||||
with:
|
||||
path: '~/.cache/composer/files'
|
||||
key: "${{ runner.os }}-composer-${{ hashFiles( '**/composer.lock' ) }}"
|
||||
restore-keys: '${{ runner.os }}-composer-'
|
||||
- name: 'Parse Project Filters'
|
||||
id: 'project-filters'
|
||||
shell: 'bash'
|
||||
run: |
|
||||
echo "install=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.install }}')" >> $GITHUB_OUTPUT
|
||||
echo "build=$(node ./.github/actions/setup-woocommerce-monorepo/scripts/parse-input-filter.js '${{ inputs.build }}')" >> $GITHUB_OUTPUT
|
||||
- name: 'Install Project Dependencies'
|
||||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter.
|
||||
if: ${{ inputs.install == 'true' || steps.project-filters.outputs.install != '' }}
|
||||
shell: 'bash'
|
||||
run: 'pnpm install'
|
||||
# `pnpm install` filtering is broken: https://github.com/pnpm/pnpm/issues/6300
|
||||
# run: 'pnpm install ${{ steps.project-filters.outputs.install }}'
|
||||
# We want to include an option to build projects using this action so that we can make
|
||||
# sure that the build cache is always used when building projects.
|
||||
- name: 'Cache Build Output'
|
||||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter.
|
||||
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }}
|
||||
uses: 'google/wireit@f3a3c79c553122e2fe5829eeac7d815326502903'
|
||||
- name: 'Build'
|
||||
# Boolean inputs aren't parsed into filters so it'll either be "true" or there will be a filter.
|
||||
if: ${{ inputs.build == 'true' || steps.project-filters.outputs.build != '' }}
|
||||
shell: 'bash'
|
||||
run: 'pnpm ${{ steps.project-filters.outputs.build }} build'
|
||||
|
|
|
@ -1,22 +1,27 @@
|
|||
const args = process.argv.slice(2);
|
||||
if (args.length != 1) {
|
||||
console.error('Filters must be passed as a single string!');
|
||||
process.exit(-1);
|
||||
const args = process.argv.slice( 2 );
|
||||
if ( args.length != 1 ) {
|
||||
console.error( 'Filters must be passed as a single string!' );
|
||||
process.exit( -1 );
|
||||
}
|
||||
|
||||
// Boolean inputs should not be processed.
|
||||
if ( args[0] === 'true' || args[0] === 'false' ) {
|
||||
process.exit();
|
||||
}
|
||||
|
||||
// Read all of the given filters and return the full filter options string.
|
||||
const filterLines = args[0].split("\n");
|
||||
const filterLines = args[0].split( "\n" );
|
||||
let output = '';
|
||||
for (const line of filterLines) {
|
||||
if (line === '') {
|
||||
for ( const line of filterLines ) {
|
||||
if ( line === '' ) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (output !== '') {
|
||||
if ( output !== '' ) {
|
||||
output += ' ';
|
||||
}
|
||||
output += "--filter='" + line + "'";
|
||||
output += `--filter='${ line }'`;
|
||||
}
|
||||
|
||||
console.log(output);
|
||||
process.exit(0);
|
||||
console.log( output );
|
||||
process.exit();
|
||||
|
|
|
@ -18,12 +18,12 @@ runs:
|
|||
if: ( inputs.test-type == 'e2e' ) || ( inputs.test-type == 'api' )
|
||||
working-directory: plugins/woocommerce
|
||||
shell: bash
|
||||
run: pnpm run env:test
|
||||
run: pnpm env:test
|
||||
|
||||
- name: Load docker images and start containers for k6 performance tests
|
||||
if: inputs.test-type == 'k6'
|
||||
working-directory: plugins/woocommerce
|
||||
shell: bash
|
||||
run: |
|
||||
pnpm env:dev --filter=woocommerce
|
||||
pnpm env:performance-init --filter=woocommerce
|
||||
pnpm --filter=@woocommerce/plugin-woocommerce env:dev
|
||||
pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init
|
||||
|
|
|
@ -30,8 +30,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Prepare plugin zips
|
||||
id: prepare
|
||||
|
|
|
@ -20,8 +20,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Build zip
|
||||
working-directory: plugins/woocommerce
|
||||
|
|
|
@ -9,91 +9,96 @@ concurrency:
|
|||
group: '${{ github.workflow }}-${{ github.ref }}'
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
project-matrix:
|
||||
# Since this is a monorepo, not every pull request or change is going to impact every project.
|
||||
# Instead of running CI tasks on all projects indiscriminately, we use a script to detect
|
||||
# which projects have changed and what kind of change occurred. This lets us build a
|
||||
# matrix that we can use to run CI tasks only on the projects that need them.
|
||||
name: 'Build Project Matrix'
|
||||
runs-on: 'ubuntu-20.04'
|
||||
outputs:
|
||||
matrix: ${{ steps.project-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3'
|
||||
name: 'Checkout'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: './.github/actions/setup-woocommerce-monorepo'
|
||||
name: 'Setup Monorepo'
|
||||
with:
|
||||
install: true
|
||||
- uses: actions/github-script@v6
|
||||
id: 'project-matrix'
|
||||
name: 'Build Matrix'
|
||||
with:
|
||||
script: |
|
||||
let baseRef = ${{ toJson( github.base_ref ) }};
|
||||
if ( baseRef ) {
|
||||
baseRef = 'origin/' + baseRef;
|
||||
}
|
||||
const buildCIMatrix = require( './.github/workflows/scripts/build-ci-matrix' );
|
||||
core.setOutput( 'matrix', JSON.stringify( await buildCIMatrix( baseRef ) ) );
|
||||
project-task-matrix:
|
||||
# This is the actual CI job that will be ran against every project with applicable changes.
|
||||
# Note that we only run the tasks that have commands set. Our script will set them if
|
||||
# they are needed and so all the workflow needs to do is run them.
|
||||
name: '${{ matrix.projectName }} - ${{ matrix.taskName }}' # Note: GitHub doesn't process expressions for skipped jobs so when there's no matrix the name will literally be this.
|
||||
runs-on: 'ubuntu-20.04'
|
||||
needs: 'project-matrix'
|
||||
if: ${{ needs.project-matrix.outputs.matrix != '[]' }}
|
||||
timeout-minutes: 30
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON( needs.project-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3'
|
||||
name: 'Checkout'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: './.github/actions/setup-woocommerce-monorepo'
|
||||
id: 'setup-monorepo'
|
||||
name: 'Setup Monorepo'
|
||||
with:
|
||||
# install-filters: '${{ matrix.projectName }}...'
|
||||
build-filters: '${{ matrix.projectName }}'
|
||||
- name: 'Lint'
|
||||
if: ${{ !cancelled() && matrix.lintCommand && steps.setup-monorepo.conclusion == 'success' }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.lintCommand }}'
|
||||
- name: 'Prepare Test Environment'
|
||||
id: 'prepare-test-environment'
|
||||
if: ${{ !cancelled() && matrix.testEnvCommand && steps.setup-monorepo.conclusion == 'success' }}
|
||||
env: ${{ matrix.testEnvVars }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnvCommand }}'
|
||||
- name: 'Test - JS'
|
||||
if: ${{ !cancelled() && matrix.jsTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.jsTestCommand }}'
|
||||
- name: 'Test - PHP'
|
||||
if: ${{ !cancelled() && matrix.phpTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.phpTestCommand }}'
|
||||
project-task-matrix-evaluation:
|
||||
# In order to add a required status check we need a consistent job that we can grab onto.
|
||||
# Since we are dynamically generating a project matrix, however, we can't rely on
|
||||
# on any specific job being present. We can get around this limitation by using
|
||||
# a job that runs after all the others and either passes or fails based on the
|
||||
# results of the other jobs in the workflow.
|
||||
name: 'Evaluate Project Matrix'
|
||||
runs-on: 'ubuntu-20.04'
|
||||
needs: 'project-task-matrix'
|
||||
if: ${{ always() }}
|
||||
steps:
|
||||
- name: 'Check Matrix Success'
|
||||
run: |
|
||||
result="${{ needs.project-task-matrix.result }}"
|
||||
if [[ $result == "success" || $result == "skipped" ]]; then
|
||||
echo "The matrix has completed successfully."
|
||||
exit 0
|
||||
else
|
||||
echo "One or more jobs in the matrix has failed."
|
||||
exit 1
|
||||
fi
|
||||
project-matrix:
|
||||
# Since this is a monorepo, not every pull request or change is going to impact every project.
|
||||
# Instead of running CI tasks on all projects indiscriminately, we use a script to detect
|
||||
# which projects have changed and what kind of change occurred. This lets us build a
|
||||
# matrix that we can use to run CI tasks only on the projects that need them.
|
||||
name: 'Build Project Matrix'
|
||||
runs-on: 'ubuntu-20.04'
|
||||
outputs:
|
||||
matrix: ${{ steps.project-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3'
|
||||
name: 'Checkout'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: './.github/actions/setup-woocommerce-monorepo'
|
||||
with:
|
||||
php-version: false # We don't want to waste time installing PHP since we aren't using it in this job.
|
||||
name: 'Setup Monorepo'
|
||||
- uses: actions/github-script@v6
|
||||
id: 'project-matrix'
|
||||
name: 'Build Matrix'
|
||||
with:
|
||||
script: |
|
||||
let baseRef = ${{ toJson( github.base_ref ) }};
|
||||
if ( baseRef ) {
|
||||
baseRef = 'origin/' + baseRef;
|
||||
}
|
||||
const buildCIMatrix = require( './.github/workflows/scripts/build-ci-matrix' );
|
||||
core.setOutput( 'matrix', JSON.stringify( await buildCIMatrix( baseRef ) ) );
|
||||
project-task-matrix:
|
||||
# This is the actual CI job that will be ran against every project with applicable changes.
|
||||
# Note that we only run the tasks that have commands set. Our script will set them if
|
||||
# they are needed and so all the workflow needs to do is run them.
|
||||
name: '${{ matrix.projectName }} - ${{ matrix.taskName }}' # Note: GitHub doesn't process expressions for skipped jobs so when there's no matrix the name will literally be this.
|
||||
runs-on: 'ubuntu-20.04'
|
||||
needs: 'project-matrix'
|
||||
if: ${{ needs.project-matrix.outputs.matrix != '[]' }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include: ${{ fromJSON( needs.project-matrix.outputs.matrix ) }}
|
||||
steps:
|
||||
- uses: 'actions/checkout@v3'
|
||||
name: 'Checkout'
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- uses: './.github/actions/setup-woocommerce-monorepo'
|
||||
id: 'setup-monorepo'
|
||||
name: 'Setup Monorepo'
|
||||
with:
|
||||
install: '${{ matrix.projectName }}...'
|
||||
build: '${{ matrix.projectName }}'
|
||||
- name: 'Lint'
|
||||
if: ${{ ! cancelled() && matrix.lintCommand && steps.setup-monorepo.conclusion == 'success' }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.lintCommand }}'
|
||||
- name: 'Prepare Test Environment'
|
||||
id: 'prepare-test-environment'
|
||||
if: ${{ ! cancelled() && matrix.testEnvCommand && steps.setup-monorepo.conclusion == 'success' }}
|
||||
env: ${{ matrix.testEnvVars }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.testEnvCommand }}'
|
||||
- name: 'Test - JS'
|
||||
if: ${{ ! cancelled() && matrix.jsTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.jsTestCommand }}'
|
||||
- name: 'Test - PHP'
|
||||
if: ${{ ! cancelled() && matrix.phpTestCommand && steps.setup-monorepo.conclusion == 'success' && ( ! matrix.testEnvCommand || steps.prepare-test-environment.conclusion == 'success' ) }}
|
||||
run: 'pnpm --filter="${{ matrix.projectName }}" ${{ matrix.phpTestCommand }}'
|
||||
project-task-matrix-evaluation:
|
||||
# In order to add a required status check we need a consistent job that we can grab onto.
|
||||
# Since we are dynamically generating a project matrix, however, we can't rely on
|
||||
# on any specific job being present. We can get around this limitation by using
|
||||
# a job that runs after all the others and either passes or fails based on the
|
||||
# results of the other jobs in the workflow.
|
||||
name: 'Evaluate Project Matrix'
|
||||
runs-on: 'ubuntu-20.04'
|
||||
needs: [
|
||||
'project-matrix',
|
||||
'project-task-matrix'
|
||||
]
|
||||
if: ${{ always() }}
|
||||
steps:
|
||||
- name: 'Check Matrix Success'
|
||||
run: |
|
||||
result="${{ needs.project-matrix.result }}"
|
||||
if [[ $result != "success" && $result != "skipped" ]]; then
|
||||
echo "An error occurred generating the CI matrix."
|
||||
exit 1
|
||||
fi
|
||||
result="${{ needs.project-task-matrix.result }}"
|
||||
if [[ $result != "success" && $result != "skipped" ]]; then
|
||||
echo "One or more jobs in the matrix has failed."
|
||||
exit 1
|
||||
fi
|
||||
echo "The matrix has completed successfully."
|
||||
|
|
|
@ -24,12 +24,15 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers with HPOS enabled.
|
||||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 1
|
||||
run: pnpm env:test:cot --filter=woocommerce
|
||||
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:cot
|
||||
|
||||
- name: Download and install Chromium browser.
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -80,12 +83,15 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers with HPOS enabled.
|
||||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 1
|
||||
run: pnpm env:test:cot --filter=woocommerce
|
||||
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test:cot
|
||||
|
||||
- name: Run Playwright API tests.
|
||||
id: run_playwright_api_tests
|
||||
|
|
|
@ -18,8 +18,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Build zip
|
||||
working-directory: plugins/woocommerce
|
||||
|
|
|
@ -24,8 +24,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Build zip
|
||||
working-directory: plugins/woocommerce
|
||||
|
|
|
@ -23,10 +23,13 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers
|
||||
working-directory: plugins/woocommerce
|
||||
run: pnpm env:test --filter=woocommerce
|
||||
run: pnpm --filter='@woocommerce/plugin-woocommerce' env:test
|
||||
|
||||
- name: Download and install Chromium browser.
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -78,10 +81,13 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers
|
||||
working-directory: plugins/woocommerce
|
||||
run: pnpm env:test --filter=woocommerce
|
||||
run: pnpm --filter='@woocommerce/plugin-woocommerce' env:test
|
||||
|
||||
- name: Run Playwright API tests.
|
||||
id: run_playwright_api_tests
|
||||
|
|
|
@ -24,6 +24,9 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: true
|
||||
build: './tools/package-release'
|
||||
|
||||
- name: Clean working directory
|
||||
run: git checkout pnpm-lock.yaml # in case for whatever reason the lockfile is out of sync, there won't be interference with npm publish.
|
||||
|
|
|
@ -27,12 +27,15 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers.
|
||||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
WP_ENV_PHP_VERSION: 7.4
|
||||
run: pnpm run env:test
|
||||
run: pnpm env:test
|
||||
|
||||
- name: Download and install Chromium browser.
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -94,12 +97,15 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers.
|
||||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 0
|
||||
run: pnpm env:test --filter=woocommerce
|
||||
run: pnpm --filter=@woocommerce/plugin-woocommerce env:test
|
||||
|
||||
- name: Run Playwright API tests.
|
||||
id: run_playwright_api_tests
|
||||
|
@ -144,14 +150,17 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Load docker images and start containers.
|
||||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
ENABLE_HPOS: 0
|
||||
run: |
|
||||
pnpm env:dev --filter=woocommerce
|
||||
pnpm env:performance-init --filter=woocommerce
|
||||
pnpm --filter=@woocommerce/plugin-woocommerce env:dev
|
||||
pnpm --filter=@woocommerce/plugin-woocommerce env:performance-init
|
||||
|
||||
- name: Install k6
|
||||
run: |
|
||||
|
|
|
@ -31,8 +31,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Prepare plugin zips
|
||||
id: prepare
|
||||
|
|
|
@ -28,8 +28,8 @@ jobs:
|
|||
working-directory: tools/code-analyzer
|
||||
run: |
|
||||
HEAD_REF=$(git rev-parse HEAD)
|
||||
version=$(pnpm run analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1)
|
||||
pnpm run analyzer "$HEAD_REF" $version -o "github"
|
||||
version=$(pnpm analyzer major-minor "$HEAD_REF" "plugins/woocommerce/woocommerce.php" | tail -n 1)
|
||||
pnpm analyzer "$HEAD_REF" $version -o "github"
|
||||
- name: Check results
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
|
|
|
@ -24,8 +24,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Check change files are touched for touched projects
|
||||
env:
|
||||
|
@ -34,4 +32,4 @@ jobs:
|
|||
run: php tools/monorepo/check-changelogger-use.php --debug "$BASE" "$HEAD"
|
||||
|
||||
- name: Run changelog validation
|
||||
run: pnpm run -r changelog validate
|
||||
run: pnpm -r changelog validate
|
||||
|
|
|
@ -26,6 +26,9 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Install Jest
|
||||
run: pnpm install -g jest
|
||||
|
|
|
@ -23,6 +23,9 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: true
|
||||
build: './tools/package-release'
|
||||
|
||||
- name: Execute script
|
||||
run: ./tools/package-release/bin/dev prepare ${{ github.event.inputs.packages }}
|
||||
|
|
|
@ -74,35 +74,35 @@ jobs:
|
|||
if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze milestone -o ${{ github.repository_owner }} -m ${{ steps.get-versions.outputs.monthlyMilestone }}
|
||||
run: pnpm utils code-freeze milestone -o ${{ github.repository_owner }} -m ${{ steps.get-versions.outputs.monthlyMilestone }}
|
||||
|
||||
- name: Create next monthly release branch
|
||||
id: branch
|
||||
if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }}
|
||||
run: pnpm utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }}
|
||||
|
||||
- name: Create next accelerated release branch
|
||||
id: branch-accel
|
||||
if: steps.get-versions.outputs.isTodayAcceleratedFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }}
|
||||
run: pnpm utils code-freeze branch -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }}
|
||||
|
||||
- name: Bump versions for Beta.1 monthly release
|
||||
id: version-bump
|
||||
if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} -c ${{ steps.get-versions.outputs.monthlyVersion }}-beta.1
|
||||
run: pnpm utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.monthlyBranch }} -c ${{ steps.get-versions.outputs.monthlyVersion }}-beta.1
|
||||
|
||||
- name: Bump versions for accelerated release
|
||||
id: version-bump-accel
|
||||
if: steps.get-versions.outputs.isTodayAcceleratedFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} -c ${{ steps.get-versions.outputs.acceleratedVersion }} -af
|
||||
run: pnpm utils code-freeze version-bump -o ${{ github.repository_owner }} -b ${{ steps.get-versions.outputs.acceleratedBranch }} -c ${{ steps.get-versions.outputs.acceleratedVersion }} -af
|
||||
|
||||
- name: Prep accelerated release
|
||||
id: accel-release-prep
|
||||
|
@ -116,14 +116,14 @@ jobs:
|
|||
if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze version-bump ${{ steps.get-versions.outputs.monthlyMilestone }}-dev -o ${{ github.repository_owner }}
|
||||
run: pnpm utils code-freeze version-bump ${{ steps.get-versions.outputs.monthlyMilestone }}-dev -o ${{ github.repository_owner }}
|
||||
|
||||
- name: Generate changelog changes
|
||||
id: changelog
|
||||
if: steps.get-versions.outputs.isTodayMonthlyFreeze == 'yes'
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: pnpm run utils code-freeze changelog -c -o ${{ github.repository_owner }} -v ${{ steps.get-versions.outputs.monthlyVersionXY }}
|
||||
run: pnpm utils code-freeze changelog -c -o ${{ github.repository_owner }} -v ${{ steps.get-versions.outputs.monthlyVersionXY }}
|
||||
|
||||
|
||||
notify-slack:
|
||||
|
@ -182,8 +182,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Build zip
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -212,8 +210,6 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build: false
|
||||
|
||||
- name: Build zip
|
||||
working-directory: plugins/woocommerce
|
||||
|
|
|
@ -19,6 +19,8 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce-beta-tester'
|
||||
|
||||
- name: Lint
|
||||
working-directory: plugins/woocommerce-beta-tester
|
||||
|
|
|
@ -32,6 +32,8 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
|
||||
- name: Setup local test environment
|
||||
uses: ./.github/actions/tests/setup-local-test-environment
|
||||
|
@ -89,6 +91,8 @@ jobs:
|
|||
|
||||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
|
||||
- name: Setup local test environment
|
||||
uses: ./.github/actions/tests/setup-local-test-environment
|
||||
|
@ -141,8 +145,7 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install-filters: woocommerce
|
||||
build: false
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
|
||||
- name: Update performance test site with E2E test
|
||||
id: update-perf-site
|
||||
|
@ -218,7 +221,8 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build-filters: woocommerce
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Setup local test environment
|
||||
uses: ./.github/actions/tests/setup-local-test-environment
|
||||
|
|
|
@ -28,7 +28,8 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build-filters: woocommerce
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Setup local test environment
|
||||
uses: ./.github/actions/tests/setup-local-test-environment
|
||||
|
@ -89,7 +90,8 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build-filters: woocommerce
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Setup local test environment
|
||||
uses: ./.github/actions/tests/setup-local-test-environment
|
||||
|
|
|
@ -54,8 +54,7 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install-filters: woocommerce
|
||||
build: false
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
|
||||
- name: Run E2E tests
|
||||
id: run-e2e-composite-action
|
||||
|
@ -130,8 +129,7 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install-filters: woocommerce
|
||||
build: false
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
|
||||
- name: Download and install Chromium browser.
|
||||
working-directory: plugins/woocommerce
|
||||
|
@ -204,8 +202,7 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
install-filters: woocommerce
|
||||
build: false
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
|
||||
- name: Run E2E tests
|
||||
id: run-e2e-composite-action
|
||||
|
@ -320,11 +317,12 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build-filters: woocommerce
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Launch WP Env
|
||||
working-directory: plugins/woocommerce
|
||||
run: pnpm run env:test
|
||||
run: pnpm env:test
|
||||
env:
|
||||
WP_ENV_CORE: WordPress/WordPress#${{ steps.get-wp-latest-1.outputs.version }}
|
||||
|
||||
|
@ -462,13 +460,14 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build-filters: woocommerce
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Launch WP Env
|
||||
working-directory: plugins/woocommerce
|
||||
env:
|
||||
WP_ENV_PHP_VERSION: ${{ matrix.php_version }}
|
||||
run: pnpm run env:test
|
||||
run: pnpm env:test
|
||||
|
||||
- name: Verify PHP version
|
||||
working-directory: .github/workflows/scripts
|
||||
|
@ -626,11 +625,12 @@ jobs:
|
|||
- name: Setup WooCommerce Monorepo
|
||||
uses: ./.github/actions/setup-woocommerce-monorepo
|
||||
with:
|
||||
build-filters: woocommerce
|
||||
install: '@woocommerce/plugin-woocommerce...'
|
||||
build: '@woocommerce/plugin-woocommerce'
|
||||
|
||||
- name: Launch WP Env
|
||||
working-directory: plugins/woocommerce
|
||||
run: pnpm run env:test
|
||||
run: pnpm env:test
|
||||
|
||||
- name: Download release zip
|
||||
id: download-zip
|
||||
|
|
|
@ -33,5 +33,5 @@ jobs:
|
|||
- name: 'Explain Remedy'
|
||||
if: failure()
|
||||
run: |
|
||||
echo "Dependency version mismatch detected. This can usually be fixed automatically by updating the pinned version in \`.syncpackrc\` and then running: \`pnpm run sync-dependencies\`"
|
||||
echo "Dependency version mismatch detected. This can usually be fixed automatically by updating the pinned version in \`.syncpackrc\` and then running: \`pnpm sync-dependencies\`"
|
||||
exit 1
|
||||
|
|
|
@ -44,6 +44,7 @@ build-style/
|
|||
build-style.js
|
||||
build-types/
|
||||
dist/
|
||||
oclif.manifest.json
|
||||
|
||||
# Project files
|
||||
node_modules/
|
||||
|
@ -94,8 +95,9 @@ allure-results
|
|||
changes.json
|
||||
.env
|
||||
|
||||
# Turborepo
|
||||
# Build Cache
|
||||
.turbo
|
||||
.wireit
|
||||
|
||||
# Support .gitkeep Files
|
||||
!.gitkeep
|
||||
|
|
|
@ -0,0 +1,256 @@
|
|||
/**
|
||||
* External dependencies.
|
||||
*/
|
||||
const fs = require( 'fs' );
|
||||
const path = require( 'path' );
|
||||
|
||||
// A cache for package files so that we don't keep loading them unnecessarily.
|
||||
const packageFileCache = {};
|
||||
|
||||
/**
|
||||
* Loads a package file or pull it from the cache.
|
||||
*
|
||||
* @param {string} packagePath The path to the package directory.
|
||||
*
|
||||
* @return {Object} The package file.
|
||||
*/
|
||||
function loadPackageFile( packagePath ) {
|
||||
// Resolve the absolute path for consistency when loading and updating.
|
||||
packagePath = path.resolve( __dirname, packagePath );
|
||||
|
||||
if ( packageFileCache[ packagePath ] ) {
|
||||
return packageFileCache[ packagePath ];
|
||||
}
|
||||
|
||||
const packageFile = JSON.parse(
|
||||
fs.readFileSync( path.join( packagePath, 'package.json' ), 'utf8' )
|
||||
);
|
||||
|
||||
packageFileCache[ packagePath ] = packageFile;
|
||||
return packageFile;
|
||||
}
|
||||
|
||||
/**
|
||||
* Updates a package file on disk and in the cache.
|
||||
*
|
||||
* @param {string} packagePath The path to the package file to update.
|
||||
* @param {Object} packageFile The new package file contents.
|
||||
*/
|
||||
function updatePackageFile( packagePath, packageFile ) {
|
||||
// Resolve the absolute path for consistency when loading and updating.
|
||||
packagePath = path.resolve( __dirname, packagePath );
|
||||
|
||||
packageFileCache[ packagePath ] = packageFile;
|
||||
|
||||
fs.writeFileSync(
|
||||
path.join( packagePath, 'package.json' ),
|
||||
// Make sure to keep the newline at the end of the file.
|
||||
JSON.stringify( packageFile, null, '\t' ) + "\n",
|
||||
'utf8'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the outputs for a given package.
|
||||
*
|
||||
* @param {string} packageFile The package file to read file outputs from.
|
||||
*
|
||||
* @return {Object.<string, Array.<string>} 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.<Object>} 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.<string, Object>} lockPackages The paths to all of the packages we're processing.
|
||||
* @param {Object} context The hook context object.
|
||||
* @param {Function.<string>} 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.<string, 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.<string>} 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,
|
||||
},
|
||||
};
|
11
.syncpackrc
11
.syncpackrc
|
@ -130,7 +130,7 @@
|
|||
"packages": [
|
||||
"@woocommerce/block-templates",
|
||||
"@woocommerce/product-editor",
|
||||
"woocommerce/client/admin",
|
||||
"@woocommerce/admin-library",
|
||||
"@woocommerce/components"
|
||||
],
|
||||
"isIgnored": true
|
||||
|
@ -238,6 +238,15 @@
|
|||
],
|
||||
"pinVersion": "~29.1.1"
|
||||
},
|
||||
{
|
||||
"dependencies": [
|
||||
"wireit"
|
||||
],
|
||||
"packages": [
|
||||
"**"
|
||||
],
|
||||
"pinVersion": "0.14.1"
|
||||
},
|
||||
{
|
||||
"label": "Only manage versions for these dependencies",
|
||||
"dependencies": [
|
||||
|
|
|
@ -6,70 +6,47 @@ This document aims to provide as much context as possible to aid in the developm
|
|||
|
||||
Please refer to [the Getting Started section of the `README.md`](README.md#getting-started) for a general-purpose guide on getting started. The rest of this document will assume that you've installed all of the prequisites and setup described there.
|
||||
|
||||
## Turborepo Commands
|
||||
|
||||
Our repository uses [Turborepo](https://turborepo.org) for `build` and `test` commands. This tool ensures that all dependencies of a plugin, package, or tool are prepared before running a command. This is done transparently when running these commands. When using `pnpm run {command}` without any options, it will execute that command against every project in the repository. You can view a list of the commands Turborepo supports in [our turbo.json file](turbo.json).
|
||||
|
||||
### Plugin, Package, and Tool Filtering
|
||||
|
||||
If you are interested in running a `turbo` command against a single plugin, package, or tool, you can do so with the `--filter` flag. This flag supports the `"name"` option in `package.json` files, paths, and globs.
|
||||
|
||||
If you would like to read more about the syntax, please check out [the Turborepo filtering documentation](https://turborepo.org/docs/core-concepts/filtering).
|
||||
In order to run commands on individual projects you will need to utilize [PNPM's --filter flag](https://pnpm.io/filtering). This flag supports `"name"` option in `package.json`, paths, and globs.
|
||||
|
||||
### Examples
|
||||
|
||||
Here are some examples of the ways you can use Turborepo / pnpm commands:
|
||||
Here are some examples of the ways you can use `pnpm` commands:
|
||||
|
||||
```bash
|
||||
# Lint and build all plugins, packages, and tools. Note the use of `-r` for lint,
|
||||
# turbo does not run the lint at this time.
|
||||
pnpm run -r lint && pnpm run build
|
||||
# Lint and build all plugins, packages, and tools.
|
||||
pnpm lint && pnpm build
|
||||
|
||||
# Build WooCommerce Core and all of its dependencies
|
||||
pnpm run --filter='woocommerce' build
|
||||
pnpm --filter='@woocommerce/plugin-woocommerce' build
|
||||
|
||||
# Lint the @woocommerce/components package - note the different argument order, turbo scripts
|
||||
# are not running lints at this point in time.
|
||||
pnpm run -r --filter='@woocommerce/components' lint
|
||||
# Lint the @woocommerce/components package
|
||||
pnpm --filter='@woocommerce/components' lint
|
||||
|
||||
# Test all of the @woocommerce scoped packages
|
||||
pnpm run --filter='@woocommerce/*' test
|
||||
pnpm --filter='@woocommerce/*' test
|
||||
|
||||
# Build all of the JavaScript packages
|
||||
pnpm run --filter='./packages/js/*' build
|
||||
pnpm --filter='./packages/js/*' build
|
||||
|
||||
# Build everything except WooCommerce Core
|
||||
pnpm run --filter='!woocommerce' build
|
||||
pnpm --filter='!@woocommerce/plugin-woocommerce' build
|
||||
|
||||
# Build everything that has changed since the last commit
|
||||
pnpm run --filter='[HEAD^1]' build
|
||||
pnpm --filter='[HEAD^1]' build
|
||||
```
|
||||
|
||||
### Cache busting Turbo
|
||||
|
||||
In the event that you need to force turbo not to cache a command you can set the env variable `TURBO_FORCE=true`.
|
||||
|
||||
e.g.
|
||||
|
||||
```bash
|
||||
# Force an uncached build of WooCommerce Core and all of its dependencies
|
||||
TURBO_FORCE=true pnpm run --filter='woocommerce' build
|
||||
```
|
||||
|
||||
## Other Commands
|
||||
|
||||
Outside of the commands in [our turbo.json file](turbo.json), each plugin, package, and tool may have unique scripts in their `package.json` files. In these cases, you can execute those commands using `pnpm {script}` and the same `--filter` syntax as Turborepo.
|
||||
|
||||
### Examples
|
||||
|
||||
Here are some examples of the commands you will make use of.
|
||||
|
||||
```bash
|
||||
# Add a changelog entry for WooCommerce Core
|
||||
pnpm --filter=woocommerce run changelog add
|
||||
pnpm --filter='@woocommerce/plugin-woocommerce' changelog add
|
||||
|
||||
# Create the woocommerce.zip file
|
||||
pnpm --filter=woocommerce run build:zip
|
||||
pnpm --filter='@woocommerce/plugin-woocommerce' build:zip
|
||||
```
|
||||
|
||||
## Plugin Development Environments
|
||||
|
|
|
@ -25,10 +25,10 @@ nvm use
|
|||
# Install the PHP and Composer dependencies for all of the plugins, packages, and tools
|
||||
pnpm install
|
||||
# Build all of the plugins, packages, and tools in the monorepo
|
||||
pnpm run build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
At this point you are now ready to begin developing and testing. All of the build outputs are cached running `pnpm run build` again will only build the plugins, packages, and tools that have changed since the last time you ran the command.
|
||||
At this point you are now ready to begin developing and testing. All of the build outputs are cached running `pnpm build` again will only build the plugins, packages, and tools that have changed since the last time you ran the command.
|
||||
|
||||
Check out [our development guide](DEVELOPMENT.md) if you would like a more comprehensive look at working in our repository.
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ pnpm exec syncpack -- list-mismatches
|
|||
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "You must sync the dependencies listed above before you can push this branch."
|
||||
echo "This can usually be accomplished automatically by updating the pinned version in \`.syncpackrc\` and then running \`pnpm run sync-dependencies\`."
|
||||
echo "This can usually be accomplished automatically by updating the pinned version in \`.syncpackrc\` and then running \`pnpm sync-dependencies\`."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ post_title: Minification of SCSS and JS
|
|||
|
||||
When updating SCSS files in the WooCommerce project, please **commit only your changes to unminified SCSS files**. The minification will be handled as part of the release process.
|
||||
|
||||
To get the minified CSS files, run `pnpm -- turbo run build --filter='woocommerce-legacy-assets'` from the repository root directory. To set up the development environment from scratch, see the section on [how to install dependencies and generate assets](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment#install-dependencies-and-generate-assets) in the guide to set up a WooCommerce development environment.
|
||||
To get the minified CSS files, run `pnpm --filter='@woocommerce/classic-assets' build` from the repository root directory. To set up the development environment from scratch, see the section on [how to install dependencies and generate assets](https://github.com/woocommerce/woocommerce/wiki/How-to-set-up-WooCommerce-development-environment#install-dependencies-and-generate-assets) in the guide to set up a WooCommerce development environment.
|
||||
|
||||
## Javascript
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ pnpm install && composer install
|
|||
### Build WooCommerce
|
||||
|
||||
```sh
|
||||
pnpm run build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
Running this script will compile the JavaScript and CSS that WooCommerce needs to operate. If you try to run WooCommerce on your server without generating the compiled assets, you may experience errors and other unwanted side-effects.
|
||||
|
|
|
@ -21,14 +21,15 @@
|
|||
"utils": "./tools/monorepo-utils/bin/run"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm exec turbo run turbo:build",
|
||||
"test": "pnpm exec turbo run turbo:test",
|
||||
"build": "pnpm -r build",
|
||||
"test": "pnpm -r test",
|
||||
"lint": "pnpm -r lint",
|
||||
"cherry-pick": "node ./tools/cherry-pick/bin/run",
|
||||
"clean": "pnpm store prune && git clean -fx **/node_modules && pnpm i",
|
||||
"preinstall": "npx only-allow pnpm",
|
||||
"postinstall": "pnpm git:update-hooks",
|
||||
"git:update-hooks": "if test -d .git; then rm -r .git/hooks && mkdir -p .git/hooks && husky install; else husky install; fi",
|
||||
"create-extension": "node ./tools/create-extension/index.js",
|
||||
"cherry-pick": "node ./tools/cherry-pick/bin/run",
|
||||
"sync-dependencies": "pnpm exec syncpack -- fix-mismatches",
|
||||
"utils": "node ./tools/monorepo-utils/dist/index.js"
|
||||
},
|
||||
|
@ -59,7 +60,6 @@
|
|||
"sass": "^1.69.5",
|
||||
"sass-loader": "^10.5.0",
|
||||
"syncpack": "^10.9.3",
|
||||
"turbo": "^1.11.1",
|
||||
"typescript": "^5.3.3",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack": "^5.89.0"
|
||||
|
|
|
@ -60,8 +60,7 @@ To create a new package, add a new folder to `/packages`, containing…
|
|||
- Package description
|
||||
- Installation details
|
||||
- Usage example
|
||||
4. A `src` directory for the source of your module, which will be built by default using the `pnpm run turbo:build` command. Note that you'll want an `index.js` file that exports the package contents, see other packages for examples.
|
||||
|
||||
4. A `src` directory for the source of your module. Note that you'll want an `index.js` file that exports the package contents, see other packages for examples.
|
||||
5. A blank Changelog file, `changelog.md`.
|
||||
|
||||
```
|
||||
|
|
|
@ -25,6 +25,23 @@
|
|||
"!*.tsbuildinfo"
|
||||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:typescript": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix:lang:js"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@types/jest": "^27.5.2",
|
||||
|
@ -50,25 +67,45 @@
|
|||
"jest-mock-extended": "^1.0.18",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "tsc --project tsconfig.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"start": "tsc --project tsconfig.json --watch",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"prepack": "pnpm run clean && pnpm run build"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
"wireit": {
|
||||
"build:project:typescript": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"node_modules/@woocommerce/e2e-environment/",
|
||||
"node_modules/@woocommerce/e2e-utils/",
|
||||
"package.json",
|
||||
"!node_modules/@woocommerce/e2e-utils/node_modules",
|
||||
"!node_modules/@woocommerce/e2e-utils/.git",
|
||||
"!node_modules/@woocommerce/e2e-utils/.svn",
|
||||
"!node_modules/@woocommerce/e2e-utils/src",
|
||||
"!node_modules/@woocommerce/e2e-environment/node_modules",
|
||||
"!node_modules/@woocommerce/e2e-environment/.git",
|
||||
"!node_modules/@woocommerce/e2e-environment/.svn",
|
||||
"!node_modules/@woocommerce/e2e-environment/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,17 +28,23 @@
|
|||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:bundle": "wireit",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/components": "workspace:*",
|
||||
"@wordpress/components": "wp-6.0",
|
||||
"@wordpress/element": "wp-6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^17.0.71",
|
||||
|
@ -59,16 +65,75 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^17.0.71",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/components": "workspace:*",
|
||||
"@wordpress/components": "wp-6.0",
|
||||
"@wordpress/element": "wp-6.0"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,6 +25,21 @@
|
|||
"src/**/*.scss"
|
||||
],
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:bundle": "wireit",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/api-fetch": "wp-6.0",
|
||||
"@wordpress/compose": "wp-6.0",
|
||||
|
@ -71,28 +86,82 @@
|
|||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-rtl-plugin": "^2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name --",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"webpack-rtl-plugin": "^2.0.0",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^17.0.71",
|
||||
"@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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,8 @@
|
|||
},
|
||||
"devDependencies": {
|
||||
"@woocommerce/eslint-plugin": "workspace:*",
|
||||
"eslint": "^8.55.0"
|
||||
"eslint": "^8.55.0",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
|
|
|
@ -30,18 +30,22 @@
|
|||
],
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run clean && npm run compile",
|
||||
"turbo:test": "jest",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "rm -rf ./dist ./tsconfig.tsbuildinfo",
|
||||
"compile": "tsc --project tsconfig.json",
|
||||
"prepack": "pnpm run build",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:typescript": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^0.24.0",
|
||||
|
@ -59,14 +63,41 @@
|
|||
"eslint": "^8.55.0",
|
||||
"jest": "~27.5.1",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
"wireit": {
|
||||
"build:project:typescript": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"dist"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.js --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"package.json"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,20 @@
|
|||
"build-style/**",
|
||||
"src/**/*.scss"
|
||||
],
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:bundle": "wireit",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/expression-evaluation": "workspace:*",
|
||||
|
@ -62,27 +74,89 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^17.0.71",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -29,6 +29,27 @@
|
|||
"src/**/*.scss"
|
||||
],
|
||||
"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.1",
|
||||
|
@ -145,30 +166,101 @@
|
|||
"typescript": "^5.3.3",
|
||||
"uuid": "^8.3.2",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"lint": "eslint --ext=js,ts,tsx src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"lint:fix": "eslint --ext=js,ts,tsx src --fix",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"test:update-snapshots": "pnpm run test -- --updateSnapshot",
|
||||
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,8 +10,7 @@
|
|||
"pnpm": "^8.6.7"
|
||||
},
|
||||
"scripts": {
|
||||
"postinstall": "composer install",
|
||||
"changelog": "composer exec -- changelogger"
|
||||
"changelog": "composer install && composer exec -- changelogger"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
|
@ -27,5 +26,8 @@
|
|||
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-product-editor-block-extensionv#readme",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"wireit": "0.14.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -7,10 +7,6 @@
|
|||
"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"
|
||||
|
@ -21,5 +17,11 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/woocommerce/woocommerce/issues"
|
||||
},
|
||||
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-woo-extensionv#readme"
|
||||
"scripts": {
|
||||
"changelog": "composer install && composer exec -- changelogger"
|
||||
},
|
||||
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/create-woo-extensionv#readme",
|
||||
"devDependencies": {
|
||||
"wireit": "0.14.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -25,29 +25,25 @@
|
|||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@types/node": "^16.18.68",
|
||||
"browser-filesaver": "^1.1.1",
|
||||
"moment": "^2.29.4"
|
||||
},
|
||||
"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.23.5",
|
||||
"@types/jest": "^27.5.2",
|
||||
|
@ -59,12 +55,67 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/internal-js-tests/",
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"package.json",
|
||||
"!node_modules/@woocommerce/internal-js-tests/node_modules",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.git",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.svn",
|
||||
"!node_modules/@woocommerce/internal-js-tests/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -25,6 +25,26 @@
|
|||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/number": "workspace:*",
|
||||
"@wordpress/deprecated": "wp-6.0",
|
||||
|
@ -36,21 +56,6 @@
|
|||
"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.23.5",
|
||||
"@types/jest": "^27.5.2",
|
||||
|
@ -62,12 +67,63 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/internal-js-tests/",
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -24,6 +24,27 @@
|
|||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:bundle": "wireit",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/experimental": "workspace:*",
|
||||
"@wordpress/components": "wp-6.0",
|
||||
|
@ -66,33 +87,100 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -24,7 +24,26 @@
|
|||
"main": "build/index.js",
|
||||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/date": "workspace:*",
|
||||
"@woocommerce/navigation": "workspace:*",
|
||||
|
@ -71,7 +90,8 @@
|
|||
"redux": "^4.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@wordpress/core-data": "wp-6.0",
|
||||
|
@ -79,25 +99,70 @@
|
|||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/internal-js-tests/",
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,11 +33,8 @@ export const withCurrentUserHydration = ( currentUser: WCUser ) =>
|
|||
);
|
||||
} );
|
||||
|
||||
const {
|
||||
startResolution,
|
||||
finishResolution,
|
||||
receiveCurrentUser,
|
||||
} = useDispatch( STORE_NAME );
|
||||
const { startResolution, finishResolution, receiveCurrentUser } =
|
||||
useDispatch( STORE_NAME );
|
||||
|
||||
if ( shouldHydrate ) {
|
||||
startResolution( 'getCurrentUser', [] );
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -48,7 +48,8 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"lodash": "^4.17.0"
|
||||
|
@ -57,24 +58,74 @@
|
|||
"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"
|
||||
"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"
|
||||
]
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -37,13 +37,15 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"lint": "eslint src",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"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 --output-file eslint_report.json --format json src"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
|
|
|
@ -22,6 +22,19 @@
|
|||
"installFiles",
|
||||
"CHANGELOG.md"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "./bin/build.sh && pnpm clean && pnpm compile",
|
||||
"clean": "rm -rf ./build ./build-module",
|
||||
"compile": "e2e-builds",
|
||||
"lint": "eslint --ext=js,ts,tsx src",
|
||||
"lint:fix": "eslint --ext=js,ts,tsx src --fix",
|
||||
"prepack": "pnpm build"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/globals": "^27.5.1",
|
||||
"@wordpress/deprecated": "wp-6.0",
|
||||
|
@ -42,7 +55,8 @@
|
|||
"@wordpress/babel-preset-default": "3.0.2",
|
||||
"@wordpress/browserslist-config": "wp-6.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-plugin-jest": "23.20.0"
|
||||
"eslint-plugin-jest": "23.20.0",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@woocommerce/api": "^0.2.0",
|
||||
|
@ -50,19 +64,5 @@
|
|||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ Again, if you don't have shell access to your test site, through WP Admin ensure
|
|||
3. You have an admin user set up (if their credentials differ from u/ `admin` and p/ `password` be sure to update `/plugins/woocommerce/tests/e2e/config/default.json`)
|
||||
4. You have a customer user set up named 'Jane Smith'. This user should be a `subscriber` and again make sure their username and password are reflected in `/plugins/woocommerce/tests/e2e/config/default.json`.
|
||||
|
||||
You should then be able to run the e2e tests by running `pnpm run e2e --filter=woocommerce`.
|
||||
You should then be able to run the e2e tests by running `pnpm e2e --filter=@woocommerce/plugin-woocommerce`.
|
||||
|
||||
### Test Sequencer Setup
|
||||
|
||||
|
|
|
@ -24,6 +24,30 @@
|
|||
},
|
||||
"main": "index.js",
|
||||
"module": "build-module/index.js",
|
||||
"bin": {
|
||||
"wc-e2e": "bin/wc-e2e.sh"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm clean && pnpm compile",
|
||||
"clean": "rm -rf ./build ./build-module",
|
||||
"compile": "e2e-builds",
|
||||
"docker:clear-all": "docker rmi --force $(docker images -q)",
|
||||
"docker:down": "./bin/docker-compose.sh down",
|
||||
"docker:ssh": "docker exec -it $(node utils/get-app-name.js)_wordpress-www /bin/bash",
|
||||
"docker:up": "./bin/docker-compose.sh up",
|
||||
"docker:wait": "bash ./bin/wait-for-build.sh",
|
||||
"lint": "eslint --ext=js,ts,tsx src",
|
||||
"lint:fix": "eslint --ext=js,ts,tsx src --fix",
|
||||
"prepack": "pnpm build",
|
||||
"test:e2e": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js",
|
||||
"test:e2e-debug": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev --debug",
|
||||
"test:e2e-dev": "bash ./bin/wait-for-build.sh && ./bin/e2e-test-integration.js --dev"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@automattic/puppeteer-utils": "github:Automattic/puppeteer-utils#0f3ec50",
|
||||
"@jest/test-sequencer": "^27.5.1",
|
||||
|
@ -59,34 +83,10 @@
|
|||
"@wordpress/babel-preset-default": "3.0.2",
|
||||
"@wordpress/browserslist-config": "wp-6.0",
|
||||
"ndb": "^1.1.5",
|
||||
"semver": "^7.5.4"
|
||||
"semver": "^7.5.4",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,19 @@
|
|||
},
|
||||
"main": "build/index.js",
|
||||
"module": "build-module/index.js",
|
||||
"scripts": {
|
||||
"build": "pnpm clean && pnpm compile",
|
||||
"clean": "rm -rf ./build ./build-module",
|
||||
"compile": "e2e-builds",
|
||||
"lint": "eslint --ext=js,ts,tsx src",
|
||||
"lint:fix": "eslint --ext=js,ts,tsx src --fix",
|
||||
"prepack": "pnpm build"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@automattic/puppeteer-utils": "github:Automattic/puppeteer-utils#0f3ec50",
|
||||
"@wordpress/deprecated": "wp-6.0",
|
||||
|
@ -38,26 +51,13 @@
|
|||
"@wordpress/babel-preset-default": "3.0.2",
|
||||
"@wordpress/browserslist-config": "wp-6.0",
|
||||
"eslint": "^8.55.0",
|
||||
"eslint-plugin-jest": "23.20.0"
|
||||
"eslint-plugin-jest": "23.20.0",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@woocommerce/api": "^0.2.0"
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -41,10 +41,11 @@
|
|||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"lint": "eslint ./rules ./configs",
|
||||
"lint:fix": "eslint ./rules ./configs --fix"
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
|
@ -53,7 +54,8 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -76,33 +76,106 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
|
||||
"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"
|
||||
]
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -25,9 +25,25 @@
|
|||
"main": "build/index.js",
|
||||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@automattic/explat-client": "^0.0.3",
|
||||
|
@ -52,27 +68,61 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/internal-js-tests/",
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"package.json",
|
||||
"!node_modules/@woocommerce/internal-js-tests/node_modules",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.git",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.svn",
|
||||
"!node_modules/@woocommerce/internal-js-tests/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,5 +10,5 @@
|
|||
"./typings",
|
||||
"./node_modules/@types"
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,18 +34,17 @@
|
|||
"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"
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
|
@ -58,12 +57,58 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,10 +7,6 @@
|
|||
"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"
|
||||
|
@ -21,5 +17,11 @@
|
|||
"bugs": {
|
||||
"url": "https://github.com/woocommerce/woocommerce/issues"
|
||||
},
|
||||
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme"
|
||||
"scripts": {
|
||||
"changelog": "composer install && composer exec -- changelogger"
|
||||
},
|
||||
"homepage": "https://github.com/woocommerce/woocommerce/tree/trunk/packages/js/extend-cart-checkout-block#readme",
|
||||
"devDependencies": {
|
||||
"wireit": "0.14.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
{
|
||||
"root": "packages/js/extend-cart-checkout-block",
|
||||
"sourceRoot": "packages/js/extend-cart-checkout-block",
|
||||
"projectType": "library"
|
||||
}
|
|
@ -27,6 +27,20 @@
|
|||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/create-block": "wp-6.0",
|
||||
"chalk": "^4.1.2",
|
||||
|
@ -59,18 +73,58 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,8 +21,10 @@
|
|||
},
|
||||
"homepage": "https://github.com/woocommerce/woocommerce#readme",
|
||||
"scripts": {
|
||||
"lint": "eslint build.js",
|
||||
"lint:fix": "eslint build.js --fix"
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint build.js --fix",
|
||||
"lint:lang:js": "eslint build.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "7.12.9",
|
||||
|
@ -31,7 +33,8 @@
|
|||
"eslint": "^8.55.0",
|
||||
"glob": "^7.2.3",
|
||||
"lodash": "^4.17.21",
|
||||
"mkdirp": "^1.0.4"
|
||||
"mkdirp": "^1.0.4",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
const path = require( 'path' );
|
||||
|
||||
// These modules need to be transformed because they are not transpiled to CommonJS.
|
||||
const transformModules = [ 'is-plain-obj', 'memize' ];
|
||||
const transformModules = [ 'is-plain-obj' ];
|
||||
// Ignore all node_modules except for the ones we need to transform.
|
||||
const transformIgnorePatterns = [
|
||||
`node_modules/(?!.pnpm/${ transformModules.join(
|
||||
|
@ -34,8 +34,9 @@ module.exports = {
|
|||
__dirname,
|
||||
'build/mocks/style-mock.js'
|
||||
),
|
||||
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
|
||||
"uuid": require.resolve('uuid'),
|
||||
// Force some modulse to resolve with the CJS entry point, because Jest does not support package.json.exports.
|
||||
'uuid': require.resolve('uuid'),
|
||||
'memize': require.resolve('memize'),
|
||||
},
|
||||
restoreMocks: true,
|
||||
setupFiles: [
|
||||
|
@ -59,7 +60,6 @@ module.exports = {
|
|||
transformIgnorePatterns,
|
||||
transform: {
|
||||
'^.+\\is-plain-obj/index\\.js$': 'babel-jest',
|
||||
'^.+\\memize/dist/index\\.js$': 'babel-jest',
|
||||
'^.+\\.[jt]sx?$': 'ts-jest',
|
||||
},
|
||||
testEnvironment: 'jest-environment-jsdom',
|
||||
|
|
|
@ -21,13 +21,17 @@
|
|||
"main": "build/util/index.js",
|
||||
"module": "build-module/util/index.js",
|
||||
"scripts": {
|
||||
"turbo:build": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"ts:check": "tsc --noEmit --project ./tsconfig.json",
|
||||
"clean": "pnpm exec rimraf *.tsbuildinfo build build-*",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix"
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"dependencies": {
|
||||
"@testing-library/jest-dom": "5.16.2",
|
||||
|
@ -47,11 +51,51 @@
|
|||
"resize-observer-polyfill": "1.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"root": "packages/js/internal-js-tests",
|
||||
"sourceRoot": "packages/js/internal-js-tests/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,17 @@
|
|||
"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",
|
||||
|
@ -32,10 +43,6 @@
|
|||
"webpack-remove-empty-scripts": "^0.7.3",
|
||||
"webpack-rtl-plugin": "^2.0.0"
|
||||
},
|
||||
"scripts": {
|
||||
"lint": "eslint index.js",
|
||||
"lint:fix": "eslint index.js --fix"
|
||||
},
|
||||
"private": true,
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
|
@ -46,11 +53,7 @@
|
|||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
"webpack": "^5.89.0",
|
||||
"wireit": "0.14.1"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -25,6 +25,26 @@
|
|||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/api-fetch": "wp-6.0",
|
||||
"@wordpress/components": "wp-6.0",
|
||||
|
@ -44,21 +64,6 @@
|
|||
"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.23.5",
|
||||
"@babel/runtime": "^7.23.5",
|
||||
|
@ -72,12 +77,58 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/internal-js-tests/",
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"package.json",
|
||||
"!node_modules/@woocommerce/internal-js-tests/node_modules",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.git",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.svn",
|
||||
"!node_modules/@woocommerce/internal-js-tests/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,6 +26,24 @@
|
|||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@wordpress/a11y": "wp-6.0",
|
||||
"@wordpress/data": "wp-6.0",
|
||||
|
@ -40,15 +58,6 @@
|
|||
"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.23.5",
|
||||
|
@ -63,11 +72,47 @@
|
|||
"redux": "^4.2.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
{
|
||||
"root": "packages/js/notices",
|
||||
"sourceRoot": "packages/js/notices/src",
|
||||
"projectType": "library",
|
||||
"targets": {
|
||||
"build": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "build"
|
||||
}
|
||||
},
|
||||
"build-watch": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "start"
|
||||
}
|
||||
},
|
||||
"test": {
|
||||
"executor": "@nrwl/workspace:run-script",
|
||||
"options": {
|
||||
"script": "test"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -31,19 +31,18 @@
|
|||
"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"
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
|
@ -58,12 +57,64 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"wireit": {
|
||||
"build:project:cjs": {
|
||||
"command": "tsc --project tsconfig-cjs.json",
|
||||
"files": [
|
||||
"tsconfig-cjs.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"build:project:esm": {
|
||||
"command": "tsc --project tsconfig.json",
|
||||
"files": [
|
||||
"tsconfig.json",
|
||||
"src/**/*.{js,jsx,ts,tsx}",
|
||||
"typings/**/*.ts"
|
||||
],
|
||||
"output": [
|
||||
"build-module",
|
||||
"build-types"
|
||||
],
|
||||
"dependencies": [
|
||||
"dependencyOutputs"
|
||||
]
|
||||
},
|
||||
"test:js": {
|
||||
"command": "jest --config ./jest.config.json --passWithNoTests",
|
||||
"dependencies": [
|
||||
"build:project"
|
||||
]
|
||||
},
|
||||
"dependencyOutputs": {
|
||||
"allowUsuallyExcludedPaths": true,
|
||||
"files": [
|
||||
"node_modules/@woocommerce/internal-js-tests/",
|
||||
"node_modules/@woocommerce/eslint-plugin/configs",
|
||||
"node_modules/@woocommerce/eslint-plugin/rules",
|
||||
"node_modules/@woocommerce/eslint-plugin/index.js",
|
||||
"package.json",
|
||||
"!node_modules/@woocommerce/internal-js-tests/node_modules",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.git",
|
||||
"!node_modules/@woocommerce/internal-js-tests/.svn",
|
||||
"!node_modules/@woocommerce/internal-js-tests/src"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -25,8 +25,26 @@
|
|||
"module": "build-module/index.js",
|
||||
"types": "build-types",
|
||||
"react-native": "src/index",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
"scripts": {
|
||||
"build": "pnpm --if-present --filter=\"$npm_package_name...\" build:project",
|
||||
"build:project": "pnpm --if-present /^build:project:.*$/",
|
||||
"build:project:bundle": "wireit",
|
||||
"build:project:cjs": "wireit",
|
||||
"build:project:esm": "wireit",
|
||||
"changelog": "composer install && composer exec -- changelogger",
|
||||
"lint": "pnpm --if-present '/^lint:lang:.*$/'",
|
||||
"lint:fix": "pnpm --if-present '/^lint:fix:lang:.*$/'",
|
||||
"lint:fix:lang:js": "eslint src --fix",
|
||||
"lint:lang:js": "eslint src",
|
||||
"prepack": "pnpm build",
|
||||
"test:js": "wireit",
|
||||
"watch:build": "pnpm build:project --watch"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"@woocommerce/components": "workspace:*",
|
||||
|
@ -66,29 +84,99 @@
|
|||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"webpack-cli": "^3.3.12",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"lint": "eslint src",
|
||||
"build:js": "tsc --project tsconfig.json && tsc --project tsconfig-cjs.json",
|
||||
"build:css": "webpack",
|
||||
"start": "concurrently \"tsc --project tsconfig.json --watch\" \"tsc --project tsconfig-cjs.json --watch\" \"webpack --watch\"",
|
||||
"test": "pnpm test:js",
|
||||
"test:js": "pnpm -w exec turbo run turbo:test --filter=$npm_package_name",
|
||||
"prepack": "pnpm run clean && pnpm run build",
|
||||
"lint:fix": "eslint src --fix",
|
||||
"test-staged": "jest --bail --config ./jest.config.json --findRelatedTests"
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix",
|
||||
"pnpm test-staged"
|
||||
]
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -118,28 +118,147 @@
|
|||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^3.3.12",
|
||||
"webpack-remove-empty-scripts": "^0.7.3",
|
||||
"webpack-rtl-plugin": "^2.0.0"
|
||||
"webpack-rtl-plugin": "^2.0.0",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"scripts": {
|
||||
"turbo:build": "pnpm run build:js && pnpm run build:css",
|
||||
"turbo:test": "jest --config ./jest.config.json",
|
||||
"prepare": "composer install",
|
||||
"changelog": "composer exec -- changelogger",
|
||||
"clean": "pnpm exec rimraf tsconfig.tsbuildinfo build build-*",
|
||||
"build": "pnpm -w exec turbo run turbo:build --filter=$npm_package_name",
|
||||
"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"
|
||||
"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"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@types/react": "^17.0.71",
|
||||
"@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",
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { BlockIcon as BaseBlockIcon } from '@wordpress/block-editor';
|
||||
import { Block, BlockAttributes } from '@wordpress/blocks';
|
||||
import { Block } from '@wordpress/blocks';
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { createElement, RawHTML } from '@wordpress/element';
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { WooHeaderItem } from '@woocommerce/admin-layout';
|
||||
import { Product, ProductVariation } from '@woocommerce/data';
|
||||
import { useEntityProp } from '@wordpress/core-data';
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { createElement } from '@wordpress/element';
|
||||
|
@ -46,11 +45,7 @@ export function Header( {
|
|||
const lastPersistedProduct = useSelect(
|
||||
( select ) => {
|
||||
const { getEntityRecord } = select( 'core' );
|
||||
return getEntityRecord(
|
||||
'postType',
|
||||
productType,
|
||||
productId
|
||||
);
|
||||
return getEntityRecord( 'postType', productType, productId );
|
||||
},
|
||||
[ productId ]
|
||||
);
|
||||
|
|
|
@ -66,7 +66,8 @@ export function HeaderToolbar( {
|
|||
return {
|
||||
isTextModeEnabled: getEditorMode() === 'text',
|
||||
isInserterEnabled: hasInserterItems(
|
||||
getBlockRootClientId( getBlockSelectionEnd() ?? '' ) ?? undefined
|
||||
getBlockRootClientId( getBlockSelectionEnd() ?? '' ) ??
|
||||
undefined
|
||||
),
|
||||
};
|
||||
}, [] );
|
||||
|
|
|
@ -6,7 +6,6 @@ import { Button } from '@wordpress/components';
|
|||
import { createElement } from '@wordpress/element';
|
||||
import { arrowLeft, arrowRight, Icon } from '@wordpress/icons';
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { ProductVariation } from '@woocommerce/data';
|
||||
import { recordEvent } from '@woocommerce/tracks';
|
||||
|
||||
/**
|
||||
|
|
|
@ -2,10 +2,7 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import { useSelect, useDispatch } from '@wordpress/data';
|
||||
import {
|
||||
EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME,
|
||||
Product,
|
||||
} from '@woocommerce/data';
|
||||
import { EXPERIMENTAL_PRODUCT_VARIATIONS_STORE_NAME } from '@woocommerce/data';
|
||||
import { getNewPath, navigateTo } from '@woocommerce/navigation';
|
||||
|
||||
type VariationSwitcherProps = {
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
vendor
|
||||
node_modules
|
||||
.turbo
|
|
@ -32,15 +32,17 @@
|
|||
"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"
|
||||
"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"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.23.5",
|
||||
|
@ -52,11 +54,52 @@
|
|||
"jest-cli": "~27.5.1",
|
||||
"rimraf": "^3.0.2",
|
||||
"ts-jest": "~29.1.1",
|
||||
"typescript": "^5.3.3"
|
||||
"typescript": "^5.3.3",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.(t|j)s?(x)": [
|
||||
"pnpm lint:fix"
|
||||
]
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,21 +28,21 @@ To enable Live(Hot) Reload when code is changed, run the following commands:
|
|||
|
||||
```text
|
||||
pnpm install
|
||||
pnpm run start
|
||||
pnpm start
|
||||
```
|
||||
|
||||
To build the /woo-ai/ plugin directory (when loading the plugin via symlink), run:
|
||||
|
||||
```text
|
||||
pnpm install
|
||||
pnpm run build
|
||||
pnpm build
|
||||
```
|
||||
|
||||
To build the plugin ZIP file, run:
|
||||
|
||||
```text
|
||||
pnpm install
|
||||
pnpm run build:zip
|
||||
pnpm build:zip
|
||||
```
|
||||
|
||||
See [wp-scripts](https://github.com/WordPress/gutenberg/tree/master/packages/scripts) for more usage information.
|
||||
|
|
|
@ -12,7 +12,7 @@ mkdir -p "$DEST_PATH"
|
|||
echo "Installing PHP and JS dependencies..."
|
||||
pnpm install
|
||||
echo "Running JS Build..."
|
||||
pnpm -w run build --filter=woo-ai || exit "$?"
|
||||
pnpm --filter='@woocommerce/plugin-woo-ai' build || exit "$?"
|
||||
|
||||
echo "Syncing files..."
|
||||
rsync -rc --exclude-from="$PROJECT_PATH/.distignore" "$PROJECT_PATH/" "$DEST_PATH/" --delete --delete-excluded
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"name": "woo-ai",
|
||||
"name": "@woocommerce/plugin-woo-ai",
|
||||
"private": true,
|
||||
"description": "Implementing WooCommerce AI Experiments.",
|
||||
"license": "GPL-2.0",
|
||||
"repository": {
|
||||
|
@ -26,7 +27,31 @@
|
|||
"prettier": "npm:wp-prettier@^2.8.5",
|
||||
"ts-loader": "^9.5.1",
|
||||
"typescript": "^5.3.3",
|
||||
"uglify-js": "^3.17.4"
|
||||
"uglify-js": "^3.17.4",
|
||||
"wireit": "0.14.1"
|
||||
},
|
||||
"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"
|
||||
},
|
||||
"dependencies": {
|
||||
"@automattic/tour-kit": "^1.1.1",
|
||||
|
@ -55,30 +80,6 @@
|
|||
"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"
|
||||
|
|
|
@ -7,7 +7,7 @@ Compile a publishable JSON object of WooCommerce's JavaScript filters and slotFi
|
|||
Generate a new reference found at `bin/hook-reference/data.json` by running the following command.
|
||||
|
||||
```
|
||||
pnpm run create-hook-reference
|
||||
pnpm create-hook-reference
|
||||
```
|
||||
|
||||
The data includes references to code in the Github repository by commit hash, so it is essential to commit the resulting data in a pull request to `main` so code references are publicly available.
|
||||
|
|
|
@ -14,7 +14,7 @@ Build the example extension by running the pnpm script and passing the example n
|
|||
|
||||
|
||||
```bash
|
||||
WC_EXT=<example> pnpm --filter=woocommerce/client/admin example
|
||||
WC_EXT=<example> pnpm --filter=@woocommerce/admin-library example
|
||||
```
|
||||
|
||||
You should see a new directory in `./woocommerce/plugins/{example} path.` Include the output plugin in your `.wp-env.json` or `.wp-env.override.json` and restart the WordPress instance. WooCommerce will now reflect the changes made by the example extension.
|
||||
|
|
|
@ -10,7 +10,7 @@ This feature is hidden behind a feature flag and can be turned on or off by visi
|
|||
|
||||
The fastest way to get started is by creating an example plugin from WooCommerce Admin. Enter the following command:
|
||||
|
||||
`WC_EXT=add-navigation-items pnpm example --filter=woocommerce/client/admin`
|
||||
`WC_EXT=add-navigation-items pnpm example --filter=@woocommerce/admin-library`
|
||||
|
||||
This will create a new plugin that covers various features of the navigation and helps to register some initial items and categories within the new navigation menu. After running the command above, you can make edits directly to the files at `docs/examples/extensions/add-navigation-items` and they will be built and copied to your `wp-content/add-navigation-items` folder on save.
|
||||
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue