diff --git a/.github/.codecov.yml b/.github/.codecov.yml index 1ce321b650d3..ba7dd34e7473 100644 --- a/.github/.codecov.yml +++ b/.github/.codecov.yml @@ -1,7 +1,11 @@ # https://docs.codecov.com/docs/codecov-yaml +codecov: + require_ci_to_pass: yes + coverage: status: project: default: - # https://docs.codecov.com/docs/commit-status#target - target: auto # coverage must be equal or above the previous commit + target: auto + threshold: 2% # the leniency in hitting the target + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9bd61e660b6c..2a9e814b5fe3 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -4,8 +4,20 @@ ### Issues Resolved - - + + + +## Screenshot + + + +## Testing the changes + + ### Check List diff --git a/.github/workflows/build_and_test_workflow.yml b/.github/workflows/build_and_test_workflow.yml index fd4cdbbefa78..8fd3a402d547 100644 --- a/.github/workflows/build_and_test_workflow.yml +++ b/.github/workflows/build_and_test_workflow.yml @@ -25,11 +25,13 @@ env: TEST_OPENSEARCH_TRANSPORT_PORT: 9403 TEST_OPENSEARCH_PORT: 9400 OSD_SNAPSHOT_SKIP_VERIFY_CHECKSUM: true + NODE_OPTIONS: "--max-old-space-size=6144 --dns-result-order=ipv4first" jobs: build-lint-test: name: Build and Verify on ${{ matrix.name }} strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] include: @@ -122,6 +124,7 @@ jobs: functional-tests: name: Run functional tests on ${{ matrix.name }} (ciGroup${{ matrix.group }}) strategy: + fail-fast: false matrix: os: [ubuntu-latest, windows-latest] group: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13] @@ -384,6 +387,7 @@ jobs: with: name: ${{ matrix.version }}-test-failures path: | - ./artifacts/bwc_tmp/test/cypress/videos/without-security/* - ./artifacts/bwc_tmp/test/cypress/screenshots/without-security/* + ./artifacts/bwc_tmp/test/cypress/videos/* + ./artifacts/bwc_tmp/test/cypress/screenshots/* + ./artifacts/bwc_tmp/test/cypress/results/* retention-days: 1 diff --git a/.i18nrc.json b/.i18nrc.json index 234aa8de0c25..64ca6528aa5e 100644 --- a/.i18nrc.json +++ b/.i18nrc.json @@ -48,7 +48,7 @@ "src/plugins/telemetry_management_section" ], "tileMap": "src/plugins/tile_map", - "timeline": ["src/plugins/timeline", "src/plugins/vis_type_timeline"], + "timeline": ["src/plugins/vis_type_timeline"], "uiActions": "src/plugins/ui_actions", "visDefaultEditor": "src/plugins/vis_default_editor", "visTypeMarkdown": "src/plugins/vis_type_markdown", diff --git a/.lycheeexclude b/.lycheeexclude index 07317835aabf..35ae861e8f91 100644 --- a/.lycheeexclude +++ b/.lycheeexclude @@ -88,6 +88,8 @@ https://opensearch.org/redirect http://www.opensearch.org/painlessDocs https://www.hostedgraphite.com/ https://connectionurl.com +http://169.254.169.254/latest/meta-data/ +http://company.net/* # External urls https://www.zeek.org/ @@ -117,3 +119,5 @@ http://www.creedthoughts.gov https://media-for-the-masses.theacademyofperformingartsandscience.org/ https://yarnpkg.com/latest.msi https://forum.opensearch.org/ +https://facebook.github.io/jest/ +https://facebook.github.io/jest/docs/cli.html diff --git a/.node-version b/.node-version index f46d5e394243..6d80269a4f04 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -14.21.3 +18.16.0 diff --git a/.nvmrc b/.nvmrc index f46d5e394243..6d80269a4f04 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -14.21.3 +18.16.0 diff --git a/CHANGELOG.md b/CHANGELOG.md index fb7c3fd87322..3a7acdd0a965 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Eliminate dependency on `got` versions older than 11.8.5 ([#2801](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2801)) - [Multi DataSource] Add explicit no spellcheck on password fields ([#2818](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2818)) - [CVE-2022-25912] Bumps simple-git from 3.4.0 to 3.15.0 ([#3036](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3036)) -- [CVE-2022-35256] Bumps node version from 14.20.0 to 14.20.1 [#3166](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3166)) +- [CVE-2022-35256] Bumps node version from 14.20.0 to 14.20.1 ([#3166](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3166)) - [CVE-2022-46175] Bumps json5 version from 1.0.1 and 2.2.1 to 1.0.2 and 2.2.3 ([#3201](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3201)) - [CVE-2022-25860] Bumps simple-git from 3.15.1 to 3.16.0 ([#3345](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3345)) - [Security] Bumps hapi/statehood to 7.0.4 ([#3411](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3411)) @@ -22,6 +22,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [CVE-2023-25653] Bump node-jose to 2.2.0 ([#3445](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3445)) - [CVE-2023-26486][cve-2023-26487] Bump vega from 5.22.1 to 5.23.0 ([#3533](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3533)) - [CVE-2023-0842] Bump xml2js from 0.4.23 to 0.5.0 ([#3842](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3842)) +- [Multi DataSource] Add private IP blocking validation on server side ([#3912](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3912)) +- Bump `joi` to v14 to avoid the possibility of prototype poisoning in a nested dependency ([#3952](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3952)) +- [CVE-2023-2251] Bump yaml to 2.2.2 ([#3947](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3947)) ### πŸ“ˆ Features/Enhancements @@ -82,6 +85,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Add satisfaction survey link to help menu ([#3676] (https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3676)) - [Vis Builder] Add persistence to visualizations inner state ([#3751](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3751)) - [Table Visualization] Move format table, consolidate types and add unit tests ([#3397](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3397)) +- [Multiple Datasource] Support Amazon OpenSearch Serverless ([#3957](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3957)) +- Add support for Node.js >=14.20.1 <19 ([#4071](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4071)) +- Bundle Node.js 14 as a fallback for operating systems that cannot run Node.js 18 ([#4151](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4151)) ### πŸ› Bug Fixes @@ -131,6 +137,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Table Visualization] Fix table rendering empty unused space ([#3797](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3797)) - [Table Visualization] Fix data table not adjusting height on the initial load ([#3816](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3816)) - Cleanup unused url ([#3847](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3847)) +- [BUG] Docked navigation impacts visibility of bottom bar component ([#3978](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3978)) ### 🚞 Infrastructure @@ -145,6 +152,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Upgrade yarn version to be compatible with @openearch-project/opensearch ([#3443](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3443)) - [CI] Reduce redundancy by using matrix strategy on Windows and Linux workflows ([#3514](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3514)) - Add an achievement badger to the PR ([#3721](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3721)) +- Install chrome driver for functional tests from path set by environment variable `TEST_BROWSER_BINARY_PATH`([#3997](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3997)) +- Adds threshold to code coverage config to prevent workflow failures ([#4040](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4040)) ### πŸ“ Documentation @@ -164,7 +173,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Doc] Update SECURITY.md with instructions for nested dependencies and backporting ([#3497](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3497)) - [Doc] [Console] Fix/update documentation links in Dev Tools console ([#3724](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3724)) - [Doc] Update DEVELOPER_GUIDE.md with added manual bootstrap timeout solution and max virtual memory error solution with docker ([#3764](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3764)) +- [Doc] Add COMMUNICATIONS.md with info about Slack, forum, office hours ([#3837](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3837)) - [Doc] Add docker files and instructions for debugging Selenium functional tests ([#3747](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3747)) +- [Saved Object Service] Adds design doc for new Saved Object Service Interface for Custom Repository [#3954](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3954) ### πŸ›  Maintenance @@ -181,7 +192,11 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Remove the unused `renovate.json5` file ([3489](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3489)) - Allow selecting the Node.js binary using `NODE_HOME` and `OSD_NODE_HOME` ([3508](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3508)) - Bump `styled-components` from 5.3.5 to 5.3.9 ([#3678](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3678)) +- Bump `js-yaml` from 3.14.0 to 4.1.0 ([#3770](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3770)) - Bump `oui` from `1.0.0` to `1.1.1` ([#3884](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3884)) +- Use `exec` in the CLI shell scripts to prevent new process creation ([#3955](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3955)) +- Adding @ZilongX and @Flyingliuhub as maintainers. ([#4137](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4137)) +- Remove timeline application ([#3971](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3971)) ### πŸͺ› Refactoring @@ -191,7 +206,9 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Console] Replace jQuery.ajax with core.http when calling OSD APIs in console ([#3080](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3080)) - [I18n] Fix Listr type errors and error handlers ([#3629](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3629)) - [Multiple DataSource] Present the authentication type choices in a drop-down ([#3693](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3693)) -- [Console] Replace jQuery usage in console plugin with native methods ([#3733](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3733)) +- [Console] Remove unused ul element and its custom styling ([#3993](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3993)) +- Fix EUI/OUI type errors ([#3798](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3798)) +- Remove unused Sass in `tile_map` plugin ([#4110](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4110)) ### πŸ”© Tests @@ -238,6 +255,8 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Multi DataSource] UX enhancement on Data source management stack ([#2521](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2521)) - [Multi DataSource] UX enhancement on Update stored password modal for Data source management stack ([#2532](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/2532)) - [Monaco editor] Add json worker support ([#3424](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3424)) +- Enhance grouping for context menus ([#3169](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3169)) +- Replace re2 with RegExp in timeline and add unit tests ([#3908](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3908)) ### πŸ› Bug Fixes @@ -249,6 +268,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - [Console] Fix dev tool console autocomplete not loading issue ([#3775](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3775)) - [Console] Fix dev tool console run command with query parameter error ([#3813](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3813)) - Add clarifying tooltips to header navigation ([#3573](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/3573)) +- [Dashboards Listing] Fix listing limit to utilize `savedObjects:listingLimit` instead of `savedObjects:perPage` ([#4021](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4021)) ### 🚞 Infrastructure diff --git a/COMMUNICATIONS.md b/COMMUNICATIONS.md new file mode 100644 index 000000000000..c1dbfc114ce7 --- /dev/null +++ b/COMMUNICATIONS.md @@ -0,0 +1,83 @@ +# OpenSearch Dashboards Communication + +- [Overview](#overview) +- [Slack](#slack) +- [Forum](#forum) +- [Developer Office Hours](#developer-office-hours) + - [What it is](#what-it-is) + - [When](#when) + - [How to sign up](#how-to-sign-up) + - [FAQ](#faq) + +## Overview + +The purpose of this document is to provide information regarding the communication channels for OpenSearch Dashboards. All communication is subject to the [OpenSearch Code of Conduct](CODE_OF_CONDUCT.md). Please see [CONTRIBUTING](CONTRIBUTING.md) if you're interested in contributing to the project. + +## Slack + +The OpenSearch project has a public workspace on [Slack](https://opensearch.slack.com). See the [Getting Started guide]() for steps to register and setup the workspace. + +Once registered, check out these channels for discussion of OpenSearch Dashboards topics: + +- [#dashboards](https://opensearch.slack.com/archives/C01QENNTGUD) +- [#dashboards-ux](https://opensearch.slack.com/archives/C05389T9LJC) + +## Forum + +Slack conversations are not searchable outside the workspace. For this reason we encourage using the [OpenSearch Dashboards category](https://forum.opensearch.org/c/opensearch-dashboards/57) of the forum for technical support discussions or summarizing findings for the rest of the community. + +## Developer Office Hours + +### What it is + +A recurring 1-hour virtual meeting for community developers to chat with [OpenSearch Dashboards project maintainers](MAINTAINERS.md). Priority will be given to topics that are signed-up in advance, but ad-hoc discussions are welcome in any remaining time. + +While we'll always prioritize asynchronous communication, sometimes a community call is the most effective and efficient venue to share information and knowledge. Some reasons to sign up: + +1. Review a proposal or technical design for a new feature in OpenSearch Dashboards or an OpenSearch Dashboards plugin +2. Learn more about how to build and extend OpenSearch Dashboards - which APIs, plugins, resources, and services are available to speed development +3. Discuss OpenSearch Dashboard roadmap and technical initiatives + +Signing up isn't required to attend - all OpenSearch Dashboards contributors or interested developers are welcome as participants. + +Bring your ideas and projects early, while you still have time and flexibility to make significant changes. + +### When + +Every other Thursday, 10AM-11AM PT. + +### How to sign up + +There will be a forum post for each iteration of the meeting, with pre-defined slots. To sign-up, simply reply in the forum thread with the following template: + +* Topic: [a brief description of what you'd like to discuss] +* Requested by: [provide GitHub aliases of attendees] +* GitHub issues or PRs: [before signing up, make sure to create an issue, whether in the OpenSearch Dashboards repository or your own plugin repository] +* Time required [choose 15, 30, 45, or 60 minutes] +* Requested maintainer: [optional; provide GitHub alias of any particular maintainer you’d like to attend] + +### FAQ + +#### Will the meetings be recorded? + +Yes, we plan to record each office hours session and post to our YouTube channel so the information can be more easily shared and referenced. + +#### Will all maintainers attend? + +Generally no, but there will always be at least one maintainer. We'll review the sign-ups ahead of time to make sure the right subject-matter experts will attend, depending on the topics. + +#### What happens if there are no sign-ups for a particular session? + +The session will still occur, and the maintainers will present a brief knowledge-sharing session or demo. We'll also hold ad-hoc discussions, but the session may end early. + +#### Is it first come first serve or do we get to decide which topics we discuss in a session? + +For sign-ups, it’s first-come first served, until we decide we need another method. + +#### Will there also be meeting notes? or is the recording the only available transcript? + +No. But we’ll also post the chat transcript and any slides shared (see https://forum.opensearch.org/t/opensearch-community-meeting-2023-0131/11892/5 as example) + +#### How can I cancel or reschedule? + +Just leave another forum reply, as early as possible so other folks have the opportunity to sign-up for the same spot. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 045b17019b7d..4a605d04c052 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,7 @@ - [Contributing to OpenSearch](#contributing-to-opensearch-dashboards) - [First Things First](#first-things-first) - [Ways to Contribute](#ways-to-contribute) + - [Join the Discussion](#join-the-discussion) - [Bug Reports](#bug-reports) - [Feature Requests](#feature-requests) - [Documentation Changes](#documentation-changes) @@ -19,6 +20,11 @@ OpenSearch is a community project that is built and maintained by people just li **Only submit your own work** (or work you have sufficient rights to submit) - Please make sure that any code or documentation you submit is your work or you have the rights to submit. We respect the intellectual property rights of others, and as part of contributing, we'll ask you to sign your contribution with a "Developer Certificate of Origin" (DCO) that states you have the rights to submit this work and you understand we'll use your contribution. There's more information about this topic in the [DCO section](#developer-certificate-of-origin). ## Ways to Contribute + +### Join the Discussion + +See the [communication guide](COMMUNICATION.md)for information on how to join our slack workspace, forum, or developer office hours. + ### Bug Reports A bug is when software behaves in a way that you didn't expect and the developer didn't intend. To help us understand what's going on, we first want to make sure you're working from the latest version. Please make sure you're testing against the [latest version](https://github.com/opensearch-project/OpenSearch-Dashboards). diff --git a/DEVELOPER_GUIDE.md b/DEVELOPER_GUIDE.md index d3c8b269c4c0..3df2106e9678 100644 --- a/DEVELOPER_GUIDE.md +++ b/DEVELOPER_GUIDE.md @@ -209,6 +209,10 @@ $ yarn start --run-examples - [Project testing guidelines](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/TESTING.md) - [Plugin conventions](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/CONVENTIONS.md#technical-conventions) +#### Join the discussion + +See the [communication guide](COMMUNICATION.md)for information on how to join our slack workspace, forum, or developer office hours. + ## Alternative development installations Although the [getting started guide](#getting-started-guide) covers the recommended development environment setup, there are several alternatives worth being aware of. diff --git a/Dockerfile b/Dockerfile index 8f2742a6c1f2..9337b827810e 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG NODE_VERSION=14.20.1 +ARG NODE_VERSION=18.16.0 FROM node:${NODE_VERSION} AS base ENV HOME '.' diff --git a/MAINTAINERS.md b/MAINTAINERS.md index ecb3f2928616..ae42e47b014b 100644 --- a/MAINTAINERS.md +++ b/MAINTAINERS.md @@ -17,6 +17,8 @@ This document contains a list of maintainers in this repo. See [opensearch-proje | Kristen Tian | [kristenTian](https://github.com/kristenTian) | Amazon | | Zhongnan Su | [zhongnansu](https://github.com/zhongnansu) | Amazon | | Manasvini B Suryanarayana | [manasvinibs](https://github.com/manasvinibs) | Amazon | +| Tao Liu | [Flyingliuhub](https://github.com/Flyingliuhub) | Amazon | +| Zilong Xia | [ZilongX](https://github.com/ZilongX) | Amazon | ## Emeritus diff --git a/README.md b/README.md index d1b8fc9ed9dd..5c6c764f87f6 100644 --- a/README.md +++ b/README.md @@ -8,9 +8,13 @@ ## Welcome -OpenSearch Dashboards is an open source search and analytics visualization. We aim to be the best community-driven platform and provide all the contributors a great open source experience. +OpenSearch Dashboards is an open-source data visualization tool designed to work with OpenSearch. OpenSearch Dashboards gives you data visualization tools to improve and automate business intelligence and support data-driven decision-making and strategic planning. -Feel free to take a look at what the community has been up to, and then head over to the [Project Board](https://github.com/opensearch-project/OpenSearch-Dashboards/projects) to track release targets, or jump in and [start opening issues](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/new/choose), [set up your development environment](DEVELOPER_GUIDE.md#getting-started), or [start contributing](CONTRIBUTING.md). +We aim to be an exceptional community-driven platform and to foster open participation and collective contribution with all contributors. Stay up to date on what's happening with the OpenSearch Project by tracking GitHub [issues](https://github.com/opensearch-project/OpenSearch-Dashboards/issues) and [pull requests](https://github.com/opensearch-project/OpenSearch-Dashboards/pulls). + +You can [contribute to this project](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/CONTRIBUTING.md) by [opening issues](https://github.com/opensearch-project/OpenSearch-Dashboards/issues/new/choose) to give feedback, share ideas, identify bugs, and contribute code. + +Set up your [OpenSearch Dashboards development environment](ttps://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/DEVELOPER_GUIDE.md#getting-started-guide) today! The project team looks forward to your contributions. ## Code Summary @@ -23,7 +27,7 @@ Feel free to take a look at what the community has been up to, and then head ove * [Project Website](https://opensearch.org/) * [Downloads](https://opensearch.org/downloads.html) * [Documentation](https://opensearch.org/docs/) -* Need help? Try [Forums](https://discuss.opendistrocommunity.dev/) +* Need help? See the [communication guide](COMMUNICATION.md) for various options * [Project Principles](https://opensearch.org/#principles) * [Developer Guide](DEVELOPER_GUIDE.md) * [Contributing to OpenSearch](CONTRIBUTING.md) diff --git a/config/opensearch_dashboards.yml b/config/opensearch_dashboards.yml index f6f1486e5499..a28a2301dcf6 100644 --- a/config/opensearch_dashboards.yml +++ b/config/opensearch_dashboards.yml @@ -229,8 +229,7 @@ # functionality in Visualization. # vis_builder.enabled: false -# Set the value of this setting to true to enable the experimental multiple data source -# support feature. Use with caution. +# Set the value of this setting to true to enable multiple data source feature. #data_source.enabled: false # Set the value of these settings to customize crypto materials to encryption saved credentials # in data sources. @@ -238,6 +237,31 @@ #data_source.encryption.wrappingKeyNamespace: 'changeme' #data_source.encryption.wrappingKey: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] +#data_source.endpointDeniedIPs: [ +# '127.0.0.0/8', +# '::1/128', +# '169.254.0.0/16', +# 'fe80::/10', +# '10.0.0.0/8', +# '172.16.0.0/12', +# '192.168.0.0/16', +# 'fc00::/7', +# '0.0.0.0/8', +# '100.64.0.0/10', +# '192.0.0.0/24', +# '192.0.2.0/24', +# '198.18.0.0/15', +# '192.88.99.0/24', +# '198.51.100.0/24', +# '203.0.113.0/24', +# '224.0.0.0/4', +# '240.0.0.0/4', +# '255.255.255.255/32', +# '::/128', +# '2001:db8::/32', +# 'ff00::/8', +# ] + # Set the value of this setting to false to hide the help menu link to the OpenSearch Dashboards user survey # opensearchDashboards.survey.url: "https://survey.opensearch.org" diff --git a/cypress/integration/with-security/check_advanced_settings.js b/cypress/integration/with-security/check_advanced_settings.js index 502ee150a33f..9ca41207724e 100644 --- a/cypress/integration/with-security/check_advanced_settings.js +++ b/cypress/integration/with-security/check_advanced_settings.js @@ -25,13 +25,6 @@ describe('verify the advanced settings are saved', () => { .should('eq', 'true'); }); - it('the Timeline default columns field is set to 4', () => { - cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should( - 'have.value', - 4 - ); - }); - it('the Timeline Maximum buckets field is set to 4', () => { cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should( 'have.value', diff --git a/cypress/integration/with-security/helpers/generate_data.js b/cypress/integration/with-security/helpers/generate_data.js index 1509dca7b012..4833a81a1398 100755 --- a/cypress/integration/with-security/helpers/generate_data.js +++ b/cypress/integration/with-security/helpers/generate_data.js @@ -31,9 +31,6 @@ describe('Generating BWC test data with security', () => { it('adds advanced settings', () => { miscUtils.visitPage('app/management/opensearch-dashboards/settings'); cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click(); - cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type( - '{selectAll}4' - ); cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type( '{selectAll}4' ); diff --git a/cypress/integration/without-security/check_advanced_settings.js b/cypress/integration/without-security/check_advanced_settings.js index 474a8178441a..9268d86a16e5 100644 --- a/cypress/integration/without-security/check_advanced_settings.js +++ b/cypress/integration/without-security/check_advanced_settings.js @@ -18,13 +18,6 @@ describe('verify the advanced settings are saved', () => { .should('eq', 'true'); }); - it('the Timeline default columns field is set to 4', () => { - cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').should( - 'have.value', - 4 - ); - }); - it('the Timeline Maximum buckets field is set to 4', () => { cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').should( 'have.value', diff --git a/cypress/integration/without-security/helpers/generate_data.js b/cypress/integration/without-security/helpers/generate_data.js index f792a9b304a1..4f2962769c16 100755 --- a/cypress/integration/without-security/helpers/generate_data.js +++ b/cypress/integration/without-security/helpers/generate_data.js @@ -14,9 +14,6 @@ describe('Generating BWC test data without security', () => { it('adds advanced settings', () => { miscUtils.visitPage('app/management/opensearch-dashboards/settings'); cy.get('[data-test-subj="advancedSetting-editField-theme:darkMode"]').click(); - cy.get('[data-test-subj="advancedSetting-editField-timeline:default_columns"]').type( - '{selectAll}4' - ); cy.get('[data-test-subj="advancedSetting-editField-timeline:max_buckets"]').type( '{selectAll}4' ); diff --git a/docs/saved_objects/img/current_saved_object_service_workflow.png b/docs/saved_objects/img/current_saved_object_service_workflow.png new file mode 100644 index 000000000000..b763101b6987 Binary files /dev/null and b/docs/saved_objects/img/current_saved_object_service_workflow.png differ diff --git a/docs/saved_objects/img/proposed_saved_object_service_workflow.png b/docs/saved_objects/img/proposed_saved_object_service_workflow.png new file mode 100644 index 000000000000..117fd0217d51 Binary files /dev/null and b/docs/saved_objects/img/proposed_saved_object_service_workflow.png differ diff --git a/docs/saved_objects/resources/current_saved_object_service_workflow.puml b/docs/saved_objects/resources/current_saved_object_service_workflow.puml new file mode 100644 index 000000000000..bc5bbf82c621 --- /dev/null +++ b/docs/saved_objects/resources/current_saved_object_service_workflow.puml @@ -0,0 +1,19 @@ +@startuml +title: Current Saved Object Service Flow +actor User +participant "Saved Object Client" as Client +participant "Saved Object Repository" as Repo +participant "Opensearch" as OS + +User -> Client: Create Saved Object +Client -> Repo: Create Saved Object +Repo -> OS: Index Saved Object +OS --> Repo: Saved Object Saved +Client -> User: Saved Object Created +User -> Client: Get Saved Object +Client -> Repo: Get Saved Object +Repo -> OS: Get Saved Object +OS --> Repo: Return Saved Object +Repo -> Client: Return Saved Object +Client -> User: Saved Object Data +@enduml \ No newline at end of file diff --git a/docs/saved_objects/resources/proposed_saved_object_service_workflow.puml b/docs/saved_objects/resources/proposed_saved_object_service_workflow.puml new file mode 100644 index 000000000000..27a5e1cd49ed --- /dev/null +++ b/docs/saved_objects/resources/proposed_saved_object_service_workflow.puml @@ -0,0 +1,38 @@ +@startuml + +title: Proposed Saved Object Service Flow + +actor User + +participant "OpenSearch-Dashboards" as OSD + +box "Saved Object Service" #LightBlue +participant "Saved Object Client" as Client +participant "Repository Factory Provider" as Factory +end box + +box "Dashboards Storage Plugin" #LightYellow +participant "Repository\n(e.g. PostgresRepository,\nDynamoDBRepository)" as Repo +participant "Metadata Storage\n(e.g. Postgres, \nDynamoDB etc)" as Meta +end box + +autonumber +group OSD Bootstrap +Repo -> Factory: Register custom repository +Factory -> Client: Returns repository +Client -> OSD: Returns Saved Object Client +end group +User -> Client: Create Saved Object +Client -> Repo: Create Saved Object +Repo -> Meta: Create/Update Record +Meta --> Repo: Saved Object Saved +Client -> User: Saved Object Created +User -> Client: Get Saved Object +Client -> Repo: Get Saved Object +Repo -> Meta: Fetch Saved Object from storage +Meta --> Repo: Return Saved Object +Repo -> Client: Return Saved Object +Client -> User: Saved Object Data + +skinparam BoxPadding 15 +@enduml \ No newline at end of file diff --git a/docs/saved_objects/saved_object_repository_factory_design.md b/docs/saved_objects/saved_object_repository_factory_design.md new file mode 100644 index 000000000000..d3fedd3575dc --- /dev/null +++ b/docs/saved_objects/saved_object_repository_factory_design.md @@ -0,0 +1,171 @@ +# Proposed Saved Object Service Interface for Custom Repository + +## Introduction + +The new saved object service interface for custom repository is a project that aims to improve scalability of the existing saved object service by introducing a new interface. The goal of this project is to provide a more efficient and flexible interface that will make it easier for developers to configure metadata of Dashboards in any different storage than OpenSearch, such as mysql, postgres, DDB, serverless (S3+ Athena). + +Currently, Dashboards stores its metadata configuration inside OpenSearch index (called .kibana). This approach is by design of Dashboards and biased towards product decision by upstream which works seamlessly and out of the box for customers but it introduces challenges while operating at scale and providing high availability for Dashboards. While choosing OpenSearch as a storage for Dashboards metadata, availability of Dashboards depends on OpenSearch cluster’s availability and other cluster parameters such as cluster health, state, versions which could make Dashboards unavailable. + +To mitigate above problem and unblock future extensibility of Dashboards, we are building Dashboards Meta storage adaptor to decouple Dashboards metadata storage from OpenSearch. This project will focus on introducing new interface in Saved Object Service using which developer can build their custom repository and save Dashboards metadata in storage of their choice. + +The stakeholders of this new interface include the developers of the Dashboards and community contributors who wants to use other metadata store. + +## Architecture Overview + +The Saved Object Service is a critical component of Dashboards that provides a way to store and manage application data. It is built using a modular architecture that provides a high degree of flexibility and extensibility. The new interface will be designed to replace [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134) implementation so that developers can build plugins that leverage the power of existing saved object service and use their own database to store and retrieve metadata of OpenSearch Dashboards. + +### Current Architecture + +The repository interface named [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134) in OpenSearch-Dashboards is a module that provides an interface for managing saved objects. The [SavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L139) is the implementation of [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134), which uses OpenSearch index as it’s data store. It is responsible for storing, retrieving, and deleting saved objects for Dashboards, such as visualizations, dashboards, and searches. + +The Saved Object Repository is built on top of the OpenSearch client and provides a simplified interface for working with OpenSearch. It uses the Saved Object Serializer to convert saved objects between their internal and external representations. The repository is then being consumed by Saved object client to create scoped saved object client. + +![img](./img/current_saved_object_service_workflow.png) + +### Proposed Architecture + +- **Approach 1 (Preferred)**: The proposed architecture will add one more layer of abstraction in Saved Object Service. `The Repository Factory Provider` in OpenSearch Dashboards will be responsible for creating and managing instances of the Repository (e.g. SavedObjectRepository, PostgresRepository, DynamoDBRepository etc.), which is used to interact with the metadata storage that stores the saved objects. Currently we have an repository interface named [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134), and the [SavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L139) is the implementation, which use an OpenSearch index as its data store. This approach would make the implementation of [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134) replaceable by plugin. + + ![img](./img/proposed_saved_object_service_workflow.png) + + * Pros: + * Only change needed in Dashboard is to introduce one more abstraction layer in Saved Object Service. + * Adds opportunity for community developers to contribute for other meta store. + + * Cons + * Code reusability is low. +
+ +**POC**: +1) Core Dashboards Change: https://github.com/bandinib-amzn/OpenSearch-Dashboards/commit/b9cfc14 +2) Postgres Repository Plugin: https://github.com/bandinib-amzn/metadata_plugin/commit/dac35f0 + +`SavedObjectsServiceSetup` provides interface to create custom Saved Object Repository. +``` +/** +* Set the default {@link SavedObjectRepositoryFactoryProvider | factory provider} for creating Saved Objects repository. +* Only one repository can be set, subsequent calls to this method will fail. +*/ +registerRepositoryFactoryProvider: ( +respositoryFactoryProvider: SavedObjectRepositoryFactoryProvider +) => void; +``` + +Here are the main steps involved in using the Saved Objects Repository Factory in Dashboards: +1. Define the dependencies: The Saved Object Repository Factory Provider requires the function which creates instance of [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134). + ``` + export const repositoryFactoryProvider: SavedObjectRepositoryFactoryProvider = ( + options: SavedObjectsRepositoryOptions + ) => { + . + . + . + return new PostgresRepository({ + typeRegistry, + serializer, + migrator, + allowedTypes, + }); + } + ``` +2. Register the provider: Register the repository factory provider with right dependencies. + ``` + core.savedObjects.registerRepositoryFactoryProvider(repositoryFactoryProvider); + ``` +3. Implement the Saved Object Operations for chosen storage type: Implement the CRUD and other operations for contracts defined in [ISavedObjectRepository](https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/core/server/saved_objects/service/lib/repository.ts#L134) + ``` + async create( + type: string, + attributes: T, + options: SavedObjectsCreateOptions = {} + ): Promise> { + ... + } + + async get( + type: string, + id: string, + options: SavedObjectsBaseOptions = {} + ): Promise> { + ... + } + + async update( + type: string, + id: string, + attributes: Partial, + options: SavedObjectsUpdateOptions = {} + ): Promise> { + ... + } + + async deleteFromNamespaces( + type: string, + id: string, + namespaces: string[], + options: SavedObjectsDeleteFromNamespacesOptions = {} + ): Promise { + ... + } + . + . + . + ``` + +- **Approach 2**: Build external plugin and using saved object client wrapper or client factory provider injection mechanism we can build custom object for Postgres or other DB. + + * Pros: + * No changes in core Dashboards. That means we can keep Dashboards as it is with very minimal changes. + + + * Cons + * Code reusability is low. + * Some components of Saved object service such as Serializer, Type registry, interface to create internal and scoped repository are only available during Saved Object Service Start. As per the current architecture, first Saved Object Service Setup β†’ Plugin Setup β†’ Saved Object Service Start β†’ Plugin Start. Some core plugin (e.g. opensearch_dashboards_usage_collection) calls find operation before plugin start and it fails because some components are still not available before plugin start. +
+ + **POC**: https://github.com/bandinib-amzn/metadata_plugin/compare/f040daf...89213eb + + +- **Approach 3**: In this approach, we just extend the `SavedObjectsRepository` class and override CRUD and other saved object operation in core Dashboards. + + * Pros: + * As we are extending the repository in core saved object service itself, we can reuse the validation and utility functions for other database options. + + + * Cons + * Changes in core Dashboards : We will be making considerable changes in critical component of Dashboards. + * With this approach, user will have to use the data storage option that we choose. +
+ + **POC**: https://github.com/bandinib-amzn/OpenSearch-Dashboards/compare/main...22d7f30 + +## Implementation Details + + +| Repository | Component | Change | +| ----------- | ----------- | ----------- | +| OpenSearch-Dashboards | Saved Object Service | Add Saved object repository factory provider | +| OpenSearch-Dashboards | Config | Configuration for metadata storage | +| MetaStorage-Plugin [Name TBD] | Plugin / Extension | We will build new plugin for Postgres. This is use case for new interface in Saved Object Repository. | + +### Configuration for metadata storage: +``` +metaStorage.enabled: true +metaStorage.config: { + type: 'xxxx', + hostName: 'xxxx', + userName: 'xxxx', + password: 'xxxx', + port: xxxx, +} +``` + +## Testing and Quality Assurance + +### Testing Approach + +The following testing approach will be used to ensure the quality of the system: + +1. **Unit testing**: Metadata store plugin will be thoroughly unit tested to ensure it meets its requirements and performs as expected. Also we will add new test cases in OpenSearch-Dashboards to test new repository factory provider. +2. **Integration testing**: Components will be integrated and tested together to ensure they work together seamlessly and without conflicts. + diff --git a/examples/embeddable_examples/public/searchable_list_container/searchable_list_container_component.tsx b/examples/embeddable_examples/public/searchable_list_container/searchable_list_container_component.tsx index c24d258fd7d8..7e742aba7cc7 100644 --- a/examples/embeddable_examples/public/searchable_list_container/searchable_list_container_component.tsx +++ b/examples/embeddable_examples/public/searchable_list_container/searchable_list_container_component.tsx @@ -82,7 +82,6 @@ export class SearchableListContainerComponentInner extends Component (checked[id] = false)); this.state = { checked, hasMatch, diff --git a/examples/embeddable_explorer/public/list_container_example.tsx b/examples/embeddable_explorer/public/list_container_example.tsx index 797b87513039..f466d120e218 100644 --- a/examples/embeddable_explorer/public/list_container_example.tsx +++ b/examples/embeddable_explorer/public/list_container_example.tsx @@ -164,6 +164,15 @@ export function ListContainerExample({ The first HelloWorldEmbeddable does not emit the hasMatch output variable, so the container chooses to hide it.

+

+ Type some strings in the search bar, and press Check matching button. If the search + string matches with any strings from the title or the description of the children + embeddables, the child embeddable's check box will be checked. Noted that the + search filter is case sensitive. However, even if the search string matches with the + strings in the HelloWorldEmbeddable, its check box will not be checked because of the + reason explained above. If we click Delete checked, all the selected child embeddables + will be deleted from the container. +

Check out the "Dynamically adding children" section, to see how to add diff --git a/examples/ui_actions_explorer/public/context_menu_examples/context_menu_examples.tsx b/examples/ui_actions_explorer/public/context_menu_examples/context_menu_examples.tsx index d38d80d0fac0..b01d04c1608b 100644 --- a/examples/ui_actions_explorer/public/context_menu_examples/context_menu_examples.tsx +++ b/examples/ui_actions_explorer/public/context_menu_examples/context_menu_examples.tsx @@ -44,6 +44,8 @@ export const ContextMenuExamples: React.FC = () => {

Below examples show how context menu panels look with varying number of actions and how the actions can be grouped into different panels using grouping field. + Grouping can only be one layer deep. A group needs to have at least two items for grouping + to work. A separator is automatically added between groups.

diff --git a/package.json b/package.json index b9eb244f7756..30e6756ca108 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,7 @@ "test:jest:ci": "scripts/use_node scripts/jest --ci --colors --runInBand", "test:jest:ci:coverage": "scripts/use_node scripts/jest --ci --colors --runInBand --coverage", "test:jest_integration": "scripts/use_node scripts/jest_integration", - "test:jest_integration:ci": "scripts/use_node scripts/jest_integration --ci --colors --max-old-space-size=5120", + "test:jest_integration:ci": "scripts/use_node scripts/jest_integration --ci --colors", "test:mocha": "scripts/use_node scripts/mocha", "test:mocha:coverage": "yarn nyc --reporter=text-summary --reporter=lcov --report-dir=./target/opensearch-dashboards-coverage/mocha scripts/use_node scripts/mocha", "test:ftr": "scripts/use_node scripts/functional_tests", @@ -81,7 +81,7 @@ "url": "https://github.com/opensearch-project/opensearch-dashboards.git" }, "resolutions": { - "**/@types/node": "^14.17.32", + "**/@types/node": "~18.7.0", "**/ansi-regex": "^5.0.1", "**/async": "^3.2.3", "**/d3-color": "^3.1.0", @@ -97,7 +97,9 @@ "**/unset-value": "^2.0.1", "**/jest-config": "npm:@amoo-miki/jest-config@27.5.1", "**/jest-jasmine2": "npm:@amoo-miki/jest-jasmine2@27.5.1", - "**/xml2js": "^0.5.0" + "**/set-value": "^4.1.0", + "**/xml2js": "^0.5.0", + "**/yaml": "^2.2.2" }, "workspaces": { "packages": [ @@ -135,7 +137,7 @@ "@hapi/podium": "^4.1.3", "@hapi/vision": "^6.1.0", "@hapi/wreck": "^17.1.0", - "@opensearch-project/opensearch": "^2.1.0", + "@opensearch-project/opensearch": "^2.2.0", "@osd/ace": "1.0.0", "@osd/analytics": "1.0.0", "@osd/apm-config-loader": "1.0.0", @@ -166,9 +168,9 @@ "deep-freeze-strict": "^1.1.1", "del": "^6.1.1", "dns-sync": "^0.2.1", - "elastic-apm-node": "^3.7.0", + "elastic-apm-node": "^3.43.0", "elasticsearch": "^16.7.0", - "http-aws-es": "6.0.0", + "http-aws-es": "npm:@zhongnansu/http-aws-es@6.0.1", "execa": "^4.0.2", "expiry-js": "0.1.7", "fast-deep-equal": "^3.1.1", @@ -176,15 +178,15 @@ "getos": "^3.2.1", "glob": "^7.1.7", "glob-all": "^3.2.1", - "globby": "^8.0.1", + "globby": "^11.1.0", "handlebars": "4.7.7", "hjson": "3.2.1", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^5.0.0", "inline-style": "^2.0.0", "ip-cidr": "^2.1.0", - "joi": "^13.5.2", - "js-yaml": "^3.14.0", + "joi": "^14.3.1", + "js-yaml": "^4.1.0", "json-stable-stringify": "^1.0.1", "json-stringify-safe": "5.0.1", "lodash": "^4.17.21", @@ -199,7 +201,6 @@ "pegjs": "0.10.0", "proxy-from-env": "1.0.0", "query-string": "^6.13.2", - "re2": "1.17.4", "react": "^16.14.0", "react-dom": "^16.12.0", "react-input-range": "^1.3.0", @@ -211,6 +212,7 @@ "rison-node": "1.0.2", "rxjs": "^6.5.5", "semver": "^5.7.0", + "set-value": "^4.1.0", "source-map-support": "^0.5.19", "symbol-observable": "^1.2.0", "tar": "^6.1.11", @@ -288,7 +290,7 @@ "@types/jest": "^27.4.0", "@types/joi": "^13.4.2", "@types/jquery": "^3.3.31", - "@types/js-yaml": "^3.11.1", + "@types/js-yaml": "^4.0.5", "@types/json-stable-stringify": "^1.0.32", "@types/json5": "^0.0.30", "@types/license-checker": "15.0.0", @@ -301,7 +303,7 @@ "@types/mock-fs": "^4.10.0", "@types/moment-timezone": "^0.5.12", "@types/mustache": "^0.8.31", - "@types/node": "^14.17.32", + "@types/node": "~18.7.0", "@types/node-forge": "^1.0.1", "@types/normalize-path": "^3.0.0", "@types/pegjs": "^0.10.1", @@ -342,7 +344,6 @@ "angular-mocks": "^1.8.2", "angular-recursion": "^1.0.5", "angular-route": "^1.8.0", - "angular-sortable-view": "^0.0.17", "archiver": "^5.3.0", "axe-core": "^4.0.2", "babel-eslint": "^10.0.3", @@ -396,7 +397,7 @@ "immer": "^9.0.6", "intl-messageformat-parser": "^1.4.0", "jest": "^27.5.1", - "jest-canvas-mock": "^2.3.1", + "jest-canvas-mock": "^2.5.1", "jest-raw-loader": "^1.0.1", "jimp": "^0.14.0", "jquery": "^3.5.0", @@ -468,7 +469,7 @@ "zlib": "^1.0.5" }, "engines": { - "node": "^14.20.1", + "node": ">=14.20.1 <19", "yarn": "^1.22.10" } } diff --git a/packages/opensearch-eslint-config-opensearch-dashboards/README.md b/packages/opensearch-eslint-config-opensearch-dashboards/README.md index 4fb3f13c8f29..a2f60c437e57 100644 --- a/packages/opensearch-eslint-config-opensearch-dashboards/README.md +++ b/packages/opensearch-eslint-config-opensearch-dashboards/README.md @@ -4,7 +4,7 @@ The eslint config used by the opensearch dashboards team ## Usage -To use this eslint config, just install the peer dependencies and reference it +To use this eslint config, just install the peer dependencies and reference it in your `.eslintrc`: ```javascript @@ -17,8 +17,8 @@ in your `.eslintrc`: ## Optional jest config -If the project uses the [jest test runner](https://facebook.github.io/jest/), -the `@elastic/eslint-config-kibana/jest` config can be extended as well to use +If the project uses the [jest test runner](https://jestjs.io), +the `@elastic/eslint-config-kibana/jest` config can be extended as well to use `eslint-plugin-jest` and add settings specific to it: ```javascript diff --git a/packages/osd-ace/package.json b/packages/osd-ace/package.json index a93467058179..b78ca5e44074 100644 --- a/packages/osd-ace/package.json +++ b/packages/osd-ace/package.json @@ -16,6 +16,6 @@ "@osd/babel-preset": "1.0.0", "raw-loader": "^4.0.2", "typescript": "4.0.2", - "webpack": "^4.41.5" + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2" } } diff --git a/packages/osd-apm-config-loader/package.json b/packages/osd-apm-config-loader/package.json index c3c0249bd73e..fc06ff025e8a 100644 --- a/packages/osd-apm-config-loader/package.json +++ b/packages/osd-apm-config-loader/package.json @@ -13,7 +13,7 @@ "dependencies": { "@elastic/safer-lodash-set": "0.0.0", "@osd/utils": "1.0.0", - "js-yaml": "^3.14.0", + "js-yaml": "^4.1.0", "lodash": "^4.17.21" }, "devDependencies": { diff --git a/packages/osd-apm-config-loader/src/utils/read_config.ts b/packages/osd-apm-config-loader/src/utils/read_config.ts index 806a1ad2e92a..7076060cb04d 100644 --- a/packages/osd-apm-config-loader/src/utils/read_config.ts +++ b/packages/osd-apm-config-loader/src/utils/read_config.ts @@ -29,13 +29,13 @@ */ import { readFileSync } from 'fs'; -import { safeLoad } from 'js-yaml'; +import { load } from 'js-yaml'; import { set } from '@elastic/safer-lodash-set'; import { isPlainObject } from 'lodash'; import { ensureDeepObject } from './ensure_deep_object'; -const readYaml = (path: string) => safeLoad(readFileSync(path, 'utf8')); +const readYaml = (path: string) => load(readFileSync(path, 'utf8')); function replaceEnvVarRefs(val: string) { return val.replace(/\$\{(\w+)\}/g, (match, envVarName) => { diff --git a/packages/osd-config-schema/package.json b/packages/osd-config-schema/package.json index 52471e29527c..c88afe609e1f 100644 --- a/packages/osd-config-schema/package.json +++ b/packages/osd-config-schema/package.json @@ -16,7 +16,7 @@ }, "peerDependencies": { "lodash": "^4.17.21", - "joi": "^13.5.2", + "joi": "^14.3.1", "moment": "^2.24.0", "type-detect": "^4.0.8" } diff --git a/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap b/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap index 38f81a0cc62b..1f5e056ba69a 100644 --- a/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap +++ b/packages/osd-config-schema/src/errors/__snapshots__/schema_error.test.ts.snap @@ -1,8 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`includes stack 1`] = ` -"Error: test - at new SchemaError (packages/osd-config-schema/src/errors/schema_error.ts:35:5) - at Object. (packages/osd-config-schema/src/errors/schema_error.test.ts:59:11) +"SchemaError: test + at Object. (packages/osd-config-schema/src/errors/schema_error.test.ts:67:11) at new Promise ()" `; diff --git a/packages/osd-config-schema/src/errors/schema_error.test.ts b/packages/osd-config-schema/src/errors/schema_error.test.ts index c134c888d510..c00add75719b 100644 --- a/packages/osd-config-schema/src/errors/schema_error.test.ts +++ b/packages/osd-config-schema/src/errors/schema_error.test.ts @@ -33,11 +33,14 @@ import { SchemaError } from '.'; import { standardize, getRepoRoot } from '@osd/cross-platform'; +// ToDo: Remove this logic when Node 14 support is removed +const isNode14 = process.version.startsWith('v14.'); + /** * Make all paths in stacktrace relative. */ -export const cleanStack = (stack: string) => - stack +export const cleanStack = (stack: string) => { + const result = stack .split('\n') .filter((line) => !line.includes('node_modules' + sep) && !line.includes('internal/')) .map((line) => { @@ -54,6 +57,11 @@ export const cleanStack = (stack: string) => }) .join('\n'); + return isNode14 + ? result.replace(/Error:\s([^\n]+)\n\s*at new ([^ ]+) [^\n]*\n/, '$2: $1\n') + : result; +}; + it('includes stack', () => { try { throw new SchemaError('test'); diff --git a/packages/osd-config-schema/src/errors/schema_error.ts b/packages/osd-config-schema/src/errors/schema_error.ts index fd67de08af47..a47453813fcd 100644 --- a/packages/osd-config-schema/src/errors/schema_error.ts +++ b/packages/osd-config-schema/src/errors/schema_error.ts @@ -34,6 +34,7 @@ export class SchemaError extends Error { constructor(message: string, cause?: Error) { super(message); this.cause = cause; + this.name = this.constructor.name; // Set the prototype explicitly, see: // https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work diff --git a/packages/osd-config/package.json b/packages/osd-config/package.json index 7d2f68abc8d8..f6d363c9c386 100644 --- a/packages/osd-config/package.json +++ b/packages/osd-config/package.json @@ -14,7 +14,7 @@ "@osd/config-schema": "1.0.0", "@osd/logging": "1.0.0", "@osd/std": "1.0.0", - "js-yaml": "^3.14.0", + "js-yaml": "^4.1.0", "load-json-file": "^6.2.0", "lodash": "^4.17.21", "moment": "^2.24.0", diff --git a/packages/osd-config/src/config_service.test.ts b/packages/osd-config/src/config_service.test.ts index 0ae49dab6015..0f634537be7e 100644 --- a/packages/osd-config/src/config_service.test.ts +++ b/packages/osd-config/src/config_service.test.ts @@ -94,10 +94,10 @@ test('throws if config at path does not match schema', async () => { ); await expect(valuesReceived).toMatchInlineSnapshot(` - Array [ - [Error: [config validation of [key]]: expected value of type [string] but got [number]], - ] - `); + Array [ + [ValidationError: [config validation of [key]]: expected value of type [string] but got [number]], + ] + `); }); test('re-validate config when updated', async () => { @@ -120,11 +120,11 @@ test('re-validate config when updated', async () => { rawConfig$.next({ key: 123 }); await expect(valuesReceived).toMatchInlineSnapshot(` - Array [ - "value", - [Error: [config validation of [key]]: expected value of type [string] but got [number]], - ] - `); + Array [ + "value", + [ValidationError: [config validation of [key]]: expected value of type [string] but got [number]], + ] + `); }); test("returns undefined if fetching optional config at a path that doesn't exist", async () => { diff --git a/packages/osd-config/src/raw/read_config.ts b/packages/osd-config/src/raw/read_config.ts index 0c4a7c2330de..ad7820381eee 100644 --- a/packages/osd-config/src/raw/read_config.ts +++ b/packages/osd-config/src/raw/read_config.ts @@ -29,13 +29,13 @@ */ import { readFileSync } from 'fs'; -import { safeLoad } from 'js-yaml'; +import { load } from 'js-yaml'; import { set } from '@elastic/safer-lodash-set'; import { isPlainObject } from 'lodash'; import { ensureDeepObject } from './ensure_deep_object'; -const readYaml = (path: string) => safeLoad(readFileSync(path, 'utf8')); +const readYaml = (path: string) => load(readFileSync(path, 'utf8')); function replaceEnvVarRefs(val: string) { return val.replace(/\$\{(\w+)\}/g, (match, envVarName) => { diff --git a/packages/osd-cross-platform/src/path.test.ts b/packages/osd-cross-platform/src/path.test.ts index ed405298ad13..3e338a426fda 100644 --- a/packages/osd-cross-platform/src/path.test.ts +++ b/packages/osd-cross-platform/src/path.test.ts @@ -5,7 +5,7 @@ import path from 'path'; import fs from 'fs'; -import { access, rmdir, mkdir, writeFile, symlink } from 'fs/promises'; +import { access, rm, mkdir, writeFile, symlink } from 'fs/promises'; import { resolveToFullNameSync, @@ -43,9 +43,9 @@ describe('Cross Platform', () => { try { // If leftover artifacts were found, get rid of them await access(tmpTestFolder); - await rmdir(tmpTestFolder, { recursive: true }); + await rm(tmpTestFolder, { recursive: true }); } catch (ex) { - // Do nothing; if `rmdir` failed, let the `mkdir` below throw the error + // Do nothing; if `rm` failed, let the `mkdir` below throw the error } await mkdir(tmpTestFolder); @@ -60,7 +60,7 @@ describe('Cross Platform', () => { afterAll(async () => { try { - await rmdir(tmpTestFolder, { recursive: true }); + await rm(tmpTestFolder, { recursive: true }); } catch (ex) { // Do nothing } diff --git a/packages/osd-dev-utils/package.json b/packages/osd-dev-utils/package.json index ea433fa5e101..6a7a4fd9d647 100644 --- a/packages/osd-dev-utils/package.json +++ b/packages/osd-dev-utils/package.json @@ -22,7 +22,7 @@ "execa": "^4.0.2", "exit-hook": "^2.2.0", "getopts": "^2.2.5", - "globby": "^8.0.1", + "globby": "^11.1.0", "load-json-file": "^6.2.0", "markdown-it": "^12.3.2", "moment": "^2.24.0", diff --git a/packages/osd-dev-utils/src/proc_runner/proc.ts b/packages/osd-dev-utils/src/proc_runner/proc.ts index 1de472df40b2..c5e905204915 100644 --- a/packages/osd-dev-utils/src/proc_runner/proc.ts +++ b/packages/osd-dev-utils/src/proc_runner/proc.ts @@ -153,7 +153,7 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) { await withTimeout( async () => { log.debug(`Sending "${signal}" to proc "${name}"`); - await treeKillAsync(childProcess.pid, signal); + await treeKillAsync(childProcess.pid!, signal); await outcomePromise; }, STOP_TIMEOUT, @@ -161,7 +161,7 @@ export function startProc(name: string, options: ProcOptions, log: ToolingLog) { log.warning( `Proc "${name}" was sent "${signal}" didn't emit the "exit" or "error" events after ${STOP_TIMEOUT} ms, sending SIGKILL` ); - await treeKillAsync(childProcess.pid, 'SIGKILL'); + await treeKillAsync(childProcess.pid!, 'SIGKILL'); } ); diff --git a/packages/osd-dev-utils/src/serializers/absolute_path_serializer.ts b/packages/osd-dev-utils/src/serializers/absolute_path_serializer.ts index 939b6e9924df..b7c6f8fe9139 100644 --- a/packages/osd-dev-utils/src/serializers/absolute_path_serializer.ts +++ b/packages/osd-dev-utils/src/serializers/absolute_path_serializer.ts @@ -37,6 +37,10 @@ export function createAbsolutePathSerializer( ) { const rootPaths = Array.isArray(rootPath) ? rootPath : [rootPath]; + if (process.platform === 'win32') { + rootPaths.push(...rootPaths.map((name) => name.replace(/\\/g, '/'))); + } + return { test: (value: any) => typeof value === 'string' && rootPaths.some((path) => value.startsWith(path)), diff --git a/packages/osd-dev-utils/src/serializers/index.ts b/packages/osd-dev-utils/src/serializers/index.ts index 4ea72efe3f53..2755a5a79147 100644 --- a/packages/osd-dev-utils/src/serializers/index.ts +++ b/packages/osd-dev-utils/src/serializers/index.ts @@ -33,3 +33,4 @@ export * from './strip_ansi_serializer'; export * from './recursive_serializer'; export * from './any_instance_serizlizer'; export * from './replace_serializer'; +export * from './strip_promises_serizlizer'; diff --git a/packages/osd-dev-utils/src/serializers/strip_promises_serizlizer.ts b/packages/osd-dev-utils/src/serializers/strip_promises_serizlizer.ts new file mode 100644 index 000000000000..eda8422c77c4 --- /dev/null +++ b/packages/osd-dev-utils/src/serializers/strip_promises_serizlizer.ts @@ -0,0 +1,9 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +export const createStripPromisesSerializer = () => ({ + serialize: (value: string) => value.replace(/("value": Promise) \{[^}]+}/gm, '$1 {}'), + test: (value: any) => typeof value === 'string', +}); diff --git a/packages/osd-dev-utils/src/simple_opensearch_dashboards_platform_plugin_discovery.ts b/packages/osd-dev-utils/src/simple_opensearch_dashboards_platform_plugin_discovery.ts index ef6c5913d9b4..b84579a36d3e 100644 --- a/packages/osd-dev-utils/src/simple_opensearch_dashboards_platform_plugin_discovery.ts +++ b/packages/osd-dev-utils/src/simple_opensearch_dashboards_platform_plugin_discovery.ts @@ -28,7 +28,8 @@ * under the License. */ -import Path from 'path'; +import { resolve } from 'path'; +import { standardize } from '@osd/cross-platform'; import globby from 'globby'; @@ -47,24 +48,23 @@ export function simpleOpenSearchDashboardsPlatformPluginDiscovery( ...scanDirs.reduce( (acc: string[], dir) => [ ...acc, - Path.resolve(dir, '*/opensearch_dashboards.json'), - Path.resolve(dir, '*/*/opensearch_dashboards.json'), - Path.resolve(dir, '*/*/*/opensearch_dashboards.json'), - Path.resolve(dir, '*/*/*/*/opensearch_dashboards.json'), - Path.resolve(dir, '*/*/*/*/*/opensearch_dashboards.json'), + resolve(dir, '*/opensearch_dashboards.json'), + resolve(dir, '*/*/opensearch_dashboards.json'), + resolve(dir, '*/*/*/opensearch_dashboards.json'), + resolve(dir, '*/*/*/*/opensearch_dashboards.json'), + resolve(dir, '*/*/*/*/*/opensearch_dashboards.json'), ], [] ), - ...pluginPaths.map((path) => Path.resolve(path, `opensearch_dashboards.json`)), + ...pluginPaths.map((path) => resolve(path, `opensearch_dashboards.json`)), ]) ); - const manifestPaths = globby.sync(patterns, { absolute: true }).map((path) => - // absolute paths returned from globby are using normalize or - // something so the path separators are `/` even on windows, - // Path.resolve solves this - Path.resolve(path) - ); + const standardizedPatterns = patterns.map((pattern) => standardize(pattern)); + + const manifestPaths = globby + .sync(standardizedPatterns, { absolute: true }) + .map((path) => standardize(resolve(path))); return manifestPaths.map(parseOpenSearchDashboardsPlatformPlugin); } diff --git a/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json b/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json index 1594e45e50b5..1112cb1ed223 100755 --- a/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json +++ b/packages/osd-eslint-import-resolver-opensearch-dashboards/package.json @@ -19,6 +19,6 @@ "glob-all": "^3.2.1", "lru-cache": "^4.1.5", "resolve": "^1.7.1", - "webpack": "^4.41.5" + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2" } } diff --git a/packages/osd-interpreter/package.json b/packages/osd-interpreter/package.json index 77ec29c839dd..6d11eb3bc1ee 100644 --- a/packages/osd-interpreter/package.json +++ b/packages/osd-interpreter/package.json @@ -27,11 +27,11 @@ "del": "^6.1.1", "getopts": "^2.2.5", "pegjs": "0.10.0", - "sass-loader": "^10.2.0", + "sass-loader": "^10.4.1", "style-loader": "^1.1.3", "supports-color": "^7.0.0", "url-loader": "^2.2.0", - "webpack": "^4.41.5", + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2", "webpack-cli": "^4.9.2" } } diff --git a/packages/osd-monaco/package.json b/packages/osd-monaco/package.json index a3f973d11fd0..ae9cfaddc53a 100644 --- a/packages/osd-monaco/package.json +++ b/packages/osd-monaco/package.json @@ -13,6 +13,7 @@ "monaco-editor": "~0.17.0" }, "devDependencies": { + "@node-rs/xxhash": "^1.3.0", "@osd/babel-preset": "1.0.0", "@osd/dev-utils": "1.0.0", "babel-loader": "^8.2.3", @@ -21,7 +22,7 @@ "raw-loader": "^4.0.2", "supports-color": "^7.0.0", "typescript": "4.0.2", - "webpack": "^4.41.5", + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2", "webpack-cli": "^4.9.2" } } diff --git a/packages/osd-monaco/webpack.config.js b/packages/osd-monaco/webpack.config.js index 1e3f108b95e5..b111fcb2608d 100644 --- a/packages/osd-monaco/webpack.config.js +++ b/packages/osd-monaco/webpack.config.js @@ -36,6 +36,7 @@ const createLangWorkerConfig = (lang) => ({ output: { path: path.resolve(__dirname, 'target/public'), filename: `${lang}.editor.worker.js`, + hashFunction: 'Xxh64', }, resolve: { modules: ['node_modules'], diff --git a/packages/osd-opensearch/package.json b/packages/osd-opensearch/package.json index 02fcddb36e6f..44404a9ae5a3 100644 --- a/packages/osd-opensearch/package.json +++ b/packages/osd-opensearch/package.json @@ -12,7 +12,7 @@ "osd:watch": "../../scripts/use_node scripts/build --watch" }, "dependencies": { - "@opensearch-project/opensearch": "^2.1.0", + "@opensearch-project/opensearch": "^2.2.0", "@osd/dev-utils": "1.0.0", "abort-controller": "^3.0.0", "chalk": "^4.1.0", diff --git a/packages/osd-optimizer/limits.yml b/packages/osd-optimizer/limits.yml index d39f9316c80d..516ebae80abf 100644 --- a/packages/osd-optimizer/limits.yml +++ b/packages/osd-optimizer/limits.yml @@ -74,7 +74,6 @@ pageLoadAssetSize: telemetry: 91832 telemetryManagementSection: 52443 tileMap: 65337 - timeline: 29920 transform: 41151 triggersActionsUi: 170145 uiActions: 95074 diff --git a/packages/osd-optimizer/package.json b/packages/osd-optimizer/package.json index 2aec5681ba91..27047c7b4ef5 100644 --- a/packages/osd-optimizer/package.json +++ b/packages/osd-optimizer/package.json @@ -19,22 +19,21 @@ "@osd/ui-shared-deps": "1.0.0", "autoprefixer": "^10.4.1", "clean-webpack-plugin": "^3.0.0", - "compression-webpack-plugin": "^4.0.0", + "compression-webpack-plugin": "npm:@amoo-miki/compression-webpack-plugin@4.0.1-rc.1", "cpy": "^8.0.0", "core-js": "^3.6.5", "dedent": "^0.7.0", "del": "^6.1.1", "execa": "^4.0.2", - "fibers": "^5.0.3", "jest-diff": "^27.5.1", - "js-yaml": "^3.14.0", + "js-yaml": "^4.1.0", "json-stable-stringify": "^1.0.1", - "lmdb-store": "^1.6.11", + "lmdb": "^2.8.0", "normalize-path": "^3.0.0", "pirates": "^4.0.1", "postcss": "^8.4.5", "rxjs": "^6.5.5", - "sass": "~1.26.11", + "node-sass": "^8.0.0", "source-map-support": "^0.5.19", "terser-webpack-plugin": "^2.1.2", "tinymath": "1.2.1", @@ -42,8 +41,9 @@ "webpack-merge": "^4.2.2" }, "devDependencies": { + "@node-rs/xxhash": "^1.3.0", "@types/babel__core": "^7.1.17", - "@types/compression-webpack-plugin": "^2.0.2", + "@types/compression-webpack-plugin": "^6.0.6", "@types/loader-utils": "^1.1.3", "@types/source-map-support": "^0.5.3", "@types/watchpack": "^1.1.6", @@ -54,10 +54,10 @@ "loader-utils": "^2.0.4", "postcss-loader": "^4.2.0", "raw-loader": "^4.0.2", - "sass-loader": "^10.2.0", + "sass-loader": "^10.4.1", "style-loader": "^1.1.3", "url-loader": "^2.2.0", "val-loader": "^2.1.2", - "webpack": "^4.41.5" + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2" } } diff --git a/packages/osd-optimizer/src/__mocks__/lmdb.ts b/packages/osd-optimizer/src/__mocks__/lmdb.ts new file mode 100644 index 000000000000..d0bfe969d207 --- /dev/null +++ b/packages/osd-optimizer/src/__mocks__/lmdb.ts @@ -0,0 +1,17 @@ +/* + * Copyright OpenSearch Contributors + * SPDX-License-Identifier: Apache-2.0 + */ + +jest.mock('lmdb', () => { + const mockedLmdb = { + open: jest.fn(() => ({ + openDB: jest.fn(() => ({ + get: jest.fn(), + putSync: jest.fn(), + remove: jest.fn(), + })), + })), + }; + return mockedLmdb; +}); diff --git a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap index aaa485172c5f..63b7e44fea07 100644 --- a/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap +++ b/packages/osd-optimizer/src/integration_tests/__snapshots__/basic_optimization.test.ts.snap @@ -74,7 +74,7 @@ OptimizerConfig { } `; -exports[`prepares assets for distribution: bar bundle 1`] = `"(function(modules){var installedModules={};function __webpack_require__(moduleId){if(installedModules[moduleId]){return installedModules[moduleId].exports}var module=installedModules[moduleId]={i:moduleId,l:false,exports:{}};modules[moduleId].call(module.exports,module,module.exports,__webpack_require__);module.l=true;return module.exports}__webpack_require__.m=modules;__webpack_require__.c=installedModules;__webpack_require__.d=function(exports,name,getter){if(!__webpack_require__.o(exports,name)){Object.defineProperty(exports,name,{enumerable:true,get:getter})}};__webpack_require__.r=function(exports){if(typeof Symbol!==\\"undefined\\"&&Symbol.toStringTag){Object.defineProperty(exports,Symbol.toStringTag,{value:\\"Module\\"})}Object.defineProperty(exports,\\"__esModule\\",{value:true})};__webpack_require__.t=function(value,mode){if(mode&1)value=__webpack_require__(value);if(mode&8)return value;if(mode&4&&typeof value===\\"object\\"&&value&&value.__esModule)return value;var ns=Object.create(null);__webpack_require__.r(ns);Object.defineProperty(ns,\\"default\\",{enumerable:true,value:value});if(mode&2&&typeof value!=\\"string\\")for(var key in value)__webpack_require__.d(ns,key,function(key){return value[key]}.bind(null,key));return ns};__webpack_require__.n=function(module){var getter=module&&module.__esModule?function getDefault(){return module[\\"default\\"]}:function getModuleExports(){return module};__webpack_require__.d(getter,\\"a\\",getter);return getter};__webpack_require__.o=function(object,property){return Object.prototype.hasOwnProperty.call(object,property)};__webpack_require__.p=\\"\\";return __webpack_require__(__webpack_require__.s=3)})([function(module,exports,__webpack_require__){\\"use strict\\";module.exports=function(cssWithMappingToString){var list=[];list.toString=function toString(){return this.map((function(item){var content=cssWithMappingToString(item);if(item[2]){return\\"@media \\".concat(item[2],\\" {\\").concat(content,\\"}\\")}return content})).join(\\"\\")};list.i=function(modules,mediaQuery,dedupe){if(typeof modules===\\"string\\"){modules=[[null,modules,\\"\\"]]}var alreadyImportedModules={};if(dedupe){for(var i=0;i value.split(REPO_ROOT).join('').replace(/\\/g, '/'), - test: (value: any) => typeof value === 'string' && value.includes(REPO_ROOT), -}); +const absolutePathSerializer = createAbsolutePathSerializer(); +expect.addSnapshotSerializer(absolutePathSerializer); const log = new ToolingLog({ level: 'error', @@ -159,15 +158,16 @@ it('builds expected bundles, saves bundle counts to metadata', async () => { expect(foo).toBeTruthy(); foo.cache.refresh(); expect(foo.cache.getModuleCount()).toBe(6); - expect(foo.cache.getReferencedFiles()).toMatchInlineSnapshot(` + expect(foo.cache.getReferencedFiles()?.map(absolutePathSerializer.serialize).sort()) + .toMatchInlineSnapshot(` Array [ - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/opensearch_dashboards.json, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/async_import.ts, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/ext.ts, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/index.ts, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.ts, - /packages/osd-optimizer/target/worker/entry_point_creator.js, - /packages/osd-ui-shared-deps/public_path_module_creator.js, + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/opensearch_dashboards.json", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/async_import.ts", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/ext.ts", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/index.ts", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/foo/public/lib.ts", + "/packages/osd-optimizer/target/worker/entry_point_creator.js", + "/packages/osd-ui-shared-deps/public_path_module_creator.js", ] `); @@ -179,21 +179,22 @@ it('builds expected bundles, saves bundle counts to metadata', async () => { 17 ); - expect(bar.cache.getReferencedFiles()).toMatchInlineSnapshot(` + expect(bar.cache.getReferencedFiles()?.map(absolutePathSerializer.serialize).sort()) + .toMatchInlineSnapshot(` Array [ - /node_modules/css-loader/package.json, - /node_modules/style-loader/package.json, - /packages/osd-optimizer/postcss.config.js, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/opensearch_dashboards.json, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.scss, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.ts, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/_other_styles.scss, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/styles.scss, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/lib.ts, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7dark.scss, - /packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7light.scss, - /packages/osd-optimizer/target/worker/entry_point_creator.js, - /packages/osd-ui-shared-deps/public_path_module_creator.js, + "/node_modules/css-loader/package.json", + "/node_modules/style-loader/package.json", + "/packages/osd-optimizer/postcss.config.js", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/opensearch_dashboards.json", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.scss", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/index.ts", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/_other_styles.scss", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/legacy/styles.scss", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/plugins/bar/public/lib.ts", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7dark.scss", + "/packages/osd-optimizer/src/__fixtures__/__tmp__/mock_repo/src/core/public/core_app/styles/_globals_v7light.scss", + "/packages/osd-optimizer/target/worker/entry_point_creator.js", + "/packages/osd-ui-shared-deps/public_path_module_creator.js", ] `); }); @@ -256,7 +257,6 @@ const expectFileMatchesSnapshotWithCompression = (filePath: string, snapshotLabe // Verify the brotli variant matches expect( - // @ts-expect-error @types/node is missing the brotli functions Zlib.brotliDecompressSync( Fs.readFileSync(Path.resolve(MOCK_REPO_DIR, `${filePath}.br`)) ).toString() diff --git a/packages/osd-optimizer/src/limits.ts b/packages/osd-optimizer/src/limits.ts index 86b186930275..d81137c3a9a4 100644 --- a/packages/osd-optimizer/src/limits.ts +++ b/packages/osd-optimizer/src/limits.ts @@ -51,7 +51,7 @@ export function readLimits(): Limits { } } - return yaml ? (Yaml.safeLoad(yaml) as any) : {}; + return yaml ? (Yaml.load(yaml) as any) : {}; } export function validateLimitsForAllBundles(log: ToolingLog, config: OptimizerConfig) { @@ -109,6 +109,6 @@ export function updateBundleLimits(log: ToolingLog, config: OptimizerConfig) { pageLoadAssetSize, }; - Fs.writeFileSync(LIMITS_PATH, Yaml.safeDump(newLimits)); + Fs.writeFileSync(LIMITS_PATH, Yaml.dump(newLimits)); log.success(`wrote updated limits to ${LIMITS_PATH}`); } diff --git a/packages/osd-optimizer/src/node/cache.ts b/packages/osd-optimizer/src/node/cache.ts index e60038102fb5..a81c656267bf 100644 --- a/packages/osd-optimizer/src/node/cache.ts +++ b/packages/osd-optimizer/src/node/cache.ts @@ -32,7 +32,7 @@ import Path from 'path'; import { Writable } from 'stream'; import chalk from 'chalk'; -import * as LmdbStore from 'lmdb-store'; +import LMDB from 'lmdb'; import { getMatchingRoot } from '@osd/cross-platform'; const GLOBAL_ATIME = `${Date.now()}`; @@ -40,15 +40,15 @@ const MINUTE = 1000 * 60; const HOUR = MINUTE * 60; const DAY = HOUR * 24; -const dbName = (db: LmdbStore.Database) => +const dbName = (db: LMDB.Database) => // @ts-expect-error db.name is not a documented/typed property db.name; export class Cache { - private readonly codes: LmdbStore.RootDatabase; - private readonly atimes: LmdbStore.Database; - private readonly mtimes: LmdbStore.Database; - private readonly sourceMaps: LmdbStore.Database; + private readonly codes: LMDB.RootDatabase; + private readonly atimes: LMDB.Database; + private readonly mtimes: LMDB.Database; + private readonly sourceMaps: LMDB.Database; private readonly pathRoots: string[]; private readonly prefix: string; private readonly log?: Writable; @@ -70,7 +70,7 @@ export class Cache { this.prefix = config.prefix; this.log = config.log; - this.codes = LmdbStore.open(config.dir, { + this.codes = LMDB.open(config.dir, { name: 'codes', encoding: 'string', maxReaders: 500, @@ -144,6 +144,7 @@ export class Cache { close() { clearTimeout(this.timer); + return this.codes?.close?.(); } private getKey(path: string) { @@ -162,7 +163,7 @@ export class Cache { return `${this.prefix}${normalizedPath}`; } - private safeGet(db: LmdbStore.Database, key: string) { + private safeGet(db: LMDB.Database, key: string) { try { const value = db.get(key); this.debug(value === undefined ? 'MISS' : 'HIT', db, key); @@ -172,7 +173,7 @@ export class Cache { } } - private async safePut(db: LmdbStore.Database, key: string, value: V) { + private async safePut(db: LMDB.Database, key: string, value: V) { try { await db.put(key, value); this.debug('PUT', db, key); @@ -181,13 +182,13 @@ export class Cache { } } - private debug(type: string, db: LmdbStore.Database, key: LmdbStore.Key) { + private debug(type: string, db: LMDB.Database, key: LMDB.Key) { if (this.log) { this.log.write(`${type} [${dbName(db)}] ${String(key)}\n`); } } - private logError(type: 'GET' | 'PUT', db: LmdbStore.Database, key: LmdbStore.Key, error: Error) { + private logError(type: 'GET' | 'PUT', db: LMDB.Database, key: LMDB.Key, error: Error) { this.debug(`ERROR/${type}`, db, `${String(key)}: ${error.stack}`); process.stderr.write( chalk.red( @@ -204,7 +205,6 @@ export class Cache { const validKeys: string[] = []; const invalidKeys: string[] = []; - // @ts-expect-error See https://github.com/DoctorEvidence/lmdb-store/pull/18 for (const { key, value } of this.atimes.getRange()) { const atime = parseInt(`${value}`, 10); if (Number.isNaN(atime) || atime < ATIME_LIMIT) { diff --git a/packages/osd-optimizer/src/optimizer/optimizer_config.test.ts b/packages/osd-optimizer/src/optimizer/optimizer_config.test.ts index a8a950726592..30620478349d 100644 --- a/packages/osd-optimizer/src/optimizer/optimizer_config.test.ts +++ b/packages/osd-optimizer/src/optimizer/optimizer_config.test.ts @@ -43,7 +43,17 @@ jest.mock('os', () => { return realOs; }); +jest.mock('fs', () => { + const originalFs = jest.requireActual('fs'); + return { + ...originalFs, + existsSync: jest.fn(), + realpathSync: originalFs.realpathSync, + }; +}); + import Path from 'path'; +import { existsSync } from 'fs'; import { REPO_ROOT } from '@osd/utils'; import { createAbsolutePathSerializer } from '@osd/dev-utils'; @@ -122,7 +132,265 @@ describe('OptimizerConfig::parseOptions()', () => { expect(parseThemeTags).toBeCalledWith('foo'); }); - it('applies defaults', () => { + it('applies defaults if opensearch-dashboards-extra path does not exist', () => { + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + }) + ).toMatchInlineSnapshot(` + Object { + "cache": true, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 2, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [ + /src/plugins, + /plugins, + /opensearch-dashboards-extra, + ], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + cache: false, + }) + ).toMatchInlineSnapshot(` + Object { + "cache": false, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 2, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [ + /src/plugins, + /plugins, + /opensearch-dashboards-extra, + ], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + examples: true, + }) + ).toMatchInlineSnapshot(` + Object { + "cache": true, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 2, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [ + /src/plugins, + /plugins, + /examples, + /opensearch-dashboards-extra, + ], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + }) + ).toMatchInlineSnapshot(` + Object { + "cache": true, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 2, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [ + /src/plugins, + /plugins, + /opensearch-dashboards-extra, + ], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + pluginScanDirs: [Path.resolve(REPO_ROOT, 'x/y/z'), '/outside/of/repo'], + }) + ).toMatchInlineSnapshot(` + Object { + "cache": true, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 2, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [ + /x/y/z, + "/outside/of/repo", + ], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + process.env.OSD_OPTIMIZER_MAX_WORKERS = '100'; + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + pluginScanDirs: [], + }) + ).toMatchInlineSnapshot(` + Object { + "cache": true, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 100, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + process.env.OSD_OPTIMIZER_NO_CACHE = '0'; + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + pluginScanDirs: [], + }) + ).toMatchInlineSnapshot(` + Object { + "cache": false, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 100, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + process.env.OSD_OPTIMIZER_NO_CACHE = '1'; + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + pluginScanDirs: [], + }) + ).toMatchInlineSnapshot(` + Object { + "cache": false, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 100, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + process.env.OSD_OPTIMIZER_NO_CACHE = '1'; + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + pluginScanDirs: [], + cache: true, + }) + ).toMatchInlineSnapshot(` + Object { + "cache": false, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 100, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + + delete process.env.OSD_OPTIMIZER_NO_CACHE; + expect( + OptimizerConfig.parseOptions({ + repoRoot: REPO_ROOT, + pluginScanDirs: [], + cache: true, + }) + ).toMatchInlineSnapshot(` + Object { + "cache": true, + "dist": false, + "filters": Array [], + "includeCoreBundle": false, + "inspectWorkers": false, + "maxWorkerCount": 100, + "outputRoot": , + "pluginPaths": Array [], + "pluginScanDirs": Array [], + "profileWebpack": false, + "repoRoot": , + "themeTags": undefined, + "watch": false, + } + `); + }); + + it('applies defaults if opensearch-dashboards-extra path exists', () => { + (existsSync as jest.Mock).mockReturnValue(true); expect( OptimizerConfig.parseOptions({ repoRoot: REPO_ROOT, @@ -461,7 +729,7 @@ describe('OptimizerConfig::create()', () => { [Window], ], "invocationCallOrder": Array [ - 21, + 39, ], "lastCall": Array [ Symbol(parsed plugin scan dirs), @@ -491,7 +759,7 @@ describe('OptimizerConfig::create()', () => { [Window], ], "invocationCallOrder": Array [ - 23, + 41, ], "lastCall": Array [ Array [], @@ -522,7 +790,7 @@ describe('OptimizerConfig::create()', () => { [Window], ], "invocationCallOrder": Array [ - 22, + 40, ], "lastCall": Array [ Symbol(new platform plugins), diff --git a/packages/osd-optimizer/src/worker/webpack.config.ts b/packages/osd-optimizer/src/worker/webpack.config.ts index caeed72a3bb1..f5272c207548 100644 --- a/packages/osd-optimizer/src/worker/webpack.config.ts +++ b/packages/osd-optimizer/src/worker/webpack.config.ts @@ -50,7 +50,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: const commonConfig: webpack.Configuration = { node: { fs: 'empty' }, - context: bundle.contextDir, + context: Path.normalize(bundle.contextDir), cache: true, entry: { [bundle.id]: ENTRY_CREATOR, @@ -69,6 +69,7 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: info.absoluteResourcePath )}${info.query}`, jsonpFunction: `${bundle.id}_bundle_jsonpfunction`, + hashFunction: 'Xxh64', }, optimization: { @@ -176,12 +177,11 @@ export function getWebpackConfig(bundle: Bundle, bundleRefs: BundleRefs, worker: )};\n${content}`; }, webpackImporter: false, - implementation: require('sass'), + implementation: require('node-sass'), sassOptions: { outputStyle: 'compressed', includePaths: [Path.resolve(worker.repoRoot, 'node_modules')], sourceMapRoot: `/${bundle.type}:${bundle.id}`, - fiber: require('fibers'), }, }, }, diff --git a/packages/osd-pm/dist/index.js b/packages/osd-pm/dist/index.js index 944856a8dd13..e43a9bfe407e 100644 --- a/packages/osd-pm/dist/index.js +++ b/packages/osd-pm/dist/index.js @@ -134,7 +134,7 @@ Object.defineProperty(exports, "run", { var _cli = __webpack_require__(1); -var _production = __webpack_require__(516); +var _production = __webpack_require__(515); var _projects = __webpack_require__(146); @@ -783,245 +783,245 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - if (typeof b !== "function" && b !== null) - throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -var __createBinding = Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -}); - -function __exportStar(m, o) { - for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -/** @deprecated */ -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -/** @deprecated */ -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -} - -function __spreadArray(to, from, pack) { - if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { - if (ar || !(i in from)) { - if (!ar) ar = Array.prototype.slice.call(from, 0, i); - ar[i] = from[i]; - } - } - return to.concat(ar || Array.prototype.slice.call(from)); -} - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -var __setModuleDefault = Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, state, kind, f) { - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); - return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); -} - -function __classPrivateFieldSet(receiver, state, value, kind, f) { - if (kind === "m") throw new TypeError("Private method is not writable"); - if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); - if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); - return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + if (typeof b !== "function" && b !== null) + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +var __createBinding = Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +}); + +function __exportStar(m, o) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +/** @deprecated */ +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +/** @deprecated */ +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +} + +function __spreadArray(to, from, pack) { + if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { + if (ar || !(i in from)) { + if (!ar) ar = Array.prototype.slice.call(from, 0, i); + ar[i] = from[i]; + } + } + return to.concat(ar || Array.prototype.slice.call(from)); +} + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +var __setModuleDefault = Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, state, kind, f) { + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); + return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); +} + +function __classPrivateFieldSet(receiver, state, value, kind, f) { + if (kind === "m") throw new TypeError("Private method is not writable"); + if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); + if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); + return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; +} /***/ }), @@ -1701,224 +1701,224 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__importDefault", function() { return __importDefault; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldGet", function() { return __classPrivateFieldGet; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "__classPrivateFieldSet", function() { return __classPrivateFieldSet; }); -/*! ***************************************************************************** -Copyright (c) Microsoft Corporation. - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH -REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY -AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, -INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM -LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR -OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -PERFORMANCE OF THIS SOFTWARE. -***************************************************************************** */ -/* global Reflect, Promise */ - -var extendStatics = function(d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); -}; - -function __extends(d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); -} - -var __assign = function() { - __assign = Object.assign || function __assign(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; - } - return t; - } - return __assign.apply(this, arguments); -} - -function __rest(s, e) { - var t = {}; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) - t[p] = s[p]; - if (s != null && typeof Object.getOwnPropertySymbols === "function") - for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { - if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) - t[p[i]] = s[p[i]]; - } - return t; -} - -function __decorate(decorators, target, key, desc) { - var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; - if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); - else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; - return c > 3 && r && Object.defineProperty(target, key, r), r; -} - -function __param(paramIndex, decorator) { - return function (target, key) { decorator(target, key, paramIndex); } -} - -function __metadata(metadataKey, metadataValue) { - if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); -} - -function __awaiter(thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -} - -function __generator(thisArg, body) { - var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; - return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; - function verb(n) { return function (v) { return step([n, v]); }; } - function step(op) { - if (f) throw new TypeError("Generator is already executing."); - while (_) try { - if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; - if (y = 0, t) op = [op[0] & 2, t.value]; - switch (op[0]) { - case 0: case 1: t = op; break; - case 4: _.label++; return { value: op[1], done: false }; - case 5: _.label++; y = op[1]; op = [0]; continue; - case 7: op = _.ops.pop(); _.trys.pop(); continue; - default: - if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } - if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } - if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } - if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } - if (t[2]) _.ops.pop(); - _.trys.pop(); continue; - } - op = body.call(thisArg, _); - } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } - if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; - } -} - -function __createBinding(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -} - -function __exportStar(m, exports) { - for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; -} - -function __values(o) { - var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; - if (m) return m.call(o); - if (o && typeof o.length === "number") return { - next: function () { - if (o && i >= o.length) o = void 0; - return { value: o && o[i++], done: !o }; - } - }; - throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); -} - -function __read(o, n) { - var m = typeof Symbol === "function" && o[Symbol.iterator]; - if (!m) return o; - var i = m.call(o), r, ar = [], e; - try { - while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); - } - catch (error) { e = { error: error }; } - finally { - try { - if (r && !r.done && (m = i["return"])) m.call(i); - } - finally { if (e) throw e.error; } - } - return ar; -} - -function __spread() { - for (var ar = [], i = 0; i < arguments.length; i++) - ar = ar.concat(__read(arguments[i])); - return ar; -} - -function __spreadArrays() { - for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; - for (var r = Array(s), k = 0, i = 0; i < il; i++) - for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) - r[k] = a[j]; - return r; -}; - -function __await(v) { - return this instanceof __await ? (this.v = v, this) : new __await(v); -} - -function __asyncGenerator(thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -} - -function __asyncDelegator(o) { - var i, p; - return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; - function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } -} - -function __asyncValues(o) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var m = o[Symbol.asyncIterator], i; - return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); - function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } - function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } -} - -function __makeTemplateObject(cooked, raw) { - if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } - return cooked; -}; - -function __importStar(mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result.default = mod; - return result; -} - -function __importDefault(mod) { - return (mod && mod.__esModule) ? mod : { default: mod }; -} - -function __classPrivateFieldGet(receiver, privateMap) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to get private field on non-instance"); - } - return privateMap.get(receiver); -} - -function __classPrivateFieldSet(receiver, privateMap, value) { - if (!privateMap.has(receiver)) { - throw new TypeError("attempted to set private field on non-instance"); - } - privateMap.set(receiver, value); - return value; -} +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = function(d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); +}; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +var __assign = function() { + __assign = Object.assign || function __assign(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; + } + return t; + } + return __assign.apply(this, arguments); +} + +function __rest(s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +} + +function __decorate(decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +} + +function __param(paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +} + +function __metadata(metadataKey, metadataValue) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); +} + +function __awaiter(thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +} + +function __generator(thisArg, body) { + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; + function verb(n) { return function (v) { return step([n, v]); }; } + function step(op) { + if (f) throw new TypeError("Generator is already executing."); + while (_) try { + if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; + if (y = 0, t) op = [op[0] & 2, t.value]; + switch (op[0]) { + case 0: case 1: t = op; break; + case 4: _.label++; return { value: op[1], done: false }; + case 5: _.label++; y = op[1]; op = [0]; continue; + case 7: op = _.ops.pop(); _.trys.pop(); continue; + default: + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } + if (t[2]) _.ops.pop(); + _.trys.pop(); continue; + } + op = body.call(thisArg, _); + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; + } +} + +function __createBinding(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +} + +function __exportStar(m, exports) { + for (var p in m) if (p !== "default" && !exports.hasOwnProperty(p)) exports[p] = m[p]; +} + +function __values(o) { + var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; + if (m) return m.call(o); + if (o && typeof o.length === "number") return { + next: function () { + if (o && i >= o.length) o = void 0; + return { value: o && o[i++], done: !o }; + } + }; + throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); +} + +function __read(o, n) { + var m = typeof Symbol === "function" && o[Symbol.iterator]; + if (!m) return o; + var i = m.call(o), r, ar = [], e; + try { + while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); + } + catch (error) { e = { error: error }; } + finally { + try { + if (r && !r.done && (m = i["return"])) m.call(i); + } + finally { if (e) throw e.error; } + } + return ar; +} + +function __spread() { + for (var ar = [], i = 0; i < arguments.length; i++) + ar = ar.concat(__read(arguments[i])); + return ar; +} + +function __spreadArrays() { + for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; + for (var r = Array(s), k = 0, i = 0; i < il; i++) + for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) + r[k] = a[j]; + return r; +}; + +function __await(v) { + return this instanceof __await ? (this.v = v, this) : new __await(v); +} + +function __asyncGenerator(thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +} + +function __asyncDelegator(o) { + var i, p; + return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; + function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; } +} + +function __asyncValues(o) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var m = o[Symbol.asyncIterator], i; + return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); + function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } + function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } +} + +function __makeTemplateObject(cooked, raw) { + if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } + return cooked; +}; + +function __importStar(mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result.default = mod; + return result; +} + +function __importDefault(mod) { + return (mod && mod.__esModule) ? mod : { default: mod }; +} + +function __classPrivateFieldGet(receiver, privateMap) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to get private field on non-instance"); + } + return privateMap.get(receiver); +} + +function __classPrivateFieldSet(receiver, privateMap, value) { + if (!privateMap.has(receiver)) { + throw new TypeError("attempted to set private field on non-instance"); + } + privateMap.set(receiver, value); + return value; +} /***/ }), @@ -8322,158 +8322,158 @@ convert.rgb.gray = function (rgb) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; /***/ }), @@ -10848,58 +10848,58 @@ mkdirP.sync = function sync (p, opts, made) { /* 142 */ /***/ (function(module, exports) { -exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair -exports.convertToSetCommand = convertToSetCommand -exports.convertToSetCommands = convertToSetCommands - -function convertToSetCommand(key, value) { - var line = "" - key = key || "" - key = key.trim() - value = value || "" - value = value.trim() - if(key && value && value.length > 0) { - line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n" - } - return line -} - -function extractVariableValuePairs(declarations) { - var pairs = {} - declarations.map(function(declaration) { - var split = declaration.split("=") - pairs[split[0]]=split[1] - }) - return pairs -} - -function convertToSetCommands(variableString) { - var variableValuePairs = extractVariableValuePairs(variableString.split(" ")) - var variableDeclarationsAsBatch = "" - Object.keys(variableValuePairs).forEach(function (key) { - variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key]) - }) - return variableDeclarationsAsBatch -} - -function replaceDollarWithPercentPair(value) { - var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g - var result = "" - var startIndex = 0 - value = value || "" - do { - var match = dollarExpressions.exec(value) - if(match) { - var betweenMatches = value.substring(startIndex, match.index) || "" - result += betweenMatches + "%" + match[1] + "%" - startIndex = dollarExpressions.lastIndex - } - } while (dollarExpressions.lastIndex > 0) - result += value.substr(startIndex) - return result -} - - +exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair +exports.convertToSetCommand = convertToSetCommand +exports.convertToSetCommands = convertToSetCommands + +function convertToSetCommand(key, value) { + var line = "" + key = key || "" + key = key.trim() + value = value || "" + value = value.trim() + if(key && value && value.length > 0) { + line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n" + } + return line +} + +function extractVariableValuePairs(declarations) { + var pairs = {} + declarations.map(function(declaration) { + var split = declaration.split("=") + pairs[split[0]]=split[1] + }) + return pairs +} + +function convertToSetCommands(variableString) { + var variableValuePairs = extractVariableValuePairs(variableString.split(" ")) + var variableDeclarationsAsBatch = "" + Object.keys(variableValuePairs).forEach(function (key) { + variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key]) + }) + return variableDeclarationsAsBatch +} + +function replaceDollarWithPercentPair(value) { + var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g + var result = "" + var startIndex = 0 + value = value || "" + do { + var match = dollarExpressions.exec(value) + if(match) { + var betweenMatches = value.substring(startIndex, match.index) || "" + result += betweenMatches + "%" + match[1] + "%" + startIndex = dollarExpressions.lastIndex + } + } while (dollarExpressions.lastIndex > 0) + result += value.substr(startIndex) + return result +} + + /***/ }), @@ -17661,158 +17661,158 @@ convert.rgb.gray = function (rgb) { /***/ (function(module, exports, __webpack_require__) { "use strict"; - - -module.exports = { - "aliceblue": [240, 248, 255], - "antiquewhite": [250, 235, 215], - "aqua": [0, 255, 255], - "aquamarine": [127, 255, 212], - "azure": [240, 255, 255], - "beige": [245, 245, 220], - "bisque": [255, 228, 196], - "black": [0, 0, 0], - "blanchedalmond": [255, 235, 205], - "blue": [0, 0, 255], - "blueviolet": [138, 43, 226], - "brown": [165, 42, 42], - "burlywood": [222, 184, 135], - "cadetblue": [95, 158, 160], - "chartreuse": [127, 255, 0], - "chocolate": [210, 105, 30], - "coral": [255, 127, 80], - "cornflowerblue": [100, 149, 237], - "cornsilk": [255, 248, 220], - "crimson": [220, 20, 60], - "cyan": [0, 255, 255], - "darkblue": [0, 0, 139], - "darkcyan": [0, 139, 139], - "darkgoldenrod": [184, 134, 11], - "darkgray": [169, 169, 169], - "darkgreen": [0, 100, 0], - "darkgrey": [169, 169, 169], - "darkkhaki": [189, 183, 107], - "darkmagenta": [139, 0, 139], - "darkolivegreen": [85, 107, 47], - "darkorange": [255, 140, 0], - "darkorchid": [153, 50, 204], - "darkred": [139, 0, 0], - "darksalmon": [233, 150, 122], - "darkseagreen": [143, 188, 143], - "darkslateblue": [72, 61, 139], - "darkslategray": [47, 79, 79], - "darkslategrey": [47, 79, 79], - "darkturquoise": [0, 206, 209], - "darkviolet": [148, 0, 211], - "deeppink": [255, 20, 147], - "deepskyblue": [0, 191, 255], - "dimgray": [105, 105, 105], - "dimgrey": [105, 105, 105], - "dodgerblue": [30, 144, 255], - "firebrick": [178, 34, 34], - "floralwhite": [255, 250, 240], - "forestgreen": [34, 139, 34], - "fuchsia": [255, 0, 255], - "gainsboro": [220, 220, 220], - "ghostwhite": [248, 248, 255], - "gold": [255, 215, 0], - "goldenrod": [218, 165, 32], - "gray": [128, 128, 128], - "green": [0, 128, 0], - "greenyellow": [173, 255, 47], - "grey": [128, 128, 128], - "honeydew": [240, 255, 240], - "hotpink": [255, 105, 180], - "indianred": [205, 92, 92], - "indigo": [75, 0, 130], - "ivory": [255, 255, 240], - "khaki": [240, 230, 140], - "lavender": [230, 230, 250], - "lavenderblush": [255, 240, 245], - "lawngreen": [124, 252, 0], - "lemonchiffon": [255, 250, 205], - "lightblue": [173, 216, 230], - "lightcoral": [240, 128, 128], - "lightcyan": [224, 255, 255], - "lightgoldenrodyellow": [250, 250, 210], - "lightgray": [211, 211, 211], - "lightgreen": [144, 238, 144], - "lightgrey": [211, 211, 211], - "lightpink": [255, 182, 193], - "lightsalmon": [255, 160, 122], - "lightseagreen": [32, 178, 170], - "lightskyblue": [135, 206, 250], - "lightslategray": [119, 136, 153], - "lightslategrey": [119, 136, 153], - "lightsteelblue": [176, 196, 222], - "lightyellow": [255, 255, 224], - "lime": [0, 255, 0], - "limegreen": [50, 205, 50], - "linen": [250, 240, 230], - "magenta": [255, 0, 255], - "maroon": [128, 0, 0], - "mediumaquamarine": [102, 205, 170], - "mediumblue": [0, 0, 205], - "mediumorchid": [186, 85, 211], - "mediumpurple": [147, 112, 219], - "mediumseagreen": [60, 179, 113], - "mediumslateblue": [123, 104, 238], - "mediumspringgreen": [0, 250, 154], - "mediumturquoise": [72, 209, 204], - "mediumvioletred": [199, 21, 133], - "midnightblue": [25, 25, 112], - "mintcream": [245, 255, 250], - "mistyrose": [255, 228, 225], - "moccasin": [255, 228, 181], - "navajowhite": [255, 222, 173], - "navy": [0, 0, 128], - "oldlace": [253, 245, 230], - "olive": [128, 128, 0], - "olivedrab": [107, 142, 35], - "orange": [255, 165, 0], - "orangered": [255, 69, 0], - "orchid": [218, 112, 214], - "palegoldenrod": [238, 232, 170], - "palegreen": [152, 251, 152], - "paleturquoise": [175, 238, 238], - "palevioletred": [219, 112, 147], - "papayawhip": [255, 239, 213], - "peachpuff": [255, 218, 185], - "peru": [205, 133, 63], - "pink": [255, 192, 203], - "plum": [221, 160, 221], - "powderblue": [176, 224, 230], - "purple": [128, 0, 128], - "rebeccapurple": [102, 51, 153], - "red": [255, 0, 0], - "rosybrown": [188, 143, 143], - "royalblue": [65, 105, 225], - "saddlebrown": [139, 69, 19], - "salmon": [250, 128, 114], - "sandybrown": [244, 164, 96], - "seagreen": [46, 139, 87], - "seashell": [255, 245, 238], - "sienna": [160, 82, 45], - "silver": [192, 192, 192], - "skyblue": [135, 206, 235], - "slateblue": [106, 90, 205], - "slategray": [112, 128, 144], - "slategrey": [112, 128, 144], - "snow": [255, 250, 250], - "springgreen": [0, 255, 127], - "steelblue": [70, 130, 180], - "tan": [210, 180, 140], - "teal": [0, 128, 128], - "thistle": [216, 191, 216], - "tomato": [255, 99, 71], - "turquoise": [64, 224, 208], - "violet": [238, 130, 238], - "wheat": [245, 222, 179], - "white": [255, 255, 255], - "whitesmoke": [245, 245, 245], - "yellow": [255, 255, 0], - "yellowgreen": [154, 205, 50] -}; + + +module.exports = { + "aliceblue": [240, 248, 255], + "antiquewhite": [250, 235, 215], + "aqua": [0, 255, 255], + "aquamarine": [127, 255, 212], + "azure": [240, 255, 255], + "beige": [245, 245, 220], + "bisque": [255, 228, 196], + "black": [0, 0, 0], + "blanchedalmond": [255, 235, 205], + "blue": [0, 0, 255], + "blueviolet": [138, 43, 226], + "brown": [165, 42, 42], + "burlywood": [222, 184, 135], + "cadetblue": [95, 158, 160], + "chartreuse": [127, 255, 0], + "chocolate": [210, 105, 30], + "coral": [255, 127, 80], + "cornflowerblue": [100, 149, 237], + "cornsilk": [255, 248, 220], + "crimson": [220, 20, 60], + "cyan": [0, 255, 255], + "darkblue": [0, 0, 139], + "darkcyan": [0, 139, 139], + "darkgoldenrod": [184, 134, 11], + "darkgray": [169, 169, 169], + "darkgreen": [0, 100, 0], + "darkgrey": [169, 169, 169], + "darkkhaki": [189, 183, 107], + "darkmagenta": [139, 0, 139], + "darkolivegreen": [85, 107, 47], + "darkorange": [255, 140, 0], + "darkorchid": [153, 50, 204], + "darkred": [139, 0, 0], + "darksalmon": [233, 150, 122], + "darkseagreen": [143, 188, 143], + "darkslateblue": [72, 61, 139], + "darkslategray": [47, 79, 79], + "darkslategrey": [47, 79, 79], + "darkturquoise": [0, 206, 209], + "darkviolet": [148, 0, 211], + "deeppink": [255, 20, 147], + "deepskyblue": [0, 191, 255], + "dimgray": [105, 105, 105], + "dimgrey": [105, 105, 105], + "dodgerblue": [30, 144, 255], + "firebrick": [178, 34, 34], + "floralwhite": [255, 250, 240], + "forestgreen": [34, 139, 34], + "fuchsia": [255, 0, 255], + "gainsboro": [220, 220, 220], + "ghostwhite": [248, 248, 255], + "gold": [255, 215, 0], + "goldenrod": [218, 165, 32], + "gray": [128, 128, 128], + "green": [0, 128, 0], + "greenyellow": [173, 255, 47], + "grey": [128, 128, 128], + "honeydew": [240, 255, 240], + "hotpink": [255, 105, 180], + "indianred": [205, 92, 92], + "indigo": [75, 0, 130], + "ivory": [255, 255, 240], + "khaki": [240, 230, 140], + "lavender": [230, 230, 250], + "lavenderblush": [255, 240, 245], + "lawngreen": [124, 252, 0], + "lemonchiffon": [255, 250, 205], + "lightblue": [173, 216, 230], + "lightcoral": [240, 128, 128], + "lightcyan": [224, 255, 255], + "lightgoldenrodyellow": [250, 250, 210], + "lightgray": [211, 211, 211], + "lightgreen": [144, 238, 144], + "lightgrey": [211, 211, 211], + "lightpink": [255, 182, 193], + "lightsalmon": [255, 160, 122], + "lightseagreen": [32, 178, 170], + "lightskyblue": [135, 206, 250], + "lightslategray": [119, 136, 153], + "lightslategrey": [119, 136, 153], + "lightsteelblue": [176, 196, 222], + "lightyellow": [255, 255, 224], + "lime": [0, 255, 0], + "limegreen": [50, 205, 50], + "linen": [250, 240, 230], + "magenta": [255, 0, 255], + "maroon": [128, 0, 0], + "mediumaquamarine": [102, 205, 170], + "mediumblue": [0, 0, 205], + "mediumorchid": [186, 85, 211], + "mediumpurple": [147, 112, 219], + "mediumseagreen": [60, 179, 113], + "mediumslateblue": [123, 104, 238], + "mediumspringgreen": [0, 250, 154], + "mediumturquoise": [72, 209, 204], + "mediumvioletred": [199, 21, 133], + "midnightblue": [25, 25, 112], + "mintcream": [245, 255, 250], + "mistyrose": [255, 228, 225], + "moccasin": [255, 228, 181], + "navajowhite": [255, 222, 173], + "navy": [0, 0, 128], + "oldlace": [253, 245, 230], + "olive": [128, 128, 0], + "olivedrab": [107, 142, 35], + "orange": [255, 165, 0], + "orangered": [255, 69, 0], + "orchid": [218, 112, 214], + "palegoldenrod": [238, 232, 170], + "palegreen": [152, 251, 152], + "paleturquoise": [175, 238, 238], + "palevioletred": [219, 112, 147], + "papayawhip": [255, 239, 213], + "peachpuff": [255, 218, 185], + "peru": [205, 133, 63], + "pink": [255, 192, 203], + "plum": [221, 160, 221], + "powderblue": [176, 224, 230], + "purple": [128, 0, 128], + "rebeccapurple": [102, 51, 153], + "red": [255, 0, 0], + "rosybrown": [188, 143, 143], + "royalblue": [65, 105, 225], + "saddlebrown": [139, 69, 19], + "salmon": [250, 128, 114], + "sandybrown": [244, 164, 96], + "seagreen": [46, 139, 87], + "seashell": [255, 245, 238], + "sienna": [160, 82, 45], + "silver": [192, 192, 192], + "skyblue": [135, 206, 235], + "slateblue": [106, 90, 205], + "slategray": [112, 128, 144], + "slategrey": [112, 128, 144], + "snow": [255, 250, 250], + "springgreen": [0, 255, 127], + "steelblue": [70, 130, 180], + "tan": [210, 180, 140], + "teal": [0, 128, 128], + "thistle": [216, 191, 216], + "tomato": [255, 99, 71], + "turquoise": [64, 224, 208], + "violet": [238, 130, 238], + "wheat": [245, 222, 179], + "white": [255, 255, 255], + "whitesmoke": [245, 245, 245], + "yellow": [255, 255, 0], + "yellowgreen": [154, 205, 50] +}; /***/ }), @@ -21376,7 +21376,7 @@ var nodeModulesPaths = __webpack_require__(207); var normalizeOptions = __webpack_require__(209); var isCore = __webpack_require__(210); -var realpathFS = fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; +var realpathFS = process.platform !== 'win32' && fs.realpath && typeof fs.realpath.native === 'function' ? fs.realpath.native : fs.realpath; var homedir = getHomedir(); var defaultPaths = function () { @@ -22053,7 +22053,7 @@ module.exports = function bind(that) { /* 214 */ /***/ (function(module) { -module.exports = JSON.parse("{\"assert\":true,\"node:assert\":[\">= 14.18 && < 15\",\">= 16\"],\"assert/strict\":\">= 15\",\"node:assert/strict\":\">= 16\",\"async_hooks\":\">= 8\",\"node:async_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"buffer_ieee754\":\">= 0.5 && < 0.9.7\",\"buffer\":true,\"node:buffer\":[\">= 14.18 && < 15\",\">= 16\"],\"child_process\":true,\"node:child_process\":[\">= 14.18 && < 15\",\">= 16\"],\"cluster\":\">= 0.5\",\"node:cluster\":[\">= 14.18 && < 15\",\">= 16\"],\"console\":true,\"node:console\":[\">= 14.18 && < 15\",\">= 16\"],\"constants\":true,\"node:constants\":[\">= 14.18 && < 15\",\">= 16\"],\"crypto\":true,\"node:crypto\":[\">= 14.18 && < 15\",\">= 16\"],\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"node:dgram\":[\">= 14.18 && < 15\",\">= 16\"],\"diagnostics_channel\":[\">= 14.17 && < 15\",\">= 15.1\"],\"node:diagnostics_channel\":[\">= 14.18 && < 15\",\">= 16\"],\"dns\":true,\"node:dns\":[\">= 14.18 && < 15\",\">= 16\"],\"dns/promises\":\">= 15\",\"node:dns/promises\":\">= 16\",\"domain\":\">= 0.7.12\",\"node:domain\":[\">= 14.18 && < 15\",\">= 16\"],\"events\":true,\"node:events\":[\">= 14.18 && < 15\",\">= 16\"],\"freelist\":\"< 6\",\"fs\":true,\"node:fs\":[\">= 14.18 && < 15\",\">= 16\"],\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"node:fs/promises\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_agent\":\">= 0.11.1\",\"node:_http_agent\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_client\":\">= 0.11.1\",\"node:_http_client\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_common\":\">= 0.11.1\",\"node:_http_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_incoming\":\">= 0.11.1\",\"node:_http_incoming\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_outgoing\":\">= 0.11.1\",\"node:_http_outgoing\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_server\":\">= 0.11.1\",\"node:_http_server\":[\">= 14.18 && < 15\",\">= 16\"],\"http\":true,\"node:http\":[\">= 14.18 && < 15\",\">= 16\"],\"http2\":\">= 8.8\",\"node:http2\":[\">= 14.18 && < 15\",\">= 16\"],\"https\":true,\"node:https\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector\":\">= 8\",\"node:inspector\":[\">= 14.18 && < 15\",\">= 16\"],\"_linklist\":\"< 8\",\"module\":true,\"node:module\":[\">= 14.18 && < 15\",\">= 16\"],\"net\":true,\"node:net\":[\">= 14.18 && < 15\",\">= 16\"],\"node-inspect/lib/_inspect\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6 && < 12\",\"os\":true,\"node:os\":[\">= 14.18 && < 15\",\">= 16\"],\"path\":true,\"node:path\":[\">= 14.18 && < 15\",\">= 16\"],\"path/posix\":\">= 15.3\",\"node:path/posix\":\">= 16\",\"path/win32\":\">= 15.3\",\"node:path/win32\":\">= 16\",\"perf_hooks\":\">= 8.5\",\"node:perf_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"process\":\">= 1\",\"node:process\":[\">= 14.18 && < 15\",\">= 16\"],\"punycode\":\">= 0.5\",\"node:punycode\":[\">= 14.18 && < 15\",\">= 16\"],\"querystring\":true,\"node:querystring\":[\">= 14.18 && < 15\",\">= 16\"],\"readline\":true,\"node:readline\":[\">= 14.18 && < 15\",\">= 16\"],\"readline/promises\":\">= 17\",\"node:readline/promises\":\">= 17\",\"repl\":true,\"node:repl\":[\">= 14.18 && < 15\",\">= 16\"],\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"node:_stream_duplex\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_transform\":\">= 0.9.4\",\"node:_stream_transform\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_wrap\":\">= 1.4.1\",\"node:_stream_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_passthrough\":\">= 0.9.4\",\"node:_stream_passthrough\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_readable\":\">= 0.9.4\",\"node:_stream_readable\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_writable\":\">= 0.9.4\",\"node:_stream_writable\":[\">= 14.18 && < 15\",\">= 16\"],\"stream\":true,\"node:stream\":[\">= 14.18 && < 15\",\">= 16\"],\"stream/consumers\":\">= 16.7\",\"node:stream/consumers\":\">= 16.7\",\"stream/promises\":\">= 15\",\"node:stream/promises\":\">= 16\",\"stream/web\":\">= 16.5\",\"node:stream/web\":\">= 16.5\",\"string_decoder\":true,\"node:string_decoder\":[\">= 14.18 && < 15\",\">= 16\"],\"sys\":[\">= 0.4 && < 0.7\",\">= 0.8\"],\"node:sys\":[\">= 14.18 && < 15\",\">= 16\"],\"timers\":true,\"node:timers\":[\">= 14.18 && < 15\",\">= 16\"],\"timers/promises\":\">= 15\",\"node:timers/promises\":\">= 16\",\"_tls_common\":\">= 0.11.13\",\"node:_tls_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"node:_tls_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"tls\":true,\"node:tls\":[\">= 14.18 && < 15\",\">= 16\"],\"trace_events\":\">= 10\",\"node:trace_events\":[\">= 14.18 && < 15\",\">= 16\"],\"tty\":true,\"node:tty\":[\">= 14.18 && < 15\",\">= 16\"],\"url\":true,\"node:url\":[\">= 14.18 && < 15\",\">= 16\"],\"util\":true,\"node:util\":[\">= 14.18 && < 15\",\">= 16\"],\"util/types\":\">= 15.3\",\"node:util/types\":\">= 16\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/consarray\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/logreader\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8\":\">= 1\",\"node:v8\":[\">= 14.18 && < 15\",\">= 16\"],\"vm\":true,\"node:vm\":[\">= 14.18 && < 15\",\">= 16\"],\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"node:worker_threads\":[\">= 14.18 && < 15\",\">= 16\"],\"zlib\":\">= 0.5\",\"node:zlib\":[\">= 14.18 && < 15\",\">= 16\"]}"); +module.exports = JSON.parse("{\"assert\":true,\"node:assert\":[\">= 14.18 && < 15\",\">= 16\"],\"assert/strict\":\">= 15\",\"node:assert/strict\":\">= 16\",\"async_hooks\":\">= 8\",\"node:async_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"buffer_ieee754\":\">= 0.5 && < 0.9.7\",\"buffer\":true,\"node:buffer\":[\">= 14.18 && < 15\",\">= 16\"],\"child_process\":true,\"node:child_process\":[\">= 14.18 && < 15\",\">= 16\"],\"cluster\":\">= 0.5\",\"node:cluster\":[\">= 14.18 && < 15\",\">= 16\"],\"console\":true,\"node:console\":[\">= 14.18 && < 15\",\">= 16\"],\"constants\":true,\"node:constants\":[\">= 14.18 && < 15\",\">= 16\"],\"crypto\":true,\"node:crypto\":[\">= 14.18 && < 15\",\">= 16\"],\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"node:dgram\":[\">= 14.18 && < 15\",\">= 16\"],\"diagnostics_channel\":[\">= 14.17 && < 15\",\">= 15.1\"],\"node:diagnostics_channel\":[\">= 14.18 && < 15\",\">= 16\"],\"dns\":true,\"node:dns\":[\">= 14.18 && < 15\",\">= 16\"],\"dns/promises\":\">= 15\",\"node:dns/promises\":\">= 16\",\"domain\":\">= 0.7.12\",\"node:domain\":[\">= 14.18 && < 15\",\">= 16\"],\"events\":true,\"node:events\":[\">= 14.18 && < 15\",\">= 16\"],\"freelist\":\"< 6\",\"fs\":true,\"node:fs\":[\">= 14.18 && < 15\",\">= 16\"],\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"node:fs/promises\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_agent\":\">= 0.11.1\",\"node:_http_agent\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_client\":\">= 0.11.1\",\"node:_http_client\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_common\":\">= 0.11.1\",\"node:_http_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_incoming\":\">= 0.11.1\",\"node:_http_incoming\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_outgoing\":\">= 0.11.1\",\"node:_http_outgoing\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_server\":\">= 0.11.1\",\"node:_http_server\":[\">= 14.18 && < 15\",\">= 16\"],\"http\":true,\"node:http\":[\">= 14.18 && < 15\",\">= 16\"],\"http2\":\">= 8.8\",\"node:http2\":[\">= 14.18 && < 15\",\">= 16\"],\"https\":true,\"node:https\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector\":\">= 8\",\"node:inspector\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector/promises\":[\">= 19\"],\"node:inspector/promises\":[\">= 19\"],\"_linklist\":\"< 8\",\"module\":true,\"node:module\":[\">= 14.18 && < 15\",\">= 16\"],\"net\":true,\"node:net\":[\">= 14.18 && < 15\",\">= 16\"],\"node-inspect/lib/_inspect\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6 && < 12\",\"os\":true,\"node:os\":[\">= 14.18 && < 15\",\">= 16\"],\"path\":true,\"node:path\":[\">= 14.18 && < 15\",\">= 16\"],\"path/posix\":\">= 15.3\",\"node:path/posix\":\">= 16\",\"path/win32\":\">= 15.3\",\"node:path/win32\":\">= 16\",\"perf_hooks\":\">= 8.5\",\"node:perf_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"process\":\">= 1\",\"node:process\":[\">= 14.18 && < 15\",\">= 16\"],\"punycode\":\">= 0.5\",\"node:punycode\":[\">= 14.18 && < 15\",\">= 16\"],\"querystring\":true,\"node:querystring\":[\">= 14.18 && < 15\",\">= 16\"],\"readline\":true,\"node:readline\":[\">= 14.18 && < 15\",\">= 16\"],\"readline/promises\":\">= 17\",\"node:readline/promises\":\">= 17\",\"repl\":true,\"node:repl\":[\">= 14.18 && < 15\",\">= 16\"],\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"node:_stream_duplex\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_transform\":\">= 0.9.4\",\"node:_stream_transform\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_wrap\":\">= 1.4.1\",\"node:_stream_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_passthrough\":\">= 0.9.4\",\"node:_stream_passthrough\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_readable\":\">= 0.9.4\",\"node:_stream_readable\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_writable\":\">= 0.9.4\",\"node:_stream_writable\":[\">= 14.18 && < 15\",\">= 16\"],\"stream\":true,\"node:stream\":[\">= 14.18 && < 15\",\">= 16\"],\"stream/consumers\":\">= 16.7\",\"node:stream/consumers\":\">= 16.7\",\"stream/promises\":\">= 15\",\"node:stream/promises\":\">= 16\",\"stream/web\":\">= 16.5\",\"node:stream/web\":\">= 16.5\",\"string_decoder\":true,\"node:string_decoder\":[\">= 14.18 && < 15\",\">= 16\"],\"sys\":[\">= 0.4 && < 0.7\",\">= 0.8\"],\"node:sys\":[\">= 14.18 && < 15\",\">= 16\"],\"node:test\":[\">= 16.17 && < 17\",\">= 18\"],\"timers\":true,\"node:timers\":[\">= 14.18 && < 15\",\">= 16\"],\"timers/promises\":\">= 15\",\"node:timers/promises\":\">= 16\",\"_tls_common\":\">= 0.11.13\",\"node:_tls_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"node:_tls_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"tls\":true,\"node:tls\":[\">= 14.18 && < 15\",\">= 16\"],\"trace_events\":\">= 10\",\"node:trace_events\":[\">= 14.18 && < 15\",\">= 16\"],\"tty\":true,\"node:tty\":[\">= 14.18 && < 15\",\">= 16\"],\"url\":true,\"node:url\":[\">= 14.18 && < 15\",\">= 16\"],\"util\":true,\"node:util\":[\">= 14.18 && < 15\",\">= 16\"],\"util/types\":\">= 15.3\",\"node:util/types\":\">= 16\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/consarray\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/logreader\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8\":\">= 1\",\"node:v8\":[\">= 14.18 && < 15\",\">= 16\"],\"vm\":true,\"node:vm\":[\">= 14.18 && < 15\",\">= 16\"],\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"node:worker_threads\":[\">= 14.18 && < 15\",\">= 16\"],\"zlib\":\">= 0.5\",\"node:zlib\":[\">= 14.18 && < 15\",\">= 16\"]}"); /***/ }), /* 215 */ @@ -22117,7 +22117,7 @@ module.exports = core; /* 216 */ /***/ (function(module) { -module.exports = JSON.parse("{\"assert\":true,\"node:assert\":[\">= 14.18 && < 15\",\">= 16\"],\"assert/strict\":\">= 15\",\"node:assert/strict\":\">= 16\",\"async_hooks\":\">= 8\",\"node:async_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"buffer_ieee754\":\">= 0.5 && < 0.9.7\",\"buffer\":true,\"node:buffer\":[\">= 14.18 && < 15\",\">= 16\"],\"child_process\":true,\"node:child_process\":[\">= 14.18 && < 15\",\">= 16\"],\"cluster\":\">= 0.5\",\"node:cluster\":[\">= 14.18 && < 15\",\">= 16\"],\"console\":true,\"node:console\":[\">= 14.18 && < 15\",\">= 16\"],\"constants\":true,\"node:constants\":[\">= 14.18 && < 15\",\">= 16\"],\"crypto\":true,\"node:crypto\":[\">= 14.18 && < 15\",\">= 16\"],\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"node:dgram\":[\">= 14.18 && < 15\",\">= 16\"],\"diagnostics_channel\":[\">= 14.17 && < 15\",\">= 15.1\"],\"node:diagnostics_channel\":[\">= 14.18 && < 15\",\">= 16\"],\"dns\":true,\"node:dns\":[\">= 14.18 && < 15\",\">= 16\"],\"dns/promises\":\">= 15\",\"node:dns/promises\":\">= 16\",\"domain\":\">= 0.7.12\",\"node:domain\":[\">= 14.18 && < 15\",\">= 16\"],\"events\":true,\"node:events\":[\">= 14.18 && < 15\",\">= 16\"],\"freelist\":\"< 6\",\"fs\":true,\"node:fs\":[\">= 14.18 && < 15\",\">= 16\"],\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"node:fs/promises\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_agent\":\">= 0.11.1\",\"node:_http_agent\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_client\":\">= 0.11.1\",\"node:_http_client\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_common\":\">= 0.11.1\",\"node:_http_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_incoming\":\">= 0.11.1\",\"node:_http_incoming\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_outgoing\":\">= 0.11.1\",\"node:_http_outgoing\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_server\":\">= 0.11.1\",\"node:_http_server\":[\">= 14.18 && < 15\",\">= 16\"],\"http\":true,\"node:http\":[\">= 14.18 && < 15\",\">= 16\"],\"http2\":\">= 8.8\",\"node:http2\":[\">= 14.18 && < 15\",\">= 16\"],\"https\":true,\"node:https\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector\":\">= 8\",\"node:inspector\":[\">= 14.18 && < 15\",\">= 16\"],\"_linklist\":\"< 8\",\"module\":true,\"node:module\":[\">= 14.18 && < 15\",\">= 16\"],\"net\":true,\"node:net\":[\">= 14.18 && < 15\",\">= 16\"],\"node-inspect/lib/_inspect\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6 && < 12\",\"os\":true,\"node:os\":[\">= 14.18 && < 15\",\">= 16\"],\"path\":true,\"node:path\":[\">= 14.18 && < 15\",\">= 16\"],\"path/posix\":\">= 15.3\",\"node:path/posix\":\">= 16\",\"path/win32\":\">= 15.3\",\"node:path/win32\":\">= 16\",\"perf_hooks\":\">= 8.5\",\"node:perf_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"process\":\">= 1\",\"node:process\":[\">= 14.18 && < 15\",\">= 16\"],\"punycode\":\">= 0.5\",\"node:punycode\":[\">= 14.18 && < 15\",\">= 16\"],\"querystring\":true,\"node:querystring\":[\">= 14.18 && < 15\",\">= 16\"],\"readline\":true,\"node:readline\":[\">= 14.18 && < 15\",\">= 16\"],\"readline/promises\":\">= 17\",\"node:readline/promises\":\">= 17\",\"repl\":true,\"node:repl\":[\">= 14.18 && < 15\",\">= 16\"],\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"node:_stream_duplex\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_transform\":\">= 0.9.4\",\"node:_stream_transform\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_wrap\":\">= 1.4.1\",\"node:_stream_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_passthrough\":\">= 0.9.4\",\"node:_stream_passthrough\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_readable\":\">= 0.9.4\",\"node:_stream_readable\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_writable\":\">= 0.9.4\",\"node:_stream_writable\":[\">= 14.18 && < 15\",\">= 16\"],\"stream\":true,\"node:stream\":[\">= 14.18 && < 15\",\">= 16\"],\"stream/consumers\":\">= 16.7\",\"node:stream/consumers\":\">= 16.7\",\"stream/promises\":\">= 15\",\"node:stream/promises\":\">= 16\",\"stream/web\":\">= 16.5\",\"node:stream/web\":\">= 16.5\",\"string_decoder\":true,\"node:string_decoder\":[\">= 14.18 && < 15\",\">= 16\"],\"sys\":[\">= 0.4 && < 0.7\",\">= 0.8\"],\"node:sys\":[\">= 14.18 && < 15\",\">= 16\"],\"timers\":true,\"node:timers\":[\">= 14.18 && < 15\",\">= 16\"],\"timers/promises\":\">= 15\",\"node:timers/promises\":\">= 16\",\"_tls_common\":\">= 0.11.13\",\"node:_tls_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"node:_tls_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"tls\":true,\"node:tls\":[\">= 14.18 && < 15\",\">= 16\"],\"trace_events\":\">= 10\",\"node:trace_events\":[\">= 14.18 && < 15\",\">= 16\"],\"tty\":true,\"node:tty\":[\">= 14.18 && < 15\",\">= 16\"],\"url\":true,\"node:url\":[\">= 14.18 && < 15\",\">= 16\"],\"util\":true,\"node:util\":[\">= 14.18 && < 15\",\">= 16\"],\"util/types\":\">= 15.3\",\"node:util/types\":\">= 16\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/consarray\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/logreader\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8\":\">= 1\",\"node:v8\":[\">= 14.18 && < 15\",\">= 16\"],\"vm\":true,\"node:vm\":[\">= 14.18 && < 15\",\">= 16\"],\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"node:worker_threads\":[\">= 14.18 && < 15\",\">= 16\"],\"zlib\":\">= 0.5\",\"node:zlib\":[\">= 14.18 && < 15\",\">= 16\"]}"); +module.exports = JSON.parse("{\"assert\":true,\"node:assert\":[\">= 14.18 && < 15\",\">= 16\"],\"assert/strict\":\">= 15\",\"node:assert/strict\":\">= 16\",\"async_hooks\":\">= 8\",\"node:async_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"buffer_ieee754\":\">= 0.5 && < 0.9.7\",\"buffer\":true,\"node:buffer\":[\">= 14.18 && < 15\",\">= 16\"],\"child_process\":true,\"node:child_process\":[\">= 14.18 && < 15\",\">= 16\"],\"cluster\":\">= 0.5\",\"node:cluster\":[\">= 14.18 && < 15\",\">= 16\"],\"console\":true,\"node:console\":[\">= 14.18 && < 15\",\">= 16\"],\"constants\":true,\"node:constants\":[\">= 14.18 && < 15\",\">= 16\"],\"crypto\":true,\"node:crypto\":[\">= 14.18 && < 15\",\">= 16\"],\"_debug_agent\":\">= 1 && < 8\",\"_debugger\":\"< 8\",\"dgram\":true,\"node:dgram\":[\">= 14.18 && < 15\",\">= 16\"],\"diagnostics_channel\":[\">= 14.17 && < 15\",\">= 15.1\"],\"node:diagnostics_channel\":[\">= 14.18 && < 15\",\">= 16\"],\"dns\":true,\"node:dns\":[\">= 14.18 && < 15\",\">= 16\"],\"dns/promises\":\">= 15\",\"node:dns/promises\":\">= 16\",\"domain\":\">= 0.7.12\",\"node:domain\":[\">= 14.18 && < 15\",\">= 16\"],\"events\":true,\"node:events\":[\">= 14.18 && < 15\",\">= 16\"],\"freelist\":\"< 6\",\"fs\":true,\"node:fs\":[\">= 14.18 && < 15\",\">= 16\"],\"fs/promises\":[\">= 10 && < 10.1\",\">= 14\"],\"node:fs/promises\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_agent\":\">= 0.11.1\",\"node:_http_agent\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_client\":\">= 0.11.1\",\"node:_http_client\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_common\":\">= 0.11.1\",\"node:_http_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_incoming\":\">= 0.11.1\",\"node:_http_incoming\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_outgoing\":\">= 0.11.1\",\"node:_http_outgoing\":[\">= 14.18 && < 15\",\">= 16\"],\"_http_server\":\">= 0.11.1\",\"node:_http_server\":[\">= 14.18 && < 15\",\">= 16\"],\"http\":true,\"node:http\":[\">= 14.18 && < 15\",\">= 16\"],\"http2\":\">= 8.8\",\"node:http2\":[\">= 14.18 && < 15\",\">= 16\"],\"https\":true,\"node:https\":[\">= 14.18 && < 15\",\">= 16\"],\"inspector\":\">= 8\",\"node:inspector\":[\">= 14.18 && < 15\",\">= 16\"],\"_linklist\":\"< 8\",\"module\":true,\"node:module\":[\">= 14.18 && < 15\",\">= 16\"],\"net\":true,\"node:net\":[\">= 14.18 && < 15\",\">= 16\"],\"node-inspect/lib/_inspect\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_client\":\">= 7.6 && < 12\",\"node-inspect/lib/internal/inspect_repl\":\">= 7.6 && < 12\",\"os\":true,\"node:os\":[\">= 14.18 && < 15\",\">= 16\"],\"path\":true,\"node:path\":[\">= 14.18 && < 15\",\">= 16\"],\"path/posix\":\">= 15.3\",\"node:path/posix\":\">= 16\",\"path/win32\":\">= 15.3\",\"node:path/win32\":\">= 16\",\"perf_hooks\":\">= 8.5\",\"node:perf_hooks\":[\">= 14.18 && < 15\",\">= 16\"],\"process\":\">= 1\",\"node:process\":[\">= 14.18 && < 15\",\">= 16\"],\"punycode\":\">= 0.5\",\"node:punycode\":[\">= 14.18 && < 15\",\">= 16\"],\"querystring\":true,\"node:querystring\":[\">= 14.18 && < 15\",\">= 16\"],\"readline\":true,\"node:readline\":[\">= 14.18 && < 15\",\">= 16\"],\"readline/promises\":\">= 17\",\"node:readline/promises\":\">= 17\",\"repl\":true,\"node:repl\":[\">= 14.18 && < 15\",\">= 16\"],\"smalloc\":\">= 0.11.5 && < 3\",\"_stream_duplex\":\">= 0.9.4\",\"node:_stream_duplex\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_transform\":\">= 0.9.4\",\"node:_stream_transform\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_wrap\":\">= 1.4.1\",\"node:_stream_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_passthrough\":\">= 0.9.4\",\"node:_stream_passthrough\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_readable\":\">= 0.9.4\",\"node:_stream_readable\":[\">= 14.18 && < 15\",\">= 16\"],\"_stream_writable\":\">= 0.9.4\",\"node:_stream_writable\":[\">= 14.18 && < 15\",\">= 16\"],\"stream\":true,\"node:stream\":[\">= 14.18 && < 15\",\">= 16\"],\"stream/consumers\":\">= 16.7\",\"node:stream/consumers\":\">= 16.7\",\"stream/promises\":\">= 15\",\"node:stream/promises\":\">= 16\",\"stream/web\":\">= 16.5\",\"node:stream/web\":\">= 16.5\",\"string_decoder\":true,\"node:string_decoder\":[\">= 14.18 && < 15\",\">= 16\"],\"sys\":[\">= 0.4 && < 0.7\",\">= 0.8\"],\"node:sys\":[\">= 14.18 && < 15\",\">= 16\"],\"node:test\":\">= 18\",\"timers\":true,\"node:timers\":[\">= 14.18 && < 15\",\">= 16\"],\"timers/promises\":\">= 15\",\"node:timers/promises\":\">= 16\",\"_tls_common\":\">= 0.11.13\",\"node:_tls_common\":[\">= 14.18 && < 15\",\">= 16\"],\"_tls_legacy\":\">= 0.11.3 && < 10\",\"_tls_wrap\":\">= 0.11.3\",\"node:_tls_wrap\":[\">= 14.18 && < 15\",\">= 16\"],\"tls\":true,\"node:tls\":[\">= 14.18 && < 15\",\">= 16\"],\"trace_events\":\">= 10\",\"node:trace_events\":[\">= 14.18 && < 15\",\">= 16\"],\"tty\":true,\"node:tty\":[\">= 14.18 && < 15\",\">= 16\"],\"url\":true,\"node:url\":[\">= 14.18 && < 15\",\">= 16\"],\"util\":true,\"node:util\":[\">= 14.18 && < 15\",\">= 16\"],\"util/types\":\">= 15.3\",\"node:util/types\":\">= 16\",\"v8/tools/arguments\":\">= 10 && < 12\",\"v8/tools/codemap\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/consarray\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/csvparser\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/logreader\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/profile_view\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8/tools/splaytree\":[\">= 4.4 && < 5\",\">= 5.2 && < 12\"],\"v8\":\">= 1\",\"node:v8\":[\">= 14.18 && < 15\",\">= 16\"],\"vm\":true,\"node:vm\":[\">= 14.18 && < 15\",\">= 16\"],\"wasi\":\">= 13.4 && < 13.5\",\"worker_threads\":\">= 11.7\",\"node:worker_threads\":[\">= 14.18 && < 15\",\">= 16\"],\"zlib\":\">= 0.5\",\"node:zlib\":[\">= 14.18 && < 15\",\">= 16\"]}"); /***/ }), /* 217 */ @@ -22142,7 +22142,7 @@ var caller = __webpack_require__(206); var nodeModulesPaths = __webpack_require__(207); var normalizeOptions = __webpack_require__(209); -var realpathFS = fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; +var realpathFS = process.platform !== 'win32' && fs.realpathSync && typeof fs.realpathSync.native === 'function' ? fs.realpathSync.native : fs.realpathSync; var homedir = getHomedir(); var defaultPaths = function () { @@ -56551,9 +56551,9 @@ exports.OpenSearchDashboards = OpenSearchDashboards; "use strict"; const minimatch = __webpack_require__(150); -const arrayUnion = __webpack_require__(513); -const arrayDiffer = __webpack_require__(514); -const arrify = __webpack_require__(515); +const arrayUnion = __webpack_require__(299); +const arrayDiffer = __webpack_require__(513); +const arrify = __webpack_require__(514); module.exports = (list, patterns, options = {}) => { list = arrify(list); @@ -56583,18 +56583,6 @@ module.exports = (list, patterns, options = {}) => { "use strict"; -module.exports = (...arguments_) => { - return [...new Set([].concat(...arguments_))]; -}; - - -/***/ }), -/* 514 */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; - - const arrayDiffer = (array, ...values) => { const rest = new Set([].concat(...values)); return array.filter(element => !rest.has(element)); @@ -56604,7 +56592,7 @@ module.exports = arrayDiffer; /***/ }), -/* 515 */ +/* 514 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56634,7 +56622,7 @@ module.exports = arrify; /***/ }), -/* 516 */ +/* 515 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56650,10 +56638,10 @@ Object.defineProperty(exports, "buildProductionProjects", { } }); -var _build_production_projects = __webpack_require__(517); +var _build_production_projects = __webpack_require__(516); /***/ }), -/* 517 */ +/* 516 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56664,7 +56652,7 @@ Object.defineProperty(exports, "__esModule", { }); exports.buildProductionProjects = buildProductionProjects; -var _cpy = _interopRequireDefault(__webpack_require__(518)); +var _cpy = _interopRequireDefault(__webpack_require__(517)); var _del = _interopRequireDefault(__webpack_require__(297)); @@ -56808,7 +56796,7 @@ async function copyToBuild(project, opensearchDashboardsRoot, buildRoot) { } /***/ }), -/* 518 */ +/* 517 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -56816,14 +56804,14 @@ async function copyToBuild(project, opensearchDashboardsRoot, buildRoot) { const EventEmitter = __webpack_require__(156); const path = __webpack_require__(4); const os = __webpack_require__(121); -const pMap = __webpack_require__(519); -const arrify = __webpack_require__(515); -const globby = __webpack_require__(520); -const hasGlob = __webpack_require__(703); -const cpFile = __webpack_require__(705); -const junk = __webpack_require__(715); -const pFilter = __webpack_require__(716); -const CpyError = __webpack_require__(718); +const pMap = __webpack_require__(518); +const arrify = __webpack_require__(514); +const globby = __webpack_require__(519); +const hasGlob = __webpack_require__(702); +const cpFile = __webpack_require__(704); +const junk = __webpack_require__(714); +const pFilter = __webpack_require__(715); +const CpyError = __webpack_require__(717); const defaultOptions = { ignoreJunk: true @@ -56974,7 +56962,7 @@ module.exports = (source, destination, { /***/ }), -/* 519 */ +/* 518 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57062,17 +57050,17 @@ module.exports = async ( /***/ }), -/* 520 */ +/* 519 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(134); -const arrayUnion = __webpack_require__(521); +const arrayUnion = __webpack_require__(520); const glob = __webpack_require__(147); -const fastGlob = __webpack_require__(523); -const dirGlob = __webpack_require__(697); -const gitignore = __webpack_require__(700); +const fastGlob = __webpack_require__(522); +const dirGlob = __webpack_require__(696); +const gitignore = __webpack_require__(699); const DEFAULT_FILTER = () => false; @@ -57217,12 +57205,12 @@ module.exports.gitignore = gitignore; /***/ }), -/* 521 */ +/* 520 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var arrayUniq = __webpack_require__(522); +var arrayUniq = __webpack_require__(521); module.exports = function () { return arrayUniq([].concat.apply([], arguments)); @@ -57230,7 +57218,7 @@ module.exports = function () { /***/ }), -/* 522 */ +/* 521 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57299,10 +57287,10 @@ if ('Set' in global) { /***/ }), -/* 523 */ +/* 522 */ /***/ (function(module, exports, __webpack_require__) { -const pkg = __webpack_require__(524); +const pkg = __webpack_require__(523); module.exports = pkg.async; module.exports.default = pkg.async; @@ -57315,375 +57303,375 @@ module.exports.generateTasks = pkg.generateTasks; /***/ }), -/* 524 */ +/* 523 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var optionsManager = __webpack_require__(525); -var taskManager = __webpack_require__(526); -var reader_async_1 = __webpack_require__(668); -var reader_stream_1 = __webpack_require__(692); -var reader_sync_1 = __webpack_require__(693); -var arrayUtils = __webpack_require__(695); -var streamUtils = __webpack_require__(696); -/** - * Synchronous API. - */ -function sync(source, opts) { - assertPatternsInput(source); - var works = getWorks(source, reader_sync_1.default, opts); - return arrayUtils.flatten(works); -} -exports.sync = sync; -/** - * Asynchronous API. - */ -function async(source, opts) { - try { - assertPatternsInput(source); - } - catch (error) { - return Promise.reject(error); - } - var works = getWorks(source, reader_async_1.default, opts); - return Promise.all(works).then(arrayUtils.flatten); -} -exports.async = async; -/** - * Stream API. - */ -function stream(source, opts) { - assertPatternsInput(source); - var works = getWorks(source, reader_stream_1.default, opts); - return streamUtils.merge(works); -} -exports.stream = stream; -/** - * Return a set of tasks based on provided patterns. - */ -function generateTasks(source, opts) { - assertPatternsInput(source); - var patterns = [].concat(source); - var options = optionsManager.prepare(opts); - return taskManager.generate(patterns, options); -} -exports.generateTasks = generateTasks; -/** - * Returns a set of works based on provided tasks and class of the reader. - */ -function getWorks(source, _Reader, opts) { - var patterns = [].concat(source); - var options = optionsManager.prepare(opts); - var tasks = taskManager.generate(patterns, options); - var reader = new _Reader(options); - return tasks.map(reader.read, reader); -} -function assertPatternsInput(source) { - if ([].concat(source).every(isString)) { - return; - } - throw new TypeError('Patterns must be a string or an array of strings'); -} -function isString(source) { - /* tslint:disable-next-line strict-type-predicates */ - return typeof source === 'string'; -} + +Object.defineProperty(exports, "__esModule", { value: true }); +var optionsManager = __webpack_require__(524); +var taskManager = __webpack_require__(525); +var reader_async_1 = __webpack_require__(667); +var reader_stream_1 = __webpack_require__(691); +var reader_sync_1 = __webpack_require__(692); +var arrayUtils = __webpack_require__(694); +var streamUtils = __webpack_require__(695); +/** + * Synchronous API. + */ +function sync(source, opts) { + assertPatternsInput(source); + var works = getWorks(source, reader_sync_1.default, opts); + return arrayUtils.flatten(works); +} +exports.sync = sync; +/** + * Asynchronous API. + */ +function async(source, opts) { + try { + assertPatternsInput(source); + } + catch (error) { + return Promise.reject(error); + } + var works = getWorks(source, reader_async_1.default, opts); + return Promise.all(works).then(arrayUtils.flatten); +} +exports.async = async; +/** + * Stream API. + */ +function stream(source, opts) { + assertPatternsInput(source); + var works = getWorks(source, reader_stream_1.default, opts); + return streamUtils.merge(works); +} +exports.stream = stream; +/** + * Return a set of tasks based on provided patterns. + */ +function generateTasks(source, opts) { + assertPatternsInput(source); + var patterns = [].concat(source); + var options = optionsManager.prepare(opts); + return taskManager.generate(patterns, options); +} +exports.generateTasks = generateTasks; +/** + * Returns a set of works based on provided tasks and class of the reader. + */ +function getWorks(source, _Reader, opts) { + var patterns = [].concat(source); + var options = optionsManager.prepare(opts); + var tasks = taskManager.generate(patterns, options); + var reader = new _Reader(options); + return tasks.map(reader.read, reader); +} +function assertPatternsInput(source) { + if ([].concat(source).every(isString)) { + return; + } + throw new TypeError('Patterns must be a string or an array of strings'); +} +function isString(source) { + /* tslint:disable-next-line strict-type-predicates */ + return typeof source === 'string'; +} /***/ }), -/* 525 */ +/* 524 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __assign = (this && this.__assign) || function () { - __assign = Object.assign || function(t) { - for (var s, i = 1, n = arguments.length; i < n; i++) { - s = arguments[i]; - for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) - t[p] = s[p]; - } - return t; - }; - return __assign.apply(this, arguments); -}; -Object.defineProperty(exports, "__esModule", { value: true }); -function prepare(options) { - var opts = __assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, brace: true, noglobstar: false, globstar: true, noext: false, extension: true, nocase: false, case: true, matchBase: false, transform: null }, options); - if (opts.onlyDirectories) { - opts.onlyFiles = false; - } - opts.brace = !opts.nobrace; - opts.globstar = !opts.noglobstar; - opts.extension = !opts.noext; - opts.case = !opts.nocase; - if (options) { - opts.brace = ('brace' in options ? options.brace : opts.brace); - opts.globstar = ('globstar' in options ? options.globstar : opts.globstar); - opts.extension = ('extension' in options ? options.extension : opts.extension); - opts.case = ('case' in options ? options.case : opts.case); - } - return opts; -} -exports.prepare = prepare; + +var __assign = (this && this.__assign) || function () { + __assign = Object.assign || function(t) { + for (var s, i = 1, n = arguments.length; i < n; i++) { + s = arguments[i]; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) + t[p] = s[p]; + } + return t; + }; + return __assign.apply(this, arguments); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +function prepare(options) { + var opts = __assign({ cwd: process.cwd(), deep: true, ignore: [], dot: false, stats: false, onlyFiles: true, onlyDirectories: false, followSymlinkedDirectories: true, unique: true, markDirectories: false, absolute: false, nobrace: false, brace: true, noglobstar: false, globstar: true, noext: false, extension: true, nocase: false, case: true, matchBase: false, transform: null }, options); + if (opts.onlyDirectories) { + opts.onlyFiles = false; + } + opts.brace = !opts.nobrace; + opts.globstar = !opts.noglobstar; + opts.extension = !opts.noext; + opts.case = !opts.nocase; + if (options) { + opts.brace = ('brace' in options ? options.brace : opts.brace); + opts.globstar = ('globstar' in options ? options.globstar : opts.globstar); + opts.extension = ('extension' in options ? options.extension : opts.extension); + opts.case = ('case' in options ? options.case : opts.case); + } + return opts; +} +exports.prepare = prepare; /***/ }), -/* 526 */ +/* 525 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var patternUtils = __webpack_require__(527); -/** - * Generate tasks based on parent directory of each pattern. - */ -function generate(patterns, options) { - var unixPatterns = patterns.map(patternUtils.unixifyPattern); - var unixIgnore = options.ignore.map(patternUtils.unixifyPattern); - var positivePatterns = getPositivePatterns(unixPatterns); - var negativePatterns = getNegativePatternsAsPositive(unixPatterns, unixIgnore); - /** - * When the `case` option is disabled, all patterns must be marked as dynamic, because we cannot check filepath - * directly (without read directory). - */ - var staticPatterns = !options.case ? [] : positivePatterns.filter(patternUtils.isStaticPattern); - var dynamicPatterns = !options.case ? positivePatterns : positivePatterns.filter(patternUtils.isDynamicPattern); - var staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); - var dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); - return staticTasks.concat(dynamicTasks); -} -exports.generate = generate; -/** - * Convert patterns to tasks based on parent directory of each pattern. - */ -function convertPatternsToTasks(positive, negative, dynamic) { - var positivePatternsGroup = groupPatternsByBaseDirectory(positive); - // When we have a global group – there is no reason to divide the patterns into independent tasks. - // In this case, the global task covers the rest. - if ('.' in positivePatternsGroup) { - var task = convertPatternGroupToTask('.', positive, negative, dynamic); - return [task]; - } - return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic); -} -exports.convertPatternsToTasks = convertPatternsToTasks; -/** - * Return only positive patterns. - */ -function getPositivePatterns(patterns) { - return patternUtils.getPositivePatterns(patterns); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Return only negative patterns. - */ -function getNegativePatternsAsPositive(patterns, ignore) { - var negative = patternUtils.getNegativePatterns(patterns).concat(ignore); - var positive = negative.map(patternUtils.convertToPositivePattern); - return positive; -} -exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; -/** - * Group patterns by base directory of each pattern. - */ -function groupPatternsByBaseDirectory(patterns) { - return patterns.reduce(function (collection, pattern) { - var base = patternUtils.getBaseDirectory(pattern); - if (base in collection) { - collection[base].push(pattern); - } - else { - collection[base] = [pattern]; - } - return collection; - }, {}); -} -exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; -/** - * Convert group of patterns to tasks. - */ -function convertPatternGroupsToTasks(positive, negative, dynamic) { - return Object.keys(positive).map(function (base) { - return convertPatternGroupToTask(base, positive[base], negative, dynamic); - }); -} -exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; -/** - * Create a task for positive and negative patterns. - */ -function convertPatternGroupToTask(base, positive, negative, dynamic) { - return { - base: base, - dynamic: dynamic, - positive: positive, - negative: negative, - patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern)) - }; -} -exports.convertPatternGroupToTask = convertPatternGroupToTask; + +Object.defineProperty(exports, "__esModule", { value: true }); +var patternUtils = __webpack_require__(526); +/** + * Generate tasks based on parent directory of each pattern. + */ +function generate(patterns, options) { + var unixPatterns = patterns.map(patternUtils.unixifyPattern); + var unixIgnore = options.ignore.map(patternUtils.unixifyPattern); + var positivePatterns = getPositivePatterns(unixPatterns); + var negativePatterns = getNegativePatternsAsPositive(unixPatterns, unixIgnore); + /** + * When the `case` option is disabled, all patterns must be marked as dynamic, because we cannot check filepath + * directly (without read directory). + */ + var staticPatterns = !options.case ? [] : positivePatterns.filter(patternUtils.isStaticPattern); + var dynamicPatterns = !options.case ? positivePatterns : positivePatterns.filter(patternUtils.isDynamicPattern); + var staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false); + var dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true); + return staticTasks.concat(dynamicTasks); +} +exports.generate = generate; +/** + * Convert patterns to tasks based on parent directory of each pattern. + */ +function convertPatternsToTasks(positive, negative, dynamic) { + var positivePatternsGroup = groupPatternsByBaseDirectory(positive); + // When we have a global group – there is no reason to divide the patterns into independent tasks. + // In this case, the global task covers the rest. + if ('.' in positivePatternsGroup) { + var task = convertPatternGroupToTask('.', positive, negative, dynamic); + return [task]; + } + return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic); +} +exports.convertPatternsToTasks = convertPatternsToTasks; +/** + * Return only positive patterns. + */ +function getPositivePatterns(patterns) { + return patternUtils.getPositivePatterns(patterns); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Return only negative patterns. + */ +function getNegativePatternsAsPositive(patterns, ignore) { + var negative = patternUtils.getNegativePatterns(patterns).concat(ignore); + var positive = negative.map(patternUtils.convertToPositivePattern); + return positive; +} +exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive; +/** + * Group patterns by base directory of each pattern. + */ +function groupPatternsByBaseDirectory(patterns) { + return patterns.reduce(function (collection, pattern) { + var base = patternUtils.getBaseDirectory(pattern); + if (base in collection) { + collection[base].push(pattern); + } + else { + collection[base] = [pattern]; + } + return collection; + }, {}); +} +exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory; +/** + * Convert group of patterns to tasks. + */ +function convertPatternGroupsToTasks(positive, negative, dynamic) { + return Object.keys(positive).map(function (base) { + return convertPatternGroupToTask(base, positive[base], negative, dynamic); + }); +} +exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks; +/** + * Create a task for positive and negative patterns. + */ +function convertPatternGroupToTask(base, positive, negative, dynamic) { + return { + base: base, + dynamic: dynamic, + positive: positive, + negative: negative, + patterns: [].concat(positive, negative.map(patternUtils.convertToNegativePattern)) + }; +} +exports.convertPatternGroupToTask = convertPatternGroupToTask; /***/ }), -/* 527 */ +/* 526 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -var globParent = __webpack_require__(309); -var isGlob = __webpack_require__(310); -var micromatch = __webpack_require__(528); -var GLOBSTAR = '**'; -/** - * Return true for static pattern. - */ -function isStaticPattern(pattern) { - return !isDynamicPattern(pattern); -} -exports.isStaticPattern = isStaticPattern; -/** - * Return true for pattern that looks like glob. - */ -function isDynamicPattern(pattern) { - return isGlob(pattern, { strict: false }); -} -exports.isDynamicPattern = isDynamicPattern; -/** - * Convert a windows Β«pathΒ» to a unix-style Β«pathΒ». - */ -function unixifyPattern(pattern) { - return pattern.replace(/\\/g, '/'); -} -exports.unixifyPattern = unixifyPattern; -/** - * Returns negative pattern as positive pattern. - */ -function convertToPositivePattern(pattern) { - return isNegativePattern(pattern) ? pattern.slice(1) : pattern; -} -exports.convertToPositivePattern = convertToPositivePattern; -/** - * Returns positive pattern as negative pattern. - */ -function convertToNegativePattern(pattern) { - return '!' + pattern; -} -exports.convertToNegativePattern = convertToNegativePattern; -/** - * Return true if provided pattern is negative pattern. - */ -function isNegativePattern(pattern) { - return pattern.startsWith('!') && pattern[1] !== '('; -} -exports.isNegativePattern = isNegativePattern; -/** - * Return true if provided pattern is positive pattern. - */ -function isPositivePattern(pattern) { - return !isNegativePattern(pattern); -} -exports.isPositivePattern = isPositivePattern; -/** - * Extracts negative patterns from array of patterns. - */ -function getNegativePatterns(patterns) { - return patterns.filter(isNegativePattern); -} -exports.getNegativePatterns = getNegativePatterns; -/** - * Extracts positive patterns from array of patterns. - */ -function getPositivePatterns(patterns) { - return patterns.filter(isPositivePattern); -} -exports.getPositivePatterns = getPositivePatterns; -/** - * Extract base directory from provided pattern. - */ -function getBaseDirectory(pattern) { - return globParent(pattern); -} -exports.getBaseDirectory = getBaseDirectory; -/** - * Return true if provided pattern has globstar. - */ -function hasGlobStar(pattern) { - return pattern.indexOf(GLOBSTAR) !== -1; -} -exports.hasGlobStar = hasGlobStar; -/** - * Return true if provided pattern ends with slash and globstar. - */ -function endsWithSlashGlobStar(pattern) { - return pattern.endsWith('/' + GLOBSTAR); -} -exports.endsWithSlashGlobStar = endsWithSlashGlobStar; -/** - * Returns Β«trueΒ» when pattern ends with a slash and globstar or the last partial of the pattern is static pattern. - */ -function isAffectDepthOfReadingPattern(pattern) { - var basename = path.basename(pattern); - return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); -} -exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; -/** - * Return naive depth of provided pattern without depth of the base directory. - */ -function getNaiveDepth(pattern) { - var base = getBaseDirectory(pattern); - var patternDepth = pattern.split('/').length; - var patternBaseDepth = base.split('/').length; - /** - * This is a hack for pattern that has no base directory. - * - * This is related to the `*\something\*` pattern. - */ - if (base === '.') { - return patternDepth - patternBaseDepth; - } - return patternDepth - patternBaseDepth - 1; -} -exports.getNaiveDepth = getNaiveDepth; -/** - * Return max naive depth of provided patterns without depth of the base directory. - */ -function getMaxNaivePatternsDepth(patterns) { - return patterns.reduce(function (max, pattern) { - var depth = getNaiveDepth(pattern); - return depth > max ? depth : max; - }, 0); -} -exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth; -/** - * Make RegExp for provided pattern. - */ -function makeRe(pattern, options) { - return micromatch.makeRe(pattern, options); -} -exports.makeRe = makeRe; -/** - * Convert patterns to regexps. - */ -function convertPatternsToRe(patterns, options) { - return patterns.map(function (pattern) { return makeRe(pattern, options); }); -} -exports.convertPatternsToRe = convertPatternsToRe; -/** - * Returns true if the entry match any of the given RegExp's. - */ -function matchAny(entry, patternsRe) { - return patternsRe.some(function (patternRe) { return patternRe.test(entry); }); -} -exports.matchAny = matchAny; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +var globParent = __webpack_require__(309); +var isGlob = __webpack_require__(310); +var micromatch = __webpack_require__(527); +var GLOBSTAR = '**'; +/** + * Return true for static pattern. + */ +function isStaticPattern(pattern) { + return !isDynamicPattern(pattern); +} +exports.isStaticPattern = isStaticPattern; +/** + * Return true for pattern that looks like glob. + */ +function isDynamicPattern(pattern) { + return isGlob(pattern, { strict: false }); +} +exports.isDynamicPattern = isDynamicPattern; +/** + * Convert a windows Β«pathΒ» to a unix-style Β«pathΒ». + */ +function unixifyPattern(pattern) { + return pattern.replace(/\\/g, '/'); +} +exports.unixifyPattern = unixifyPattern; +/** + * Returns negative pattern as positive pattern. + */ +function convertToPositivePattern(pattern) { + return isNegativePattern(pattern) ? pattern.slice(1) : pattern; +} +exports.convertToPositivePattern = convertToPositivePattern; +/** + * Returns positive pattern as negative pattern. + */ +function convertToNegativePattern(pattern) { + return '!' + pattern; +} +exports.convertToNegativePattern = convertToNegativePattern; +/** + * Return true if provided pattern is negative pattern. + */ +function isNegativePattern(pattern) { + return pattern.startsWith('!') && pattern[1] !== '('; +} +exports.isNegativePattern = isNegativePattern; +/** + * Return true if provided pattern is positive pattern. + */ +function isPositivePattern(pattern) { + return !isNegativePattern(pattern); +} +exports.isPositivePattern = isPositivePattern; +/** + * Extracts negative patterns from array of patterns. + */ +function getNegativePatterns(patterns) { + return patterns.filter(isNegativePattern); +} +exports.getNegativePatterns = getNegativePatterns; +/** + * Extracts positive patterns from array of patterns. + */ +function getPositivePatterns(patterns) { + return patterns.filter(isPositivePattern); +} +exports.getPositivePatterns = getPositivePatterns; +/** + * Extract base directory from provided pattern. + */ +function getBaseDirectory(pattern) { + return globParent(pattern); +} +exports.getBaseDirectory = getBaseDirectory; +/** + * Return true if provided pattern has globstar. + */ +function hasGlobStar(pattern) { + return pattern.indexOf(GLOBSTAR) !== -1; +} +exports.hasGlobStar = hasGlobStar; +/** + * Return true if provided pattern ends with slash and globstar. + */ +function endsWithSlashGlobStar(pattern) { + return pattern.endsWith('/' + GLOBSTAR); +} +exports.endsWithSlashGlobStar = endsWithSlashGlobStar; +/** + * Returns Β«trueΒ» when pattern ends with a slash and globstar or the last partial of the pattern is static pattern. + */ +function isAffectDepthOfReadingPattern(pattern) { + var basename = path.basename(pattern); + return endsWithSlashGlobStar(pattern) || isStaticPattern(basename); +} +exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern; +/** + * Return naive depth of provided pattern without depth of the base directory. + */ +function getNaiveDepth(pattern) { + var base = getBaseDirectory(pattern); + var patternDepth = pattern.split('/').length; + var patternBaseDepth = base.split('/').length; + /** + * This is a hack for pattern that has no base directory. + * + * This is related to the `*\something\*` pattern. + */ + if (base === '.') { + return patternDepth - patternBaseDepth; + } + return patternDepth - patternBaseDepth - 1; +} +exports.getNaiveDepth = getNaiveDepth; +/** + * Return max naive depth of provided patterns without depth of the base directory. + */ +function getMaxNaivePatternsDepth(patterns) { + return patterns.reduce(function (max, pattern) { + var depth = getNaiveDepth(pattern); + return depth > max ? depth : max; + }, 0); +} +exports.getMaxNaivePatternsDepth = getMaxNaivePatternsDepth; +/** + * Make RegExp for provided pattern. + */ +function makeRe(pattern, options) { + return micromatch.makeRe(pattern, options); +} +exports.makeRe = makeRe; +/** + * Convert patterns to regexps. + */ +function convertPatternsToRe(patterns, options) { + return patterns.map(function (pattern) { return makeRe(pattern, options); }); +} +exports.convertPatternsToRe = convertPatternsToRe; +/** + * Returns true if the entry match any of the given RegExp's. + */ +function matchAny(entry, patternsRe) { + return patternsRe.some(function (patternRe) { return patternRe.test(entry); }); +} +exports.matchAny = matchAny; /***/ }), -/* 528 */ +/* 527 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -57694,18 +57682,18 @@ exports.matchAny = matchAny; */ var util = __webpack_require__(112); -var braces = __webpack_require__(529); -var toRegex = __webpack_require__(530); -var extend = __webpack_require__(633); +var braces = __webpack_require__(528); +var toRegex = __webpack_require__(529); +var extend = __webpack_require__(632); /** * Local dependencies */ -var compilers = __webpack_require__(635); -var parsers = __webpack_require__(664); -var cache = __webpack_require__(665); -var utils = __webpack_require__(666); +var compilers = __webpack_require__(634); +var parsers = __webpack_require__(663); +var cache = __webpack_require__(664); +var utils = __webpack_require__(665); var MAX_LENGTH = 1024 * 64; /** @@ -58567,7 +58555,7 @@ module.exports = micromatch; /***/ }), -/* 529 */ +/* 528 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -58577,18 +58565,18 @@ module.exports = micromatch; * Module dependencies */ -var toRegex = __webpack_require__(530); -var unique = __webpack_require__(550); -var extend = __webpack_require__(551); +var toRegex = __webpack_require__(529); +var unique = __webpack_require__(549); +var extend = __webpack_require__(550); /** * Local dependencies */ -var compilers = __webpack_require__(553); -var parsers = __webpack_require__(564); -var Braces = __webpack_require__(568); -var utils = __webpack_require__(554); +var compilers = __webpack_require__(552); +var parsers = __webpack_require__(563); +var Braces = __webpack_require__(567); +var utils = __webpack_require__(553); var MAX_LENGTH = 1024 * 64; var cache = {}; @@ -58892,16 +58880,16 @@ module.exports = braces; /***/ }), -/* 530 */ +/* 529 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var safe = __webpack_require__(531); -var define = __webpack_require__(537); -var extend = __webpack_require__(543); -var not = __webpack_require__(547); +var safe = __webpack_require__(530); +var define = __webpack_require__(536); +var extend = __webpack_require__(542); +var not = __webpack_require__(546); var MAX_LENGTH = 1024 * 64; /** @@ -59054,10 +59042,10 @@ module.exports.makeRe = makeRe; /***/ }), -/* 531 */ +/* 530 */ /***/ (function(module, exports, __webpack_require__) { -var parse = __webpack_require__(532); +var parse = __webpack_require__(531); var types = parse.types; module.exports = function (re, opts) { @@ -59103,13 +59091,13 @@ function isRegExp (x) { /***/ }), -/* 532 */ +/* 531 */ /***/ (function(module, exports, __webpack_require__) { -var util = __webpack_require__(533); -var types = __webpack_require__(534); -var sets = __webpack_require__(535); -var positions = __webpack_require__(536); +var util = __webpack_require__(532); +var types = __webpack_require__(533); +var sets = __webpack_require__(534); +var positions = __webpack_require__(535); module.exports = function(regexpStr) { @@ -59391,11 +59379,11 @@ module.exports.types = types; /***/ }), -/* 533 */ +/* 532 */ /***/ (function(module, exports, __webpack_require__) { -var types = __webpack_require__(534); -var sets = __webpack_require__(535); +var types = __webpack_require__(533); +var sets = __webpack_require__(534); // All of these are private and only used by randexp. @@ -59508,7 +59496,7 @@ exports.error = function(regexp, msg) { /***/ }), -/* 534 */ +/* 533 */ /***/ (function(module, exports) { module.exports = { @@ -59524,10 +59512,10 @@ module.exports = { /***/ }), -/* 535 */ +/* 534 */ /***/ (function(module, exports, __webpack_require__) { -var types = __webpack_require__(534); +var types = __webpack_require__(533); var INTS = function() { return [{ type: types.RANGE , from: 48, to: 57 }]; @@ -59612,10 +59600,10 @@ exports.anyChar = function() { /***/ }), -/* 536 */ +/* 535 */ /***/ (function(module, exports, __webpack_require__) { -var types = __webpack_require__(534); +var types = __webpack_require__(533); exports.wordBoundary = function() { return { type: types.POSITION, value: 'b' }; @@ -59635,7 +59623,7 @@ exports.end = function() { /***/ }), -/* 537 */ +/* 536 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59648,8 +59636,8 @@ exports.end = function() { -var isobject = __webpack_require__(538); -var isDescriptor = __webpack_require__(539); +var isobject = __webpack_require__(537); +var isDescriptor = __webpack_require__(538); var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) ? Reflect.defineProperty : Object.defineProperty; @@ -59680,7 +59668,7 @@ module.exports = function defineProperty(obj, key, val) { /***/ }), -/* 538 */ +/* 537 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59699,7 +59687,7 @@ module.exports = function isObject(val) { /***/ }), -/* 539 */ +/* 538 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59712,9 +59700,9 @@ module.exports = function isObject(val) { -var typeOf = __webpack_require__(540); -var isAccessor = __webpack_require__(541); -var isData = __webpack_require__(542); +var typeOf = __webpack_require__(539); +var isAccessor = __webpack_require__(540); +var isData = __webpack_require__(541); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { @@ -59728,7 +59716,7 @@ module.exports = function isDescriptor(obj, key) { /***/ }), -/* 540 */ +/* 539 */ /***/ (function(module, exports) { var toString = Object.prototype.toString; @@ -59863,7 +59851,7 @@ function isBuffer(val) { /***/ }), -/* 541 */ +/* 540 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59876,7 +59864,7 @@ function isBuffer(val) { -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); // accessor descriptor properties var accessor = { @@ -59939,7 +59927,7 @@ module.exports = isAccessorDescriptor; /***/ }), -/* 542 */ +/* 541 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -59952,7 +59940,7 @@ module.exports = isAccessorDescriptor; -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); module.exports = function isDataDescriptor(obj, prop) { // data descriptor properties @@ -59995,14 +59983,14 @@ module.exports = function isDataDescriptor(obj, prop) { /***/ }), -/* 543 */ +/* 542 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(544); -var assignSymbols = __webpack_require__(546); +var isExtendable = __webpack_require__(543); +var assignSymbols = __webpack_require__(545); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -60062,7 +60050,7 @@ function isEnum(obj, key) { /***/ }), -/* 544 */ +/* 543 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60075,7 +60063,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(545); +var isPlainObject = __webpack_require__(544); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -60083,7 +60071,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 545 */ +/* 544 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60096,7 +60084,7 @@ module.exports = function isExtendable(val) { -var isObject = __webpack_require__(538); +var isObject = __webpack_require__(537); function isObjectObject(o) { return isObject(o) === true @@ -60127,7 +60115,7 @@ module.exports = function isPlainObject(o) { /***/ }), -/* 546 */ +/* 545 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60174,14 +60162,14 @@ module.exports = function(receiver, objects) { /***/ }), -/* 547 */ +/* 546 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(548); -var safe = __webpack_require__(531); +var extend = __webpack_require__(547); +var safe = __webpack_require__(530); /** * The main export is a function that takes a `pattern` string and an `options` object. @@ -60253,14 +60241,14 @@ module.exports = toRegex; /***/ }), -/* 548 */ +/* 547 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(549); -var assignSymbols = __webpack_require__(546); +var isExtendable = __webpack_require__(548); +var assignSymbols = __webpack_require__(545); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -60320,7 +60308,7 @@ function isEnum(obj, key) { /***/ }), -/* 549 */ +/* 548 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60333,7 +60321,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(545); +var isPlainObject = __webpack_require__(544); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -60341,7 +60329,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 550 */ +/* 549 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60391,13 +60379,13 @@ module.exports.immutable = function uniqueImmutable(arr) { /***/ }), -/* 551 */ +/* 550 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(552); +var isObject = __webpack_require__(551); module.exports = function extend(o/*, objects*/) { if (!isObject(o)) { o = {}; } @@ -60431,7 +60419,7 @@ function hasOwn(obj, key) { /***/ }), -/* 552 */ +/* 551 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -60451,13 +60439,13 @@ module.exports = function isExtendable(val) { /***/ }), -/* 553 */ +/* 552 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(554); +var utils = __webpack_require__(553); module.exports = function(braces, options) { braces.compiler @@ -60740,25 +60728,25 @@ function hasQueue(node) { /***/ }), -/* 554 */ +/* 553 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var splitString = __webpack_require__(555); +var splitString = __webpack_require__(554); var utils = module.exports; /** * Module dependencies */ -utils.extend = __webpack_require__(551); -utils.flatten = __webpack_require__(558); -utils.isObject = __webpack_require__(538); -utils.fillRange = __webpack_require__(559); -utils.repeat = __webpack_require__(563); -utils.unique = __webpack_require__(550); +utils.extend = __webpack_require__(550); +utils.flatten = __webpack_require__(557); +utils.isObject = __webpack_require__(537); +utils.fillRange = __webpack_require__(558); +utils.repeat = __webpack_require__(562); +utils.unique = __webpack_require__(549); utils.define = function(obj, key, val) { Object.defineProperty(obj, key, { @@ -61090,7 +61078,7 @@ utils.escapeRegex = function(str) { /***/ }), -/* 555 */ +/* 554 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61103,7 +61091,7 @@ utils.escapeRegex = function(str) { -var extend = __webpack_require__(556); +var extend = __webpack_require__(555); module.exports = function(str, options, fn) { if (typeof str !== 'string') { @@ -61268,14 +61256,14 @@ function keepEscaping(opts, str, idx) { /***/ }), -/* 556 */ +/* 555 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(557); -var assignSymbols = __webpack_require__(546); +var isExtendable = __webpack_require__(556); +var assignSymbols = __webpack_require__(545); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -61335,7 +61323,7 @@ function isEnum(obj, key) { /***/ }), -/* 557 */ +/* 556 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61348,7 +61336,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(545); +var isPlainObject = __webpack_require__(544); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -61356,7 +61344,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 558 */ +/* 557 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61385,7 +61373,7 @@ function flat(arr, res) { /***/ }), -/* 559 */ +/* 558 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61399,10 +61387,10 @@ function flat(arr, res) { var util = __webpack_require__(112); -var isNumber = __webpack_require__(560); -var extend = __webpack_require__(551); -var repeat = __webpack_require__(561); -var toRegex = __webpack_require__(562); +var isNumber = __webpack_require__(559); +var extend = __webpack_require__(550); +var repeat = __webpack_require__(560); +var toRegex = __webpack_require__(561); /** * Return a range of numbers or letters. @@ -61600,7 +61588,7 @@ module.exports = fillRange; /***/ }), -/* 560 */ +/* 559 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61613,7 +61601,7 @@ module.exports = fillRange; -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); module.exports = function isNumber(num) { var type = typeOf(num); @@ -61629,7 +61617,7 @@ module.exports = function isNumber(num) { /***/ }), -/* 561 */ +/* 560 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61706,7 +61694,7 @@ function repeat(str, num) { /***/ }), -/* 562 */ +/* 561 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -61719,8 +61707,8 @@ function repeat(str, num) { -var repeat = __webpack_require__(561); -var isNumber = __webpack_require__(560); +var repeat = __webpack_require__(560); +var isNumber = __webpack_require__(559); var cache = {}; function toRegexRange(min, max, options) { @@ -62007,7 +61995,7 @@ module.exports = toRegexRange; /***/ }), -/* 563 */ +/* 562 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -62036,14 +62024,14 @@ module.exports = function repeat(ele, num) { /***/ }), -/* 564 */ +/* 563 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Node = __webpack_require__(565); -var utils = __webpack_require__(554); +var Node = __webpack_require__(564); +var utils = __webpack_require__(553); /** * Braces parsers @@ -62403,15 +62391,15 @@ function concatNodes(pos, node, parent, options) { /***/ }), -/* 565 */ +/* 564 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(538); -var define = __webpack_require__(566); -var utils = __webpack_require__(567); +var isObject = __webpack_require__(537); +var define = __webpack_require__(565); +var utils = __webpack_require__(566); var ownNames; /** @@ -62902,7 +62890,7 @@ exports = module.exports = Node; /***/ }), -/* 566 */ +/* 565 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -62915,7 +62903,7 @@ exports = module.exports = Node; -var isDescriptor = __webpack_require__(539); +var isDescriptor = __webpack_require__(538); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -62940,13 +62928,13 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 567 */ +/* 566 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); var utils = module.exports; /** @@ -63966,17 +63954,17 @@ function assert(val, message) { /***/ }), -/* 568 */ +/* 567 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extend = __webpack_require__(551); -var Snapdragon = __webpack_require__(569); -var compilers = __webpack_require__(553); -var parsers = __webpack_require__(564); -var utils = __webpack_require__(554); +var extend = __webpack_require__(550); +var Snapdragon = __webpack_require__(568); +var compilers = __webpack_require__(552); +var parsers = __webpack_require__(563); +var utils = __webpack_require__(553); /** * Customize Snapdragon parser and renderer @@ -64077,17 +64065,17 @@ module.exports = Braces; /***/ }), -/* 569 */ +/* 568 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var Base = __webpack_require__(570); -var define = __webpack_require__(595); -var Compiler = __webpack_require__(602); -var Parser = __webpack_require__(630); -var utils = __webpack_require__(610); +var Base = __webpack_require__(569); +var define = __webpack_require__(594); +var Compiler = __webpack_require__(601); +var Parser = __webpack_require__(629); +var utils = __webpack_require__(609); var regexCache = {}; var cache = {}; @@ -64258,20 +64246,20 @@ module.exports.Parser = Parser; /***/ }), -/* 570 */ +/* 569 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(112); -var define = __webpack_require__(571); -var CacheBase = __webpack_require__(572); -var Emitter = __webpack_require__(573); -var isObject = __webpack_require__(538); -var merge = __webpack_require__(590); -var pascal = __webpack_require__(593); -var cu = __webpack_require__(594); +var define = __webpack_require__(570); +var CacheBase = __webpack_require__(571); +var Emitter = __webpack_require__(572); +var isObject = __webpack_require__(537); +var merge = __webpack_require__(589); +var pascal = __webpack_require__(592); +var cu = __webpack_require__(593); /** * Optionally define a custom `cache` namespace to use. @@ -64700,7 +64688,7 @@ module.exports.namespace = namespace; /***/ }), -/* 571 */ +/* 570 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -64713,7 +64701,7 @@ module.exports.namespace = namespace; -var isDescriptor = __webpack_require__(539); +var isDescriptor = __webpack_require__(538); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -64738,21 +64726,21 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 572 */ +/* 571 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(538); -var Emitter = __webpack_require__(573); -var visit = __webpack_require__(574); -var toPath = __webpack_require__(577); -var union = __webpack_require__(578); -var del = __webpack_require__(582); -var get = __webpack_require__(580); -var has = __webpack_require__(588); -var set = __webpack_require__(581); +var isObject = __webpack_require__(537); +var Emitter = __webpack_require__(572); +var visit = __webpack_require__(573); +var toPath = __webpack_require__(576); +var union = __webpack_require__(577); +var del = __webpack_require__(581); +var get = __webpack_require__(579); +var has = __webpack_require__(587); +var set = __webpack_require__(580); /** * Create a `Cache` constructor that when instantiated will @@ -65006,188 +64994,188 @@ module.exports.namespace = namespace; /***/ }), -/* 573 */ +/* 572 */ /***/ (function(module, exports, __webpack_require__) { - -/** - * Expose `Emitter`. - */ - -if (true) { - module.exports = Emitter; -} - -/** - * Initialize a new `Emitter`. - * - * @api public - */ - -function Emitter(obj) { - if (obj) return mixin(obj); -}; - -/** - * Mixin the emitter properties. - * - * @param {Object} obj - * @return {Object} - * @api private - */ - -function mixin(obj) { - for (var key in Emitter.prototype) { - obj[key] = Emitter.prototype[key]; - } - return obj; -} - -/** - * Listen on the given `event` with `fn`. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.on = -Emitter.prototype.addEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - (this._callbacks['$' + event] = this._callbacks['$' + event] || []) - .push(fn); - return this; -}; - -/** - * Adds an `event` listener that will be invoked a single - * time then automatically removed. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.once = function(event, fn){ - function on() { - this.off(event, on); - fn.apply(this, arguments); - } - - on.fn = fn; - this.on(event, on); - return this; -}; - -/** - * Remove the given callback for `event` or all - * registered callbacks. - * - * @param {String} event - * @param {Function} fn - * @return {Emitter} - * @api public - */ - -Emitter.prototype.off = -Emitter.prototype.removeListener = -Emitter.prototype.removeAllListeners = -Emitter.prototype.removeEventListener = function(event, fn){ - this._callbacks = this._callbacks || {}; - - // all - if (0 == arguments.length) { - this._callbacks = {}; - return this; - } - - // specific event - var callbacks = this._callbacks['$' + event]; - if (!callbacks) return this; - - // remove all handlers - if (1 == arguments.length) { - delete this._callbacks['$' + event]; - return this; - } - - // remove specific handler - var cb; - for (var i = 0; i < callbacks.length; i++) { - cb = callbacks[i]; - if (cb === fn || cb.fn === fn) { - callbacks.splice(i, 1); - break; - } - } - - // Remove event specific arrays for event types that no - // one is subscribed for to avoid memory leak. - if (callbacks.length === 0) { - delete this._callbacks['$' + event]; - } - - return this; -}; - -/** - * Emit `event` with the given args. - * - * @param {String} event - * @param {Mixed} ... - * @return {Emitter} - */ - -Emitter.prototype.emit = function(event){ - this._callbacks = this._callbacks || {}; - - var args = new Array(arguments.length - 1) - , callbacks = this._callbacks['$' + event]; - - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - - if (callbacks) { - callbacks = callbacks.slice(0); - for (var i = 0, len = callbacks.length; i < len; ++i) { - callbacks[i].apply(this, args); - } - } - - return this; -}; - -/** - * Return array of callbacks for `event`. - * - * @param {String} event - * @return {Array} - * @api public - */ - -Emitter.prototype.listeners = function(event){ - this._callbacks = this._callbacks || {}; - return this._callbacks['$' + event] || []; -}; - -/** - * Check if this emitter has `event` handlers. - * - * @param {String} event - * @return {Boolean} - * @api public - */ - -Emitter.prototype.hasListeners = function(event){ - return !! this.listeners(event).length; -}; + +/** + * Expose `Emitter`. + */ + +if (true) { + module.exports = Emitter; +} + +/** + * Initialize a new `Emitter`. + * + * @api public + */ + +function Emitter(obj) { + if (obj) return mixin(obj); +}; + +/** + * Mixin the emitter properties. + * + * @param {Object} obj + * @return {Object} + * @api private + */ + +function mixin(obj) { + for (var key in Emitter.prototype) { + obj[key] = Emitter.prototype[key]; + } + return obj; +} + +/** + * Listen on the given `event` with `fn`. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.on = +Emitter.prototype.addEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + (this._callbacks['$' + event] = this._callbacks['$' + event] || []) + .push(fn); + return this; +}; + +/** + * Adds an `event` listener that will be invoked a single + * time then automatically removed. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.once = function(event, fn){ + function on() { + this.off(event, on); + fn.apply(this, arguments); + } + + on.fn = fn; + this.on(event, on); + return this; +}; + +/** + * Remove the given callback for `event` or all + * registered callbacks. + * + * @param {String} event + * @param {Function} fn + * @return {Emitter} + * @api public + */ + +Emitter.prototype.off = +Emitter.prototype.removeListener = +Emitter.prototype.removeAllListeners = +Emitter.prototype.removeEventListener = function(event, fn){ + this._callbacks = this._callbacks || {}; + + // all + if (0 == arguments.length) { + this._callbacks = {}; + return this; + } + + // specific event + var callbacks = this._callbacks['$' + event]; + if (!callbacks) return this; + + // remove all handlers + if (1 == arguments.length) { + delete this._callbacks['$' + event]; + return this; + } + + // remove specific handler + var cb; + for (var i = 0; i < callbacks.length; i++) { + cb = callbacks[i]; + if (cb === fn || cb.fn === fn) { + callbacks.splice(i, 1); + break; + } + } + + // Remove event specific arrays for event types that no + // one is subscribed for to avoid memory leak. + if (callbacks.length === 0) { + delete this._callbacks['$' + event]; + } + + return this; +}; + +/** + * Emit `event` with the given args. + * + * @param {String} event + * @param {Mixed} ... + * @return {Emitter} + */ + +Emitter.prototype.emit = function(event){ + this._callbacks = this._callbacks || {}; + + var args = new Array(arguments.length - 1) + , callbacks = this._callbacks['$' + event]; + + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + + if (callbacks) { + callbacks = callbacks.slice(0); + for (var i = 0, len = callbacks.length; i < len; ++i) { + callbacks[i].apply(this, args); + } + } + + return this; +}; + +/** + * Return array of callbacks for `event`. + * + * @param {String} event + * @return {Array} + * @api public + */ + +Emitter.prototype.listeners = function(event){ + this._callbacks = this._callbacks || {}; + return this._callbacks['$' + event] || []; +}; + +/** + * Check if this emitter has `event` handlers. + * + * @param {String} event + * @return {Boolean} + * @api public + */ + +Emitter.prototype.hasListeners = function(event){ + return !! this.listeners(event).length; +}; /***/ }), -/* 574 */ +/* 573 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65200,8 +65188,8 @@ Emitter.prototype.hasListeners = function(event){ -var visit = __webpack_require__(575); -var mapVisit = __webpack_require__(576); +var visit = __webpack_require__(574); +var mapVisit = __webpack_require__(575); module.exports = function(collection, method, val) { var result; @@ -65224,7 +65212,7 @@ module.exports = function(collection, method, val) { /***/ }), -/* 575 */ +/* 574 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65237,7 +65225,7 @@ module.exports = function(collection, method, val) { -var isObject = __webpack_require__(538); +var isObject = __webpack_require__(537); module.exports = function visit(thisArg, method, target, val) { if (!isObject(thisArg) && typeof thisArg !== 'function') { @@ -65264,14 +65252,14 @@ module.exports = function visit(thisArg, method, target, val) { /***/ }), -/* 576 */ +/* 575 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(112); -var visit = __webpack_require__(575); +var visit = __webpack_require__(574); /** * Map `visit` over an array of objects. @@ -65308,7 +65296,7 @@ function isObject(val) { /***/ }), -/* 577 */ +/* 576 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65321,7 +65309,7 @@ function isObject(val) { -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); module.exports = function toPath(args) { if (typeOf(args) !== 'arguments') { @@ -65348,16 +65336,16 @@ function filter(arr) { /***/ }), -/* 578 */ +/* 577 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isObject = __webpack_require__(552); -var union = __webpack_require__(579); -var get = __webpack_require__(580); -var set = __webpack_require__(581); +var isObject = __webpack_require__(551); +var union = __webpack_require__(578); +var get = __webpack_require__(579); +var set = __webpack_require__(580); module.exports = function unionValue(obj, prop, value) { if (!isObject(obj)) { @@ -65385,7 +65373,7 @@ function arrayify(val) { /***/ }), -/* 579 */ +/* 578 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65421,7 +65409,7 @@ module.exports = function union(init) { /***/ }), -/* 580 */ +/* 579 */ /***/ (function(module, exports) { /*! @@ -65477,7 +65465,7 @@ function toString(val) { /***/ }), -/* 581 */ +/* 580 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65490,10 +65478,10 @@ function toString(val) { -var split = __webpack_require__(555); -var extend = __webpack_require__(551); -var isPlainObject = __webpack_require__(545); -var isObject = __webpack_require__(552); +var split = __webpack_require__(554); +var extend = __webpack_require__(550); +var isPlainObject = __webpack_require__(544); +var isObject = __webpack_require__(551); module.exports = function(obj, prop, val) { if (!isObject(obj)) { @@ -65539,7 +65527,7 @@ function isValidKey(key) { /***/ }), -/* 582 */ +/* 581 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65552,8 +65540,8 @@ function isValidKey(key) { -var isObject = __webpack_require__(583); -var has = __webpack_require__(584); +var isObject = __webpack_require__(582); +var has = __webpack_require__(583); const isUnsafeKey = key => { return key === '__proto__' || key === 'constructor' || key === 'prototype'; @@ -65595,7 +65583,7 @@ module.exports = function unset(obj, prop) { /***/ }), -/* 583 */ +/* 582 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -65614,7 +65602,7 @@ function isObject(val) { /***/ }), -/* 584 */ +/* 583 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65627,8 +65615,8 @@ function isObject(val) { -const get = __webpack_require__(585); -const has = __webpack_require__(587); +const get = __webpack_require__(584); +const has = __webpack_require__(586); module.exports = function(obj, path, options) { if (isObject(obj) && (typeof path === 'string' || Array.isArray(path))) { @@ -65643,7 +65631,7 @@ function isObject(val) { /***/ }), -/* 585 */ +/* 584 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -65653,7 +65641,7 @@ function isObject(val) { * Released under the MIT License. */ -const isObject = __webpack_require__(586); +const isObject = __webpack_require__(585); module.exports = function(target, path, options) { if (!isObject(options)) { @@ -65759,7 +65747,7 @@ function isValidObject(val) { /***/ }), -/* 586 */ +/* 585 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65778,7 +65766,7 @@ module.exports = function isObject(val) { /***/ }), -/* 587 */ +/* 586 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65791,7 +65779,7 @@ module.exports = function isObject(val) { -const typeOf = __webpack_require__(540); +const typeOf = __webpack_require__(539); module.exports = function has(val) { switch (typeOf(val)) { @@ -65834,7 +65822,7 @@ module.exports = function has(val) { /***/ }), -/* 588 */ +/* 587 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65847,9 +65835,9 @@ module.exports = function has(val) { -var isObject = __webpack_require__(538); -var hasValues = __webpack_require__(589); -var get = __webpack_require__(580); +var isObject = __webpack_require__(537); +var hasValues = __webpack_require__(588); +var get = __webpack_require__(579); module.exports = function(val, prop) { return hasValues(isObject(val) && prop ? get(val, prop) : val); @@ -65857,7 +65845,7 @@ module.exports = function(val, prop) { /***/ }), -/* 589 */ +/* 588 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -65870,8 +65858,8 @@ module.exports = function(val, prop) { -var typeOf = __webpack_require__(540); -var isNumber = __webpack_require__(560); +var typeOf = __webpack_require__(539); +var isNumber = __webpack_require__(559); module.exports = function hasValue(val) { // is-number checks for NaN and other edge cases @@ -65924,14 +65912,14 @@ module.exports = function hasValue(val) { /***/ }), -/* 590 */ +/* 589 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(591); -var forIn = __webpack_require__(592); +var isExtendable = __webpack_require__(590); +var forIn = __webpack_require__(591); function mixinDeep(target, objects) { var len = arguments.length, i = 0; @@ -65995,7 +65983,7 @@ module.exports = mixinDeep; /***/ }), -/* 591 */ +/* 590 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66008,7 +65996,7 @@ module.exports = mixinDeep; -var isPlainObject = __webpack_require__(545); +var isPlainObject = __webpack_require__(544); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -66016,7 +66004,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 592 */ +/* 591 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66039,7 +66027,7 @@ module.exports = function forIn(obj, fn, thisArg) { /***/ }), -/* 593 */ +/* 592 */ /***/ (function(module, exports) { /*! @@ -66066,17 +66054,17 @@ module.exports = pascalcase; /***/ }), -/* 594 */ +/* 593 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var util = __webpack_require__(112); -var union = __webpack_require__(579); -var define = __webpack_require__(595); -var staticExtend = __webpack_require__(599); -var isObj = __webpack_require__(538); +var union = __webpack_require__(578); +var define = __webpack_require__(594); +var staticExtend = __webpack_require__(598); +var isObj = __webpack_require__(537); /** * Expose class utils @@ -66443,7 +66431,7 @@ cu.bubble = function(Parent, events) { /***/ }), -/* 595 */ +/* 594 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66456,7 +66444,7 @@ cu.bubble = function(Parent, events) { -var isDescriptor = __webpack_require__(596); +var isDescriptor = __webpack_require__(595); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -66481,7 +66469,7 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 596 */ +/* 595 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66494,9 +66482,9 @@ module.exports = function defineProperty(obj, prop, val) { -var typeOf = __webpack_require__(540); -var isAccessor = __webpack_require__(597); -var isData = __webpack_require__(598); +var typeOf = __webpack_require__(539); +var isAccessor = __webpack_require__(596); +var isData = __webpack_require__(597); module.exports = function isDescriptor(obj, key) { if (typeOf(obj) !== 'object') { @@ -66510,7 +66498,7 @@ module.exports = function isDescriptor(obj, key) { /***/ }), -/* 597 */ +/* 596 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66523,7 +66511,7 @@ module.exports = function isDescriptor(obj, key) { -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); // accessor descriptor properties var accessor = { @@ -66586,7 +66574,7 @@ module.exports = isAccessorDescriptor; /***/ }), -/* 598 */ +/* 597 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66599,7 +66587,7 @@ module.exports = isAccessorDescriptor; -var typeOf = __webpack_require__(540); +var typeOf = __webpack_require__(539); // data descriptor properties var data = { @@ -66648,7 +66636,7 @@ module.exports = isDataDescriptor; /***/ }), -/* 599 */ +/* 598 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -66661,8 +66649,8 @@ module.exports = isDataDescriptor; -var copy = __webpack_require__(600); -var define = __webpack_require__(595); +var copy = __webpack_require__(599); +var define = __webpack_require__(594); var util = __webpack_require__(112); /** @@ -66745,15 +66733,15 @@ module.exports = extend; /***/ }), -/* 600 */ +/* 599 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var typeOf = __webpack_require__(540); -var copyDescriptor = __webpack_require__(601); -var define = __webpack_require__(595); +var typeOf = __webpack_require__(539); +var copyDescriptor = __webpack_require__(600); +var define = __webpack_require__(594); /** * Copy static properties, prototype properties, and descriptors from one object to another. @@ -66926,7 +66914,7 @@ module.exports.has = has; /***/ }), -/* 601 */ +/* 600 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67014,16 +67002,16 @@ function isObject(val) { /***/ }), -/* 602 */ +/* 601 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var use = __webpack_require__(603); -var define = __webpack_require__(595); -var debug = __webpack_require__(604)('snapdragon:compiler'); -var utils = __webpack_require__(610); +var use = __webpack_require__(602); +var define = __webpack_require__(594); +var debug = __webpack_require__(603)('snapdragon:compiler'); +var utils = __webpack_require__(609); /** * Create a new `Compiler` with the given `options`. @@ -67177,7 +67165,7 @@ Compiler.prototype = { // source map support if (opts.sourcemap) { - var sourcemaps = __webpack_require__(629); + var sourcemaps = __webpack_require__(628); sourcemaps(this); this.mapVisit(this.ast.nodes); this.applySourceMaps(); @@ -67198,7 +67186,7 @@ module.exports = Compiler; /***/ }), -/* 603 */ +/* 602 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -67360,7 +67348,7 @@ function define(obj, key, val) { /***/ }), -/* 604 */ +/* 603 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67369,14 +67357,14 @@ function define(obj, key, val) { */ if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = __webpack_require__(605); + module.exports = __webpack_require__(604); } else { - module.exports = __webpack_require__(608); + module.exports = __webpack_require__(607); } /***/ }), -/* 605 */ +/* 604 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67385,7 +67373,7 @@ if (typeof process !== 'undefined' && process.type === 'renderer') { * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(606); +exports = module.exports = __webpack_require__(605); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -67567,7 +67555,7 @@ function localstorage() { /***/ }), -/* 606 */ +/* 605 */ /***/ (function(module, exports, __webpack_require__) { @@ -67583,7 +67571,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(607); +exports.humanize = __webpack_require__(606); /** * The currently active debug mode names, and names to skip. @@ -67775,7 +67763,7 @@ function coerce(val) { /***/ }), -/* 607 */ +/* 606 */ /***/ (function(module, exports) { /** @@ -67933,7 +67921,7 @@ function plural(ms, n, name) { /***/ }), -/* 608 */ +/* 607 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -67949,7 +67937,7 @@ var util = __webpack_require__(112); * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(606); +exports = module.exports = __webpack_require__(605); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; @@ -68128,7 +68116,7 @@ function createWritableStdioStream (fd) { case 'PIPE': case 'TCP': - var net = __webpack_require__(609); + var net = __webpack_require__(608); stream = new net.Socket({ fd: fd, readable: false, @@ -68187,13 +68175,13 @@ exports.enable(load()); /***/ }), -/* 609 */ +/* 608 */ /***/ (function(module, exports) { module.exports = require("net"); /***/ }), -/* 610 */ +/* 609 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -68203,9 +68191,9 @@ module.exports = require("net"); * Module dependencies */ -exports.extend = __webpack_require__(551); -exports.SourceMap = __webpack_require__(611); -exports.sourceMapResolve = __webpack_require__(622); +exports.extend = __webpack_require__(550); +exports.SourceMap = __webpack_require__(610); +exports.sourceMapResolve = __webpack_require__(621); /** * Convert backslash in the given string to forward slashes @@ -68248,7 +68236,7 @@ exports.last = function(arr, n) { /***/ }), -/* 611 */ +/* 610 */ /***/ (function(module, exports, __webpack_require__) { /* @@ -68256,13 +68244,13 @@ exports.last = function(arr, n) { * Licensed under the New BSD license. See LICENSE.txt or: * http://opensource.org/licenses/BSD-3-Clause */ -exports.SourceMapGenerator = __webpack_require__(612).SourceMapGenerator; -exports.SourceMapConsumer = __webpack_require__(618).SourceMapConsumer; -exports.SourceNode = __webpack_require__(621).SourceNode; +exports.SourceMapGenerator = __webpack_require__(611).SourceMapGenerator; +exports.SourceMapConsumer = __webpack_require__(617).SourceMapConsumer; +exports.SourceNode = __webpack_require__(620).SourceNode; /***/ }), -/* 612 */ +/* 611 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -68272,10 +68260,10 @@ exports.SourceNode = __webpack_require__(621).SourceNode; * http://opensource.org/licenses/BSD-3-Clause */ -var base64VLQ = __webpack_require__(613); -var util = __webpack_require__(615); -var ArraySet = __webpack_require__(616).ArraySet; -var MappingList = __webpack_require__(617).MappingList; +var base64VLQ = __webpack_require__(612); +var util = __webpack_require__(614); +var ArraySet = __webpack_require__(615).ArraySet; +var MappingList = __webpack_require__(616).MappingList; /** * An instance of the SourceMapGenerator represents a source map which is @@ -68684,7 +68672,7 @@ exports.SourceMapGenerator = SourceMapGenerator; /***/ }), -/* 613 */ +/* 612 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -68724,7 +68712,7 @@ exports.SourceMapGenerator = SourceMapGenerator; * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -var base64 = __webpack_require__(614); +var base64 = __webpack_require__(613); // A single base 64 digit can contain 6 bits of data. For the base 64 variable // length quantities we use in the source map spec, the first bit is the sign, @@ -68830,7 +68818,7 @@ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { /***/ }), -/* 614 */ +/* 613 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -68903,7 +68891,7 @@ exports.decode = function (charCode) { /***/ }), -/* 615 */ +/* 614 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -69326,7 +69314,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate /***/ }), -/* 616 */ +/* 615 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -69336,7 +69324,7 @@ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflate * http://opensource.org/licenses/BSD-3-Clause */ -var util = __webpack_require__(615); +var util = __webpack_require__(614); var has = Object.prototype.hasOwnProperty; var hasNativeMap = typeof Map !== "undefined"; @@ -69453,7 +69441,7 @@ exports.ArraySet = ArraySet; /***/ }), -/* 617 */ +/* 616 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -69463,7 +69451,7 @@ exports.ArraySet = ArraySet; * http://opensource.org/licenses/BSD-3-Clause */ -var util = __webpack_require__(615); +var util = __webpack_require__(614); /** * Determine whether mappingB is after mappingA with respect to generated @@ -69538,7 +69526,7 @@ exports.MappingList = MappingList; /***/ }), -/* 618 */ +/* 617 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -69548,11 +69536,11 @@ exports.MappingList = MappingList; * http://opensource.org/licenses/BSD-3-Clause */ -var util = __webpack_require__(615); -var binarySearch = __webpack_require__(619); -var ArraySet = __webpack_require__(616).ArraySet; -var base64VLQ = __webpack_require__(613); -var quickSort = __webpack_require__(620).quickSort; +var util = __webpack_require__(614); +var binarySearch = __webpack_require__(618); +var ArraySet = __webpack_require__(615).ArraySet; +var base64VLQ = __webpack_require__(612); +var quickSort = __webpack_require__(619).quickSort; function SourceMapConsumer(aSourceMap) { var sourceMap = aSourceMap; @@ -70626,7 +70614,7 @@ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; /***/ }), -/* 619 */ +/* 618 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -70743,7 +70731,7 @@ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { /***/ }), -/* 620 */ +/* 619 */ /***/ (function(module, exports) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -70863,7 +70851,7 @@ exports.quickSort = function (ary, comparator) { /***/ }), -/* 621 */ +/* 620 */ /***/ (function(module, exports, __webpack_require__) { /* -*- Mode: js; js-indent-level: 2; -*- */ @@ -70873,8 +70861,8 @@ exports.quickSort = function (ary, comparator) { * http://opensource.org/licenses/BSD-3-Clause */ -var SourceMapGenerator = __webpack_require__(612).SourceMapGenerator; -var util = __webpack_require__(615); +var SourceMapGenerator = __webpack_require__(611).SourceMapGenerator; +var util = __webpack_require__(614); // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other // operating systems these days (capturing the result). @@ -71282,15 +71270,15 @@ exports.SourceNode = SourceNode; /***/ }), -/* 622 */ +/* 621 */ /***/ (function(module, exports, __webpack_require__) { -var sourceMappingURL = __webpack_require__(623) +var sourceMappingURL = __webpack_require__(622) -var resolveUrl = __webpack_require__(624) -var decodeUriComponent = __webpack_require__(625) -var urix = __webpack_require__(627) -var atob = __webpack_require__(628) +var resolveUrl = __webpack_require__(623) +var decodeUriComponent = __webpack_require__(624) +var urix = __webpack_require__(626) +var atob = __webpack_require__(627) @@ -71630,7 +71618,7 @@ module.exports = { /***/ }), -/* 623 */ +/* 622 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_RESULT__;// Copyright 2014 Simon Lydell @@ -71693,7 +71681,7 @@ void (function(root, factory) { /***/ }), -/* 624 */ +/* 623 */ /***/ (function(module, exports, __webpack_require__) { var url = __webpack_require__(200) @@ -71708,10 +71696,10 @@ module.exports = resolveUrl /***/ }), -/* 625 */ +/* 624 */ /***/ (function(module, exports, __webpack_require__) { -var decodeUriComponent = __webpack_require__(626) +var decodeUriComponent = __webpack_require__(625) function customDecodeUriComponent(string) { // `decodeUriComponent` turns `+` into ` `, but that's not wanted. @@ -71722,7 +71710,7 @@ module.exports = customDecodeUriComponent /***/ }), -/* 626 */ +/* 625 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71823,30 +71811,30 @@ module.exports = function (encodedURI) { /***/ }), -/* 627 */ +/* 626 */ /***/ (function(module, exports, __webpack_require__) { -// Copyright 2014 Simon Lydell -// X11 (β€œMIT”) Licensed. (See LICENSE.) - -var path = __webpack_require__(4) - -"use strict" - -function urix(aPath) { - if (path.sep === "\\") { - return aPath - .replace(/\\/g, "/") - .replace(/^[a-z]:\/?/i, "/") - } - return aPath -} - -module.exports = urix +// Copyright 2014 Simon Lydell +// X11 (β€œMIT”) Licensed. (See LICENSE.) + +var path = __webpack_require__(4) + +"use strict" + +function urix(aPath) { + if (path.sep === "\\") { + return aPath + .replace(/\\/g, "/") + .replace(/^[a-z]:\/?/i, "/") + } + return aPath +} + +module.exports = urix /***/ }), -/* 628 */ +/* 627 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71860,7 +71848,7 @@ module.exports = atob.atob = atob; /***/ }), -/* 629 */ +/* 628 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -71868,8 +71856,8 @@ module.exports = atob.atob = atob; var fs = __webpack_require__(134); var path = __webpack_require__(4); -var define = __webpack_require__(595); -var utils = __webpack_require__(610); +var define = __webpack_require__(594); +var utils = __webpack_require__(609); /** * Expose `mixin()`. @@ -72012,19 +72000,19 @@ exports.comment = function(node) { /***/ }), -/* 630 */ +/* 629 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var use = __webpack_require__(603); +var use = __webpack_require__(602); var util = __webpack_require__(112); -var Cache = __webpack_require__(631); -var define = __webpack_require__(595); -var debug = __webpack_require__(604)('snapdragon:parser'); -var Position = __webpack_require__(632); -var utils = __webpack_require__(610); +var Cache = __webpack_require__(630); +var define = __webpack_require__(594); +var debug = __webpack_require__(603)('snapdragon:parser'); +var Position = __webpack_require__(631); +var utils = __webpack_require__(609); /** * Create a new `Parser` with the given `input` and `options`. @@ -72552,7 +72540,7 @@ module.exports = Parser; /***/ }), -/* 631 */ +/* 630 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72659,13 +72647,13 @@ MapCache.prototype.del = function mapDelete(key) { /***/ }), -/* 632 */ +/* 631 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var define = __webpack_require__(595); +var define = __webpack_require__(594); /** * Store position for a node @@ -72680,14 +72668,14 @@ module.exports = function Position(start, parser) { /***/ }), -/* 633 */ +/* 632 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(634); -var assignSymbols = __webpack_require__(546); +var isExtendable = __webpack_require__(633); +var assignSymbols = __webpack_require__(545); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -72747,7 +72735,7 @@ function isEnum(obj, key) { /***/ }), -/* 634 */ +/* 633 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72760,7 +72748,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(545); +var isPlainObject = __webpack_require__(544); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -72768,14 +72756,14 @@ module.exports = function isExtendable(val) { /***/ }), -/* 635 */ +/* 634 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var nanomatch = __webpack_require__(636); -var extglob = __webpack_require__(648); +var nanomatch = __webpack_require__(635); +var extglob = __webpack_require__(647); module.exports = function(snapdragon) { var compilers = snapdragon.compiler.compilers; @@ -72852,7 +72840,7 @@ function escapeExtglobs(compiler) { /***/ }), -/* 636 */ +/* 635 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -72863,17 +72851,17 @@ function escapeExtglobs(compiler) { */ var util = __webpack_require__(112); -var toRegex = __webpack_require__(530); -var extend = __webpack_require__(637); +var toRegex = __webpack_require__(529); +var extend = __webpack_require__(636); /** * Local dependencies */ -var compilers = __webpack_require__(639); -var parsers = __webpack_require__(640); -var cache = __webpack_require__(641); -var utils = __webpack_require__(643); +var compilers = __webpack_require__(638); +var parsers = __webpack_require__(639); +var cache = __webpack_require__(640); +var utils = __webpack_require__(642); var MAX_LENGTH = 1024 * 64; /** @@ -73697,14 +73685,14 @@ module.exports = nanomatch; /***/ }), -/* 637 */ +/* 636 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var isExtendable = __webpack_require__(638); -var assignSymbols = __webpack_require__(546); +var isExtendable = __webpack_require__(637); +var assignSymbols = __webpack_require__(545); module.exports = Object.assign || function(obj/*, objects*/) { if (obj === null || typeof obj === 'undefined') { @@ -73764,7 +73752,7 @@ function isEnum(obj, key) { /***/ }), -/* 638 */ +/* 637 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -73777,7 +73765,7 @@ function isEnum(obj, key) { -var isPlainObject = __webpack_require__(545); +var isPlainObject = __webpack_require__(544); module.exports = function isExtendable(val) { return isPlainObject(val) || typeof val === 'function' || Array.isArray(val); @@ -73785,7 +73773,7 @@ module.exports = function isExtendable(val) { /***/ }), -/* 639 */ +/* 638 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74131,14 +74119,14 @@ module.exports = function(nanomatch, options) { /***/ }), -/* 640 */ +/* 639 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var regexNot = __webpack_require__(547); -var toRegex = __webpack_require__(530); +var regexNot = __webpack_require__(546); +var toRegex = __webpack_require__(529); /** * Characters to use in negation regex (we want to "not" match @@ -74524,14 +74512,14 @@ module.exports.not = NOT_REGEX; /***/ }), -/* 641 */ +/* 640 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = new (__webpack_require__(642))(); +module.exports = new (__webpack_require__(641))(); /***/ }), -/* 642 */ +/* 641 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74544,7 +74532,7 @@ module.exports = new (__webpack_require__(642))(); -var MapCache = __webpack_require__(631); +var MapCache = __webpack_require__(630); /** * Create a new `FragmentCache` with an optional object to use for `caches`. @@ -74666,7 +74654,7 @@ exports = module.exports = FragmentCache; /***/ }), -/* 643 */ +/* 642 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -74679,14 +74667,14 @@ var path = __webpack_require__(4); * Module dependencies */ -var isWindows = __webpack_require__(644)(); -var Snapdragon = __webpack_require__(569); -utils.define = __webpack_require__(645); -utils.diff = __webpack_require__(646); -utils.extend = __webpack_require__(637); -utils.pick = __webpack_require__(647); -utils.typeOf = __webpack_require__(540); -utils.unique = __webpack_require__(550); +var isWindows = __webpack_require__(643)(); +var Snapdragon = __webpack_require__(568); +utils.define = __webpack_require__(644); +utils.diff = __webpack_require__(645); +utils.extend = __webpack_require__(636); +utils.pick = __webpack_require__(646); +utils.typeOf = __webpack_require__(539); +utils.unique = __webpack_require__(549); /** * Returns true if the given value is effectively an empty string @@ -75052,7 +75040,7 @@ utils.unixify = function(options) { /***/ }), -/* 644 */ +/* 643 */ /***/ (function(module, exports, __webpack_require__) { var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*! @@ -75080,7 +75068,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ /***/ }), -/* 645 */ +/* 644 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75093,8 +75081,8 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_ -var isobject = __webpack_require__(538); -var isDescriptor = __webpack_require__(539); +var isobject = __webpack_require__(537); +var isDescriptor = __webpack_require__(538); var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) ? Reflect.defineProperty : Object.defineProperty; @@ -75125,7 +75113,7 @@ module.exports = function defineProperty(obj, key, val) { /***/ }), -/* 646 */ +/* 645 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75179,7 +75167,7 @@ function diffArray(one, two) { /***/ }), -/* 647 */ +/* 646 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75192,7 +75180,7 @@ function diffArray(one, two) { -var isObject = __webpack_require__(538); +var isObject = __webpack_require__(537); module.exports = function pick(obj, keys) { if (!isObject(obj) && typeof obj !== 'function') { @@ -75221,7 +75209,7 @@ module.exports = function pick(obj, keys) { /***/ }), -/* 648 */ +/* 647 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75231,18 +75219,18 @@ module.exports = function pick(obj, keys) { * Module dependencies */ -var extend = __webpack_require__(551); -var unique = __webpack_require__(550); -var toRegex = __webpack_require__(530); +var extend = __webpack_require__(550); +var unique = __webpack_require__(549); +var toRegex = __webpack_require__(529); /** * Local dependencies */ -var compilers = __webpack_require__(649); -var parsers = __webpack_require__(660); -var Extglob = __webpack_require__(663); -var utils = __webpack_require__(662); +var compilers = __webpack_require__(648); +var parsers = __webpack_require__(659); +var Extglob = __webpack_require__(662); +var utils = __webpack_require__(661); var MAX_LENGTH = 1024 * 64; /** @@ -75559,13 +75547,13 @@ module.exports = extglob; /***/ }), -/* 649 */ +/* 648 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var brackets = __webpack_require__(650); +var brackets = __webpack_require__(649); /** * Extglob compilers @@ -75735,7 +75723,7 @@ module.exports = function(extglob) { /***/ }), -/* 650 */ +/* 649 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -75745,17 +75733,17 @@ module.exports = function(extglob) { * Local dependencies */ -var compilers = __webpack_require__(651); -var parsers = __webpack_require__(653); +var compilers = __webpack_require__(650); +var parsers = __webpack_require__(652); /** * Module dependencies */ -var debug = __webpack_require__(655)('expand-brackets'); -var extend = __webpack_require__(551); -var Snapdragon = __webpack_require__(569); -var toRegex = __webpack_require__(530); +var debug = __webpack_require__(654)('expand-brackets'); +var extend = __webpack_require__(550); +var Snapdragon = __webpack_require__(568); +var toRegex = __webpack_require__(529); /** * Parses the given POSIX character class `pattern` and returns a @@ -75953,13 +75941,13 @@ module.exports = brackets; /***/ }), -/* 651 */ +/* 650 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var posix = __webpack_require__(652); +var posix = __webpack_require__(651); module.exports = function(brackets) { brackets.compiler @@ -76047,7 +76035,7 @@ module.exports = function(brackets) { /***/ }), -/* 652 */ +/* 651 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -76076,14 +76064,14 @@ module.exports = { /***/ }), -/* 653 */ +/* 652 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var utils = __webpack_require__(654); -var define = __webpack_require__(595); +var utils = __webpack_require__(653); +var define = __webpack_require__(594); /** * Text regex @@ -76302,14 +76290,14 @@ module.exports.TEXT_REGEX = TEXT_REGEX; /***/ }), -/* 654 */ +/* 653 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var toRegex = __webpack_require__(530); -var regexNot = __webpack_require__(547); +var toRegex = __webpack_require__(529); +var regexNot = __webpack_require__(546); var cached; /** @@ -76343,7 +76331,7 @@ exports.createRegex = function(pattern, include) { /***/ }), -/* 655 */ +/* 654 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76352,14 +76340,14 @@ exports.createRegex = function(pattern, include) { */ if (typeof process !== 'undefined' && process.type === 'renderer') { - module.exports = __webpack_require__(656); + module.exports = __webpack_require__(655); } else { - module.exports = __webpack_require__(659); + module.exports = __webpack_require__(658); } /***/ }), -/* 656 */ +/* 655 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76368,7 +76356,7 @@ if (typeof process !== 'undefined' && process.type === 'renderer') { * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(657); +exports = module.exports = __webpack_require__(656); exports.log = log; exports.formatArgs = formatArgs; exports.save = save; @@ -76550,7 +76538,7 @@ function localstorage() { /***/ }), -/* 657 */ +/* 656 */ /***/ (function(module, exports, __webpack_require__) { @@ -76566,7 +76554,7 @@ exports.coerce = coerce; exports.disable = disable; exports.enable = enable; exports.enabled = enabled; -exports.humanize = __webpack_require__(658); +exports.humanize = __webpack_require__(657); /** * The currently active debug mode names, and names to skip. @@ -76758,7 +76746,7 @@ function coerce(val) { /***/ }), -/* 658 */ +/* 657 */ /***/ (function(module, exports) { /** @@ -76916,7 +76904,7 @@ function plural(ms, n, name) { /***/ }), -/* 659 */ +/* 658 */ /***/ (function(module, exports, __webpack_require__) { /** @@ -76932,7 +76920,7 @@ var util = __webpack_require__(112); * Expose `debug()` as the module. */ -exports = module.exports = __webpack_require__(657); +exports = module.exports = __webpack_require__(656); exports.init = init; exports.log = log; exports.formatArgs = formatArgs; @@ -77111,7 +77099,7 @@ function createWritableStdioStream (fd) { case 'PIPE': case 'TCP': - var net = __webpack_require__(609); + var net = __webpack_require__(608); stream = new net.Socket({ fd: fd, readable: false, @@ -77170,15 +77158,15 @@ exports.enable(load()); /***/ }), -/* 660 */ +/* 659 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var brackets = __webpack_require__(650); -var define = __webpack_require__(661); -var utils = __webpack_require__(662); +var brackets = __webpack_require__(649); +var define = __webpack_require__(660); +var utils = __webpack_require__(661); /** * Characters to use in text regex (we want to "not" match @@ -77333,7 +77321,7 @@ module.exports = parsers; /***/ }), -/* 661 */ +/* 660 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77346,7 +77334,7 @@ module.exports = parsers; -var isDescriptor = __webpack_require__(539); +var isDescriptor = __webpack_require__(538); module.exports = function defineProperty(obj, prop, val) { if (typeof obj !== 'object' && typeof obj !== 'function') { @@ -77371,14 +77359,14 @@ module.exports = function defineProperty(obj, prop, val) { /***/ }), -/* 662 */ +/* 661 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var regex = __webpack_require__(547); -var Cache = __webpack_require__(642); +var regex = __webpack_require__(546); +var Cache = __webpack_require__(641); /** * Utils @@ -77447,7 +77435,7 @@ utils.createRegex = function(str) { /***/ }), -/* 663 */ +/* 662 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77457,16 +77445,16 @@ utils.createRegex = function(str) { * Module dependencies */ -var Snapdragon = __webpack_require__(569); -var define = __webpack_require__(661); -var extend = __webpack_require__(551); +var Snapdragon = __webpack_require__(568); +var define = __webpack_require__(660); +var extend = __webpack_require__(550); /** * Local dependencies */ -var compilers = __webpack_require__(649); -var parsers = __webpack_require__(660); +var compilers = __webpack_require__(648); +var parsers = __webpack_require__(659); /** * Customize Snapdragon parser and renderer @@ -77532,16 +77520,16 @@ module.exports = Extglob; /***/ }), -/* 664 */ +/* 663 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -var extglob = __webpack_require__(648); -var nanomatch = __webpack_require__(636); -var regexNot = __webpack_require__(547); -var toRegex = __webpack_require__(530); +var extglob = __webpack_require__(647); +var nanomatch = __webpack_require__(635); +var regexNot = __webpack_require__(546); +var toRegex = __webpack_require__(529); var not; /** @@ -77622,14 +77610,14 @@ function textRegex(pattern) { /***/ }), -/* 665 */ +/* 664 */ /***/ (function(module, exports, __webpack_require__) { -module.exports = new (__webpack_require__(642))(); +module.exports = new (__webpack_require__(641))(); /***/ }), -/* 666 */ +/* 665 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77642,13 +77630,13 @@ var path = __webpack_require__(4); * Module dependencies */ -var Snapdragon = __webpack_require__(569); -utils.define = __webpack_require__(667); -utils.diff = __webpack_require__(646); -utils.extend = __webpack_require__(633); -utils.pick = __webpack_require__(647); -utils.typeOf = __webpack_require__(540); -utils.unique = __webpack_require__(550); +var Snapdragon = __webpack_require__(568); +utils.define = __webpack_require__(666); +utils.diff = __webpack_require__(645); +utils.extend = __webpack_require__(632); +utils.pick = __webpack_require__(646); +utils.typeOf = __webpack_require__(539); +utils.unique = __webpack_require__(549); /** * Returns true if the platform is windows, or `path.sep` is `\\`. @@ -77945,7 +77933,7 @@ utils.unixify = function(options) { /***/ }), -/* 667 */ +/* 666 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -77958,8 +77946,8 @@ utils.unixify = function(options) { -var isobject = __webpack_require__(538); -var isDescriptor = __webpack_require__(539); +var isobject = __webpack_require__(537); +var isDescriptor = __webpack_require__(538); var define = (typeof Reflect !== 'undefined' && Reflect.defineProperty) ? Reflect.defineProperty : Object.defineProperty; @@ -77990,97 +77978,97 @@ module.exports = function defineProperty(obj, key, val) { /***/ }), -/* 668 */ +/* 667 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var readdir = __webpack_require__(669); -var reader_1 = __webpack_require__(682); -var fs_stream_1 = __webpack_require__(686); -var ReaderAsync = /** @class */ (function (_super) { - __extends(ReaderAsync, _super); - function ReaderAsync() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ReaderAsync.prototype, "fsAdapter", { - /** - * Returns FileSystem adapter. - */ - get: function () { - return new fs_stream_1.default(this.options); - }, - enumerable: true, - configurable: true - }); - /** - * Use async API to read entries for Task. - */ - ReaderAsync.prototype.read = function (task) { - var _this = this; - var root = this.getRootDirectory(task); - var options = this.getReaderOptions(task); - var entries = []; - return new Promise(function (resolve, reject) { - var stream = _this.api(root, task, options); - stream.on('error', function (err) { - _this.isEnoentCodeError(err) ? resolve([]) : reject(err); - stream.pause(); - }); - stream.on('data', function (entry) { return entries.push(_this.transform(entry)); }); - stream.on('end', function () { return resolve(entries); }); - }); - }; - /** - * Returns founded paths. - */ - ReaderAsync.prototype.api = function (root, task, options) { - if (task.dynamic) { - return this.dynamicApi(root, options); - } - return this.staticApi(task, options); - }; - /** - * Api for dynamic tasks. - */ - ReaderAsync.prototype.dynamicApi = function (root, options) { - return readdir.readdirStreamStat(root, options); - }; - /** - * Api for static tasks. - */ - ReaderAsync.prototype.staticApi = function (task, options) { - return this.fsAdapter.read(task.patterns, options.filter); - }; - return ReaderAsync; -}(reader_1.default)); -exports.default = ReaderAsync; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var readdir = __webpack_require__(668); +var reader_1 = __webpack_require__(681); +var fs_stream_1 = __webpack_require__(685); +var ReaderAsync = /** @class */ (function (_super) { + __extends(ReaderAsync, _super); + function ReaderAsync() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderAsync.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_stream_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use async API to read entries for Task. + */ + ReaderAsync.prototype.read = function (task) { + var _this = this; + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + var entries = []; + return new Promise(function (resolve, reject) { + var stream = _this.api(root, task, options); + stream.on('error', function (err) { + _this.isEnoentCodeError(err) ? resolve([]) : reject(err); + stream.pause(); + }); + stream.on('data', function (entry) { return entries.push(_this.transform(entry)); }); + stream.on('end', function () { return resolve(entries); }); + }); + }; + /** + * Returns founded paths. + */ + ReaderAsync.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderAsync.prototype.dynamicApi = function (root, options) { + return readdir.readdirStreamStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderAsync.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderAsync; +}(reader_1.default)); +exports.default = ReaderAsync; /***/ }), -/* 669 */ +/* 668 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const readdirSync = __webpack_require__(670); -const readdirAsync = __webpack_require__(678); -const readdirStream = __webpack_require__(681); +const readdirSync = __webpack_require__(669); +const readdirAsync = __webpack_require__(677); +const readdirStream = __webpack_require__(680); module.exports = exports = readdirAsyncPath; exports.readdir = exports.readdirAsync = exports.async = readdirAsyncPath; @@ -78164,7 +78152,7 @@ function readdirStreamStat (dir, options) { /***/ }), -/* 670 */ +/* 669 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78172,11 +78160,11 @@ function readdirStreamStat (dir, options) { module.exports = readdirSync; -const DirectoryReader = __webpack_require__(671); +const DirectoryReader = __webpack_require__(670); let syncFacade = { - fs: __webpack_require__(676), - forEach: __webpack_require__(677), + fs: __webpack_require__(675), + forEach: __webpack_require__(676), sync: true }; @@ -78205,7 +78193,7 @@ function readdirSync (dir, options, internalOptions) { /***/ }), -/* 671 */ +/* 670 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -78214,9 +78202,9 @@ function readdirSync (dir, options, internalOptions) { const Readable = __webpack_require__(138).Readable; const EventEmitter = __webpack_require__(156).EventEmitter; const path = __webpack_require__(4); -const normalizeOptions = __webpack_require__(672); -const stat = __webpack_require__(674); -const call = __webpack_require__(675); +const normalizeOptions = __webpack_require__(671); +const stat = __webpack_require__(673); +const call = __webpack_require__(674); /** * Asynchronously reads the contents of a directory and streams the results @@ -78592,14 +78580,14 @@ module.exports = DirectoryReader; /***/ }), -/* 672 */ +/* 671 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const globToRegExp = __webpack_require__(673); +const globToRegExp = __webpack_require__(672); module.exports = normalizeOptions; @@ -78776,7 +78764,7 @@ function normalizeOptions (options, internalOptions) { /***/ }), -/* 673 */ +/* 672 */ /***/ (function(module, exports) { module.exports = function (glob, opts) { @@ -78913,13 +78901,13 @@ module.exports = function (glob, opts) { /***/ }), -/* 674 */ +/* 673 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const call = __webpack_require__(675); +const call = __webpack_require__(674); module.exports = stat; @@ -78994,7 +78982,7 @@ function symlinkStat (fs, path, lstats, callback) { /***/ }), -/* 675 */ +/* 674 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79055,14 +79043,14 @@ function callOnce (fn) { /***/ }), -/* 676 */ +/* 675 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(134); -const call = __webpack_require__(675); +const call = __webpack_require__(674); /** * A facade around {@link fs.readdirSync} that allows it to be called @@ -79126,7 +79114,7 @@ exports.lstat = function (path, callback) { /***/ }), -/* 677 */ +/* 676 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79155,7 +79143,7 @@ function syncForEach (array, iterator, done) { /***/ }), -/* 678 */ +/* 677 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79163,12 +79151,12 @@ function syncForEach (array, iterator, done) { module.exports = readdirAsync; -const maybe = __webpack_require__(679); -const DirectoryReader = __webpack_require__(671); +const maybe = __webpack_require__(678); +const DirectoryReader = __webpack_require__(670); let asyncFacade = { fs: __webpack_require__(134), - forEach: __webpack_require__(680), + forEach: __webpack_require__(679), async: true }; @@ -79210,7 +79198,7 @@ function readdirAsync (dir, options, callback, internalOptions) { /***/ }), -/* 679 */ +/* 678 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79237,7 +79225,7 @@ module.exports = function maybe (cb, promise) { /***/ }), -/* 680 */ +/* 679 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79273,7 +79261,7 @@ function asyncForEach (array, iterator, done) { /***/ }), -/* 681 */ +/* 680 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79281,11 +79269,11 @@ function asyncForEach (array, iterator, done) { module.exports = readdirStream; -const DirectoryReader = __webpack_require__(671); +const DirectoryReader = __webpack_require__(670); let streamFacade = { fs: __webpack_require__(134), - forEach: __webpack_require__(680), + forEach: __webpack_require__(679), async: true }; @@ -79305,373 +79293,373 @@ function readdirStream (dir, options, internalOptions) { /***/ }), -/* 682 */ +/* 681 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -var deep_1 = __webpack_require__(683); -var entry_1 = __webpack_require__(685); -var pathUtil = __webpack_require__(684); -var Reader = /** @class */ (function () { - function Reader(options) { - this.options = options; - this.micromatchOptions = this.getMicromatchOptions(); - this.entryFilter = new entry_1.default(options, this.micromatchOptions); - this.deepFilter = new deep_1.default(options, this.micromatchOptions); - } - /** - * Returns root path to scanner. - */ - Reader.prototype.getRootDirectory = function (task) { - return path.resolve(this.options.cwd, task.base); - }; - /** - * Returns options for reader. - */ - Reader.prototype.getReaderOptions = function (task) { - return { - basePath: task.base === '.' ? '' : task.base, - filter: this.entryFilter.getFilter(task.positive, task.negative), - deep: this.deepFilter.getFilter(task.positive, task.negative), - sep: '/' - }; - }; - /** - * Returns options for micromatch. - */ - Reader.prototype.getMicromatchOptions = function () { - return { - dot: this.options.dot, - nobrace: !this.options.brace, - noglobstar: !this.options.globstar, - noext: !this.options.extension, - nocase: !this.options.case, - matchBase: this.options.matchBase - }; - }; - /** - * Returns transformed entry. - */ - Reader.prototype.transform = function (entry) { - if (this.options.absolute) { - entry.path = pathUtil.makeAbsolute(this.options.cwd, entry.path); - } - if (this.options.markDirectories && entry.isDirectory()) { - entry.path += '/'; - } - var item = this.options.stats ? entry : entry.path; - if (this.options.transform === null) { - return item; - } - return this.options.transform(item); - }; - /** - * Returns true if error has ENOENT code. - */ - Reader.prototype.isEnoentCodeError = function (err) { - return err.code === 'ENOENT'; - }; - return Reader; -}()); -exports.default = Reader; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +var deep_1 = __webpack_require__(682); +var entry_1 = __webpack_require__(684); +var pathUtil = __webpack_require__(683); +var Reader = /** @class */ (function () { + function Reader(options) { + this.options = options; + this.micromatchOptions = this.getMicromatchOptions(); + this.entryFilter = new entry_1.default(options, this.micromatchOptions); + this.deepFilter = new deep_1.default(options, this.micromatchOptions); + } + /** + * Returns root path to scanner. + */ + Reader.prototype.getRootDirectory = function (task) { + return path.resolve(this.options.cwd, task.base); + }; + /** + * Returns options for reader. + */ + Reader.prototype.getReaderOptions = function (task) { + return { + basePath: task.base === '.' ? '' : task.base, + filter: this.entryFilter.getFilter(task.positive, task.negative), + deep: this.deepFilter.getFilter(task.positive, task.negative), + sep: '/' + }; + }; + /** + * Returns options for micromatch. + */ + Reader.prototype.getMicromatchOptions = function () { + return { + dot: this.options.dot, + nobrace: !this.options.brace, + noglobstar: !this.options.globstar, + noext: !this.options.extension, + nocase: !this.options.case, + matchBase: this.options.matchBase + }; + }; + /** + * Returns transformed entry. + */ + Reader.prototype.transform = function (entry) { + if (this.options.absolute) { + entry.path = pathUtil.makeAbsolute(this.options.cwd, entry.path); + } + if (this.options.markDirectories && entry.isDirectory()) { + entry.path += '/'; + } + var item = this.options.stats ? entry : entry.path; + if (this.options.transform === null) { + return item; + } + return this.options.transform(item); + }; + /** + * Returns true if error has ENOENT code. + */ + Reader.prototype.isEnoentCodeError = function (err) { + return err.code === 'ENOENT'; + }; + return Reader; +}()); +exports.default = Reader; /***/ }), -/* 683 */ +/* 682 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var pathUtils = __webpack_require__(684); -var patternUtils = __webpack_require__(527); -var DeepFilter = /** @class */ (function () { - function DeepFilter(options, micromatchOptions) { - this.options = options; - this.micromatchOptions = micromatchOptions; - } - /** - * Returns filter for directories. - */ - DeepFilter.prototype.getFilter = function (positive, negative) { - var _this = this; - var maxPatternDepth = this.getMaxPatternDepth(positive); - var negativeRe = this.getNegativePatternsRe(negative); - return function (entry) { return _this.filter(entry, negativeRe, maxPatternDepth); }; - }; - /** - * Returns max depth of the provided patterns. - */ - DeepFilter.prototype.getMaxPatternDepth = function (patterns) { - var globstar = patterns.some(patternUtils.hasGlobStar); - return globstar ? Infinity : patternUtils.getMaxNaivePatternsDepth(patterns); - }; - /** - * Returns RegExp's for patterns that can affect the depth of reading. - */ - DeepFilter.prototype.getNegativePatternsRe = function (patterns) { - var affectDepthOfReadingPatterns = patterns.filter(patternUtils.isAffectDepthOfReadingPattern); - return patternUtils.convertPatternsToRe(affectDepthOfReadingPatterns, this.micromatchOptions); - }; - /** - * Returns Β«trueΒ» for directory that should be read. - */ - DeepFilter.prototype.filter = function (entry, negativeRe, maxPatternDepth) { - if (this.isSkippedByDeepOption(entry.depth)) { - return false; - } - if (this.isSkippedByMaxPatternDepth(entry.depth, maxPatternDepth)) { - return false; - } - if (this.isSkippedSymlinkedDirectory(entry)) { - return false; - } - if (this.isSkippedDotDirectory(entry)) { - return false; - } - return this.isSkippedByNegativePatterns(entry, negativeRe); - }; - /** - * Returns Β«trueΒ» when the Β«deepΒ» option is disabled or number and depth of the entry is greater that the option value. - */ - DeepFilter.prototype.isSkippedByDeepOption = function (entryDepth) { - return !this.options.deep || (typeof this.options.deep === 'number' && entryDepth >= this.options.deep); - }; - /** - * Returns Β«trueΒ» when depth parameter is not an Infinity and entry depth greater that the parameter value. - */ - DeepFilter.prototype.isSkippedByMaxPatternDepth = function (entryDepth, maxPatternDepth) { - return maxPatternDepth !== Infinity && entryDepth >= maxPatternDepth; - }; - /** - * Returns Β«trueΒ» for symlinked directory if the Β«followSymlinkedDirectoriesΒ» option is disabled. - */ - DeepFilter.prototype.isSkippedSymlinkedDirectory = function (entry) { - return !this.options.followSymlinkedDirectories && entry.isSymbolicLink(); - }; - /** - * Returns Β«trueΒ» for a directory whose name starts with a period if Β«dotΒ» option is disabled. - */ - DeepFilter.prototype.isSkippedDotDirectory = function (entry) { - return !this.options.dot && pathUtils.isDotDirectory(entry.path); - }; - /** - * Returns Β«trueΒ» for a directory whose path math to any negative pattern. - */ - DeepFilter.prototype.isSkippedByNegativePatterns = function (entry, negativeRe) { - return !patternUtils.matchAny(entry.path, negativeRe); - }; - return DeepFilter; -}()); -exports.default = DeepFilter; + +Object.defineProperty(exports, "__esModule", { value: true }); +var pathUtils = __webpack_require__(683); +var patternUtils = __webpack_require__(526); +var DeepFilter = /** @class */ (function () { + function DeepFilter(options, micromatchOptions) { + this.options = options; + this.micromatchOptions = micromatchOptions; + } + /** + * Returns filter for directories. + */ + DeepFilter.prototype.getFilter = function (positive, negative) { + var _this = this; + var maxPatternDepth = this.getMaxPatternDepth(positive); + var negativeRe = this.getNegativePatternsRe(negative); + return function (entry) { return _this.filter(entry, negativeRe, maxPatternDepth); }; + }; + /** + * Returns max depth of the provided patterns. + */ + DeepFilter.prototype.getMaxPatternDepth = function (patterns) { + var globstar = patterns.some(patternUtils.hasGlobStar); + return globstar ? Infinity : patternUtils.getMaxNaivePatternsDepth(patterns); + }; + /** + * Returns RegExp's for patterns that can affect the depth of reading. + */ + DeepFilter.prototype.getNegativePatternsRe = function (patterns) { + var affectDepthOfReadingPatterns = patterns.filter(patternUtils.isAffectDepthOfReadingPattern); + return patternUtils.convertPatternsToRe(affectDepthOfReadingPatterns, this.micromatchOptions); + }; + /** + * Returns Β«trueΒ» for directory that should be read. + */ + DeepFilter.prototype.filter = function (entry, negativeRe, maxPatternDepth) { + if (this.isSkippedByDeepOption(entry.depth)) { + return false; + } + if (this.isSkippedByMaxPatternDepth(entry.depth, maxPatternDepth)) { + return false; + } + if (this.isSkippedSymlinkedDirectory(entry)) { + return false; + } + if (this.isSkippedDotDirectory(entry)) { + return false; + } + return this.isSkippedByNegativePatterns(entry, negativeRe); + }; + /** + * Returns Β«trueΒ» when the Β«deepΒ» option is disabled or number and depth of the entry is greater that the option value. + */ + DeepFilter.prototype.isSkippedByDeepOption = function (entryDepth) { + return !this.options.deep || (typeof this.options.deep === 'number' && entryDepth >= this.options.deep); + }; + /** + * Returns Β«trueΒ» when depth parameter is not an Infinity and entry depth greater that the parameter value. + */ + DeepFilter.prototype.isSkippedByMaxPatternDepth = function (entryDepth, maxPatternDepth) { + return maxPatternDepth !== Infinity && entryDepth >= maxPatternDepth; + }; + /** + * Returns Β«trueΒ» for symlinked directory if the Β«followSymlinkedDirectoriesΒ» option is disabled. + */ + DeepFilter.prototype.isSkippedSymlinkedDirectory = function (entry) { + return !this.options.followSymlinkedDirectories && entry.isSymbolicLink(); + }; + /** + * Returns Β«trueΒ» for a directory whose name starts with a period if Β«dotΒ» option is disabled. + */ + DeepFilter.prototype.isSkippedDotDirectory = function (entry) { + return !this.options.dot && pathUtils.isDotDirectory(entry.path); + }; + /** + * Returns Β«trueΒ» for a directory whose path math to any negative pattern. + */ + DeepFilter.prototype.isSkippedByNegativePatterns = function (entry, negativeRe) { + return !patternUtils.matchAny(entry.path, negativeRe); + }; + return DeepFilter; +}()); +exports.default = DeepFilter; /***/ }), -/* 684 */ +/* 683 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -/** - * Returns Β«trueΒ» if the last partial of the path starting with a period. - */ -function isDotDirectory(filepath) { - return path.basename(filepath).startsWith('.'); -} -exports.isDotDirectory = isDotDirectory; -/** - * Convert a windows-like path to a unix-style path. - */ -function normalize(filepath) { - return filepath.replace(/\\/g, '/'); -} -exports.normalize = normalize; -/** - * Returns normalized absolute path of provided filepath. - */ -function makeAbsolute(cwd, filepath) { - return normalize(path.resolve(cwd, filepath)); -} -exports.makeAbsolute = makeAbsolute; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +/** + * Returns Β«trueΒ» if the last partial of the path starting with a period. + */ +function isDotDirectory(filepath) { + return path.basename(filepath).startsWith('.'); +} +exports.isDotDirectory = isDotDirectory; +/** + * Convert a windows-like path to a unix-style path. + */ +function normalize(filepath) { + return filepath.replace(/\\/g, '/'); +} +exports.normalize = normalize; +/** + * Returns normalized absolute path of provided filepath. + */ +function makeAbsolute(cwd, filepath) { + return normalize(path.resolve(cwd, filepath)); +} +exports.makeAbsolute = makeAbsolute; /***/ }), -/* 685 */ +/* 684 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var pathUtils = __webpack_require__(684); -var patternUtils = __webpack_require__(527); -var EntryFilter = /** @class */ (function () { - function EntryFilter(options, micromatchOptions) { - this.options = options; - this.micromatchOptions = micromatchOptions; - this.index = new Map(); - } - /** - * Returns filter for directories. - */ - EntryFilter.prototype.getFilter = function (positive, negative) { - var _this = this; - var positiveRe = patternUtils.convertPatternsToRe(positive, this.micromatchOptions); - var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); - return function (entry) { return _this.filter(entry, positiveRe, negativeRe); }; - }; - /** - * Returns true if entry must be added to result. - */ - EntryFilter.prototype.filter = function (entry, positiveRe, negativeRe) { - // Exclude duplicate results - if (this.options.unique) { - if (this.isDuplicateEntry(entry)) { - return false; - } - this.createIndexRecord(entry); - } - // Filter files and directories by options - if (this.onlyFileFilter(entry) || this.onlyDirectoryFilter(entry)) { - return false; - } - if (this.isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) { - return false; - } - return this.isMatchToPatterns(entry.path, positiveRe) && !this.isMatchToPatterns(entry.path, negativeRe); - }; - /** - * Return true if the entry already has in the cross reader index. - */ - EntryFilter.prototype.isDuplicateEntry = function (entry) { - return this.index.has(entry.path); - }; - /** - * Create record in the cross reader index. - */ - EntryFilter.prototype.createIndexRecord = function (entry) { - this.index.set(entry.path, undefined); - }; - /** - * Returns true for non-files if the Β«onlyFilesΒ» option is enabled. - */ - EntryFilter.prototype.onlyFileFilter = function (entry) { - return this.options.onlyFiles && !entry.isFile(); - }; - /** - * Returns true for non-directories if the Β«onlyDirectoriesΒ» option is enabled. - */ - EntryFilter.prototype.onlyDirectoryFilter = function (entry) { - return this.options.onlyDirectories && !entry.isDirectory(); - }; - /** - * Return true when `absolute` option is enabled and matched to the negative patterns. - */ - EntryFilter.prototype.isSkippedByAbsoluteNegativePatterns = function (entry, negativeRe) { - if (!this.options.absolute) { - return false; - } - var fullpath = pathUtils.makeAbsolute(this.options.cwd, entry.path); - return this.isMatchToPatterns(fullpath, negativeRe); - }; - /** - * Return true when entry match to provided patterns. - * - * First, just trying to apply patterns to the path. - * Second, trying to apply patterns to the path with final slash (need to micromatch to support Β«directory/**Β» patterns). - */ - EntryFilter.prototype.isMatchToPatterns = function (filepath, patternsRe) { - return patternUtils.matchAny(filepath, patternsRe) || patternUtils.matchAny(filepath + '/', patternsRe); - }; - return EntryFilter; -}()); -exports.default = EntryFilter; + +Object.defineProperty(exports, "__esModule", { value: true }); +var pathUtils = __webpack_require__(683); +var patternUtils = __webpack_require__(526); +var EntryFilter = /** @class */ (function () { + function EntryFilter(options, micromatchOptions) { + this.options = options; + this.micromatchOptions = micromatchOptions; + this.index = new Map(); + } + /** + * Returns filter for directories. + */ + EntryFilter.prototype.getFilter = function (positive, negative) { + var _this = this; + var positiveRe = patternUtils.convertPatternsToRe(positive, this.micromatchOptions); + var negativeRe = patternUtils.convertPatternsToRe(negative, this.micromatchOptions); + return function (entry) { return _this.filter(entry, positiveRe, negativeRe); }; + }; + /** + * Returns true if entry must be added to result. + */ + EntryFilter.prototype.filter = function (entry, positiveRe, negativeRe) { + // Exclude duplicate results + if (this.options.unique) { + if (this.isDuplicateEntry(entry)) { + return false; + } + this.createIndexRecord(entry); + } + // Filter files and directories by options + if (this.onlyFileFilter(entry) || this.onlyDirectoryFilter(entry)) { + return false; + } + if (this.isSkippedByAbsoluteNegativePatterns(entry, negativeRe)) { + return false; + } + return this.isMatchToPatterns(entry.path, positiveRe) && !this.isMatchToPatterns(entry.path, negativeRe); + }; + /** + * Return true if the entry already has in the cross reader index. + */ + EntryFilter.prototype.isDuplicateEntry = function (entry) { + return this.index.has(entry.path); + }; + /** + * Create record in the cross reader index. + */ + EntryFilter.prototype.createIndexRecord = function (entry) { + this.index.set(entry.path, undefined); + }; + /** + * Returns true for non-files if the Β«onlyFilesΒ» option is enabled. + */ + EntryFilter.prototype.onlyFileFilter = function (entry) { + return this.options.onlyFiles && !entry.isFile(); + }; + /** + * Returns true for non-directories if the Β«onlyDirectoriesΒ» option is enabled. + */ + EntryFilter.prototype.onlyDirectoryFilter = function (entry) { + return this.options.onlyDirectories && !entry.isDirectory(); + }; + /** + * Return true when `absolute` option is enabled and matched to the negative patterns. + */ + EntryFilter.prototype.isSkippedByAbsoluteNegativePatterns = function (entry, negativeRe) { + if (!this.options.absolute) { + return false; + } + var fullpath = pathUtils.makeAbsolute(this.options.cwd, entry.path); + return this.isMatchToPatterns(fullpath, negativeRe); + }; + /** + * Return true when entry match to provided patterns. + * + * First, just trying to apply patterns to the path. + * Second, trying to apply patterns to the path with final slash (need to micromatch to support Β«directory/**Β» patterns). + */ + EntryFilter.prototype.isMatchToPatterns = function (filepath, patternsRe) { + return patternUtils.matchAny(filepath, patternsRe) || patternUtils.matchAny(filepath + '/', patternsRe); + }; + return EntryFilter; +}()); +exports.default = EntryFilter; /***/ }), -/* 686 */ +/* 685 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var stream = __webpack_require__(138); -var fsStat = __webpack_require__(687); -var fs_1 = __webpack_require__(691); -var FileSystemStream = /** @class */ (function (_super) { - __extends(FileSystemStream, _super); - function FileSystemStream() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Use stream API to read entries for Task. - */ - FileSystemStream.prototype.read = function (patterns, filter) { - var _this = this; - var filepaths = patterns.map(this.getFullEntryPath, this); - var transform = new stream.Transform({ objectMode: true }); - transform._transform = function (index, _enc, done) { - return _this.getEntry(filepaths[index], patterns[index]).then(function (entry) { - if (entry !== null && filter(entry)) { - transform.push(entry); - } - if (index === filepaths.length - 1) { - transform.end(); - } - done(); - }); - }; - for (var i = 0; i < filepaths.length; i++) { - transform.write(i); - } - return transform; - }; - /** - * Return entry for the provided path. - */ - FileSystemStream.prototype.getEntry = function (filepath, pattern) { - var _this = this; - return this.getStat(filepath) - .then(function (stat) { return _this.makeEntry(stat, pattern); }) - .catch(function () { return null; }); - }; - /** - * Return fs.Stats for the provided path. - */ - FileSystemStream.prototype.getStat = function (filepath) { - return fsStat.stat(filepath, { throwErrorOnBrokenSymlinks: false }); - }; - return FileSystemStream; -}(fs_1.default)); -exports.default = FileSystemStream; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var stream = __webpack_require__(138); +var fsStat = __webpack_require__(686); +var fs_1 = __webpack_require__(690); +var FileSystemStream = /** @class */ (function (_super) { + __extends(FileSystemStream, _super); + function FileSystemStream() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Use stream API to read entries for Task. + */ + FileSystemStream.prototype.read = function (patterns, filter) { + var _this = this; + var filepaths = patterns.map(this.getFullEntryPath, this); + var transform = new stream.Transform({ objectMode: true }); + transform._transform = function (index, _enc, done) { + return _this.getEntry(filepaths[index], patterns[index]).then(function (entry) { + if (entry !== null && filter(entry)) { + transform.push(entry); + } + if (index === filepaths.length - 1) { + transform.end(); + } + done(); + }); + }; + for (var i = 0; i < filepaths.length; i++) { + transform.write(i); + } + return transform; + }; + /** + * Return entry for the provided path. + */ + FileSystemStream.prototype.getEntry = function (filepath, pattern) { + var _this = this; + return this.getStat(filepath) + .then(function (stat) { return _this.makeEntry(stat, pattern); }) + .catch(function () { return null; }); + }; + /** + * Return fs.Stats for the provided path. + */ + FileSystemStream.prototype.getStat = function (filepath) { + return fsStat.stat(filepath, { throwErrorOnBrokenSymlinks: false }); + }; + return FileSystemStream; +}(fs_1.default)); +exports.default = FileSystemStream; /***/ }), -/* 687 */ +/* 686 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const optionsManager = __webpack_require__(688); -const statProvider = __webpack_require__(690); +const optionsManager = __webpack_require__(687); +const statProvider = __webpack_require__(689); /** * Asynchronous API. */ @@ -79702,13 +79690,13 @@ exports.statSync = statSync; /***/ }), -/* 688 */ +/* 687 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -const fsAdapter = __webpack_require__(689); +const fsAdapter = __webpack_require__(688); function prepare(opts) { const options = Object.assign({ fs: fsAdapter.getFileSystemAdapter(opts ? opts.fs : undefined), @@ -79721,7 +79709,7 @@ exports.prepare = prepare; /***/ }), -/* 689 */ +/* 688 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79744,7 +79732,7 @@ exports.getFileSystemAdapter = getFileSystemAdapter; /***/ }), -/* 690 */ +/* 689 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -79796,318 +79784,318 @@ exports.isFollowedSymlink = isFollowedSymlink; /***/ }), -/* 691 */ +/* 690 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var path = __webpack_require__(4); -var FileSystem = /** @class */ (function () { - function FileSystem(options) { - this.options = options; - } - /** - * Return full path to entry. - */ - FileSystem.prototype.getFullEntryPath = function (filepath) { - return path.resolve(this.options.cwd, filepath); - }; - /** - * Return an implementation of the Entry interface. - */ - FileSystem.prototype.makeEntry = function (stat, pattern) { - stat.path = pattern; - stat.depth = pattern.split('/').length; - return stat; - }; - return FileSystem; -}()); -exports.default = FileSystem; + +Object.defineProperty(exports, "__esModule", { value: true }); +var path = __webpack_require__(4); +var FileSystem = /** @class */ (function () { + function FileSystem(options) { + this.options = options; + } + /** + * Return full path to entry. + */ + FileSystem.prototype.getFullEntryPath = function (filepath) { + return path.resolve(this.options.cwd, filepath); + }; + /** + * Return an implementation of the Entry interface. + */ + FileSystem.prototype.makeEntry = function (stat, pattern) { + stat.path = pattern; + stat.depth = pattern.split('/').length; + return stat; + }; + return FileSystem; +}()); +exports.default = FileSystem; /***/ }), -/* 692 */ +/* 691 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var stream = __webpack_require__(138); -var readdir = __webpack_require__(669); -var reader_1 = __webpack_require__(682); -var fs_stream_1 = __webpack_require__(686); -var TransformStream = /** @class */ (function (_super) { - __extends(TransformStream, _super); - function TransformStream(reader) { - var _this = _super.call(this, { objectMode: true }) || this; - _this.reader = reader; - return _this; - } - TransformStream.prototype._transform = function (entry, _encoding, callback) { - callback(null, this.reader.transform(entry)); - }; - return TransformStream; -}(stream.Transform)); -var ReaderStream = /** @class */ (function (_super) { - __extends(ReaderStream, _super); - function ReaderStream() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ReaderStream.prototype, "fsAdapter", { - /** - * Returns FileSystem adapter. - */ - get: function () { - return new fs_stream_1.default(this.options); - }, - enumerable: true, - configurable: true - }); - /** - * Use stream API to read entries for Task. - */ - ReaderStream.prototype.read = function (task) { - var _this = this; - var root = this.getRootDirectory(task); - var options = this.getReaderOptions(task); - var transform = new TransformStream(this); - var readable = this.api(root, task, options); - return readable - .on('error', function (err) { return _this.isEnoentCodeError(err) ? null : transform.emit('error', err); }) - .pipe(transform); - }; - /** - * Returns founded paths. - */ - ReaderStream.prototype.api = function (root, task, options) { - if (task.dynamic) { - return this.dynamicApi(root, options); - } - return this.staticApi(task, options); - }; - /** - * Api for dynamic tasks. - */ - ReaderStream.prototype.dynamicApi = function (root, options) { - return readdir.readdirStreamStat(root, options); - }; - /** - * Api for static tasks. - */ - ReaderStream.prototype.staticApi = function (task, options) { - return this.fsAdapter.read(task.patterns, options.filter); - }; - return ReaderStream; -}(reader_1.default)); -exports.default = ReaderStream; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var stream = __webpack_require__(138); +var readdir = __webpack_require__(668); +var reader_1 = __webpack_require__(681); +var fs_stream_1 = __webpack_require__(685); +var TransformStream = /** @class */ (function (_super) { + __extends(TransformStream, _super); + function TransformStream(reader) { + var _this = _super.call(this, { objectMode: true }) || this; + _this.reader = reader; + return _this; + } + TransformStream.prototype._transform = function (entry, _encoding, callback) { + callback(null, this.reader.transform(entry)); + }; + return TransformStream; +}(stream.Transform)); +var ReaderStream = /** @class */ (function (_super) { + __extends(ReaderStream, _super); + function ReaderStream() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderStream.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_stream_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use stream API to read entries for Task. + */ + ReaderStream.prototype.read = function (task) { + var _this = this; + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + var transform = new TransformStream(this); + var readable = this.api(root, task, options); + return readable + .on('error', function (err) { return _this.isEnoentCodeError(err) ? null : transform.emit('error', err); }) + .pipe(transform); + }; + /** + * Returns founded paths. + */ + ReaderStream.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderStream.prototype.dynamicApi = function (root, options) { + return readdir.readdirStreamStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderStream.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderStream; +}(reader_1.default)); +exports.default = ReaderStream; /***/ }), -/* 693 */ +/* 692 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var readdir = __webpack_require__(669); -var reader_1 = __webpack_require__(682); -var fs_sync_1 = __webpack_require__(694); -var ReaderSync = /** @class */ (function (_super) { - __extends(ReaderSync, _super); - function ReaderSync() { - return _super !== null && _super.apply(this, arguments) || this; - } - Object.defineProperty(ReaderSync.prototype, "fsAdapter", { - /** - * Returns FileSystem adapter. - */ - get: function () { - return new fs_sync_1.default(this.options); - }, - enumerable: true, - configurable: true - }); - /** - * Use sync API to read entries for Task. - */ - ReaderSync.prototype.read = function (task) { - var root = this.getRootDirectory(task); - var options = this.getReaderOptions(task); - try { - var entries = this.api(root, task, options); - return entries.map(this.transform, this); - } - catch (err) { - if (this.isEnoentCodeError(err)) { - return []; - } - throw err; - } - }; - /** - * Returns founded paths. - */ - ReaderSync.prototype.api = function (root, task, options) { - if (task.dynamic) { - return this.dynamicApi(root, options); - } - return this.staticApi(task, options); - }; - /** - * Api for dynamic tasks. - */ - ReaderSync.prototype.dynamicApi = function (root, options) { - return readdir.readdirSyncStat(root, options); - }; - /** - * Api for static tasks. - */ - ReaderSync.prototype.staticApi = function (task, options) { - return this.fsAdapter.read(task.patterns, options.filter); - }; - return ReaderSync; -}(reader_1.default)); -exports.default = ReaderSync; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var readdir = __webpack_require__(668); +var reader_1 = __webpack_require__(681); +var fs_sync_1 = __webpack_require__(693); +var ReaderSync = /** @class */ (function (_super) { + __extends(ReaderSync, _super); + function ReaderSync() { + return _super !== null && _super.apply(this, arguments) || this; + } + Object.defineProperty(ReaderSync.prototype, "fsAdapter", { + /** + * Returns FileSystem adapter. + */ + get: function () { + return new fs_sync_1.default(this.options); + }, + enumerable: true, + configurable: true + }); + /** + * Use sync API to read entries for Task. + */ + ReaderSync.prototype.read = function (task) { + var root = this.getRootDirectory(task); + var options = this.getReaderOptions(task); + try { + var entries = this.api(root, task, options); + return entries.map(this.transform, this); + } + catch (err) { + if (this.isEnoentCodeError(err)) { + return []; + } + throw err; + } + }; + /** + * Returns founded paths. + */ + ReaderSync.prototype.api = function (root, task, options) { + if (task.dynamic) { + return this.dynamicApi(root, options); + } + return this.staticApi(task, options); + }; + /** + * Api for dynamic tasks. + */ + ReaderSync.prototype.dynamicApi = function (root, options) { + return readdir.readdirSyncStat(root, options); + }; + /** + * Api for static tasks. + */ + ReaderSync.prototype.staticApi = function (task, options) { + return this.fsAdapter.read(task.patterns, options.filter); + }; + return ReaderSync; +}(reader_1.default)); +exports.default = ReaderSync; /***/ }), -/* 694 */ +/* 693 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -var __extends = (this && this.__extends) || (function () { - var extendStatics = function (d, b) { - extendStatics = Object.setPrototypeOf || - ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || - function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; - return extendStatics(d, b); - }; - return function (d, b) { - extendStatics(d, b); - function __() { this.constructor = d; } - d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -var fsStat = __webpack_require__(687); -var fs_1 = __webpack_require__(691); -var FileSystemSync = /** @class */ (function (_super) { - __extends(FileSystemSync, _super); - function FileSystemSync() { - return _super !== null && _super.apply(this, arguments) || this; - } - /** - * Use sync API to read entries for Task. - */ - FileSystemSync.prototype.read = function (patterns, filter) { - var _this = this; - var entries = []; - patterns.forEach(function (pattern) { - var filepath = _this.getFullEntryPath(pattern); - var entry = _this.getEntry(filepath, pattern); - if (entry === null || !filter(entry)) { - return; - } - entries.push(entry); - }); - return entries; - }; - /** - * Return entry for the provided path. - */ - FileSystemSync.prototype.getEntry = function (filepath, pattern) { - try { - var stat = this.getStat(filepath); - return this.makeEntry(stat, pattern); - } - catch (err) { - return null; - } - }; - /** - * Return fs.Stats for the provided path. - */ - FileSystemSync.prototype.getStat = function (filepath) { - return fsStat.statSync(filepath, { throwErrorOnBrokenSymlinks: false }); - }; - return FileSystemSync; -}(fs_1.default)); -exports.default = FileSystemSync; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var fsStat = __webpack_require__(686); +var fs_1 = __webpack_require__(690); +var FileSystemSync = /** @class */ (function (_super) { + __extends(FileSystemSync, _super); + function FileSystemSync() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * Use sync API to read entries for Task. + */ + FileSystemSync.prototype.read = function (patterns, filter) { + var _this = this; + var entries = []; + patterns.forEach(function (pattern) { + var filepath = _this.getFullEntryPath(pattern); + var entry = _this.getEntry(filepath, pattern); + if (entry === null || !filter(entry)) { + return; + } + entries.push(entry); + }); + return entries; + }; + /** + * Return entry for the provided path. + */ + FileSystemSync.prototype.getEntry = function (filepath, pattern) { + try { + var stat = this.getStat(filepath); + return this.makeEntry(stat, pattern); + } + catch (err) { + return null; + } + }; + /** + * Return fs.Stats for the provided path. + */ + FileSystemSync.prototype.getStat = function (filepath) { + return fsStat.statSync(filepath, { throwErrorOnBrokenSymlinks: false }); + }; + return FileSystemSync; +}(fs_1.default)); +exports.default = FileSystemSync; /***/ }), -/* 695 */ +/* 694 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -/** - * Flatten nested arrays (max depth is 2) into a non-nested array of non-array items. - */ -function flatten(items) { - return items.reduce(function (collection, item) { return [].concat(collection, item); }, []); -} -exports.flatten = flatten; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Flatten nested arrays (max depth is 2) into a non-nested array of non-array items. + */ +function flatten(items) { + return items.reduce(function (collection, item) { return [].concat(collection, item); }, []); +} +exports.flatten = flatten; /***/ }), -/* 696 */ +/* 695 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -var merge2 = __webpack_require__(300); -/** - * Merge multiple streams and propagate their errors into one stream in parallel. - */ -function merge(streams) { - var mergedStream = merge2(streams); - streams.forEach(function (stream) { - stream.on('error', function (err) { return mergedStream.emit('error', err); }); - }); - return mergedStream; -} -exports.merge = merge; + +Object.defineProperty(exports, "__esModule", { value: true }); +var merge2 = __webpack_require__(300); +/** + * Merge multiple streams and propagate their errors into one stream in parallel. + */ +function merge(streams) { + var mergedStream = merge2(streams); + streams.forEach(function (stream) { + stream.on('error', function (err) { return mergedStream.emit('error', err); }); + }); + return mergedStream; +} +exports.merge = merge; /***/ }), -/* 697 */ +/* 696 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); -const pathType = __webpack_require__(698); +const pathType = __webpack_require__(697); const getExtensions = extensions => extensions.length > 1 ? `{${extensions.join(',')}}` : extensions[0]; @@ -80173,13 +80161,13 @@ module.exports.sync = (input, opts) => { /***/ }), -/* 698 */ +/* 697 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(134); -const pify = __webpack_require__(699); +const pify = __webpack_require__(698); function type(fn, fn2, fp) { if (typeof fp !== 'string') { @@ -80222,7 +80210,7 @@ exports.symlinkSync = typeSync.bind(null, 'lstatSync', 'isSymbolicLink'); /***/ }), -/* 699 */ +/* 698 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80313,17 +80301,17 @@ module.exports = (obj, opts) => { /***/ }), -/* 700 */ +/* 699 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const fs = __webpack_require__(134); const path = __webpack_require__(4); -const fastGlob = __webpack_require__(523); -const gitIgnore = __webpack_require__(701); +const fastGlob = __webpack_require__(522); +const gitIgnore = __webpack_require__(700); const pify = __webpack_require__(233); -const slash = __webpack_require__(702); +const slash = __webpack_require__(701); const DEFAULT_IGNORE = [ '**/node_modules/**', @@ -80421,7 +80409,7 @@ module.exports.sync = options => { /***/ }), -/* 701 */ +/* 700 */ /***/ (function(module, exports) { // A simple implementation of make-array @@ -80890,7 +80878,7 @@ module.exports = options => new IgnoreBase(options) /***/ }), -/* 702 */ +/* 701 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80908,7 +80896,7 @@ module.exports = input => { /***/ }), -/* 703 */ +/* 702 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -80921,7 +80909,7 @@ module.exports = input => { -var isGlob = __webpack_require__(704); +var isGlob = __webpack_require__(703); module.exports = function hasGlob(val) { if (val == null) return false; @@ -80941,7 +80929,7 @@ module.exports = function hasGlob(val) { /***/ }), -/* 704 */ +/* 703 */ /***/ (function(module, exports, __webpack_require__) { /*! @@ -80972,17 +80960,17 @@ module.exports = function isGlob(str) { /***/ }), -/* 705 */ +/* 704 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const path = __webpack_require__(4); const {constants: fsConstants} = __webpack_require__(134); -const pEvent = __webpack_require__(706); -const CpFileError = __webpack_require__(709); -const fs = __webpack_require__(711); -const ProgressEmitter = __webpack_require__(714); +const pEvent = __webpack_require__(705); +const CpFileError = __webpack_require__(708); +const fs = __webpack_require__(710); +const ProgressEmitter = __webpack_require__(713); const cpFileAsync = async (source, destination, options, progressEmitter) => { let readError; @@ -81096,12 +81084,12 @@ module.exports.sync = (source, destination, options) => { /***/ }), -/* 706 */ +/* 705 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pTimeout = __webpack_require__(707); +const pTimeout = __webpack_require__(706); const symbolAsyncIterator = Symbol.asyncIterator || '@@asyncIterator'; @@ -81394,13 +81382,13 @@ module.exports.TimeoutError = pTimeout.TimeoutError; /***/ }), -/* 707 */ +/* 706 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pFinally = __webpack_require__(708); +const pFinally = __webpack_require__(707); class TimeoutError extends Error { constructor(message) { @@ -81458,7 +81446,7 @@ module.exports.TimeoutError = TimeoutError; /***/ }), -/* 708 */ +/* 707 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81480,12 +81468,12 @@ module.exports = (promise, onFinally) => { /***/ }), -/* 709 */ +/* 708 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const NestedError = __webpack_require__(710); +const NestedError = __webpack_require__(709); class CpFileError extends NestedError { constructor(message, nested) { @@ -81499,7 +81487,7 @@ module.exports = CpFileError; /***/ }), -/* 710 */ +/* 709 */ /***/ (function(module, exports, __webpack_require__) { var inherits = __webpack_require__(112).inherits; @@ -81555,16 +81543,16 @@ module.exports = NestedError; /***/ }), -/* 711 */ +/* 710 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; const {promisify} = __webpack_require__(112); const fs = __webpack_require__(133); -const makeDir = __webpack_require__(712); -const pEvent = __webpack_require__(706); -const CpFileError = __webpack_require__(709); +const makeDir = __webpack_require__(711); +const pEvent = __webpack_require__(705); +const CpFileError = __webpack_require__(708); const stat = promisify(fs.stat); const lstat = promisify(fs.lstat); @@ -81661,7 +81649,7 @@ exports.copyFileSync = (source, destination, flags) => { /***/ }), -/* 712 */ +/* 711 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -81669,7 +81657,7 @@ exports.copyFileSync = (source, destination, flags) => { const fs = __webpack_require__(134); const path = __webpack_require__(4); const {promisify} = __webpack_require__(112); -const semver = __webpack_require__(713); +const semver = __webpack_require__(712); const useNativeRecursiveOption = semver.satisfies(process.version, '>=10.12.0'); @@ -81824,7 +81812,7 @@ module.exports.sync = (input, options) => { /***/ }), -/* 713 */ +/* 712 */ /***/ (function(module, exports) { exports = module.exports = SemVer @@ -83426,7 +83414,7 @@ function coerce (version, options) { /***/ }), -/* 714 */ +/* 713 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83467,7 +83455,7 @@ module.exports = ProgressEmitter; /***/ }), -/* 715 */ +/* 714 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83513,12 +83501,12 @@ exports.default = module.exports; /***/ }), -/* 716 */ +/* 715 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const pMap = __webpack_require__(717); +const pMap = __webpack_require__(716); const pFilter = async (iterable, filterer, options) => { const values = await pMap( @@ -83535,7 +83523,7 @@ module.exports.default = pFilter; /***/ }), -/* 717 */ +/* 716 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -83614,12 +83602,12 @@ module.exports.default = pMap; /***/ }), -/* 718 */ +/* 717 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -const NestedError = __webpack_require__(710); +const NestedError = __webpack_require__(709); class CpyError extends NestedError { constructor(message, nested) { diff --git a/packages/osd-pm/package.json b/packages/osd-pm/package.json index 74261eb778e0..5f50dc858b13 100644 --- a/packages/osd-pm/package.json +++ b/packages/osd-pm/package.json @@ -18,6 +18,7 @@ "@babel/plugin-proposal-object-rest-spread": "^7.16.5", "@babel/preset-env": "^7.16.5", "@babel/preset-typescript": "^7.16.5", + "@node-rs/xxhash": "^1.3.0", "@types/cmd-shim": "^2.0.0", "@types/cpy": "^5.1.0", "@types/dedent": "^0.7.0", @@ -28,7 +29,7 @@ "@types/lodash": "^4.14.170", "@types/log-symbols": "^2.0.0", "@types/ncp": "^2.0.1", - "@types/node": "^14.17.32", + "@types/node": "~18.7.0", "@types/ora": "^1.3.5", "@types/read-pkg": "^4.0.0", "@types/strip-ansi": "^5.2.1", @@ -46,7 +47,7 @@ "execa": "^4.0.2", "getopts": "^2.2.5", "glob": "^7.1.7", - "globby": "^8.0.1", + "globby": "^11.1.0", "has-ansi": "^3.0.0", "is-path-inside": "^3.0.2", "lodash": "^4.17.21", @@ -62,7 +63,7 @@ "tempy": "^0.3.0", "typescript": "4.0.2", "unlazy-loader": "^0.1.3", - "webpack": "^4.41.5", + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2", "webpack-cli": "^4.9.2", "write-pkg": "^4.0.0" }, diff --git a/packages/osd-pm/src/utils/fs.ts b/packages/osd-pm/src/utils/fs.ts index c29aacb2a901..cf9b1f3a8542 100644 --- a/packages/osd-pm/src/utils/fs.ts +++ b/packages/osd-pm/src/utils/fs.ts @@ -30,19 +30,15 @@ import cmdShimCb from 'cmd-shim'; import fs from 'fs'; +import { lstat, symlink, mkdir, unlink } from 'fs/promises'; import { ncp } from 'ncp'; import { dirname, relative } from 'path'; import { promisify } from 'util'; -const lstat = promisify(fs.lstat); -export const readFile = promisify(fs.readFile); -export const writeFile = promisify(fs.writeFile); -const symlink = promisify(fs.symlink); -export const chmod = promisify(fs.chmod); +export { readFile, writeFile, chmod, unlink } from 'fs/promises'; + const cmdShim = promisify(cmdShimCb); -const mkdir = promisify(fs.mkdir); export const mkdirp = async (path: string) => await mkdir(path, { recursive: true }); -export const unlink = promisify(fs.unlink); export const copyDirectory = promisify(ncp); async function statTest(path: string, block: (stats: fs.Stats) => boolean) { diff --git a/packages/osd-pm/src/utils/project_checksums.ts b/packages/osd-pm/src/utils/project_checksums.ts index e7d928ce3f73..e60590ee91ee 100644 --- a/packages/osd-pm/src/utils/project_checksums.ts +++ b/packages/osd-pm/src/utils/project_checksums.ts @@ -28,11 +28,9 @@ * under the License. */ -import Fs from 'fs'; +import { stat } from 'fs/promises'; import Crypto from 'crypto'; -import { promisify } from 'util'; - import execa from 'execa'; import { YarnLock, resolveDepsForProject } from './yarn_lock'; @@ -45,7 +43,6 @@ export type ChecksumMap = Map; /** map of [repo relative path to changed file, type of change] */ type Changes = Map; -const statAsync = promisify(Fs.stat); const projectBySpecificitySorter = (a: Project, b: Project) => b.path.length - a.path.length; /** Get the changed files for a set of projects */ @@ -184,7 +181,7 @@ async function getChecksum( return `${path}:deleted`; } - const stats = await statAsync(osd.getAbsolute(path)); + const stats = await stat(osd.getAbsolute(path)); log.verbose(`[${project.name}] modified time ${stats.mtimeMs} for ${path}`); return `${path}:${stats.mtimeMs}`; }) diff --git a/packages/osd-pm/webpack.config.js b/packages/osd-pm/webpack.config.js index 66b9e0a81ee4..fd8cdcbfde27 100644 --- a/packages/osd-pm/webpack.config.js +++ b/packages/osd-pm/webpack.config.js @@ -41,6 +41,7 @@ module.exports = { path: path.resolve(__dirname, 'dist'), filename: '[name].js', libraryTarget: 'commonjs2', + hashFunction: 'Xxh64', }, resolve: { diff --git a/packages/osd-test/package.json b/packages/osd-test/package.json index 69fa50828fc0..c1ee4f1687cd 100644 --- a/packages/osd-test/package.json +++ b/packages/osd-test/package.json @@ -31,7 +31,7 @@ "exit-hook": "^2.2.0", "getopts": "^2.2.5", "glob": "^7.1.7", - "joi": "^13.5.2", + "joi": "^14.3.1", "lodash": "^4.17.21", "parse-link-header": "^2.0.0", "rxjs": "^6.5.5", diff --git a/packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts b/packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts index cc628b9de811..9ba16ca6407c 100644 --- a/packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts +++ b/packages/osd-test/src/functional_test_runner/lib/suite_tracker.test.ts @@ -31,7 +31,19 @@ import fs from 'fs'; import { join, resolve } from 'path'; -jest.mock('fs'); +jest.mock('fs', () => { + const mockedFs: object = jest.createMockFromModule('fs'); + const realFs = jest.requireActual('fs'); + + return { + __esModules: true, + ...mockedFs, + // Both needed by @osd/cross-platform + realpathSync: realFs.realpathSync, + readFileSync: realFs.readFileSync, + }; +}); + jest.mock('@osd/utils', () => { return { REPO_ROOT: '/dev/null/root' }; }); diff --git a/packages/osd-ui-framework/Gruntfile.js b/packages/osd-ui-framework/Gruntfile.js index b52e1430f56e..9ad26b578e08 100644 --- a/packages/osd-ui-framework/Gruntfile.js +++ b/packages/osd-ui-framework/Gruntfile.js @@ -28,7 +28,7 @@ * under the License. */ -const sass = require('sass'); +const sass = require('node-sass'); const postcss = require('postcss'); const postcssConfig = require('@osd/optimizer/postcss.config.js'); diff --git a/packages/osd-ui-framework/package.json b/packages/osd-ui-framework/package.json index 3ebc09f4a8ad..ffd624757392 100644 --- a/packages/osd-ui-framework/package.json +++ b/packages/osd-ui-framework/package.json @@ -30,7 +30,7 @@ "grunt-babel": "^8.0.0", "grunt-contrib-clean": "^2.0.0", "grunt-contrib-copy": "^1.0.0", - "sass": "~1.26.11", + "node-sass": "^8.0.0", "postcss": "^8.4.5", "sinon": "^7.4.2" } diff --git a/packages/osd-ui-shared-deps/package.json b/packages/osd-ui-shared-deps/package.json index 61f7008fbc0f..a4924657cb1e 100644 --- a/packages/osd-ui-shared-deps/package.json +++ b/packages/osd-ui-shared-deps/package.json @@ -17,7 +17,7 @@ "abortcontroller-polyfill": "^1.4.0", "angular": "^1.8.2", "axios": "^0.27.2", - "compression-webpack-plugin": "^4.0.0", + "compression-webpack-plugin": "npm:@amoo-miki/compression-webpack-plugin@4.0.1-rc.1", "core-js": "^3.6.5", "custom-event-polyfill": "^0.3.0", "jquery": "^3.5.0", @@ -38,6 +38,7 @@ "whatwg-fetch": "^3.0.0" }, "devDependencies": { + "@node-rs/xxhash": "^1.3.0", "@osd/babel-preset": "1.0.0", "@osd/dev-utils": "1.0.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.24", @@ -45,6 +46,6 @@ "del": "^6.1.1", "loader-utils": "^2.0.4", "val-loader": "^2.1.2", - "webpack": "^4.41.5" + "webpack": "npm:@amoo-miki/webpack@4.46.0-rc.2" } } diff --git a/packages/osd-ui-shared-deps/webpack.config.js b/packages/osd-ui-shared-deps/webpack.config.js index 5cd48010215d..397fbe12cd4b 100644 --- a/packages/osd-ui-shared-deps/webpack.config.js +++ b/packages/osd-ui-shared-deps/webpack.config.js @@ -57,6 +57,7 @@ exports.getWebpackConfig = ({ dev = false } = {}) => ({ devtoolModuleFilenameTemplate: (info) => `osd-ui-shared-deps/${Path.relative(REPO_ROOT, info.absoluteResourcePath)}`, library: '__osdSharedDeps__', + hashFunction: 'Xxh64', }, module: { diff --git a/release-notes/opensearch-dashboards.release-notes-1.3.10.md b/release-notes/opensearch-dashboards.release-notes-1.3.10.md new file mode 100644 index 000000000000..be08d46aac93 --- /dev/null +++ b/release-notes/opensearch-dashboards.release-notes-1.3.10.md @@ -0,0 +1,33 @@ +# Version 1.3.10 Release Notes + +### πŸ›‘ Security + +- [CVE-2020-15366][1.x] Bump ajv from 4.11.8 to 6.12.6 ([#4035](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4035)) +- [CVE-2022-48285][1.x] Bump jszip from 3.7.1 to 3.10.1 ([#4011](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4011)) +- [CVE-2021-35065][1.x] Bump glob-parent from 6.0.0 to 6.0.2 ([#4005](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4005)) +- [CVE-2022-25851][1.x] Bump jpeg-js from 0.4.1 to 0.4.4 ([#3860](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3860)) +- [CVE-2022-25858][1.x] Bump terser from 4.8.0 to 4.8.1 ([#3786](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3786)) +- [CVE-2021-23490][1.x] Bump parse-link-header from 1.0.1 to 2.0.0 ([#3820](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3820)) +- [CVE-2021-3765][1.x] Bump validator from 8.2.0 to 13.9.0 ([#3753](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3753)) +- [CVE-2022-25758][1.x] Bump scss-tokenizer from 0.3.0 to 0.4.3 ([#3789](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3789)) +- [CVE-2021-3803][1.x] Bump nth-check from 1.0.2 to 2.0.1 ([#3745](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3745)) +- Bump highlight.js from 9.18.5 to 10.7.3 to solve security concerns ([#4062](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4062)) + +### πŸ“ˆ Features/Enhancements + +- Add tooltip to help icon ([#3872](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3872)) + +### πŸ› Bug Fixes + +- [TSVB] Fix the link to "serial differencing aggregation" documentation ([#3503](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3503)) + +### πŸ“ Documentation + +- Update jest documentation links ([#3939](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3939)) + +### πŸ›  Maintenance + +- Add threshold to code coverage changes for project ([#4050](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/4050)) +- Temporarily hardcode chromedriver to 112.0.0 to enable all ftr tests ([#4039]()) +- Update MAINTAINERS.md and CODEOWNERS ([#3938](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3938)) +- Add opensearch-dashboards-docker-dev to .gitignore ([#3781](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3781)) diff --git a/release-notes/opensearch-dashboards.release-notes-2.7.0.md b/release-notes/opensearch-dashboards.release-notes-2.7.0.md index 3ad55fe4d807..60eda3832436 100644 --- a/release-notes/opensearch-dashboards.release-notes-2.7.0.md +++ b/release-notes/opensearch-dashboards.release-notes-2.7.0.md @@ -76,7 +76,6 @@ ### πŸͺ› Refactoring - Remove automatic addition of `osd-version` header to requests outside of OpenSearch Dashboards ([#3643](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3643)) -- [Console] Replace jQuery usage in console plugin with native methods ([#3733](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3733)) - [Doc Links] Clean up docs_link_service organization so that strings are in the right categories. ([#3685](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3685)) - [I18n] Fix Listr type errors and error handlers ([#3629](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3629)) - [Multiple DataSource] Refactor dev tool console to use opensearch-js client to send requests ([#3544](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/3544)) diff --git a/scripts/bwc/opensearch_dashboards_service.sh b/scripts/bwc/opensearch_dashboards_service.sh index 79f1c56708b4..784fbcaa594b 100755 --- a/scripts/bwc/opensearch_dashboards_service.sh +++ b/scripts/bwc/opensearch_dashboards_service.sh @@ -29,4 +29,4 @@ function check_dashboards_status { cd "$DIR" check_status $DASHBOARDS_PATH "$DASHBOARDS_MSG" $DASHBOARDS_URL "$OPENSEARCH_ARGS" >> /dev/null 2>&1 echo "OpenSearch Dashboards is up!" -} +} diff --git a/scripts/bwc/utils.sh b/scripts/bwc/utils.sh index fea47b14759a..c6a4ef739307 100755 --- a/scripts/bwc/utils.sh +++ b/scripts/bwc/utils.sh @@ -9,11 +9,12 @@ function open_artifact() { artifact_dir=$1 artifact=$2 cd $artifact_dir - + # check if artifact provided is URL or attempt if passing by absolute path if curl -I -L $artifact; then curl -L $artifact | tar -xz --strip-components=1 else + echo "Artifact is not a URL; attempting to unarchive a local file..." tar -xf $artifact --strip-components=1 fi } @@ -45,14 +46,25 @@ function print_txt() { } # this function is used to check the running status of OpenSearch or OpenSearch Dashboards -# $1 is the path to the tmp file which saves the running status +# $1 is the path to the tmp file which saves the running status # $2 is the error msg to check # $3 is the url to curl # $4 contains arguments that need to be passed to the curl command function check_status() { - while [ ! -f $1 ] || ! grep -q "$2" $1; do - if [ -f $1 ]; then rm $1; fi - curl $3 $4 > $1 || true + # Calculate end time as 180s from now + check_status_end_time=$(expr 180 + "$(date '+%s')") + + rm -rf $1 + + while [ ! -f $1 ] || ! grep -q "$2" $1; do + if [ -f $1 ]; then rm $1; fi + curl $3 $4 > $1 || true + + # Stop checking after $check_status_end_time + if [ $check_status_end_time -lt $(date '+%s') ]; then + echo "Error: Status check has timed out" + exit 1 + fi done rm $1 } @@ -62,7 +74,7 @@ function check_status() { function upload_data() { rm -rf "$OPENSEARCH_DIR/data" cd $OPENSEARCH_DIR - cp "$CWD/cypress/test-data/$DASHBOARDS_TYPE/$1.tar.gz" . + cp "$CWD/cypress/test-data/$DASHBOARDS_TYPE/$1.tar.gz" . tar -xvf "$OPENSEARCH_DIR/$1.tar.gz" >> /dev/null 2>&1 rm "$1.tar.gz" echo "Data has been uploaded and ready to test" @@ -75,6 +87,6 @@ function get_dashboards_package_version() { | awk -F: '{ print $2 }' \ | sed 's/[",]//g' \ | tr -d [:space:]) - + echo "$DASHBOARDS_PACKAGE_VERSION" } diff --git a/scripts/jest.js b/scripts/jest.js index 53c687e51a84..80f269c72498 100755 --- a/scripts/jest.js +++ b/scripts/jest.js @@ -38,7 +38,7 @@ // // node scripts/jest --coverage // -// See all cli options in https://facebook.github.io/jest/docs/cli.html +// See all cli options in https://jestjs.io/docs/cli var resolve = require('path').resolve; process.argv.push('--config', resolve(__dirname, '../src/dev/jest/config.js')); diff --git a/scripts/jest_integration.js b/scripts/jest_integration.js index f5bc937c4d79..e0614aef7a11 100755 --- a/scripts/jest_integration.js +++ b/scripts/jest_integration.js @@ -38,7 +38,12 @@ // // node scripts/jest_integration --coverage // -// See all cli options in https://facebook.github.io/jest/docs/cli.html +// See all cli options in https://jestjs.io/docs/cli + +/* Increase the max listeners + * Numerous listeners are added by `root.start()` that are never removed. + */ +process.setMaxListeners(Infinity); var resolve = require('path').resolve; process.argv.push('--config', resolve(__dirname, '../src/dev/jest/config.integration.js')); diff --git a/scripts/use_node b/scripts/use_node index f39a39434db1..48e7e2858200 100755 --- a/scripts/use_node +++ b/scripts/use_node @@ -57,11 +57,17 @@ elif [ ! -z "$NODE_HOME" ]; then NODE_ERROR_MSG="in NODE_HOME" NODE_ERROR_SHOW=true else + # Set these variables outside, as catchalls, to show meaningful errors if needed NODE="$OSD_HOME/node/bin/node" NODE_ERROR_MSG="bundled with OpenSearch Dashboards" # A bin folder at the root is only present in release builds that have a bundled Node.js binary - if [ -x "OSD_HOME/bin" ]; then + if [ -d "${OSD_HOME}/bin" ]; then NODE_ERROR_SHOW=true + # Not all operating systems can run the latest Node.js and the fallback is for them + "${NODE}" -v 2> /dev/null + if [ $? -ne 0 ] && [ -d "${OSD_HOME}/node/fallback" ]; then + NODE="$OSD_HOME/node/fallback/bin/node" + fi fi fi @@ -75,7 +81,7 @@ else fi if [ ! -x "$NODE" ]; then - # Irrespective of NODE_ERROR_SHOW, show the error + # Irrespective of NODE_ERROR_SHOW, if NODE is not found or executable, show the error echo "Could not find a Node.js runtime binary $NODE_ERROR_MSG or on the system" >&2 exit 1 fi @@ -91,7 +97,7 @@ fi # If a file path was provided for execution, prefix with OSD_HOME; use relative paths to avoid the need for this. if [ ! -z "$OSD_USE_NODE_JS_FILE_PATH" ]; then - NODE_OPTIONS="$OSD_NODE_OPTS_PREFIX $OSD_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${OSD_HOME}${OSD_USE_NODE_JS_FILE_PATH}" "${@}" + NODE_OPTIONS="$OSD_NODE_OPTS_PREFIX $OSD_NODE_OPTS $NODE_OPTIONS" exec "${NODE}" "${OSD_HOME}${OSD_USE_NODE_JS_FILE_PATH}" "${@}" elif [ $# -ne 0 ]; then - NODE_OPTIONS="$OSD_NODE_OPTS_PREFIX $OSD_NODE_OPTS $NODE_OPTIONS" "${NODE}" "${@}" + NODE_OPTIONS="$OSD_NODE_OPTS_PREFIX $OSD_NODE_OPTS $NODE_OPTIONS" exec "${NODE}" "${@}" fi diff --git a/src/cli/cluster/cluster_manager.test.ts b/src/cli/cluster/cluster_manager.test.ts index 350d863c9892..7c83d9194501 100644 --- a/src/cli/cluster/cluster_manager.test.ts +++ b/src/cli/cluster/cluster_manager.test.ts @@ -31,6 +31,7 @@ import * as Rx from 'rxjs'; import { mockCluster } from './cluster_manager.test.mocks'; +import '@osd/optimizer/target/__mocks__/lmdb'; jest.mock('readline', () => ({ createInterface: jest.fn(() => ({ diff --git a/src/cli/serve/integration_tests/invalid_config.test.ts b/src/cli/serve/integration_tests/invalid_config.test.ts index 87ffd37d038e..4fe27ccd39ef 100644 --- a/src/cli/serve/integration_tests/invalid_config.test.ts +++ b/src/cli/serve/integration_tests/invalid_config.test.ts @@ -64,7 +64,7 @@ describe('cli invalid config support', function () { .split('\n') .filter(Boolean) .map((line) => JSON.parse(line) as LogEntry) - .filter((line) => line.tags.includes('fatal')) + .filter((line) => line.tags?.includes?.('fatal')) .map((obj) => ({ ...obj, pid: '## PID ##', diff --git a/src/cli/serve/integration_tests/reload_logging_config.test.ts b/src/cli/serve/integration_tests/reload_logging_config.test.ts index fb3c63ffc71d..5950cb1fdfb0 100644 --- a/src/cli/serve/integration_tests/reload_logging_config.test.ts +++ b/src/cli/serve/integration_tests/reload_logging_config.test.ts @@ -36,7 +36,7 @@ import Del from 'del'; import * as Rx from 'rxjs'; import { map, filter, take } from 'rxjs/operators'; -import { safeDump } from 'js-yaml'; +import { dump } from 'js-yaml'; import { getConfigFromFiles } from '@osd/config'; const legacyConfig = follow('__fixtures__/reload_logging_config/opensearch_dashboards.test.yml'); @@ -89,7 +89,7 @@ function createConfigManager(configPath: string) { return { modify(fn: (input: Record) => Record) { const oldContent = getConfigFromFiles([configPath]); - const yaml = safeDump(fn(oldContent)); + const yaml = dump(fn(oldContent)); Fs.writeFileSync(configPath, yaml); }, }; diff --git a/src/cli_plugin/install/cleanup.js b/src/cli_plugin/install/cleanup.js index b23b28fc5295..c93cad047f6d 100644 --- a/src/cli_plugin/install/cleanup.js +++ b/src/cli_plugin/install/cleanup.js @@ -28,33 +28,29 @@ * under the License. */ -import del from 'del'; -import fs from 'fs'; +import { rm, access } from 'fs/promises'; +import { rmSync, constants } from 'fs'; -export function cleanPrevious(settings, logger) { - return new Promise(function (resolve, reject) { - try { - fs.statSync(settings.workingPath); - - logger.log('Found previous install attempt. Deleting...'); - try { - del.sync(settings.workingPath, { force: true }); - } catch (e) { - reject(e); - } - resolve(); - } catch (e) { - if (e.code !== 'ENOENT') reject(e); +const exists = async (loc) => { + try { + await access(loc, constants.W_OK); + return true; + } catch (e) { + if (e.code !== 'ENOENT') throw e; + } +}; +export const cleanPrevious = async (settings, logger) => { + const workingPathExists = await exists(settings.workingPath); - resolve(); - } - }); -} + if (workingPathExists) { + logger.log('Found previous install attempt. Deleting...'); + return await rm(settings.workingPath, { recursive: true }); + } +}; export function cleanArtifacts(settings) { - // delete the working directory. - // At this point we're bailing, so swallow any errors on delete. + // Delete the working directory; at this point we're bailing, so swallow any errors on delete. try { - del.sync(settings.workingPath); + rmSync(settings.workingPath, { recursive: true, force: true }); } catch (e) {} // eslint-disable-line no-empty } diff --git a/src/cli_plugin/install/cleanup.test.js b/src/cli_plugin/install/cleanup.test.js index f05d69d1621b..f1453d0ff129 100644 --- a/src/cli_plugin/install/cleanup.test.js +++ b/src/cli_plugin/install/cleanup.test.js @@ -28,9 +28,11 @@ * under the License. */ -import sinon from 'sinon'; -import fs from 'fs'; -import del from 'del'; +import fs from 'fs/promises'; +import { rmSync } from 'fs'; + +jest.mock('fs'); +jest.mock('fs/promises'); import { cleanPrevious, cleanArtifacts } from './cleanup'; import { Logger } from '../lib/logger'; @@ -41,105 +43,116 @@ describe('opensearchDashboards cli', function () { const settings = { workingPath: 'dummy', }; + const logger = new Logger(settings); describe('cleanPrevious', function () { - let errorStub; - let logger; - - beforeEach(function () { - errorStub = sinon.stub(); - logger = new Logger(settings); - sinon.stub(logger, 'log'); - sinon.stub(logger, 'error'); - }); - afterEach(function () { - logger.log.restore(); - logger.error.restore(); - fs.statSync.restore(); - del.sync.restore(); + jest.resetAllMocks(); }); - it('should resolve if the working path does not exist', function () { - sinon.stub(del, 'sync'); - sinon.stub(fs, 'statSync').callsFake(() => { - const error = new Error('ENOENT'); - error.code = 'ENOENT'; - throw error; + it('should resolve if the working path does not exist', async () => { + fs.access.mockImplementation(() => { + const notFoundError = new Error('ENOENT'); + notFoundError.code = 'ENOENT'; + throw notFoundError; }); - return cleanPrevious(settings, logger) - .catch(errorStub) - .then(function () { - expect(errorStub.called).toBe(false); - }); + const exceptionCatcher = jest.fn(); + + try { + await cleanPrevious(settings, logger); + } catch (e) { + exceptionCatcher(); + } + + expect(fs.rm).not.toHaveBeenCalled(); + expect(exceptionCatcher).not.toHaveBeenCalled(); }); - it('should rethrow any exception except ENOENT from fs.statSync', function () { - sinon.stub(del, 'sync'); - sinon.stub(fs, 'statSync').throws(new Error('An Unhandled Error')); + it('should rethrow any exceptions from accessing the folders except ENOENT', async () => { + fs.access.mockImplementation(() => { + const noAccessError = new Error('EACCES'); + noAccessError.code = 'EACCES'; + throw noAccessError; + }); + + const exceptionCatcher = jest.fn(); - errorStub = sinon.stub(); - return cleanPrevious(settings, logger) - .catch(errorStub) - .then(function () { - expect(errorStub.called).toBe(true); - }); + try { + await cleanPrevious(settings, logger); + } catch (e) { + exceptionCatcher(); + } + + expect(fs.rm).not.toHaveBeenCalled(); + expect(exceptionCatcher).toHaveBeenCalled(); }); - it('should log a message if there was a working directory', function () { - sinon.stub(del, 'sync'); - sinon.stub(fs, 'statSync'); - - return cleanPrevious(settings, logger) - .catch(errorStub) - .then(function () { - expect(logger.log.calledWith('Found previous install attempt. Deleting...')).toBe( - true - ); - }); + it('should log a message if there was a working directory', async () => { + jest.spyOn(logger, 'log'); + const exceptionCatcher = jest.fn(); + + try { + await cleanPrevious(settings, logger); + } catch (e) { + exceptionCatcher(); + } + + expect(logger.log).toHaveBeenCalledWith('Found previous install attempt. Deleting...'); + expect(fs.rm).toHaveBeenCalled(); + expect(exceptionCatcher).not.toHaveBeenCalled(); }); - it('should rethrow any exception from del.sync', function () { - sinon.stub(fs, 'statSync'); - sinon.stub(del, 'sync').throws(new Error('I am an error thrown by del')); + it('should rethrow any exception from deleting the folder', async () => { + fs.rm.mockImplementation(() => { + const dummyError = new Error('EDUMMY'); + dummyError.code = 'EDUMMY'; + throw dummyError; + }); + + const exceptionCatcher = jest.fn(); - errorStub = sinon.stub(); - return cleanPrevious(settings, logger) - .catch(errorStub) - .then(function () { - expect(errorStub.called).toBe(true); - }); + try { + await cleanPrevious(settings, logger); + } catch (e) { + exceptionCatcher(); + } + + expect(fs.rm).toHaveBeenCalled(); + expect(exceptionCatcher).toHaveBeenCalled(); }); - it('should resolve if the working path is deleted', function () { - sinon.stub(del, 'sync'); - sinon.stub(fs, 'statSync'); + it('should resolve if the working path is deleted', async () => { + const exceptionCatcher = jest.fn(); + + try { + await cleanPrevious(settings, logger); + } catch (e) { + exceptionCatcher(); + } - return cleanPrevious(settings, logger) - .catch(errorStub) - .then(function () { - expect(errorStub.called).toBe(false); - }); + expect(fs.rm).toHaveBeenCalled(); + expect(exceptionCatcher).not.toHaveBeenCalled(); }); }); describe('cleanArtifacts', function () { - beforeEach(function () {}); - afterEach(function () { - del.sync.restore(); + jest.resetAllMocks(); }); - it('should attempt to delete the working directory', function () { - sinon.stub(del, 'sync'); - + it('should attempt to delete the working directory', () => { cleanArtifacts(settings); - expect(del.sync.calledWith(settings.workingPath)).toBe(true); + + expect(rmSync).toHaveBeenCalledWith(settings.workingPath, expect.anything()); }); - it('should swallow any errors thrown by del.sync', function () { - sinon.stub(del, 'sync').throws(new Error('Something bad happened.')); + it('should swallow any errors thrown by del.sync', () => { + rmSync.mockImplementation(() => { + const dummyError = new Error('EDUMMY'); + dummyError.code = 'EDUMMY'; + throw dummyError; + }); expect(() => cleanArtifacts(settings)).not.toThrow(); }); diff --git a/src/core/public/chrome/chrome_service.test.ts b/src/core/public/chrome/chrome_service.test.ts index 6ef1f30605a3..b8635f5a070f 100644 --- a/src/core/public/chrome/chrome_service.test.ts +++ b/src/core/public/chrome/chrome_service.test.ts @@ -50,6 +50,9 @@ class FakeApp implements App { const store = new Map(); const originalLocalStorage = window.localStorage; +// @ts-expect-error to allow redeclaring a readonly prop +delete window.localStorage; + (window as any).localStorage = { setItem: (key: string, value: string) => store.set(String(key), String(value)), getItem: (key: string) => store.get(String(key)), diff --git a/src/core/public/chrome/recently_accessed/recently_accessed_service.test.ts b/src/core/public/chrome/recently_accessed/recently_accessed_service.test.ts index 1a0772174af1..7046d5efc236 100644 --- a/src/core/public/chrome/recently_accessed/recently_accessed_service.test.ts +++ b/src/core/public/chrome/recently_accessed/recently_accessed_service.test.ts @@ -66,6 +66,9 @@ describe('RecentlyAccessed#start()', () => { let originalLocalStorage: Storage; beforeAll(() => { originalLocalStorage = window.localStorage; + + // @ts-expect-error to allow redeclaring a readonly prop + delete window.localStorage; // @ts-expect-error window.localStorage = new LocalStorageMock(); }); diff --git a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap index 6486e207ed37..4c2beb329a98 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header.test.tsx.snap @@ -5415,14 +5415,10 @@ exports[`Header handles visibility and lock changes 1`] = ` aria-label="Help menu" onClick={[Function]} > - } @@ -5474,9 +5470,6 @@ exports[`Header handles visibility and lock changes 1`] = ` > - @@ -5519,21 +5512,12 @@ exports[`Header handles visibility and lock changes 1`] = ` > - - - @@ -10674,14 +10658,10 @@ exports[`Header renders condensed header 1`] = ` aria-label="Help menu" onClick={[Function]} > - } @@ -10733,9 +10713,6 @@ exports[`Header renders condensed header 1`] = ` > - @@ -10778,21 +10755,12 @@ exports[`Header renders condensed header 1`] = ` > - - - diff --git a/src/core/public/chrome/ui/header/__snapshots__/header_help_menu.test.tsx.snap b/src/core/public/chrome/ui/header/__snapshots__/header_help_menu.test.tsx.snap index 5406fbf6abaa..036e2b4ee0ce 100644 --- a/src/core/public/chrome/ui/header/__snapshots__/header_help_menu.test.tsx.snap +++ b/src/core/public/chrome/ui/header/__snapshots__/header_help_menu.test.tsx.snap @@ -1622,14 +1622,10 @@ exports[`Header help menu hides survey link 1`] = ` aria-label="Help menu" onClick={[Function]} > - } @@ -1681,9 +1677,6 @@ exports[`Header help menu hides survey link 1`] = ` > - @@ -1726,21 +1719,12 @@ exports[`Header help menu hides survey link 1`] = ` > - - - @@ -3798,14 +3782,10 @@ exports[`Header help menu renders survey link 1`] = ` aria-label="Help menu" onClick={[Function]} > - } @@ -3857,9 +3837,6 @@ exports[`Header help menu renders survey link 1`] = ` > - @@ -3902,21 +3879,12 @@ exports[`Header help menu renders survey link 1`] = ` > - - - diff --git a/src/core/public/chrome/ui/header/header_help_menu.tsx b/src/core/public/chrome/ui/header/header_help_menu.tsx index f0be769937f5..0eba4c0c2673 100644 --- a/src/core/public/chrome/ui/header/header_help_menu.tsx +++ b/src/core/public/chrome/ui/header/header_help_menu.tsx @@ -330,9 +330,8 @@ class HeaderHelpMenuUI extends Component { })} onClick={this.onMenuButtonClick} > - { + private _isMounted: boolean = false; + constructor(props: StatusAppProps) { super(props); this.state = { @@ -68,15 +70,25 @@ export class StatusApp extends Component { } async componentDidMount() { + this._isMounted = true; const { http, notifications } = this.props; try { const data = await loadStatus({ http, notifications }); + + if (!this._isMounted) return; + this.setState({ loading: false, fetchError: false, data }); } catch (e) { + if (!this._isMounted) return; + this.setState({ fetchError: true, loading: false, data: null }); } } + componentWillUnmount() { + this._isMounted = false; + } + render() { const { loading, fetchError, data } = this.state; diff --git a/src/core/public/doc_links/doc_links_service.ts b/src/core/public/doc_links/doc_links_service.ts index 2faf70d54e82..7dd8c6561ade 100644 --- a/src/core/public/doc_links/doc_links_service.ts +++ b/src/core/public/doc_links/doc_links_service.ts @@ -421,7 +421,6 @@ export class DocLinksService { visualize: { // https://opensearch.org/docs/latest/dashboards/visualize/viz-index/ guide: `${OPENSEARCH_WEBSITE_DOCS}visualize/viz-index/`, - timelineDeprecation: `${OPENSEARCH_WEBSITE_DOCS}`, }, }, noDocumentation: { @@ -571,7 +570,6 @@ export class DocLinksService { reIndex: { rethrottle: `${OPENSEARCH_WEBSITE_DOCS}`, }, - timelineDeprecation: `${OPENSEARCH_WEBSITE_DOCS}`, apmServer: `${OPENSEARCH_WEBSITE_DOCS}`, tutorial: { loadDataTutorial: `${OPENSEARCH_WEBSITE_DOCS}`, @@ -919,7 +917,6 @@ export interface DocLinksStart { readonly reIndex: { readonly rethrottle: string; }; - readonly timelineDeprecation: string; readonly apmServer: string; readonly tutorial: { readonly loadDataTutorial: string; diff --git a/src/core/public/rendering/_base.scss b/src/core/public/rendering/_base.scss index e59008f08259..1333e48f6ca5 100644 --- a/src/core/public/rendering/_base.scss +++ b/src/core/public/rendering/_base.scss @@ -5,7 +5,6 @@ */ // SASSTODO: Naming here is too embedded and high up that changing them could cause major breaks #opensearch-dashboards-body { - overflow-x: hidden; min-height: 100%; } diff --git a/src/core/public/rendering/app_containers.test.tsx b/src/core/public/rendering/app_containers.test.tsx index fd43c79514c1..157253f5f757 100644 --- a/src/core/public/rendering/app_containers.test.tsx +++ b/src/core/public/rendering/app_containers.test.tsx @@ -43,6 +43,7 @@ describe('AppWrapper', () => { expect(component.getDOMNode()).toMatchInlineSnapshot(`
app-content
@@ -53,6 +54,7 @@ describe('AppWrapper', () => { expect(component.getDOMNode()).toMatchInlineSnapshot(`
app-content
@@ -63,6 +65,7 @@ describe('AppWrapper', () => { expect(component.getDOMNode()).toMatchInlineSnapshot(`
app-content
diff --git a/src/core/public/rendering/app_containers.tsx b/src/core/public/rendering/app_containers.tsx index dab85769bd0b..8ccf795f8dcf 100644 --- a/src/core/public/rendering/app_containers.tsx +++ b/src/core/public/rendering/app_containers.tsx @@ -37,7 +37,11 @@ export const AppWrapper: React.FunctionComponent<{ chromeVisible$: Observable; }> = ({ chromeVisible$, children }) => { const visible = useObservable(chromeVisible$); - return
{children}
; + return ( +
+ {children} +
+ ); }; export const AppContainer: React.FunctionComponent<{ diff --git a/src/core/server/bootstrap.ts b/src/core/server/bootstrap.ts index 8defb17d2030..b36caa518bb0 100644 --- a/src/core/server/bootstrap.ts +++ b/src/core/server/bootstrap.ts @@ -29,11 +29,14 @@ */ import chalk from 'chalk'; -import { isMaster as isClusterManager } from 'cluster'; +import cluster from 'cluster'; import { CliArgs, Env, RawConfigService } from './config'; import { Root } from './root'; import { CriticalError } from './errors'; +// ToDo: `isMaster` is a Node 14- prop; remove it when Node 18+ is the only engine supported +const isClusterManager = cluster.isPrimary ?? cluster.isMaster; + interface OpenSearchDashboardsFeatures { // Indicates whether we can run OpenSearch Dashboards in a so called cluster mode in which // OpenSearch Dashboards is run as a "worker" process together with optimizer "worker" process @@ -63,7 +66,7 @@ export async function bootstrap({ features, }: BootstrapArgs) { if (cliArgs.repl && !features.isReplModeSupported) { - onRootShutdown('OpenSearch Dashboards REPL mode can only be run in development mode.'); + terminate('OpenSearch Dashboards REPL mode can only be run in development mode.'); } if (cliArgs.optimize) { @@ -96,8 +99,8 @@ export async function bootstrap({ // This is only used by the LogRotator service // in order to be able to reload the log configuration // under the cluster mode - process.on('message', (msg) => { - if (!msg || msg.reloadLoggingConfig !== true) { + process.on('message', (msg: any) => { + if (msg?.reloadLoggingConfig !== true) { return; } @@ -133,16 +136,27 @@ export async function bootstrap({ } } +/* `onRootShutdown` is called multiple times due to catching and rethrowing of exceptions + * in Root and bootstrap. The debouncer below is to make sure every catch and rethrow is + * executed before calling `terminate`. + */ +let shutdownTimer: NodeJS.Timeout; function onRootShutdown(reason?: any) { + clearTimeout(shutdownTimer); + shutdownTimer = setTimeout(() => terminate(reason), 300); +} + +function terminate(reason?: any) { + const exitCode = + reason === undefined ? 0 : reason instanceof CriticalError ? reason.processExitCode : 1; + if (reason !== undefined) { // There is a chance that logger wasn't configured properly and error that // that forced root to shut down could go unnoticed. To prevent this we always // mirror such fatal errors in standard output with `console.error`. // eslint-disable-next-line console.error(`\n${chalk.white.bgRed(' FATAL ')} ${reason}\n`); - - process.exit(reason instanceof CriticalError ? reason.processExitCode : 1); } - process.exit(0); + process.exit(exitCode); } diff --git a/src/core/server/http/router/request.ts b/src/core/server/http/router/request.ts index 0091a320bd63..f31b658890a4 100644 --- a/src/core/server/http/router/request.ts +++ b/src/core/server/http/router/request.ts @@ -242,11 +242,7 @@ export class OpenSearchDashboardsRequest< } private getEvents(request: Request): OpenSearchDashboardsRequestEvents { - const finish$ = merge( - fromEvent(request.raw.res, 'finish'), // Response has been sent - fromEvent(request.raw.req, 'close') // connection was closed - ).pipe(shareReplay(1), first()); - + const finish$ = fromEvent(request.raw.res, 'finish').pipe(shareReplay(1), first()); const aborted$ = fromEvent(request.raw.req, 'aborted').pipe(first(), takeUntil(finish$)); const completed$ = merge(finish$, aborted$).pipe(shareReplay(1), first()); diff --git a/src/core/server/http/router/validator/validator.test.ts b/src/core/server/http/router/validator/validator.test.ts index bda6da118efd..4c0dd2009daf 100644 --- a/src/core/server/http/router/validator/validator.test.ts +++ b/src/core/server/http/router/validator/validator.test.ts @@ -31,6 +31,9 @@ import { RouteValidationError, RouteValidator } from './'; import { schema, Type } from '@osd/config-schema'; +// ToDo: Remove this logic when Node 14 support is removed +const isNode14 = process.version.startsWith('v14.'); + describe('Router validator', () => { it('should validate and infer the type from a function', () => { const validator = RouteValidator.from({ @@ -70,7 +73,9 @@ describe('Router validator', () => { expect(() => validator.getParams({})).toThrowError('[foo]: Not a string'); expect(() => validator.getParams(undefined)).toThrowError( - `Cannot read property 'foo' of undefined` + isNode14 + ? `Cannot read property 'foo' of undefined` + : `Cannot read properties of undefined (reading 'foo')` ); expect(() => validator.getParams({}, 'myField')).toThrowError('[myField.foo]: Not a string'); diff --git a/src/core/server/legacy/legacy_service.test.ts b/src/core/server/legacy/legacy_service.test.ts index 9c1412541a66..8ad4c738df44 100644 --- a/src/core/server/legacy/legacy_service.test.ts +++ b/src/core/server/legacy/legacy_service.test.ts @@ -31,6 +31,8 @@ jest.mock('../../../legacy/server/osd_server'); jest.mock('./cluster_manager'); +import '@osd/optimizer/target/__mocks__/lmdb'; + import { BehaviorSubject, throwError } from 'rxjs'; import { REPO_ROOT } from '@osd/dev-utils'; diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts index cce7a4ff4b49..1a0fd8a6d364 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.mocks.ts @@ -29,6 +29,7 @@ */ const realFs = jest.requireActual('fs'); +const realFsPromises = jest.requireActual('fs/promises'); export const mockReadFile = jest.fn(); const mockStat = jest.fn(); @@ -37,3 +38,11 @@ jest.doMock('fs', () => ({ readFile: mockReadFile, stat: mockStat, })); + +export const mockReadFilePromise = jest.fn(); +const mockStatPromise = jest.fn(); +jest.doMock('fs/promises', () => ({ + ...realFsPromises, + readFile: mockReadFilePromise, + stat: mockStatPromise, +})); diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts index 6103b2d748b6..18b715d95050 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.test.ts @@ -28,7 +28,7 @@ * under the License. */ -import { mockReadFile } from './plugin_manifest_parser.test.mocks'; +import { mockReadFilePromise } from './plugin_manifest_parser.test.mocks'; import { PluginDiscoveryErrorType } from './plugin_discovery_error'; import { loggingSystemMock } from '../../logging/logging_system.mock'; @@ -52,9 +52,7 @@ afterEach(() => { }); test('return error when manifest is empty', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from('')); - }); + mockReadFilePromise.mockResolvedValue(Buffer.from('')); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Unexpected end of JSON input (invalid-manifest, ${pluginManifestPath})`, @@ -64,9 +62,7 @@ test('return error when manifest is empty', async () => { }); test('return error when manifest content is null', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from('null')); - }); + mockReadFilePromise.mockResolvedValue(Buffer.from('null')); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin manifest must contain a JSON encoded object. (invalid-manifest, ${pluginManifestPath})`, @@ -76,9 +72,7 @@ test('return error when manifest content is null', async () => { }); test('return error when manifest content is not a valid JSON', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from('not-json')); - }); + mockReadFilePromise.mockResolvedValue(Buffer.from('not-json')); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Unexpected token o in JSON at position 1 (invalid-manifest, ${pluginManifestPath})`, @@ -88,9 +82,7 @@ test('return error when manifest content is not a valid JSON', async () => { }); test('return error when plugin id is missing', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ version: 'some-version' }))); - }); + mockReadFilePromise.mockResolvedValue(Buffer.from(JSON.stringify({ version: 'some-version' }))); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin manifest must contain an "id" property. (invalid-manifest, ${pluginManifestPath})`, @@ -100,9 +92,9 @@ test('return error when plugin id is missing', async () => { }); test('return error when plugin id includes `.` characters', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'some.name', version: 'some-version' }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'some.name', version: 'some-version' })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin "id" must not include \`.\` characters. (invalid-manifest, ${pluginManifestPath})`, @@ -112,14 +104,9 @@ test('return error when plugin id includes `.` characters', async () => { }); test('logs warning if pluginId is not in camelCase format', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ id: 'some_name', version: 'opensearchDashboards', server: true }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'some_name', version: 'opensearchDashboards', server: true })) + ); expect(loggingSystemMock.collect(logger).warn).toHaveLength(0); await parseManifest(pluginPath, packageInfo, logger); @@ -133,14 +120,9 @@ test('logs warning if pluginId is not in camelCase format', async () => { }); test('does not log pluginId format warning in dist mode', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ id: 'some_name', version: 'opensearchDashboards', server: true }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'some_name', version: 'opensearchDashboards', server: true })) + ); expect(loggingSystemMock.collect(logger).warn).toHaveLength(0); await parseManifest(pluginPath, { ...packageInfo, dist: true }, logger); @@ -148,9 +130,7 @@ test('does not log pluginId format warning in dist mode', async () => { }); test('return error when plugin version is missing', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'someId' }))); - }); + mockReadFilePromise.mockResolvedValue(Buffer.from(JSON.stringify({ id: 'someId' }))); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin manifest for "someId" must contain a "version" property. (invalid-manifest, ${pluginManifestPath})`, @@ -160,9 +140,9 @@ test('return error when plugin version is missing', async () => { }); test('return error when plugin expected OpenSearch Dashboards version is lower than actual version', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'someId', version: '6.4.2' }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '6.4.2' })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin "someId" is only compatible with OpenSearch Dashboards version "6.4.2", but used OpenSearch Dashboards version is "7.0.0-alpha1". (incompatible-version, ${pluginManifestPath})`, @@ -172,18 +152,15 @@ test('return error when plugin expected OpenSearch Dashboards version is lower t }); test('return error when plugin expected OpenSearch Dashboards version cannot be interpreted as semver', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ - id: 'someId', - version: '1.0.0', - opensearchDashboardsVersion: 'non-sem-ver', - }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ + id: 'someId', + version: '1.0.0', + opensearchDashboardsVersion: 'non-sem-ver', + }) + ) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin "someId" is only compatible with OpenSearch Dashboards version "non-sem-ver", but used OpenSearch Dashboards version is "7.0.0-alpha1". (incompatible-version, ${pluginManifestPath})`, @@ -193,9 +170,9 @@ test('return error when plugin expected OpenSearch Dashboards version cannot be }); test('return error when plugin config path is not a string', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', configPath: 2 }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', configPath: 2 })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `The "configPath" in plugin manifest for "someId" should either be a string or an array of strings. (invalid-manifest, ${pluginManifestPath})`, @@ -205,12 +182,9 @@ test('return error when plugin config path is not a string', async () => { }); test('return error when plugin config path is an array that contains non-string values', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', configPath: ['config', 2] })) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', configPath: ['config', 2] })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `The "configPath" in plugin manifest for "someId" should either be a string or an array of strings. (invalid-manifest, ${pluginManifestPath})`, @@ -220,9 +194,9 @@ test('return error when plugin config path is an array that contains non-string }); test('return error when plugin expected OpenSearch Dashboards version is higher than actual version', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.1' }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.1' })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Plugin "someId" is only compatible with OpenSearch Dashboards version "7.0.1", but used OpenSearch Dashboards version is "7.0.0-alpha1". (incompatible-version, ${pluginManifestPath})`, @@ -232,9 +206,9 @@ test('return error when plugin expected OpenSearch Dashboards version is higher }); test('return error when both `server` and `ui` are set to `false` or missing', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0' }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0' })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Both "server" and "ui" are missing or set to "false" in plugin manifest for "someId", but at least one of these must be set to "true". (invalid-manifest, ${pluginManifestPath})`, @@ -242,12 +216,9 @@ test('return error when both `server` and `ui` are set to `false` or missing', a path: pluginManifestPath, }); - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', server: false, ui: false })) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', server: false, ui: false })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Both "server" and "ui" are missing or set to "false" in plugin manifest for "someId", but at least one of these must be set to "true". (invalid-manifest, ${pluginManifestPath})`, @@ -257,20 +228,17 @@ test('return error when both `server` and `ui` are set to `false` or missing', a }); test('return error when manifest contains unrecognized properties', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ - id: 'someId', - version: '7.0.0', - server: true, - unknownOne: 'one', - unknownTwo: true, - }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ + id: 'someId', + version: '7.0.0', + server: true, + unknownOne: 'one', + unknownTwo: true, + }) + ) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).rejects.toMatchObject({ message: `Manifest for plugin "someId" contains the following unrecognized properties: unknownOne,unknownTwo. (invalid-manifest, ${pluginManifestPath})`, @@ -281,46 +249,40 @@ test('return error when manifest contains unrecognized properties', async () => describe('configPath', () => { test('falls back to plugin id if not specified', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'plugin', version: '7.0.0', server: true }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'plugin', version: '7.0.0', server: true })) + ); const manifest = await parseManifest(pluginPath, packageInfo, logger); expect(manifest.configPath).toBe(manifest.id); }); test('falls back to plugin id in snakeCase format', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'SomeId', version: '7.0.0', server: true }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'SomeId', version: '7.0.0', server: true })) + ); const manifest = await parseManifest(pluginPath, packageInfo, logger); expect(manifest.configPath).toBe('some_id'); }); test('not formated to snakeCase if defined explicitly as string', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ id: 'someId', configPath: 'somePath', version: '7.0.0', server: true }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ id: 'someId', configPath: 'somePath', version: '7.0.0', server: true }) + ) + ); const manifest = await parseManifest(pluginPath, packageInfo, logger); expect(manifest.configPath).toBe('somePath'); }); test('not formated to snakeCase if defined explicitly as an array of strings', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ id: 'someId', configPath: ['somePath'], version: '7.0.0', server: true }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ id: 'someId', configPath: ['somePath'], version: '7.0.0', server: true }) + ) + ); const manifest = await parseManifest(pluginPath, packageInfo, logger); expect(manifest.configPath).toEqual(['somePath']); @@ -328,9 +290,9 @@ describe('configPath', () => { }); test('set defaults for all missing optional fields', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb(null, Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', server: true }))); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from(JSON.stringify({ id: 'someId', version: '7.0.0', server: true })) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).resolves.toEqual({ id: 'someId', @@ -346,22 +308,19 @@ test('set defaults for all missing optional fields', async () => { }); test('return all set optional fields as they are in manifest', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ - id: 'someId', - configPath: ['some', 'path'], - version: 'some-version', - opensearchDashboardsVersion: '7.0.0', - requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], - optionalPlugins: ['some-optional-plugin'], - ui: true, - }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ + id: 'someId', + configPath: ['some', 'path'], + version: 'some-version', + opensearchDashboardsVersion: '7.0.0', + requiredPlugins: ['some-required-plugin', 'some-required-plugin-2'], + optionalPlugins: ['some-optional-plugin'], + ui: true, + }) + ) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).resolves.toEqual({ id: 'someId', @@ -377,21 +336,18 @@ test('return all set optional fields as they are in manifest', async () => { }); test('return manifest when plugin expected OpenSearch Dashboards version matches actual version', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ - id: 'someId', - configPath: 'some-path', - version: 'some-version', - opensearchDashboardsVersion: '7.0.0-alpha2', - requiredPlugins: ['some-required-plugin'], - server: true, - }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ + id: 'someId', + configPath: 'some-path', + version: 'some-version', + opensearchDashboardsVersion: '7.0.0-alpha2', + requiredPlugins: ['some-required-plugin'], + server: true, + }) + ) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).resolves.toEqual({ id: 'someId', @@ -407,21 +363,18 @@ test('return manifest when plugin expected OpenSearch Dashboards version matches }); test('return manifest when plugin expected OpenSearch Dashboards version is `opensearchDashboards`', async () => { - mockReadFile.mockImplementation((path, cb) => { - cb( - null, - Buffer.from( - JSON.stringify({ - id: 'someId', - version: 'some-version', - opensearchDashboardsVersion: 'opensearchDashboards', - requiredPlugins: ['some-required-plugin'], - server: true, - ui: true, - }) - ) - ); - }); + mockReadFilePromise.mockResolvedValue( + Buffer.from( + JSON.stringify({ + id: 'someId', + version: 'some-version', + opensearchDashboardsVersion: 'opensearchDashboards', + requiredPlugins: ['some-required-plugin'], + server: true, + ui: true, + }) + ) + ); await expect(parseManifest(pluginPath, packageInfo, logger)).resolves.toEqual({ id: 'someId', diff --git a/src/core/server/plugins/discovery/plugin_manifest_parser.ts b/src/core/server/plugins/discovery/plugin_manifest_parser.ts index 0f39f14b0ce5..2a5ccf611f0c 100644 --- a/src/core/server/plugins/discovery/plugin_manifest_parser.ts +++ b/src/core/server/plugins/discovery/plugin_manifest_parser.ts @@ -28,10 +28,9 @@ * under the License. */ -import { readFile, stat } from 'fs'; +import { readFile, stat } from 'fs/promises'; import { resolve } from 'path'; import { coerce } from 'semver'; -import { promisify } from 'util'; import { snakeCase } from 'lodash'; import { isConfigPath, PackageInfo } from '../../config'; import { Logger } from '../../logging'; @@ -39,9 +38,6 @@ import { PluginManifest } from '../types'; import { PluginDiscoveryError } from './plugin_discovery_error'; import { isCamelCase } from './is_camel_case'; -const fsReadFileAsync = promisify(readFile); -const fsStatAsync = promisify(stat); - /** * Name of the JSON manifest file that should be located in the plugin directory. */ @@ -92,7 +88,7 @@ export async function parseManifest( let manifestContent; try { - manifestContent = await fsReadFileAsync(manifestPath); + manifestContent = await readFile(manifestPath); } catch (err) { throw PluginDiscoveryError.missingManifest(manifestPath, err); } @@ -219,7 +215,7 @@ export async function parseManifest( */ export async function isNewPlatformPlugin(pluginPath: string) { try { - return (await fsStatAsync(resolve(pluginPath, MANIFEST_FILE_NAME))).isFile(); + return (await stat(resolve(pluginPath, MANIFEST_FILE_NAME))).isFile(); } catch (err) { return false; } diff --git a/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts b/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts index ac2806748207..cf7e1d8246a7 100644 --- a/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts +++ b/src/core/server/saved_objects/export/get_sorted_objects_for_export.test.ts @@ -32,6 +32,9 @@ import { exportSavedObjectsToStream } from './get_sorted_objects_for_export'; import { savedObjectsClientMock } from '../service/saved_objects_client.mock'; import { Readable } from 'stream'; import { createPromiseFromStreams, createConcatStream } from '../../utils/streams'; +import { createStripPromisesSerializer } from '@osd/dev-utils'; + +expect.addSnapshotSerializer(createStripPromisesSerializer()); async function readStreamToCompletion(stream: Readable) { return createPromiseFromStreams([stream, createConcatStream([])]); @@ -89,27 +92,27 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "exportedCount": 2, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 2, + missingRefCount: 0, + missingReferences: Array [], }, ] `); @@ -118,20 +121,20 @@ describe('getSortedObjectsForExport()', () => { "calls": Array [ Array [ Object { - "namespaces": undefined, - "perPage": 500, - "search": undefined, - "type": Array [ - "index-pattern", - "search", + namespaces: undefined, + perPage: 500, + search: undefined, + type: Array [ + index-pattern, + search, ], }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -179,27 +182,27 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "exportedCount": 2, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 2, + missingRefCount: 0, + missingReferences: Array [], }, ] `); @@ -208,20 +211,20 @@ describe('getSortedObjectsForExport()', () => { "calls": Array [ Array [ Object { - "namespaces": undefined, - "perPage": 500, - "search": undefined, - "type": Array [ - "index-pattern", - "search", + namespaces: undefined, + perPage: 500, + search: undefined, + type: Array [ + index-pattern, + search, ], }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -268,22 +271,22 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, ] `); @@ -329,27 +332,27 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "exportedCount": 2, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 2, + missingRefCount: 0, + missingReferences: Array [], }, ] `); @@ -358,20 +361,20 @@ describe('getSortedObjectsForExport()', () => { "calls": Array [ Array [ Object { - "namespaces": undefined, - "perPage": 500, - "search": "foo", - "type": Array [ - "index-pattern", - "search", + namespaces: undefined, + perPage: 500, + search: foo, + type: Array [ + index-pattern, + search, ], }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -418,27 +421,27 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "exportedCount": 2, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 2, + missingRefCount: 0, + missingReferences: Array [], }, ] `); @@ -447,22 +450,22 @@ describe('getSortedObjectsForExport()', () => { "calls": Array [ Array [ Object { - "namespaces": Array [ - "foo", + namespaces: Array [ + foo, ], - "perPage": 500, - "search": undefined, - "type": Array [ - "index-pattern", - "search", + perPage: 500, + search: undefined, + type: Array [ + index-pattern, + search, ], }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -503,7 +506,7 @@ describe('getSortedObjectsForExport()', () => { exportSizeLimit: 1, types: ['index-pattern', 'search'], }) - ).rejects.toThrowErrorMatchingInlineSnapshot(`"Can't export more than 1 objects"`); + ).rejects.toThrowErrorMatchingInlineSnapshot(`Can't export more than 1 objects`); }); test('sorts objects within type', async () => { @@ -550,33 +553,33 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object { - "name": "foo", + attributes: Object { + name: foo, }, - "id": "1", - "references": Array [], - "type": "index-pattern", + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object { - "name": "bar", + attributes: Object { + name: bar, }, - "id": "2", - "references": Array [], - "type": "index-pattern", + id: 2, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object { - "name": "baz", + attributes: Object { + name: baz, }, - "id": "3", - "references": Array [], - "type": "index-pattern", + id: 3, + references: Array [], + type: index-pattern, }, Object { - "exportedCount": 3, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 3, + missingRefCount: 0, + missingReferences: Array [], }, ] `); @@ -623,57 +626,57 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "exportedCount": 2, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 2, + missingRefCount: 0, + missingReferences: Array [], }, ] `); expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(` - [MockFunction] { - "calls": Array [ - Array [ - Array [ - Object { - "id": "1", - "type": "index-pattern", - }, - Object { - "id": "2", - "type": "search", - }, - ], - Object { - "namespace": undefined, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": Promise {}, - }, - ], - } - `); + [MockFunction] { + "calls": Array [ + Array [ + Array [ + Object { + id: 1, + type: index-pattern, + }, + Object { + id: 2, + type: search, + }, + ], + Object { + namespace: undefined, + }, + ], + ], + "results": Array [ + Object { + type: return, + value: Promise {}, + }, + ], + } + `); }); test('modifies return results to redact `namespaces` attribute', async () => { @@ -745,68 +748,68 @@ describe('getSortedObjectsForExport()', () => { expect(response).toMatchInlineSnapshot(` Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "name", - "type": "index-pattern", + id: 1, + name: name, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "exportedCount": 2, - "missingRefCount": 0, - "missingReferences": Array [], + exportedCount: 2, + missingRefCount: 0, + missingReferences: Array [], }, ] `); expect(savedObjectsClient.bulkGet).toMatchInlineSnapshot(` - [MockFunction] { - "calls": Array [ - Array [ - Array [ - Object { - "id": "2", - "type": "search", - }, - ], - Object { - "namespace": undefined, - }, - ], - Array [ - Array [ - Object { - "id": "1", - "type": "index-pattern", - }, - ], - Object { - "namespace": undefined, - }, - ], - ], - "results": Array [ - Object { - "type": "return", - "value": Promise {}, - }, - Object { - "type": "return", - "value": Promise {}, - }, - ], - } - `); + [MockFunction] { + "calls": Array [ + Array [ + Array [ + Object { + id: 2, + type: search, + }, + ], + Object { + namespace: undefined, + }, + ], + Array [ + Array [ + Object { + id: 1, + type: index-pattern, + }, + ], + Object { + namespace: undefined, + }, + ], + ], + "results": Array [ + Object { + type: return, + value: Promise {}, + }, + Object { + type: return, + value: Promise {}, + }, + ], + } + `); }); test('export selected objects throws error when exceeding exportSizeLimit', async () => { @@ -825,7 +828,7 @@ describe('getSortedObjectsForExport()', () => { ], }; await expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( - `"Can't export more than 1 objects"` + `Can't export more than 1 objects` ); }); @@ -838,7 +841,7 @@ describe('getSortedObjectsForExport()', () => { }; expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( - `"Either \`type\` or \`objects\` are required."` + `Either \`type\` or \`objects\` are required.` ); }); @@ -851,7 +854,7 @@ describe('getSortedObjectsForExport()', () => { }; expect(exportSavedObjectsToStream(exportOpts)).rejects.toThrowErrorMatchingInlineSnapshot( - `"Can't specify both \\"search\\" and \\"objects\\" properties when exporting"` + `Can't specify both "search" and "objects" properties when exporting` ); }); }); diff --git a/src/core/server/saved_objects/export/inject_nested_depdendencies.test.ts b/src/core/server/saved_objects/export/inject_nested_depdendencies.test.ts index 587491280285..00c81e55244e 100644 --- a/src/core/server/saved_objects/export/inject_nested_depdendencies.test.ts +++ b/src/core/server/saved_objects/export/inject_nested_depdendencies.test.ts @@ -32,6 +32,10 @@ import { SavedObject } from '../types'; import { savedObjectsClientMock } from '../../mocks'; import { getObjectReferencesToFetch, fetchNestedDependencies } from './inject_nested_depdendencies'; import { SavedObjectsErrorHelpers } from '..'; +import { createStripPromisesSerializer } from '@osd/dev-utils'; + +// This is to clean Promises +expect.addSnapshotSerializer(createStripPromisesSerializer()); describe('getObjectReferencesToFetch()', () => { test('works with no saved objects', () => { @@ -82,8 +86,8 @@ describe('getObjectReferencesToFetch()', () => { expect(result).toMatchInlineSnapshot(` Array [ Object { - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, ] `); @@ -139,13 +143,13 @@ describe('injectNestedDependencies', () => { const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); expect(result).toMatchInlineSnapshot(` Object { - "missingRefs": Array [], - "objects": Array [ + missingRefs: Array [], + objects: Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, ], } @@ -176,25 +180,25 @@ describe('injectNestedDependencies', () => { const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); expect(result).toMatchInlineSnapshot(` Object { - "missingRefs": Array [], - "objects": Array [ + missingRefs: Array [], + objects: Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", + id: 1, + name: ref_0, + type: index-pattern, }, ], - "type": "search", + type: search, }, ], } @@ -229,25 +233,25 @@ describe('injectNestedDependencies', () => { const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); expect(result).toMatchInlineSnapshot(` Object { - "missingRefs": Array [], - "objects": Array [ + missingRefs: Array [], + objects: Array [ Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", + id: 1, + name: ref_0, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, ], } @@ -258,19 +262,19 @@ describe('injectNestedDependencies', () => { Array [ Array [ Object { - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -350,66 +354,66 @@ describe('injectNestedDependencies', () => { const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); expect(result).toMatchInlineSnapshot(` Object { - "missingRefs": Array [], - "objects": Array [ + missingRefs: Array [], + objects: Array [ Object { - "attributes": Object {}, - "id": "5", - "references": Array [ + attributes: Object {}, + id: 5, + references: Array [ Object { - "id": "4", - "name": "panel_0", - "type": "visualization", + id: 4, + name: panel_0, + type: visualization, }, Object { - "id": "3", - "name": "panel_1", - "type": "visualization", + id: 3, + name: panel_1, + type: visualization, }, ], - "type": "dashboard", + type: dashboard, }, Object { - "attributes": Object {}, - "id": "4", - "references": Array [ + attributes: Object {}, + id: 4, + references: Array [ Object { - "id": "2", - "name": "ref_0", - "type": "search", + id: 2, + name: ref_0, + type: search, }, ], - "type": "visualization", + type: visualization, }, Object { - "attributes": Object {}, - "id": "3", - "references": Array [ + attributes: Object {}, + id: 3, + references: Array [ Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", + id: 1, + name: ref_0, + type: index-pattern, }, ], - "type": "visualization", + type: visualization, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", + id: 1, + name: ref_0, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "attributes": Object {}, - "id": "1", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 1, + references: Array [], + type: index-pattern, }, ], } @@ -420,42 +424,42 @@ describe('injectNestedDependencies', () => { Array [ Array [ Object { - "id": "4", - "type": "visualization", + id: 4, + type: visualization, }, Object { - "id": "3", - "type": "visualization", + id: 3, + type: visualization, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], Array [ Array [ Object { - "id": "2", - "type": "search", + id: 2, + type: search, }, Object { - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -503,35 +507,35 @@ describe('injectNestedDependencies', () => { const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); expect(result).toMatchInlineSnapshot(` Object { - "missingRefs": Array [ + missingRefs: Array [ Object { - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, ], - "objects": Array [ + objects: Array [ Object { - "attributes": Object {}, - "id": "1", - "references": Array [ + attributes: Object {}, + id: 1, + references: Array [ Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", + id: 1, + name: ref_0, + type: index-pattern, }, Object { - "id": "2", - "name": "ref_1", - "type": "index-pattern", + id: 2, + name: ref_1, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "attributes": Object {}, - "id": "2", - "references": Array [], - "type": "index-pattern", + attributes: Object {}, + id: 2, + references: Array [], + type: index-pattern, }, ], } @@ -572,31 +576,31 @@ describe('injectNestedDependencies', () => { const result = await fetchNestedDependencies(savedObjects, savedObjectsClient); expect(result).toMatchInlineSnapshot(` Object { - "missingRefs": Array [], - "objects": Array [ + missingRefs: Array [], + objects: Array [ Object { - "attributes": Object {}, - "id": "2", - "references": Array [ + attributes: Object {}, + id: 2, + references: Array [ Object { - "id": "1", - "name": "ref_0", - "type": "index-pattern", + id: 1, + name: ref_0, + type: index-pattern, }, ], - "type": "search", + type: search, }, Object { - "attributes": Object {}, - "id": "1", - "references": Array [ + attributes: Object {}, + id: 1, + references: Array [ Object { - "id": "2", - "name": "ref_0", - "type": "search", + id: 2, + name: ref_0, + type: search, }, ], - "type": "index-pattern", + type: index-pattern, }, ], } @@ -607,19 +611,19 @@ describe('injectNestedDependencies', () => { Array [ Array [ Object { - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } diff --git a/src/core/server/saved_objects/import/validate_references.test.ts b/src/core/server/saved_objects/import/validate_references.test.ts index 8b9a4ebee4c1..df9a4e216bbb 100644 --- a/src/core/server/saved_objects/import/validate_references.test.ts +++ b/src/core/server/saved_objects/import/validate_references.test.ts @@ -31,7 +31,9 @@ import { getNonExistingReferenceAsKeys, validateReferences } from './validate_references'; import { savedObjectsClientMock } from '../../mocks'; import { SavedObjectsErrorHelpers } from '..'; +import { createStripPromisesSerializer } from '@osd/dev-utils'; +expect.addSnapshotSerializer(createStripPromisesSerializer()); describe('getNonExistingReferenceAsKeys()', () => { const savedObjectsClient = savedObjectsClientMock.create(); @@ -132,22 +134,22 @@ describe('getNonExistingReferenceAsKeys()', () => { Array [ Array [ Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -226,29 +228,29 @@ describe('getNonExistingReferenceAsKeys()', () => { Array [ Array [ Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "1", - "type": "index-pattern", + id: 1, + type: index-pattern, }, Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "3", - "type": "search", + id: 3, + type: search, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -366,46 +368,46 @@ describe('validateReferences()', () => { expect(result).toMatchInlineSnapshot(` Array [ Object { - "error": Object { - "references": Array [ + error: Object { + references: Array [ Object { - "id": "3", - "type": "index-pattern", + id: 3, + type: index-pattern, }, ], - "type": "missing_references", + type: missing_references, }, - "id": "2", - "meta": Object { - "title": "My Visualization 2", + id: 2, + meta: Object { + title: My Visualization 2, }, - "title": "My Visualization 2", - "type": "visualization", + title: My Visualization 2, + type: visualization, }, Object { - "error": Object { - "references": Array [ + error: Object { + references: Array [ Object { - "id": "5", - "type": "index-pattern", + id: 5, + type: index-pattern, }, Object { - "id": "6", - "type": "index-pattern", + id: 6, + type: index-pattern, }, Object { - "id": "7", - "type": "search", + id: 7, + type: search, }, ], - "type": "missing_references", + type: missing_references, }, - "id": "4", - "meta": Object { - "title": "My Visualization 4", + id: 4, + meta: Object { + title: My Visualization 4, }, - "title": "My Visualization 4", - "type": "visualization", + title: My Visualization 4, + type: visualization, }, ] `); @@ -415,50 +417,50 @@ describe('validateReferences()', () => { Array [ Array [ Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "3", - "type": "index-pattern", + id: 3, + type: index-pattern, }, Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "5", - "type": "index-pattern", + id: 5, + type: index-pattern, }, Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "6", - "type": "index-pattern", + id: 6, + type: index-pattern, }, Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "7", - "type": "search", + id: 7, + type: search, }, Object { - "fields": Array [ - "id", + fields: Array [ + id, ], - "id": "8", - "type": "search", + id: 8, + type: search, }, ], Object { - "namespace": undefined, + namespace: undefined, }, ], ], "results": Array [ Object { - "type": "return", - "value": Promise {}, + type: return, + value: Promise {}, }, ], } @@ -597,6 +599,6 @@ describe('validateReferences()', () => { ]; await expect( validateReferences(savedObjects, savedObjectsClient) - ).rejects.toThrowErrorMatchingInlineSnapshot(`"Bad Request"`); + ).rejects.toThrowErrorMatchingInlineSnapshot(`Bad Request`); }); }); diff --git a/src/core/server/status/plugins_status.ts b/src/core/server/status/plugins_status.ts index 52ba85459658..b4fe9bcd0835 100644 --- a/src/core/server/status/plugins_status.ts +++ b/src/core/server/status/plugins_status.ts @@ -43,7 +43,7 @@ interface Deps { export class PluginsStatusService { private readonly pluginStatuses = new Map>(); - private readonly update$ = new BehaviorSubject(true); + private readonly update$ = new BehaviorSubject(true); private readonly defaultInheritedStatus$: Observable; constructor(private readonly deps: Deps) { @@ -121,7 +121,7 @@ export class PluginsStatusService { return combineLatest(pluginStatuses).pipe( map((statuses) => Object.fromEntries(statuses)), - distinctUntilChanged(isDeepStrictEqual) + distinctUntilChanged>(isDeepStrictEqual) ); }) ); diff --git a/src/core/server/status/status_service.ts b/src/core/server/status/status_service.ts index b128bfb7218c..10547e510fa6 100644 --- a/src/core/server/status/status_service.ts +++ b/src/core/server/status/status_service.ts @@ -95,7 +95,7 @@ export class StatusService implements CoreService { this.logger.debug(`Recalculated overall status`, { status: summary }); return summary; }), - distinctUntilChanged(isDeepStrictEqual), + distinctUntilChanged>(isDeepStrictEqual), shareReplay(1) ); @@ -149,7 +149,7 @@ export class StatusService implements CoreService { opensearch: opensearchStatus, savedObjects: savedObjectsStatus, })), - distinctUntilChanged(isDeepStrictEqual), + distinctUntilChanged(isDeepStrictEqual), shareReplay(1) ); } diff --git a/src/core/server/ui_settings/ui_settings_client.test.ts b/src/core/server/ui_settings/ui_settings_client.test.ts index a7aa95ebab91..9108467fd04c 100644 --- a/src/core/server/ui_settings/ui_settings_client.test.ts +++ b/src/core/server/ui_settings/ui_settings_client.test.ts @@ -168,7 +168,7 @@ describe('ui settings', () => { foo: 1, }) ).rejects.toMatchInlineSnapshot( - `[Error: [validation [foo]]: expected value of type [string] but got [number]]` + `[ValidationError: [validation [foo]]: expected value of type [string] but got [number]]` ); expect(savedObjectsClient.update).toHaveBeenCalledTimes(0); @@ -196,7 +196,7 @@ describe('ui settings', () => { const { uiSettings, savedObjectsClient } = setup({ defaults }); await expect(uiSettings.set('foo', 1)).rejects.toMatchInlineSnapshot( - `[Error: [validation [foo]]: expected value of type [string] but got [number]]` + `[ValidationError: [validation [foo]]: expected value of type [string] but got [number]]` ); expect(savedObjectsClient.update).toHaveBeenCalledTimes(0); @@ -389,7 +389,7 @@ describe('ui settings', () => { expect(loggingSystemMock.collect(logger).warn).toMatchInlineSnapshot(` Array [ Array [ - "Ignore invalid UiSettings value. Error: [validation [id]]: expected value of type [number] but got [string].", + "Ignore invalid UiSettings value. ValidationError: [validation [id]]: expected value of type [number] but got [string].", ], ] `); @@ -531,7 +531,7 @@ describe('ui settings', () => { expect(loggingSystemMock.collect(logger).warn).toMatchInlineSnapshot(` Array [ Array [ - "Ignore invalid UiSettings value. Error: [validation [id]]: expected value of type [number] but got [string].", + "Ignore invalid UiSettings value. ValidationError: [validation [id]]: expected value of type [number] but got [string].", ], ] `); @@ -682,7 +682,7 @@ describe('ui settings', () => { expect(loggingSystemMock.collect(logger).warn).toMatchInlineSnapshot(` Array [ Array [ - "Ignore invalid UiSettings value. Error: [validation [id]]: expected value of type [number] but got [string].", + "Ignore invalid UiSettings value. ValidationError: [validation [id]]: expected value of type [number] but got [string].", ], ] `); diff --git a/src/core/server/ui_settings/ui_settings_service.test.ts b/src/core/server/ui_settings/ui_settings_service.test.ts index ae881363e63f..e32429de7abe 100644 --- a/src/core/server/ui_settings/ui_settings_service.test.ts +++ b/src/core/server/ui_settings/ui_settings_service.test.ts @@ -111,7 +111,7 @@ describe('uiSettings', () => { }); await expect(service.start()).rejects.toMatchInlineSnapshot( - `[Error: [ui settings defaults [custom]]: expected value of type [string] but got [number]]` + `[ValidationError: [ui settings defaults [custom]]: expected value of type [string] but got [number]]` ); }); @@ -134,7 +134,7 @@ describe('uiSettings', () => { }); await expect(customizedService.start()).rejects.toMatchInlineSnapshot( - `[Error: [ui settings overrides [custom]]: expected value of type [string] but got [number]]` + `[ValidationError: [ui settings overrides [custom]]: expected value of type [string] but got [number]]` ); }); }); diff --git a/src/core/test_helpers/osd_server.ts b/src/core/test_helpers/osd_server.ts index 5c062d76dcac..8f03ac949842 100644 --- a/src/core/test_helpers/osd_server.ts +++ b/src/core/test_helpers/osd_server.ts @@ -52,6 +52,7 @@ export type HttpMethod = 'delete' | 'get' | 'head' | 'post' | 'put'; const DEFAULTS_SETTINGS = { server: { autoListen: true, + host: '0.0.0.0', // Use the ephemeral port to make sure that tests use the first available // port and aren't affected by the timing issues in test environment. port: 0, diff --git a/src/dev/build/lib/build.test.ts b/src/dev/build/lib/build.test.ts index 140237437ad1..96509df78aed 100644 --- a/src/dev/build/lib/build.test.ts +++ b/src/dev/build/lib/build.test.ts @@ -42,6 +42,7 @@ const config = new Config( darwin: false, linux: false, linuxArm: false, + windows: false, }, { version: '1.0.0', @@ -53,6 +54,7 @@ const config = new Config( }, }, '1.2.3', + '1.2.3', REPO_ROOT, { buildNumber: 1234, diff --git a/src/dev/build/lib/config.ts b/src/dev/build/lib/config.ts index 03fdd14b05c0..6af5b8e6901a 100644 --- a/src/dev/build/lib/config.ts +++ b/src/dev/build/lib/config.ts @@ -31,6 +31,7 @@ import { dirname, resolve, relative } from 'path'; import os from 'os'; import loadJsonFile from 'load-json-file'; +import { readFile } from 'fs/promises'; import { getVersionInfo, VersionInfo } from './version_info'; import { @@ -67,11 +68,15 @@ export class Config { const pkgPath = resolve(__dirname, '../../../../package.json'); const pkg: Package = loadJsonFile.sync(pkgPath); + const nvmrcPath = resolve(__dirname, '../../../../.nvmrc'); + const nvmrcContent = (await readFile(nvmrcPath, 'utf8'))?.trim?.(); + return new Config( targetAllPlatforms, targetPlatforms, pkg, pkg.engines.node, + nvmrcContent, dirname(pkgPath), await getVersionInfo({ isRelease, @@ -87,6 +92,7 @@ export class Config { private readonly targetPlatforms: TargetPlatforms, private readonly pkg: Package, private readonly nodeRange: string, + private readonly nodeVersion: string, private readonly repoRoot: string, private readonly versionInfo: VersionInfo, public readonly isRelease: boolean @@ -100,12 +106,19 @@ export class Config { } /** - * Get the node version required by OpenSearch Dashboards + * Get the node version range compatible with OpenSearch Dashboards */ getNodeRange() { return this.nodeRange; } + /** + * Get the node version required by OpenSearch Dashboards + */ + getNodeVersion() { + return this.nodeVersion; + } + /** * Convert an absolute path to a relative path, based from the repo */ diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards b/src/dev/build/tasks/bin/scripts/opensearch-dashboards index 49c41011da7d..c7eae94b4996 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards @@ -28,4 +28,4 @@ done # Get an absolute path for OSD_HOME OSD_HOME="$(cd "$(dirname "${SCRIPT}")/.."; pwd)" -OSD_NODE_OPTS_PREFIX="--no-warnings --max-http-header-size=65536" OSD_USE_NODE_JS_FILE_PATH=/src/cli/dist NODE_ENV=production ${OSD_HOME}/bin/use_node "${@}" +OSD_NODE_OPTS_PREFIX="--no-warnings --max-http-header-size=65536" OSD_USE_NODE_JS_FILE_PATH=/src/cli/dist NODE_ENV=production exec ${OSD_HOME}/bin/use_node "${@}" diff --git a/src/dev/build/tasks/bin/scripts/opensearch-dashboards-plugin b/src/dev/build/tasks/bin/scripts/opensearch-dashboards-plugin index 6af40438d13b..a8d9829cc3c1 100755 --- a/src/dev/build/tasks/bin/scripts/opensearch-dashboards-plugin +++ b/src/dev/build/tasks/bin/scripts/opensearch-dashboards-plugin @@ -28,4 +28,4 @@ done # Get an absolute path for OSD_HOME OSD_HOME="$(cd "$(dirname "${SCRIPT}")/.."; pwd)" -OSD_NODE_OPTS_PREFIX="--no-warnings" OSD_USE_NODE_JS_FILE_PATH=/src/cli_plugin/dist NODE_ENV=production ${OSD_HOME}/bin/use_node "${@}" +OSD_NODE_OPTS_PREFIX="--no-warnings" OSD_USE_NODE_JS_FILE_PATH=/src/cli_plugin/dist NODE_ENV=production exec ${OSD_HOME}/bin/use_node "${@}" diff --git a/src/dev/build/tasks/create_archives_sources_task.ts b/src/dev/build/tasks/create_archives_sources_task.ts index bf53c2915560..55d9b5313f12 100644 --- a/src/dev/build/tasks/create_archives_sources_task.ts +++ b/src/dev/build/tasks/create_archives_sources_task.ts @@ -29,7 +29,7 @@ */ import { scanCopy, Task } from '../lib'; -import { getNodeDownloadInfo } from './nodejs'; +import { getNodeDownloadInfo, getNodeVersionDownloadInfo, NODE14_FALLBACK_VERSION } from './nodejs'; export const CreateArchivesSources: Task = { description: 'Creating platform-specific archive source directories', @@ -54,6 +54,20 @@ export const CreateArchivesSources: Task = { destination: build.resolvePathForPlatform(platform, 'node'), }); + // ToDo [NODE14]: Remove this Node.js 14 fallback download + // Copy the Node.js 14 binaries into node/fallback to be used by `use_node` + await scanCopy({ + source: ( + await getNodeVersionDownloadInfo( + NODE14_FALLBACK_VERSION, + platform.getNodeArch(), + platform.isWindows(), + config.resolveFromRepo() + ) + ).extractDir, + destination: build.resolvePathForPlatform(platform, 'node', 'fallback'), + }); + log.debug('Node.js copied into', platform.getNodeArch(), 'specific build directory'); }) ); diff --git a/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts index 3aff61e7cf4f..f5905534e121 100644 --- a/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/download_node_builds_task.test.ts @@ -44,7 +44,9 @@ jest.mock('../../lib/get_build_number'); expect.addSnapshotSerializer(createAnyInstanceSerializer(ToolingLog)); -const { getNodeDownloadInfo } = jest.requireMock('./node_download_info'); +const { getNodeDownloadInfo, getNodeVersionDownloadInfo } = jest.requireMock( + './node_download_info' +); const { getNodeShasums } = jest.requireMock('./node_shasums'); const { download } = jest.requireMock('../../lib/download'); @@ -76,6 +78,16 @@ async function setup({ failOnUrl }: { failOnUrl?: string } = {}) { }; }); + getNodeVersionDownloadInfo.mockImplementation((version, architecture, isWindows, repoRoot) => { + return { + url: `https://mirrors.nodejs.org/dist/v${version}/node-v${version}-${architecture}.tar.gz`, + downloadName: `node-v${version}-${architecture}.tar.gz`, + downloadPath: `/mocked/path/.node_binaries/${version}/node-v${version}-${architecture}.tar.gz`, + extractDir: `/mocked/path/.node_binaries/${version}/${architecture}`, + version, + }; + }); + getNodeShasums.mockReturnValue({ 'linux:downloadName': 'linux:sha256', 'darwin:downloadName': 'darwin:sha256', @@ -134,6 +146,42 @@ it('downloads node builds for each platform', async () => { "url": "win32:url", }, ], + Array [ + Object { + "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-linux-x64.tar.gz", + "log": , + "retries": 3, + "sha256": undefined, + "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-linux-x64.tar.gz", + }, + ], + Array [ + Object { + "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-linux-arm64.tar.gz", + "log": , + "retries": 3, + "sha256": undefined, + "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-linux-arm64.tar.gz", + }, + ], + Array [ + Object { + "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-darwin-x64.tar.gz", + "log": , + "retries": 3, + "sha256": undefined, + "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-darwin-x64.tar.gz", + }, + ], + Array [ + Object { + "destination": "/mocked/path/.node_binaries/14.21.3/node-v14.21.3-win32-x64.tar.gz", + "log": , + "retries": 3, + "sha256": undefined, + "url": "https://mirrors.nodejs.org/dist/v14.21.3/node-v14.21.3-win32-x64.tar.gz", + }, + ], ] `); expect(testWriter.messages).toMatchInlineSnapshot(`Array []`); diff --git a/src/dev/build/tasks/nodejs/download_node_builds_task.ts b/src/dev/build/tasks/nodejs/download_node_builds_task.ts index 9771e92e209f..393a02176e17 100644 --- a/src/dev/build/tasks/nodejs/download_node_builds_task.ts +++ b/src/dev/build/tasks/nodejs/download_node_builds_task.ts @@ -30,16 +30,25 @@ import { download, GlobalTask } from '../../lib'; import { getNodeShasums } from './node_shasums'; -import { getLatestNodeVersion, getNodeDownloadInfo } from './node_download_info'; +import { + getNodeDownloadInfo, + getNodeVersionDownloadInfo, + getRequiredVersion, + NODE14_FALLBACK_VERSION, +} from './node_download_info'; export const DownloadNodeBuilds: GlobalTask = { global: true, description: 'Downloading node.js builds for all platforms', async run(config, log) { - const latestNodeVersion = await getLatestNodeVersion(config); - const shasums = await getNodeShasums(log, latestNodeVersion); - await Promise.all( - config.getTargetPlatforms().map(async (platform) => { + const requiredNodeVersion = getRequiredVersion(config); + const shasums = await getNodeShasums(log, requiredNodeVersion); + + // ToDo [NODE14]: Remove this Node.js 14 fallback download + const node14ShaSums = await getNodeShasums(log, NODE14_FALLBACK_VERSION); + + await Promise.all([ + ...config.getTargetPlatforms().map(async (platform) => { const { url, downloadPath, downloadName } = await getNodeDownloadInfo(config, platform); await download({ log, @@ -48,7 +57,23 @@ export const DownloadNodeBuilds: GlobalTask = { destination: downloadPath, retries: 3, }); - }) - ); + }), + // ToDo [NODE14]: Remove this Node.js 14 fallback download + ...config.getTargetPlatforms().map(async (platform) => { + const { url, downloadPath, downloadName } = await getNodeVersionDownloadInfo( + NODE14_FALLBACK_VERSION, + platform.getNodeArch(), + platform.isWindows(), + config.resolveFromRepo() + ); + await download({ + log, + url, + sha256: node14ShaSums[downloadName], + destination: downloadPath, + retries: 3, + }); + }), + ]); }, }; diff --git a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts index 02a6a7bfa723..e68539310903 100644 --- a/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/extract_node_builds_task.test.ts @@ -37,7 +37,7 @@ import { import { Config } from '../../lib'; import { ExtractNodeBuilds } from './extract_node_builds_task'; -import { getLatestNodeVersion } from './node_download_info'; +import { getRequiredVersion } from './node_download_info'; jest.mock('../../lib/fs'); jest.mock('../../lib/get_build_number'); @@ -62,7 +62,7 @@ async function setup() { }, }); - const realNodeVersion = await getLatestNodeVersion(config); + const realNodeVersion = getRequiredVersion(config); if (realNodeVersion) { expect.addSnapshotSerializer( createRecursiveSerializer( @@ -123,6 +123,27 @@ it('runs expected fs operations', async () => { "strip": 1, }, ], + Array [ + /.node_binaries/14.21.3/node-v14.21.3-linux-x64.tar.gz, + /.node_binaries/14.21.3/linux-x64, + Object { + "strip": 1, + }, + ], + Array [ + /.node_binaries/14.21.3/node-v14.21.3-linux-arm64.tar.gz, + /.node_binaries/14.21.3/linux-arm64, + Object { + "strip": 1, + }, + ], + Array [ + /.node_binaries/14.21.3/node-v14.21.3-darwin-x64.tar.gz, + /.node_binaries/14.21.3/darwin-x64, + Object { + "strip": 1, + }, + ], ], "unzip": Array [ Array [ @@ -132,6 +153,13 @@ it('runs expected fs operations', async () => { "strip": 1, }, ], + Array [ + /.node_binaries/14.21.3/node-v14.21.3-win-x64.zip, + /.node_binaries/14.21.3/win32-x64, + Object { + "strip": 1, + }, + ], ], } `); diff --git a/src/dev/build/tasks/nodejs/extract_node_builds_task.ts b/src/dev/build/tasks/nodejs/extract_node_builds_task.ts index 28b2ebe24d4b..7934718c0bce 100644 --- a/src/dev/build/tasks/nodejs/extract_node_builds_task.ts +++ b/src/dev/build/tasks/nodejs/extract_node_builds_task.ts @@ -29,21 +29,39 @@ */ import { untar, unzip, GlobalTask } from '../../lib'; -import { getNodeDownloadInfo } from './node_download_info'; +import { + getNodeDownloadInfo, + getNodeVersionDownloadInfo, + NODE14_FALLBACK_VERSION, +} from './node_download_info'; export const ExtractNodeBuilds: GlobalTask = { global: true, description: 'Extracting node.js builds for all platforms', async run(config) { - await Promise.all( - config.getTargetPlatforms().map(async (platform) => { + await Promise.all([ + ...config.getTargetPlatforms().map(async (platform) => { const { downloadPath, extractDir } = await getNodeDownloadInfo(config, platform); if (platform.isWindows()) { await unzip(downloadPath, extractDir, { strip: 1 }); } else { await untar(downloadPath, extractDir, { strip: 1 }); } - }) - ); + }), + // ToDo [NODE14]: Remove this Node.js 14 fallback download + ...config.getTargetPlatforms().map(async (platform) => { + const { downloadPath, extractDir } = await getNodeVersionDownloadInfo( + NODE14_FALLBACK_VERSION, + platform.getNodeArch(), + platform.isWindows(), + config.resolveFromRepo() + ); + if (platform.isWindows()) { + await unzip(downloadPath, extractDir, { strip: 1 }); + } else { + await untar(downloadPath, extractDir, { strip: 1 }); + } + }), + ]); }, }; diff --git a/src/dev/build/tasks/nodejs/node_download_info.ts b/src/dev/build/tasks/nodejs/node_download_info.ts index 73163bc3c30a..37eba4c29a58 100644 --- a/src/dev/build/tasks/nodejs/node_download_info.ts +++ b/src/dev/build/tasks/nodejs/node_download_info.ts @@ -28,7 +28,7 @@ * under the License. */ -import { basename } from 'path'; +import { basename, resolve } from 'path'; import fetch from 'node-fetch'; import semver from 'semver'; @@ -36,8 +36,10 @@ import { Config, Platform } from '../../lib'; const NODE_RANGE_CACHE: { [key: string]: string } = {}; +export const NODE14_FALLBACK_VERSION = '14.21.3'; + export async function getNodeDownloadInfo(config: Config, platform: Platform) { - const version = await getLatestNodeVersion(config); + const version = getRequiredVersion(config); const arch = platform.getNodeArch(); const downloadName = platform.isWindows() @@ -57,6 +59,29 @@ export async function getNodeDownloadInfo(config: Config, platform: Platform) { }; } +export async function getNodeVersionDownloadInfo( + version: string, + architecture: string, + isWindows: boolean, + repoRoot: string +) { + const downloadName = isWindows + ? `node-v${version}-win-x64.zip` + : `node-v${version}-${architecture}.tar.gz`; + + const url = `https://mirrors.nodejs.org/dist/v${version}/${downloadName}`; + const downloadPath = resolve(repoRoot, '.node_binaries', version, basename(downloadName)); + const extractDir = resolve(repoRoot, '.node_binaries', version, architecture); + + return { + url, + downloadName, + downloadPath, + extractDir, + version, + }; +} + export async function getLatestNodeVersion(config: Config) { const range = config.getNodeRange(); // Check cache and return if known @@ -76,3 +101,7 @@ export async function getLatestNodeVersion(config: Config) { return maxVersion; } + +export const getRequiredVersion = (config: Config) => { + return config.getNodeVersion(); +}; diff --git a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts index 4724fa73e9f0..1d516ce457ad 100644 --- a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts +++ b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.test.ts @@ -43,7 +43,9 @@ jest.mock('../../lib/fs'); jest.mock('../../lib/get_build_number'); const { getNodeShasums } = jest.requireMock('./node_shasums'); -const { getNodeDownloadInfo, getLatestNodeVersion } = jest.requireMock('./node_download_info'); +const { getNodeDownloadInfo, getLatestNodeVersion, getRequiredVersion } = jest.requireMock( + './node_download_info' +); const { getFileHash } = jest.requireMock('../../lib/fs'); const log = new ToolingLog(); @@ -83,6 +85,8 @@ async function setup(actualShaSums?: Record) { getLatestNodeVersion.mockReturnValue(''); + getRequiredVersion.mockReturnValue(''); + getFileHash.mockImplementation((downloadPath: string) => { if (actualShaSums?.[downloadPath]) { return actualShaSums[downloadPath]; diff --git a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.ts b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.ts index 4c64c4bbd25d..9eec2d4af8ce 100644 --- a/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.ts +++ b/src/dev/build/tasks/nodejs/verify_existing_node_builds_task.ts @@ -29,15 +29,15 @@ */ import { getFileHash, GlobalTask } from '../../lib'; -import { getNodeDownloadInfo, getLatestNodeVersion } from './node_download_info'; +import { getNodeDownloadInfo, getRequiredVersion } from './node_download_info'; import { getNodeShasums } from './node_shasums'; export const VerifyExistingNodeBuilds: GlobalTask = { global: true, description: 'Verifying previously downloaded node.js build for all platforms', async run(config, log) { - const latestNodeVersion = await getLatestNodeVersion(config); - const shasums = await getNodeShasums(log, latestNodeVersion); + const requiredNodeVersion = getRequiredVersion(config); + const shasums = await getNodeShasums(log, requiredNodeVersion); await Promise.all( config.getTargetPlatforms().map(async (platform) => { diff --git a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/opensearch-dashboards-docker b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/opensearch-dashboards-docker index de9ec4e4b5de..124a5e074842 100755 --- a/src/dev/build/tasks/os_packages/docker_generator/resources/bin/opensearch-dashboards-docker +++ b/src/dev/build/tasks/os_packages/docker_generator/resources/bin/opensearch-dashboards-docker @@ -135,7 +135,6 @@ opensearch_dashboards_vars=( tilemap.options.minZoom tilemap.options.subdomains tilemap.url - timeline.enabled vega.enableExternalUrls apm_oss.apmAgentConfigurationIndex apm_oss.indexPattern diff --git a/src/dev/build/tasks/patch_native_modules_task.test.ts b/src/dev/build/tasks/patch_native_modules_task.test.ts index f3a3daa432c3..71553d39cd9c 100644 --- a/src/dev/build/tasks/patch_native_modules_task.test.ts +++ b/src/dev/build/tasks/patch_native_modules_task.test.ts @@ -9,8 +9,8 @@ import { createAnyInstanceSerializer, createAbsolutePathSerializer, } from '@osd/dev-utils'; -import { Build, Config } from '../lib'; -import { PatchNativeModules } from './patch_native_modules_task'; +import { Build, Config, read, download, untar, gunzip } from '../lib'; +import { createPatchNativeModulesTask } from './patch_native_modules_task'; const log = new ToolingLog(); const testWriter = new ToolingLogCollectingWriter(); @@ -19,16 +19,16 @@ expect.addSnapshotSerializer(createAnyInstanceSerializer(Config)); expect.addSnapshotSerializer(createAnyInstanceSerializer(ToolingLog)); expect.addSnapshotSerializer(createAbsolutePathSerializer()); -jest.mock('../lib/download'); -jest.mock('../lib/fs', () => ({ - ...jest.requireActual('../lib/fs'), - untar: jest.fn(), - gunzip: jest.fn(), -})); - -const { untar } = jest.requireMock('../lib/fs'); -const { gunzip } = jest.requireMock('../lib/fs'); -const { download } = jest.requireMock('../lib/download'); +jest.mock('../lib', () => { + const originalModule = jest.requireActual('../lib'); + return { + ...originalModule, + download: jest.fn(), + gunzip: jest.fn(), + untar: jest.fn(), + read: jest.fn(), + }; +}); async function setup() { const config = await Config.create({ @@ -38,14 +38,15 @@ async function setup() { linux: false, linuxArm: false, darwin: false, + windows: false, }, }); const build = new Build(config); - download.mockImplementation(() => {}); - untar.mockImplementation(() => {}); - gunzip.mockImplementation(() => {}); + (read as jest.MockedFunction).mockImplementation(async () => { + return JSON.stringify({ version: mockPackage.version }); + }); return { config, build }; } @@ -55,38 +56,77 @@ beforeEach(() => { jest.clearAllMocks(); }); -it('patch native modules task downloads the correct platform package', async () => { - const { config, build } = await setup(); - config.targetPlatforms.linuxArm = true; - await PatchNativeModules.run(config, log, build); - expect(download.mock.calls.length).toBe(1); - expect(download.mock.calls).toMatchInlineSnapshot(` +const mockPackage = { + name: 'mock-native-module', + version: '1.0.0', + destinationPath: 'path/to/destination', + extractMethod: 'untar', + archives: { + 'linux-arm64': { + url: 'https://example.com/mock-native-module/linux-arm64.tar.gz', + sha256: 'mock-sha256', + }, + 'linux-x64': { + url: 'https://example.com/mock-native-module/linux-x64.gz', + sha256: 'mock-sha256', + }, + }, +}; + +describe('patch native modules task', () => { + it('patch native modules task downloads the correct platform package', async () => { + const { config, build } = await setup(); + config.targetPlatforms.linuxArm = true; + const PatchNativeModulesWithMock = createPatchNativeModulesTask([mockPackage]); + await PatchNativeModulesWithMock.run(config, log, build); + expect((download as jest.MockedFunction).mock.calls.length).toBe(1); + expect((download as jest.MockedFunction).mock.calls).toMatchInlineSnapshot(` Array [ Array [ Object { - "destination": /.native_modules/re2/linux-arm64-83.tar.gz, + "destination": /.native_modules/mock-native-module/linux-arm64.tar.gz, "log": , "retries": 3, - "sha256": "d86ced75b794fbf518b90908847b3c09a50f3ff5a2815aa30f53080f926a2873", - "url": "https://d1v1sj258etie.cloudfront.net/node-re2/releases/download/1.17.4/linux-arm64-83.tar.gz", + "sha256": "mock-sha256", + "url": "https://example.com/mock-native-module/linux-arm64.tar.gz", }, ], ] `); -}); + }); -it('for .tar.gz artifact, patch native modules task unzip it via untar', async () => { - const { config, build } = await setup(); - config.targetPlatforms.linuxArm = true; - await PatchNativeModules.run(config, log, build); - expect(untar.mock.calls.length).toBe(1); - expect(gunzip.mock.calls.length).toBe(0); -}); + it('for .tar.gz artifact, patch native modules task unzip it via untar', async () => { + const { config, build } = await setup(); + config.targetPlatforms.linuxArm = true; + const PatchNativeModulesWithMock = createPatchNativeModulesTask([mockPackage]); + await PatchNativeModulesWithMock.run(config, log, build); + expect(untar).toHaveBeenCalled(); + expect(gunzip).not.toHaveBeenCalled(); + }); -it('for .gz artifact, patch native modules task unzip it via gunzip', async () => { - const { config, build } = await setup(); - config.targetPlatforms.linux = true; - await PatchNativeModules.run(config, log, build); - expect(untar.mock.calls.length).toBe(0); - expect(gunzip.mock.calls.length).toBe(1); + it('for .gz artifact, patch native modules task unzip it via gunzip', async () => { + const mockPackageGZ = { + ...mockPackage, + extractMethod: 'gunzip', + }; + const { config, build } = await setup(); + config.targetPlatforms.linux = true; + const PatchNativeModulesWithMock = createPatchNativeModulesTask([mockPackageGZ]); + await PatchNativeModulesWithMock.run(config, log, build); + expect(gunzip).toHaveBeenCalled(); + expect(untar).not.toHaveBeenCalled(); + }); + + it('throws error for unsupported extract methods', async () => { + const mockPackageUnsupported = { + ...mockPackage, + extractMethod: 'unsupported', + }; + const { config, build } = await setup(); + config.targetPlatforms.linux = true; + const PatchNativeModulesWithMock = createPatchNativeModulesTask([mockPackageUnsupported]); + await expect(PatchNativeModulesWithMock.run(config, log, build)).rejects.toThrow( + 'Extract method of unsupported is not supported' + ); + }); }); diff --git a/src/dev/build/tasks/patch_native_modules_task.ts b/src/dev/build/tasks/patch_native_modules_task.ts index 3bd9fa63c358..b8c8d8a5b9fb 100644 --- a/src/dev/build/tasks/patch_native_modules_task.ts +++ b/src/dev/build/tasks/patch_native_modules_task.ts @@ -52,45 +52,7 @@ interface Package { >; } -/* Process for updating URLs and checksums after bumping the version of `re2` or NodeJS: - * 1. Match the `version` with the version in the yarn.lock file. - * 2. Match the module version, the digits at the end of the filename, with the output of - * `node -p process.versions.modules`. - * 3. Confirm that the URLs exist for each platform-architecture combo on - * https://github.com/uhop/node-re2/releases/tag/[VERSION]; reach out to maintainers for ARM - * releases of `re2` as they currently don't have an official ARM release. - * 4. Generate new checksums for each artifact by downloading each one and calling - * `shasum -a 256` or `sha256sum` on the downloaded file. - */ -const packages: Package[] = [ - { - name: 're2', - version: '1.17.4', - destinationPath: 'node_modules/re2/build/Release/re2.node', - extractMethod: 'gunzip', - archives: { - 'darwin-x64': { - url: 'https://github.com/uhop/node-re2/releases/download/1.17.4/darwin-x64-83.gz', - sha256: '9112ed93c1544ecc6397f7ff20bd2b28f3b04c7fbb54024e10f9a376a132a87d', - }, - 'linux-x64': { - url: 'https://github.com/uhop/node-re2/releases/download/1.17.4/linux-x64-83.gz', - sha256: '86e03540783a18c41f81df0aec320b1f64aca6cbd3a87fc1b7a9b4109c5f5986', - }, - 'linux-arm64': { - url: - 'https://d1v1sj258etie.cloudfront.net/node-re2/releases/download/1.17.4/linux-arm64-83.tar.gz', - sha256: 'd86ced75b794fbf518b90908847b3c09a50f3ff5a2815aa30f53080f926a2873', - overriddenExtractMethod: 'untar', - overriddenDestinationPath: 'node_modules/re2/build/Release', - }, - 'win32-x64': { - url: 'https://github.com/uhop/node-re2/releases/download/1.17.4/win32-x64-83.gz', - sha256: '2f842d9757288afd4bd5dec0e7b370a4c3e89ac98050598b17abb9e8e00e3294', - }, - }, - }, -]; +export const packages: Package[] = []; async function getInstalledVersion(config: Config, packageName: string) { const packageJSONPath = config.resolveFromRepo( @@ -145,15 +107,20 @@ async function patchModule( } } -export const PatchNativeModules: Task = { - description: 'Patching platform-specific native modules', - async run(config, log, build) { - for (const pkg of packages) { - await Promise.all( - config.getTargetPlatforms().map(async (platform) => { - await patchModule(config, log, build, platform, pkg); - }) - ); - } - }, -}; +export function createPatchNativeModulesTask(customPackages?: Package[]): Task { + return { + description: 'Patching platform-specific native modules', + async run(config, log, build) { + const targetPackages = customPackages || packages; + for (const pkg of targetPackages) { + await Promise.all( + config.getTargetPlatforms().map(async (platform) => { + await patchModule(config, log, build, platform, pkg); + }) + ); + } + }, + }; +} + +export const PatchNativeModules = createPatchNativeModulesTask(); diff --git a/src/dev/jest/junit_reporter.js b/src/dev/jest/junit_reporter.js index 65f244042a12..1add8e722a5a 100644 --- a/src/dev/jest/junit_reporter.js +++ b/src/dev/jest/junit_reporter.js @@ -53,7 +53,7 @@ export default class JestJUnitReporter { /** * Called by jest when all tests complete * @param {Object} contexts - * @param {JestResults} results see https://facebook.github.io/jest/docs/en/configuration.html#testresultsprocessor-string + * @param {JestResults} results see https://jestjs.io/docs/configuration/#testresultsprocessor-string * @return {undefined} */ onRunComplete(contexts, results) { diff --git a/src/dev/stylelint/lint_files.js b/src/dev/stylelint/lint_files.js index ead1fde5bb23..2d94f98b396c 100644 --- a/src/dev/stylelint/lint_files.js +++ b/src/dev/stylelint/lint_files.js @@ -30,13 +30,13 @@ import stylelint from 'stylelint'; import path from 'path'; -import { safeLoad } from 'js-yaml'; +import { load } from 'js-yaml'; import fs from 'fs'; import { createFailError } from '@osd/dev-utils'; // load the include globs from .stylelintrc.yml and convert them to regular expressions for filtering files const stylelintPath = path.resolve(__dirname, '..', '..', '..', '.stylelintrc.yml'); -const styleLintConfig = safeLoad(fs.readFileSync(stylelintPath)); +const styleLintConfig = load(fs.readFileSync(stylelintPath)); /** * Lints a list of files with eslint. eslint reports are written to the log diff --git a/src/legacy/server/logging/rotate/log_rotator.test.ts b/src/legacy/server/logging/rotate/log_rotator.test.ts index 9dbe960d405d..efb499352635 100644 --- a/src/legacy/server/logging/rotate/log_rotator.test.ts +++ b/src/legacy/server/logging/rotate/log_rotator.test.ts @@ -72,9 +72,12 @@ describe('LogRotator', () => { writeFileSync(testFilePath, ''); }); - afterEach(() => { + afterEach((done) => { del.sync(dirname(testFilePath), { force: true }); mockOn.mockClear(); + + // Tests occasionally fail complaining that `testFilePath` doesn't exist; this tries to help + setTimeout(done, 500); }); it('rotates log file when bigger than set limit on start', async () => { diff --git a/src/legacy/server/logging/rotate/log_rotator.ts b/src/legacy/server/logging/rotate/log_rotator.ts index 7502631d22dd..ac2123036b44 100644 --- a/src/legacy/server/logging/rotate/log_rotator.ts +++ b/src/legacy/server/logging/rotate/log_rotator.ts @@ -97,7 +97,7 @@ export class LogRotator { await this._startLogFileSizeMonitor(); } - stop = () => { + async stop() { if (!this.running) { return; } @@ -106,10 +106,10 @@ export class LogRotator { this._deleteExitListener(); // stop log file size monitor - this._stopLogFileSizeMonitor(); + await this._stopLogFileSizeMonitor(); this.running = false; - }; + } async _shouldUsePolling() { try { @@ -202,12 +202,12 @@ export class LogRotator { await this.throttledRotate(); }; - _stopLogFileSizeMonitor() { + async _stopLogFileSizeMonitor() { if (!this.stalker) { return; } - this.stalker.close(); + await this.stalker.close(); if (this.stalkerUsePollingPolicyTestTimeout) { clearTimeout(this.stalkerUsePollingPolicyTestTimeout); diff --git a/src/plugins/advanced_settings/public/management_app/_advanced_settings.scss b/src/plugins/advanced_settings/public/management_app/_advanced_settings.scss index 82704fc93062..a33082c3ef64 100644 --- a/src/plugins/advanced_settings/public/management_app/_advanced_settings.scss +++ b/src/plugins/advanced_settings/public/management_app/_advanced_settings.scss @@ -76,7 +76,3 @@ .mgtAdvancedSettingsForm__button { width: 100%; } - -.osdBody--mgtAdvancedSettingsHasBottomBar .mgtPage__body { - padding-bottom: $euiSizeXL * 2; -} diff --git a/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx b/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx index c5a8a89157fe..4f17ab378d3c 100644 --- a/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/field/field.test.tsx @@ -36,7 +36,7 @@ import { FieldSetting } from '../../types'; import { UiSettingsType, StringValidation } from '../../../../../../core/public'; import { notificationServiceMock, docLinksServiceMock } from '../../../../../../core/public/mocks'; -import { findTestSubject } from '@elastic/eui/lib/test'; +import { findTestSubject } from 'test_utils/helpers'; import { Field, getEditableValue } from './field'; jest.mock('brace/theme/textmate', () => 'brace/theme/textmate'); diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx index 650d8b259f0c..a0edaa5ab602 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.test.tsx @@ -29,15 +29,21 @@ */ import React from 'react'; +import ReactDOM from 'react-dom'; import { shallowWithI18nProvider, mountWithI18nProvider } from 'test_utils/enzyme_helpers'; import { UiSettingsType } from '../../../../../../core/public'; -import { findTestSubject } from '@elastic/eui/lib/test'; +import { findTestSubject } from 'test_utils/helpers'; import { notificationServiceMock } from '../../../../../../core/public/mocks'; import { SettingsChanges } from '../../types'; import { Form } from './form'; +jest.mock('react-dom', () => ({ + ...jest.requireActual('react-dom'), + createPortal: jest.fn((element) => element), +})); + jest.mock('../field', () => ({ Field: () => { return 'field'; @@ -45,6 +51,8 @@ jest.mock('../field', () => ({ })); beforeAll(() => { + ReactDOM.createPortal = jest.fn((children: any) => children); + const localStorage: Record = { 'core.chrome.isLocked': true, }; @@ -60,6 +68,7 @@ beforeAll(() => { }); afterAll(() => { + (ReactDOM.createPortal as jest.Mock).mockClear(); delete (window as any).localStorage; }); diff --git a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx index 92b7a792d2d2..a74199771d2a 100644 --- a/src/plugins/advanced_settings/public/management_app/components/form/form.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/form/form.tsx @@ -47,8 +47,9 @@ import { import { FormattedMessage } from '@osd/i18n/react'; import { isEmpty } from 'lodash'; import { i18n } from '@osd/i18n'; +import { DocLinksStart, ToastsStart } from 'opensearch-dashboards/public'; +import { createPortal } from 'react-dom'; import { toMountPoint } from '../../../../../opensearch_dashboards_react/public'; -import { DocLinksStart, ToastsStart } from '../../../../../../core/public'; import { getCategoryName } from '../../lib'; import { Field, getEditableValue } from '../field'; @@ -336,63 +337,69 @@ export class Form extends PureComponent { }; renderBottomBar = () => { - const areChangesInvalid = this.areChangesInvalid(); - return ( - - - -

{this.renderCountOfUnsaved()}

-
- - - - {i18n.translate('advancedSettings.form.cancelButtonLabel', { - defaultMessage: 'Cancel changes', - })} - - - - - + + +

{this.renderCountOfUnsaved()}

+
+ + + - {i18n.translate('advancedSettings.form.saveButtonLabel', { - defaultMessage: 'Save changes', + {i18n.translate('advancedSettings.form.cancelButtonLabel', { + defaultMessage: 'Cancel changes', })} -
-
-
-
-
- ); + + + + + + {i18n.translate('advancedSettings.form.saveButtonLabel', { + defaultMessage: 'Save changes', + })} + + + +
+ + ); + + return createPortal(bottomBar, document.getElementById('app-wrapper')!); + } catch (e) { + return null; + } }; render() { @@ -401,12 +408,6 @@ export class Form extends PureComponent { const currentCategories: Category[] = []; const hasUnsavedChanges = !isEmpty(unsavedChanges); - if (hasUnsavedChanges) { - document.body.classList.add('osdBody--mgtAdvancedSettingsHasBottomBar'); - } else { - document.body.classList.remove('osdBody--mgtAdvancedSettingsHasBottomBar'); - } - categories.forEach((category) => { if (visibleSettings[category] && visibleSettings[category].length) { currentCategories.push(category); diff --git a/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx b/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx index 34b69888b3be..f362af408e0c 100644 --- a/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/search/search.test.tsx @@ -31,7 +31,7 @@ import React from 'react'; import { shallowWithI18nProvider, mountWithI18nProvider } from 'test_utils/enzyme_helpers'; -import { findTestSubject } from '@elastic/eui/lib/test'; +import { findTestSubject } from 'test_utils/helpers'; import { Query } from '@elastic/eui'; import { Search } from './search'; diff --git a/src/plugins/advanced_settings/public/management_app/components/search/search.tsx b/src/plugins/advanced_settings/public/management_app/components/search/search.tsx index a957fa793f8f..0b1de3bbfb24 100644 --- a/src/plugins/advanced_settings/public/management_app/components/search/search.tsx +++ b/src/plugins/advanced_settings/public/management_app/components/search/search.tsx @@ -31,7 +31,6 @@ import React, { Fragment, PureComponent } from 'react'; import { i18n } from '@osd/i18n'; import { EuiSearchBar, EuiFormErrorText, Query } from '@elastic/eui'; - import { getCategoryName } from '../../lib'; interface SearchProps { @@ -111,6 +110,7 @@ export class Search extends PureComponent { return ( + {/* @ts-ignore The Query types that typescript complains about here are identical and is a false flag. Once OUI migration is complete, this ignore can be removed */} {queryParseError} diff --git a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx index 876e94d4cbcb..1c47cc41e920 100644 --- a/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx +++ b/src/plugins/console/public/application/containers/editor/legacy/console_editor/editor.tsx @@ -231,7 +231,6 @@ function EditorUI({ initialTextValue, dataSourceId }: EditorProps) { return (
-