From f1f5ee6d233c9db856cc3ecb32804ae9c04a6bfd Mon Sep 17 00:00:00 2001 From: mrmeku Date: Mon, 7 Jun 2021 09:31:02 -0600 Subject: [PATCH] feat(cypress): cypress executable toolchain (#2668) This is a major refactor the cypress_repository rule Prior to this change, the cypress CLI from NPM was invoked to download the corresponding Cypress binary. This was bad for a number of reasons. Namely it was non cachable and did not match bazel's semantics for grabbing the right binary for a particular platform / architecture The new cypress_repositories rule, downloads binaries for all platforms from Cypress's CDN and uses bazel's select logic to use the appropriate one given a particular configuration. --- WORKSPACE | 13 +- docs/Cypress.html | 411 ++++++++++++ docs/Cypress.md | 334 +++++++++- examples/cypress/BUILD.bazel | 6 +- examples/cypress/WORKSPACE | 9 +- examples/cypress/package.json | 2 +- internal/node/node.bzl | 70 +- packages/cypress/BUILD.bazel | 50 +- packages/cypress/index.bzl | 34 +- packages/cypress/install.md | 0 packages/cypress/internal/BUILD.bazel | 11 + .../cypress/internal/cypress_repositories.bzl | 113 ++++ .../cypress/internal/cypress_repository.bzl | 81 --- .../cypress/internal/cypress_web_test.bzl | 130 ++++ packages/cypress/internal/install-cypress.js | 187 ------ .../{index.template.js => index.js.tpl} | 0 packages/cypress/internal/run-cypress.js | 62 +- .../internal/template.cypress_web_test.bzl | 160 ----- .../cypress/internal/toolchain/BUILD.bazel | 79 +++ .../internal/toolchain/cypress_toolchain.bzl | 75 +++ packages/cypress/package.json | 3 - packages/cypress/test/BUILD.bazel | 18 +- packages/cypress/test/package.json | 8 +- packages/cypress/test/plugin.ts | 21 +- packages/cypress/test/tsconfig.json | 6 +- packages/cypress/test/yarn.lock | 625 ++++-------------- 26 files changed, 1390 insertions(+), 1118 deletions(-) create mode 100755 docs/Cypress.html delete mode 100644 packages/cypress/install.md create mode 100644 packages/cypress/internal/BUILD.bazel create mode 100644 packages/cypress/internal/cypress_repositories.bzl delete mode 100644 packages/cypress/internal/cypress_repository.bzl create mode 100644 packages/cypress/internal/cypress_web_test.bzl delete mode 100644 packages/cypress/internal/install-cypress.js rename packages/cypress/internal/plugins/{index.template.js => index.js.tpl} (100%) delete mode 100644 packages/cypress/internal/template.cypress_web_test.bzl create mode 100644 packages/cypress/internal/toolchain/BUILD.bazel create mode 100644 packages/cypress/internal/toolchain/cypress_toolchain.bzl diff --git a/WORKSPACE b/WORKSPACE index 621b229923..d05744c4e9 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -16,7 +16,7 @@ workspace( name = "build_bazel_rules_nodejs", managed_directories = { "@angular_deps": ["packages/angular/node_modules"], - # cypress_deps must be a managed directory to ensure it is downloaded before cypress_repository is run. + # cypress_deps must be a managed directory to ensure it is downloaded before cypress_repositories is run. "@cypress_deps": ["packages/cypress/test/node_modules"], "@internal_test_multi_linker_sub_deps": ["internal/linker/test/multi_linker/sub/node_modules"], "@npm": ["node_modules"], @@ -100,13 +100,14 @@ ts_setup_dev_workspace() # # Install @bazel/cypress dependencies # -load("//packages/cypress:index.bzl", "cypress_repository") +load("//packages/cypress:index.bzl", "cypress_repositories") -cypress_repository( +cypress_repositories( name = "cypress", - cypress_bin = "@cypress_deps//:node_modules/cypress/bin/cypress", - # Currently cypress cannot be installed on our Linux/Windows CI machines - fail_on_error = False, + darwin_sha256 = "101a0ced77fb74b356800cb3a3919f5288d23cc63fdd39a0c500673159e954fc", + linux_sha256 = "d8ea8d16fed33fdae8f17178bcae076aaf532fa7ccb48f377df1f143e60abd59", + version = "7.3.0", + windows_sha256 = "8a8809e4fd22fe7bfc3103c39df3f4fce9db0964450ce927558e9a09558cb26c", ) # Setup the rules_webtesting toolchain diff --git a/docs/Cypress.html b/docs/Cypress.html new file mode 100755 index 0000000000..95df53c285 --- /dev/null +++ b/docs/Cypress.html @@ -0,0 +1,411 @@ + + + + + + + + + + rules_nodejs - Cypress + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+ + + +
+ + +
+
+ + +

Cypress rules for Bazel

+ +

The Cypress rules run tests under the Cypress e2e testing framework with Bazel.

+ +

Installation

+ +

Add @bazel/cypress and cypress npm packages to your devDependencies in package.json.

+ +
npm install --save-dev @bazel/cypress cypress
+
+

or using yarn

+
yarn add -D @bazel/cypress cypress
+
+ +

Then, load and invoke cypress_repository within your WORKSPACE file.

+ +
# Assuming your external repository for node_modules is named @npm
+
+load("@npm//@bazel/cypress:index.bzl", "cypress_repository")
+
+# The name you pass here names the external repository you can load cypress_web_test from
+cypress_repository(name = "cypress")
+
+ +

macOS install requirements

+

On macOS, cypress_repository generates an external repository containing files whose names contain spaces. In order to make these files compatible with bazel you will need to add the following flag to your .bazelrc file:

+
# Required for cypress_repository on macOS
+build --experimental_inprocess_symlink_creation
+
+ +

windows install requirements

+

At this point in time, cypress_repository is incompatible with bazel sandboxing on Windows. This may change in the future, but for now using cypress on windows requires windows sandboxing be disabled (it is disabled by default)

+ +

Example use of cypress_web_test

+

This example assumes you’ve named your external repository for node_modules as npm and for cypress as cypress

+
load("@cypress//:index.bzl", "cypress_web_test")
+load("@npm//@bazel/typescript:index.bzl", "ts_library")
+
+# You must create a cypress plugin in order to boot a server to serve your application. It can be written as a javascript file or in typescript using ts_library or ts_project.
+ts_library(
+    name = "plugin_file",
+    testonly = True,
+    srcs = ["plugin.ts"],
+    tsconfig = ":tsconfig.json",
+    deps = [
+        "@npm//@types/node",
+        "@npm//express",
+    ],
+)
+
+# You can write your cypress tests a javascript files or in typescript using ts_library or ts_project.
+ts_library(
+    name = "hello_spec",
+    testonly = True,
+    srcs = ["hello.spec.ts"],
+    tsconfig = ":tsconfig.json",
+    deps = [
+        "@npm//cypress",
+    ],
+)
+
+cypress_web_test(
+    # The name of your test target
+    name = "test",
+    srcs = [
+        # Load javascript test files directly as sources
+        "world.spec.js",
+        # Load ts_library tests as a target to srcs
+        ":hello_spec",
+    ],
+    # A cypress config file is required
+    config_file = "cypress.json",
+    # Any runtime dependencies you need to boot your server or run your tests
+    data = [],
+    # Your cypress plugin used to configure cypress and boot your server
+    plugin_file = ":plugin_file",
+)
+
+ +

cypress_repository

+ +

USAGE

+ +
+cypress_repository(name, cypress_bin, fail_on_error, quiet, repo_mapping)
+
+ +

ATTRIBUTES

+ +

name

+ +

(Name, mandatory): A unique name for this repository.

+ +

cypress_bin

+ +

(Label): bazel target of the cypress binary

+ +

Defaults to @npm//:node_modules/cypress/bin/cypress

+ +

fail_on_error

+ +

(Boolean): If the repository rule should allow errors

+ +

Defaults to True

+ +

quiet

+ +

(Boolean): If stdout and stderr should be printed to the terminal

+ +

Defaults to True

+ +

repo_mapping

+ +

(Dictionary: String -> String, mandatory): A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.<p>For example, an entry "@foo": "@bar" declares that, for any time this repository depends on @foo (such as a dependency on @foo//some:target, it should actually resolve that dependency within globally-declared @bar (@bar//some:target).

+ + +
+
+ + +
+
+ + + + + + + + + + + + + + + + + diff --git a/docs/Cypress.md b/docs/Cypress.md index edb49c4a58..4e9c9c0d18 100755 --- a/docs/Cypress.md +++ b/docs/Cypress.md @@ -21,36 +21,36 @@ or using yarn yarn add -D @bazel/cypress cypress ``` -Then, load and invoke `cypress_repository` within your `WORKSPACE` file. +Then, load and invoke `cypress_repositories` within your `WORKSPACE` file. ```python # Assuming your external repository for node_modules is named @npm -load("@npm//@bazel/cypress:index.bzl", "cypress_repository") +load("@npm//@bazel/cypress:index.bzl", "cypress_repositories") # The name you pass here names the external repository you can load cypress_web_test from -cypress_repository(name = "cypress") +cypress_repositories(name = "cypress", version = "MATCH_VERSION_IN_PACKAGE_JSON") ``` ### macOS install requirements -On macOS, `cypress_repository` generates an external repository containing files whose names contain spaces. In order to make these files compatible with bazel you will need to add the following flag to your `.bazelrc` file: +On macOS, `cypress_repositories` generates an external repository containing files whose names contain spaces. In order to make these files compatible with bazel you will need to add the following flag to your `.bazelrc` file: ```python -# Required for cypress_repository on macOS +# Required for cypress_repositories on macOS build --experimental_inprocess_symlink_creation ``` ### windows install requirements -At this point in time, `cypress_repository` is incompatible with bazel sandboxing on Windows. This may change in the future, but for now using cypress on windows requires windows sandboxing be disabled (it is disabled by default) +At this point in time, `cypress_repositories` is incompatible with bazel sandboxing on Windows. This may change in the future, but for now using cypress on windows requires windows sandboxing be disabled (it is disabled by default) ## Example use of cypress_web_test This example assumes you've named your external repository for node_modules as `npm` and for cypress as `cypress` ```python -load("@cypress//:index.bzl", "cypress_web_test") +load("@npm//@bazel/cypress//:index.bzl", "cypress_web_test") load("@npm//@bazel/typescript:index.bzl", "ts_library") # You must create a cypress plugin in order to boot a server to serve your application. It can be written as a javascript file or in typescript using ts_library or ts_project. ts_library( - name = "plugins_file", + name = "plugin_file", testonly = True, srcs = ["plugin.ts"], tsconfig = ":tsconfig.json", @@ -85,50 +85,336 @@ cypress_web_test( # Any runtime dependencies you need to boot your server or run your tests data = [], # Your cypress plugin used to configure cypress and boot your server - plugins_file = ":plugins_file", + plugin_file = ":plugin_file", ) ``` -## cypress_repository +## cypress_toolchain **USAGE**
-cypress_repository(name, cypress_bin, fail_on_error, quiet, repo_mapping)
+cypress_toolchain(name, cypress_bin, cypress_bin_path, cypress_files)
 
+Defines a cypress toolchain. + +For usage see https://docs.bazel.build/versions/master/toolchains.html#defining-toolchains. + + +**ATTRIBUTES** + + +

name

+ +(*Name, mandatory*): A unique name for this target. + + +

cypress_bin

+ +(*Label*): A hermetically downloaded cypress executable binary for the target platform. + +Defaults to `None` + +

cypress_bin_path

+ +(*String*): Path to an existing cypress executable for the target platform. + +Defaults to `""` + +

cypress_files

+ +(*Label*): A hermetically downloaded cypress filegroup of all cypress binary files for the target platform. Must be set when cypress_bin is set. + +Defaults to `None` + + +## cypress_web_test + +**USAGE** + +
+cypress_web_test(name, chdir, config_file, configuration_env_vars, cypress_npm_package, data,
+                 default_env_vars, entry_point, env, expected_exit_code, link_workspace_root,
+                 plugin_file, srcs, templated_args)
+
+ + +Identical to `nodejs_binary`, except this can be used with `bazel test` as well. +When the binary returns zero exit code, the test passes; otherwise it fails. + +`nodejs_test` is a convenient way to write a novel kind of test based on running +your own test runner. For example, the `ts-api-guardian` library has a way to +assert the public API of a TypeScript program, and uses `nodejs_test` here: +https://github.com/angular/angular/blob/master/tools/ts-api-guardian/index.bzl + +If you just want to run a standard test using a test runner from npm, use the generated +*_test target created by npm_install/yarn_install, such as `mocha_test`. +Some test runners like Karma and Jasmine have custom rules with added features, e.g. `jasmine_node_test`. + +By default, Bazel runs tests with a working directory set to your workspace root. +Use the `chdir` attribute to change the working directory before the program starts. + +To debug a Node.js test, we recommend saving a group of flags together in a "config". +Put this in your `tools/bazel.rc` so it's shared with your team: +```python +# Enable debugging tests with --config=debug +test:debug --test_arg=--node_options=--inspect-brk --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results +``` + +Now you can add `--config=debug` to any `bazel test` command line. +The runtime will pause before executing the program, allowing you to connect a +remote debugger. **ATTRIBUTES** -

name

+

name

+ +(*Name, mandatory*): A unique name for this target. + + +

chdir

+ +(*String*): Working directory to run the binary or test in, relative to the workspace. +By default, Bazel always runs in the workspace root. +Due to implementation details, this argument must be underneath this package directory. + +To run in the directory containing the `nodejs_binary` / `nodejs_test`, use + + chdir = package_name() + +(or if you're in a macro, use `native.package_name()`) + +WARNING: this will affect other paths passed to the program, either as arguments or in configuration files, +which are workspace-relative. +You may need `../../` segments to re-relativize such paths to the new working directory. + +Defaults to `""` + +

config_file

+ +(*Label, mandatory*): cypress.json configuration file. See https://docs.cypress.io/guides/references/configuration + + +

configuration_env_vars

+ +(*List of strings*): Pass these configuration environment variables to the resulting binary. +Chooses a subset of the configuration environment variables (taken from `ctx.var`), which also +includes anything specified via the --define flag. +Note, this can lead to different outputs produced by this rule. + +Defaults to `[]` + +

cypress_npm_package

+ +(*Label*): The cypress npm package. If you installed cypress as a peer dependency, this should not need to be set. + +Defaults to `//cypress:cypress` + +

data

+ +(*List of labels*): Runtime dependencies which may be loaded during execution. + +Defaults to `[]` + +

default_env_vars

+ +(*List of strings*): Default environment variables that are added to `configuration_env_vars`. + +This is separate from the default of `configuration_env_vars` so that a user can set `configuration_env_vars` +without losing the defaults that should be set in most cases. + +The set of default environment variables is: + +- `VERBOSE_LOGS`: use by some rules & tools to turn on debug output in their logs +- `NODE_DEBUG`: used by node.js itself to print more logs +- `RUNFILES_LIB_DEBUG`: print diagnostic message from Bazel runfiles.bash helper + +Defaults to `["VERBOSE_LOGS", "NODE_DEBUG", "RUNFILES_LIB_DEBUG"]` + +

entry_point

+ +(*Label*): Entry point JS file which bootstraps the cypress cli + +Defaults to `@npm//@bazel/cypress/internal:run-cypress.js` + +

env

+ +(*Dictionary: String -> String*): Specifies additional environment variables to set when the target is executed, subject to location +expansion. + +Defaults to `{}` + +

expected_exit_code

+ +(*Integer*): The expected exit code for the test. Defaults to 0. + +Defaults to `0` + + + +(*Boolean*): Link the workspace root to the bin_dir to support absolute requires like 'my_wksp/path/to/file'. +If source files need to be required then they can be copied to the bin_dir with copy_to_bin. + +Defaults to `False` + +

plugin_file

+ +(*Label*): Your cypress plugin file. See https://docs.cypress.io/guides/tooling/plugins-guide + +Defaults to `@npm//@bazel/cypress:internal/plugins/base.js` + +

srcs

+ +(*List of labels*): A list of test files. See https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Test-files + +Defaults to `[]` + +

templated_args

+ +(*List of strings*): Arguments which are passed to every execution of the program. + To pass a node startup option, prepend it with `--node_options=`, e.g. + `--node_options=--preserve-symlinks`. + +Subject to 'Make variable' substitution. See https://docs.bazel.build/versions/master/be/make-variables.html. + +1. Subject to predefined source/output path variables substitutions. + +The predefined variables `execpath`, `execpaths`, `rootpath`, `rootpaths`, `location`, and `locations` take +label parameters (e.g. `$(execpath //foo:bar)`) and substitute the file paths denoted by that label. + +See https://docs.bazel.build/versions/master/be/make-variables.html#predefined_label_variables for more info. + +NB: This $(location) substition returns the manifest file path which differs from the *_binary & *_test +args and genrule bazel substitions. This will be fixed in a future major release. +See docs string of `expand_location_into_runfiles` macro in `internal/common/expand_into_runfiles.bzl` +for more info. + +The recommended approach is to now use `$(rootpath)` where you previously used $(location). + +To get from a `$(rootpath)` to the absolute path that `$$(rlocation $(location))` returned you can either use +`$$(rlocation $(rootpath))` if you are in the `templated_args` of a `nodejs_binary` or `nodejs_test`: + +BUILD.bazel: +```python +nodejs_test( + name = "my_test", + data = [":bootstrap.js"], + templated_args = ["--node_options=--require=$$(rlocation $(rootpath :bootstrap.js))"], +) +``` + +or if you're in the context of a .js script you can pass the $(rootpath) as an argument to the script +and use the javascript runfiles helper to resolve to the absolute path: + +BUILD.bazel: +```python +nodejs_test( + name = "my_test", + data = [":some_file"], + entry_point = ":my_test.js", + templated_args = ["$(rootpath :some_file)"], +) +``` + +my_test.js +```python +const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']); +const args = process.argv.slice(2); +const some_file = runfiles.resolveWorkspaceRelative(args[0]); +``` + +NB: Bazel will error if it sees the single dollar sign $(rlocation path) in `templated_args` as it will try to +expand `$(rlocation)` since we now expand predefined & custom "make" variables such as `$(COMPILATION_MODE)`, +`$(BINDIR)` & `$(TARGET_CPU)` using `ctx.expand_make_variables`. See https://docs.bazel.build/versions/master/be/make-variables.html. + +To prevent expansion of `$(rlocation)` write it as `$$(rlocation)`. Bazel understands `$$` to be +the string literal `$` and the expansion results in `$(rlocation)` being passed as an arg instead +of being expanded. `$(rlocation)` is then evaluated by the bash node launcher script and it calls +the `rlocation` function in the runfiles.bash helper. For example, the templated arg +`$$(rlocation $(rootpath //:some_file))` is expanded by Bazel to `$(rlocation ./some_file)` which +is then converted in bash to the absolute path of `//:some_file` in runfiles by the runfiles.bash helper +before being passed as an argument to the program. + +NB: nodejs_binary and nodejs_test will preserve the legacy behavior of `$(rlocation)` so users don't +need to update to `$$(rlocation)`. This may be changed in the future. + +2. Subject to predefined variables & custom variable substitutions. + +Predefined "Make" variables such as $(COMPILATION_MODE) and $(TARGET_CPU) are expanded. +See https://docs.bazel.build/versions/master/be/make-variables.html#predefined_variables. + +Custom variables are also expanded including variables set through the Bazel CLI with --define=SOME_VAR=SOME_VALUE. +See https://docs.bazel.build/versions/master/be/make-variables.html#custom_variables. + +Predefined genrule variables are not supported in this context. + +Defaults to `[]` + + +## cypress_repositories + +**USAGE** + +
+cypress_repositories(name, version, linux_urls, linux_sha256, darwin_urls, darwin_sha256,
+                     windows_urls, windows_sha256)
+
+ + Repository rule used to install cypress binary. + +**PARAMETERS** + + +

name

+ +Name of the external workspace where the cypress binary lives + + + +

version

+ +Version of cypress binary to use. Should match package.json + + + +

linux_urls

+ +(Optional) URLs at which the cypress binary for linux distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used. + +Defaults to `[]` + +

linux_sha256

-(*Name, mandatory*): A unique name for this repository. +(Optional) SHA-256 of the linux cypress binary +Defaults to `""` -

cypress_bin

+

darwin_urls

-(*Label*): bazel target of the cypress binary +(Optional) URLs at which the cypress binary for darwin distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used. -Defaults to `@npm//:node_modules/cypress/bin/cypress` +Defaults to `[]` -

fail_on_error

+

darwin_sha256

-(*Boolean*): If the repository rule should allow errors +(Optional) SHA-256 of the darwin cypress binary -Defaults to `True` +Defaults to `""` -

quiet

+

windows_urls

-(*Boolean*): If stdout and stderr should be printed to the terminal +(Optional) URLs at which the cypress binary for windows distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used. -Defaults to `True` +Defaults to `[]` -

repo_mapping

+

windows_sha256

-(*Dictionary: String -> String, mandatory*): A dictionary from local repository name to global repository name. This allows controls over workspace dependency resolution for dependencies of this repository.

For example, an entry `"@foo": "@bar"` declares that, for any time this repository depends on `@foo` (such as a dependency on `@foo//some:target`, it should actually resolve that dependency within globally-declared `@bar` (`@bar//some:target`). +(Optional) SHA-256 of the windows cypress binary +Defaults to `""` diff --git a/examples/cypress/BUILD.bazel b/examples/cypress/BUILD.bazel index e56a1768aa..6a8b8ce974 100644 --- a/examples/cypress/BUILD.bazel +++ b/examples/cypress/BUILD.bazel @@ -1,9 +1,9 @@ -load("@cypress//:index.bzl", "cypress_web_test") +load("@yarn//@bazel/cypress:index.bzl", "cypress_web_test") load("@yarn//@bazel/typescript:index.bzl", "ts_library") # You must create a cypress plugin in order to boot a server to serve your application. It can be written as a javascript file or in typescript using ts_library or ts_project. ts_library( - name = "plugins_file", + name = "plugin_file", testonly = True, srcs = ["plugin.ts"], tsconfig = ":tsconfig.json", @@ -38,5 +38,5 @@ cypress_web_test( # Any runtime dependencies you need to boot your server or run your tests data = ["@yarn//rxjs"], # Your cypress plugin used to configure cypress and boot your server - plugins_file = ":plugins_file", + plugin_file = ":plugin_file", ) diff --git a/examples/cypress/WORKSPACE b/examples/cypress/WORKSPACE index d23c29c6c0..360b48c616 100644 --- a/examples/cypress/WORKSPACE +++ b/examples/cypress/WORKSPACE @@ -33,9 +33,12 @@ yarn_install( yarn_lock = "//:yarn.lock", ) -load("@yarn//@bazel/cypress:index.bzl", "cypress_repository") +load("@yarn//@bazel/cypress:index.bzl", "cypress_repositories") -cypress_repository( +cypress_repositories( name = "cypress", - cypress_bin = "@yarn//:node_modules/cypress/bin/cypress", + darwin_sha256 = "101a0ced77fb74b356800cb3a3919f5288d23cc63fdd39a0c500673159e954fc", + linux_sha256 = "d8ea8d16fed33fdae8f17178bcae076aaf532fa7ccb48f377df1f143e60abd59", + version = "7.3.0", + windows_sha256 = "8a8809e4fd22fe7bfc3103c39df3f4fce9db0964450ce927558e9a09558cb26c", ) diff --git a/examples/cypress/package.json b/examples/cypress/package.json index f9510556a5..4a2bd7876d 100644 --- a/examples/cypress/package.json +++ b/examples/cypress/package.json @@ -9,7 +9,7 @@ "@bazel/ibazel": "^0.15.10", "@bazel/typescript": "^3.5.1", "@types/node": "14.0.13", - "cypress": "^4.8.0", + "cypress": "7.3.0", "rxjs": "^6.5.2", "typescript": "3.9.5" }, diff --git a/internal/node/node.bzl b/internal/node/node.bzl index 946fe1504a..b569066fd8 100644 --- a/internal/node/node.bzl +++ b/internal/node/node.bzl @@ -40,12 +40,12 @@ def _trim_package_node_modules(package_name): segments.append(n) return "/".join(segments) -def _compute_node_modules_roots(ctx): +def _compute_node_modules_roots(ctx, data): """Computes the node_modules root (if any) from data attribute.""" node_modules_roots = {} # Add in roots from third-party deps - for d in ctx.attr.data: + for d in data: if ExternalNpmPackageInfo in d: path = d[ExternalNpmPackageInfo].path workspace = d[ExternalNpmPackageInfo].workspace @@ -56,7 +56,7 @@ def _compute_node_modules_roots(ctx): node_modules_roots[path] = workspace # Add in roots for multi-linked first party deps - for dep in ctx.attr.data: + for dep in data: for k, v in getattr(dep, MODULE_MAPPINGS_ASPECT_RESULTS_NAME, {}).items(): map_key_split = k.split(":") package_name = map_key_split[0] @@ -65,12 +65,12 @@ def _compute_node_modules_roots(ctx): node_modules_roots[package_path] = "" return node_modules_roots -def _write_require_patch_script(ctx, node_modules_root): +def _write_require_patch_script(ctx, data, node_modules_root): # Generates the JavaScript snippet of module roots mappings, with each entry # in the form: # {module_name: /^mod_name\b/, module_root: 'path/to/mod_name'} module_mappings = [] - for d in ctx.attr.data: + for d in data: if hasattr(d, "runfiles_module_mappings"): for [mn, mr] in d.runfiles_module_mappings.items(): escaped = mn.replace("/", "\\/").replace(".", "\\.") @@ -145,13 +145,14 @@ def _to_execroot_path(ctx, file): def _join(*elements): return "/".join([f for f in elements if f]) -def _nodejs_binary_impl(ctx): +def _nodejs_binary_impl(ctx, data = [], runfiles = [], expanded_args = []): node_modules_manifest = write_node_modules_manifest(ctx, link_workspace_root = ctx.attr.link_workspace_root) node_modules_depsets = [] + data = ctx.attr.data + data # Also include files from npm fine grained deps as inputs. # These deps are identified by the ExternalNpmPackageInfo provider. - for d in ctx.attr.data: + for d in data: if ExternalNpmPackageInfo in d: node_modules_depsets.append(d[ExternalNpmPackageInfo].sources) @@ -164,7 +165,7 @@ def _nodejs_binary_impl(ctx): # transitive depset()s sources_depsets = [] - for d in ctx.attr.data: + for d in data: if JSModuleInfo in d: sources_depsets.append(d[JSModuleInfo].sources) @@ -176,14 +177,14 @@ def _nodejs_binary_impl(ctx): sources_depsets.append(d.files) sources = depset(transitive = sources_depsets) - node_modules_roots = _compute_node_modules_roots(ctx) + node_modules_roots = _compute_node_modules_roots(ctx, data) if "" in node_modules_roots: node_modules_root = node_modules_roots[""] + "/node_modules" else: # there are no fine grained deps but we still need a node_modules_root even if it is a non-existant one node_modules_root = "build_bazel_rules_nodejs/node_modules" - _write_require_patch_script(ctx, node_modules_root) + _write_require_patch_script(ctx, data, node_modules_root) _write_loader_script(ctx) @@ -193,7 +194,7 @@ def _nodejs_binary_impl(ctx): # Add all env vars from the ctx attr for [key, value] in ctx.attr.env.items(): - env_vars += "export %s=%s\n" % (key, expand_location_into_runfiles(ctx, value, ctx.attr.data)) + env_vars += "export %s=%s\n" % (key, expand_location_into_runfiles(ctx, value, data)) # While we can derive the workspace from the pwd when running locally # because it is in the execroot path `execroot/my_wksp`, on RBE the @@ -250,7 +251,7 @@ fi is_builtin = ctx.attr._node.label.workspace_name in ["nodejs_%s" % p for p in BUILT_IN_NODE_PLATFORMS] - runfiles = [] + runfiles = runfiles[:] runfiles.extend(node_tool_files) runfiles.extend(ctx.files._bash_runfile_helper) runfiles.append(ctx.outputs.loader_script) @@ -259,7 +260,7 @@ fi # First replace any instances of "$(rlocation " with "$$(rlocation " to preserve # legacy uses of "$(rlocation" - expanded_args = [preserve_legacy_templated_args(a) for a in ctx.attr.templated_args] + expanded_args = expanded_args + [preserve_legacy_templated_args(a) for a in ctx.attr.templated_args] # chdir has to include rlocation lookup for windows # that means we have to generate a script so there's an entry in the runfiles manifest @@ -281,7 +282,7 @@ fi # Next expand predefined source/output path variables: # $(execpath), $(rootpath) & legacy $(location) - expanded_args = [expand_location_into_runfiles(ctx, a, ctx.attr.data) for a in expanded_args] + expanded_args = [expand_location_into_runfiles(ctx, a, data) for a in expanded_args] # Finally expand predefined variables & custom variables rule_dir = _join(ctx.bin_dir.path, ctx.label.workspace_root, ctx.label.package) @@ -363,7 +364,7 @@ fi # when downstream usage is ready to rely on linker NodeRuntimeDepsInfo( deps = depset(ctx.files.entry_point, transitive = [node_modules, sources]), - pkgs = ctx.attr.data, + pkgs = data, ), # indicates that the this binary should be instrumented by coverage # see https://docs.bazel.build/versions/master/skylark/lib/coverage_common.html @@ -621,25 +622,21 @@ _NODEJS_EXECUTABLE_OUTPUTS = { "require_patch_script": "%{name}_require_patch.js", } -# The name of the declared rule appears in -# bazel query --output=label_kind -# So we make these match what the user types in their BUILD file -# and duplicate the definitions to give two distinct symbols. -nodejs_binary = rule( - implementation = _nodejs_binary_impl, - attrs = _NODEJS_EXECUTABLE_ATTRS, - doc = "Runs some JavaScript code in NodeJS.", - executable = True, - outputs = _NODEJS_EXECUTABLE_OUTPUTS, - toolchains = [ +nodejs_binary_kwargs = { + "attrs": _NODEJS_EXECUTABLE_ATTRS, + "doc": "Runs some JavaScript code in NodeJS.", + "executable": True, + "implementation": _nodejs_binary_impl, + "outputs": _NODEJS_EXECUTABLE_OUTPUTS, + "toolchains": [ "@build_bazel_rules_nodejs//toolchains/node:toolchain_type", "@bazel_tools//tools/sh:toolchain_type", ], -) +} -nodejs_test = rule( - implementation = _nodejs_binary_impl, - attrs = dict(_NODEJS_EXECUTABLE_ATTRS, **{ +nodejs_test_kwargs = dict( + nodejs_binary_kwargs, + attrs = dict(nodejs_binary_kwargs["attrs"], **{ "expected_exit_code": attr.int( doc = "The expected exit code for the test. Defaults to 0.", default = 0, @@ -679,9 +676,12 @@ The runtime will pause before executing the program, allowing you to connect a remote debugger. """, test = True, - outputs = _NODEJS_EXECUTABLE_OUTPUTS, - toolchains = [ - "@build_bazel_rules_nodejs//toolchains/node:toolchain_type", - "@bazel_tools//tools/sh:toolchain_type", - ], ) + +# The name of the declared rule appears in +# bazel query --output=label_kind +# So we make these match what the user types in their BUILD file +# and duplicate the definitions to give two distinct symbols. +nodejs_binary = rule(**nodejs_binary_kwargs) + +nodejs_test = rule(**nodejs_test_kwargs) diff --git a/packages/cypress/BUILD.bazel b/packages/cypress/BUILD.bazel index 8c287277e8..d1c3d51638 100644 --- a/packages/cypress/BUILD.bazel +++ b/packages/cypress/BUILD.bazel @@ -19,25 +19,23 @@ load("//third_party/github.com/bazelbuild/bazel-skylib:rules/copy_file.bzl", "co package(default_visibility = ["//visibility:public"]) -exports_files( - [ - "internal/plugins/index.template.js", - "internal/run-cypress.js", - ], - visibility = ["//packages/cypress/test:__subpackages__"], -) - codeowners( teams = ["@mrmeku"], ) bzl_library( name = "bzl", - srcs = glob(["**/*.bzl"]), + srcs = [ + ":index.bzl", + "//packages/cypress/internal:cypress_repositories.bzl", + "//packages/cypress/internal:cypress_web_test.bzl", + "//packages/cypress/internal/toolchain:cypress_toolchain.bzl", + "@bazel_tools//tools:bzl_srcs", + ], deps = [ - "@build_bazel_rules_nodejs//:bzl", - "@build_bazel_rules_nodejs//internal/common:bzl", - "@build_bazel_rules_nodejs//internal/node:bzl", + "//:bzl", + "//internal/common:bzl", + "//internal/node:bzl", ], ) @@ -61,26 +59,18 @@ pkg_npm( srcs = [ "index.bzl", "package.json", - "//packages/cypress:internal/cypress_repository.bzl", - "//packages/cypress:internal/install-cypress.js", - "//packages/cypress:internal/plugins/base.js", - "//packages/cypress:internal/plugins/index.template.js", - "//packages/cypress:internal/run-cypress.js", - "//packages/cypress:internal/template.cypress_web_test.bzl", + "//packages/cypress/internal:BUILD.bazel", + "//packages/cypress/internal:cypress_repositories.bzl", + "//packages/cypress/internal:cypress_web_test.bzl", + "//packages/cypress/internal:plugins/base.js", + "//packages/cypress/internal:plugins/index.js.tpl", + "//packages/cypress/internal:run-cypress.js", + "//packages/cypress/internal/toolchain:BUILD.bazel", + "//packages/cypress/internal/toolchain:cypress_toolchain.bzl", ], - build_file_content = """exports_files([ - "internal/plugins/base.js", - "internal/plugins/index.template.js", - "internal/run-cypress.js", - "plugins/base.js", -])""", + build_file_content = "", substitutions = { - "@build_bazel_rules_nodejs//packages/cypress:internal/cypress_repository.bzl": "//packages/cypress:internal/cypress_repository.bzl", - "@build_bazel_rules_nodejs//packages/cypress:internal/install-cypress.js": "TEMPLATED_node_modules_workspace_name//@bazel/cypress:internal/install-cypress.js", - "@build_bazel_rules_nodejs//packages/cypress:internal/plugins/base.js": "TEMPLATED_node_modules_workspace_name//@bazel/cypress:internal/plugins/base.js", - "@build_bazel_rules_nodejs//packages/cypress:internal/plugins/index.template.js": "TEMPLATED_node_modules_workspace_name//@bazel/cypress:internal/plugins/index.template.js", - "@build_bazel_rules_nodejs//packages/cypress:internal/run-cypress.js": "TEMPLATED_node_modules_workspace_name//@bazel/cypress:internal/run-cypress.js", - "TEMPLATED_node_modules_workspace_name//tar": "TEMPLATED_node_modules_workspace_name//@bazel/cypress", + "@build_bazel_rules_nodejs//packages/cypress/internal": "//@bazel/cypress/internal", }, deps = [ ":README.md", diff --git a/packages/cypress/index.bzl b/packages/cypress/index.bzl index eb2cbfe00e..c4260abaf1 100644 --- a/packages/cypress/index.bzl +++ b/packages/cypress/index.bzl @@ -29,36 +29,36 @@ or using yarn yarn add -D @bazel/cypress cypress ``` -Then, load and invoke `cypress_repository` within your `WORKSPACE` file. +Then, load and invoke `cypress_repositories` within your `WORKSPACE` file. ```python # Assuming your external repository for node_modules is named @npm -load("@npm//@bazel/cypress:index.bzl", "cypress_repository") +load("@npm//@bazel/cypress:index.bzl", "cypress_repositories") # The name you pass here names the external repository you can load cypress_web_test from -cypress_repository(name = "cypress") +cypress_repositories(name = "cypress", version = "MATCH_VERSION_IN_PACKAGE_JSON") ``` ### macOS install requirements -On macOS, `cypress_repository` generates an external repository containing files whose names contain spaces. In order to make these files compatible with bazel you will need to add the following flag to your `.bazelrc` file: +On macOS, `cypress_repositories` generates an external repository containing files whose names contain spaces. In order to make these files compatible with bazel you will need to add the following flag to your `.bazelrc` file: ```python -# Required for cypress_repository on macOS +# Required for cypress_repositories on macOS build --experimental_inprocess_symlink_creation ``` ### windows install requirements -At this point in time, `cypress_repository` is incompatible with bazel sandboxing on Windows. This may change in the future, but for now using cypress on windows requires windows sandboxing be disabled (it is disabled by default) +At this point in time, `cypress_repositories` is incompatible with bazel sandboxing on Windows. This may change in the future, but for now using cypress on windows requires windows sandboxing be disabled (it is disabled by default) ## Example use of cypress_web_test This example assumes you've named your external repository for node_modules as `npm` and for cypress as `cypress` ```python -load("@cypress//:index.bzl", "cypress_web_test") +load("@npm//@bazel/cypress//:index.bzl", "cypress_web_test") load("@npm//@bazel/typescript:index.bzl", "ts_library") # You must create a cypress plugin in order to boot a server to serve your application. It can be written as a javascript file or in typescript using ts_library or ts_project. ts_library( - name = "plugins_file", + name = "plugin_file", testonly = True, srcs = ["plugin.ts"], tsconfig = ":tsconfig.json", @@ -93,14 +93,24 @@ cypress_web_test( # Any runtime dependencies you need to boot your server or run your tests data = [], # Your cypress plugin used to configure cypress and boot your server - plugins_file = ":plugins_file", + plugin_file = ":plugin_file", ) ``` """ load( - "@build_bazel_rules_nodejs//packages/cypress:internal/cypress_repository.bzl", - _cypress_repository = "cypress_repository", + "@build_bazel_rules_nodejs//packages/cypress/internal:cypress_repositories.bzl", + _cypress_repositories = "cypress_repositories", +) +load( + "@build_bazel_rules_nodejs//packages/cypress/internal:cypress_web_test.bzl", + _cypress_web_test = "cypress_web_test", +) +load( + "@build_bazel_rules_nodejs//packages/cypress/internal/toolchain:cypress_toolchain.bzl", + _cypress_toolchain = "cypress_toolchain", ) -cypress_repository = _cypress_repository +cypress_repositories = _cypress_repositories +cypress_web_test = _cypress_web_test +cypress_toolchain = _cypress_toolchain diff --git a/packages/cypress/install.md b/packages/cypress/install.md deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/packages/cypress/internal/BUILD.bazel b/packages/cypress/internal/BUILD.bazel new file mode 100644 index 0000000000..03dae2ef9a --- /dev/null +++ b/packages/cypress/internal/BUILD.bazel @@ -0,0 +1,11 @@ +exports_files( + [ + "cypress_repositories.bzl", + "cypress_web_test.bzl", + "plugins/base.js", + "plugins/index.js.tpl", + "run-cypress.js", + "BUILD.bazel", + ], + visibility = ["//visibility:public"], +) diff --git a/packages/cypress/internal/cypress_repositories.bzl b/packages/cypress/internal/cypress_repositories.bzl new file mode 100644 index 0000000000..7bab3d687d --- /dev/null +++ b/packages/cypress/internal/cypress_repositories.bzl @@ -0,0 +1,113 @@ +# Copyright 2020 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""Repository rule used to install cypress binary. +""" + +load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") + +def cypress_repositories( + name, + version, + linux_urls = [], + linux_sha256 = "", + darwin_urls = [], + darwin_sha256 = "", + windows_urls = [], + windows_sha256 = ""): + """ + Repository rule used to install cypress binary. + + Args: + name: Name of the external workspace where the cypress binary lives + version: Version of cypress binary to use. Should match package.json + linux_urls: (Optional) URLs at which the cypress binary for linux distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used. + linux_sha256: (Optional) SHA-256 of the linux cypress binary + darwin_urls: (Optional) URLs at which the cypress binary for darwin distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used. + darwin_sha256: (Optional) SHA-256 of the darwin cypress binary + windows_urls: (Optional) URLs at which the cypress binary for windows distros of linux can be downloaded. If omitted, https://cdn.cypress.io/desktop will be used. + windows_sha256: (Optional) SHA-256 of the windows cypress binary + """ + http_archive( + name = "cypress_windows".format(name), + sha256 = windows_sha256, + urls = windows_urls + [ + "https://cdn.cypress.io/desktop/{}/win32-x64/cypress.zip".format(version), + ], + strip_prefix = "Cypress", + build_file_content = """ +filegroup( + name = "files", + srcs = glob(["**"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "bin", + srcs = ["Cypress.exe"], + visibility = ["//visibility:public"], +) +""", + ) + + http_archive( + name = "cypress_darwin".format(name), + sha256 = darwin_sha256, + # Cypress checks that the binary path matches **/Contents/MacOS/Cypress so we do not strip that particular prefix. + strip_prefix = "Cypress.app", + urls = darwin_urls + [ + "https://cdn.cypress.io/desktop/{}/darwin-x64/cypress.zip".format(version), + ], + build_file_content = """ +filegroup( + name = "files", + srcs = glob(["**"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "bin", + # Cypress checks that the binary path matches **/Contents/MacOS/Cypress + srcs = ["Contents/MacOS/Cypress"], + visibility = ["//visibility:public"], +) +""", + ) + + http_archive( + name = "cypress_linux".format(name), + sha256 = linux_sha256, + strip_prefix = "Cypress", + urls = linux_urls + [ + "https://cdn.cypress.io/desktop/{}/linux-x64/cypress.zip".format(version), + ], + build_file_content = """ +filegroup( + name = "files", + srcs = glob(["**"]), + visibility = ["//visibility:public"], +) + +filegroup( + name = "bin", + srcs = ["Cypress"], + visibility = ["//visibility:public"], +) +""", + ) + + # This needs to be setup so toolchains can access nodejs for all different versions + for os_name in ["windows", "darwin", "linux"]: + toolchain_label = Label("@build_bazel_rules_nodejs//packages/cypress/internal/toolchain:cypress_{}_toolchain".format(os_name)) + native.register_toolchains("@{}//{}:{}".format(toolchain_label.workspace_name, toolchain_label.package, toolchain_label.name)) diff --git a/packages/cypress/internal/cypress_repository.bzl b/packages/cypress/internal/cypress_repository.bzl deleted file mode 100644 index 6eacf8fcd1..0000000000 --- a/packages/cypress/internal/cypress_repository.bzl +++ /dev/null @@ -1,81 +0,0 @@ -# Copyright 2020 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -"""Repository rule used to install cypress binary. -""" - -load("@build_bazel_rules_nodejs//internal/node:node_labels.bzl", "get_node_label") - -def _cypress_repository_impl(repository_ctx): - node = repository_ctx.path(get_node_label(repository_ctx)) - - install_cypress = "packages/cypress/internal/install-cypress.js" - repository_ctx.template( - install_cypress, - repository_ctx.path(repository_ctx.attr._install_cypress), - {}, - ) - - repository_ctx.template( - "plugins/base.js", - repository_ctx.path(repository_ctx.attr._base_plugin), - {}, - ) - - repository_ctx.template( - "packages/cypress/internal/cypress_web_test.bzl", - repository_ctx.path(repository_ctx.attr._cypress_web_test), - { - "TEMPLATED_node_modules_workspace_name//": "@{}//".format(repository_ctx.attr.cypress_bin.workspace_name), - }, - ) - - exec_result = repository_ctx.execute( - [node, install_cypress, repository_ctx.path(repository_ctx.attr.cypress_bin)], - quiet = repository_ctx.attr.quiet, - ) - - if exec_result.return_code != 0 and repository_ctx.attr.fail_on_error: - fail("\ncypress_repository exited with code: {}\n\nstdout:\n{}\n\nstderr:\n{}\n\n".format(exec_result.return_code, exec_result.stdout, exec_result.stderr)) - -cypress_repository = repository_rule( - implementation = _cypress_repository_impl, - attrs = { - "cypress_bin": attr.label( - doc = "bazel target of the cypress binary", - allow_single_file = True, - default = "@npm//:node_modules/cypress/bin/cypress", - ), - "fail_on_error": attr.bool( - default = True, - doc = "If the repository rule should allow errors", - ), - "quiet": attr.bool( - default = True, - doc = "If stdout and stderr should be printed to the terminal", - ), - "_base_plugin": attr.label( - allow_single_file = True, - default = "//packages/cypress:internal/plugins/base.js", - ), - "_cypress_web_test": attr.label( - allow_single_file = True, - default = "//packages/cypress:internal/template.cypress_web_test.bzl", - ), - "_install_cypress": attr.label( - allow_single_file = True, - default = "//packages/cypress:internal/install-cypress.js", - ), - }, -) diff --git a/packages/cypress/internal/cypress_web_test.bzl b/packages/cypress/internal/cypress_web_test.bzl new file mode 100644 index 0000000000..65a7cf9249 --- /dev/null +++ b/packages/cypress/internal/cypress_web_test.bzl @@ -0,0 +1,130 @@ +# Copyright 2020 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +"E2E testing with Cypress" + +load("@build_bazel_rules_nodejs//:providers.bzl", "JSNamedModuleInfo") +load("@build_bazel_rules_nodejs//internal/node:node.bzl", "nodejs_test_kwargs") + +ATTRS = dict( + nodejs_test_kwargs["attrs"], + config_file = attr.label( + allow_single_file = [".json"], + mandatory = True, + doc = "cypress.json configuration file. See https://docs.cypress.io/guides/references/configuration", + ), + cypress_npm_package = attr.label( + doc = "The cypress npm package. If you installed cypress as a peer dependency, this should not need to be set.", + default = Label("//cypress"), + allow_files = True, + ), + entry_point = attr.label( + doc = """Entry point JS file which bootstraps the cypress cli""", + allow_single_file = True, + default = Label("@build_bazel_rules_nodejs//packages/cypress/internal:run-cypress.js"), + ), + plugin_file = attr.label( + default = Label("@build_bazel_rules_nodejs//packages/cypress:internal/plugins/base.js"), + allow_single_file = True, + doc = "Your cypress plugin file. See https://docs.cypress.io/guides/tooling/plugins-guide", + ), + srcs = attr.label_list( + doc = "A list of test files. See https://docs.cypress.io/guides/core-concepts/writing-and-organizing-tests#Test-files", + allow_files = True, + ), + # Unused by this rule, but here to require that a user supplies one for the downstream nodejs_test + _plugin_wrapper = attr.label( + default = Label("@build_bazel_rules_nodejs//packages/cypress/internal:plugins/index.js.tpl"), + allow_single_file = True, + ), +) + +def _filter_js(files): + return [f for f in files if f.extension == "js" or f.extension == "mjs"] + +def _cypress_plugin_wrapper(ctx): + plugin_file = None + + # TODO: switch to JSModuleInfo when it is available + if JSNamedModuleInfo in ctx.attr.plugin_file: + plugin_file = _filter_js(ctx.attr.plugin_file[JSNamedModuleInfo].direct_sources.to_list())[0] + else: + plugin_file = ctx.file.plugin_file + + # TODO: switch to JSModuleInfo when it is available + integration_files = [] + for src in ctx.attr.srcs: + if JSNamedModuleInfo in src: + integration_files.append(src[JSNamedModuleInfo].direct_sources) + + integration_files_short_paths = ["'{}'".format(f.short_path) for f in _filter_js(depset(direct = ctx.files.srcs, transitive = integration_files).to_list())] + + plugin_file_wrapper = ctx.actions.declare_file("{}_cypress_plugin_wrapper.js".format(ctx.attr.name)) + + ctx.actions.expand_template( + output = plugin_file_wrapper, + template = ctx.file._plugin_wrapper, + substitutions = { + "TEMPLATED_integrationFileShortPaths": "[\n {files}\n]".format(files = ",\n ".join(integration_files_short_paths)), + "TEMPLATED_pluginsFile": plugin_file.short_path, + }, + ) + + return plugin_file_wrapper + +def _cypress_web_test_impl(ctx): + plugin_wrapper = _cypress_plugin_wrapper(ctx) + + cypressinfo = ctx.toolchains[Label("@build_bazel_rules_nodejs//packages/cypress/internal/toolchain:toolchain_type")].cypressinfo + + expanded_args = [ + ctx.file.config_file.short_path, + plugin_wrapper.short_path, + cypressinfo.cypress_bin_path, + ] + + runfiles = ( + [plugin_wrapper] + + ctx.files.config_file + + ctx.files.cypress_npm_package + + ctx.files.plugin_file + + ctx.files.srcs + + cypressinfo.cypress_files + ) + + data = [ + ctx.attr.config_file, + ctx.attr.cypress_npm_package, + ctx.attr.plugin_file, + ctx.attr.srcs, + ] + + return nodejs_test_kwargs["implementation"]( + ctx, + data = data, + runfiles = runfiles, + expanded_args = expanded_args, + ) + +toolchain_type_label = Label("@build_bazel_rules_nodejs//packages/cypress/internal/toolchain:toolchain_type") + +_cypress_web_test_kwargs = dict( + nodejs_test_kwargs, + implementation = _cypress_web_test_impl, + attrs = ATTRS, + toolchains = nodejs_test_kwargs["toolchains"] + [ + "@{}//{}:{}".format(toolchain_type_label.workspace_name, toolchain_type_label.package, toolchain_type_label.name), + ], +) + +cypress_web_test = rule(**_cypress_web_test_kwargs) diff --git a/packages/cypress/internal/install-cypress.js b/packages/cypress/internal/install-cypress.js deleted file mode 100644 index 7ff7feeb46..0000000000 --- a/packages/cypress/internal/install-cypress.js +++ /dev/null @@ -1,187 +0,0 @@ -/** - * install-cypress is responsible for creating an external repository from which a cypress_web_test - * can be loaded. The script invokes `cypress install` to download and install the cypress binary - * and subsequently calls cypress verify to ensure the binary is runnable. - * - * On macOS, cypress needs to create files and directories during its first run. This script also - * run a hello world cypress tests so that cypress can create files and directories it will need at - * runtime. During bazel test, the file system is readonly so we create these files within a - * repository rule while the file system remains read/write. - */ - -const {spawnSync} = require('child_process'); -const {readdirSync, statSync, writeFileSync, mkdirSync, createWriteStream} = require('fs'); -const { - join, - basename, - relative, - dirname, -} = require('path'); - -const nodePath = process.argv[1]; -const cwd = process.cwd(); -const cypressBin = process.argv[2]; - -const nodeModulesPath = join(cypressBin.split('node_modules')[0], 'node_modules'); -const tar = require(require.resolve('tar', { - paths: [ - join(nodeModulesPath, '@bazel', 'cypress', 'node_modules'), - nodeModulesPath, - ] -})); - -async function main() { - // Sandboxing doesn't work on windows, so we can just use the global cypress cache. - if (process.platform === 'win32') { - installGlobalCypressCache(); - process.exit(0); - } - - // Attempt to install the cypress cache within the bazel sandbox and fallback to a global cypress - // cache as a last resort. - try { - await installSandboxedCypressCache() - } catch (e) { - console.error('ERROR', e); - installGlobalCypressCache(); - } -} - -function installGlobalCypressCache() { - writeFileSync('BUILD.bazel', `package(default_visibility = ["//visibility:public"]) -exports_files([ - "packages/cypress/internal/plugins/index.template.js", - "packages/cypress/internal/plugins/base.js", -])`); - writeFileSync('index.bzl', `load( - "//:packages/cypress/internal/cypress_web_test.bzl", - _cypress_web_test = "cypress_web_test_global_cache", -) -cypress_web_test = _cypress_web_test`) - - const env = { - PATH: `${dirname(nodePath)}:${process.env.PATH}`, - }; - const spawnOptions = { - env, - stdio: [process.stdin, process.stdout, process.stderr], - shell: process.env.SHELL - }; - - const install = spawnSync(`${cypressBin}`, ['install'], spawnOptions); - if (install.status !== 0) { - throw new Error('cypress install failed') - } - - const verify = spawnSync(`${cypressBin}`, ['verify'], spawnOptions); - - if (verify.status !== 0) { - throw new Error('cypress verify failed') - } -} - - -async function installSandboxedCypressCache() { - mkdirSync(join(cwd, 'cypress-install')) - - const env = { - CYPRESS_CACHE_FOLDER: join(cwd, 'cypress-install'), - PATH: `${dirname(nodePath)}:${process.env.PATH}`, - DEBUG: 'cypress:*' - } - - const spawnOptions = - {env, stdio: [process.stdin, process.stdout, process.stderr], shell: process.env.SHELL}; - - const install = spawnSync(`${cypressBin}`, ['install'], spawnOptions); - - if (install.status !== 0) { - throw new Error(`${cypressBin} install error: ${install.error}`) - } - - function walkDir(dir, callback) { - readdirSync(dir).forEach(f => { - let dirPath = join(dir, f); - let isDirectory = statSync(dirPath).isDirectory(); - isDirectory ? walkDir(dirPath, callback) : callback(join(dir, f)); - }); - }; - - let CYPRESS_RUN_BINARY; - walkDir(env.CYPRESS_CACHE_FOLDER, (filePath) => { - if (basename(filePath) === 'Cypress') { - if (CYPRESS_RUN_BINARY) { - throw new Error(`More than one cypress executable found: ${CYPRESS_RUN_BINARY} ${filePath}`) - } - - CYPRESS_RUN_BINARY = filePath; - } - }); - - if (!CYPRESS_RUN_BINARY) { - throw new Error(`No cypress executable found.`); - } - - spawnOptions.env.CYPRESS_RUN_BINARY = CYPRESS_RUN_BINARY; - - const verify = spawnSync(cypressBin, ['verify'], spawnOptions); - - if (verify.status !== 0) { - throw new Error(`cypress verify failed`); - } - - writeFileSync(join(env.CYPRESS_CACHE_FOLDER, 'bazel_cypress.json'), JSON.stringify({ - cypressExecutable: relative(cwd, CYPRESS_RUN_BINARY), - })); - - const cacheFiles = []; - walkDir(env.CYPRESS_CACHE_FOLDER, (filePath) => { - cacheFiles.push(relative(cwd, filePath)); - }); - - const archiveName = 'cypress.archive'; - await createCypressArchive(cacheFiles, join(cwd, archiveName)); - - writeFileSync('index.bzl', `load( - "//:packages/cypress/internal/cypress_web_test.bzl", - _cypress_web_test = "cypress_web_test", -) -cypress_web_test = _cypress_web_test`) - writeFileSync('BUILD.bazel', ` -package(default_visibility = ["//visibility:public"]) - -exports_files([ - "packages/cypress/internal/plugins/index.template.js", - "packages/cypress/internal/plugins/base.js", -]) - -filegroup( - name = "cypress_archive", - srcs = ["${relative(cwd, archiveName)}"], -) -`.trim()) -} - -function createCypressArchive(cypressFiles, archiveName) { - return new Promise((resolve, reject) => { - const writeStream = createWriteStream(archiveName); - - tar.create( - { - gzip: false, - portable: true, - noMtime: true, - }, - cypressFiles) - .pipe(writeStream) - .on('finish', (err) => { - if (err) { - return reject(err); - } - - return resolve(); - }) - }); -} - -main() \ No newline at end of file diff --git a/packages/cypress/internal/plugins/index.template.js b/packages/cypress/internal/plugins/index.js.tpl similarity index 100% rename from packages/cypress/internal/plugins/index.template.js rename to packages/cypress/internal/plugins/index.js.tpl diff --git a/packages/cypress/internal/run-cypress.js b/packages/cypress/internal/run-cypress.js index e6b562f0c8..a50ee048e8 100644 --- a/packages/cypress/internal/run-cypress.js +++ b/packages/cypress/internal/run-cypress.js @@ -1,76 +1,24 @@ -const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']); const init = require('cypress/lib/cli').init; const {join} = require('path'); -const {readFileSync} = require('fs'); -const [node, entry, configFilePath, pluginsFilePath, cypressTarPath, cypressBin, ...args] = - process.argv; - -const pluginsFile = runfiles.resolveWorkspaceRelative(pluginsFilePath).replace(process.cwd(), '.'); -const configFile = runfiles.resolveWorkspaceRelative(configFilePath).replace(process.cwd(), '.'); +const [node, entry, configFilePath, pluginsFilePath, cypressBin, ...args] = process.argv; async function invokeCypressWithCommand(command) { process.env.HOME = process.env['TEST_TMPDIR']; - if (cypressTarPath) { - const resolvedArchivePath = join(cypressTarPath.replace('external/', '../')); - await untarCypress(resolvedArchivePath, join(process.env['TEST_TMPDIR'])) - } + // NOTE: Use join since cypressBin is a relative path. + process.env.CYPRESS_RUN_BINARY = join(process.cwd(), cypressBin); init([ node, entry, command, - '--config-file', - configFile, - '--config', - `pluginsFile=${pluginsFile}`, + `--config-file=${configFilePath}`, + `--config=pluginsFile=${pluginsFilePath}`, ...args, ]); } - - -function untarCypress(cypressTarPath, outputPath) { - return new Promise((resolve, reject) => { - const nodeModulesPath = join( - process.cwd(), cypressBin.replace('external/', '../').split('node_modules')[0], - 'node_modules'); - - const tar = require(require.resolve('tar', { - paths: [ - join(nodeModulesPath, '@bazel', 'cypress', 'node_modules'), - nodeModulesPath, - ] - })); - - - tar.x( - { - cwd: outputPath, - file: cypressTarPath, - noMtime: true, - }, - err => { - if (err) { - return reject(err); - } - - try { - const {cypressExecutable} = - JSON.parse(readFileSync(join(outputPath, 'cypress-install', 'bazel_cypress.json'))); - - process.env.CYPRESS_RUN_BINARY = join(outputPath, cypressExecutable); - process.env.CYPRESS_CACHE_FOLDER = outputPath; - } catch (err) { - return reject(err) - } - - return resolve(); - }) - }); -} - async function main() { try { // Detect that we are running as a test, by using well-known environment diff --git a/packages/cypress/internal/template.cypress_web_test.bzl b/packages/cypress/internal/template.cypress_web_test.bzl deleted file mode 100644 index 6a895493ec..0000000000 --- a/packages/cypress/internal/template.cypress_web_test.bzl +++ /dev/null @@ -1,160 +0,0 @@ -# Copyright 2020 The Bazel Authors. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -"E2E testing with Cypress" - -load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test") -load("@build_bazel_rules_nodejs//:providers.bzl", "JSNamedModuleInfo") - -def _filter_js(files): - return [f for f in files if f.extension == "js" or f.extension == "mjs"] - -def _cypress_plugin_impl(ctx): - plugins_file = None - - # TODO: switch to JSModuleInfo when it is available - if JSNamedModuleInfo in ctx.attr.plugins_file: - plugins_file = _filter_js(ctx.attr.plugins_file[JSNamedModuleInfo].direct_sources.to_list())[0] - else: - plugins_file = ctx.file.plugins_file - - # TODO: switch to JSModuleInfo when it is available - integration_files = [] - for src in ctx.attr.srcs: - if JSNamedModuleInfo in src: - integration_files.append(src[JSNamedModuleInfo].direct_sources) - - integration_files_short_paths = ["'{}'".format(f.short_path) for f in _filter_js(depset(direct = ctx.files.srcs, transitive = integration_files).to_list())] - - ctx.actions.expand_template( - output = ctx.outputs.plugin, - template = ctx.file._plugin_template, - substitutions = { - "TEMPLATED_integrationFileShortPaths": "[\n {files}\n]".format(files = ",\n ".join(integration_files_short_paths)), - "TEMPLATED_pluginsFile": plugins_file.short_path, - }, - ) - - return [DefaultInfo( - files = depset([ctx.outputs.plugin]), - )] - -_cypress_plugin = rule( - implementation = _cypress_plugin_impl, - outputs = {"plugin": "%{name}_cypress_plugin.js"}, - attrs = { - "config_file": attr.label( - allow_single_file = [".json"], - mandatory = True, - ), - "plugins_file": attr.label( - default = Label("@build_bazel_rules_nodejs//packages/cypress:internal/plugins/base.js"), - allow_single_file = True, - ), - "srcs": attr.label_list( - doc = "A list of JavaScript test files", - allow_files = True, - ), - # Unused by this rule, but here to require that a user supplies one for the downstream nodejs_test - "_plugin_template": attr.label( - default = Label("@build_bazel_rules_nodejs//packages/cypress:internal/plugins/index.template.js"), - allow_single_file = True, - ), - }, -) - -def cypress_web_test( - name, - config_file, - srcs = [], - plugins_file = Label("//plugins/base.js"), - data = [], - templated_args = [], - cypress = Label("TEMPLATED_node_modules_workspace_name//cypress"), - cypress_archive = Label("//:cypress_archive"), - cypress_bin = Label("TEMPLATED_node_modules_workspace_name//:node_modules/cypress/bin/cypress"), - tar = Label("TEMPLATED_node_modules_workspace_name//tar"), - **kwargs): - cypress_plugin = "{name}_cypress_plugin".format(name = name) - tags = kwargs.pop("tags", []) + ["cypress"] - - _cypress_plugin( - name = cypress_plugin, - srcs = srcs, - tags = tags, - plugins_file = plugins_file, - config_file = config_file, - testonly = True, - visibility = ["//visibility:private"], - ) - - nodejs_test( - name = name, - tags = tags, - data = data + [ - plugins_file, - cypress_archive, - cypress_bin, - cypress, - tar, - "{cypress_plugin}".format(cypress_plugin = cypress_plugin), - "{config_file}".format(config_file = config_file), - ] + srcs, - entry_point = "@build_bazel_rules_nodejs//packages/cypress:internal/run-cypress.js", - templated_args = [ - "$(rootpath {config_file})".format(config_file = config_file), - "$(rootpath {cypress_plugin})".format(cypress_plugin = cypress_plugin), - "$(rootpath {cypress_archive})".format(cypress_archive = cypress_archive), - "$(rootpath {cypress_bin})".format(cypress_bin = cypress_bin), - ] + templated_args, - **kwargs - ) - -def cypress_web_test_global_cache( - name, - config_file, - srcs = [], - plugins_file = Label("@build_bazel_rules_nodejs//packages/cypress:plugins/base.js"), - cypress = Label("TEMPLATED_node_modules_workspace_name//cypress:cypress"), - data = [], - templated_args = [], - **kwargs): - cypress_plugin = "{name}_cypress_plugin".format(name = name) - tags = kwargs.pop("tags", []) + ["cypress"] - - _cypress_plugin( - name = cypress_plugin, - srcs = srcs, - tags = tags, - plugins_file = plugins_file, - config_file = config_file, - testonly = True, - visibility = ["//visibility:private"], - ) - - nodejs_test( - name = name, - tags = tags, - data = data + [ - plugins_file, - cypress, - "{cypress_plugin}".format(cypress_plugin = cypress_plugin), - "{config_file}".format(config_file = config_file), - ] + srcs, - entry_point = "@build_bazel_rules_nodejs//packages/cypress:internal/run-cypress.js", - templated_args = [ - "$(rootpath {config_file})".format(config_file = config_file), - "$(rootpath {cypress_plugin})".format(cypress_plugin = cypress_plugin), - ] + templated_args, - **kwargs - ) diff --git a/packages/cypress/internal/toolchain/BUILD.bazel b/packages/cypress/internal/toolchain/BUILD.bazel new file mode 100644 index 0000000000..57a7733cf1 --- /dev/null +++ b/packages/cypress/internal/toolchain/BUILD.bazel @@ -0,0 +1,79 @@ +load(":cypress_toolchain.bzl", "cypress_toolchain") + +package(default_visibility = ["//visibility:private"]) + +exports_files( + [ + "cypress_toolchain.bzl", + "BUILD.bazel", + ], + visibility = ["//visibility:public"], +) + +# cypress toolchain type +toolchain_type(name = "toolchain_type") + +[cypress_toolchain( + name = "cypress_%s_toolchain_config" % os_name, + cypress_bin = "@cypress_%s//:bin" % os_name, + cypress_files = "@cypress_%s//:files" % os_name, +) for os_name in [ + "darwin", + "linux", + "windows", +]] + +# Allow targets to use a toolchains attribute, such as sh_binary and genrule +# This way they can reference the cypress_PATH make variable. +alias( + name = "toolchain", + actual = select({ + "@bazel_tools//src/conditions:darwin": ":cypress_darwin_toolchain_config", + "@bazel_tools//src/conditions:linux_x86_64": ":cypress_linux_toolchain_config", + "@bazel_tools//src/conditions:windows": ":cypress_windows_toolchain_config", + "//conditions:default": ":cypress_linux_toolchain_config", + }), + visibility = ["//visibility:public"], +) + +# Allow targets to declare a dependency on the cypress binary for the current host platform +alias( + name = "cypress_bin", + actual = select({ + "@bazel_tools//src/conditions:darwin": "@cypress_darwin//:bin", + "@bazel_tools//src/conditions:linux_x86_64": "@cypress_linux//:bin", + "@bazel_tools//src/conditions:windows": "@cypress_windows//:bin", + "//conditions:default": "@cypress_linux//:bin", + }), + visibility = ["//visibility:public"], +) + +toolchain( + name = "cypress_linux_toolchain", + target_compatible_with = [ + "@platforms//os:linux", + "@platforms//cpu:x86_64", + ], + toolchain = ":cypress_linux_toolchain_config", + toolchain_type = ":toolchain_type", +) + +toolchain( + name = "cypress_darwin_toolchain", + target_compatible_with = [ + "@platforms//os:osx", + "@platforms//cpu:x86_64", + ], + toolchain = ":cypress_darwin_toolchain_config", + toolchain_type = ":toolchain_type", +) + +toolchain( + name = "cypress_windows_toolchain", + target_compatible_with = [ + "@platforms//os:windows", + "@platforms//cpu:x86_64", + ], + toolchain = ":cypress_windows_toolchain_config", + toolchain_type = ":toolchain_type", +) diff --git a/packages/cypress/internal/toolchain/cypress_toolchain.bzl b/packages/cypress/internal/toolchain/cypress_toolchain.bzl new file mode 100644 index 0000000000..d51c4b64b6 --- /dev/null +++ b/packages/cypress/internal/toolchain/cypress_toolchain.bzl @@ -0,0 +1,75 @@ +# Copyright 2018 The Bazel Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +"""This module implements the cypress toolchain rule. +""" + +CypressInfo = provider( + doc = "Information about how to invoke the cypress executable.", + fields = { + "cypress_bin": "Target for the bazel installed cypress executable for the target platform.", + "cypress_bin_path": "Path to the system installed cypress executable for the target platform.", + "cypress_files": """Files required in runfiles to make the cypress executable available. + +May be empty if the cypress_bin_path points to a locally installed cypress binary.""", + }, +) + +def _cypress_toolchain_impl(ctx): + if ctx.attr.cypress_bin and ctx.attr.cypress_bin_path: + fail("Can only set one of cypress_bin or cypress_bin_path but both were set.") + if not ctx.attr.cypress_bin and not ctx.attr.cypress_bin_path: + fail("Must set one of cypress_bin or cypress_bin_path.") + if ctx.attr.cypress_bin and not ctx.attr.cypress_files: + fail("Must set cypress_files when cypress_bin is set.") + + cypress_files = [] + cypress_bin_path = ctx.attr.cypress_bin_path + + if ctx.attr.cypress_bin: + cypress_files = ctx.attr.cypress_bin.files.to_list() + ctx.attr.cypress_files.files.to_list() + cypress_bin_path = cypress_files[0].short_path + + return [ + platform_common.ToolchainInfo( + cypressinfo = CypressInfo( + cypress_bin_path = cypress_bin_path, + cypress_files = cypress_files, + ), + ), + ] + +cypress_toolchain = rule( + implementation = _cypress_toolchain_impl, + attrs = { + "cypress_bin": attr.label( + doc = "A hermetically downloaded cypress executable binary for the target platform.", + mandatory = False, + allow_single_file = True, + ), + "cypress_bin_path": attr.string( + doc = "Path to an existing cypress executable for the target platform.", + mandatory = False, + ), + "cypress_files": attr.label( + doc = "A hermetically downloaded cypress filegroup of all cypress binary files for the target platform. Must be set when cypress_bin is set.", + mandatory = False, + allow_files = True, + ), + }, + doc = """Defines a cypress toolchain. + +For usage see https://docs.bazel.build/versions/master/toolchains.html#defining-toolchains. +""", +) diff --git a/packages/cypress/package.json b/packages/cypress/package.json index e7465f6f4b..f502b0898e 100644 --- a/packages/cypress/package.json +++ b/packages/cypress/package.json @@ -1,8 +1,5 @@ { "name": "@bazel/cypress", - "dependencies": { - "tar": "6.0.5" - }, "peerDependencies": { "cypress": ">=4.7.0" }, diff --git a/packages/cypress/test/BUILD.bazel b/packages/cypress/test/BUILD.bazel index 6a2a252e31..998977f0a0 100644 --- a/packages/cypress/test/BUILD.bazel +++ b/packages/cypress/test/BUILD.bazel @@ -1,16 +1,14 @@ -load("@cypress//:index.bzl", "cypress_web_test") -load("//packages/typescript:index.bzl", "ts_library") +load("@build_bazel_rules_nodejs//packages/cypress:index.bzl", "cypress_web_test") +load("@build_bazel_rules_nodejs//packages/typescript:index.bzl", "ts_library") ts_library( - name = "plugins_file", + name = "plugin_file", testonly = True, srcs = ["plugin.ts"], tags = ["cypress"], tsconfig = ":tsconfig.json", deps = [ "@cypress_deps//:node_modules", - "@cypress_deps//@types/node", - "@cypress_deps//express", ], ) @@ -22,8 +20,6 @@ ts_library( tsconfig = ":tsconfig.json", deps = [ "@cypress_deps//:node_modules", - "@cypress_deps//@types", - "@cypress_deps//cypress", ], ) @@ -34,6 +30,10 @@ cypress_web_test( ":hello_spec", ], config_file = "cypress.json", - data = ["@cypress_deps//rxjs"], - plugins_file = ":plugins_file", + cypress_npm_package = "@cypress_deps//cypress", + data = [ + "@cypress_deps//rxjs", + ], + plugin_file = ":plugin_file", + tags = ["cypress"], ) diff --git a/packages/cypress/test/package.json b/packages/cypress/test/package.json index ab90b3d4a8..ffd310bf82 100644 --- a/packages/cypress/test/package.json +++ b/packages/cypress/test/package.json @@ -2,11 +2,9 @@ "name": "cypress_test", "private": true, "dependencies": { - "express": "4.17.1", - "cypress": "^5.2.0", + "cypress": "7.3.0", "@types/node": "14.0.14", - "rxjs": "^6.5.2", - "typescript": "3.9.5", - "tar": "6.0.5" + "rxjs": "6.5.2", + "typescript": "4.2.4" } } diff --git a/packages/cypress/test/plugin.ts b/packages/cypress/test/plugin.ts index 26aeae4a55..e040b9fc5b 100644 --- a/packages/cypress/test/plugin.ts +++ b/packages/cypress/test/plugin.ts @@ -1,17 +1,20 @@ -import * as express from 'express'; -// TODO(mrmeku): Show case a way to launch a devserver bazel target. -module.exports = (on, config) => { - const app = express(); +const http = require('http'); - app.get('/', function(req, res) { - res.send('hello-world'); +module.exports = (_on, config) => { + const hostname = '127.0.0.1'; + const port = 3000; + const server = http.createServer((_req, res) => { + res.statusCode = 200; + res.setHeader('Content-Type', 'text/html'); + res.end('hello-world'); }); - const port = 3000; - app.listen(port); + server.listen(port, hostname, () => { + console.log(`Server running at http://${hostname}:${port}/`); + }); - config.baseUrl = `http://localhost:${port}`; + config.baseUrl = `http://${hostname}:${port}`; return config; }; diff --git a/packages/cypress/test/tsconfig.json b/packages/cypress/test/tsconfig.json index aa2aac7590..782426b7a0 100644 --- a/packages/cypress/test/tsconfig.json +++ b/packages/cypress/test/tsconfig.json @@ -1,5 +1,7 @@ { "compilerOptions": { - "types": [] + "types": [ + "node" + ] } -} +} \ No newline at end of file diff --git a/packages/cypress/test/yarn.lock b/packages/cypress/test/yarn.lock index 88cb73f8b6..819a8fc2b7 100644 --- a/packages/cypress/test/yarn.lock +++ b/packages/cypress/test/yarn.lock @@ -63,24 +63,21 @@ resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.14.tgz#24a0b5959f16ac141aeb0c5b3cd7a15b7c64cbce" integrity sha512-syUgf67ZQpaJj01/tRTknkMNoBBLWJOBODF0Zm4NrXmiSuxjymFrxnTu1QVYRubhVkRcZLYZG8STTwJRdVm/WQ== -"@types/sinonjs__fake-timers@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.1.tgz#681df970358c82836b42f989188d133e218c458e" - integrity sha512-yYezQwGWty8ziyYLdZjwxyMb0CZR49h8JALHGrxjQHWlqGgc8kLdHEgWrgL0uZ29DMvEVBDnHU2Wg36zKSIUtA== +"@types/node@^14.14.31": + version "14.14.44" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.44.tgz#df7503e6002847b834371c004b372529f3f85215" + integrity sha512-+gaugz6Oce6ZInfI/tK4Pq5wIIkJMEJUu92RB3Eu93mtj4wjjjz9EB5mLp5s1pSsLXdC/CPut/xF20ZzAQJbTA== + +"@types/sinonjs__fake-timers@^6.0.2": + version "6.0.2" + resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae" + integrity sha512-dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0bg== "@types/sizzle@^2.3.2": version "2.3.2" resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.2.tgz#a811b8c18e2babab7d542b3365887ae2e4d9de47" integrity sha512-7EJYyKTL7tFR8+gDbB6Wwz/arpGa0Mywk1TJbNzKzHtzbwVmY4HR9WqS5VV7dsBUKQmPNr192jHr/VpBluj/hg== -accepts@~1.3.7: - version "1.3.7" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" - integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== - dependencies: - mime-types "~2.1.24" - negotiator "0.6.2" - ajv@^6.5.5: version "6.12.2" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.2.tgz#c629c5eced17baf314437918d2da88c99d5958cd" @@ -136,15 +133,10 @@ any-observable@^0.3.0: resolved "https://registry.yarnpkg.com/any-observable/-/any-observable-0.3.0.tgz#af933475e5806a67d0d7df090dd5e8bef65d119b" integrity sha512-/FQM1EDkTsf63Ub2C6O7GuYFDsSXUwsaZDurV0np41ocwq0jthUAYCmhBX9f+KwlaCgIuWyr/4WlUQUBfKfZog== -arch@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/arch/-/arch-2.1.2.tgz#0c52bbe7344bb4fa260c443d2cbad9c00ff2f0bf" - integrity sha512-NTBIIbAfkJeIletyABbVtdPgeKfDafR+1mZV/AyyfC1UkVkp9iUjV+wwmqtUgphHYajbI86jejBJp5e+jkGTiQ== - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= +arch@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" + integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== asn1@~0.2.3: version "0.2.4" @@ -195,7 +187,7 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" -blob-util@2.0.2: +blob-util@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== @@ -205,22 +197,6 @@ bluebird@^3.7.2: resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== -body-parser@1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - brace-expansion@^1.1.7: version "1.1.11" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" @@ -239,11 +215,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - cachedir@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" @@ -287,15 +258,10 @@ check-more-types@^2.24.0: resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" integrity sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA= -chownr@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece" - integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ== - -ci-info@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" - integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== +ci-info@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.1.1.tgz#9a32fcefdf7bcdb6f0a7e1c0f8098ec57897b80a" + integrity sha512-kdRWLBIJwdsYJWYJFtAFFYxybguqeF91qpZaggjG5Nf8QKdizFG2hjqvaTXbxFIcYbSaD74KpAXv6BSm17DHEQ== cli-cursor@^1.0.2: version "1.0.2" @@ -370,10 +336,10 @@ combined-stream@^1.0.6, combined-stream@~1.0.6: dependencies: delayed-stream "~1.0.0" -commander@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae" + integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg== common-tags@^1.8.0: version "1.8.0" @@ -395,28 +361,6 @@ concat-stream@^1.6.2: readable-stream "^2.2.2" typedarray "^0.0.6" -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== - dependencies: - safe-buffer "5.1.2" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - core-util-is@1.0.2, core-util-is@~1.0.0: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -431,45 +375,46 @@ cross-spawn@^7.0.0: shebang-command "^2.0.0" which "^2.0.1" -cypress@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-5.2.0.tgz#6902efd90703242a2539f0623c6e1118aff01f95" - integrity sha512-9S2spcrpIXrQ+CQIKHsjRoLQyRc2ehB06clJXPXXp1zyOL/uZMM3Qc20ipNki4CcNwY0nBTQZffPbRpODeGYQg== +cypress@7.3.0: + version "7.3.0" + resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.3.0.tgz#17345b8d18681c120f033e7d8fd0f0271e9d0d51" + integrity sha512-aseRCH1tRVCrM6oEfja6fR/bo5l6e4SkHRRSATh27UeN4f/ANC8U7tGIulmrISJVy9xuOkOdbYKbUb2MNM+nrw== dependencies: "@cypress/listr-verbose-renderer" "^0.4.1" "@cypress/request" "^2.88.5" "@cypress/xvfb" "^1.2.4" - "@types/sinonjs__fake-timers" "^6.0.1" + "@types/node" "^14.14.31" + "@types/sinonjs__fake-timers" "^6.0.2" "@types/sizzle" "^2.3.2" - arch "^2.1.2" - blob-util "2.0.2" + arch "^2.2.0" + blob-util "^2.0.2" bluebird "^3.7.2" cachedir "^2.3.0" chalk "^4.1.0" check-more-types "^2.24.0" cli-table3 "~0.6.0" - commander "^4.1.1" + commander "^5.1.0" common-tags "^1.8.0" - debug "^4.1.1" - eventemitter2 "^6.4.2" - execa "^4.0.2" + dayjs "^1.10.4" + debug "4.3.2" + eventemitter2 "^6.4.3" + execa "4.1.0" executable "^4.1.1" extract-zip "^1.7.0" - fs-extra "^9.0.1" + fs-extra "^9.1.0" getos "^3.2.1" - is-ci "^2.0.0" - is-installed-globally "^0.3.2" + is-ci "^3.0.0" + is-installed-globally "~0.4.0" lazy-ass "^1.6.0" listr "^0.14.3" - lodash "^4.17.19" + lodash "^4.17.21" log-symbols "^4.0.0" minimist "^1.2.5" - moment "^2.27.0" ospath "^1.2.2" - pretty-bytes "^5.3.0" - ramda "~0.26.1" + pretty-bytes "^5.6.0" + ramda "~0.27.1" request-progress "^3.0.0" - supports-color "^7.1.0" + supports-color "^8.1.1" tmp "~0.2.1" untildify "^4.0.0" url "^0.11.0" @@ -487,7 +432,19 @@ date-fns@^1.27.2: resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== -debug@2.6.9, debug@^2.6.9: +dayjs@^1.10.4: + version "1.10.4" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.4.tgz#8e544a9b8683f61783f570980a8a80eaf54ab1e2" + integrity sha512-RI/Hh4kqRc1UKLOAf/T5zdMMX5DQIlDxwUe3wSyMMnEbGunnpENCdbUgM+dW7kXidZqCttBrmw7BhN4TMddkCw== + +debug@4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.2.tgz#f0a49c18ac8779e31d4a0c6029dfb76873c7428b" + integrity sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw== + dependencies: + ms "2.1.2" + +debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -501,28 +458,11 @@ debug@^3.1.0: dependencies: ms "^2.1.1" -debug@^4.1.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1" - integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg== - dependencies: - ms "2.1.2" - delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= -depd@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" - integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= - -destroy@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" - integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= - ecc-jsbn@~0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" @@ -531,11 +471,6 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - elegant-spinner@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/elegant-spinner/-/elegant-spinner-1.0.1.tgz#db043521c95d7e303fd8f345bedc3349cfb0729e" @@ -546,11 +481,6 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - end-of-stream@^1.1.0: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" @@ -558,30 +488,20 @@ end-of-stream@^1.1.0: dependencies: once "^1.4.0" -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -eventemitter2@^6.4.2: - version "6.4.3" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.3.tgz#35c563619b13f3681e7eb05cbdaf50f56ba58820" - integrity sha512-t0A2msp6BzOf+QAcI6z9XMktLj52OjGQg+8SJH6v5+3uxNpWYRR3wQmfA+6xtMU9kOC59qk9licus5dYcrYkMQ== +eventemitter2@^6.4.3: + version "6.4.4" + resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.4.tgz#aa96e8275c4dbeb017a5d0e03780c65612a1202b" + integrity sha512-HLU3NDY6wARrLCEwyGKRBvuWYyvW6mHYv72SJJAH3iJN3a6eVUvkjFkcxah1bcTgGVBBrFdIopBJPhCQFMLyXw== -execa@^4.0.2: - version "4.0.3" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.0.3.tgz#0a34dabbad6d66100bd6f2c576c8669403f317f2" - integrity sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A== +execa@4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" + integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== dependencies: cross-spawn "^7.0.0" get-stream "^5.0.0" @@ -605,42 +525,6 @@ exit-hook@^1.0.0: resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" integrity sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g= -express@4.17.1: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== - dependencies: - accepts "~1.3.7" - array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" - content-type "~1.0.4" - cookie "0.4.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "~1.1.2" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "~1.1.2" - fresh "0.5.2" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "~2.3.0" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" - range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" - statuses "~1.5.0" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -698,19 +582,6 @@ figures@^2.0.0: dependencies: escape-string-regexp "^1.0.5" -finalhandler@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" - integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "~2.3.0" - parseurl "~1.3.3" - statuses "~1.5.0" - unpipe "~1.0.0" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -725,32 +596,15 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" -forwarded@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" - integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs-extra@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.0.1.tgz#910da0062437ba4c39fedd863f1675ccfefcb9fc" - integrity sha512-h2iAoN838FqAFJY2/qVpzFXy+EBxfVE220PalAqQLDVsFOHLJrZvut5puAbCdNv6WJk+B8ihI+k0c7JK5erwqQ== +fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== dependencies: at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" - universalify "^1.0.0" - -fs-minipass@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" - integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg== - dependencies: - minipass "^3.0.0" + universalify "^2.0.0" fs.realpath@^1.0.0: version "1.0.0" @@ -790,12 +644,12 @@ glob@^7.1.3: once "^1.3.0" path-is-absolute "^1.0.0" -global-dirs@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-2.0.1.tgz#acdf3bb6685bcd55cb35e8a052266569e9469201" - integrity sha512-5HqUqdhkEovj2Of/ms3IeS/EekcO54ytHRLV4PEY2rhRwrHXLQjeVEES0Lhka0xwNDtGYn58wyC4s5+MHsOO6A== +global-dirs@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/global-dirs/-/global-dirs-3.0.0.tgz#70a76fe84ea315ab37b1f5576cbde7d48ef72686" + integrity sha512-v8ho2DS5RiCjftj1nD9NmnfaOzTdud7RRnVd9kFNOjqZbISlx5DQ+OrTkywgd0dIt7oFCvKetZSHoHcP3sDdiA== dependencies: - ini "^1.3.5" + ini "2.0.0" graceful-fs@^4.1.6, graceful-fs@^4.2.0: version "4.2.4" @@ -832,28 +686,6 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -868,13 +700,6 @@ human-signals@^1.1.1: resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - indent-string@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/indent-string/-/indent-string-3.2.0.tgz#4a5fd6d27cc332f37e5419a504dbb837105c9289" @@ -888,32 +713,22 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.3: +inherits@2, inherits@^2.0.3, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - -ini@^1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927" - integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-ci@^2.0.0: +ini@2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" - integrity sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w== + resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" + integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== + +is-ci@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" + integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== dependencies: - ci-info "^2.0.0" + ci-info "^3.1.1" is-fullwidth-code-point@^1.0.0: version "1.0.0" @@ -932,13 +747,13 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== -is-installed-globally@^0.3.2: - version "0.3.2" - resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.3.2.tgz#fd3efa79ee670d1187233182d5b0a1dd00313141" - integrity sha512-wZ8x1js7Ia0kecP/CHM/3ABkAmujX7WPvQk6uu3Fly/Mk44pySulQpnHG46OMjHGXApINnV4QhY3SWnECO2z5g== +is-installed-globally@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" + integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== dependencies: - global-dirs "^2.0.1" - is-path-inside "^3.0.1" + global-dirs "^3.0.0" + is-path-inside "^3.0.2" is-observable@^1.1.0: version "1.1.0" @@ -947,10 +762,10 @@ is-observable@^1.1.0: dependencies: symbol-observable "^1.1.0" -is-path-inside@^3.0.1: - version "3.0.2" - resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.2.tgz#f5220fc82a3e233757291dddc9c5877f2a1f3017" - integrity sha512-/2UGPSgmtqwo1ktx8NDHjuPwZWmHhO+gj0f93EkhLB5RgW9RZevWYYlIkS6zePc6U2WpOdQYIwHe9YC4DWEBVg== +is-path-inside@^3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== is-promise@^2.1.0: version "2.2.2" @@ -1080,10 +895,10 @@ lodash.once@^4.1.1: resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= -lodash@^4.17.19: - version "4.17.20" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52" - integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA== +lodash@^4.17.21: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== log-symbols@^1.0.2: version "1.0.2" @@ -1108,43 +923,23 @@ log-update@^2.3.0: cli-cursor "^2.0.0" wrap-ansi "^3.0.1" -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - merge-stream@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - mime-db@1.44.0: version "1.44.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.44.0.tgz#fa11c5eb0aca1334b4233cb4d52f10c5a6272f92" integrity sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg== -mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: +mime-types@^2.1.12, mime-types@~2.1.19: version "2.1.27" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.27.tgz#47949f98e279ea53119f5722e0f34e529bec009f" integrity sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w== dependencies: mime-db "1.44.0" -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - mimic-fn@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" @@ -1167,21 +962,6 @@ minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602" integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw== -minipass@^3.0.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.3.tgz#7d42ff1f39635482e15f9cdb53184deebd5815fd" - integrity sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg== - dependencies: - yallist "^4.0.0" - -minizlib@^2.1.1: - version "2.1.2" - resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" - integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== - dependencies: - minipass "^3.0.0" - yallist "^4.0.0" - mkdirp@^0.5.4: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" @@ -1189,36 +969,16 @@ mkdirp@^0.5.4: dependencies: minimist "^1.2.5" -mkdirp@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" - integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== - -moment@^2.27.0: - version "2.29.0" - resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.0.tgz#fcbef955844d91deb55438613ddcec56e86a3425" - integrity sha512-z6IJ5HXYiuxvFTI6eiQ9dm77uE0gyy1yXNApVHqTcnIKfY9tIwEjlzsZ6u1LQXvVgKeTnv9Xm7NDvJ7lso3MtA== - ms@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" - integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== - ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -negotiator@0.6.2: - version "0.6.2" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" - integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== - npm-run-path@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -1241,13 +1001,6 @@ object-assign@^4.1.0: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= -on-finished@~2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" - integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= - dependencies: - ee-first "1.1.1" - once@^1.3.0, once@^1.3.1, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -1284,11 +1037,6 @@ p-map@^2.0.0: resolved "https://registry.yarnpkg.com/p-map/-/p-map-2.1.0.tgz#310928feef9c9ecc65b68b17693018a665cea175" integrity sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw== -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - path-is-absolute@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" @@ -1299,11 +1047,6 @@ path-key@^3.0.0, path-key@^3.1.0: resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - pend@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" @@ -1319,24 +1062,16 @@ pify@^2.2.0: resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= -pretty-bytes@^5.3.0: - version "5.4.1" - resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.4.1.tgz#cd89f79bbcef21e3d21eb0da68ffe93f803e884b" - integrity sha512-s1Iam6Gwz3JI5Hweaz4GoCD1WUNUIyzePFy5+Js2hjwGVt2Z79wNN+ZKOZ2vB6C+Xs6njyB84Z1IthQg8d9LxA== +pretty-bytes@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" + integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -proxy-addr@~2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.6.tgz#fdc2336505447d3f2f2c638ed272caf614bbb2bf" - integrity sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw== - dependencies: - forwarded "~0.1.2" - ipaddr.js "1.9.1" - psl@^1.1.28: version "1.8.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" @@ -1360,11 +1095,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" @@ -1375,25 +1105,10 @@ querystring@0.2.0: resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= -ramda@~0.26.1: - version "0.26.1" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06" - integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ== - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" +ramda@~0.27.1: + version "0.27.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" + integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw== readable-stream@^2.2.2: version "2.3.7" @@ -1438,6 +1153,13 @@ rimraf@^3.0.0: dependencies: glob "^7.1.3" +rxjs@6.5.2: + version "6.5.2" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.2.tgz#2e35ce815cd46d84d02a209fb4e5921e051dbec7" + integrity sha512-HUb7j3kvb7p7eCUHE3FqjoDsC1xfZQ4AHFWfTKSpZ+sAhhz5X1WX0ZuUqWbzB2QhSLp3DoLUG+hMdEDKqWo2Zg== + dependencies: + tslib "^1.9.0" + rxjs@^6.3.3: version "6.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" @@ -1445,62 +1167,21 @@ rxjs@^6.3.3: dependencies: tslib "^1.9.0" -rxjs@^6.5.2: - version "6.6.3" - resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.3.tgz#8ca84635c4daa900c0d3967a6ee7ac60271ee552" - integrity sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ== - dependencies: - tslib "^1.9.0" - -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - safe-buffer@^5.0.1, safe-buffer@^5.1.2: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + +safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== - dependencies: - debug "2.6.9" - depd "~1.1.2" - destroy "~1.0.4" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "~1.7.2" - mime "1.6.0" - ms "2.1.1" - on-finished "~2.3.0" - range-parser "~1.2.1" - statuses "~1.5.0" - -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.17.1" - -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -1538,11 +1219,6 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" -"statuses@>= 1.5.0 < 2", statuses@~1.5.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" - integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= - string-width@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" @@ -1621,23 +1297,18 @@ supports-color@^7.1.0: dependencies: has-flag "^4.0.0" +supports-color@^8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + symbol-observable@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804" integrity sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ== -tar@6.0.5: - version "6.0.5" - resolved "https://registry.yarnpkg.com/tar/-/tar-6.0.5.tgz#bde815086e10b39f1dcd298e89d596e1535e200f" - integrity sha512-0b4HOimQHj9nXNEAA7zWwMM91Zhhba3pspja6sQbgTpynOJf+bkjBnfybNYzbpLbnwXnbyB4LOREvlyXLkCHSg== - dependencies: - chownr "^2.0.0" - fs-minipass "^2.0.0" - minipass "^3.0.0" - minizlib "^2.1.1" - mkdirp "^1.0.3" - yallist "^4.0.0" - throttleit@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" @@ -1650,11 +1321,6 @@ tmp@~0.2.1: dependencies: rimraf "^3.0.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - tough-cookie@~2.5.0: version "2.5.0" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" @@ -1680,33 +1346,25 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -type-is@~1.6.17, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@3.9.5: - version "3.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" - integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== +typescript@4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" + integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== universalify@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-1.0.0.tgz#b61a1da173e8435b2fe3c67d29b9adf8594bd16d" integrity sha512-rb6X1W158d7pRQBg5gkR8uPaSfiids68LTJQYOtEUhoJUWBdaQHsuT/EUduxXYxcrt4r5PJ4fuHW1MHT6p0qug== -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= +universalify@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717" + integrity sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ== untildify@^4.0.0: version "4.0.0" @@ -1733,21 +1391,11 @@ util-deprecate@~1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" @@ -1777,11 +1425,6 @@ wrappy@1: resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - yauzl@^2.10.0: version "2.10.0" resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9"