Skip to content

Commit

Permalink
Merge branch 'trunk' into update/react-peer-deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zinigor authored Feb 21, 2023
2 parents d5deb23 + bc5e94b commit b096d87
Show file tree
Hide file tree
Showing 484 changed files with 5,487 additions and 2,878 deletions.
5 changes: 1 addition & 4 deletions .github/actions/tool-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ description: "Setup needed versions of PHP, Node, and Pnpm."
inputs:
php:
description: "Override the PHP version, or set 'false' to skip setting up PHP."
coverage:
description: "Set the PHP coverage driver, e.g. 'none' or 'pcov'."
default: 'none'
node:
description: "Override the Node version, or set 'false' to skip setting up Node and Pnpm."
runs:
Expand Down Expand Up @@ -65,7 +62,7 @@ runs:
ini-values: error_reporting=E_ALL, display_errors=On, zend.assertions=1
tools: composer:${{ steps.versions.outputs.composer-version }}
extensions: mysql, imagick
coverage: ${{ inputs.coverage }}
coverage: none

- name: Configure composer
if: steps.versions.outputs.php-version != 'false'
Expand Down
4 changes: 3 additions & 1 deletion .github/files/required-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
- '!projects/js-packages/svelte-data-sync-client/**'
- '!projects/packages/wp-js-data-sync/**'
- '!projects/packages/backup/**'
- '!projects/packages/import/**'
- '!projects/packages/search/**'
- '!projects/packages/stats/**'
- '!projects/packages/stats-admin/**'
Expand All @@ -59,10 +60,11 @@
- avengers
- jetpack-approvers

# The Caribou team reviews changes to the Migration plugin,
# The Caribou team reviews changes to the Migration plugin and its Import package,
# and can add dependencies to the monorepo's lock file.
- name: Migration
paths:
- 'projects/packages/import/**'
- 'projects/plugins/migration/**'
- '!projects/plugins/*/composer.lock'
- '!projects/plugins/*/composer.json'
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ jobs:
EXIT=0
mkdir artifacts
[[ "$TEST_SCRIPT" == "test-coverage" ]] && mkdir coverage
for P in composer.json projects/*/*/composer.json; do
if [[ "$P" == "composer.json" ]]; then
DIR="."
Expand Down
17 changes: 0 additions & 17 deletions codecov.yml

This file was deleted.

15 changes: 3 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions docs/monorepo.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ We use `composer.json` to hold metadata about projects. Much of our generic tool
* `.repositories`: If you include a repository entry referencing monorepo packages, it must have `.options.monorepo` set to true. This allows the build tooling to recognize and remove it.
* `.scripts.build-development`: If your project has a general build step, this must run the necessary commands. See [Building](#building) for details.
* `.scripts.build-production`: If your project requires a production-specific build step, this must run the necessary commands. See [Building](#building) for details.
* `.scripts.test-coverage`: If the package contains any tests, this must run the necessary commands to generate a coverage report. See [Code coverage](#code-coverage) for details.
* `.scripts.skip-test-coverage`: Run before `.scripts.test-coverage` in CI. If it exits with code 3, the test run will be skipped.
* `.scripts.test-e2e`: If the package contains any E2E tests, this must run the necessary commands. See [E2E tests](#e2e-tests) for details.
* `.scripts.test-js`: If the package contains any JavaScript tests, this must run the necessary commands. See [JavaScript tests](#javascript-tests) for details.
* `.scripts.skip-test-js`: Run before `.scripts.test-js` in CI. If it exits with code 3, the test run will be skipped.
Expand Down Expand Up @@ -248,16 +246,6 @@ JavaScript tests should use `jest`, not `mocha`/`chai`/`sinon`. For React testin

If a project contains end-to-end tests, it must define `.scripts.test-e2e` in `composer.json` to run the tests. If a build step is required before running tests, the necessary commands for that should also be included.

### Code coverage

If a project contains PHP or JavaScript tests, it should also define `.scripts.test-coverage` in `composer.json` to run the tests in a mode that will generate code coverage output. The CI environment will run `pnpm install` and `composer install` beforehand, but if a build step is required before running tests the necessary commands for that should also be included in `.scripts.test-coverage`.

Output should be written to the path specified via the `COVERAGE_DIR` environment variable. Subdirectories of that path may be used as desired.

For PHP tests, you'll probably run PHPUnit as `php -dpcov.directory=. "$(command -v phpunit)" --coverage-clover "$COVERAGE_DIR/clover.xml"`.

There's no need to be concerned about collisions with other projects' coverage files, a separate directory is used per project. The coverage files are also automatically copied to `ARTIFACTS_DIR`.

## Mirror repositories

Most projects in the monorepo should have a mirror repository holding a built version of the project, ready for deployment. Follow these steps to create the mirror repo and configure the monorepo tooling to push to it.
Expand Down
2 changes: 1 addition & 1 deletion docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Running the script will tell you if you have your environment already set up and

#### Running Tests

To run PHP, JS, and coverage tests, you can use the Jetpack CLI: `jetpack test` and then choose the project and type of test you'd like to run.
To run PHP and JS tests, you can use the Jetpack CLI: `jetpack test` and then choose the project and type of test you'd like to run.

# Development Workflow

Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: removed
Comment: Remove `test-coverage` scripts and other remnants of automated code coverage.


3 changes: 1 addition & 2 deletions projects/github-actions/test-results-to-slack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
},
"scripts": {
"build": "ncc build src/index.js -o dist --source-map --license licenses.txt",
"test": "jest --config=tests/jest.config.js --verbose --runInBand",
"test-coverage": "jest --config=tests/jest.config.js --coverage --coverageDirectory=\"$COVERAGE_DIR\" --coverageReporters=clover"
"test": "jest --config=tests/jest.config.js --verbose --runInBand"
},
"engines": {
"node": "^18.13.0",
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@

### This is a list detailing changes for the Jetpack RNA Analytics package releases.

## 0.1.24 - 2023-02-20
### Changed
- Minor internal updates.

## 0.1.23 - 2023-01-25
### Changed
- Minor internal updates.

## 0.1.22 - 2022-12-02
Expand Down
3 changes: 0 additions & 3 deletions projects/js-packages/analytics/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
"scripts": {
"test-js": [
"pnpm run test"
],
"test-coverage": [
"pnpm run test-coverage"
]
},
"repositories": [
Expand Down
5 changes: 2 additions & 3 deletions projects/js-packages/analytics/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-analytics",
"version": "0.1.23",
"version": "0.1.24",
"description": "Jetpack Analytics Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand All @@ -15,8 +15,7 @@
".": "./index.jsx"
},
"scripts": {
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test-coverage": "pnpm run test --coverageDirectory=\"$COVERAGE_DIR\" --coverage --coverageReporters=clover"
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"engines": {
"node": "^18.13.0",
Expand Down
4 changes: 4 additions & 0 deletions projects/js-packages/api/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## 0.15.1 - 2023-02-20
### Changed
- Minor internal updates.

## 0.15.0 - 2023-02-15
### Added
- Added fetchMigrationStatus get method [#28807]
Expand Down
3 changes: 0 additions & 3 deletions projects/js-packages/api/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"scripts": {
"test-js": [
"pnpm run test"
],
"test-coverage": [
"pnpm run test-coverage"
]
},
"repositories": [
Expand Down
5 changes: 2 additions & 3 deletions projects/js-packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-api",
"version": "0.15.0",
"version": "0.15.1",
"description": "Jetpack Api Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand All @@ -19,8 +19,7 @@
".": "./index.jsx"
},
"scripts": {
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test-coverage": "pnpm run test --coverageDirectory=\"$COVERAGE_DIR\" --coverage --coverageReporters=clover"
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"engines": {
"node": "^18.13.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: removed
Comment: Remove `test-coverage` scripts and other remnants of automated code coverage.


Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
"scripts": {
"test-js": [
"pnpm run test"
],
"test-coverage": [
"pnpm run test-coverage"
]
},
"repositories": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/babel-plugin-replace-textdomain",
"version": "1.0.22",
"version": "1.0.23-alpha",
"description": "A Babel plugin to replace the textdomain in gettext-style function calls.",
"homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/babel-plugin-replace-textdomain/#readme",
"bugs": {
Expand All @@ -14,8 +14,7 @@
"license": "GPL-2.0-or-later",
"author": "Automattic",
"scripts": {
"test": "jest tests",
"test-coverage": "jest tests --coverage --collectCoverageFrom='src/**/*.js' --coverageDirectory=\"$COVERAGE_DIR\" --coverageReporters=clover"
"test": "jest tests"
},
"dependencies": {
"debug": "^4.3.2"
Expand Down
5 changes: 5 additions & 0 deletions projects/js-packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

### This is a list detailing changes for the Jetpack RNA Components package releases.

## 0.27.7 - 2023-02-20
### Fixed
- Changed wrong version [#28824]
- Use External Link icons for external links [#28922]

## 0.27.6 - 2023-02-15
### Changed
- Editing changelog for Jetpack 11.9-a.3 [#28971]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ExternalLink } from '@wordpress/components';
import { createInterpolateElement } from '@wordpress/element';
import { __, sprintf } from '@wordpress/i18n';
import { Icon, check, closeSmall } from '@wordpress/icons';
Expand Down Expand Up @@ -29,13 +30,9 @@ const ToS = createInterpolateElement(
'jetpack'
),
{
tosLink: <a href={ getRedirectUrl( 'wpcom-tos' ) } rel="noopener noreferrer" target="_blank" />,
tosLink: <ExternalLink href={ getRedirectUrl( 'wpcom-tos' ) } />,
shareDetailsLink: (
<a
href={ getRedirectUrl( 'jetpack-support-what-data-does-jetpack-sync' ) }
rel="noopener noreferrer"
target="_blank"
/>
<ExternalLink href={ getRedirectUrl( 'jetpack-support-what-data-does-jetpack-sync' ) } />
),
}
);
Expand Down
3 changes: 0 additions & 3 deletions projects/js-packages/components/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
],
"test-js": [
"pnpm run test"
],
"test-coverage": [
"pnpm run test-coverage"
]
},
"repositories": [
Expand Down
5 changes: 2 additions & 3 deletions projects/js-packages/components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@automattic/jetpack-components",
"version": "0.27.7-alpha",
"version": "0.27.8-alpha",
"description": "Jetpack Components Package",
"author": "Automattic",
"license": "GPL-2.0-or-later",
Expand Down Expand Up @@ -61,8 +61,7 @@
"scripts": {
"build": "pnpm run compile-ts",
"compile-ts": "tsc --pretty",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test-coverage": "pnpm run test --coverageDirectory=\"$COVERAGE_DIR\" --coverage --coverageReporters=clover"
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"engines": {
"node": "^18.13.0",
Expand Down
Loading

0 comments on commit b096d87

Please sign in to comment.