From 4d9d20038ecf76af894bc3891ca1147fcaa9d141 Mon Sep 17 00:00:00 2001 From: "Soare Robert Daniel (Mac 2023)" Date: Fri, 21 Jun 2024 17:02:58 +0300 Subject: [PATCH] feat: add E2E test support with `wp-scripts` and Playwright --- .github/workflows/e2e.yml | 50 + .github/workflows/qa-zip.yaml | 16 +- .github/workflows/test-php.yml | 41 +- .gitignore | 12 +- .wp-env.override.json | 11 + README.md | 4 + assets/js/build/tracking/tracking.asset.php | 2 +- assets/js/build/tracking/tracking.js | 2 +- assets/js/src/tracking.js | 10 +- bin/setup-env-e2e.sh | 17 + composer.json | 3 +- composer.lock | 1994 ++++++++++++++++++- docs/E2E.md | 51 + package-lock.json | 1260 +++++++++++- package.json | 14 +- tests/e2e/config/flaky-tests-reporter.js | 84 + tests/e2e/config/global-setup.js | 45 + tests/e2e/playwright.config.js | 60 + tests/e2e/specs/about-us-page.spec.js | 30 + tests/e2e/specs/feature-plugins.spec.js | 21 + tests/e2e/specs/promotions.spec.js | 73 + tests/e2e/specs/rollback.spec.js | 16 + tests/e2e/specs/script-loader.spec.js | 76 + tests/e2e/utils/index.js | 21 + tests/js-unit/tracking.test.js | 99 + 25 files changed, 3761 insertions(+), 251 deletions(-) create mode 100644 .github/workflows/e2e.yml create mode 100644 .wp-env.override.json create mode 100644 bin/setup-env-e2e.sh create mode 100644 docs/E2E.md create mode 100644 tests/e2e/config/flaky-tests-reporter.js create mode 100644 tests/e2e/config/global-setup.js create mode 100644 tests/e2e/playwright.config.js create mode 100644 tests/e2e/specs/about-us-page.spec.js create mode 100644 tests/e2e/specs/feature-plugins.spec.js create mode 100644 tests/e2e/specs/promotions.spec.js create mode 100644 tests/e2e/specs/rollback.spec.js create mode 100644 tests/e2e/specs/script-loader.spec.js create mode 100644 tests/e2e/utils/index.js create mode 100644 tests/js-unit/tracking.test.js diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml new file mode 100644 index 00000000..89e2148f --- /dev/null +++ b/.github/workflows/e2e.yml @@ -0,0 +1,50 @@ +name: Test e2e + +on: + pull_request: + types: [opened, synchronize, ready_for_review] + branches-ignore: + - "update_dependencies" + +concurrency: + group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.ref }} + cancel-in-progress: true +jobs: + e2e: + if: github.event.pull_request.draft == false && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name + name: Playwright E2E tests + strategy: + fail-fast: false + runs-on: ubuntu-22.04 + steps: + - name: Setup PHP version + uses: shivammathur/setup-php@v2 + with: + php-version: "7.4" + extensions: simplexml + - name: Check out source files + uses: actions/checkout@v4 + - name: Install composer deps + run: composer install --no-dev --prefer-dist --no-progress --no-suggest + - name: Install npm deps + run: | + npm ci + npm install -g playwright-cli + npx playwright install --with-deps chromium + - name: Install environment + run: | + cp ./bin/themeisle-sdk.php ./ + npm run wp-env start + - name: Run the tests + run: | + npm run test:e2e:playwright + env: + GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }} + - name: Archive test results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: e2e-playwright-results + path: artifacts + retention-days: 1 + if-no-files-found: ignore diff --git a/.github/workflows/qa-zip.yaml b/.github/workflows/qa-zip.yaml index a1f93adf..7d117039 100644 --- a/.github/workflows/qa-zip.yaml +++ b/.github/workflows/qa-zip.yaml @@ -14,19 +14,13 @@ jobs: branch-name: ${{ steps.retrieve-branch-name.outputs.branch_name }} git-sha-8: ${{ steps.retrieve-git-sha-8.outputs.sha8 }} steps: + - name: Setup PHP version + uses: shivammathur/setup-php@v2 + with: + php-version: "7.4" + extensions: simplexml - name: Check out source files uses: actions/checkout@v2 - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Configure Composer cache - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - name: Install composer deps run: composer install --no-dev --prefer-dist --no-progress --no-suggest - name: Install NPM deps diff --git a/.github/workflows/test-php.yml b/.github/workflows/test-php.yml index c032d5ce..e9c239e5 100644 --- a/.github/workflows/test-php.yml +++ b/.github/workflows/test-php.yml @@ -3,30 +3,19 @@ name: Test PHP on: push: branches-ignore: - - 'master' + - "master" jobs: phplint: name: PHP Lint - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - name: Setup PHP version - uses: shivammathur/setup-php@v1 + uses: shivammathur/setup-php@v2 with: - php-version: '7.2' + php-version: "7.4" extensions: simplexml - name: Checkout source code - uses: actions/checkout@v2 - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Setup Composer cache - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- + uses: actions/checkout@v4 - name: Install composer run: composer install --prefer-dist --no-progress --no-suggest - name: Run PHPCS @@ -34,7 +23,10 @@ jobs: phpunit: name: PHPUnit - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 + strategy: + matrix: + php: [ "7.4", "8.0" ] services: mysql: image: mysql:5.7 @@ -47,25 +39,14 @@ jobs: - name: Setup PHP version uses: shivammathur/setup-php@v2 with: - php-version: '7.2' + php-version: ${{ matrix.php }} extensions: simplexml, mysql tools: phpunit-polyfills - name: Checkout source code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Install WordPress Test Suite run: | bash bin/install-wp-tests.sh wordpress_test root root 127.0.0.1:${{ job.services.mysql.ports['3306'] }} - - name: Get Composer Cache Directory - id: composer-cache - run: | - echo "::set-output name=dir::$(composer config cache-files-dir)" - - name: Setup Composer cache - uses: actions/cache@v1 - with: - path: ${{ steps.composer-cache.outputs.dir }} - key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} - restore-keys: | - ${{ runner.os }}-composer- - name: Install composer run: composer install --prefer-dist --no-progress --no-suggest --no-dev - name: Run phpunit diff --git a/.gitignore b/.gitignore index 830b3e62..7da9cbc0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,11 @@ +.DS_Store .idea -node_modules +.vscode +artifact +artifacts +dist logs +node_modules +themeisle-sdk.php vendor -.DS_Store -dist -artifact \ No newline at end of file +.phpunit.result.cache \ No newline at end of file diff --git a/.wp-env.override.json b/.wp-env.override.json new file mode 100644 index 00000000..9ab7fad5 --- /dev/null +++ b/.wp-env.override.json @@ -0,0 +1,11 @@ +{ + "core": null, + "plugins": [ "." ], + "config": { + "WP_DEBUG": true, + "WP_DEBUG_DISPLAY": true + }, + "lifecycleScripts": { + "afterStart": "bash ./bin/setup-env-e2e.sh" + } +} diff --git a/README.md b/README.md index 44c2726b..940895e2 100644 --- a/README.md +++ b/README.md @@ -28,3 +28,7 @@ and manually autoloading the load.php file in the composer.json file of your pro - The library works out of the box by simply loading the autoloader into the plugin/theme files. - Some modules are loaded only if the product is not available on WordPress.org ( licenser/review ). You can define if the product is available on wordpress.org by adding this file header `WordPress Available: ` where `` will be replaced with the proper status. - If the product requires is a premium one and requires a licesing mechanism, we can use `Requires License: ` to specifically tell that the product requires license. + +### Guides +- [Add and use Telemetry in a product](./docs/TELEMETRY.md) +- [Running and adding an E2E test](./docs/E2E.md) diff --git a/assets/js/build/tracking/tracking.asset.php b/assets/js/build/tracking/tracking.asset.php index 50d9b083..2cc488b0 100644 --- a/assets/js/build/tracking/tracking.asset.php +++ b/assets/js/build/tracking/tracking.asset.php @@ -1 +1 @@ - array(), 'version' => 'b8af0b12ad3cabe4c4b8'); + array(), 'version' => 'f35e2c927fed8015fa08'); diff --git a/assets/js/build/tracking/tracking.js b/assets/js/build/tracking/tracking.js index 677e2b8e..bdc37e05 100644 --- a/assets/js/build/tracking/tracking.js +++ b/assets/js/build/tracking/tracking.js @@ -1 +1 @@ -(()=>{var e={802:e=>{e.exports=function e(t,n,r){function o(s,u){if(!n[s]){if(!t[s]){if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}u=n[s]={exports:{}},t[s][0].call(u.exports,(function(e){return o(t[s][1][e]||e)}),u,u.exports,e,t,n,r)}return n[s].exports}for(var i=void 0,s=0;s>16),a((65280&r)>>8),a(255&r);return 2==o?a(255&(r=f(e.charAt(n))<<2|f(e.charAt(n+1))>>4)):1==o&&(a((r=f(e.charAt(n))<<10|f(e.charAt(n+1))<<4|f(e.charAt(n+2))>>2)>>8&255),a(255&r)),i},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,s="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(i){case 1:s=(s+=u((n=e[e.length-1])>>2))+u(n<<4&63)+"==";break;case 2:s=(s=(s+=u((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+u(n>>4&63))+u(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,o,i,s,u,a,f,l){var c=e("base64-js"),d=e("ieee754");function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var r,i,s,u,a=typeof e;if("base64"===t&&"string"==a)for(e=(u=e).trim?u.trim():u.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==a)r=x(e);else if("string"==a)r=o.byteLength(e,t);else{if("object"!=a)throw new Error("First argument needs to be a number, array or string.");r=x(e.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(r)):((i=this).length=r,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(S(u=e)||o.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(s=0;s>>0)):(t+1>>0),o}function g(e,t,n,r){if(r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(null!=t,"missing offset"),Y(t+1>>8*(r?i:1-i)}function v(e,t,n,r,o){if(o||(Y(null!=t,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(null!=n,"missing offset"),Y(n+3>>8*(r?i:3-i)&255}function _(e,t,n,r,o){o||(Y(null!=t,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(null!=n,"missing offset"),Y(n+1>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}(this,e,t,n);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(e,t,n){var r,o,i,s,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):u.length)===t)return"";switch(e){case"hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||rthis.length&&(r=this.length);var i=(r=e.length-t=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return h(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return h(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return p(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return p(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(Y(null!=e,"missing offset"),Y(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return g(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return g(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return w(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return w(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return b(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return b(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,n){n||(Y(null!=e,"missing value"),Y(null!=t,"missing offset"),Y(t=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,n){m(this,e,t,!0,n)},o.prototype.writeUInt16BE=function(e,t,n){m(this,e,t,!1,n)},o.prototype.writeUInt32LE=function(e,t,n){v(this,e,t,!0,n)},o.prototype.writeUInt32BE=function(e,t,n){v(this,e,t,!1,n)},o.prototype.writeInt8=function(e,t,n){n||(Y(null!=e,"missing value"),Y(null!=t,"missing offset"),Y(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},o.prototype.writeInt16LE=function(e,t,n){_(this,e,t,!0,n)},o.prototype.writeInt16BE=function(e,t,n){_(this,e,t,!1,n)},o.prototype.writeInt32LE=function(e,t,n){E(this,e,t,!0,n)},o.prototype.writeInt32BE=function(e,t,n){E(this,e,t,!1,n)},o.prototype.writeFloatLE=function(e,t,n){I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){A(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){A(this,e,t,!1,n)},o.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,Y("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),Y(t<=n,"end < start"),n!==t&&0!==this.length){Y(0<=t&&t"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function C(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function M(e,t){Y("number"==typeof e,"cannot write a non-number as a number"),Y(0<=e,"specified a negative value for writing an unsigned value"),Y(e<=t,"value is larger than maximum value for type"),Y(Math.floor(e)===e,"value has a fractional component")}function N(e,t,n){Y("number"==typeof e,"cannot write a non-number as a number"),Y(e<=t,"value larger than maximum allowed value"),Y(n<=e,"value smaller than minimum allowed value"),Y(Math.floor(e)===e,"value has a fractional component")}function F(e,t,n){Y("number"==typeof e,"cannot write a non-number as a number"),Y(e<=t,"value larger than maximum allowed value"),Y(n<=e,"value smaller than minimum allowed value")}function Y(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=B.get,e.set=B.set,e.write=B.write,e.toString=B.toString,e.toLocaleString=B.toString,e.toJSON=B.toJSON,e.copy=B.copy,e.slice=B.slice,e.readUInt8=B.readUInt8,e.readUInt16LE=B.readUInt16LE,e.readUInt16BE=B.readUInt16BE,e.readUInt32LE=B.readUInt32LE,e.readUInt32BE=B.readUInt32BE,e.readInt8=B.readInt8,e.readInt16LE=B.readInt16LE,e.readInt16BE=B.readInt16BE,e.readInt32LE=B.readInt32LE,e.readInt32BE=B.readInt32BE,e.readFloatLE=B.readFloatLE,e.readFloatBE=B.readFloatBE,e.readDoubleLE=B.readDoubleLE,e.readDoubleBE=B.readDoubleBE,e.writeUInt8=B.writeUInt8,e.writeUInt16LE=B.writeUInt16LE,e.writeUInt16BE=B.writeUInt16BE,e.writeUInt32LE=B.writeUInt32LE,e.writeUInt32BE=B.writeUInt32BE,e.writeInt8=B.writeInt8,e.writeInt16LE=B.writeInt16LE,e.writeInt16BE=B.writeInt16BE,e.writeInt32LE=B.writeInt32LE,e.writeInt32BE=B.writeInt32BE,e.writeFloatLE=B.writeFloatLE,e.writeFloatBE=B.writeFloatBE,e.writeDoubleLE=B.writeDoubleLE,e.writeDoubleBE=B.writeDoubleBE,e.fill=B.fill,e.inspect=B.inspect,e.toArrayBuffer=B.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,r,o,i,s,u,a,f,l){o=e("buffer").Buffer;var c=new o(4);c.fill(0),t.exports={hash:function(e,t,n,r){for(var i=t(function(e,t){e.length%4!=0&&(n=e.length+(4-e.length%4),e=o.concat([e,c],n));for(var n,r=[],i=t?e.readInt32BE:e.readInt32LE,s=0;sg?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,s=0;s>>32-o,n)}function p(e,t,n,r,o,i,s){return h(t&n|~t&r,e,t,o,i,s)}function g(e,t,n,r,o,i,s){return h(t&r|n&~r,e,t,o,i,s)}function y(e,t,n,r,o,i,s){return h(t^n^r,e,t,o,i,s)}function w(e,t,n,r,o,i,s){return h(n^(t|~r),e,t,o,i,s)}function b(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return c.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,r,o,i,s,u,a,f){t.exports=function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,r,o,i,s,u,a,f,l){var c=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,o,i=Array(80),s=1732584193,u=-271733879,a=-1732584194,f=271733878,l=-1009589776,c=0;c>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<>>32-t}t.exports=function(e){return c.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,r,o,i,s,u,a,f,l){function c(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function d(e,t){var n,r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),o=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),i=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var s,u,a=0;a>>t|e<<32-t},g=function(e,t){return e>>>t};t.exports=function(e){return h.hash(e,d,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,r,o,i,s,u,a,f){n.read=function(e,t,n,r,o){var i,s,u=8*o-r-1,a=(1<>1,l=-7,c=n?o-1:0,d=n?-1:1;for(o=e[t+c],c+=d,i=o&(1<<-l)-1,o>>=-l,l+=u;0>=-l,l+=r;0>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1;for(i=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(t+=1<=s+l?c/r:c*Math.pow(2,1-l))*r&&(s++,r/=2),f<=s+l?(u=0,s=f):1<=s+l?(u=(t*r-1)*Math.pow(2,o),s+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),s=0));8<=o;e[n+d]=255&u,d+=h,u/=256,o-=8);for(s=s<{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(802),t=n.n(e);const r=e=>{var t;const n=e?.filter((e=>e?.[0]))?.[0];return null!==(t=n?.[1])&&void 0!==t?t:n?.[0]};class o{constructor(){this.events=new Map,this.eventsLimit=50,this.listeners=[],this.interval=null,this.consent=!1,this.endpoint=tiTelemetry?.endpoint,this.products=tiTelemetry?.products,this.autoSendIntervalTime=3e5}_set=(e,t,n)=>{if(!this.hasProduct(t.slug))return;if(!n?.consent&&!this.getProductConsent(t.slug))return;if(!this.validate(t))return;const r=n?.directSave?t:this.trkMetadata(t);this.events.set(e,r),n?.refreshTimer&&this.refreshTimer(),n?.sendNow?this.uploadEvents():n?.ignoreLimit||this.sendIfLimitReached()};_add=(e,n)=>{const r=t()(e);return this._set(r.toString(),e,n),r.toString()};with=e=>{const t={slug:e,...this.envInfo()};return{add:(e,n)=>this._add({...t,...e},n),set:(e,n,r)=>this._set(e,{...t,...n},r),base:this}};envInfo=()=>({site:window.location.hostname});uploadEvents=async()=>{if(0!==this.events.size)try{const e=Array.from(this.events.values());this.events.clear();const t=await this.sendBulkTracking(e.map((({slug:e,site:t,license:n,...r})=>({slug:e,site:t,license:n,data:r}))));t.ok||this.listeners.forEach((e=>e({success:!1,error:"Failed to send tracking events"})));const n=await t.json();this.listeners.forEach((e=>e({success:!0,response:n})))}catch(e){console.error(e)}};sendIfLimitReached=()=>{if(this.events.size>=this.eventsLimit)return this.uploadEvents()};subscribe=e=>(this.listeners.push(e),()=>{this.listeners=this.listeners.filter((t=>t!==e))});hasConsent=()=>this.consent;sendBulkTracking=e=>fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});trkMetadata=e=>({env:r([[window.location.href.includes("customize.php"),"customizer"],[window.location.href.includes("site-editor.php"),"site-editor"],[window.location.href.includes("widgets.php"),"widgets"],[window.location.href.includes("admin.php"),"admin"],["post-editor"]]),license:this.getProductTackHash(e.slug),...null!=e?e:{}});hasProduct=e=>this.products.some((t=>t?.slug?.includes(e)));getProductTackHash=e=>this.products.find((t=>t?.slug?.includes(e)))?.trackHash;getProductConsent=e=>this.products.find((t=>t?.slug?.includes(e)))?.consent;start=()=>{this.interval||(this.interval=window.setInterval((()=>{this.uploadEvents()}),this.autoSendIntervalTime))};stop=()=>{this.interval&&(window.clearInterval(this.interval),this.interval=null)};refreshTimer=()=>{this.stop(),this.start()};validate=e=>"object"==typeof e?0!==Object.keys(e).length&&Object.values(e).every(this.validate):void 0!==e;clone=()=>{const e=new o;return e.events=new Map(this.events),e.listeners=[...this.listeners],e.interval=this.interval,e.consent=this.consent,e.endpoint=this.endpoint,e}}window.tiTrk=new o,window?.wp?.customize?.bind("save",(()=>{window?.tiTrk?.uploadEvents()})),window.addEventListener("beforeunload",(async()=>{window?.tiTrk?.uploadEvents()}))})()})(); \ No newline at end of file +(()=>{var e={802:e=>{e.exports=function e(t,n,r){function o(s,u){if(!n[s]){if(!t[s]){if(i)return i(s,!0);throw new Error("Cannot find module '"+s+"'")}u=n[s]={exports:{}},t[s][0].call(u.exports,(function(e){return o(t[s][1][e]||e)}),u,u.exports,e,t,n,r)}return n[s].exports}for(var i=void 0,s=0;s>16),a((65280&r)>>8),a(255&r);return 2==o?a(255&(r=f(e.charAt(n))<<2|f(e.charAt(n+1))>>4)):1==o&&(a((r=f(e.charAt(n))<<10|f(e.charAt(n+1))<<4|f(e.charAt(n+2))>>2)>>8&255),a(255&r)),i},e.fromByteArray=function(e){var t,n,r,o,i=e.length%3,s="";function u(e){return"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(e)}for(t=0,r=e.length-i;t>18&63)+u(o>>12&63)+u(o>>6&63)+u(63&o);switch(i){case 1:s=(s+=u((n=e[e.length-1])>>2))+u(n<<4&63)+"==";break;case 2:s=(s=(s+=u((n=(e[e.length-2]<<8)+e[e.length-1])>>10))+u(n>>4&63))+u(n<<2&63)+"="}return s}}(void 0===n?this.base64js={}:n)}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/base64-js/lib/b64.js","/node_modules/gulp-browserify/node_modules/base64-js/lib")},{buffer:3,lYpoI2:11}],3:[function(e,t,n){(function(t,r,o,i,s,u,a,f,l){var c=e("base64-js"),d=e("ieee754");function o(e,t,n){if(!(this instanceof o))return new o(e,t,n);var r,i,s,u,a=typeof e;if("base64"===t&&"string"==a)for(e=(u=e).trim?u.trim():u.replace(/^\s+|\s+$/g,"");e.length%4!=0;)e+="=";if("number"==a)r=x(e);else if("string"==a)r=o.byteLength(e,t);else{if("object"!=a)throw new Error("First argument needs to be a number, array or string.");r=x(e.length)}if(o._useTypedArrays?i=o._augment(new Uint8Array(r)):((i=this).length=r,i._isBuffer=!0),o._useTypedArrays&&"number"==typeof e.byteLength)i._set(e);else if(S(u=e)||o.isBuffer(u)||u&&"object"==typeof u&&"number"==typeof u.length)for(s=0;s>>0)):(t+1>>0),o}function g(e,t,n,r){if(r||(Y("boolean"==typeof n,"missing or invalid endian"),Y(null!=t,"missing offset"),Y(t+1>>8*(r?i:1-i)}function v(e,t,n,r,o){if(o||(Y(null!=t,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(null!=n,"missing offset"),Y(n+3>>8*(r?i:3-i)&255}function _(e,t,n,r,o){o||(Y(null!=t,"missing value"),Y("boolean"==typeof r,"missing or invalid endian"),Y(null!=n,"missing offset"),Y(n+1>8,n%=256,r.push(n),r.push(t);return r}(t),e,n,r)}(this,e,t,n);break;default:throw new Error("Unknown encoding")}return i},o.prototype.toString=function(e,t,n){var r,o,i,s,u=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,(n=void 0!==n?Number(n):u.length)===t)return"";switch(e){case"hex":r=function(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||rthis.length&&(r=this.length);var i=(r=e.length-t=this.length))return this[e]},o.prototype.readUInt16LE=function(e,t){return h(this,e,!0,t)},o.prototype.readUInt16BE=function(e,t){return h(this,e,!1,t)},o.prototype.readUInt32LE=function(e,t){return p(this,e,!0,t)},o.prototype.readUInt32BE=function(e,t){return p(this,e,!1,t)},o.prototype.readInt8=function(e,t){if(t||(Y(null!=e,"missing offset"),Y(e=this.length))return 128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){return g(this,e,!0,t)},o.prototype.readInt16BE=function(e,t){return g(this,e,!1,t)},o.prototype.readInt32LE=function(e,t){return y(this,e,!0,t)},o.prototype.readInt32BE=function(e,t){return y(this,e,!1,t)},o.prototype.readFloatLE=function(e,t){return w(this,e,!0,t)},o.prototype.readFloatBE=function(e,t){return w(this,e,!1,t)},o.prototype.readDoubleLE=function(e,t){return b(this,e,!0,t)},o.prototype.readDoubleBE=function(e,t){return b(this,e,!1,t)},o.prototype.writeUInt8=function(e,t,n){n||(Y(null!=e,"missing value"),Y(null!=t,"missing offset"),Y(t=this.length||(this[t]=e)},o.prototype.writeUInt16LE=function(e,t,n){m(this,e,t,!0,n)},o.prototype.writeUInt16BE=function(e,t,n){m(this,e,t,!1,n)},o.prototype.writeUInt32LE=function(e,t,n){v(this,e,t,!0,n)},o.prototype.writeUInt32BE=function(e,t,n){v(this,e,t,!1,n)},o.prototype.writeInt8=function(e,t,n){n||(Y(null!=e,"missing value"),Y(null!=t,"missing offset"),Y(t=this.length||(0<=e?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},o.prototype.writeInt16LE=function(e,t,n){_(this,e,t,!0,n)},o.prototype.writeInt16BE=function(e,t,n){_(this,e,t,!1,n)},o.prototype.writeInt32LE=function(e,t,n){E(this,e,t,!0,n)},o.prototype.writeInt32BE=function(e,t,n){E(this,e,t,!1,n)},o.prototype.writeFloatLE=function(e,t,n){I(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){I(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){A(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){A(this,e,t,!1,n)},o.prototype.fill=function(e,t,n){if(t=t||0,n=n||this.length,Y("number"==typeof(e="string"==typeof(e=e||0)?e.charCodeAt(0):e)&&!isNaN(e),"value is not a number"),Y(t<=n,"end < start"),n!==t&&0!==this.length){Y(0<=t&&t"},o.prototype.toArrayBuffer=function(){if("undefined"==typeof Uint8Array)throw new Error("Buffer.toArrayBuffer not supported in this browser");if(o._useTypedArrays)return new o(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;t=t.length||o>=e.length);o++)t[o+n]=e[o];return o}function C(e){try{return decodeURIComponent(e)}catch(e){return String.fromCharCode(65533)}}function M(e,t){Y("number"==typeof e,"cannot write a non-number as a number"),Y(0<=e,"specified a negative value for writing an unsigned value"),Y(e<=t,"value is larger than maximum value for type"),Y(Math.floor(e)===e,"value has a fractional component")}function N(e,t,n){Y("number"==typeof e,"cannot write a non-number as a number"),Y(e<=t,"value larger than maximum allowed value"),Y(n<=e,"value smaller than minimum allowed value"),Y(Math.floor(e)===e,"value has a fractional component")}function F(e,t,n){Y("number"==typeof e,"cannot write a non-number as a number"),Y(e<=t,"value larger than maximum allowed value"),Y(n<=e,"value smaller than minimum allowed value")}function Y(e,t){if(!e)throw new Error(t||"Failed assertion")}o._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=B.get,e.set=B.set,e.write=B.write,e.toString=B.toString,e.toLocaleString=B.toString,e.toJSON=B.toJSON,e.copy=B.copy,e.slice=B.slice,e.readUInt8=B.readUInt8,e.readUInt16LE=B.readUInt16LE,e.readUInt16BE=B.readUInt16BE,e.readUInt32LE=B.readUInt32LE,e.readUInt32BE=B.readUInt32BE,e.readInt8=B.readInt8,e.readInt16LE=B.readInt16LE,e.readInt16BE=B.readInt16BE,e.readInt32LE=B.readInt32LE,e.readInt32BE=B.readInt32BE,e.readFloatLE=B.readFloatLE,e.readFloatBE=B.readFloatBE,e.readDoubleLE=B.readDoubleLE,e.readDoubleBE=B.readDoubleBE,e.writeUInt8=B.writeUInt8,e.writeUInt16LE=B.writeUInt16LE,e.writeUInt16BE=B.writeUInt16BE,e.writeUInt32LE=B.writeUInt32LE,e.writeUInt32BE=B.writeUInt32BE,e.writeInt8=B.writeInt8,e.writeInt16LE=B.writeInt16LE,e.writeInt16BE=B.writeInt16BE,e.writeInt32LE=B.writeInt32LE,e.writeInt32BE=B.writeInt32BE,e.writeFloatLE=B.writeFloatLE,e.writeFloatBE=B.writeFloatBE,e.writeDoubleLE=B.writeDoubleLE,e.writeDoubleBE=B.writeDoubleBE,e.fill=B.fill,e.inspect=B.inspect,e.toArrayBuffer=B.toArrayBuffer,e}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/buffer/index.js","/node_modules/gulp-browserify/node_modules/buffer")},{"base64-js":2,buffer:3,ieee754:10,lYpoI2:11}],4:[function(e,t,n){(function(n,r,o,i,s,u,a,f,l){o=e("buffer").Buffer;var c=new o(4);c.fill(0),t.exports={hash:function(e,t,n,r){for(var i=t(function(e,t){e.length%4!=0&&(n=e.length+(4-e.length%4),e=o.concat([e,c],n));for(var n,r=[],i=t?e.readInt32BE:e.readInt32LE,s=0;sg?t=e(t):t.length>5]|=128<>>9<<4)]=t;for(var n=1732584193,r=-271733879,o=-1732584194,i=271733878,s=0;s>>32-o,n)}function p(e,t,n,r,o,i,s){return h(t&n|~t&r,e,t,o,i,s)}function g(e,t,n,r,o,i,s){return h(t&r|n&~r,e,t,o,i,s)}function y(e,t,n,r,o,i,s){return h(t^n^r,e,t,o,i,s)}function w(e,t,n,r,o,i,s){return h(n^(t|~r),e,t,o,i,s)}function b(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}t.exports=function(e){return c.hash(e,d,16)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/md5.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],7:[function(e,t,n){(function(e,n,r,o,i,s,u,a,f){t.exports=function(e){for(var t,n=new Array(e),r=0;r>>((3&r)<<3)&255;return n}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/rng.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{buffer:3,lYpoI2:11}],8:[function(e,t,n){(function(n,r,o,i,s,u,a,f,l){var c=e("./helpers");function d(e,t){e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var n,r,o,i=Array(80),s=1732584193,u=-271733879,a=-1732584194,f=271733878,l=-1009589776,c=0;c>16)+(t>>16)+(n>>16)<<16|65535&n}function p(e,t){return e<>>32-t}t.exports=function(e){return c.hash(e,d,20,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],9:[function(e,t,n){(function(n,r,o,i,s,u,a,f,l){function c(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}function d(e,t){var n,r=new Array(1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298),o=new Array(1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225),i=new Array(64);e[t>>5]|=128<<24-t%32,e[15+(t+64>>9<<4)]=t;for(var s,u,a=0;a>>t|e<<32-t},g=function(e,t){return e>>>t};t.exports=function(e){return h.hash(e,d,32,!0)}}).call(this,e("lYpoI2"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},e("buffer").Buffer,arguments[3],arguments[4],arguments[5],arguments[6],"/node_modules/gulp-browserify/node_modules/crypto-browserify/sha256.js","/node_modules/gulp-browserify/node_modules/crypto-browserify")},{"./helpers":4,buffer:3,lYpoI2:11}],10:[function(e,t,n){(function(e,t,r,o,i,s,u,a,f){n.read=function(e,t,n,r,o){var i,s,u=8*o-r-1,a=(1<>1,l=-7,c=n?o-1:0,d=n?-1:1;for(o=e[t+c],c+=d,i=o&(1<<-l)-1,o>>=-l,l+=u;0>=-l,l+=r;0>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,h=r?1:-1;for(i=t<0||0===t&&1/t<0?1:0,t=Math.abs(t),isNaN(t)||t===1/0?(u=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(t+=1<=s+l?c/r:c*Math.pow(2,1-l))*r&&(s++,r/=2),f<=s+l?(u=0,s=f):1<=s+l?(u=(t*r-1)*Math.pow(2,o),s+=l):(u=t*Math.pow(2,l-1)*Math.pow(2,o),s=0));8<=o;e[n+d]=255&u,d+=h,u/=256,o-=8);for(s=s<{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e=n(802),t=n.n(e);const r=e=>{var t;const n=e?.filter((e=>e?.[0]))?.[0];return null!==(t=n?.[1])&&void 0!==t?t:n?.[0]};class o{constructor(e){var t;null!==(t=e)&&void 0!==t||(e={}),this.events=new Map,this.eventsLimit=50,this.listeners=[],this.interval=null,this.consent=!1,this.endpoint=e?.endpoint,this.products=e?.products,this.autoSendIntervalTime=3e5}_set=(e,t,n)=>{if(!this.hasProduct(t.slug))return;if(!n?.consent&&!this.getProductConsent(t.slug))return;if(!this.validate(t))return;const r=n?.directSave?t:this.trkMetadata(t);this.events.set(e,r),n?.refreshTimer&&this.refreshTimer(),n?.sendNow?this.uploadEvents():n?.ignoreLimit||this.sendIfLimitReached()};_add=(e,n)=>{const r=t()(e);return this._set(r.toString(),e,n),r.toString()};with=e=>{const t={slug:e,...this.envInfo()};return{add:(e,n)=>this._add({...t,...e},n),set:(e,n,r)=>this._set(e,{...t,...n},r),base:this}};envInfo=()=>({site:window.location.hostname});uploadEvents=async()=>{if(0!==this.events.size)try{const e=Array.from(this.events.values());this.events.clear();const t=await this.sendBulkTracking(e.map((({slug:e,site:t,license:n,...r})=>({slug:e,site:t,license:n,data:r}))));t.ok||this.listeners.forEach((e=>e({success:!1,error:"Failed to send tracking events"})));const n=await t.json();this.listeners.forEach((e=>e({success:!0,response:n})))}catch(e){console.error(e)}};sendIfLimitReached=()=>{if(this.events.size>=this.eventsLimit)return this.uploadEvents()};subscribe=e=>(this.listeners.push(e),()=>{this.listeners=this.listeners.filter((t=>t!==e))});hasConsent=()=>this.consent;sendBulkTracking=e=>fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});trkMetadata=e=>({env:r([[window.location.href.includes("customize.php"),"customizer"],[window.location.href.includes("site-editor.php"),"site-editor"],[window.location.href.includes("widgets.php"),"widgets"],[window.location.href.includes("admin.php"),"admin"],["post-editor"]]),license:this.getProductTackHash(e.slug),...null!=e?e:{}});hasProduct=e=>this.products.some((t=>t?.slug?.includes(e)));getProductTackHash=e=>this.products.find((t=>t?.slug?.includes(e)))?.trackHash;getProductConsent=e=>this.products.find((t=>t?.slug?.includes(e)))?.consent;start=()=>{this.interval||(this.interval=window.setInterval((()=>{this.uploadEvents()}),this.autoSendIntervalTime))};stop=()=>{this.interval&&(window.clearInterval(this.interval),this.interval=null)};refreshTimer=()=>{this.stop(),this.start()};validate=e=>"object"==typeof e?0!==Object.keys(e).length&&Object.values(e).every(this.validate):void 0!==e;clone=()=>{const e=new o;return e.events=new Map(this.events),e.listeners=[...this.listeners],e.interval=this.interval,e.consent=this.consent,e.endpoint=this.endpoint,e}}window.tiTrk=new o(window?.tiTelemetry),window?.wp?.customize?.bind("save",(()=>{window?.tiTrk?.uploadEvents()})),window.addEventListener("beforeunload",(async()=>{window?.tiTrk?.uploadEvents()}))})()})(); \ No newline at end of file diff --git a/assets/js/src/tracking.js b/assets/js/src/tracking.js index 4946ffc8..06069526 100644 --- a/assets/js/src/tracking.js +++ b/assets/js/src/tracking.js @@ -49,8 +49,10 @@ export const getChoice = arr => { * @property {boolean} [ignoreLimit] - Ignore the limit of the events to be send. */ -class EventTrackingAccumulator { - constructor() { +export class EventTrackingAccumulator { + constructor( tiTelemetry ) { + + tiTelemetry ??= {} /** * @type {Map} - The events to be sent. @@ -180,11 +182,9 @@ class EventTrackingAccumulator { * Send all the events in the accumulator. Clears the accumulator after sending. All the listeners will be notified. */ uploadEvents = async() => { - if ( 0 === this.events.size ) { return; } - try { const events = Array.from( this.events.values() ); this.events.clear(); @@ -366,7 +366,7 @@ class EventTrackingAccumulator { } // Initialize the accumulator. -window.tiTrk = new EventTrackingAccumulator(); +window.tiTrk = new EventTrackingAccumulator( window?.tiTelemetry ); // Send the events on save for the customizer. window?.wp?.customize?.bind( 'save', () => { diff --git a/bin/setup-env-e2e.sh b/bin/setup-env-e2e.sh new file mode 100644 index 00000000..0c51fed3 --- /dev/null +++ b/bin/setup-env-e2e.sh @@ -0,0 +1,17 @@ +echo "Setting up environment for e2e tests" + +echo "* The working directory is: $(pwd)" + +echo "[1] Transform into a plugin" +if [ ! -f "./themeisle-sdk.php" ]; then + cp ./bin/themeisle-sdk.php ./ +else + echo "[Skip] The plugin file already exists" +fi + +echo "[2] Activate Visualizer tracking" +npm run wp-env run tests-cli wp option set visualizer_logger_flag "yes" + +echo "[3] Install plugins" +npm run wp-env run tests-cli wp plugin install visualizer +npm run wp-env run tests-cli wp plugin activate visualizer \ No newline at end of file diff --git a/composer.json b/composer.json index 4e338245..ba439afa 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,8 @@ ], "version": "3.3.29", "require-dev": { - "codeinwp/phpcs-ruleset": "dev-main" + "codeinwp/phpcs-ruleset": "dev-main", + "yoast/phpunit-polyfills": "^2.0" }, "scripts": { "format": "phpcbf --standard=phpcs.xml --report-summary --report-source -s --runtime-set testVersion 7.2- ", diff --git a/composer.lock b/composer.lock index 68564733..c0527747 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e7963668ca76fb5c6e8ccccd4335bcdc", + "content-hash": "e9fc1a362f3d764130716579f8bc99bd", "packages": [], "packages-dev": [ { @@ -165,177 +165,1868 @@ }, "time": "2020-12-07T18:04:37+00:00" }, + { + "name": "doctrine/instantiator", + "version": "1.5.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/0a0fa9780f5d4e507415a065172d26a98d02047b", + "reference": "0a0fa9780f5d4e507415a065172d26a98d02047b", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^0.16 || ^1", + "phpstan/phpstan": "^1.4", + "phpstan/phpstan-phpunit": "^1", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.5", + "vimeo/psalm": "^4.30 || ^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/1.5.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:15:36+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2024-06-12T14:39:25+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.1.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "reference": "683130c2ff8c2739f4822ff7ac5c873ec529abd1", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.1.0" + }, + "time": "2024-07-01T20:03:41+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, { "name": "phpcompatibility/php-compatibility", "version": "9.3.5", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "homepage": "https://github.com/wimg", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "homepage": "https://github.com/jrfnl", + "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, + "time": "2019-12-27T09:44:58+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-paragonie", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", + "reference": "ddabec839cc003651f2ce695c938686d1086cf43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43", + "reference": "ddabec839cc003651f2ce695c938686d1086cf43", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "paragonie/random_compat": "dev-master", + "paragonie/sodium_compat": "dev-master" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "paragonie", + "phpcs", + "polyfill", + "standards" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, + "time": "2021-02-15T10:24:51+00:00" + }, + { + "name": "phpcompatibility/phpcompatibility-wp", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", + "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", + "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", + "shasum": "" + }, + "require": { + "phpcompatibility/php-compatibility": "^9.0", + "phpcompatibility/phpcompatibility-paragonie": "^1.0" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0-or-later" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "lead" + } + ], + "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", + "homepage": "http://phpcompatibility.com/", + "keywords": [ + "compatibility", + "phpcs", + "standards", + "wordpress" + ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "time": "2021-02-15T12:58:46+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.31", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/48c34b5d8d983006bd2adc2d0de92963b9155965", + "reference": "48c34b5d8d983006bd2adc2d0de92963b9155965", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.3", + "phpunit/php-text-template": "^2.0.2", + "sebastian/code-unit-reverse-lookup": "^2.0.2", + "sebastian/complexity": "^2.0", + "sebastian/environment": "^5.1.2", + "sebastian/lines-of-code": "^1.0.3", + "sebastian/version": "^3.0.1", + "theseer/tokenizer": "^1.2.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.31" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:37:42+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.20", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "49d7820565836236411f5dc002d16dd689cde42f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/49d7820565836236411f5dc002d16dd689cde42f", + "reference": "49d7820565836236411f5dc002d16dd689cde42f", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.31", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.8", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.6", + "sebastian/global-state": "^5.0.7", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.20" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2024-07-10T11:45:39+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/fa0f136dd2334583309d32b62544682ee972b51a", + "reference": "fa0f136dd2334583309d32b62544682ee972b51a", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2022-09-14T12:41:17+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/78c00df8f170e02473b682df15bfcdacc3d32d72", + "reference": "78c00df8f170e02473b682df15bfcdacc3d32d72", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:33:00+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.7", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "reference": "bca7df1f32ee6fe93b4d4a9abbf69e13a4ada2c9", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.7" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:35:11+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", - "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", "shasum": "" }, "require": { - "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.3 || ^3.0.2" + "php": ">=7.3" }, - "conflict": { - "squizlabs/php_codesniffer": "2.6.2" + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "reference": "e75bd0f07204fec2a0af9b0f3cfe97d05f92efc1", + "shasum": "" + }, + "require": { + "php": ">=7.3" }, "require-dev": { - "phpunit/phpunit": "~4.5 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^9.3" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", - "homepage": "https://github.com/wimg", - "role": "lead" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" }, { - "name": "Juliette Reinders Folmer", - "homepage": "https://github.com/jrfnl", - "role": "lead" + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" }, { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" + "name": "Adam Harvey", + "email": "aharvey@php.net" } ], - "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", - "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", - "keywords": [ - "compatibility", - "phpcs", - "standards" - ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibility" + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.5" }, - "time": "2019-12-27T09:44:58+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:07:39+00:00" }, { - "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.1", + "name": "sebastian/resource-operations", + "version": "3.0.4", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/ddabec839cc003651f2ce695c938686d1086cf43", - "reference": "ddabec839cc003651f2ce695c938686d1086cf43", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0" + "php": ">=7.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", - "paragonie/random_compat": "dev-master", - "paragonie/sodium_compat": "dev-master" + "phpunit/phpunit": "^9.0" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", - "role": "lead" - }, - { - "name": "Juliette Reinders Folmer", - "role": "lead" + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" } ], - "description": "A set of rulesets for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by the Paragonie polyfill libraries.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "paragonie", - "phpcs", - "polyfill", - "standards" - ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" }, - "time": "2021-02-15T10:24:51+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" }, { - "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.1", + "name": "sebastian/type", + "version": "3.2.1", "source": { "type": "git", - "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e" + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", - "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", "shasum": "" }, "require": { - "phpcompatibility/php-compatibility": "^9.0", - "phpcompatibility/phpcompatibility-paragonie": "^1.0" + "php": ">=7.3" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + "phpunit/phpunit": "^9.5" }, - "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", - "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] }, - "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ - "LGPL-3.0-or-later" + "BSD-3-Clause" ], "authors": [ { - "name": "Wim Godden", + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", "role": "lead" - }, + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ { - "name": "Juliette Reinders Folmer", - "role": "lead" + "url": "https://github.com/sebastianbergmann", + "type": "github" } ], - "description": "A ruleset for PHP_CodeSniffer to check for PHP cross-version compatibility issues in projects, while accounting for polyfills provided by WordPress.", - "homepage": "http://phpcompatibility.com/", - "keywords": [ - "compatibility", - "phpcs", - "standards", - "wordpress" + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", "support": { - "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", - "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" }, - "time": "2021-02-15T12:58:46+00:00" + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" }, { "name": "sirbrillig/phpcs-variable-analysis", @@ -446,6 +2137,56 @@ }, "time": "2020-10-23T02:01:07+00:00" }, + { + "name": "theseer/tokenizer", + "version": "1.2.3", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:36:25+00:00" + }, { "name": "wp-coding-standards/wpcs", "version": "2.3.0", @@ -570,6 +2311,69 @@ "source": "https://github.com/WPTRT/WPThemeReview" }, "time": "2019-11-17T20:05:55+00:00" + }, + { + "name": "yoast/phpunit-polyfills", + "version": "2.0.1", + "source": { + "type": "git", + "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", + "reference": "4a088f125c970d6d6ea52c927f96fe39b330d0f1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/4a088f125c970d6d6ea52c927f96fe39b330d0f1", + "reference": "4a088f125c970d6d6ea52c927f96fe39b330d0f1", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "phpunit/phpunit": "^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0 || ^10.0" + }, + "require-dev": { + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.1.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "2.x-dev" + } + }, + "autoload": { + "files": [ + "phpunitpolyfills-autoload.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Team Yoast", + "email": "support@yoast.com", + "homepage": "https://yoast.com" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills/graphs/contributors" + } + ], + "description": "Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests", + "homepage": "https://github.com/Yoast/PHPUnit-Polyfills", + "keywords": [ + "phpunit", + "polyfill", + "testing" + ], + "support": { + "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", + "source": "https://github.com/Yoast/PHPUnit-Polyfills" + }, + "time": "2024-04-05T16:36:44+00:00" } ], "aliases": [], @@ -581,5 +2385,5 @@ "prefer-lowest": false, "platform": [], "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.6.0" } diff --git a/docs/E2E.md b/docs/E2E.md new file mode 100644 index 00000000..cc2c6352 --- /dev/null +++ b/docs/E2E.md @@ -0,0 +1,51 @@ +## E2E Testing using Playwright + +### How to run the E2E tests + +To run the E2E tests you will to install playwright using the following command: + +```bash +npx playwright install +``` + +> [!NOTE] +> You also need to use Node.js 18 or later, along with Docker and Docker. + +Create the testing instance using the following command: + +```bash +npm run wp-env start +``` + +This will create a WordPress instance. The port is `8889` and the user is `admin` and the password is `password` (the same values used by `wp-env` testing instance). + +> [!NOTE] +> Read more about `wp-env` [here](https://github.com/WordPress/gutenberg/tree/HEAD/packages/env#readme) + +For the _headless_ mode, use the following command: + +```bash +npm run test:e2e:playwright +``` + +For _debug_ mode (which will open the browser along with Playwright Editor), use the following command: + +```bash +npm run test:e2e:playwright:debug +``` + +> [!NOTE] +> When writing a test, using the debug mode is recommended since it will allow you to see the browser and the test in action. + +### Learn more about E2E testing + +Resources: + +- [Playwright Documentation](https://playwright.dev/docs/intro) +- https://github.com/WordPress/gutenberg/blob/trunk/packages/e2e-test-utils-playwright/README.md +- https://developer.wordpress.org/block-editor/contributors/code/testing-overview/ + +To see more examples of E2E tests, check the Gutenberg repository: https://github.com/WordPress/gutenberg/tree/trunk/test/e2e + +> [!NOTE] +> If you are out of ideas on who to test, check the Gutenberg repository. It has a lot of examples of E2E tests that you can use as a reference. diff --git a/package-lock.json b/package-lock.json index 220cb901..1c8b77d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "themeisle-sdk", - "version": "3.3.20", + "version": "3.3.29", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "themeisle-sdk", - "version": "3.3.20", + "version": "3.3.29", "dependencies": { "@formbricks/js": "^2.0.0", "object-hash": "^3.0.0" @@ -15,12 +15,15 @@ "@semantic-release/changelog": "^5.0.0", "@semantic-release/exec": "^5.0.0", "@semantic-release/git": "^9.0.0", + "@wordpress/e2e-test-utils-playwright": "^1.8.0", + "@wordpress/env": "^10.8.0", "@wordpress/postcss-plugins-preset": "^4.17.0", "@wordpress/scripts": "^27.8.0", "conventional-changelog-simple-preset": "^1.0.20", "eslint-config-wordpress": "^2.0.0", "grunt-version": "^1.3.1", "npm-run-all": "^4.1.5", + "playwright": "^1.47.2", "postcss-combine-media-query": "^1.0.1", "postcss-custom-media": "^9.1.3", "postcss-sort-media-queries": "^5.1.0", @@ -3047,6 +3050,21 @@ "@jridgewell/sourcemap-codec": "^1.4.14" } }, + "node_modules/@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "dev": true, + "dependencies": { + "debug": "^4.1.1" + } + }, + "node_modules/@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", + "dev": true + }, "node_modules/@leichtgewicht/ip-codec": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz", @@ -3275,6 +3293,53 @@ "node": ">=16" } }, + "node_modules/@playwright/test/node_modules/fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "peer": true, + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/@playwright/test/node_modules/playwright": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.0.tgz", + "integrity": "sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==", + "dev": true, + "peer": true, + "dependencies": { + "playwright-core": "1.44.0" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "fsevents": "2.3.2" + } + }, + "node_modules/@playwright/test/node_modules/playwright-core": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.0.tgz", + "integrity": "sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ==", + "dev": true, + "peer": true, + "bin": { + "playwright-core": "cli.js" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@pmmmwh/react-refresh-webpack-plugin": { "version": "0.5.13", "resolved": "https://registry.npmjs.org/@pmmmwh/react-refresh-webpack-plugin/-/react-refresh-webpack-plugin-0.5.13.tgz", @@ -3886,6 +3951,18 @@ "integrity": "sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==", "dev": true }, + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", + "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" + } + }, "node_modules/@sinonjs/commons": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.1.tgz", @@ -4249,6 +4326,18 @@ "url": "https://github.com/sponsors/gregberge" } }, + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", + "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "dev": true, + "dependencies": { + "defer-to-connect": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/@tannin/compile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@tannin/compile/-/compile-1.1.0.tgz", @@ -4364,6 +4453,18 @@ "@types/node": "*" } }, + "node_modules/@types/cacheable-request": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.3.tgz", + "integrity": "sha512-IQ3EbTzGxIigb1I3qPZc1rWJnH0BmSKv5QYTalEwweFvyBDLSAe24zP0le/hyi7ecGfZVlIVAg4BZqb8WBwKqw==", + "dev": true, + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "^3.1.4", + "@types/node": "*", + "@types/responselike": "^1.0.0" + } + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", @@ -4452,6 +4553,12 @@ "@types/node": "*" } }, + "node_modules/@types/http-cache-semantics": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz", + "integrity": "sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA==", + "dev": true + }, "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", @@ -4514,6 +4621,15 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/keyv": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", + "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", @@ -4574,6 +4690,15 @@ "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", "dev": true }, + "node_modules/@types/responselike": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.3.tgz", + "integrity": "sha512-H/+L+UkTV33uf49PH5pCAUBVPNj2nDBXTN+qS1dOwyyg24l3CcicicCA7ca+HMvJBZcFgl5r8e+RR6elsb4Lyw==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/retry": { "version": "0.12.0", "resolved": "https://registry.npmjs.org/@types/retry/-/retry-0.12.0.tgz", @@ -5202,20 +5327,6 @@ } } }, - "node_modules/@wordpress/api-fetch": { - "version": "6.54.0", - "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.54.0.tgz", - "integrity": "sha512-nBiMUr57dWFmjw1ZmgVwng6PzNjPNHXpCyODYwJNmErl95zcsVKwVANzrT3R/oCmeDEomy+vRBWJN8TxsnpDjg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.57.0", - "@wordpress/url": "^3.58.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@wordpress/babel-plugin-import-jsx-pragma": { "version": "4.40.0", "resolved": "https://registry.npmjs.org/@wordpress/babel-plugin-import-jsx-pragma/-/babel-plugin-import-jsx-pragma-4.40.0.tgz", @@ -5282,28 +5393,231 @@ } }, "node_modules/@wordpress/e2e-test-utils-playwright": { - "version": "0.25.0", - "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.25.0.tgz", - "integrity": "sha512-6KhYvOeCjiwGqb6V2pc8pdzIaee9annctrpoBBCZDC+LOeW+8DLKZeQYAn9CV3Lmeq1Pxn+9dvHsaV/4+nSHBg==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-1.8.0.tgz", + "integrity": "sha512-/BzX6NujT8S3Ogj379Cnp1LsURFeyksnXz9jd9rK0KB9PhqPU0O3jmkt1Ugcs9jttOtANSvaBJqYC9W7kZuoNQ==", "dev": true, + "license": "GPL-2.0-or-later", "dependencies": { - "@wordpress/api-fetch": "^6.54.0", - "@wordpress/keycodes": "^3.57.0", - "@wordpress/url": "^3.58.0", "change-case": "^4.1.2", "form-data": "^4.0.0", "get-port": "^5.1.1", "lighthouse": "^10.4.0", "mime": "^3.0.0", - "web-vitals": "^3.5.0" + "web-vitals": "^4.2.1" }, "engines": { - "node": ">=12" + "node": ">=18.12.0", + "npm": ">=8.19.2" }, "peerDependencies": { "@playwright/test": ">=1" } }, + "node_modules/@wordpress/e2e-test-utils-playwright/node_modules/web-vitals": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-4.2.3.tgz", + "integrity": "sha512-/CFAm1mNxSmOj6i0Co+iGFJ58OS4NRGVP+AWS/l509uIK5a1bSoIVaHz/ZumpHTfHSZBpgrJ+wjfpAOrTHok5Q==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/@wordpress/env": { + "version": "10.8.0", + "resolved": "https://registry.npmjs.org/@wordpress/env/-/env-10.8.0.tgz", + "integrity": "sha512-kU66r7y/3AnUd6D4XeWE7h6bVJmzteTKDMMWoIoJsSNI5YP/BmXRa+/dJ4bwk0KFKxfh3tcRBhearGeEa4TGBw==", + "dev": true, + "license": "GPL-2.0-or-later", + "dependencies": { + "chalk": "^4.0.0", + "copy-dir": "^1.3.0", + "docker-compose": "^0.24.3", + "extract-zip": "^1.6.7", + "got": "^11.8.5", + "inquirer": "^7.1.0", + "js-yaml": "^3.13.1", + "ora": "^4.0.2", + "rimraf": "^3.0.2", + "simple-git": "^3.5.0", + "terminal-link": "^2.0.0", + "yargs": "^17.3.0" + }, + "bin": { + "wp-env": "bin/wp-env" + }, + "engines": { + "node": ">=18.12.0", + "npm": ">=8.19.2" + } + }, + "node_modules/@wordpress/env/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@wordpress/env/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@wordpress/env/node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/env/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@wordpress/env/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/@wordpress/env/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/@wordpress/env/node_modules/extract-zip": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-1.7.0.tgz", + "integrity": "sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA==", + "dev": true, + "dependencies": { + "concat-stream": "^1.6.2", + "debug": "^2.6.9", + "mkdirp": "^0.5.4", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + } + }, + "node_modules/@wordpress/env/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wordpress/env/node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/@wordpress/env/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "dev": true + }, + "node_modules/@wordpress/env/node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@wordpress/env/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@wordpress/env/node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "dev": true, + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/env/node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "dev": true, + "engines": { + "node": ">=12" + } + }, "node_modules/@wordpress/eslint-plugin": { "version": "18.0.0", "resolved": "https://registry.npmjs.org/@wordpress/eslint-plugin/-/eslint-plugin-18.0.0.tgz", @@ -5374,44 +5688,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@wordpress/hooks": { - "version": "3.57.0", - "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.57.0.tgz", - "integrity": "sha512-+RaPsTj80QNUw3RfiMhxIzaAuYPAvMByrpy97jmodrvhPM5wR9utj40DYIlAiBfMhwACh8NM+kY+UB08CKcmCQ==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/i18n": { - "version": "4.57.0", - "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.57.0.tgz", - "integrity": "sha512-VYWYHE+7NxnZvE9Swhhe4leQcn0jHNkzRAEV36TkfAL/MvrQYCRh71KLTvKhsilG96HUQdBwjH0VPLmYEmR3sg==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/hooks": "^3.57.0", - "gettext-parser": "^1.3.1", - "memize": "^2.1.0", - "sprintf-js": "^1.1.1", - "tannin": "^1.2.0" - }, - "bin": { - "pot-to-php": "tools/pot-to-php.js" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@wordpress/i18n/node_modules/sprintf-js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", - "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", - "dev": true - }, "node_modules/@wordpress/jest-console": { "version": "7.28.0", "resolved": "https://registry.npmjs.org/@wordpress/jest-console/-/jest-console-7.28.0.tgz", @@ -5445,19 +5721,6 @@ "jest": ">=29" } }, - "node_modules/@wordpress/keycodes": { - "version": "3.57.0", - "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.57.0.tgz", - "integrity": "sha512-8u9MlHE5xPxJf7jROBO8IGYKN54IkjXQD3mfsxVE+dtONeNwRaPvvcZOuOfySerABcCat2OgWCh1s0cV5WNCuw==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "@wordpress/i18n": "^4.57.0" - }, - "engines": { - "node": ">=12" - } - }, "node_modules/@wordpress/npm-package-json-lint-config": { "version": "4.42.0", "resolved": "https://registry.npmjs.org/@wordpress/npm-package-json-lint-config/-/npm-package-json-lint-config-4.42.0.tgz", @@ -5575,6 +5838,101 @@ "react-dom": "^18.0.0" } }, + "node_modules/@wordpress/scripts/node_modules/@wordpress/api-fetch": { + "version": "6.55.0", + "resolved": "https://registry.npmjs.org/@wordpress/api-fetch/-/api-fetch-6.55.0.tgz", + "integrity": "sha512-1HrCUsJdeRY5Y0IjplotINwqMRO81e7O7VhBScuKk7iOuDm/E1ioKv2uLGnPNWziYu+Zf025byxOqVzXDyM2gw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "@wordpress/i18n": "^4.58.0", + "@wordpress/url": "^3.59.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/scripts/node_modules/@wordpress/e2e-test-utils-playwright": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/@wordpress/e2e-test-utils-playwright/-/e2e-test-utils-playwright-0.25.0.tgz", + "integrity": "sha512-6KhYvOeCjiwGqb6V2pc8pdzIaee9annctrpoBBCZDC+LOeW+8DLKZeQYAn9CV3Lmeq1Pxn+9dvHsaV/4+nSHBg==", + "dev": true, + "dependencies": { + "@wordpress/api-fetch": "^6.54.0", + "@wordpress/keycodes": "^3.57.0", + "@wordpress/url": "^3.58.0", + "change-case": "^4.1.2", + "form-data": "^4.0.0", + "get-port": "^5.1.1", + "lighthouse": "^10.4.0", + "mime": "^3.0.0", + "web-vitals": "^3.5.0" + }, + "engines": { + "node": ">=12" + }, + "peerDependencies": { + "@playwright/test": ">=1" + } + }, + "node_modules/@wordpress/scripts/node_modules/@wordpress/hooks": { + "version": "3.58.0", + "resolved": "https://registry.npmjs.org/@wordpress/hooks/-/hooks-3.58.0.tgz", + "integrity": "sha512-9LB0ZHnZRQlORttux9t/xbAskF+dk2ujqzPGsVzc92mSKpQP3K2a5Wy74fUnInguB1vLUNHT6nrNdkVom5qX1Q==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/scripts/node_modules/@wordpress/i18n": { + "version": "4.58.0", + "resolved": "https://registry.npmjs.org/@wordpress/i18n/-/i18n-4.58.0.tgz", + "integrity": "sha512-VfvS3BWv/RDjRKD6PscIcvYfWKnGJcI/DEqyDgUMhxCM6NRwoL478CsUKTiGJIymeyRodNRfprdcF086DpGKYw==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "@wordpress/hooks": "^3.58.0", + "gettext-parser": "^1.3.1", + "memize": "^2.1.0", + "sprintf-js": "^1.1.1", + "tannin": "^1.2.0" + }, + "bin": { + "pot-to-php": "tools/pot-to-php.js" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/scripts/node_modules/@wordpress/keycodes": { + "version": "3.58.0", + "resolved": "https://registry.npmjs.org/@wordpress/keycodes/-/keycodes-3.58.0.tgz", + "integrity": "sha512-Q/LRKpx8ndzuHlkxSQ2BD+NTYYKQPIneNNMng8hTAfyU7RFwXpqj06HpeOFGh4XIdPKCs/8hmucoLJRmmLmZJA==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "@wordpress/i18n": "^4.58.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@wordpress/scripts/node_modules/@wordpress/url": { + "version": "3.59.0", + "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.59.0.tgz", + "integrity": "sha512-GxvoMjYCav0w4CiX0i0h3qflrE/9rhLIZg5aPCQjbrBdwTxYR3Exfw0IJYcmVaTKXQOUU8fOxlDxULsbLmKe9w==", + "dev": true, + "dependencies": { + "@babel/runtime": "^7.16.0", + "remove-accents": "^0.5.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/@wordpress/scripts/node_modules/ansi-styles": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", @@ -5675,6 +6033,12 @@ "node": ">=0.10.0" } }, + "node_modules/@wordpress/scripts/node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "dev": true + }, "node_modules/@wordpress/scripts/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5717,21 +6081,8 @@ "engines": { "node": ">=14" }, - "peerDependencies": { - "stylelint": "^14.2" - } - }, - "node_modules/@wordpress/url": { - "version": "3.58.0", - "resolved": "https://registry.npmjs.org/@wordpress/url/-/url-3.58.0.tgz", - "integrity": "sha512-t76YwLjJpwyxghTrha28qmv1UdZyxrFLrk5nOV46UsVHBgo78hRzkkwA4HHhSGzvAZcewEWozvJxpswgCTX3rQ==", - "dev": true, - "dependencies": { - "@babel/runtime": "^7.16.0", - "remove-accents": "^0.5.0" - }, - "engines": { - "node": ">=12" + "peerDependencies": { + "stylelint": "^14.2" } }, "node_modules/@wordpress/warning": { @@ -6939,6 +7290,33 @@ "node": ">= 0.8" } }, + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", + "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", + "dev": true, + "engines": { + "node": ">=10.6.0" + } + }, + "node_modules/cacheable-request": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", + "dev": true, + "dependencies": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/call-bind": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", @@ -7114,6 +7492,12 @@ "node": ">=10" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, "node_modules/check-node-version": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/check-node-version/-/check-node-version-4.2.1.tgz", @@ -7316,6 +7700,30 @@ "webpack": "*" } }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.9.2", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz", + "integrity": "sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/cli-table3": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.2.tgz", @@ -7331,6 +7739,15 @@ "@colors/colors": "1.5.0" } }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/cliui": { "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", @@ -7342,6 +7759,15 @@ "wrap-ansi": "^7.0.0" } }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, "node_modules/clone-deep": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-0.2.4.tgz", @@ -7358,6 +7784,18 @@ "node": ">=0.10.0" } }, + "node_modules/clone-response": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.3.tgz", + "integrity": "sha512-ROoL94jJH2dUVML2Y/5PEDNaSHgeOdSDicUyS7izcF63G6sTc/FTjLub4b8Il9S8S0beOfYt0TaA5qvFK+w0wA==", + "dev": true, + "dependencies": { + "mimic-response": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -7507,6 +7945,45 @@ "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", "dev": true }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, "node_modules/configstore": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/configstore/-/configstore-5.0.1.tgz", @@ -7942,6 +8419,12 @@ "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", "dev": true }, + "node_modules/copy-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/copy-dir/-/copy-dir-1.3.0.tgz", + "integrity": "sha512-Q4+qBFnN4bwGwvtXXzbp4P/4iNk0MaiGAzvQ8OiMtlLjkIKjmNN689uVzShSM0908q7GoFHXIPx4zi75ocoaHw==", + "dev": true + }, "node_modules/copy-webpack-plugin": { "version": "10.2.4", "resolved": "https://registry.npmjs.org/copy-webpack-plugin/-/copy-webpack-plugin-10.2.4.tgz", @@ -8677,6 +9160,33 @@ "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", "dev": true }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "dev": true, + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/dedent": { "version": "1.5.3", "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.5.3.tgz", @@ -8771,6 +9281,27 @@ "node": ">=10.17.0" } }, + "node_modules/defaults": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.4.tgz", + "integrity": "sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==", + "dev": true, + "dependencies": { + "clone": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/defer-to-connect": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", + "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", + "dev": true, + "engines": { + "node": ">=10" + } + }, "node_modules/define-data-property": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", @@ -8989,6 +9520,30 @@ "node": ">=6" } }, + "node_modules/docker-compose": { + "version": "0.24.8", + "resolved": "https://registry.npmjs.org/docker-compose/-/docker-compose-0.24.8.tgz", + "integrity": "sha512-plizRs/Vf15H+GCVxq2EUvyPK7ei9b/cVesHvjnX4xaXjM9spHe2Ytq0BitndFgvTJ3E3NljPNUEl7BAN43iZw==", + "dev": true, + "dependencies": { + "yaml": "^2.2.2" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/docker-compose/node_modules/yaml": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.4.5.tgz", + "integrity": "sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==", + "dev": true, + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14" + } + }, "node_modules/doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", @@ -10633,6 +11188,20 @@ "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dev": true, + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -11702,6 +12271,31 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/got": { + "version": "11.8.6", + "resolved": "https://registry.npmjs.org/got/-/got-11.8.6.tgz", + "integrity": "sha512-6tfZ91bOr7bOXnK7PRDCGBLa1H4U080YHNaAQ2KsMGlLEzRbk44nsZF2E1IeRc3vtJHPVbKCYgdFbaGO2ljd8g==", + "dev": true, + "dependencies": { + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" + }, + "engines": { + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" + } + }, "node_modules/graceful-fs": { "version": "4.2.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", @@ -12235,6 +12829,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "dev": true + }, "node_modules/http-deceiver": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/http-deceiver/-/http-deceiver-1.2.7.tgz", @@ -12324,6 +12924,31 @@ } } }, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", + "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "dev": true, + "dependencies": { + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" + }, + "engines": { + "node": ">=10.19.0" + } + }, + "node_modules/http2-wrapper/node_modules/quick-lru": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", + "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/https-proxy-agent": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", @@ -12528,6 +13153,118 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "node_modules/inquirer": { + "version": "7.3.3", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.3.3.tgz", + "integrity": "sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.19", + "mute-stream": "0.0.8", + "run-async": "^2.4.0", + "rxjs": "^6.6.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/inquirer/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/inquirer/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/inquirer/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/inquirer/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/inquirer/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, "node_modules/internal-slot": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.7.tgz", @@ -12884,6 +13621,15 @@ "node": ">=0.10.0" } }, + "node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/is-map": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/is-map/-/is-map-2.0.3.tgz", @@ -16184,6 +16930,15 @@ "tslib": "^2.0.3" } }, + "node_modules/lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/lru_map": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", @@ -16731,6 +17486,15 @@ "node": ">=6" } }, + "node_modules/mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, "node_modules/min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", @@ -16955,6 +17719,12 @@ "multicast-dns": "cli.js" } }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==", + "dev": true + }, "node_modules/nanoid": { "version": "3.3.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz", @@ -20719,6 +21489,169 @@ "node": ">= 0.8.0" } }, + "node_modules/ora": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-4.1.1.tgz", + "integrity": "sha512-sjYP8QyVWBpBZWD6Vr1M/KwknSw6kJOz41tvGMlwWeClHBtYKTbHMki1PsLZnxKpXMPbTKv9b3pjQu3REib96A==", + "dev": true, + "dependencies": { + "chalk": "^3.0.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.2.0", + "is-interactive": "^1.0.0", + "log-symbols": "^3.0.0", + "mute-stream": "0.0.8", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ora/node_modules/chalk": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz", + "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ora/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/ora/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/log-symbols": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-3.0.0.tgz", + "integrity": "sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==", + "dev": true, + "dependencies": { + "chalk": "^2.4.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ora/node_modules/log-symbols/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/log-symbols/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/log-symbols/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/ora/node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "node_modules/ora/node_modules/log-symbols/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/log-symbols/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/ora/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/os-homedir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", @@ -20747,6 +21680,15 @@ "os-tmpdir": "^1.0.0" } }, + "node_modules/p-cancelable": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", + "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/p-each-series": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", @@ -21285,35 +22227,35 @@ } }, "node_modules/playwright": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.44.0.tgz", - "integrity": "sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==", + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.47.2.tgz", + "integrity": "sha512-nx1cLMmQWqmA3UsnjaaokyoUpdVaaDhJhMoxX2qj3McpjnsqFHs516QAKYhqHAgOP+oCFTEOCOAaD1RgD/RQfA==", "dev": true, - "peer": true, + "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.44.0" + "playwright-core": "1.47.2" }, "bin": { "playwright": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" }, "optionalDependencies": { "fsevents": "2.3.2" } }, "node_modules/playwright-core": { - "version": "1.44.0", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.44.0.tgz", - "integrity": "sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ==", + "version": "1.47.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.47.2.tgz", + "integrity": "sha512-3JvMfF+9LJfe16l7AbSmU555PaTl2tPyQsVInqm3id16pdDfvZ8TTZ/pyzmkbDrZTQefyzU7AIHlZqQnxpqHVQ==", "dev": true, - "peer": true, + "license": "Apache-2.0", "bin": { "playwright-core": "cli.js" }, "engines": { - "node": ">=16" + "node": ">=18" } }, "node_modules/playwright/node_modules/fsevents": { @@ -21326,7 +22268,6 @@ "os": [ "darwin" ], - "peer": true, "engines": { "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } @@ -22821,6 +23762,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/resolve-alpn": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", + "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==", + "dev": true + }, "node_modules/resolve-bin": { "version": "0.4.3", "resolved": "https://registry.npmjs.org/resolve-bin/-/resolve-bin-0.4.3.tgz", @@ -22882,6 +23829,31 @@ "node": ">=10" } }, + "node_modules/responselike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.1.tgz", + "integrity": "sha512-4gl03wn3hj1HP3yzgdI7d3lCkF95F21Pz4BPGvKHinyQzALR5CapwC8yIi0Rh58DEMQ/SguC03wFj2k0M/mHhw==", + "dev": true, + "dependencies": { + "lowercase-keys": "^2.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/retry": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", @@ -22922,6 +23894,15 @@ "node": ">=10.0.0" } }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, "node_modules/run-con": { "version": "1.2.12", "resolved": "https://registry.npmjs.org/run-con/-/run-con-1.2.12.tgz", @@ -23624,6 +24605,38 @@ "node": ">=4" } }, + "node_modules/simple-git": { + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.25.0.tgz", + "integrity": "sha512-KIY5sBnzc4yEcJXW7Tdv4viEz8KyG+nU0hay+DWZasvdFOYKeUZ6Xc25LUHHjw0tinPT7O1eY6pzX7pRT1K8rw==", + "dev": true, + "dependencies": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.5" + }, + "funding": { + "type": "github", + "url": "https://github.com/steveukx/git-js?sponsor=1" + } + }, + "node_modules/simple-git/node_modules/debug": { + "version": "4.3.5", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.5.tgz", + "integrity": "sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, "node_modules/sirv": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/sirv/-/sirv-2.0.4.tgz", @@ -24788,6 +25801,22 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/terser": { "version": "5.31.0", "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.0.tgz", @@ -24959,6 +25988,18 @@ "integrity": "sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA==", "dev": true }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/tmpl": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", @@ -25258,6 +26299,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true + }, "node_modules/typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", @@ -25681,6 +26728,15 @@ "minimalistic-assert": "^1.0.0" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==", + "dev": true, + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/web-vitals": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/web-vitals/-/web-vitals-3.5.2.tgz", diff --git a/package.json b/package.json index 96e08eb3..7d38236b 100644 --- a/package.json +++ b/package.json @@ -16,19 +16,31 @@ "start": "npm-run-all --parallel start:*", "build": "npm-run-all --parallel build:*", "release": "semantic-release --debug", - "dist": "bash ./bin/dist.sh" + "dist": "bash ./bin/dist.sh", + "wp-env": "wp-env", + "test:e2e:playwright": "wp-scripts test-playwright --config tests/e2e/playwright.config.js", + "test:e2e:playwright:debug": "wp-scripts test-playwright --config tests/e2e/playwright.config.js --ui", + "test:unit:php:base": "wp-env run --env-cwd='wp-content/plugins/themeisle-sdk' tests-wordpress vendor/bin/phpunit", + "test:unit:php": "npm run wp-env start && npm run test:unit:php:base", + "test:unit": "wp-scripts test-unit-js", + "test:unit:help": "wp-scripts test-unit-js --help", + "test:unit:watch": "wp-scripts test-unit-js --watch", + "test:unit:debug": "wp-scripts --inspect-brk test-unit-js --runInBand --no-cache" }, "author": "Themeisle", "devDependencies": { "@semantic-release/changelog": "^5.0.0", "@semantic-release/exec": "^5.0.0", "@semantic-release/git": "^9.0.0", + "@wordpress/e2e-test-utils-playwright": "^1.8.0", + "@wordpress/env": "^10.8.0", "@wordpress/postcss-plugins-preset": "^4.17.0", "@wordpress/scripts": "^27.8.0", "conventional-changelog-simple-preset": "^1.0.20", "eslint-config-wordpress": "^2.0.0", "grunt-version": "^1.3.1", "npm-run-all": "^4.1.5", + "playwright": "^1.47.2", "postcss-combine-media-query": "^1.0.1", "postcss-custom-media": "^9.1.3", "postcss-sort-media-queries": "^5.1.0", diff --git a/tests/e2e/config/flaky-tests-reporter.js b/tests/e2e/config/flaky-tests-reporter.js new file mode 100644 index 00000000..4a7274f3 --- /dev/null +++ b/tests/e2e/config/flaky-tests-reporter.js @@ -0,0 +1,84 @@ +// Fork of https://github.com/WordPress/gutenberg/blob/trunk/test/e2e/config/flaky-tests-reporter.ts + +/** + * A **flaky** test is defined as a test which passed after auto-retrying. + * - By default, all tests run once if they pass. + * - If a test fails, it will automatically re-run at most 2 times. + * - If it pass after retrying (below 2 times), then it's marked as **flaky** + * but displayed as **passed** in the original test suite. + * - If it fail all 3 times, then it's a **failed** test. + */ +/** + * External dependencies + */ +import fs from 'fs'; +import filenamify from 'filenamify'; + +// Remove "steps" to prevent stringify circular structure. +function formatTestResult( testResult ) { + const result = { ...testResult, steps: undefined }; + delete result.steps; + return result; +} + +class FlakyTestsReporter { + failingTestCaseResults = new Map(); + + onBegin() { + try { + fs.mkdirSync( 'flaky-tests' ); + } catch ( err ) { + if ( + err instanceof Error && + ( err).code === 'EEXIST' + ) { + // Ignore the error if the directory already exists. + } else { + throw err; + } + } + } + + onTestEnd( test, testCaseResult ) { + const testPath = test.location.file; + const testTitle = test.title; + + switch ( test.outcome() ) { + case 'unexpected': { + if ( ! this.failingTestCaseResults.has( testTitle ) ) { + this.failingTestCaseResults.set( testTitle, [] ); + } + this.failingTestCaseResults + .get( testTitle ) + .push( formatTestResult( testCaseResult ) ); + break; + } + case 'flaky': { + fs.writeFileSync( + `flaky-tests/${ filenamify( testTitle ) }.json`, + JSON.stringify( { + version: 1, + runner: '@playwright/test', + title: testTitle, + path: testPath, + results: this.failingTestCaseResults.get( testTitle ), + } ), + 'utf-8' + ); + break; + } + default: + break; + } + } + + onEnd() { + this.failingTestCaseResults.clear(); + } + + printsToStdio() { + return false; + } +} + +module.exports = FlakyTestsReporter; \ No newline at end of file diff --git a/tests/e2e/config/global-setup.js b/tests/e2e/config/global-setup.js new file mode 100644 index 00000000..5f567b50 --- /dev/null +++ b/tests/e2e/config/global-setup.js @@ -0,0 +1,45 @@ +// Fork of https://github.com/WordPress/gutenberg/blob/trunk/test/e2e/config/global-setup.ts + +/** + * External dependencies + */ +import { request } from '@playwright/test'; + +/** + * WordPress dependencies + */ +import { RequestUtils } from '@wordpress/e2e-test-utils-playwright'; + +async function globalSetup( config ) { + const { storageState, baseURL } = config.projects[ 0 ].use; + const storageStatePath = + typeof storageState === 'string' ? storageState : undefined; + + const requestContext = await request.newContext( { + baseURL, + } ); + + const requestUtils = new RequestUtils( requestContext, { + storageStatePath, + } ); + + // Authenticate and save the storageState to disk. + await requestUtils.setupRest(); + + // Reset the test environment before running the tests. + await Promise.all( [ + // requestUtils.activateTheme( 'twentytwentyone' ), + // Disable this test plugin as it's conflicting with some of the tests. + // We already have reduced motion enabled and Playwright will wait for most of the animations anyway. + // requestUtils.deactivatePlugin( + // 'gutenberg-test-plugin-disables-the-css-animations' + // ), + requestUtils.deleteAllPosts(), + requestUtils.deleteAllBlocks(), + requestUtils.resetPreferences(), + ] ); + + await requestContext.dispose(); +} + +export default globalSetup; \ No newline at end of file diff --git a/tests/e2e/playwright.config.js b/tests/e2e/playwright.config.js new file mode 100644 index 00000000..120942ac --- /dev/null +++ b/tests/e2e/playwright.config.js @@ -0,0 +1,60 @@ +// Fork of https://github.com/WordPress/gutenberg/blob/trunk/test/e2e/playwright.config.ts + +/** + * External dependencies + */ +import os from 'os'; +import { fileURLToPath } from 'url'; +import { defineConfig, devices } from '@playwright/test'; + +/** + * WordPress dependencies + */ +const baseConfig = require( '@wordpress/scripts/config/playwright.config' ); + +const config = defineConfig({ + ...baseConfig, + reporter: process.env.CI ? + [[ 'github' ], [ './config/flaky-tests-reporter.js' ]] : + 'list', + workers: 1, + globalSetup: fileURLToPath( + new URL( './config/global-setup.js', 'file:' + __filename ).href + ), + projects: [ + { + name: 'chromium', + use: { + ...devices[ 'Desktop Chrome' ], + permissions: [ 'clipboard-read', 'clipboard-write' ] + }, + grepInvert: /-chromium/ + } + + // { + // name: 'webkit', + // use: { + // ...devices[ 'Desktop Safari' ], + // /** + // * Headless webkit won't receive dataTransfer with custom types in the + // * drop event on Linux. The solution is to use `xvfb-run` to run the tests. + // * ```sh + // * xvfb-run npm run test:e2e:playwright + // * ``` + // * See `.github/workflows/end2end-test-playwright.yml` for advanced usages. + // */ + // headless: os.type() !== 'Linux', + // }, + // grep: /@webkit/, + // grepInvert: /-webkit/, + // }, + // { + // name: 'firefox', + // use: { ...devices[ 'Desktop Firefox' ] }, + // grep: /@firefox/, + // grepInvert: /-firefox/, + // }, + ] +}); + +export default config; diff --git a/tests/e2e/specs/about-us-page.spec.js b/tests/e2e/specs/about-us-page.spec.js new file mode 100644 index 00000000..9eacd22b --- /dev/null +++ b/tests/e2e/specs/about-us-page.spec.js @@ -0,0 +1,30 @@ +/** + * WordPress dependencies + */ +import { test, expect } from '@wordpress/e2e-test-utils-playwright'; + +test.describe( 'About Us Module', () => { + + test( 'check main sections', async({ page }) => { + await page.goto( '/wp-admin/admin.php?page=themeisle-sdk' ); + await page.locator( '#toplevel_page_themeisle-sdk' ).getByRole( 'link', { name: 'About Us' }).click(); + await page.waitForSelector( '#ti-sdk-about' ); + + // Header components are visible. + await expect( page.locator( '.head img' ) ).toBeVisible(); + await expect( page.locator( 'p' ).filter({ hasText: 'by Themeisle' }).getByRole( 'link' ) ).toBeVisible(); + + // Newsletter form is visible. + await expect( page.getByPlaceholder( 'Your email address' ) ).toBeVisible(); + await expect( page.getByRole( 'button', { name: 'Sign me up' }) ).toBeVisible(); + + // We have product install shortcuts. + await expect( page.locator( '.product-card' ).count() ).resolves.toBeGreaterThan( 0 ); + + // We should have some uninstalled products. + await expect( page.locator( '.product-card' ).filter({ has: page.locator( '.not-installed' ) }).count() ).resolves.toBeGreaterThan( 0 ); + + // Landing Kit link is visible. + await expect( page.getByRole( 'link', { name: 'Learn More' }) ).toBeVisible(); + }); +}); diff --git a/tests/e2e/specs/feature-plugins.spec.js b/tests/e2e/specs/feature-plugins.spec.js new file mode 100644 index 00000000..bd56cacb --- /dev/null +++ b/tests/e2e/specs/feature-plugins.spec.js @@ -0,0 +1,21 @@ +/** + * WordPress dependencies + */ +import { test, expect } from '@wordpress/e2e-test-utils-playwright'; + +test.describe( 'Featured Plugin', () => { + + test( 'check recommendation', async({ page, admin }) => { + await admin.visitAdminPage( 'plugin-install.php' ); + + const optimoleCard = page.locator( '.plugin-card-optimole-wp' ); + + await expect( optimoleCard ).toBeVisible(); + await expect( optimoleCard.locator( 'a[data-slug="optimole-wp"]' ) ).toBeVisible(); + + const otterCard = page.locator( '.plugin-card-otter-blocks' ); + + await expect( otterCard ).toBeVisible(); + await expect( otterCard.locator( 'a[data-slug="otter-blocks"]' ) ).toBeVisible(); + }); +}); diff --git a/tests/e2e/specs/promotions.spec.js b/tests/e2e/specs/promotions.spec.js new file mode 100644 index 00000000..b93766ca --- /dev/null +++ b/tests/e2e/specs/promotions.spec.js @@ -0,0 +1,73 @@ +/** + * WordPress dependencies + */ +import { test, expect } from '@wordpress/e2e-test-utils-playwright'; + + +test.describe( 'Promotions', () => { + + test( 'on Theme Install page', async({ page, admin }) => { + await admin.visitAdminPage( 'theme-install.php?browse=popular' ); + + // Check if the promotions are visible. + expect( await page.locator( '.ti-sdk-om-notice' ).count() ).toBeGreaterThan( 0 ); + + // Check Neve promotion. + const nevePromotion = page.locator( '#ti-neve-notice' ); + + await expect( nevePromotion ).toBeVisible(); + await expect( nevePromotion.getByRole( 'button', { name: 'Install & Activate' }) ).toBeVisible(); + await expect( nevePromotion.getByRole( 'link', { name: 'Preview' }) ).toBeVisible(); + await expect( nevePromotion.getByRole( 'button', { name: 'Dismiss this notice.' }) ).toBeVisible(); + }); + + test( 'on Edit page', async({ page, admin }) => { + await admin.visitAdminPage( 'edit.php' ); + + // Check if the promotions are visible. + expect( await page.locator( '.ti-sdk-om-notice' ).count() ).toBeGreaterThan( 0 ); + + // Check Revive Social promotion. + const ropPromotion = page.locator( '#ti-rop-notice' ); + + await expect( ropPromotion ).toBeVisible(); + await expect( ropPromotion.getByRole( 'button', { name: 'Install & Activate' }) ).toBeVisible(); + await expect( ropPromotion.getByRole( 'link', { name: 'Learn more' }) ).toBeVisible(); + await expect( ropPromotion.getByRole( 'button', { name: 'Dismiss this notice.' }) ).toBeVisible(); + }); + + test( 'on Upload page', async({ page, admin }) => { + await admin.visitAdminPage( 'upload.php' ); + + // Check if the promotions are visible. + expect( await page.locator( '.ti-sdk-om-notice' ).count() ).toBeGreaterThan( 0 ); + + // Check Optimole promotion. + const optimoleNotice = page.locator( '#ti-optml-notice' ); + + await expect( optimoleNotice ).toBeVisible(); + await expect( optimoleNotice.getByRole( 'button', { name: 'Install Optimole' }) ).toBeVisible(); + await expect( optimoleNotice.getByRole( 'link', { name: 'Learn more' }) ).toBeVisible(); + await expect( optimoleNotice.getByRole( 'button', { name: 'Dismiss this notice.' }) ).toBeVisible(); + + // Check CF7 promotion. + const cf7Notice = page.locator( '#ti-redirection-cf7-notice' ); + + await expect( cf7Notice ).toBeVisible(); + await expect( cf7Notice.getByRole( 'button', { name: 'Get Started Free' }) ).toBeVisible(); + await expect( cf7Notice.getByRole( 'link', { name: 'Learn more' }) ).toBeVisible(); + await expect( cf7Notice.getByRole( 'button', { name: 'Dismiss this notice.' }) ).toBeVisible(); + }); + + test( 'on Gutenberg Editor page', async({ page, admin, editor }) => { + await admin.createNewPost(); + + // Check Optimole promotion in Image Core block settings. + await editor.insertBlock({ name: 'core/image' }); + const optimoleNotice = page.locator( '.ti-sdk-om-notice' ); + + await expect( optimoleNotice.getByRole( 'button', { name: 'Install Optimole' }) ).toBeVisible(); + await expect( optimoleNotice.getByRole( 'link', { name: 'Learn More' }) ).toBeVisible(); + await expect( optimoleNotice.getByRole( 'button', { name: 'Dismiss this notice.' }) ).toBeVisible(); + }); +}); diff --git a/tests/e2e/specs/rollback.spec.js b/tests/e2e/specs/rollback.spec.js new file mode 100644 index 00000000..977ea30a --- /dev/null +++ b/tests/e2e/specs/rollback.spec.js @@ -0,0 +1,16 @@ +/** + * WordPress dependencies + */ +import { test, expect } from '@wordpress/e2e-test-utils-playwright'; + + +test.describe( 'Rollback', () => { + + test( 'rendering', async({ page, admin }) => { + await admin.visitAdminPage( 'plugins.php' ); + + const pluginContainer = page.locator( '[data-slug="visualizer"] .plugin-title' ); + await expect( pluginContainer ).toBeVisible(); + await expect( pluginContainer.getByRole( 'link', { name: 'Rollback to' }) ).toBeVisible(); + }); +}); diff --git a/tests/e2e/specs/script-loader.spec.js b/tests/e2e/specs/script-loader.spec.js new file mode 100644 index 00000000..aaca5f54 --- /dev/null +++ b/tests/e2e/specs/script-loader.spec.js @@ -0,0 +1,76 @@ +/** + * WordPress dependencies + */ +import { test, expect } from '@wordpress/e2e-test-utils-playwright'; + +/** + * Internal dependencies + */ +import { blockRequests } from '../utils'; + +test.describe( 'Script Loader', () => { + + test( 'check survey and tracking script loading (on Visualizer)', async({ page, admin, context }) => { + await blockRequests( context ); + await admin.visitAdminPage( 'admin.php?page=visualizer' ); + + await expect( page.locator( 'script#themeisle_sdk_survey_script-js' ) ).toHaveCount( 1 ); + await expect( page.locator( 'script#themeisle_sdk_tracking_script-js' ) ).toHaveCount( 1 ); + await expect( page.locator( 'script#themeisle_sdk_tracking_script-js-extra' ) ).toHaveCount( 1 ); + + const tiTelemetryDefined = await page.evaluate( () => { + return 'undefined' !== typeof window.tiTelemetry; + }); + expect( tiTelemetryDefined ).toBe( true ); + }); + + test( 'check window.tiTrk functionality', async({ page, admin, context }) => { + await admin.visitAdminPage( 'admin.php?page=visualizer' ); + await blockRequests( context ); + + // Check if window.tiTrk exists + const tiTrkExists = await page.evaluate( () => { + return 'undefined' !== typeof window.tiTrk; + }); + expect( tiTrkExists ).toBe( true ); + + // Check if window.tiTrk has the expected methods + const tiTrkMethods = await page.evaluate( () => { + return { + hasWithMethod: 'function' === typeof window.tiTrk.with, + hasUploadEventsMethod: 'function' === typeof window.tiTrk.uploadEvents, + hasStartMethod: 'function' === typeof window.tiTrk.start, + hasStopMethod: 'function' === typeof window.tiTrk.stop + }; + }); + expect( tiTrkMethods ).toEqual({ + hasWithMethod: true, + hasUploadEventsMethod: true, + hasStartMethod: true, + hasStopMethod: true + }); + + // Test adding an event + const eventAdded = await page.evaluate( () => { + const testEvent = { + slug: 'visualizer', + action: 'test-action', + feature: 'test-feature' + }; + window.tiTrk.with( 'visualizer' ).add( testEvent ); + return 0 < window.tiTrk.events.size; + }); + expect( eventAdded ).toBe( true ); + + // Test uploading events (this will clear the events) + await page.evaluate( () => { + window.tiTrk.uploadEvents(); + }); + + // Check if events were cleared after uploading + const eventsCleared = await page.evaluate( () => { + return 0 === window.tiTrk.events.size; + }); + expect( eventsCleared ).toBe( true ); + }); +}); diff --git a/tests/e2e/utils/index.js b/tests/e2e/utils/index.js new file mode 100644 index 00000000..f001bb47 --- /dev/null +++ b/tests/e2e/utils/index.js @@ -0,0 +1,21 @@ +const BLOCKED_URLS = [ + 'https://api.themeisle.com/tracking/', // Do not send tracking data. + 'https://app.formbricks.com' // Do not initialize FormBricks survey. +]; + +/** + * Block requests to specific URLs. + * + * @param {import('@playwright/test').BrowserContext} context Playwright browser context. + */ +export async function blockRequests( context ) { + await context.route( '**/*', route => { + const url = route.request().url(); + if ( BLOCKED_URLS.some( blockedUrl => url.startsWith( blockedUrl ) ) ) { + console.log( `[UTILS] Blocked request to: ${url}` ); + route.abort(); + } else { + route.continue(); + } + }); +} diff --git a/tests/js-unit/tracking.test.js b/tests/js-unit/tracking.test.js new file mode 100644 index 00000000..5ac8919d --- /dev/null +++ b/tests/js-unit/tracking.test.js @@ -0,0 +1,99 @@ +import { EventTrackingAccumulator } from '../../assets/js/src/tracking'; + + +// Mock the global fetch function +global.fetch = jest.fn( () => + Promise.resolve({ + ok: true, + json: () => Promise.resolve({ success: true }) + }) +); + +// Mock objects +const tiTelemetry = { + endpoint: 'https://api.test.com/tracking', + products: [ + { slug: 'test-product', trackHash: 'abc123', consent: true } + ] +}; + +describe( 'EventTrackingAccumulator', () => { + let accumulator; + + beforeEach( () => { + accumulator = new EventTrackingAccumulator( tiTelemetry ); + global.fetch.mockClear(); + }); + + test( 'should add an event to the accumulator using _add method', () => { + const data = { slug: 'test-product', action: 'block-created' }; + const hash = accumulator._add( data ); + expect( accumulator.events.size ).toBe( 1 ); + expect( accumulator.events.get( hash ) ).toEqual( expect.objectContaining( data ) ); + }); + + test( 'should set an event with a specific key using _set method', () => { + const key = 'test-key'; + const data = { slug: 'test-product', action: 'block-updated' }; + accumulator._set( key, data ); + expect( accumulator.events.size ).toBe( 1 ); + expect( accumulator.events.get( key ) ).toEqual( expect.objectContaining( data ) ); + }); + + test( 'should send events to the server', async() => { + accumulator._add({ slug: 'test-product', action: 'block-created' }); + accumulator._add({ slug: 'test-product', action: 'block-updated' }); + + await accumulator.uploadEvents(); + + expect( global.fetch ).toHaveBeenCalledTimes( 1 ); + expect( global.fetch ).toHaveBeenCalledWith( + 'https://api.test.com/tracking', + expect.objectContaining({ + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: expect.any( String ) + }) + ); + expect( accumulator.events.size ).toBe( 0 ); + }); + + test( 'should send events when limit is reached', async() => { + for ( let i = 0; i < accumulator.eventsLimit; i++ ) { + accumulator._add({ slug: 'test-product', action: `action-${i}` }); + } + + await accumulator.sendIfLimitReached(); + + expect( global.fetch ).toHaveBeenCalledTimes( 1 ); + expect( accumulator.events.size ).toBe( 0 ); + }); + + test( 'should create a new accumulator with preset data', () => { + const withAccumulator = accumulator.with( 'test-product' ); + const data = { action: 'block-created' }; + withAccumulator.add( data ); + + expect( accumulator.events.size ).toBe( 1 ); + const addedEvent = Array.from( accumulator.events.values() )[0]; + expect( addedEvent ).toEqual( expect.objectContaining({ + slug: 'test-product', + action: 'block-created', + license: 'abc123', + env: 'post-editor' + }) ); + }); + + test( 'should return the correct consent value', () => { + expect( accumulator.hasConsent() ).toBe( false ); + accumulator.consent = true; + expect( accumulator.hasConsent() ).toBe( true ); + }); + + test( 'should correctly validate tracking data', () => { + expect( accumulator.validate({}) ).toBe( false ); + expect( accumulator.validate({ prop: undefined }) ).toBe( false ); + expect( accumulator.validate({ prop: 'value' }) ).toBe( true ); + expect( accumulator.validate({ prop1: 'value1', prop2: { nestedProp: 'value2' }}) ).toBe( true ); + }); +});