diff --git a/.eslintrc.json b/.eslintrc.json index 6c5755ad..dd22c57e 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,7 @@ { "env": { "node": true, "jest": true }, "parser": "@typescript-eslint/parser", - "parserOptions": { "ecmaVersion": 2020, "sourceType": "module" }, + "parserOptions": { "ecmaVersion": 2019, "sourceType": "module" }, "extends": [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", @@ -12,11 +12,5 @@ "plugin:prettier/recommended", "prettier/@typescript-eslint" ], - "plugins": ["@typescript-eslint", "jest"], - "rules": { - "camelcase": "off", - "require-atomic-updates": "off", - "@typescript-eslint/ban-ts-ignore": "off", - "@typescript-eslint/camelcase": "off" - } + "plugins": ["@typescript-eslint", "jest"] } \ No newline at end of file diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index acf31d4e..e69f5059 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -2,7 +2,5 @@ tidelift: "npm/setup-php" community_bridge: setup-php -issuehunt: shivammathur patreon: shivammathur -liberapay: shivammathur custom: https://www.paypal.me/shivammathur diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 24521023..ec175d38 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Nice, you found a bug! title: '' -labels: t:bug +labels: 'bug' assignees: 'shivammathur' --- @@ -10,6 +10,11 @@ assignees: 'shivammathur' **Describe the bug** +**Version** +- [ ] I have checked releases and the bug exists in the latest patch version of `v1` or `v2`. +- [ ] `v2` +- [ ] `v1` + **Runners** - [ ] GitHub Hosted diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index dd7c533d..0d22598e 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest a new feature title: '' -labels: t:enhancement +labels: 'enhancement' assignees: 'shivammathur' --- @@ -10,6 +10,9 @@ assignees: 'shivammathur' **Describe the feature** +**Version** +- [ ] I have checked releases and the feature is missing in the latest patch version of `v2`. + **Underlying issue** diff --git a/.github/PULL_REQUEST_TEMPLATE/FIX.md b/.github/PULL_REQUEST_TEMPLATE/FIX.md deleted file mode 100644 index 777d1c9f..00000000 --- a/.github/PULL_REQUEST_TEMPLATE/FIX.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: 🐞 Bug Fix -about: You have a fix for a bug? -labels: bug - ---- - -## A Pull Request should be associated with an Issue. - -> If you're offering a new feature or fixing anything, please provide the details in Issues, -> so that the development can be pointed in the intended direction. - -Related issue: - -> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md) -> Thank you for your contribution. - -### Description - -This PR [briefly explain what it does] - -> In case this PR introduced TypeScript/JavaScript code changes: - -- [ ] I have written test cases for the changes in this pull request. -- [ ] I have run `npm run format` before the commit. -- [ ] I have run `npm run lint` before the commit. -- [ ] I have run `npm run release` before the commit. -- [ ] `npm test` returns with no unit test errors and all code covered. - -> In case this PR edits any scripts: - -- [ ] I have checked the edited scripts for syntax. -- [ ] I have tested the changes in an integration test (If yes, provide workflow link). - - diff --git a/.github/PULL_REQUEST_TEMPLATE/IMPROVEMENT.md b/.github/PULL_REQUEST_TEMPLATE/IMPROVEMENT.md deleted file mode 100644 index bb7b521b..00000000 --- a/.github/PULL_REQUEST_TEMPLATE/IMPROVEMENT.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: ⚙ Improvement -about: You have some improvement to make setup-php better? -labels: enhancement - ---- - -## A Pull Request should be associated with an Issue. - -> If you're improving a feature please provide the details in Issues, -> so that the development can be pointed in the intended direction. - -Related issue: - -> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md) -> Thank you for your contribution. - -### Description - -This PR [briefly explain what it does] - -> In case this PR introduced TypeScript/JavaScript code changes: - -- [ ] I have written test cases for the changes in this pull request. -- [ ] I have run `npm run format` before the commit. -- [ ] I have run `npm run lint` before the commit. -- [ ] I have run `npm run release` before the commit. -- [ ] `npm test` returns with no unit test errors and all code covered. - -> In case this PR edits any scripts: - -- [ ] I have checked the edited scripts for syntax. -- [ ] I have tested the changes in an integration test (If yes, provide workflow link). - - diff --git a/.github/PULL_REQUEST_TEMPLATE/NEW_FEATURE.md b/.github/PULL_REQUEST_TEMPLATE/NEW_FEATURE.md deleted file mode 100644 index 70e08cfd..00000000 --- a/.github/PULL_REQUEST_TEMPLATE/NEW_FEATURE.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -name: 🎉 New Feature -about: You have added a new feature to setup-php? -labels: enhancement - ---- - -## A Pull Request should be associated with an Issue. - -> If you're adding a new feature please provide the details in Issues, -> so that the development can be pointed in the intended direction. - -Related issue: - -> Further notes in [Contribution Guidelines](.github/CONTRIBUTING.md) -> Thank you for your contribution. - -### Description - -This PR [briefly explain what it does] - -> In case this PR introduced TypeScript/JavaScript code changes: - -- [ ] I have written test cases for the changes in this pull request. -- [ ] I have run `npm run format` before the commit. -- [ ] I have run `npm run lint` before the commit. -- [ ] I have run `npm run release` before the commit. -- [ ] `npm test` returns with no unit test errors and all code covered. - -> In case this PR edits any scripts: - -- [ ] I have checked the edited scripts for syntax. -- [ ] I have tested the changes in an integration test (If yes, provide workflow link). - - diff --git a/.github/SECURITY.md b/.github/SECURITY.md index 52d904a7..a129b4c0 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -6,8 +6,8 @@ The following versions of this project are supported for security updates. | Version | Supported | | ------- | ------------------ | -| 1.8.x | :white_check_mark: | -| 2.2.x | :white_check_mark: | +| 1.9.x | :white_check_mark: | +| 2.3.x | :white_check_mark: | ## Supported PHP Versions @@ -22,7 +22,7 @@ This security policy only applies to the latest patches of the following PHP ver ## Reporting a Vulnerability -If you have found any issues that might have security implications in the versions supported, please send a report privately to [contact@shivammathur.com](mailto:contact@shivammathur.com) +If you have found any issues that might have security implications in the versions supported, please send a report privately to [contact@shivammathur.com](mailto:contact@shivammathur.com). Do not report security reports publicly. ## Tidelift diff --git a/.github/workflows/experimental-workflow.yml b/.github/workflows/experimental-workflow.yml index f5024b89..001a8c6b 100644 --- a/.github/workflows/experimental-workflow.yml +++ b/.github/workflows/experimental-workflow.yml @@ -25,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-latest, windows-latest, macos-latest] + operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest] php-versions: ['8.0'] env: extensions: xml, opcache, pcov @@ -34,28 +34,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Setup Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - - name: Install dependencies - run: npm install - - - name: Prettier Format Check - run: npm run format-check - - - name: ESLint Check - run: npm run lint - - - name: Run tests - run: npm test - - - name: Send Coverage - continue-on-error: true - timeout-minutes: 1 - run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }} - - name: Setup cache environment id: cache-env uses: shivammathur/cache-extensions@develop @@ -65,7 +43,7 @@ jobs: key: ${{ env.key }} - name: Cache extensions - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.cache-env.outputs.dir }} key: ${{ steps.cache-env.outputs.key }} diff --git a/.github/workflows/node-workflow.yml b/.github/workflows/node-workflow.yml new file mode 100644 index 00000000..5e7b899b --- /dev/null +++ b/.github/workflows/node-workflow.yml @@ -0,0 +1,51 @@ +name: Node workflow +on: + pull_request: + branches: + - master + - develop + - verbose + paths-ignore: + - '**.md' + - 'examples/**' + push: + branches: + - master + - develop + - verbose + paths-ignore: + - '**.md' + - 'examples/**' +jobs: + run: + name: Run + runs-on: ${{ matrix.operating-system }} + strategy: + fail-fast: false + matrix: + operating-system: [ubuntu-latest, windows-latest, macos-latest] + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node.js 12.x + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: Install dependencies + run: npm install + + - name: Prettier Format Check + run: npm run format-check + + - name: ESLint Check + run: npm run lint + + - name: Run tests + run: npm test + + - name: Send Coverage + continue-on-error: true + timeout-minutes: 1 + run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }} diff --git a/.github/workflows/workflow.yml b/.github/workflows/workflow.yml index d5af78a8..e15b78d9 100644 --- a/.github/workflows/workflow.yml +++ b/.github/workflows/workflow.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - operating-system: [ubuntu-latest, windows-latest, macos-latest] + operating-system: [ubuntu-20.04, ubuntu-18.04, ubuntu-16.04, windows-latest, macos-latest] php-versions: ['5.3', '5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4'] env: extensions: xml, opcache, xdebug, pcov @@ -32,28 +32,6 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Setup Node.js 12.x - uses: actions/setup-node@v1 - with: - node-version: 12.x - - - name: Install dependencies - run: npm install - - - name: Prettier Format Check - run: npm run format-check - - - name: ESLint Check - run: npm run lint - - - name: Run tests - run: npm test - - - name: Send Coverage - continue-on-error: true - timeout-minutes: 1 - run: curl -s https://codecov.io/bash | bash -s -- -t ${{secrets.CODECOV_TOKEN}} -f coverage/clover.xml -n github-actions-codecov-${{ matrix.operating-system }}-php${{ matrix.php-versions }} - - name: Setup cache environment id: cache-env uses: shivammathur/cache-extensions@develop @@ -63,7 +41,7 @@ jobs: key: ${{ env.key }} - name: Cache extensions - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.cache-env.outputs.dir }} key: ${{ steps.cache-env.outputs.key }} diff --git a/README.md b/README.md index 06819f47..31c45c46 100644 --- a/README.md +++ b/README.md @@ -19,9 +19,11 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support - [PHP Support](#tada-php-support) - [OS/Platform Support](#cloud-osplatform-support) + - [GitHub-Hosted Runners](#github-hosted-runners) + - [Self-Hosted Runners](#self-hosted-runners) - [PHP Extension Support](#heavy_plus_sign-php-extension-support) - [Tools Support](#wrench-tools-support) -- [Coverage support](#signal_strength-coverage-support) +- [Coverage Support](#signal_strength-coverage-support) - [Xdebug](#xdebug) - [PCOV](#pcov) - [Disable Coverage](#disable-coverage) @@ -29,7 +31,7 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support - [Inputs](#inputs) - [Basic Setup](#basic-setup) - [Matrix Setup](#matrix-setup) - - [Experimental Setup](#experimental-setup) + - [Nightly Build Setup](#nightly-build-setup) - [Self Hosted Setup](#self-hosted-setup) - [Local Testing Setup](#local-testing-setup) - [Thread Safe Setup](#thread-safe-setup) @@ -51,30 +53,45 @@ Setup PHP with required extensions, php.ini configuration, code-coverage support |PHP Version|Stability|Release Support|Runner Support| |--- |--- |--- |--- | -|`5.3`|`Stable`|`End of life`|`GitHub`| -|`5.4`|`Stable`|`End of life`|`GitHub`| -|`5.5`|`Stable`|`End of life`|`GitHub`| -|`5.6`|`Stable`|`End of life`|`GitHub`, `self-hosted`| -|`7.0`|`Stable`|`End of life`|`GitHub`, `self-hosted`| -|`7.1`|`Stable`|`End of life`|`GitHub`, `self-hosted`| -|`7.2`|`Stable`|`Security fixes only`|`GitHub`, `self-hosted`| -|`7.3`|`Stable`|`Active`|`GitHub`, `self-hosted`| -|`7.4`|`Stable`|`Active`|`GitHub`, `self-hosted`| -|`8.0`|`Experimental`|`In development`|`GitHub`, `self-hosted`| +|`5.3`|`Stable`|`End of life`|`GitHub-hosted`| +|`5.4`|`Stable`|`End of life`|`GitHub-hosted`| +|`5.5`|`Stable`|`End of life`|`GitHub-hosted`| +|`5.6`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`| +|`7.0`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`| +|`7.1`|`Stable`|`End of life`|`GitHub-hosted`, `self-hosted`| +|`7.2`|`Stable`|`Security fixes only`|`GitHub-hosted`, `self-hosted`| +|`7.3`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`| +|`7.4`|`Stable`|`Active`|`GitHub-hosted`, `self-hosted`| +|`8.0`|`Nightly`|`In development`|`GitHub-hosted`, `self-hosted`| -**Note:** Specifying `8.0` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` with `PHP JIT`, `Union Types v2` and other [new features](https://wiki.php.net/rfc#php_80 "New features implemented in PHP 8"). See [experimental setup](#experimental-setup) for more information. +**Note:** Specifying `8.0` in `php-version` input installs a nightly build of `PHP 8.0.0-dev` with `PHP JIT`, `Union Types v2` and other [new features](https://wiki.php.net/rfc#php_80 "New features implemented in PHP 8"). See [nightly build setup](#nightly-build-setup) for more information. ## :cloud: OS/Platform Support -|Virtual environment|matrix.operating-system| -|--- |--- | -|Windows Server 2019|`windows-latest` or `windows-2019`| -|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`| -|Ubuntu 16.04|`ubuntu-16.04`| -|MacOS X Catalina 10.15|`macos-latest` or `macos-10.15`| -|Self Hosted|`self-hosted`| +Both `GitHub-hosted` runners and `self-hosted` runners are supported on the following operating systems. -**Note:** Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners. +### GitHub-Hosted Runners + +|Virtual environment|YAML workflow label|Pre-installed PHP| +|--- |--- |--- | +|Ubuntu 16.04|`ubuntu-16.04`|`PHP 5.6` to `PHP 7.4`| +|Ubuntu 18.04|`ubuntu-latest` or `ubuntu-18.04`|`PHP 7.1` to `PHP 7.4`| +|Ubuntu 20.04|`ubuntu-20.04`|`PHP 7.4`| +|Windows Server 2019|`windows-latest` or `windows-2019`|`PHP 7.4`| +|macOS Catalina 10.15|`macos-latest` or `macos-10.15`|`PHP 7.4`| + +### Self-Hosted Runners + +|Host OS/Virtual environment|YAML workflow label| +|--- |--- | +|Ubuntu 16.04|`self-hosted` or `Linux`| +|Ubuntu 18.04|`self-hosted` or `Linux`| +|Ubuntu 20.04|`self-hosted` or `Linux`| +|Windows 7 and newer|`self-hosted` or `Windows`| +|Windows Server 2012 R2 and newer|`self-hosted` or `Windows`| +|macOS Catalina 10.15|`self-hosted` or `macOS`| + +- Refer to the [self-hosted setup](#self-hosted-setup) to use the action on self-hosted runners. ## :heavy_plus_sign: PHP Extension Support @@ -140,24 +157,30 @@ with: tools: php-cs-fixer, phpunit ``` -To setup a particular version of a tool, specify it in this form `tool:version`. -Version should be in semver format and a valid release of the tool. +To setup a particular version of a tool, specify it in the form `tool:version`. +Latest stable version of `composer` is setup by default. You can setup the required version by specifying `v1`, `v2`, `snapshot` or `preview` as version. ```yaml uses: shivammathur/setup-php@v2 with: php-version: '7.4' - tools: php-cs-fixer:2.15.5, phpunit:8.5.1 -``` + tools: composer:v2 +``` + +Version for other tools should be in `semver` format and a valid release of the tool. + +```yaml +uses: shivammathur/setup-php@v2 +with: + php-version: '7.4' + tools: php-cs-fixer:2.16.2, phpunit:8.5.1 +``` **Notes** -- `composer` is setup by default. -- Specifying version for `composer` and `pecl` has no effect, latest versions of both tools which are compatible with the PHP version will be setup. -- Both agent and client will be setup when `blackfire` is specified. -- If the version specified for the tool is not in semver format, latest version of the tool will be setup. +- Both agent `blackfire-agent` and client `blackfire` are setup when `blackfire` is specified. - Tools which cannot be setup gracefully leave an error message in the logs, the action is not interrupted. -## :signal_strength: Coverage support +## :signal_strength: Coverage Support ### Xdebug @@ -174,8 +197,8 @@ with: ### PCOV Specify `coverage: pcov` to use `PCOV` and disable `Xdebug`. -It is much faster than `Xdebug`. -`PCOV` needs `PHP >= 7.1`. +`PCOV` supports `PHP 7.1` and newer PHP versions. +Tests with `PCOV` run much faster than with `Xdebug`. If your source code directory is other than `src`, `lib` or, `app`, specify `pcov.directory` using the `ini-values` input. ```yaml @@ -285,12 +308,12 @@ jobs: tools: php-cs-fixer, phpunit ``` -### Experimental Setup +### Nightly Build Setup > Setup a nightly build of `PHP 8.0.0-dev` from the [master branch](https://github.com/php/php-src/tree/master "Master branch on PHP source repository") of PHP. -- This version is currently in development and is an experimental feature on this action. -- `PECL` is installed by default with this version on `ubuntu`. +- This version is currently in development. +- `PECL` is installed by default with this version on `ubuntu` and `macOS`. - Some extensions might not support this version currently. - Refer to this [RFC](https://wiki.php.net/rfc/jit "PHP JIT RFC configuration") for configuring `PHP JIT` on this version. - Refer to this [list of RFCs](https://wiki.php.net/rfc#php_80 "List of RFCs implemented in PHP8") implemented in this version. @@ -314,8 +337,6 @@ steps: > Setup PHP on a self-hosted runner. -- `PHP 5.6` and newer versions are supported on self-hosted runners. -- `Windows 7` and newer, `Windows Server 2012 R2` and newer, `Ubuntu 18.04`, `Ubuntu 16.04` and `MacOS X Catalina 10.15` are supported. - To setup a dockerized self-hosted runner, refer to this [guide](https://github.com/shivammathur/setup-php/wiki/Dockerized-self-hosted-runner-on-Ubuntu) to setup in an `Ubuntu` container and refer to this [guide](https://github.com/shivammathur/setup-php/wiki/Dockerized-self-hosted-runner-on-Windows) to setup in a `Windows` container. - To setup the runner directly on the host OS or in a VM, follow this [requirements guide](https://github.com/shivammathur/setup-php/wiki/Requirements-for-self-hosted-runners "Requirements guide for self-hosted runner to run setup-php") before setting up the self-hosted runner. @@ -366,6 +387,9 @@ Run the workflow locally with `act` using [`shivammathur/node`](https://github.c # For runs-on: ubuntu-latest act -P ubuntu-latest=shivammathur/node:latest +# For runs-on: ubuntu-20.04 +act -P ubuntu-20.04=shivammathur/node:focal + # For runs-on: ubuntu-18.04 act -P ubuntu-18.04=shivammathur/node:bionic @@ -454,7 +478,7 @@ steps: key: ${{ env.key }} - name: Cache extensions - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.cache-env.outputs.dir }} key: ${{ steps.cache-env.outputs.key }} @@ -479,7 +503,7 @@ If your project uses composer, you can persist composer's internal cache directo run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} @@ -507,7 +531,7 @@ If your project has node.js dependencies, you can persist npm's or yarn's cache run: echo "::set-output name=dir::$(npm config get cache)" # Use $(yarn cache dir) for yarn - name: Cache dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.node-cache-dir.outputs.dir }} key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} # Use '**/yarn.lock' for yarn @@ -609,7 +633,7 @@ Contributions are welcome! See [Contributor's Guide](.github/CONTRIBUTING.md "sh If this action helped you. -- To support this project subscribe on [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon") or sponsor using [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal"). +- Sponsor the project by subscribing on [Patreon](https://www.patreon.com/shivammathur "Shivam Mathur Patreon") or by contributing using [Paypal](https://www.paypal.me/shivammathur "Shivam Mathur PayPal"). - Please star the project and share it with the community. - If you blog, write about your experience of using this action. - If you need any help using this, please contact me using [Codementor](https://www.codementor.io/shivammathur "Shivam Mathur Codementor") diff --git a/__tests__/tools.test.ts b/__tests__/tools.test.ts index 07c2394e..863b7dc5 100644 --- a/__tests__/tools.test.ts +++ b/__tests__/tools.test.ts @@ -219,6 +219,41 @@ describe('Tools tests', () => { expect( await tools.addComposer(['a', 'b', 'composer:1.2.3']) ).toStrictEqual(['composer', 'a', 'b']); + expect( + await tools.addComposer(['a', 'b', 'composer:snapshot']) + ).toStrictEqual(['composer:snapshot', 'a', 'b']); + expect( + await tools.addComposer(['a', 'b', 'composer:preview']) + ).toStrictEqual(['composer:preview', 'a', 'b']); + expect( + await tools.addComposer(['a', 'b', 'c', 'composer:1']) + ).toStrictEqual(['composer:1', 'a', 'b', 'c']); + expect( + await tools.addComposer(['a', 'b', 'c', 'composer:2']) + ).toStrictEqual(['composer:2', 'a', 'b', 'c']); + expect( + await tools.addComposer(['a', 'b', 'c', 'composer:v1']) + ).toStrictEqual(['composer:1', 'a', 'b', 'c']); + expect( + await tools.addComposer(['a', 'b', 'c', 'composer:v2']) + ).toStrictEqual(['composer:2', 'a', 'b', 'c']); + }); + + it('checking updateComposer', async () => { + expect(await tools.updateComposer('latest', 'linux')).toContain(''); + expect(await tools.updateComposer('stable', 'win32')).toContain(''); + expect(await tools.updateComposer('snapshot', 'darwin')).toContain( + '\ncomposer self-update --snapshot' + ); + expect(await tools.updateComposer('preview', 'linux')).toContain( + '\ncomposer self-update --preview' + ); + expect(await tools.updateComposer('1', 'win32')).toContain( + '\ncomposer self-update --1' + ); + expect(await tools.updateComposer('2', 'darwin')).toContain( + '\ncomposer self-update --2' + ); }); it('checking getSymfonyUri', async () => { @@ -504,4 +539,24 @@ describe('Tools tests', () => { 'Add-Composertool composer-prefetcher composer-prefetcher narrowspark/automatic-' ); }); + it('checking composer setup', async () => { + let script: string = await tools.addTools( + 'composer, composer:v1', + '7.4', + 'linux' + ); + expect(script).toContain( + 'add_tool https://getcomposer.org/composer-stable.phar composer' + ); + expect(script).toContain('composer self-update --1'); + + script = await tools.addTools('composer:preview', '7.4', 'linux'); + expect(script).toContain('composer self-update --preview'); + script = await tools.addTools( + 'composer:v1, composer:preview, composer:snapshot', + '7.4', + 'linux' + ); + expect(script).toContain('composer self-update --snapshot'); + }); }); diff --git a/dist/index.js b/dist/index.js index 0d889f9b..0e9af736 100644 --- a/dist/index.js +++ b/dist/index.js @@ -973,7 +973,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -1030,7 +1030,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -1605,12 +1605,12 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.addTools = exports.addPackage = exports.addDevTools = exports.addArchive = exports.getCleanedToolsList = exports.addComposer = exports.getWpCliUrl = exports.getSymfonyUri = exports.getDeployerUrl = exports.getPharUrl = exports.addPhive = exports.getCodeceptionUri = exports.getCodeceptionUriBuilder = exports.getUri = exports.parseTool = exports.getToolVersion = exports.getCommand = void 0; +exports.addTools = exports.addPackage = exports.addDevTools = exports.addArchive = exports.getCleanedToolsList = exports.updateComposer = exports.addComposer = exports.getWpCliUrl = exports.getSymfonyUri = exports.getDeployerUrl = exports.getPharUrl = exports.addPhive = exports.getCodeceptionUri = exports.getCodeceptionUriBuilder = exports.getUri = exports.parseTool = exports.getToolVersion = exports.getCommand = void 0; const utils = __importStar(__webpack_require__(163)); /** * Function to get command to setup tools @@ -1638,8 +1638,10 @@ exports.getCommand = getCommand; async function getToolVersion(version) { // semver_regex - https://semver.org/ const semver_regex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; + const composer_regex = /^stable$|^preview$|^snapshot$|^v?[1|2]$/; version = version.replace(/[><=^]*/, ''); switch (true) { + case composer_regex.test(version): case semver_regex.test(version): return version; default: @@ -1864,19 +1866,42 @@ exports.getWpCliUrl = getWpCliUrl; * @param tools_list */ async function addComposer(tools_list) { - const regex = /^composer($|:.*)/; - const composer = tools_list.filter(tool => regex.test(tool))[0]; - switch (composer) { + const regex_any = /^composer($|:.*)/; + const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$)/; + const matches = tools_list.filter(tool => regex_valid.test(tool)); + let composer = 'composer'; + tools_list = tools_list.filter(tool => !regex_any.test(tool)); + switch (matches[0]) { case undefined: break; default: - tools_list = tools_list.filter(tool => !regex.test(tool)); + composer = matches[matches.length - 1].replace(/v([1-2])/, '$1'); break; } - tools_list.unshift('composer'); + tools_list.unshift(composer); return tools_list; } exports.addComposer = addComposer; +/** + * Function to get script to update composer + * + * @param version + * @param os_version + */ +async function updateComposer(version, os_version) { + switch (version) { + case 'snapshot': + case 'preview': + case '1': + case '2': + return ('\ncomposer self-update --' + + version + + (await utils.suppressOutput(os_version))); + default: + return ''; + } +} +exports.updateComposer = updateComposer; /** * Function to get Tools list after cleanup * @@ -2007,11 +2032,10 @@ async function addTools(tools_csv, php_version, os_version) { script += await addArchive(tool, version, url, os_version); break; case 'composer': - // If RC is released as latest release, switch to getcomposer. - // Prefered source is GitHub as it is faster. - // url = github + 'composer/composer/releases/latest/download/composer.phar'; url = 'https://getcomposer.org/composer-stable.phar'; - script += await addArchive(tool, version, url, os_version); + script += + (await addArchive('composer', version, url, os_version)) + + (await updateComposer(version, os_version)); break; case 'codeception': url = @@ -2106,7 +2130,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -2245,7 +2269,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -2338,7 +2362,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; @@ -2656,7 +2680,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? ( var __importStar = (this && this.__importStar) || function (mod) { if (mod && mod.__esModule) return mod; var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); __setModuleDefault(result, mod); return result; }; diff --git a/examples/bedrock.yml b/examples/bedrock.yml index 9d79b781..9a6d5b23 100644 --- a/examples/bedrock.yml +++ b/examples/bedrock.yml @@ -19,7 +19,7 @@ jobs: - name: Get composer cache directory id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/cakephp-mysql.yml b/examples/cakephp-mysql.yml index 0de09cd0..6272ae40 100644 --- a/examples/cakephp-mysql.yml +++ b/examples/cakephp-mysql.yml @@ -40,7 +40,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -73,7 +73,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -101,7 +101,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/cakephp-postgres.yml b/examples/cakephp-postgres.yml index 21aeaa8a..57831770 100644 --- a/examples/cakephp-postgres.yml +++ b/examples/cakephp-postgres.yml @@ -38,7 +38,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -71,7 +71,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -99,7 +99,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/cakephp.yml b/examples/cakephp.yml index 65e011b8..044fd82c 100644 --- a/examples/cakephp.yml +++ b/examples/cakephp.yml @@ -22,7 +22,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -51,7 +51,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. @@ -79,7 +79,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/codeigniter.yml b/examples/codeigniter.yml index 3d3bb03d..9fa2efd9 100644 --- a/examples/codeigniter.yml +++ b/examples/codeigniter.yml @@ -21,7 +21,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/laravel-mysql.yml b/examples/laravel-mysql.yml index af9c7031..8e9ad645 100644 --- a/examples/laravel-mysql.yml +++ b/examples/laravel-mysql.yml @@ -47,7 +47,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/laravel-postgres.yml b/examples/laravel-postgres.yml index e0b00391..aaf8b3e2 100644 --- a/examples/laravel-postgres.yml +++ b/examples/laravel-postgres.yml @@ -47,7 +47,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/laravel.yml b/examples/laravel.yml index 68480c3f..5498c88c 100644 --- a/examples/laravel.yml +++ b/examples/laravel.yml @@ -23,7 +23,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/lumen-mysql.yml b/examples/lumen-mysql.yml index 2c46c32b..ecf27230 100644 --- a/examples/lumen-mysql.yml +++ b/examples/lumen-mysql.yml @@ -47,7 +47,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/lumen-postgres.yml b/examples/lumen-postgres.yml index 609cecd5..a68cbe98 100644 --- a/examples/lumen-postgres.yml +++ b/examples/lumen-postgres.yml @@ -47,7 +47,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/lumen.yml b/examples/lumen.yml index 6c3f7b17..b905cbd3 100644 --- a/examples/lumen.yml +++ b/examples/lumen.yml @@ -23,7 +23,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/phalcon-mysql.yml b/examples/phalcon-mysql.yml index 0e6f8abe..10fd1c9c 100644 --- a/examples/phalcon-mysql.yml +++ b/examples/phalcon-mysql.yml @@ -47,7 +47,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/phalcon-postgres.yml b/examples/phalcon-postgres.yml index 321502d8..ee2b6ed6 100644 --- a/examples/phalcon-postgres.yml +++ b/examples/phalcon-postgres.yml @@ -46,7 +46,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/sage.yml b/examples/sage.yml index 3863b3a7..f664c6fc 100644 --- a/examples/sage.yml +++ b/examples/sage.yml @@ -27,7 +27,7 @@ jobs: - name: Get yarn cache id: yarn-cache run: echo "::set-output name=dir::$(yarn cache dir)" - - uses: actions/cache@v1 + - uses: actions/cache@v2 with: path: ${{ steps.yarn-cache.outputs.dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} @@ -36,7 +36,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/slim-framework.yml b/examples/slim-framework.yml index 329ed8b0..5263cf58 100644 --- a/examples/slim-framework.yml +++ b/examples/slim-framework.yml @@ -21,7 +21,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/symfony-mysql.yml b/examples/symfony-mysql.yml index 56966a82..a694f211 100644 --- a/examples/symfony-mysql.yml +++ b/examples/symfony-mysql.yml @@ -34,7 +34,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/symfony-postgres.yml b/examples/symfony-postgres.yml index e3638ea2..7297e25e 100644 --- a/examples/symfony-postgres.yml +++ b/examples/symfony-postgres.yml @@ -32,7 +32,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/symfony.yml b/examples/symfony.yml index 6c9a0d70..8e3bef1d 100644 --- a/examples/symfony.yml +++ b/examples/symfony.yml @@ -23,7 +23,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/yii2-mysql.yml b/examples/yii2-mysql.yml index e01b5c52..6dab880d 100644 --- a/examples/yii2-mysql.yml +++ b/examples/yii2-mysql.yml @@ -44,7 +44,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/yii2-postgres.yml b/examples/yii2-postgres.yml index b3465faf..4e854e06 100644 --- a/examples/yii2-postgres.yml +++ b/examples/yii2-postgres.yml @@ -42,7 +42,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/examples/zend-framework.yml b/examples/zend-framework.yml index 3a4921b6..960e2303 100644 --- a/examples/zend-framework.yml +++ b/examples/zend-framework.yml @@ -21,7 +21,7 @@ jobs: id: composer-cache run: echo "::set-output name=dir::$(composer config cache-files-dir)" - name: Cache composer dependencies - uses: actions/cache@v1 + uses: actions/cache@v2 with: path: ${{ steps.composer-cache.outputs.dir }} # Use composer.json for key, if composer.lock is not committed. diff --git a/package-lock.json b/package-lock.json index a3ea5e27..1d54641f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "setup-php", - "version": "2.2.2", + "version": "2.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -23,28 +23,28 @@ "integrity": "sha512-J8KuFqVPr3p6U8W93DOXlXW6zFvrQAJANdS+vw0YhusLIq+bszW8zmK2Fh1C2kDPX8FMvwIl1OUcFgvJoXLbAg==" }, "@babel/code-frame": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.8.3.tgz", - "integrity": "sha512-a9gxpmdXtZEInkCSHUJDLHZVBgb1QS0jhss4cPP93EW7s+uC5bikET2twEF3KV+7rDblJcmNvTR7VJejqd2C2g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.1.tgz", + "integrity": "sha512-IGhtTmpjGbYzcEDOw7DcQtbQSXcG9ftmAXtWTu9V936vDye4xjjekktFAtgZsWpzTj/X01jocB46mTywm/4SZw==", "dev": true, "requires": { - "@babel/highlight": "^7.8.3" + "@babel/highlight": "^7.10.1" } }, "@babel/core": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.6.tgz", - "integrity": "sha512-nD3deLvbsApbHAHttzIssYqgb883yU/d9roe4RZymBCDaZryMJDbptVpEpeQuRh4BJ+SYI8le9YGxKvFEvl1Wg==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.10.2.tgz", + "integrity": "sha512-KQmV9yguEjQsXqyOUGKjS4+3K8/DlOCE2pZcq4augdQmtTy5iv5EHtmMSJ7V4c1BIPjuwtZYqYLCq9Ga+hGBRQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-module-transforms": "^7.9.0", - "@babel/helpers": "^7.9.6", - "@babel/parser": "^7.9.6", - "@babel/template": "^7.8.6", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6", + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.2", + "@babel/helper-module-transforms": "^7.10.1", + "@babel/helpers": "^7.10.1", + "@babel/parser": "^7.10.2", + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.2", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -55,6 +55,15 @@ "source-map": "^0.5.0" }, "dependencies": { + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -70,12 +79,12 @@ } }, "@babel/generator": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.9.6.tgz", - "integrity": "sha512-+htwWKJbH2bL72HRluF8zumBxzuX0ZZUFl3JLNyoUjM/Ho8wnVpPXM6aUz8cfKDqQ/h7zHqKt4xzJteUosckqQ==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.10.2.tgz", + "integrity": "sha512-AxfBNHNu99DTMvlUPlt1h2+Hn7knPpH5ayJ8OqDWSeLld+Fi2AYBTC/IejWDM9Edcii4UzZRCsbUt0WlSDsDsA==", "dev": true, "requires": { - "@babel/types": "^7.9.6", + "@babel/types": "^7.10.2", "jsesc": "^2.5.1", "lodash": "^4.17.13", "source-map": "^0.5.0" @@ -90,128 +99,128 @@ } }, "@babel/helper-function-name": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.9.5.tgz", - "integrity": "sha512-JVcQZeXM59Cd1qanDUxv9fgJpt3NeKUaqBqUEvfmQ+BCOKq2xUgaWZW2hr0dkbyJgezYuplEoh5knmrnS68efw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.1.tgz", + "integrity": "sha512-fcpumwhs3YyZ/ttd5Rz0xn0TpIwVkN7X0V38B9TWNfVF42KEkhkAAuPCQ3oXmtTRtiPJrmZ0TrfS0GKF0eMaRQ==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "^7.8.3", - "@babel/template": "^7.8.3", - "@babel/types": "^7.9.5" + "@babel/helper-get-function-arity": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-get-function-arity": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.8.3.tgz", - "integrity": "sha512-FVDR+Gd9iLjUMY1fzE2SR0IuaJToR4RkCDARVfsBBPSP53GEqSFjD8gNyxg246VUyc/ALRxFaAK8rVG7UT7xRA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.1.tgz", + "integrity": "sha512-F5qdXkYGOQUb0hpRaPoetF9AnsXknKjWMZ+wmsIRsp5ge5sFh4c3h1eH2pRTTuy9KKAA2+TTYomGXAtEL2fQEw==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.8.3.tgz", - "integrity": "sha512-fO4Egq88utkQFjbPrSHGmGLFqmrshs11d46WI+WZDESt7Wu7wN2G2Iu+NMMZJFDOVRHAMIkB5SNh30NtwCA7RA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.10.1.tgz", + "integrity": "sha512-u7XLXeM2n50gb6PWJ9hoO5oO7JFPaZtrh35t8RqKLT1jFKj9IWeD1zrcrYp1q1qiZTdEarfDWfTIP8nGsu0h5g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-module-imports": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.8.3.tgz", - "integrity": "sha512-R0Bx3jippsbAEtzkpZ/6FIiuzOURPcMjHp+Z6xPe6DtApDJx+w7UYyOLanZqO8+wKR9G10s/FmHXvxaMd9s6Kg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.1.tgz", + "integrity": "sha512-SFxgwYmZ3HZPyZwJRiVNLRHWuW2OgE5k2nrVs6D9Iv4PPnXVffuEHy83Sfx/l4SqF+5kyJXjAyUmrG7tNm+qVg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-module-transforms": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.9.0.tgz", - "integrity": "sha512-0FvKyu0gpPfIQ8EkxlrAydOWROdHpBmiCiRwLkUiBGhCUPRRbVD2/tm3sFr/c/GWFrQ/ffutGUAnx7V0FzT2wA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.10.1.tgz", + "integrity": "sha512-RLHRCAzyJe7Q7sF4oy2cB+kRnU4wDZY/H2xJFGof+M+SJEGhZsb+GFj5j1AD8NiSaVBJ+Pf0/WObiXu/zxWpFg==", "dev": true, "requires": { - "@babel/helper-module-imports": "^7.8.3", - "@babel/helper-replace-supers": "^7.8.6", - "@babel/helper-simple-access": "^7.8.3", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/template": "^7.8.6", - "@babel/types": "^7.9.0", + "@babel/helper-module-imports": "^7.10.1", + "@babel/helper-replace-supers": "^7.10.1", + "@babel/helper-simple-access": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1", "lodash": "^4.17.13" } }, "@babel/helper-optimise-call-expression": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.8.3.tgz", - "integrity": "sha512-Kag20n86cbO2AvHca6EJsvqAd82gc6VMGule4HwebwMlwkpXuVqrNRj6CkCV2sKxgi9MyAUnZVnZ6lJ1/vKhHQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.1.tgz", + "integrity": "sha512-a0DjNS1prnBsoKx83dP2falChcs7p3i8VMzdrSbfLhuQra/2ENC4sbri34dz/rWmDADsmF1q5GbfaXydh0Jbjg==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-plugin-utils": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.8.3.tgz", - "integrity": "sha512-j+fq49Xds2smCUNYmEHF9kGNkhbet6yVIBp4e6oeQpH1RUs/Ir06xUKzDjDkGcaaokPiTNs2JBWHjaE4csUkZQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.1.tgz", + "integrity": "sha512-fvoGeXt0bJc7VMWZGCAEBEMo/HAjW2mP8apF5eXK0wSqwLAVHAISCWRoLMBMUs2kqeaG77jltVqu4Hn8Egl3nA==", "dev": true }, "@babel/helper-replace-supers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.9.6.tgz", - "integrity": "sha512-qX+chbxkbArLyCImk3bWV+jB5gTNU/rsze+JlcF6Nf8tVTigPJSI1o1oBow/9Resa1yehUO9lIipsmu9oG4RzA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.1.tgz", + "integrity": "sha512-SOwJzEfpuQwInzzQJGjGaiG578UYmyi2Xw668klPWV5n07B73S0a9btjLk/52Mlcxa+5AdIYqws1KyXRfMoB7A==", "dev": true, "requires": { - "@babel/helper-member-expression-to-functions": "^7.8.3", - "@babel/helper-optimise-call-expression": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" + "@babel/helper-member-expression-to-functions": "^7.10.1", + "@babel/helper-optimise-call-expression": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-simple-access": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.8.3.tgz", - "integrity": "sha512-VNGUDjx5cCWg4vvCTR8qQ7YJYZ+HBjxOgXEl7ounz+4Sn7+LMD3CFrCTEU6/qXKbA2nKg21CwhhBzO0RpRbdCw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.1.tgz", + "integrity": "sha512-VSWpWzRzn9VtgMJBIWTZ+GP107kZdQ4YplJlCmIrjoLVSi/0upixezHCDG8kpPVTBJpKfxTH01wDhh+jS2zKbw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/types": "^7.8.3" + "@babel/template": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/helper-split-export-declaration": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.8.3.tgz", - "integrity": "sha512-3x3yOeyBhW851hroze7ElzdkeRXQYQbFIb7gLK1WQYsw2GWDay5gAJNw1sWJ0VFP6z5J1whqeXH/WCdCjZv6dA==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.10.1.tgz", + "integrity": "sha512-UQ1LVBPrYdbchNhLwj6fetj46BcFwfS4NllJo/1aJsT+1dLTEnXJL0qHqtY7gPzF8S2fXBJamf1biAXV3X077g==", "dev": true, "requires": { - "@babel/types": "^7.8.3" + "@babel/types": "^7.10.1" } }, "@babel/helper-validator-identifier": { - "version": "7.9.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.9.5.tgz", - "integrity": "sha512-/8arLKUFq882w4tWGj9JYzRpAlZgiWUJ+dtteNTDqrRBz9Iguck9Rn3ykuBDoUwh2TO4tSAJlrxDUOXWklJe4g==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.1.tgz", + "integrity": "sha512-5vW/JXLALhczRCWP0PnFDMCJAchlBvM7f4uk/jXritBnIa6E1KmqmtrS3yn1LAnxFBypQ3eneLuXjsnfQsgILw==", "dev": true }, "@babel/helpers": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.9.6.tgz", - "integrity": "sha512-tI4bUbldloLcHWoRUMAj4g1bF313M/o6fBKhIsb3QnGVPwRm9JsNf/gqMkQ7zjqReABiffPV6RWj7hEglID5Iw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.1.tgz", + "integrity": "sha512-muQNHF+IdU6wGgkaJyhhEmI54MOZBKsFfsXFhboz1ybwJ1Kl7IHlbm2a++4jwrmY5UYsgitt5lfqo1wMFcHmyw==", "dev": true, "requires": { - "@babel/template": "^7.8.3", - "@babel/traverse": "^7.9.6", - "@babel/types": "^7.9.6" + "@babel/template": "^7.10.1", + "@babel/traverse": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/highlight": { - "version": "7.9.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.9.0.tgz", - "integrity": "sha512-lJZPilxX7Op3Nv/2cvFdnlepPXDxi29wxteT57Q965oc5R9v86ztx0jfxVrTcBk8C2kcPkkDa2Z4T3ZsPPVWsQ==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.1.tgz", + "integrity": "sha512-8rMof+gVP8mxYZApLF/JgNDAkdKa+aJt3ZYxF8z6+j/hpeXL7iMsKCPHa2jNMHu/qqBwzQF4OHNoYi8dMA/rYg==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.0", + "@babel/helper-validator-identifier": "^7.10.1", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -269,9 +278,9 @@ } }, "@babel/parser": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.9.6.tgz", - "integrity": "sha512-AoeIEJn8vt+d/6+PXDRPaksYhnlbMIiejioBZvvMQsOjW/JYK6k/0dKnvvP3EhK5GfMBWDPtrxRtegWdAcdq9Q==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.10.2.tgz", + "integrity": "sha512-PApSXlNMJyB4JiGVhCOlzKIif+TKFTvu0aQAhnTvfP/z3vVSN6ZypH5bfUNwFXXjRQtUEBNFd2PtmCmG2Py3qQ==", "dev": true }, "@babel/plugin-syntax-async-generators": { @@ -293,12 +302,12 @@ } }, "@babel/plugin-syntax-class-properties": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.8.3.tgz", - "integrity": "sha512-UcAyQWg2bAN647Q+O811tG9MrJ38Z10jjhQdKNAL8fsyPzE3cCN/uT+f55cFVY4aGO4jqJAvmqsuY3GQDwAoXg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.1.tgz", + "integrity": "sha512-Gf2Yx/iRs1JREDtVZ56OrjjgFHCaldpTnuy9BHla10qyVT3YkIIGEtoDWhyop0ksu1GvNjHIoYRBqm3zoR1jyQ==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.1" } }, "@babel/plugin-syntax-json-strings": { @@ -311,12 +320,12 @@ } }, "@babel/plugin-syntax-logical-assignment-operators": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.8.3.tgz", - "integrity": "sha512-Zpg2Sgc++37kuFl6ppq2Q7Awc6E6AIW671x5PY8E/f7MCIyPPGK/EoeZXvvY3P42exZ3Q4/t3YOzP/HiN79jDg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.1.tgz", + "integrity": "sha512-XyHIFa9kdrgJS91CUH+ccPVTnJShr8nLGc5bG2IhGXv5p1Rd+8BleGE5yzIg2Nc1QZAdHDa0Qp4m6066OL96Iw==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.1" } }, "@babel/plugin-syntax-nullish-coalescing-operator": { @@ -329,12 +338,12 @@ } }, "@babel/plugin-syntax-numeric-separator": { - "version": "7.8.3", - "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.8.3.tgz", - "integrity": "sha512-H7dCMAdN83PcCmqmkHB5dtp+Xa9a6LKSvA2hiFBC/5alSHxM5VgWZXFqDi0YFe8XNGT6iCa+z4V4zSt/PdZ7Dw==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.1.tgz", + "integrity": "sha512-uTd0OsHrpe3tH5gRPTxG8Voh99/WCU78vIm5NMRYPAqC8lR4vajt6KkCAknCHrx24vkPdd/05yfdGSB4EIY2mg==", "dev": true, "requires": { - "@babel/helper-plugin-utils": "^7.8.3" + "@babel/helper-plugin-utils": "^7.10.1" } }, "@babel/plugin-syntax-object-rest-spread": { @@ -365,28 +374,28 @@ } }, "@babel/template": { - "version": "7.8.6", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.8.6.tgz", - "integrity": "sha512-zbMsPMy/v0PWFZEhQJ66bqjhH+z0JgMoBWuikXybgG3Gkd/3t5oQ1Rw2WQhnSrsOmsKXnZOx15tkC4qON/+JPg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.1.tgz", + "integrity": "sha512-OQDg6SqvFSsc9A0ej6SKINWrpJiNonRIniYondK2ViKhB06i3c0s+76XUft71iqBEe9S1OKsHwPAjfHnuvnCig==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/parser": "^7.8.6", - "@babel/types": "^7.8.6" + "@babel/code-frame": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1" } }, "@babel/traverse": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.9.6.tgz", - "integrity": "sha512-b3rAHSjbxy6VEAvlxM8OV/0X4XrG72zoxme6q1MOoe2vd0bEc+TwayhuC1+Dfgqh1QEG+pj7atQqvUprHIccsg==", + "version": "7.10.1", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.10.1.tgz", + "integrity": "sha512-C/cTuXeKt85K+p08jN6vMDz8vSV0vZcI0wmQ36o6mjbuo++kPMdpOYw23W2XH04dbRt9/nMEfA4W3eR21CD+TQ==", "dev": true, "requires": { - "@babel/code-frame": "^7.8.3", - "@babel/generator": "^7.9.6", - "@babel/helper-function-name": "^7.9.5", - "@babel/helper-split-export-declaration": "^7.8.3", - "@babel/parser": "^7.9.6", - "@babel/types": "^7.9.6", + "@babel/code-frame": "^7.10.1", + "@babel/generator": "^7.10.1", + "@babel/helper-function-name": "^7.10.1", + "@babel/helper-split-export-declaration": "^7.10.1", + "@babel/parser": "^7.10.1", + "@babel/types": "^7.10.1", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.13" @@ -401,12 +410,12 @@ } }, "@babel/types": { - "version": "7.9.6", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.9.6.tgz", - "integrity": "sha512-qxXzvBO//jO9ZnoasKF1uJzHd2+M6Q2ZPIVfnFps8JJvXy0ZBbwbNOmE6SGIY5XOY6d1Bo5lb9d9RJ8nv3WSeA==", + "version": "7.10.2", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.10.2.tgz", + "integrity": "sha512-AD3AwWBSz0AWF0AkCN9VPiWrvldXq+/e3cHa4J89vo4ymjz1XwrBFFVZmkJTsQIPNk+ZVomPSXUJqq8yyjZsng==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.9.5", + "@babel/helper-validator-identifier": "^7.10.1", "lodash": "^4.17.13", "to-fast-properties": "^2.0.0" } @@ -910,9 +919,9 @@ } }, "@types/babel__core": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.7.tgz", - "integrity": "sha512-RL62NqSFPCDK2FM1pSDH0scHpJvsXtZNiYlMB73DgPBaG1E38ZYVL+ei5EkWRbr+KC4YNiAUNBnRj+bgwpgjMw==", + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.8.tgz", + "integrity": "sha512-KXBiQG2OXvaPWFPDS1rD8yV9vO0OuWIqAEqLsbfX0oU2REN5KuoMnZ1gClWcBhO5I3n6oTVAmrMufOvRqdmFTQ==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -942,9 +951,9 @@ } }, "@types/babel__traverse": { - "version": "7.0.11", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.11.tgz", - "integrity": "sha512-ddHK5icION5U6q11+tV2f9Mo6CZVuT8GJKld2q9LqHSZbvLbH34Kcu2yFGckZut453+eQU6btIA3RihmnRgI+Q==", + "version": "7.0.12", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.12.tgz", + "integrity": "sha512-t4CoEokHTfcyfb4hUaF9oOHu9RmmNWnm1CP0YmMqOOfClKascOmvlEM736vlqeScuGvBDsHkf8R2INd4DWreQA==", "dev": true, "requires": { "@babel/types": "^7.3.0" @@ -1012,10 +1021,16 @@ "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", "dev": true }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", + "dev": true + }, "@types/node": { - "version": "14.0.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.5.tgz", - "integrity": "sha512-90hiq6/VqtQgX8Sp0EzeIsv3r+ellbGj4URKj5j30tLlZvRUpnAe9YbYnjl3pJM93GyXU0tghHhvXHq+5rnCKA==", + "version": "14.0.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.0.12.tgz", + "integrity": "sha512-/sjzehvjkkpvLpYtN6/2dv5kg41otMGuHQUt9T2aiAuIfleCQRQHXXzF1eAw/qkZTj5Kcf4JSTf7EIizHocy6Q==", "dev": true }, "@types/normalize-package-data": { @@ -1058,12 +1073,12 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.0.0.tgz", - "integrity": "sha512-lcZ0M6jD4cqGccYOERKdMtg+VWpoq3NSnWVxpc/AwAy0zhkUYVioOUZmfNqiNH8/eBNGhCn6HXd6mKIGRgNc1Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.2.0.tgz", + "integrity": "sha512-t9RTk/GyYilIXt6BmZurhBzuMT9kLKw3fQoJtK9ayv0tXTlznXEAnx07sCLXdkN3/tZDep1s1CEV95CWuARYWA==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "3.0.0", + "@typescript-eslint/experimental-utils": "3.2.0", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", "semver": "^7.3.2", @@ -1071,33 +1086,33 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.0.0.tgz", - "integrity": "sha512-BN0vmr9N79M9s2ctITtChRuP1+Dls0x/wlg0RXW1yQ7WJKPurg6X3Xirv61J2sjPif4F8SLsFMs5Nzte0WYoTQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.2.0.tgz", + "integrity": "sha512-UbJBsk+xO9dIFKtj16+m42EvUvsjZbbgQ2O5xSTSfVT1Z3yGkL90DVu0Hd3029FZ5/uBgl+F3Vo8FAcEcqc6aQ==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "3.0.0", + "@typescript-eslint/typescript-estree": "3.2.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" } }, "@typescript-eslint/parser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.0.0.tgz", - "integrity": "sha512-8RRCA9KLxoFNO0mQlrLZA0reGPd/MsobxZS/yPFj+0/XgMdS8+mO8mF3BDj2ZYQj03rkayhSJtF1HAohQ3iylw==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.2.0.tgz", + "integrity": "sha512-Vhu+wwdevDLVDjK1lIcoD6ZbuOa93fzqszkaO3iCnmrScmKwyW/AGkzc2UvfE5TCoCXqq7Jyt6SOXjsIlpqF4A==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.0.0", - "@typescript-eslint/typescript-estree": "3.0.0", + "@typescript-eslint/experimental-utils": "3.2.0", + "@typescript-eslint/typescript-estree": "3.2.0", "eslint-visitor-keys": "^1.1.0" } }, "@typescript-eslint/typescript-estree": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.0.0.tgz", - "integrity": "sha512-nevQvHyNghsfLrrByzVIH4ZG3NROgJ8LZlfh3ddwPPH4CH7W4GAiSx5qu+xHuX5pWsq6q/eqMc1io840ZhAnUg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.2.0.tgz", + "integrity": "sha512-uh+Y2QO7dxNrdLw7mVnjUqkwO/InxEqwN0wF+Za6eo3coxls9aH9kQ/5rSvW2GcNanebRTmsT5w1/92lAOb1bA==", "dev": true, "requires": { "debug": "^4.1.1", @@ -1110,9 +1125,9 @@ } }, "@zeit/ncc": { - "version": "0.22.2", - "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.2.tgz", - "integrity": "sha512-LGW5RPIwulh+fyKiMTgbIEbdc/hdf/4+U5B1WbT/We0jweHoywDbk9hi+3hNjSzQNShGumP72zgc6PHEUG5syg==", + "version": "0.22.3", + "resolved": "https://registry.npmjs.org/@zeit/ncc/-/ncc-0.22.3.tgz", + "integrity": "sha512-jnCLpLXWuw/PAiJiVbLjA8WBC0IJQbFeUwF4I9M+23MvIxTxk5pD4Q8byQBSPmHQjz5aBoA7AKAElQxMpjrCLQ==", "dev": true }, "abab": { @@ -1304,9 +1319,9 @@ "dev": true }, "aws4": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.9.1.tgz", - "integrity": "sha512-wMHVg2EOHaMRxbzgFJ9gtjOOCrI80OHLG14rxi28XwOW8ux6IiEbRCGGGqCtdAIg4FQCbW20k9RsT4y3gJlFug==", + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz", + "integrity": "sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==", "dev": true }, "babel-jest": { @@ -1766,9 +1781,9 @@ } }, "cross-spawn": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", - "integrity": "sha512-PD6G8QG3S4FK/XCGFbEQrDqO2AnMMsy0meR7lerlIOHAAbkuavGU/pOqprrlvfTNjvowivTeBsjebAL0NSoMxw==", + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -2029,9 +2044,9 @@ "dev": true }, "escodegen": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.1.tgz", - "integrity": "sha512-Bmt7NcRySdIfNPfU2ZoXDrrXsG9ZjvDxcAlMfDUgRBjLOWTuIACXPBFJH7Z+cLb40JeQco5toikyc9t9P8E9SQ==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.2.tgz", + "integrity": "sha512-InuOIiKk8wwuOFg6x9BQXbzjrQhtyXh46K9bqVTPzSo2FnyMBaYGBMC6PhQy7yxxil9vIedFBweQBMK74/7o8A==", "dev": true, "requires": { "esprima": "^4.0.1", @@ -2083,9 +2098,9 @@ } }, "eslint": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.0.0.tgz", - "integrity": "sha512-qY1cwdOxMONHJfGqw52UOpZDeqXy8xmD0u8CT6jIstil72jkhURC704W8CFyTPDPllz4z4lu0Ql1+07PG/XdIg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.2.0.tgz", + "integrity": "sha512-B3BtEyaDKC5MlfDa2Ha8/D6DsS4fju95zs0hjS3HdGazw+LNayai38A25qMppK37wWGWNYSPOR6oYzlz5MHsRQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -2094,10 +2109,10 @@ "cross-spawn": "^7.0.2", "debug": "^4.0.1", "doctrine": "^3.0.0", - "eslint-scope": "^5.0.0", + "eslint-scope": "^5.1.0", "eslint-utils": "^2.0.0", - "eslint-visitor-keys": "^1.1.0", - "espree": "^7.0.0", + "eslint-visitor-keys": "^1.2.0", + "espree": "^7.1.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -2202,23 +2217,24 @@ } }, "eslint-plugin-import": { - "version": "2.20.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.20.2.tgz", - "integrity": "sha512-FObidqpXrR8OnCh4iNsxy+WACztJLXAHBO5hK79T1Hc77PgQZkyDGA5Ag9xAvRpglvLNxhH/zSmZ70/pZ31dHg==", + "version": "2.21.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.21.1.tgz", + "integrity": "sha512-qYOOsgUv63vHof7BqbzuD+Ud34bXHxFJxntuAC1ZappFZXYbRIek3aJ7jc9i2dHDGDyZ/0zlO0cpioES265Lsw==", "dev": true, "requires": { - "array-includes": "^3.0.3", - "array.prototype.flat": "^1.2.1", + "array-includes": "^3.1.1", + "array.prototype.flat": "^1.2.3", "contains-path": "^0.1.0", "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "^0.3.2", - "eslint-module-utils": "^2.4.1", + "eslint-import-resolver-node": "^0.3.3", + "eslint-module-utils": "^2.6.0", "has": "^1.0.3", "minimatch": "^3.0.4", - "object.values": "^1.1.0", + "object.values": "^1.1.1", "read-pkg-up": "^2.0.0", - "resolve": "^1.12.0" + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0" }, "dependencies": { "debug": { @@ -2249,9 +2265,9 @@ } }, "eslint-plugin-jest": { - "version": "23.13.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.13.1.tgz", - "integrity": "sha512-TRLJH6M6EDvGocD98a7yVThrAOCK9WJfo9phuUb0MJptcrOYZeCKzC9aOzZCD93sxXCsiJVZywaTHdI/mAi0FQ==", + "version": "23.13.2", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-23.13.2.tgz", + "integrity": "sha512-qZit+moTXTyZFNDqSIR88/L3rdBlTU7CuW6XmyErD2FfHEkdoLgThkRbiQjzgYnX6rfgLx3Ci4eJmF4Ui5v1Cw==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "^2.5.0" @@ -2296,9 +2312,9 @@ } }, "eslint-scope": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", - "integrity": "sha512-oYrhJW7S0bxAFDvWqzvMPRm6pcgcnWc4QnofCAqRTRfQC0JcwenzGglTtsLyIuuWFfkqDG9vz67cnttSd53djw==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -2315,20 +2331,20 @@ } }, "eslint-visitor-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz", - "integrity": "sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.2.0.tgz", + "integrity": "sha512-WFb4ihckKil6hu3Dp798xdzSfddwKKU3+nGniKF6HfeW6OLd2OUDEPP7TcHtB5+QXOKg2s6B2DaMPE1Nn/kxKQ==", "dev": true }, "espree": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-7.0.0.tgz", - "integrity": "sha512-/r2XEx5Mw4pgKdyb7GNLQNsu++asx/dltf/CI8RFi9oGHxmQFgvLbc5Op4U6i8Oaj+kdslhJtVlEZeAqH5qOTw==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-7.1.0.tgz", + "integrity": "sha512-dcorZSyfmm4WTuTnE5Y7MEN1DyoPYy1ZR783QW1FJoenn7RailyWFsq/UL6ZAAA7uXurN9FIpYyUs3OfiIW+Qw==", "dev": true, "requires": { - "acorn": "^7.1.1", + "acorn": "^7.2.0", "acorn-jsx": "^5.2.0", - "eslint-visitor-keys": "^1.1.0" + "eslint-visitor-keys": "^1.2.0" } }, "esprima": { @@ -2657,9 +2673,9 @@ "dev": true }, "fast-deep-equal": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", - "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==", + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-diff": { @@ -3298,9 +3314,9 @@ "dev": true }, "is-callable": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz", - "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.0.tgz", + "integrity": "sha512-pyVD9AaGLxtg6srb2Ng6ynWJqkHU9bEM087AKck0w8QwDarTfNcpIYoU8x8Hv2Icm8u6kFJM18Dag8lyqGkviw==", "dev": true }, "is-ci": { @@ -3419,12 +3435,12 @@ "dev": true }, "is-regex": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz", - "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.0.tgz", + "integrity": "sha512-iI97M8KTWID2la5uYXlkbSDQIg4F6o1sYboZKKTDpnDQMLtUL86zxhgDet3Q2SriaYsyGqZ6Mn2SjbRKeLHdqw==", "dev": true, "requires": { - "has": "^1.0.3" + "has-symbols": "^1.0.1" } }, "is-stream": { @@ -3642,9 +3658,9 @@ } }, "execa": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.1.tgz", - "integrity": "sha512-SCjM/zlBdOK8Q5TIjOn6iEHZaPHFsMoTxXQ2nvUvtPnuohz3H2dIozSg+etNR98dGoYUp2ENSKLL/XaMmbxVgw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.2.tgz", + "integrity": "sha512-QI2zLa6CjGWdiQsmSkZoGtDx2N+cQIGb3yNolGTdjSQzydzLgYYf8LRuagp7S7fPimjcrzUDSUFd/MgzELMi4Q==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -4814,9 +4830,9 @@ "dev": true }, "js-yaml": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", - "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -4900,12 +4916,12 @@ "dev": true }, "json5": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "dev": true, "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.0" } }, "jsprim": { @@ -5179,9 +5195,9 @@ "dev": true }, "node-notifier": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-7.0.0.tgz", - "integrity": "sha512-y8ThJESxsHcak81PGpzWwQKxzk+5YtP3IxR8AYdpXQ1IB6FmcVzFdZXrkPin49F/DKUCfeeiziB8ptY9npzGuA==", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-7.0.1.tgz", + "integrity": "sha512-VkzhierE7DBmQEElhTGJIoiZa1oqRijOtgOlsXg32KrJRXsPy0NXFBqWGW/wTswnJlDCs5viRYaqWguqzsKcmg==", "dev": true, "optional": true, "requires": { @@ -5352,9 +5368,9 @@ } }, "opencollective-postinstall": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz", - "integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", "dev": true }, "optionator": { @@ -6304,9 +6320,9 @@ "dev": true }, "spdx-correct": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -6706,9 +6722,9 @@ } }, "ts-jest": { - "version": "26.0.0", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.0.0.tgz", - "integrity": "sha512-eBpWH65mGgzobuw7UZy+uPP9lwu+tPp60o324ASRX4Ijg8UC5dl2zcge4kkmqr2Zeuk9FwIjvCTOPuNMEyGWWw==", + "version": "26.1.0", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-26.1.0.tgz", + "integrity": "sha512-JbhQdyDMYN5nfKXaAwCIyaWLGwevcT2/dbqRPsQeh6NZPUuXjZQZEfeLb75tz0ubCIgEELNm6xAzTe5NXs5Y4Q==", "dev": true, "requires": { "bs-logger": "0.x", @@ -6723,6 +6739,15 @@ "yargs-parser": "18.x" }, "dependencies": { + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -6731,6 +6756,18 @@ } } }, + "tsconfig-paths": { + "version": "3.9.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz", + "integrity": "sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==", + "dev": true, + "requires": { + "@types/json5": "^0.0.29", + "json5": "^1.0.1", + "minimist": "^1.2.0", + "strip-bom": "^3.0.0" + } + }, "tslib": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", @@ -6792,9 +6829,9 @@ } }, "typescript": { - "version": "3.9.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", - "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", + "version": "3.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.5.tgz", + "integrity": "sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ==", "dev": true }, "union-value": { @@ -6878,9 +6915,9 @@ "optional": true }, "v8-compile-cache": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.0.tgz", - "integrity": "sha512-usZBT3PW+LOjM25wbqIlZwPeJV+3OSz3M1k1Ws8snlW39dZyYL9lOGC5FgPVHfk0jKmjiDV8Z0mIbVQPiwFs7g==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "dev": true }, "v8-to-istanbul": { diff --git a/package.json b/package.json index 3c3ba4d3..dfb511bd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "setup-php", - "version": "2.2.2", + "version": "2.3.0", "private": false, "description": "Setup PHP for use with GitHub Actions", "main": "dist/index.js", @@ -31,21 +31,21 @@ }, "devDependencies": { "@types/jest": "^25.2.3", - "@types/node": "^14.0.5", - "@typescript-eslint/eslint-plugin": "^3.0.0", - "@typescript-eslint/parser": "^3.0.0", - "@zeit/ncc": "^0.22.2", - "eslint": "^7.0.0", + "@types/node": "^14.0.12", + "@typescript-eslint/eslint-plugin": "^3.2.0", + "@typescript-eslint/parser": "^3.2.0", + "@zeit/ncc": "^0.22.3", + "eslint": "^7.2.0", "eslint-config-prettier": "^6.11.0", - "eslint-plugin-import": "^2.20.2", - "eslint-plugin-jest": "^23.13.1", + "eslint-plugin-import": "^2.21.1", + "eslint-plugin-jest": "^23.13.2", "eslint-plugin-prettier": "^3.1.3", "husky": "^4.2.5", "jest": "^26.0.1", "jest-circus": "^26.0.1", "prettier": "^2.0.5", - "ts-jest": "^26.0.0", - "typescript": "^3.9.3" + "ts-jest": "^26.1.0", + "typescript": "^3.9.5" }, "husky": { "skipCI": true, diff --git a/src/scripts/darwin.sh b/src/scripts/darwin.sh index 3cae05a0..4e7a845c 100644 --- a/src/scripts/darwin.sh +++ b/src/scripts/darwin.sh @@ -1,10 +1,10 @@ -# Function to log start of a operation +# Function to log start of a operation. step_log() { message=$1 printf "\n\033[90;1m==> \033[0m\033[37;1m%s\033[0m\n" "$message" } -# Function to log result of a operation +# Function to log result of a operation. add_log() { mark=$1 subject=$2 @@ -16,7 +16,24 @@ add_log() { fi } -# Function to remove extensions +# Function to read env inputs. +read_env() { + [[ -z "${update}" ]] && update='false' && UPDATE='false' || update="${update}" + [ "$update" = false ] && [[ -n ${UPDATE} ]] && update="${UPDATE}" + [[ -z "${runner}" ]] && runner='github' && RUNNER='github' || runner="${runner}" + [ "$runner" = false ] && [[ -n ${RUNNER} ]] && runner="${RUNNER}" +} + +# Function to setup environment for self-hosted runners. +self_hosted_setup() { + if [[ $(command -v brew) == "" ]]; then + step_log "Setup Brew" + curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | bash -s >/dev/null 2>&1 + add_log "$tick" "Brew" "Installed Homebrew" + fi +} + +# Function to remove extensions. remove_extension() { extension=$1 if check_extension "$extension"; then @@ -30,7 +47,7 @@ remove_extension() { fi } -# Function to test if extension is loaded +# Function to test if extension is loaded. check_extension() { extension=$1 if [ "$extension" != "mysql" ]; then @@ -40,7 +57,7 @@ check_extension() { fi } -# Fuction to get the PECL version +# Fuction to get the PECL version. get_pecl_version() { extension=$1 stability=$2 @@ -53,7 +70,7 @@ get_pecl_version() { echo "$pecl_version" } -# Function to install a PECL version +# Function to install a specific version of PECL extension. add_pecl_extension() { extension=$1 pecl_version=$2 @@ -91,7 +108,7 @@ add_extension() { fi } -# Function to pre-release extensions using PECL +# Function to setup pre-release extensions using PECL. add_unstable_extension() { extension=$1 stability=$2 @@ -100,7 +117,7 @@ add_unstable_extension() { add_pecl_extension "$extension" "$pecl_version" "$prefix" } -# Function to setup a remote tool +# Function to setup a remote tool. add_tool() { url=$1 tool=$2 @@ -118,6 +135,10 @@ add_tool() { if [ -n "$COMPOSER_TOKEN" ]; then composer -q global config github-oauth.github.com "$COMPOSER_TOKEN" fi + # TODO: Remove after composer 2.0 update, fixes peer fingerprint error + if [[ "$version" =~ $old_versions ]]; then + composer -q global config repos.packagist composer https://repo-ca-bhs-1.packagist.org + fi elif [ "$tool" = "phan" ]; then add_extension fileinfo "sudo pecl install -f fileinfo" extension >/dev/null 2>&1 add_extension ast "sudo pecl install -f ast" extension >/dev/null 2>&1 @@ -138,7 +159,7 @@ add_tool() { fi } -# Function to add a tool using composer +# Function to add a tool using composer. add_composertool() { tool=$1 release=$2 @@ -153,9 +174,13 @@ add_blackfire() { sudo mkdir -p usr/local/var/run brew tap blackfireio/homebrew-blackfire >/dev/null 2>&1 brew install blackfire-agent >/dev/null 2>&1 - sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1 - brew services start blackfire-agent >/dev/null 2>&1 - sudo blackfire --config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1 + if [[ -n $BLACKFIRE_SERVER_ID ]] && [[ -n $BLACKFIRE_SERVER_TOKEN ]]; then + sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1 + brew services start blackfire-agent >/dev/null 2>&1 + fi + if [[ -n $BLACKFIRE_CLIENT_ID ]] && [[ -n $BLACKFIRE_CLIENT_TOKEN ]]; then + sudo blackfire config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1 + fi add_log "$tick" "blackfire" "Added" add_log "$tick" "blackfire-agent" "Added" } @@ -163,18 +188,17 @@ add_blackfire() { # Function to configure PECL configure_pecl() { for tool in pear pecl; do - sudo "$tool" config-set php_ini "$ini_file" >/dev/null 2>&1 - sudo "$tool" config-set auto_discover 1 >/dev/null 2>&1 - sudo "$tool" channel-update "$tool".php.net >/dev/null 2>&1 + sudo "$tool" config-set php_ini "$ini_file" + sudo "$tool" channel-update "$tool".php.net done } -# Function to log PECL, it is installed along with PHP +# Function to handle request to add PECL. add_pecl() { add_log "$tick" "PECL" "Added" } -# Function to fetch updated formulas +# Function to fetch updated formulae. update_formulae() { brew_dir=$(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-core/Formula for formula in httpd pkg-config apr apr-util argon2 aspell autoconf bison curl-openssl freetds freetype gettext glib gmp icu4c jpeg krb5 libffi libpng libpq libsodium libzip oniguruma openldap openssl@1.1 re2c sqlite tidyp unixodbc webp; do @@ -184,7 +208,7 @@ update_formulae() { wait "${to_wait[@]}" } -# Function to setup PHP >=5.6 +# Function to setup PHP 5.6 and newer. setup_php() { action=$1 export HOMEBREW_NO_INSTALL_CLEANUP=TRUE @@ -192,7 +216,7 @@ setup_php() { if brew list php@"$version" 2>/dev/null | grep -q "Error" && [ "$action" != "upgrade" ]; then brew unlink php@"$version" else - if [ "$version" = "8.0" ]; then update_formulae; fi + if [ "$version" = "$master_version" ]; then update_formulae; fi brew "$action" shivammathur/php/php@"$version" fi brew link --force --overwrite php@"$version" @@ -203,23 +227,18 @@ tick="✓" cross="✗" version=$1 nodot_version=${1/./} +master_version="8.0" old_versions="5.[3-5]" tool_path_dir="/usr/local/bin" existing_version=$(php-config --version 2>/dev/null | cut -c 1-3) -[[ -z "${update}" ]] && update='false' && UPDATE='false' || update="${update}" -[ "$update" = false ] && [[ -n ${UPDATE} ]] && update="${UPDATE}" -[[ -z "${runner}" ]] && runner='github' && RUNNER='github' || runner="${runner}" -[ "$runner" = false ] && [[ -n ${RUNNER} ]] && runner="${RUNNER}" +read_env if [ "$runner" = "self-hosted" ]; then if [[ "$version" =~ $old_versions ]]; then add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner" exit 1 - fi - if [[ $(command -v brew) == "" ]]; then - step_log "Setup Brew" - curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh | bash -s >/dev/null 2>&1 - add_log "$tick" "Brew" "Installed Homebrew" + else + self_hosted_setup >/dev/null 2>&1 fi fi @@ -244,5 +263,5 @@ ext_dir=$(php -i | grep -Ei "extension_dir => /" | sed -e "s|.*=> s*||") scan_dir=$(php --ini | grep additional | sed -e "s|.*: s*||") sudo mkdir -p "$ext_dir" semver=$(php -v | head -n 1 | cut -f 2 -d ' ') -if [[ ! "$version" =~ $old_versions ]]; then configure_pecl; fi +if [[ ! "$version" =~ $old_versions ]]; then configure_pecl >/dev/null 2>&1; fi add_log "$tick" "PHP" "$status PHP $semver" diff --git a/src/scripts/linux.sh b/src/scripts/linux.sh index 5b1316cb..793f9833 100644 --- a/src/scripts/linux.sh +++ b/src/scripts/linux.sh @@ -1,10 +1,10 @@ -# Function to log start of a operation +# Function to log start of a operation. step_log() { message=$1 printf "\n\033[90;1m==> \033[0m\033[37;1m%s\033[0m\n" "$message" } -# Function to log result of a operation +# Function to log result of a operation. add_log() { mark=$1 subject=$2 @@ -16,50 +16,50 @@ add_log() { fi } -# Function to update php ppa -update_ppa() { - if [ "$ppa_updated" = "false" ]; then +# Function to read env inputs. +read_env() { + [[ -z "${update}" ]] && update='false' && UPDATE='false' || update="${update}" + [ "$update" = false ] && [[ -n ${UPDATE} ]] && update="${UPDATE}" + [[ -z "${runner}" ]] && runner='github' && RUNNER='github' || runner="${runner}" + [ "$runner" = false ] && [[ -n ${RUNNER} ]] && runner="${RUNNER}" +} + +# Function to update the package lists. +update_lists() { + if [ "$lists_updated" = "false" ]; then sudo "$debconf_fix" apt-get update >/dev/null 2>&1 - ppa_updated="true" + lists_updated="true" fi } -# Function to setup environment for self-hosted runners -pre_setup() { - sudo mkdir -p /var/run /run/php - if [ "$runner" = "self-hosted" ]; then - if [[ "$version" =~ $old_versions ]] || [ "$version" = "5.3" ]; then - add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner" - exit 1 - fi - if ! command -v apt-fast >/dev/null; then - sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast - fi - update_ppa && $apt_install curl make lsb-release software-properties-common unzip - if ! apt-cache policy | grep -q ondrej/php; then - LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y && update_ppa - fi - if [ "$version" = "8.0" ]; then - IFS=' ' read -r -a libs <<< "$(echo "aspell curl4-gnutls enchant freetype6 icu jpeg png tidy webp xpm zip" | sed "s/[^ ]*/lib&-dev/g")" - $apt_install "${libs[@]}" +# Function to setup environment for self-hosted runners. +self_hosted_setup() { + echo "Set disable_coredump false" | sudo tee -a /etc/sudo.conf + if ! command -v apt-fast >/dev/null; then + sudo ln -sf /usr/bin/apt-get /usr/bin/apt-fast + fi + update_lists && $apt_install curl make lsb-release software-properties-common unzip + if ! apt-cache policy | grep -q ondrej/php; then + LC_ALL=C.UTF-8 sudo apt-add-repository ppa:ondrej/php -y + if [ "$(lsb_release -r -s)" = "16.04" ]; then + sudo "$debconf_fix" apt-get update fi fi } -# Function to configure PECL +# Function to configure PECL. configure_pecl() { if [ "$pecl_config" = "false" ] && [ -e /usr/bin/pecl ]; then for tool in pear pecl; do - sudo "$tool" config-set php_ini "$scan_dir"/99-pecl.ini >/dev/null 2>&1 - sudo "$tool" config-set auto_discover 1 >/dev/null 2>&1 - sudo "$tool" channel-update "$tool".php.net >/dev/null 2>&1 + sudo "$tool" config-set php_ini "$scan_dir"/99-pecl.ini + sudo "$tool" channel-update "$tool".php.net done pecl_config="true" fi } -# Fuction to get the PECL version +# Fuction to get the PECL version of an extension. get_pecl_version() { extension=$1 stability=$2 @@ -72,7 +72,7 @@ get_pecl_version() { echo "$pecl_version" } -# Function to test if extension is loaded +# Function to check if an extension is loaded. check_extension() { extension=$1 if [ "$extension" != "mysql" ]; then @@ -82,7 +82,7 @@ check_extension() { fi } -# Function to delete extensions +# Function to delete extensions. delete_extension() { extension=$1 sudo sed -i "/$extension/d" "$ini_file" @@ -91,7 +91,7 @@ delete_extension() { sudo rm -rf "$ext_dir"/"$extension".so >/dev/null 2>&1 } -# Function to disable and delete extensions +# Function to disable and delete extensions. remove_extension() { extension=$1 if check_extension "$extension"; then @@ -106,14 +106,14 @@ remove_extension() { fi } -# Function to enable existing extension +# Function to enable existing extensions. enable_extension() { if ! check_extension "$1" && [ -e "$ext_dir/$1.so" ]; then echo "$2=$1.so" >>"$pecl_file" fi } -# Funcion to add PDO extension +# Funcion to add PDO extension. add_pdo_extension() { pdo_ext="pdo_$1" if check_extension "$pdo_ext"; then @@ -134,20 +134,20 @@ add_pdo_extension() { fi } -# Function to setup extensions +# Function to add extensions. add_extension() { extension=$1 install_command=$2 prefix=$3 - if [[ "$version" =~ $old_versions ]]; then - install_command="update_ppa && ${install_command/5\.[4-5]-$extension/5-$extension=$release_version}" - fi enable_extension "$extension" "$prefix" if check_extension "$extension"; then add_log "$tick" "$extension" "Enabled" else + if [[ "$version" =~ 5.[4-5] ]]; then + install_command="update_lists && ${install_command/5\.[4-5]-$extension/5-$extension=$release_version}" + fi eval "$install_command" >/dev/null 2>&1 || - (update_ppa && eval "$install_command" >/dev/null 2>&1) || + (update_lists && eval "$install_command" >/dev/null 2>&1) || sudo pecl install -f "$extension" >/dev/null 2>&1 (check_extension "$extension" && add_log "$tick" "$extension" "Installed and enabled") || add_log "$cross" "$extension" "Could not install $extension on PHP $semver" @@ -155,7 +155,7 @@ add_extension() { sudo chmod 777 "$ini_file" } -# Function to install a PECL version +# Function to install a PECL version. add_pecl_extension() { extension=$1 pecl_version=$2 @@ -176,7 +176,7 @@ add_pecl_extension() { fi } -# Function to pre-release extensions using PECL +# Function to pre-release extensions using PECL. add_unstable_extension() { extension=$1 stability=$2 @@ -185,7 +185,7 @@ add_unstable_extension() { add_pecl_extension "$extension" "$pecl_version" "$prefix" } -# Function to update extension +# Function to update extension. update_extension() { extension=$1 latest_version=$2 @@ -194,13 +194,13 @@ update_extension() { if [ "$final_version" != "$current_version" ]; then version_exists=$(apt-cache policy -- *"$extension" | grep "$final_version") if [ -z "$version_exists" ]; then - update_ppa + update_lists fi $apt_install php"$version"-"$extension" fi } -# Function to setup a remote tool +# Function to setup a remote tool. add_tool() { url=$1 tool=$2 @@ -217,6 +217,10 @@ add_tool() { if [ -n "$COMPOSER_TOKEN" ]; then composer -q global config github-oauth.github.com "$COMPOSER_TOKEN" fi + # TODO: Remove after composer 2.0 update, fixes peer fingerprint error + if [[ "$version" =~ $old_versions ]]; then + composer -q global config repos.packagist composer https://repo-ca-bhs-1.packagist.org + fi elif [ "$tool" = "cs2pr" ]; then sudo sed -i 's/\r$//; s/exit(9)/exit(0)/' "$tool_path" elif [ "$tool" = "phan" ]; then @@ -235,7 +239,7 @@ add_tool() { fi } -# Function to setup a tool using composer +# Function to setup a tool using composer. add_composertool() { tool=$1 release=$2 @@ -246,96 +250,85 @@ add_composertool() { ) || add_log "$cross" "$tool" "Could not setup $tool" } -# Function to setup phpize and php-config +# Function to setup phpize and php-config. add_devtools() { if ! [ -e "/usr/bin/phpize$version" ] || ! [ -e "/usr/bin/php-config$version" ]; then - update_ppa && $apt_install php"$version"-dev php"$version"-xml >/dev/null 2>&1 + update_lists && $apt_install php"$version"-dev php"$version"-xml >/dev/null 2>&1 fi sudo update-alternatives --set php-config /usr/bin/php-config"$version" >/dev/null 2>&1 sudo update-alternatives --set phpize /usr/bin/phpize"$version" >/dev/null 2>&1 - configure_pecl + configure_pecl >/dev/null 2>&1 } +# Function to add blackfire and blackfire-agent. add_blackfire() { sudo mkdir -p /var/run/blackfire - sudo curl -o /tmp/blackfire-gpg.key -sSL https://packages.blackfire.io/gpg.key >/dev/null 2>&1 - sudo apt-key add /tmp/blackfire-gpg.key >/dev/null 2>&1 + sudo curl -sSL https://packages.blackfire.io/gpg.key | sudo apt-key add - >/dev/null 2>&1 echo "deb http://packages.blackfire.io/debian any main" | sudo tee /etc/apt/sources.list.d/blackfire.list >/dev/null 2>&1 - find /etc/apt/sources.list.d -type f -name blackfire.list -exec sudo "$debconf_fix" apt-fast update -o Dir::Etc::sourcelist="{}" ';' >/dev/null 2>&1 + sudo "$debconf_fix" apt-get update >/dev/null 2>&1 $apt_install blackfire-agent >/dev/null 2>&1 - sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1 - sudo /etc/init.d/blackfire-agent restart >/dev/null 2>&1 - sudo blackfire --config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1 + if [[ -n $BLACKFIRE_SERVER_ID ]] && [[ -n $BLACKFIRE_SERVER_TOKEN ]]; then + sudo blackfire-agent --register --server-id="$BLACKFIRE_SERVER_ID" --server-token="$BLACKFIRE_SERVER_TOKEN" >/dev/null 2>&1 + sudo /etc/init.d/blackfire-agent restart >/dev/null 2>&1 + fi + if [[ -n $BLACKFIRE_CLIENT_ID ]] && [[ -n $BLACKFIRE_CLIENT_TOKEN ]]; then + sudo blackfire config --client-id="$BLACKFIRE_CLIENT_ID" --client-token="$BLACKFIRE_CLIENT_TOKEN" >/dev/null 2>&1 + fi add_log "$tick" "blackfire" "Added" add_log "$tick" "blackfire-agent" "Added" } -# Function to setup the nightly build from master branch +# Function to setup the nightly build from master branch. setup_master() { - update_ppa && $apt_install libzip-dev libwebp-dev - tar_file=php_"$version"%2Bubuntu"$(lsb_release -r -s)".tar.xz - install_dir=~/php/"$version" - bintray_url=https://dl.bintray.com/shivammathur/php/"$tar_file" - sudo mkdir -m 777 -p ~/php - if [ ! "$(whoami)" = "runner" ]; then - sudo rm -rf /home/runner && sudo ln -sf ~/ /home/runner; - fi - curl -o /tmp/"$tar_file" -sSL "$bintray_url" - sudo tar xf /tmp/"$tar_file" -C ~/php - for tool_path in "$install_dir"/bin/*; do - tool=$(basename "$tool_path") - sudo cp "$tool_path" /usr/bin/"$tool$version" - sudo update-alternatives --install /usr/bin/"$tool" "$tool" /usr/bin/"$tool$version" 50 - done - sudo ln -sf "$install_dir"/etc/php.ini /etc/php.ini + curl -sSL "$github"/php-builder/releases/latest/download/install.sh | bash -s "$runner" } -# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5 +# Function to setup PHP 5.3, PHP 5.4 and PHP 5.5. setup_old_versions() { - dir=php-"$version" - tar_file="$dir".tar.xz - bintray_url=https://dl.bintray.com/shivammathur/php/"$tar_file" - curl -o /tmp/"$tar_file" -sSL "$bintray_url" - sudo tar xf /tmp/"$tar_file" -C /tmp - sudo chmod a+x /tmp/"$dir"/*.sh - (cd /tmp/"$dir" && ./install.sh && ./post-install.sh) + curl -sSL "$github"/php5-ubuntu/releases/latest/download/install.sh | bash -s "$version" configure_pecl release_version=$(php -v | head -n 1 | cut -d' ' -f 2) } -# Function to setup PECL +# Function to add PECL. add_pecl() { - add_devtools + add_devtools >/dev/null 2>&1 if [ ! -e /usr/bin/pecl ]; then $apt_install php-pear >/dev/null 2>&1 fi - configure_pecl + configure_pecl >/dev/null 2>&1 add_log "$tick" "PECL" "Added" } -# Function to switch versions of PHP binaries +# Function to switch versions of PHP binaries. switch_version() { for tool in pear pecl php phar phar.phar php-cgi php-config phpize phpdbg; do if [ -e "/usr/bin/$tool$version" ]; then - sudo update-alternatives --set $tool /usr/bin/"$tool$version" >/dev/null 2>&1 + sudo update-alternatives --set $tool /usr/bin/"$tool$version" fi done } -# Function to get PHP version in semver format +# Function to get PHP version in semver format. php_semver() { - if [ ! "$version" = "8.0" ]; then + if [ ! "$version" = "$master_version" ]; then php"$version" -v | head -n 1 | cut -f 2 -d ' ' | cut -f 1 -d '-' else php -v | head -n 1 | cut -f 2 -d ' ' fi } -# Function to update PHP +# Function to install packaged PHP +add_packaged_php() { + update_lists + IFS=' ' read -r -a packages <<< "$(echo "curl mbstring xml intl" | sed "s/[^ ]*/php$version-&/g")" + $apt_install php"$version" "${packages[@]}" +} + +# Function to update PHP. update_php() { - update_ppa initial_version=$(php_semver) - $apt_install php"$version" php"$version"-curl php"$version"-mbstring php"$version"-xml >/dev/null 2>&1 + add_packaged_php updated_version=$(php_semver) if [ "$updated_version" != "$initial_version" ]; then status="Updated to" @@ -344,56 +337,65 @@ update_php() { fi } +# Function to install PHP. +add_php() { + if [ "$version" = "$master_version" ]; then + setup_master + elif [[ "$version" =~ $old_versions ]]; then + setup_old_versions + else + add_packaged_php + fi + status="Installed" +} + # Variables tick="✓" cross="✗" -ppa_updated="false" +lists_updated="false" pecl_config="false" version=$1 -old_versions="5.[4-5]" +master_version="8.0" +old_versions="5.[3-5]" debconf_fix="DEBIAN_FRONTEND=noninteractive" +github="https://github.com/shivammathur" apt_install="sudo $debconf_fix apt-fast install -y" tool_path_dir="/usr/local/bin" existing_version=$(php-config --version 2>/dev/null | cut -c 1-3) -[[ -z "${update}" ]] && update='false' && UPDATE='false' || update="${update}" -[ "$update" = false ] && [[ -n ${UPDATE} ]] && update="${UPDATE}" -[[ -z "${runner}" ]] && runner='github' && RUNNER='github' || runner="${runner}" -[ "$runner" = false ] && [[ -n ${RUNNER} ]] && runner="${RUNNER}" + +read_env +if [ "$runner" = "self-hosted" ]; then + if [[ "$version" =~ $old_versions ]]; then + add_log "$cross" "PHP" "PHP $version is not supported on self-hosted runner" + exit 1 + else + self_hosted_setup >/dev/null 2>&1 + fi +fi # Setup PHP step_log "Setup PHP" -pre_setup >/dev/null 2>&1 +sudo mkdir -p /var/run /run/php if [ "$existing_version" != "$version" ]; then if [ ! -e "/usr/bin/php$version" ]; then - if [ "$version" = "8.0" ]; then - setup_master >/dev/null 2>&1 - elif [[ "$version" =~ $old_versions ]] || [ "$version" = "5.3" ]; then - setup_old_versions >/dev/null 2>&1 - else - update_ppa - $apt_install php"$version" php"$version"-curl php"$version"-mbstring php"$version"-xml php"$version"-intl >/dev/null 2>&1 - fi - status="Installed" + add_php >/dev/null 2>&1 else if [ "$update" = "true" ]; then - update_php + update_php >/dev/null 2>&1 else status="Switched to" fi fi - - # PHP 5.3 is switched by install script, for rest switch_version - if [ "$version" != "5.3" ]; then - switch_version + if ! [[ "$version" =~ $old_versions ]]; then + switch_version >/dev/null 2>&1 fi - else if [ "$update" = "true" ]; then - update_php + update_php >/dev/null 2>&1 else status="Found" - if [ "$version" = "8.0" ]; then - switch_version + if [ "$version" = "$master_version" ]; then + switch_version >/dev/null 2>&1 fi fi fi diff --git a/src/scripts/win32.ps1 b/src/scripts/win32.ps1 index 1964589a..fe0982b3 100644 --- a/src/scripts/win32.ps1 +++ b/src/scripts/win32.ps1 @@ -11,23 +11,49 @@ param ( $dir ) +# Function to log start of a operation. Function Step-Log($message) { printf "\n\033[90;1m==> \033[0m\033[37;1m%s \033[0m\n" $message } +# Function to log result of a operation. Function Add-Log($mark, $subject, $message) { $code = if ($mark -eq $cross) { "31" } else { "32" } printf "\033[%s;1m%s \033[0m\033[34;1m%s \033[0m\033[90;1m%s \033[0m\n" $code $mark $subject $message } -Function Get-PathFromRegistry { - $env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + - [System.Environment]::GetEnvironmentVariable("Path","User") - if($null -eq (Get-Content $current_profile | findstr 'Get-PathFromRegistry')) { - Add-Content -Path $current_profile -Value 'Function Get-PathFromRegistry { $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "User") }; Get-PathFromRegistry' +# Function to add a line to a powershell profile safely. +Function Add-ToProfile { + param( + [Parameter(Position = 0, Mandatory = $true)] + [ValidateNotNull()] + [ValidateLength(1, [int]::MaxValue)] + [string] + $input_profile, + [Parameter(Position = 1, Mandatory = $true)] + [ValidateNotNull()] + [ValidateLength(1, [int]::MaxValue)] + [string] + $search, + [Parameter(Position = 2, Mandatory = $true)] + [ValidateNotNull()] + [ValidateLength(1, [int]::MaxValue)] + [string] + $value + ) + if($null -eq (Get-Content $input_profile | findstr $search)) { + Add-Content -Path $input_profile -Value $value } } +# Function to fetch PATH from the registry. +Function Get-PathFromRegistry { + $env:Path = [System.Environment]::GetEnvironmentVariable("Path","User") + ";" + + [System.Environment]::GetEnvironmentVariable("Path","Machine") + Add-ToProfile $current_profile 'Get-PathFromRegistry' 'Function Get-PathFromRegistry { $env:Path = [System.Environment]::GetEnvironmentVariable("Path", "User") + ";" + [System.Environment]::GetEnvironmentVariable("Path", "Machine") }; Get-PathFromRegistry' +} + +# Function to add a location to PATH. Function Add-Path { param( [string]$PathItem @@ -38,30 +64,30 @@ Function Add-Path { Get-PathFromRegistry } +# Function to get a clean Powershell profile. Function Get-CleanPSProfile { if(-not(Test-Path -LiteralPath $profile)) { New-Item -Path $profile -ItemType "file" -Force } Set-Content $current_profile -Value '' - if ($null -eq (Get-Content $profile | FindStr $current_profile.replace('\', '\\'))) { - Add-Content $profile -Value ". $current_profile" - } + Add-ToProfile $profile $current_profile.replace('\', '\\') ". $current_profile" } +# Function to install PhpManager. Function Install-PhpManager() { $repo = "mlocati/powershell-phpmanager" - $zip_file = "$php_dir\PhpManager.zip" - $tags = Invoke-WebRequest https://api.github.com/repos/$repo/tags | ConvertFrom-Json - $tag = $tags[0].Name - $module_path = "$php_dir\PhpManager\powershell-phpmanager-$tag\PhpManager" - Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file - Expand-Archive -Path $zip_file -DestinationPath $php_dir\PhpManager - Import-Module $module_path - if($null -eq (Get-Content $current_profile | findstr 'powershell-phpmanager')) { - Add-Content -Path $current_profile -Value "Import-Module $module_path" + $tag = (Invoke-RestMethod https://api.github.com/repos/$repo/tags)[0].Name + $module_path = "$bin_dir\PhpManager\powershell-phpmanager-$tag\PhpManager" + if(-not (Test-Path $module_path\PhpManager.psm1 -PathType Leaf)) { + $zip_file = "$bin_dir\PhpManager.zip" + Invoke-WebRequest -UseBasicParsing -Uri https://github.com/$repo/archive/$tag.zip -OutFile $zip_file + Expand-Archive -Path $zip_file -DestinationPath $bin_dir\PhpManager -Force } + Import-Module $module_path + Add-ToProfile $current_profile 'powershell-phpmanager' "Import-Module $module_path" } +# Function to add PHP extensions. Function Add-Extension { Param ( [Parameter(Position = 0, Mandatory = $true)] @@ -111,6 +137,7 @@ Function Add-Extension { } } +# Function to remove PHP extensions. Function Remove-Extension() { Param ( [Parameter(Position = 0, Mandatory = $true)] @@ -134,6 +161,7 @@ Function Remove-Extension() { } } +# Function to add tools. Function Add-Tool() { Param ( [Parameter(Position = 0, Mandatory = $true)] @@ -147,22 +175,22 @@ Function Add-Tool() { [string] $tool ) - if (Test-Path $php_dir\$tool) { - Remove-Item $php_dir\$tool + if (Test-Path $bin_dir\$tool) { + Remove-Item $bin_dir\$tool } if ($tool -eq "symfony") { - Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $php_dir\$tool.exe - Add-Content -Path $current_profile -Value "New-Alias $tool $php_dir\$tool.exe" >$null 2>&1 + Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $bin_dir\$tool.exe + Add-ToProfile $current_profile $tool "New-Alias $tool $bin_dir\$tool.exe" >$null 2>&1 } else { try { - Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $php_dir\$tool + Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $bin_dir\$tool $bat_content = @() $bat_content += "@ECHO off" $bat_content += "setlocal DISABLEDELAYEDEXPANSION" $bat_content += "SET BIN_TARGET=%~dp0/" + $tool $bat_content += "php %BIN_TARGET% %*" - Set-Content -Path $php_dir\$tool.bat -Value $bat_content - Add-Content -Path $current_profile -Value "New-Alias $tool $php_dir\$tool.bat" >$null 2>&1 + Set-Content -Path $bin_dir\$tool.bat -Value $bat_content + Add-ToProfile $current_profile $tool "New-Alias $tool $bin_dir\$tool.bat" >$null 2>&1 } catch { } } if($tool -eq "phan") { @@ -171,23 +199,28 @@ Function Add-Tool() { } elseif($tool -eq "phive") { Add-Extension xml >$null 2>&1 } elseif($tool -eq "cs2pr") { - (Get-Content $php_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $php_dir/cs2pr + (Get-Content $bin_dir/cs2pr).replace('exit(9)', 'exit(0)') | Set-Content $bin_dir/cs2pr } elseif($tool -eq "composer") { composer -q global config process-timeout 0 Write-Output "::add-path::$env:APPDATA\Composer\vendor\bin" if (Test-Path env:COMPOSER_TOKEN) { composer -q global config github-oauth.github.com $env:COMPOSER_TOKEN } + # TODO: Remove after composer 2.0 update, fixes peer fingerprint error + if ($version -lt 5.6) { + composer -q global config repos.packagist composer https://repo-ca-bhs-1.packagist.org + } } elseif($tool -eq "wp-cli") { - Copy-Item $php_dir\wp-cli.bat -Destination $php_dir\wp.bat + Copy-Item $bin_dir\wp-cli.bat -Destination $bin_dir\wp.bat } - if (((Get-ChildItem -Path $php_dir/* | Where-Object Name -Match "^$tool(.exe|.phar)*$").Count -gt 0)) { + if (((Get-ChildItem -Path $bin_dir/* | Where-Object Name -Match "^$tool(.exe|.phar)*$").Count -gt 0)) { Add-Log $tick $tool "Added" } else { Add-Log $cross $tool "Could not add $tool" } } +# Function to setup a tool using composer. Function Add-Composertool() { Param ( [Parameter(Position = 0, Mandatory = $true)] @@ -214,23 +247,25 @@ Function Add-Composertool() { } } +# Function to handle request to add PECL. Function Add-Pecl() { Add-Log $tick "PECL" "Use extensions input to setup PECL extensions on windows" } +# Function to add blackfire and blackfire-agent. Function Add-Blackfire() { $agent_data = Invoke-WebRequest https://blackfire.io/docs/up-and-running/update | ForEach-Object { $_.tostring() -split "[`r`n]" | Select-String '' | Select-Object -Index 0 } $agent_version = [regex]::Matches($agent_data, '(.+)') | ForEach-Object {$_.Captures[0].Groups[1].value } $url = "https://packages.blackfire.io/binaries/blackfire-agent/${agent_version}/blackfire-agent-windows_${arch_name}.zip" - Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $php_dir\blackfire.zip >$null 2>&1 - Expand-Archive -Path $php_dir\blackfire.zip -DestinationPath $php_dir -Force >$null 2>&1 - Add-Content -Path $current_profile -Value "New-Alias blackfire $php_dir\blackfire.exe" - Add-Content -Path $current_profile -Value "New-Alias blackfire-agent $php_dir\blackfire-agent.exe" + Invoke-WebRequest -UseBasicParsing -Uri $url -OutFile $bin_dir\blackfire.zip >$null 2>&1 + Expand-Archive -Path $bin_dir\blackfire.zip -DestinationPath $bin_dir -Force >$null 2>&1 + Add-ToProfile $current_profile 'blackfire' "New-Alias blackfire $bin_dir\blackfire.exe" + Add-ToProfile $current_profile 'blackfire-agent' "New-Alias blackfire-agent $bin_dir\blackfire-agent.exe" if ((Test-Path env:BLACKFIRE_SERVER_ID) -and (Test-Path env:BLACKFIRE_SERVER_TOKEN)) { blackfire-agent --register --server-id=$env:BLACKFIRE_SERVER_ID --server-token=$env:BLACKFIRE_SERVER_TOKEN >$null 2>&1 } if ((Test-Path env:BLACKFIRE_CLIENT_ID) -and (Test-Path env:BLACKFIRE_CLIENT_TOKEN)) { - blackfire --config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem >$null 2>&1 + blackfire config --client-id=$env:BLACKFIRE_CLIENT_ID --client-token=$env:BLACKFIRE_CLIENT_TOKEN --ca-cert=$php_dir\ssl\cacert.pem >$null 2>&1 } Add-Log $tick "blackfire" "Added" Add-Log $tick "blackfire-agent" "Added" @@ -241,9 +276,11 @@ $tick = ([char]8730) $cross = ([char]10007) $php_dir = 'C:\tools\php' $ext_dir = "$php_dir\ext" +$bin_dir = $php_dir $current_profile = "$env:TEMP\setup-php.ps1" $ProgressPreference = 'SilentlyContinue' $master_version = '8.0' +$cert_source='CurrentUser' $arch = 'x64' $arch_name ='amd64' @@ -261,6 +298,7 @@ if($env:RUNNER -eq 'self-hosted') { $bin_dir = 'C:\tools\bin' $php_dir = "$php_dir$version" $ext_dir = "$php_dir\ext" + $cert_source='Curl' Get-CleanPSProfile >$null 2>&1 New-Item $bin_dir -Type Directory 2>&1 | Out-Null Add-Path -PathItem $bin_dir @@ -270,13 +308,20 @@ if($env:RUNNER -eq 'self-hosted') { } if($version -lt 5.6) { Add-Log $cross "PHP" "PHP $version is not supported on self-hosted runner" + Start-Sleep 1 exit 1 } + if ((Get-InstalledModule).Name -notcontains 'VcRedist') { + Install-Module -Name VcRedist -Force + } New-Item $php_dir -Type Directory 2>&1 | Out-Null Add-Path -PathItem $php_dir setx PHPROOT $php_dir >$null 2>&1 } else { $current_profile = "$PSHOME\Profile.ps1" + if(-not(Test-Path -LiteralPath $current_profile)) { + New-Item -Path $current_profile -ItemType "file" -Force >$null 2>&1 + } } Step-Log "Setup PhpManager" Install-PhpManager >$null 2>&1 @@ -315,7 +360,7 @@ if($version -lt "5.5") { } else { Enable-PhpExtension -Extension openssl, curl, opcache, mbstring -Path $php_dir } -Update-PhpCAInfo -Path $php_dir -Source CurrentUser +Update-PhpCAInfo -Path $php_dir -Source $cert_source if ($version -eq 'master') { Copy-Item $dir"\..\src\bin\php_$env:PHPTS`_pcov.dll" -Destination $ext_dir"\php_pcov.dll" Set-PhpIniKey -Key 'opcache.jit_buffer_size' -Value '256M' -Path $php_dir diff --git a/src/tools.ts b/src/tools.ts index 828f85cc..acea374b 100644 --- a/src/tools.ts +++ b/src/tools.ts @@ -33,8 +33,10 @@ export async function getCommand( export async function getToolVersion(version: string): Promise { // semver_regex - https://semver.org/ const semver_regex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/; + const composer_regex = /^stable$|^preview$|^snapshot$|^v?[1|2]$/; version = version.replace(/[><=^]*/, ''); switch (true) { + case composer_regex.test(version): case semver_regex.test(version): return version; default: @@ -300,19 +302,47 @@ export async function getWpCliUrl(version: string): Promise { * @param tools_list */ export async function addComposer(tools_list: string[]): Promise { - const regex = /^composer($|:.*)/; - const composer: string = tools_list.filter(tool => regex.test(tool))[0]; - switch (composer) { + const regex_any = /^composer($|:.*)/; + const regex_valid = /^composer:?($|preview$|snapshot$|v?[1-2]$)/; + const matches: string[] = tools_list.filter(tool => regex_valid.test(tool)); + let composer = 'composer'; + tools_list = tools_list.filter(tool => !regex_any.test(tool)); + switch (matches[0]) { case undefined: break; default: - tools_list = tools_list.filter(tool => !regex.test(tool)); + composer = matches[matches.length - 1].replace(/v([1-2])/, '$1'); break; } - tools_list.unshift('composer'); + tools_list.unshift(composer); return tools_list; } +/** + * Function to get script to update composer + * + * @param version + * @param os_version + */ +export async function updateComposer( + version: string, + os_version: string +): Promise { + switch (version) { + case 'snapshot': + case 'preview': + case '1': + case '2': + return ( + '\ncomposer self-update --' + + version + + (await utils.suppressOutput(os_version)) + ); + default: + return ''; + } +} + /** * Function to get Tools list after cleanup * @@ -483,11 +513,10 @@ export async function addTools( script += await addArchive(tool, version, url, os_version); break; case 'composer': - // If RC is released as latest release, switch to getcomposer. - // Prefered source is GitHub as it is faster. - // url = github + 'composer/composer/releases/latest/download/composer.phar'; url = 'https://getcomposer.org/composer-stable.phar'; - script += await addArchive(tool, version, url, os_version); + script += + (await addArchive('composer', version, url, os_version)) + + (await updateComposer(version, os_version)); break; case 'codeception': url = diff --git a/tsconfig.json b/tsconfig.json index 0711bd22..01a2717c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { /* Basic Options */ // "incremental": true, /* Enable incremental compilation */ - "target": "ES2020", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ + "target": "ES2019", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */ "module": "commonjs", /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */ // "allowJs": true, /* Allow javascript files to be compiled. */ // "checkJs": true, /* Report errors in .js files. */