diff --git a/.buildkite/release.yml b/.buildkite/release.yml index b4500790..9f364312 100644 --- a/.buildkite/release.yml +++ b/.buildkite/release.yml @@ -1,11 +1,38 @@ --- # $yaml-language-server: $schema=https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json steps: - - label: "Package :package:" + - label: "Package Mac ARM64 :package: :mac:" command: ".buildkite/scripts/package.sh" + artifact_paths: "package.log" agents: provider: orka imagePrefix: generic-13-ventura-x64 + env: + PACKAGE_PLATFORM: "macos_arm64" + - label: "Package Mac x64 :package: :mac:" + command: ".buildkite/scripts/package.sh" + artifact_paths: "package.log" + agents: + provider: orka + imagePrefix: generic-13-ventura-x64 + env: + PACKAGE_PLATFORM: "macos_x64" + - label: "Package Linux x64 :package: :linux:" + command: ".buildkite/scripts/package.sh" + artifact_paths: "package.log" + agents: + provider: orka + imagePrefix: generic-13-ventura-x64 + env: + PACKAGE_PLATFORM: "linux" + - label: "Build Windows x64 :package: :windows:" + command: ".buildkite/scripts/package.sh" + artifact_paths: "package.log" + agents: + provider: orka + imagePrefix: generic-13-ventura-x64 + env: + PACKAGE_PLATFORM: "windows" - wait: ~ @@ -36,17 +63,24 @@ steps: - wait: ~ - - label: Download signed artifacts + # The order matters here, we need to download the gpg files first, then the windows and macos files + # The current BK pipeline helpers use an opinionated folder names (artifacts-to-sign and signed-artifacts) + - label: Download signed artifacts (windows and gpg) commands: - .buildkite/scripts/download-signed-artifacts.sh "gpg-sign-service" "gpg" - - .buildkite/scripts/download-signed-artifacts.sh "macos-sign-service" "macos" - .buildkite/scripts/download-signed-artifacts.sh "windows-sign-service" "windows" - .buildkite/scripts/download-signed-artifacts.sh "gpg-sign-service" "gpg" | buildkite-agent pipeline upload - - .buildkite/scripts/download-signed-artifacts.sh "macos-sign-service" "macos" | buildkite-agent pipeline upload - .buildkite/scripts/download-signed-artifacts.sh "windows-sign-service" "windows" | buildkite-agent pipeline upload - wait: ~ + - label: Download signed artifacts (macos) + commands: + - .buildkite/scripts/download-signed-artifacts.sh "macos-sign-service" "macos" + - .buildkite/scripts/download-signed-artifacts.sh "macos-sign-service" "macos" | buildkite-agent pipeline upload + + - wait: ~ + - label: "Publish S3 Artifacts :s3:" trigger: unified-release-publish-s3-artifacts key: publish-s3-service @@ -60,6 +94,7 @@ steps: - label: "Publish GitHub Release :github:" commands: - .buildkite/scripts/create-github-release.sh + # The steps name are set as part of the .buildkite/scripts/download-signed-artifacts.sh script depends_on: - "gpg" - "macos" diff --git a/.buildkite/scripts/create-github-release.sh b/.buildkite/scripts/create-github-release.sh index 3e6d7b74..be9b021a 100755 --- a/.buildkite/scripts/create-github-release.sh +++ b/.buildkite/scripts/create-github-release.sh @@ -8,9 +8,22 @@ set -eox pipefail DIST_LOCATION=signed-artifacts echo "--- Download signed artifacts" +# +# Download the signed artifacts from the previous step but using the below order +# gpg, windows and macos. +# This should help with the signing process and download the files in the correct +# order. gpg signing signs all the files, but the dmg files need to be signed +# separately as part of the Macos BK pipeline helper. +# As long as, the signing process is split in different types and use the same +# folder name, we need this hack. +# buildkite-agent artifact download --step gpg "$DIST_LOCATION/*.*" ./ -buildkite-agent artifact download --step macos "$DIST_LOCATION/*.*" ./ +# help with debugging +ls -ltra "$DIST_LOCATION/" buildkite-agent artifact download --step windows "$DIST_LOCATION/*.*" ./ +ls -ltra "$DIST_LOCATION/" +buildkite-agent artifact download --step macos "$DIST_LOCATION/*.*" ./ +ls -ltra "$DIST_LOCATION/" echo "--- List signed artifacts" ls -l "$DIST_LOCATION/" diff --git a/.buildkite/scripts/download-signed-artifacts.sh b/.buildkite/scripts/download-signed-artifacts.sh index de167e84..a7ce0adf 100755 --- a/.buildkite/scripts/download-signed-artifacts.sh +++ b/.buildkite/scripts/download-signed-artifacts.sh @@ -35,11 +35,12 @@ if [ -z "$SIGN_BUILD_ID" ] ; then fi cat << EOF - - label: ":pipeline: Download signed artifacts" + - label: ":pipeline: Download signed artifacts $DOWNLOAD_STEP_NAME" key: "$DOWNLOAD_STEP_NAME" commands: - mkdir -p signed-artifacts - buildkite-agent artifact download --build "$SIGN_BUILD_ID" "*.*" signed-artifacts/ + - ls -ltra signed-artifacts/ - buildkite-agent artifact upload "signed-artifacts/*.*" agents: image: docker.elastic.co/ci-agent-images/ubuntu-build-essential diff --git a/.buildkite/scripts/package.sh b/.buildkite/scripts/package.sh index 7c0a308c..6ea57072 100755 --- a/.buildkite/scripts/package.sh +++ b/.buildkite/scripts/package.sh @@ -15,15 +15,42 @@ npm ci echo "--- run release-ci" # Disable signing # see https://www.electron.build/code-signing#how-to-disable-code-signing-during-the-build-process-on-macos -export CSC_IDENTITY_AUTO_DISCOVERY=false +# export CSC_IDENTITY_AUTO_DISCOVERY=false # Disable notarize, see scripts/notarize.js export SKIP_NOTARIZATION=true -npm run release-ci + +if [ -z "$PACKAGE_PLATFORM" ]; then + echo "Error: PACKAGE_PLATFORM must be set to continue." + exit 1 +fi + +case "$PACKAGE_PLATFORM" in + "linux") + echo "--- Package for Linux" + npm run release-ci_linux-x64 | tee package.log + ;; + + "macos_arm64") + echo "--- Package for MacOS ARM64" + npm run release-ci_mac-arm64 | tee package.log + ;; + + "macos_x64") + echo "--- Package for MacOS x64" + npm run release-ci_mac-x64 | tee package.log + ;; + + "windows") + echo "--- Package for Windows" + npm run release-ci_windows-x64 | tee package.log + ;; +esac # Store unsigned artifacts if [ -n "$BUILDKITE" ] ; then echo "--- Upload artifacts" mv dist artifacts-to-sign + # We cannot upload artifacts-to-sign/*.* since it contains some generated files builder-debug, .blockmap and so on # (only *nix) buildkite-agent artifact upload "artifacts-to-sign/*.deb;artifacts-to-sign/*.dmg;artifacts-to-sign/*.zip" diff --git a/NOTICE.txt b/NOTICE.txt index 3d58da88..687a57bf 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -183,6 +183,33 @@ SOFTWARE. +--- +This product relies on archiver-utils + +Copyright (c) 2015 Chris Talkington. + +Permission is hereby granted, free of charge, to any person +obtaining a copy of this software and associated documentation +files (the "Software"), to deal in the Software without +restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + + --- This product relies on dotenv @@ -309,218 +336,6 @@ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ---- -This product relies on playwright-core - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Portions Copyright (c) Microsoft Corporation. - Portions Copyright 2017 Google Inc. - - 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. - - -Playwright -Copyright (c) Microsoft Corporation - -This software contains code derived from the Puppeteer project (https://github.com/puppeteer/puppeteer), -available under the Apache 2.0 license (https://github.com/puppeteer/puppeteer/blob/master/LICENSE). --- @@ -577,6 +392,203 @@ SOFTWARE. +--- +This product relies on sharp + +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and +distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright +owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities +that control, are controlled by, or are under common control with that entity. +For the purposes of this definition, "control" means (i) the power, direct or +indirect, to cause the direction or management of such entity, whether by +contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising +permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including +but not limited to software source code, documentation source, and configuration +files. + +"Object" form shall mean any form resulting from mechanical transformation or +translation of a Source form, including but not limited to compiled object code, +generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made +available under the License, as indicated by a copyright notice that is included +in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that +is based on (or derived from) the Work and for which the editorial revisions, +annotations, elaborations, or other modifications represent, as a whole, an +original work of authorship. For the purposes of this License, Derivative Works +shall not include works that remain separable from, or merely link (or bind by +name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version +of the Work and any modifications or additions to that Work or Derivative Works +thereof, that is intentionally submitted to Licensor for inclusion in the Work +by the copyright owner or by an individual or Legal Entity authorized to submit +on behalf of the copyright owner. For the purposes of this definition, +"submitted" means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, and +issue tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding communication +that is conspicuously marked or otherwise designated in writing by the copyright +owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf +of whom a Contribution has been received by Licensor and subsequently +incorporated within the Work. + +2. Grant of Copyright License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the Work and such +Derivative Works in Source or Object form. + +3. Grant of Patent License. + +Subject to the terms and conditions of this License, each Contributor hereby +grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, +irrevocable (except as stated in this section) patent license to make, have +made, use, offer to sell, sell, import, and otherwise transfer the Work, where +such license applies only to those patent claims licensable by such Contributor +that are necessarily infringed by their Contribution(s) alone or by combination +of their Contribution(s) with the Work to which such Contribution(s) was +submitted. If You institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work or a +Contribution incorporated within the Work constitutes direct or contributory +patent infringement, then any patent licenses granted to You under this License +for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. + +You may reproduce and distribute copies of the Work or Derivative Works thereof +in any medium, with or without modifications, and in Source or Object form, +provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of +this License; and +You must cause any modified files to carry prominent notices stating that You +changed the files; and +You must retain, in the Source form of any Derivative Works that You distribute, +all copyright, patent, trademark, and attribution notices from the Source form +of the Work, excluding those notices that do not pertain to any part of the +Derivative Works; and +If the Work includes a "NOTICE" text file as part of its distribution, then any +Derivative Works that You distribute must include a readable copy of the +attribution notices contained within such NOTICE file, excluding those notices +that do not pertain to any part of the Derivative Works, in at least one of the +following places: within a NOTICE text file distributed as part of the +Derivative Works; within the Source form or documentation, if provided along +with the Derivative Works; or, within a display generated by the Derivative +Works, if and wherever such third-party notices normally appear. The contents of +the NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative Works that +You distribute, alongside or as an addendum to the NOTICE text from the Work, +provided that such additional attribution notices cannot be construed as +modifying the License. +You may add Your own copyright statement to Your modifications and may provide +additional or different license terms and conditions for use, reproduction, or +distribution of Your modifications, or for any such Derivative Works as a whole, +provided Your use, reproduction, and distribution of the Work otherwise complies +with the conditions stated in this License. + +5. Submission of Contributions. + +Unless You explicitly state otherwise, any Contribution intentionally submitted +for inclusion in the Work by You to the Licensor shall be under the terms and +conditions of this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify the terms of +any separate license agreement you may have executed with Licensor regarding +such Contributions. + +6. Trademarks. + +This License does not grant permission to use the trade names, trademarks, +service marks, or product names of the Licensor, except as required for +reasonable and customary use in describing the origin of the Work and +reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. + +Unless required by applicable law or agreed to in writing, Licensor provides the +Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, +including, without limitation, any warranties or conditions of TITLE, +NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are +solely responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of +permissions under this License. + +8. Limitation of Liability. + +In no event and under no legal theory, whether in tort (including negligence), +contract, or otherwise, unless required by applicable law (such as deliberate +and grossly negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, incidental, +or consequential damages of any character arising as a result of this License or +out of the use or inability to use the Work (including but not limited to +damages for loss of goodwill, work stoppage, computer failure or malfunction, or +any and all other commercial damages or losses), even if such Contributor has +been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. + +While redistributing the Work or Derivative Works thereof, You may choose to +offer, and charge a fee for, acceptance of support, warranty, indemnity, or +other liability obligations and/or rights consistent with this License. However, +in accepting such obligations, You may act only on Your own behalf and on Your +sole responsibility, not on behalf of any other Contributor, and only if You +agree to indemnify, defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason of your +accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work + +To apply the Apache License to your work, attach the following boilerplate +notice, with the fields enclosed by brackets "[]" replaced with your own +identifying information. (Don't include the brackets!) The text should be +enclosed in the appropriate comment syntax for the file format. We also +recommend that a file or class name and description of purpose be included on +the same "printed page" as the copyright notice for easier identification within +third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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 product relies on styled-components @@ -607,60 +619,268 @@ SOFTWARE. --- This product relies on typescript -Apache License - -Version 2.0, January 2004 +Apache License + +Version 2.0, January 2004 + +http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + +"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: + +You must give any other recipients of the Work or Derivative Works a copy of this License; and + +You must cause any modified files to carry prominent notices stating that You changed the files; and + +You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and + +If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS -http://www.apache.org/licenses/ -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. -"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. - -"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. - -"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. - -"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. - -"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. - -"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). - -"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. - -"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." - -"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: - -You must give any other recipients of the Work or Derivative Works a copy of this License; and - -You must cause any modified files to carry prominent notices stating that You changed the files; and - -You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and - -If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS +--- +This product relies on playwright + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Portions Copyright (c) Microsoft Corporation. + Portions Copyright 2017 Google Inc. + + 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. diff --git a/dev-tools/dep-info.js b/dev-tools/dep-info.js index 128e4cb2..75ea15c7 100644 --- a/dev-tools/dep-info.js +++ b/dev-tools/dep-info.js @@ -52,31 +52,41 @@ function getFileContent(directory, filename) { return content; } -function generateDependencyInfo(deps) { +async function generateDependencyInfo(deps) { var allLicenses = []; - deps.forEach(d => { - // we download forked `playwright-core` as playwright. The directory doesn't include NOTICE nor LICENSE - // so we need to copy over from the official playwright-core package downloaded for synthetics agent. - if (d === 'playwright') { - d = 'playwright-core'; - } - - const modulesPath = join(ROOT_NODE_MODULES, d); - - const dep = { name: d }; - - const license = getFileContent(modulesPath, 'LICENSE'); - if (license) { - dep.license = license; - } - - const notice = getFileContent(modulesPath, 'NOTICE'); - if (notice) { - dep.notice = notice; - } - - allLicenses.push(dep); - }); + await Promise.all( + deps.map(async function (d) { + const modulesPath = join(ROOT_NODE_MODULES, d); + + const dep = { name: d }; + + const license = getFileContent(modulesPath, 'LICENSE'); + if (license) { + dep.license = license; + } else if (d === 'playwright') { + const { version: playwrightTag } = require(join(modulesPath, 'package.json')); + // playwright-core doesn't ship with a license file in the package, + // this pulls the main playwright license file from the repo. + const { statusCode, body } = await request( + `https://raw.githubusercontent.com/microsoft/playwright/refs/tags/v${playwrightTag}/LICENSE` + ); + const bodyStr = await body.text(); + if (statusCode !== 200) { + throw new Error( + `Failed to fetch playwright license info. status: ${statusCode}, reason: ${bodyStr}.` + ); + } + dep.license = bodyStr; + } + + const notice = getFileContent(modulesPath, 'NOTICE'); + if (notice) { + dep.notice = notice; + } + + allLicenses.push(dep); + }) + ); return allLicenses; } @@ -102,7 +112,7 @@ async function getChromiumInfo() { async function generateNotice() { const { name: pkgName, dependencies } = getPackageInfo(ROOT_DIR); const chromiumInfo = await getChromiumInfo(); - const depInfo = [chromiumInfo, ...generateDependencyInfo(Object.keys(dependencies))]; + const depInfo = [chromiumInfo, ...(await generateDependencyInfo(Object.keys(dependencies)))]; let allLicenses = ` ${pkgName} Copyright (c) 2021-present, Elasticsearch BV diff --git a/electron-builder.yml b/electron-builder.linux-x64.yml similarity index 68% rename from electron-builder.yml rename to electron-builder.linux-x64.yml index 25924de6..49cfc16d 100644 --- a/electron-builder.yml +++ b/electron-builder.linux-x64.yml @@ -1,6 +1,7 @@ productName: "Elastic Synthetics Recorder" appId: co.elastic.synthetics-recorder artifactName: ${name}-${version}-${os}-${arch}.${ext} +beforeBuild: "./scripts/fix-sharp.js" beforePack: "./scripts/before-pack.js" afterPack: "./scripts/after-pack.js" afterSign: "./scripts/notarize.js" @@ -11,6 +12,8 @@ files: extraResources: - from: local-browsers/_releases/${os}-${arch} to: local-browsers + - from: node_modules/@img/**/* + to: app.asar.unpacked/node_modules/@img - NOTICE.txt publish: - provider: github @@ -20,24 +23,6 @@ protocols: - name: elastic-synthetics-recorder schemes: - elastic-synthetics-recorder -mac: - icon: public/elastic.png - category: public.app-category.developer-tools - entitlements: assets/entitlements.mac.plist - entitlementsInherit: assets/entitlements.mac.plist - gatekeeperAssess: false - hardenedRuntime: true - target: - - target: default - arch: - - x64 - - arm64 -win: - target: - - target: nsis - arch: - - x64 - icon: public/elastic.png linux: target: - target: deb @@ -49,5 +34,5 @@ linux: # https://github.com/electron-userland/electron-builder/issues/6200#issuecomment-907830847 asarUnpack: - "**\\*.{node,dll}" - - "**/node_modules/sharp/**" - "**/node_modules/@elastic/synthetics/**" + asar: true \ No newline at end of file diff --git a/electron-builder.mac-arm64.yml b/electron-builder.mac-arm64.yml new file mode 100644 index 00000000..a58a236a --- /dev/null +++ b/electron-builder.mac-arm64.yml @@ -0,0 +1,37 @@ +productName: "Elastic Synthetics Recorder" +appId: co.elastic.synthetics-recorder +artifactName: ${name}-${version}-${os}-${arch}.${ext} +beforeBuild: "./scripts/fix-sharp.js" +beforePack: "./scripts/before-pack.js" +afterPack: "./scripts/after-pack.js" +afterSign: "./scripts/notarize.js" +files: + - build/**/* + - scripts/**/* + - assets/entitlements.mac.plist +extraResources: + - from: local-browsers/_releases/${os}-${arch} + to: local-browsers + - from: node_modules/@img/**/* + to: app.asar.unpacked/node_modules/@img + - NOTICE.txt +publish: + - provider: github +extraMetadata: + main: build/electron/electron.js +protocols: + - name: elastic-synthetics-recorder + schemes: + - elastic-synthetics-recorder +mac: + icon: public/elastic.png + category: public.app-category.developer-tools + entitlements: assets/entitlements.mac.plist + entitlementsInherit: assets/entitlements.mac.plist + gatekeeperAssess: false + hardenedRuntime: true + asar: true + target: + - target: default + arch: + - arm64 diff --git a/electron-builder.mac-x64.yml b/electron-builder.mac-x64.yml new file mode 100644 index 00000000..cc7328d0 --- /dev/null +++ b/electron-builder.mac-x64.yml @@ -0,0 +1,37 @@ +productName: "Elastic Synthetics Recorder" +appId: co.elastic.synthetics-recorder +artifactName: ${name}-${version}-${os}-${arch}.${ext} +beforeBuild: "./scripts/fix-sharp.js" +beforePack: "./scripts/before-pack.js" +afterPack: "./scripts/after-pack.js" +afterSign: "./scripts/notarize.js" +files: + - build/**/* + - scripts/**/* + - assets/entitlements.mac.plist +extraResources: + - from: local-browsers/_releases/${os}-${arch} + to: local-browsers + - from: node_modules/@img/**/* + to: app.asar.unpacked/node_modules/@img + - NOTICE.txt +publish: + - provider: github +extraMetadata: + main: build/electron/electron.js +protocols: + - name: elastic-synthetics-recorder + schemes: + - elastic-synthetics-recorder +mac: + icon: public/elastic.png + category: public.app-category.developer-tools + entitlements: assets/entitlements.mac.plist + entitlementsInherit: assets/entitlements.mac.plist + gatekeeperAssess: false + hardenedRuntime: true + asar: true + target: + - target: default + arch: + - x64 \ No newline at end of file diff --git a/electron-builder.win-x64.yml b/electron-builder.win-x64.yml new file mode 100644 index 00000000..18611163 --- /dev/null +++ b/electron-builder.win-x64.yml @@ -0,0 +1,35 @@ +productName: "Elastic Synthetics Recorder" +appId: co.elastic.synthetics-recorder +artifactName: ${name}-${version}-${os}-${arch}.${ext} +beforeBuild: "./scripts/fix-sharp.js" +beforePack: "./scripts/before-pack.js" +afterPack: "./scripts/after-pack.js" +afterSign: "./scripts/notarize.js" +files: + - build/**/* + - scripts/**/* + - assets/entitlements.mac.plist +extraResources: + - from: local-browsers/_releases/${os}-${arch} + to: local-browsers + - from: node_modules/@img/**/* + to: app.asar.unpacked/node_modules/@img + - NOTICE.txt +publish: + - provider: github +extraMetadata: + main: build/electron/electron.js +protocols: + - name: elastic-synthetics-recorder + schemes: + - elastic-synthetics-recorder +win: + target: + - target: nsis + arch: + - x64 + icon: public/elastic.png + asar: true + asarUnpack: + - "**\\*.{node,dll}" + - "**/node_modules/@elastic/synthetics/**" \ No newline at end of file diff --git a/electron/api/recordJourney.ts b/electron/api/recordJourney.ts index 4fd881d5..55b38ce8 100644 --- a/electron/api/recordJourney.ts +++ b/electron/api/recordJourney.ts @@ -51,6 +51,9 @@ export async function recordJourney( }; actionListener.on('actions', actionsHandler); + // setting this will prevent the playwright inspector window opening; + // we don't use this for anything and it's confusing and cluttering to the user + process.env.PWTEST_CLI_HEADLESS = 'true'; // _enableRecorder is private method, not defined in BrowserContext type await (context as any)._enableRecorder({ launchOptions: {}, diff --git a/package-lock.json b/package-lock.json index 5ff30109..3cf6f9db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "synthetics-recorder", - "version": "1.4.0", + "version": "1.4.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "synthetics-recorder", - "version": "1.4.0", + "version": "1.4.3", "hasInstallScript": true, "license": "MIT", "dependencies": { @@ -15,6 +15,7 @@ "@elastic/synthetics": "=1.16.2", "@emotion/cache": "^11.9.3", "@emotion/react": "^11.9.3", + "archiver-utils": "^5.0.2", "dotenv": "^16.0.3", "electron-debug": "^3.2.0", "electron-is-dev": "^2.0.0", @@ -2713,60 +2714,6 @@ "url": "https://github.com/sponsors/gjtorikian/" } }, - "node_modules/@electron/rebuild": { - "version": "3.6.1", - "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-3.6.1.tgz", - "integrity": "sha512-f6596ZHpEq/YskUd8emYvOUne89ij8mQgjYFA5ru25QwbrRO+t1SImofdDv7kKOuWCmVOuU5tvfkbgGxIl3E/w==", - "dev": true, - "dependencies": { - "@malept/cross-spawn-promise": "^2.0.0", - "chalk": "^4.0.0", - "debug": "^4.1.1", - "detect-libc": "^2.0.1", - "fs-extra": "^10.0.0", - "got": "^11.7.0", - "node-abi": "^3.45.0", - "node-api-version": "^0.2.0", - "node-gyp": "^9.0.0", - "ora": "^5.1.0", - "read-binary-file-arch": "^1.0.6", - "semver": "^7.3.5", - "tar": "^6.0.5", - "yargs": "^17.0.1" - }, - "bin": { - "electron-rebuild": "lib/cli.js" - }, - "engines": { - "node": ">=12.13.0" - } - }, - "node_modules/@electron/rebuild/node_modules/fs-extra": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", - "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@electron/rebuild/node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "dev": true, - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, "node_modules/@electron/universal": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@electron/universal/-/universal-2.0.1.tgz", @@ -6697,6 +6644,34 @@ "node": ">=10" } }, + "node_modules/app-builder-lib/node_modules/@electron/rebuild": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/@electron/rebuild/-/rebuild-3.6.1.tgz", + "integrity": "sha512-f6596ZHpEq/YskUd8emYvOUne89ij8mQgjYFA5ru25QwbrRO+t1SImofdDv7kKOuWCmVOuU5tvfkbgGxIl3E/w==", + "dev": true, + "dependencies": { + "@malept/cross-spawn-promise": "^2.0.0", + "chalk": "^4.0.0", + "debug": "^4.1.1", + "detect-libc": "^2.0.1", + "fs-extra": "^10.0.0", + "got": "^11.7.0", + "node-abi": "^3.45.0", + "node-api-version": "^0.2.0", + "node-gyp": "^9.0.0", + "ora": "^5.1.0", + "read-binary-file-arch": "^1.0.6", + "semver": "^7.3.5", + "tar": "^6.0.5", + "yargs": "^17.0.1" + }, + "bin": { + "electron-rebuild": "lib/cli.js" + }, + "engines": { + "node": ">=12.13.0" + } + }, "node_modules/app-builder-lib/node_modules/fs-extra": { "version": "10.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", diff --git a/package.json b/package.json index d4bb6037..73be3b94 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "synthetics-recorder", - "version": "1.4.0", + "version": "1.4.3", "description": "Record synthetics user journey flow of a website", "repository": "https://github.com/elastic/synthetics-recorder", "scripts": { @@ -8,13 +8,17 @@ "postinstall": "npm run install:pw && electron-builder install-app-deps && node dev-tools/dep-info.js && npm run prepare-demo-app --legacy-peer-deps", "prepare-demo-app": "npm install --prefix demo-app && npm run build --prefix demo-app", "react:start": "react-scripts start", - "react:build": "react-scripts build", + "react:build": "npx react-scripts build", "dev": "concurrently -k \"BROWSER=none npm run react:start\" \"npm run tsc-electron -- -w\" \"wait-on http://127.0.0.1:3000 && nodemon --exec electron build/electron/electron.js\"", - "build": "npm run clean && npm run react:build && npm run tsc-electron", + "build": "npm run react:build && npm run tsc-electron", "tsc-electron": "tsc -p tsconfig.node.json", "pack": "npm run build && electron-builder", "release": "npm run pack -- -mwl --publish=always", - "release-ci": "npm run pack -- -mwl --publish=never", + "release-ci": "npm run release-ci_mac-x64 && npm run release-ci_mac-arm64 && npm run release-ci_linux-x64 && npm run release-ci_windows-x64", + "release-ci_mac-x64": "npm run pack -- --mac --x64 --config=electron-builder.mac-x64.yml --publish=never", + "release-ci_mac-arm64": "npm run pack -- --mac --arm64 --config=electron-builder.mac-arm64.yml --publish=never", + "release-ci_linux-x64": "npm run pack -- --linux --x64 --config=electron-builder.linux-x64.yml --publish=never", + "release-ci_windows-x64": "npm run pack -- --windows --x64 --config=electron-builder.win-x64.yml --publish=never", "clean": "rm -rf ./build && rm -rf ./dist", "lint": "DEBUG=eslint:cli-engine eslint .", "format": "prettier --write .", @@ -86,6 +90,7 @@ "@elastic/synthetics": "=1.16.2", "@emotion/cache": "^11.9.3", "@emotion/react": "^11.9.3", + "archiver-utils": "^5.0.2", "dotenv": "^16.0.3", "electron-debug": "^3.2.0", "electron-is-dev": "^2.0.0", diff --git a/scripts/before-pack.js b/scripts/before-pack.js index 079bac1a..2525b03a 100644 --- a/scripts/before-pack.js +++ b/scripts/before-pack.js @@ -21,11 +21,12 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ + const { Arch } = require('electron-builder'); const { downloadForPlatform } = require('./download-chromium'); exports.default = function beforePack(ctx) { const arch = Arch[ctx.arch]; const platform = ctx.electronPlatformName; - return Promise.all([downloadForPlatform(platform, arch)]); + return downloadForPlatform(platform, arch); }; diff --git a/scripts/check-sharp.js b/scripts/check-sharp.js new file mode 100644 index 00000000..2e1af42f --- /dev/null +++ b/scripts/check-sharp.js @@ -0,0 +1,90 @@ +/* +MIT License + +Copyright (c) 2021-present, Elastic NV + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +const path = require('path'); +const fsPromises = require('fs').promises; + +const platformDirs = { + darwin_x64: 'mac/Elastic Synthetics Recorder.app/Contents/Resources', + darwin_arm64: 'mac-arm64/Elastic Synthetics Recorder.app/Contents/Resources', + linux_x64: 'linux-unpacked/resources', + win32_x64: 'win-unpacked/resources', +}; +const resourcesSubpath = path.join('app.asar.unpacked', 'node_modules', '@img'); +const libNames = { + darwin_x64: 'darwin-x64', + darwin_arm64: 'darwin-arm64', + linux_x64: 'linux-x64', + win32_x64: 'win32-x64', +}; +function sharpBinName(platform, arch) { + return `sharp-${libNames[formatPlatformArch(platform, arch)]}`; +} +function formatPlatformArch(platform, arch) { + return `${platform}_${arch}`; +} +async function dirExist(path) { + try { + await fsPromises.access(path); + } catch (_err) { + return false; + } + return true; +} + +// This script is called during the build process to ensure that if sharp binary dependencies are present in node_modules but have +// not been copied, they will be forcibly included in the package for the appropriate platform. +exports.default = async function checkSharpResources(ctx) { + const platform = ctx.platform.nodeName; + const { arch } = ctx; + const resourcePath = path.join( + __dirname, + '..', + 'dist', + platformDirs[formatPlatformArch(platform, arch)], + resourcesSubpath + ); + const rootNodeModules = path.join(__dirname, '..', 'node_modules', '@img'); + + if (!(await dirExist(resourcePath))) { + await fsPromises.mkdir(resourcePath, { recursive: true }); + } + + const contents = await fsPromises.readdir(resourcePath); + if (!contents.some(file => file === sharpBinName(platform, arch))) { + if (await dirExist(rootNodeModules)) { + const rootContents = await fsPromises.readdir(rootNodeModules); + const contentsSet = new Set(contents); + const toCopy = rootContents.filter(file => !contentsSet.has(file)); + + for (const file of toCopy) { + const sourcePath = path.join(rootNodeModules, file); + await fsPromises.cp(sourcePath, path.join(resourcePath, file), { + recursive: true, + force: false, + }); + } + } + } +}; diff --git a/scripts/fix-sharp.js b/scripts/fix-sharp.js new file mode 100644 index 00000000..e2358988 --- /dev/null +++ b/scripts/fix-sharp.js @@ -0,0 +1,64 @@ +/* +MIT License + +Copyright (c) 2021-present, Elastic NV + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ + +const { spawn } = require('child_process'); + +// This script will forcibly install sharp for the given platform, because +// at times the electro-builder process seems not to do this. +exports.default = async function fixSharp(ctx) { + const platform = ctx.platform.nodeName; + const arch = ctx.arch; + + const filteredEnvs = {}; + for (const [k, v] of Object.entries(process.env)) { + if (!k.startsWith('APPLE_') && !k.includes('PASSWORD')) { + filteredEnvs[k] = v; + } + } + + await new Promise((resolve, reject) => { + const npmInstall = spawn('sh', ['-c', 'env && npm install sharp'], { + stdio: 'inherit', + shell: true, + env: { + ...filteredEnvs, + npm_config_os: platform, + npm_config_cpu: arch, + npm_config_arch: arch, + npm_config_platform: platform, + }, + }); + npmInstall.on('close', code => { + if (code === 0) { + resolve(); + } else { + reject(new Error('process finished with error code ' + code)); + } + }); + npmInstall.on('error', reason => { + reject(reason); + }); + }); + return true; +};