From e2d6ee58ec0fb0f32cc83ff9823c0519a488e41f Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 10 Dec 2024 12:05:53 +0100 Subject: [PATCH 01/36] WIP: individual publishing of packages --- .github/workflows/bump-packages.yml | 57 +++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/bump-packages.yml diff --git a/.github/workflows/bump-packages.yml b/.github/workflows/bump-packages.yml new file mode 100644 index 0000000000..a98adf2ef7 --- /dev/null +++ b/.github/workflows/bump-packages.yml @@ -0,0 +1,57 @@ +name: Bump packages +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + update_generated_files: + name: Bump packages + runs-on: ubuntu-latest + steps: + - name: Create Github App Token + uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + id: app-token + with: + app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} + private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} + + - uses: actions/checkout@v4 + with: + # don't checkout a detatched HEAD + ref: ${{ github.head_ref }} + + - uses: actions/setup-node@v4 + with: + node-version: 20.16.0 + cache: "npm" + + - name: Install npm@10.2.4 + run: | + npm install -g npm@10.2.4 + + - name: Install Dependencies + run: | + npm -v + npm ci + + - name: Bump packages + env: + LAST_BUMP_COMMIT_MESSAGE: "chore(release): bump package versions" + SKIP_BUMP_PACKAGES: "mongodb-compass" + run: | + npm run bump-packages + git add . + git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true + + - name: Create Pull Request + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 + with: + token: ${{ steps.app-token.outputs.token }} + commit-message: "chore(release): bump package versions" + branch: ci/bump-packages + title: "chore(release): bump package versions" + labels: no-title-validation + body: | + - Bump package versions From f759846982de85e1fc841b519ba297e5c6f81d88 Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 18 Dec 2024 13:09:00 +0100 Subject: [PATCH 02/36] use 2.3.7 --- THIRD_PARTY_NOTICES.md | 303 +++++++++++++++++++++++++++-------------- 1 file changed, 202 insertions(+), 101 deletions(-) diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index 8ec1792ee1..d08817a519 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -20346,30 +20346,54 @@ License tags: Unlicense License files: * LICENSE: - This is free and unencumbered software released into the public domain. - - Anyone is free to copy, modify, publish, use, compile, sell, or - distribute this software, either in source code form or as a compiled - binary, for any purpose, commercial or non-commercial, and by any - means. - - In jurisdictions that recognize copyright laws, the author or authors - of this software dedicate any and all copyright interest in the - software to the public domain. We make this dedication for the benefit - of the public at large and to the detriment of our heirs and - successors. We intend this dedication to be an overt act of - relinquishment in perpetuity of all present and future rights to this - software under copyright law. - - 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 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. - - For more information, please refer to + This is free and unencumbered software released into the public domain. + + + + Anyone is free to copy, modify, publish, use, compile, sell, or + + distribute this software, either in source code form or as a compiled + + binary, for any purpose, commercial or non-commercial, and by any + + means. + + + + In jurisdictions that recognize copyright laws, the author or authors + + of this software dedicate any and all copyright interest in the + + software to the public domain. We make this dedication for the benefit + + of the public at large and to the detriment of our heirs and + + successors. We intend this dedication to be an overt act of + + relinquishment in perpetuity of all present and future rights to this + + software under copyright law. + + + + 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 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. + + + + For more information, please refer to + @@ -21431,13 +21455,20 @@ License tags: MIT License files: * LICENSE: - The MIT License (MIT) - Copyright (c) 2015 Dmitry Ivanov - - 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 MIT License (MIT) + + Copyright (c) 2015 Dmitry Ivanov + + + + 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. @@ -21711,24 +21742,42 @@ License tags: MIT License files: * LICENSE: - Copyright Brian White. All rights reserved. - - 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 + Copyright Brian White. All rights reserved. + + + + 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. @@ -31151,36 +31200,62 @@ License tags: 0BSD License files: * CopyrightNotice.txt: - /*! ***************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - + /*! ***************************************************************************** + + Copyright (c) Microsoft Corporation. + + + + Permission to use, copy, modify, and/or distribute this software for any + + purpose with or without fee is hereby granted. + + + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + + PERFORMANCE OF THIS SOFTWARE. + + ***************************************************************************** */ + + + * LICENSE.txt: - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + Copyright (c) Microsoft Corporation. + + + + Permission to use, copy, modify, and/or distribute this software for any + + purpose with or without fee is hereby granted. + + + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. @@ -31191,36 +31266,62 @@ License tags: 0BSD License files: * CopyrightNotice.txt: - /****************************************************************************** - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - PERFORMANCE OF THIS SOFTWARE. - ***************************************************************************** */ - + /****************************************************************************** + + Copyright (c) Microsoft Corporation. + + + + Permission to use, copy, modify, and/or distribute this software for any + + purpose with or without fee is hereby granted. + + + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + + PERFORMANCE OF THIS SOFTWARE. + + ***************************************************************************** */ + + + * LICENSE.txt: - Copyright (c) Microsoft Corporation. - - Permission to use, copy, modify, and/or distribute this software for any - purpose with or without fee is hereby granted. - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + Copyright (c) Microsoft Corporation. + + + + Permission to use, copy, modify, and/or distribute this software for any + + purpose with or without fee is hereby granted. + + + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. From 229634004febd68e22e363caad1404482824cf2f Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 18 Dec 2024 13:18:09 +0100 Subject: [PATCH 03/36] update package-lock.json and packages --- package-lock.json | 329 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 12 +- 2 files changed, 335 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 21ce0afe7b..ba5c84bf1b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29118,6 +29118,19 @@ "node": ">=14.15.1" } }, + "packages/browser-runtime-core/node_modules/@mongosh/types": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.7.tgz", + "integrity": "sha512-0rOQM9CtsGcpkBmQOjdSbZw/idWNuBl38+Fk7H74goEey7ojE/PZvKtcAwSaODsJIrDhCqWx+1w+TdspVokeAg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/browser-runtime-electron": { "name": "@mongosh/browser-runtime-electron", "version": "3.0.0", @@ -29727,6 +29740,216 @@ "node": ">=14.15.1" } }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/arg-parser": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.7.tgz", + "integrity": "sha512-cChpbvlSjaHAtO2nAgrJpWBhvL8BPZhjS0PWxlYlHIGdLSHKCjOA62QsAKTP57HIcs4lirhrvV3DqP9FZnKftg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.7", + "@mongosh/i18n": "2.3.7", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/async-rewriter2": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/async-rewriter2/-/async-rewriter2-2.3.7.tgz", + "integrity": "sha512-847ZzSbvoz0iveZt23AWD6iJQ7qm6CZdHOASVBvmKTyixf3rMt/y+L/xvOuZvz5kEU7eCaFa99eyW6SN4DBNog==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/core": "^7.22.8", + "@babel/plugin-transform-destructuring": "^7.22.5", + "@babel/plugin-transform-parameters": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "bin": { + "async-rewrite": "bin/async-rewrite.js" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/autocomplete": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/autocomplete/-/autocomplete-2.3.7.tgz", + "integrity": "sha512-+LSbyX5ej4gD3uVL0hvgX66f/1V6BM1ccwEvIHQWePaIuprvThSE1mPwt8dl6Dz8PoqB/wzMp1nbUVE51pUoJA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/mongodb-constants": "^0.10.1", + "@mongosh/shell-api": "2.3.7", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-core": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-core/-/browser-runtime-core-2.3.7.tgz", + "integrity": "sha512-L3HEGKqmZ8IPjcTTmUHu3oN1D1wv1MBWS1MhwkcAhprqOfLOu9vloLfX/uWV5+w8MqarWZZDQEzWkWrZ40y49A==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/autocomplete": "2.3.7", + "@mongosh/service-provider-core": "2.3.7", + "@mongosh/shell-api": "2.3.7", + "@mongosh/shell-evaluator": "2.3.7" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-electron": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-electron/-/browser-runtime-electron-2.3.7.tgz", + "integrity": "sha512-y3RHWClFo1xqG3zZIohfAb/DKkTpc3irKrDy+MPs0NqeOgqrGhRq8tPZB8nN9SOK19DWfjTmfWUKBpdOL3Ou+g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/browser-runtime-core": "2.3.7", + "@mongosh/service-provider-core": "2.3.7", + "@mongosh/types": "2.3.7" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/errors": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.7.tgz", + "integrity": "sha512-WQ7vyeypDYnQIVieNJDF+GhItt46oR9bL2ossWJ9PrTxX57gwV8y1k1YKdhmrWOAVejp5ZDNPWKPyAM5/Ri0Kw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/history": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.7.tgz", + "integrity": "sha512-4EEyPZuFTHEAPUvn6ga4+xcz2NKrl5fJIU37T9eyWJb4BfpDxG+CrrLGRRMqfS+LHar7Xen/oEWWKOMvrt1x8g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "mongodb-connection-string-url": "^3.0.1", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/i18n": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.7.tgz", + "integrity": "sha512-xH5ZK29jb4pf3cBOFpomz3Zq2PnZLTgBRiteqGLucTrGM1YZ7Nr81fFMEa8il0wTK2taQ8yuCvhGC0liiM+8sw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.7" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-core": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.7.tgz", + "integrity": "sha512-y6gQv3Pi6vSR0O1pIpBNDJv84oY+QKKUJAIjDRwGAmgRP6CuMXr25J6R57iLxVzsdhxPxZml1RXvvncM8gRGkA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-providers": "^3.525.0", + "@mongosh/errors": "2.3.7", + "bson": "^6.10.1", + "mongodb": "^6.12.0", + "mongodb-build-info": "^1.7.2", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + }, + "optionalDependencies": { + "mongodb-client-encryption": "^6.1.0" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-node-driver": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/service-provider-node-driver/-/service-provider-node-driver-2.3.7.tgz", + "integrity": "sha512-qxWwuwFcmI2cQxaBClof886vw2W0TNYNC0ewnjTtWo8EF01uGB9krATKp1rn5A+FX62z6dI1J0L0oYLpmlu68w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4", + "@mongodb-js/oidc-plugin": "^1.1.5", + "@mongosh/errors": "2.3.7", + "@mongosh/service-provider-core": "2.3.7", + "@mongosh/types": "2.3.7", + "aws4": "^1.12.0", + "mongodb": "^6.12.0", + "mongodb-connection-string-url": "^3.0.1", + "socks": "^2.8.3" + }, + "engines": { + "node": ">=14.15.1" + }, + "optionalDependencies": { + "kerberos": "2.1.0", + "mongodb-client-encryption": "^6.1.0" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-api": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.7.tgz", + "integrity": "sha512-3aWHB74dUPrPGVQgOsfJUykx/sy4CbUXoZTUZA8VZt6i0aRZFuJ0bbEFmtZ7hM4cmacNVlqe+ry/6rxC7KL/hA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/arg-parser": "2.3.7", + "@mongosh/errors": "2.3.7", + "@mongosh/history": "2.3.7", + "@mongosh/i18n": "2.3.7", + "@mongosh/service-provider-core": "2.3.7", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-evaluator": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/shell-evaluator/-/shell-evaluator-2.3.7.tgz", + "integrity": "sha512-pdG+ILkFiejOySti3QMte3vTHOQhLrjag8Gfm4DjnH2oK8z4Yw5lr4BfWS5u5JaSvtmmOIEW1mRp2UJbSiKjDA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/async-rewriter2": "2.3.7", + "@mongosh/history": "2.3.7", + "@mongosh/shell-api": "2.3.7" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/types": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.7.tgz", + "integrity": "sha512-0rOQM9CtsGcpkBmQOjdSbZw/idWNuBl38+Fk7H74goEey7ojE/PZvKtcAwSaODsJIrDhCqWx+1w+TdspVokeAg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/service-provider-core": { "name": "@mongosh/service-provider-core", "version": "3.0.0", @@ -29754,6 +29977,15 @@ "mongodb-client-encryption": "^6.1.0" } }, + "packages/service-provider-core/node_modules/@mongosh/errors": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.7.tgz", + "integrity": "sha512-WQ7vyeypDYnQIVieNJDF+GhItt46oR9bL2ossWJ9PrTxX57gwV8y1k1YKdhmrWOAVejp5ZDNPWKPyAM5/Ri0Kw==", + "license": "Apache-2.0", + "engines": { + "node": ">=14.15.1" + } + }, "packages/service-provider-node-driver": { "name": "@mongosh/service-provider-node-driver", "version": "3.0.0", @@ -29873,6 +30105,103 @@ "node": ">=14.15.1" } }, + "packages/snippet-manager/node_modules/@mongosh/arg-parser": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.7.tgz", + "integrity": "sha512-cChpbvlSjaHAtO2nAgrJpWBhvL8BPZhjS0PWxlYlHIGdLSHKCjOA62QsAKTP57HIcs4lirhrvV3DqP9FZnKftg==", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.7", + "@mongosh/i18n": "2.3.7", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/errors": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.7.tgz", + "integrity": "sha512-WQ7vyeypDYnQIVieNJDF+GhItt46oR9bL2ossWJ9PrTxX57gwV8y1k1YKdhmrWOAVejp5ZDNPWKPyAM5/Ri0Kw==", + "license": "Apache-2.0", + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/history": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.7.tgz", + "integrity": "sha512-4EEyPZuFTHEAPUvn6ga4+xcz2NKrl5fJIU37T9eyWJb4BfpDxG+CrrLGRRMqfS+LHar7Xen/oEWWKOMvrt1x8g==", + "license": "Apache-2.0", + "dependencies": { + "mongodb-connection-string-url": "^3.0.1", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/i18n": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.7.tgz", + "integrity": "sha512-xH5ZK29jb4pf3cBOFpomz3Zq2PnZLTgBRiteqGLucTrGM1YZ7Nr81fFMEa8il0wTK2taQ8yuCvhGC0liiM+8sw==", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.7" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/service-provider-core": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.7.tgz", + "integrity": "sha512-y6gQv3Pi6vSR0O1pIpBNDJv84oY+QKKUJAIjDRwGAmgRP6CuMXr25J6R57iLxVzsdhxPxZml1RXvvncM8gRGkA==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-providers": "^3.525.0", + "@mongosh/errors": "2.3.7", + "bson": "^6.10.1", + "mongodb": "^6.12.0", + "mongodb-build-info": "^1.7.2", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + }, + "optionalDependencies": { + "mongodb-client-encryption": "^6.1.0" + } + }, + "packages/snippet-manager/node_modules/@mongosh/shell-api": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.7.tgz", + "integrity": "sha512-3aWHB74dUPrPGVQgOsfJUykx/sy4CbUXoZTUZA8VZt6i0aRZFuJ0bbEFmtZ7hM4cmacNVlqe+ry/6rxC7KL/hA==", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/arg-parser": "2.3.7", + "@mongosh/errors": "2.3.7", + "@mongosh/history": "2.3.7", + "@mongosh/i18n": "2.3.7", + "@mongosh/service-provider-core": "2.3.7", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/types": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.7.tgz", + "integrity": "sha512-0rOQM9CtsGcpkBmQOjdSbZw/idWNuBl38+Fk7H74goEey7ojE/PZvKtcAwSaODsJIrDhCqWx+1w+TdspVokeAg==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/snippet-manager/node_modules/@types/cross-spawn": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.6.tgz", diff --git a/package.json b/package.json index af12edefb6..9a6b14d705 100644 --- a/package.json +++ b/package.json @@ -149,24 +149,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/types", - "packages/i18n", "packages/logging", + "packages/node-runtime-worker-thread", "packages/service-provider-core", - "packages/arg-parser", + "packages/snippet-manager", + "packages/types", + "packages/i18n", "packages/service-provider-node-driver", + "packages/arg-parser", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", - "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", + "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", - "packages/node-runtime-worker-thread", - "packages/browser-repl", "packages/connectivity-tests" ], "overrides": { From 546574ab9fb504cb5230b0d4f5fbd47f9985f7c9 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 19 Dec 2024 11:08:57 +0100 Subject: [PATCH 04/36] restore changes --- THIRD_PARTY_NOTICES.md | 303 ++++++++++-------------------- package-lock.json | 414 ++++++----------------------------------- package.json | 12 +- 3 files changed, 162 insertions(+), 567 deletions(-) diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md index d08817a519..8ec1792ee1 100644 --- a/THIRD_PARTY_NOTICES.md +++ b/THIRD_PARTY_NOTICES.md @@ -20346,54 +20346,30 @@ License tags: Unlicense License files: * LICENSE: - This is free and unencumbered software released into the public domain. - - - - Anyone is free to copy, modify, publish, use, compile, sell, or - - distribute this software, either in source code form or as a compiled - - binary, for any purpose, commercial or non-commercial, and by any - - means. - - - - In jurisdictions that recognize copyright laws, the author or authors - - of this software dedicate any and all copyright interest in the - - software to the public domain. We make this dedication for the benefit - - of the public at large and to the detriment of our heirs and - - successors. We intend this dedication to be an overt act of - - relinquishment in perpetuity of all present and future rights to this - - software under copyright law. - - - - 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 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. - - - - For more information, please refer to - + This is free and unencumbered software released into the public domain. + + Anyone is free to copy, modify, publish, use, compile, sell, or + distribute this software, either in source code form or as a compiled + binary, for any purpose, commercial or non-commercial, and by any + means. + + In jurisdictions that recognize copyright laws, the author or authors + of this software dedicate any and all copyright interest in the + software to the public domain. We make this dedication for the benefit + of the public at large and to the detriment of our heirs and + successors. We intend this dedication to be an overt act of + relinquishment in perpetuity of all present and future rights to this + software under copyright law. + + 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 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. + + For more information, please refer to @@ -21455,20 +21431,13 @@ License tags: MIT License files: * LICENSE: - The MIT License (MIT) - - Copyright (c) 2015 Dmitry Ivanov - - - - 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 MIT License (MIT) + Copyright (c) 2015 Dmitry Ivanov + + 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. @@ -21742,42 +21711,24 @@ License tags: MIT License files: * LICENSE: - Copyright Brian White. All rights reserved. - - - - 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 - + Copyright Brian White. All rights reserved. + + 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. @@ -31200,62 +31151,36 @@ License tags: 0BSD License files: * CopyrightNotice.txt: - /*! ***************************************************************************** - - Copyright (c) Microsoft Corporation. - - - - Permission to use, copy, modify, and/or distribute this software for any - - purpose with or without fee is hereby granted. - - - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - - PERFORMANCE OF THIS SOFTWARE. - - ***************************************************************************** */ - - - + /*! ***************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + * LICENSE.txt: - Copyright (c) Microsoft Corporation. - - - - Permission to use, copy, modify, and/or distribute this software for any - - purpose with or without fee is hereby granted. - - - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. @@ -31266,62 +31191,36 @@ License tags: 0BSD License files: * CopyrightNotice.txt: - /****************************************************************************** - - Copyright (c) Microsoft Corporation. - - - - Permission to use, copy, modify, and/or distribute this software for any - - purpose with or without fee is hereby granted. - - - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - - PERFORMANCE OF THIS SOFTWARE. - - ***************************************************************************** */ - - - + /****************************************************************************** + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + ***************************************************************************** */ + * LICENSE.txt: - Copyright (c) Microsoft Corporation. - - - - Permission to use, copy, modify, and/or distribute this software for any - - purpose with or without fee is hereby granted. - - - - THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH - - REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY - - AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, - - INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM - - LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR - - OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - + Copyright (c) Microsoft Corporation. + + Permission to use, copy, modify, and/or distribute this software for any + purpose with or without fee is hereby granted. + + THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR + OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/package-lock.json b/package-lock.json index ba5c84bf1b..c2c07f7f50 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,24 +17,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/types", - "packages/i18n", "packages/logging", + "packages/node-runtime-worker-thread", "packages/service-provider-core", - "packages/arg-parser", + "packages/snippet-manager", + "packages/types", + "packages/i18n", "packages/service-provider-node-driver", + "packages/arg-parser", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", - "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", + "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", - "packages/node-runtime-worker-thread", - "packages/browser-repl", "packages/connectivity-tests" ], "bin": { @@ -5659,30 +5659,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/@mongodb-js/devtools-connect": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.3.4.tgz", - "integrity": "sha512-zD1uu/e2+/SbkSjzdxCg8PSVJkRY+/z1h75F1kZ2UPuy41PmLe9f7Lh8zC1rlR+uFUUcUc503QknfmvinnPSOg==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.4.2", - "@mongodb-js/oidc-http-server-pages": "1.1.3", - "lodash.merge": "^4.6.2", - "mongodb-connection-string-url": "^3.0.0", - "socks": "^2.7.3" - }, - "optionalDependencies": { - "kerberos": "^2.1.0", - "mongodb-client-encryption": "^6.1.0", - "os-dns-native": "^1.2.0", - "resolve-mongodb-srv": "^1.1.1" - }, - "peerDependencies": { - "@mongodb-js/oidc-plugin": "^1.1.0", - "mongodb": "^6.9.0", - "mongodb-log-writer": "^1.4.2" - } - }, "node_modules/@mongodb-js/devtools-github-repo": { "version": "1.2.0", "license": "Apache-2.0", @@ -28857,6 +28833,31 @@ "node": ">=14.15.1" } }, + "packages/arg-parser/node_modules/@mongodb-js/devtools-connect": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.3.4.tgz", + "integrity": "sha512-zD1uu/e2+/SbkSjzdxCg8PSVJkRY+/z1h75F1kZ2UPuy41PmLe9f7Lh8zC1rlR+uFUUcUc503QknfmvinnPSOg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-proxy-support": "^0.4.2", + "@mongodb-js/oidc-http-server-pages": "1.1.3", + "lodash.merge": "^4.6.2", + "mongodb-connection-string-url": "^3.0.0", + "socks": "^2.7.3" + }, + "optionalDependencies": { + "kerberos": "^2.1.0", + "mongodb-client-encryption": "^6.1.0", + "os-dns-native": "^1.2.0", + "resolve-mongodb-srv": "^1.1.1" + }, + "peerDependencies": { + "@mongodb-js/oidc-plugin": "^1.1.0", + "mongodb": "^6.9.0", + "mongodb-log-writer": "^1.4.2" + } + }, "packages/async-rewriter2": { "name": "@mongosh/async-rewriter2", "version": "2.4.0", @@ -29118,19 +29119,6 @@ "node": ">=14.15.1" } }, - "packages/browser-runtime-core/node_modules/@mongosh/types": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.7.tgz", - "integrity": "sha512-0rOQM9CtsGcpkBmQOjdSbZw/idWNuBl38+Fk7H74goEey7ojE/PZvKtcAwSaODsJIrDhCqWx+1w+TdspVokeAg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/browser-runtime-electron": { "name": "@mongosh/browser-runtime-electron", "version": "3.0.0", @@ -29740,216 +29728,6 @@ "node": ">=14.15.1" } }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/arg-parser": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.7.tgz", - "integrity": "sha512-cChpbvlSjaHAtO2nAgrJpWBhvL8BPZhjS0PWxlYlHIGdLSHKCjOA62QsAKTP57HIcs4lirhrvV3DqP9FZnKftg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.7", - "@mongosh/i18n": "2.3.7", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/async-rewriter2": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/async-rewriter2/-/async-rewriter2-2.3.7.tgz", - "integrity": "sha512-847ZzSbvoz0iveZt23AWD6iJQ7qm6CZdHOASVBvmKTyixf3rMt/y+L/xvOuZvz5kEU7eCaFa99eyW6SN4DBNog==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/core": "^7.22.8", - "@babel/plugin-transform-destructuring": "^7.22.5", - "@babel/plugin-transform-parameters": "^7.22.5", - "@babel/plugin-transform-shorthand-properties": "^7.22.5", - "@babel/types": "^7.22.5" - }, - "bin": { - "async-rewrite": "bin/async-rewrite.js" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/autocomplete": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/autocomplete/-/autocomplete-2.3.7.tgz", - "integrity": "sha512-+LSbyX5ej4gD3uVL0hvgX66f/1V6BM1ccwEvIHQWePaIuprvThSE1mPwt8dl6Dz8PoqB/wzMp1nbUVE51pUoJA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/mongodb-constants": "^0.10.1", - "@mongosh/shell-api": "2.3.7", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-core": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-core/-/browser-runtime-core-2.3.7.tgz", - "integrity": "sha512-L3HEGKqmZ8IPjcTTmUHu3oN1D1wv1MBWS1MhwkcAhprqOfLOu9vloLfX/uWV5+w8MqarWZZDQEzWkWrZ40y49A==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/autocomplete": "2.3.7", - "@mongosh/service-provider-core": "2.3.7", - "@mongosh/shell-api": "2.3.7", - "@mongosh/shell-evaluator": "2.3.7" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-electron": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-electron/-/browser-runtime-electron-2.3.7.tgz", - "integrity": "sha512-y3RHWClFo1xqG3zZIohfAb/DKkTpc3irKrDy+MPs0NqeOgqrGhRq8tPZB8nN9SOK19DWfjTmfWUKBpdOL3Ou+g==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/browser-runtime-core": "2.3.7", - "@mongosh/service-provider-core": "2.3.7", - "@mongosh/types": "2.3.7" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/errors": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.7.tgz", - "integrity": "sha512-WQ7vyeypDYnQIVieNJDF+GhItt46oR9bL2ossWJ9PrTxX57gwV8y1k1YKdhmrWOAVejp5ZDNPWKPyAM5/Ri0Kw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/history": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.7.tgz", - "integrity": "sha512-4EEyPZuFTHEAPUvn6ga4+xcz2NKrl5fJIU37T9eyWJb4BfpDxG+CrrLGRRMqfS+LHar7Xen/oEWWKOMvrt1x8g==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "mongodb-connection-string-url": "^3.0.1", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/i18n": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.7.tgz", - "integrity": "sha512-xH5ZK29jb4pf3cBOFpomz3Zq2PnZLTgBRiteqGLucTrGM1YZ7Nr81fFMEa8il0wTK2taQ8yuCvhGC0liiM+8sw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.7" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-core": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.7.tgz", - "integrity": "sha512-y6gQv3Pi6vSR0O1pIpBNDJv84oY+QKKUJAIjDRwGAmgRP6CuMXr25J6R57iLxVzsdhxPxZml1RXvvncM8gRGkA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-providers": "^3.525.0", - "@mongosh/errors": "2.3.7", - "bson": "^6.10.1", - "mongodb": "^6.12.0", - "mongodb-build-info": "^1.7.2", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - }, - "optionalDependencies": { - "mongodb-client-encryption": "^6.1.0" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-node-driver": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/service-provider-node-driver/-/service-provider-node-driver-2.3.7.tgz", - "integrity": "sha512-qxWwuwFcmI2cQxaBClof886vw2W0TNYNC0ewnjTtWo8EF01uGB9krATKp1rn5A+FX62z6dI1J0L0oYLpmlu68w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4", - "@mongodb-js/oidc-plugin": "^1.1.5", - "@mongosh/errors": "2.3.7", - "@mongosh/service-provider-core": "2.3.7", - "@mongosh/types": "2.3.7", - "aws4": "^1.12.0", - "mongodb": "^6.12.0", - "mongodb-connection-string-url": "^3.0.1", - "socks": "^2.8.3" - }, - "engines": { - "node": ">=14.15.1" - }, - "optionalDependencies": { - "kerberos": "2.1.0", - "mongodb-client-encryption": "^6.1.0" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-api": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.7.tgz", - "integrity": "sha512-3aWHB74dUPrPGVQgOsfJUykx/sy4CbUXoZTUZA8VZt6i0aRZFuJ0bbEFmtZ7hM4cmacNVlqe+ry/6rxC7KL/hA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/arg-parser": "2.3.7", - "@mongosh/errors": "2.3.7", - "@mongosh/history": "2.3.7", - "@mongosh/i18n": "2.3.7", - "@mongosh/service-provider-core": "2.3.7", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-evaluator": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/shell-evaluator/-/shell-evaluator-2.3.7.tgz", - "integrity": "sha512-pdG+ILkFiejOySti3QMte3vTHOQhLrjag8Gfm4DjnH2oK8z4Yw5lr4BfWS5u5JaSvtmmOIEW1mRp2UJbSiKjDA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/async-rewriter2": "2.3.7", - "@mongosh/history": "2.3.7", - "@mongosh/shell-api": "2.3.7" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/types": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.7.tgz", - "integrity": "sha512-0rOQM9CtsGcpkBmQOjdSbZw/idWNuBl38+Fk7H74goEey7ojE/PZvKtcAwSaODsJIrDhCqWx+1w+TdspVokeAg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/service-provider-core": { "name": "@mongosh/service-provider-core", "version": "3.0.0", @@ -29977,15 +29755,6 @@ "mongodb-client-encryption": "^6.1.0" } }, - "packages/service-provider-core/node_modules/@mongosh/errors": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.7.tgz", - "integrity": "sha512-WQ7vyeypDYnQIVieNJDF+GhItt46oR9bL2ossWJ9PrTxX57gwV8y1k1YKdhmrWOAVejp5ZDNPWKPyAM5/Ri0Kw==", - "license": "Apache-2.0", - "engines": { - "node": ">=14.15.1" - } - }, "packages/service-provider-node-driver": { "name": "@mongosh/service-provider-node-driver", "version": "3.0.0", @@ -30105,103 +29874,6 @@ "node": ">=14.15.1" } }, - "packages/snippet-manager/node_modules/@mongosh/arg-parser": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.7.tgz", - "integrity": "sha512-cChpbvlSjaHAtO2nAgrJpWBhvL8BPZhjS0PWxlYlHIGdLSHKCjOA62QsAKTP57HIcs4lirhrvV3DqP9FZnKftg==", - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.7", - "@mongosh/i18n": "2.3.7", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/errors": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.7.tgz", - "integrity": "sha512-WQ7vyeypDYnQIVieNJDF+GhItt46oR9bL2ossWJ9PrTxX57gwV8y1k1YKdhmrWOAVejp5ZDNPWKPyAM5/Ri0Kw==", - "license": "Apache-2.0", - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/history": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.7.tgz", - "integrity": "sha512-4EEyPZuFTHEAPUvn6ga4+xcz2NKrl5fJIU37T9eyWJb4BfpDxG+CrrLGRRMqfS+LHar7Xen/oEWWKOMvrt1x8g==", - "license": "Apache-2.0", - "dependencies": { - "mongodb-connection-string-url": "^3.0.1", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/i18n": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.7.tgz", - "integrity": "sha512-xH5ZK29jb4pf3cBOFpomz3Zq2PnZLTgBRiteqGLucTrGM1YZ7Nr81fFMEa8il0wTK2taQ8yuCvhGC0liiM+8sw==", - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.7" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/service-provider-core": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.7.tgz", - "integrity": "sha512-y6gQv3Pi6vSR0O1pIpBNDJv84oY+QKKUJAIjDRwGAmgRP6CuMXr25J6R57iLxVzsdhxPxZml1RXvvncM8gRGkA==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-providers": "^3.525.0", - "@mongosh/errors": "2.3.7", - "bson": "^6.10.1", - "mongodb": "^6.12.0", - "mongodb-build-info": "^1.7.2", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - }, - "optionalDependencies": { - "mongodb-client-encryption": "^6.1.0" - } - }, - "packages/snippet-manager/node_modules/@mongosh/shell-api": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.7.tgz", - "integrity": "sha512-3aWHB74dUPrPGVQgOsfJUykx/sy4CbUXoZTUZA8VZt6i0aRZFuJ0bbEFmtZ7hM4cmacNVlqe+ry/6rxC7KL/hA==", - "license": "Apache-2.0", - "dependencies": { - "@mongosh/arg-parser": "2.3.7", - "@mongosh/errors": "2.3.7", - "@mongosh/history": "2.3.7", - "@mongosh/i18n": "2.3.7", - "@mongosh/service-provider-core": "2.3.7", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/types": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.7.tgz", - "integrity": "sha512-0rOQM9CtsGcpkBmQOjdSbZw/idWNuBl38+Fk7H74goEey7ojE/PZvKtcAwSaODsJIrDhCqWx+1w+TdspVokeAg==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/snippet-manager/node_modules/@types/cross-spawn": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.6.tgz", @@ -30232,6 +29904,30 @@ "node": ">=14.15.1" } }, + "packages/types/node_modules/@mongodb-js/devtools-connect": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.3.4.tgz", + "integrity": "sha512-zD1uu/e2+/SbkSjzdxCg8PSVJkRY+/z1h75F1kZ2UPuy41PmLe9f7Lh8zC1rlR+uFUUcUc503QknfmvinnPSOg==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-proxy-support": "^0.4.2", + "@mongodb-js/oidc-http-server-pages": "1.1.3", + "lodash.merge": "^4.6.2", + "mongodb-connection-string-url": "^3.0.0", + "socks": "^2.7.3" + }, + "optionalDependencies": { + "kerberos": "^2.1.0", + "mongodb-client-encryption": "^6.1.0", + "os-dns-native": "^1.2.0", + "resolve-mongodb-srv": "^1.1.1" + }, + "peerDependencies": { + "@mongodb-js/oidc-plugin": "^1.1.0", + "mongodb": "^6.9.0", + "mongodb-log-writer": "^1.4.2" + } + }, "scripts/docker": { "name": "@mongosh/docker-build-scripts", "version": "3.0.0", diff --git a/package.json b/package.json index 9a6b14d705..af12edefb6 100644 --- a/package.json +++ b/package.json @@ -149,24 +149,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/logging", - "packages/node-runtime-worker-thread", - "packages/service-provider-core", - "packages/snippet-manager", "packages/types", "packages/i18n", - "packages/service-provider-node-driver", + "packages/logging", + "packages/service-provider-core", "packages/arg-parser", + "packages/service-provider-node-driver", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", + "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", - "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", + "packages/node-runtime-worker-thread", + "packages/browser-repl", "packages/connectivity-tests" ], "overrides": { From f71c326f06f70d38c3d28d29f5ef8b1ec47a5b48 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 19 Dec 2024 13:44:29 +0100 Subject: [PATCH 05/36] wip --- configs/eslint-config-mongosh/package.json | 2 +- configs/tsconfig-mongosh/package.json | 2 +- package-lock.json | 94 +++++++++---------- packages/arg-parser/package.json | 4 +- packages/async-rewriter2/package.json | 4 +- packages/autocomplete/package.json | 4 +- packages/browser-repl/package.json | 4 +- packages/browser-runtime-core/package.json | 2 +- .../browser-runtime-electron/package.json | 2 +- packages/build/package.json | 2 +- packages/cli-repl/package.json | 4 +- packages/e2e-tests/package.json | 4 +- packages/editor/package.json | 4 +- packages/errors/package.json | 4 +- packages/history/package.json | 4 +- packages/i18n/package.json | 4 +- packages/java-shell/package.json | 2 +- .../js-multiline-to-singleline/package.json | 4 +- packages/logging/package.json | 4 +- .../node-runtime-worker-thread/package.json | 2 +- packages/service-provider-core/package.json | 4 +- .../service-provider-node-driver/package.json | 4 +- packages/shell-api/package.json | 2 +- packages/shell-evaluator/package.json | 2 +- packages/snippet-manager/package.json | 4 +- packages/types/package.json | 4 +- 26 files changed, 88 insertions(+), 88 deletions(-) diff --git a/configs/eslint-config-mongosh/package.json b/configs/eslint-config-mongosh/package.json index dd95cbf3f8..d0c201384e 100644 --- a/configs/eslint-config-mongosh/package.json +++ b/configs/eslint-config-mongosh/package.json @@ -1,6 +1,6 @@ { "name": "@mongodb-js/eslint-config-mongosh", - "version": "1.0.0", + "version": "1.0.2", "private": true, "description": "Shared Mongosh eslint configuration", "license": "SSPL", diff --git a/configs/tsconfig-mongosh/package.json b/configs/tsconfig-mongosh/package.json index 4b3440b2b7..4b846acf95 100644 --- a/configs/tsconfig-mongosh/package.json +++ b/configs/tsconfig-mongosh/package.json @@ -1,6 +1,6 @@ { "name": "@mongodb-js/tsconfig-mongosh", - "version": "1.0.0", + "version": "1.0.2", "private": true, "description": "Shared Mongosh Typescript configuration", "license": "SSPL", diff --git a/package-lock.json b/package-lock.json index c2c07f7f50..bf9a9db973 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,24 +17,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/logging", - "packages/node-runtime-worker-thread", - "packages/service-provider-core", - "packages/snippet-manager", "packages/types", "packages/i18n", - "packages/service-provider-node-driver", + "packages/logging", + "packages/service-provider-core", "packages/arg-parser", + "packages/service-provider-node-driver", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", + "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", - "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", + "packages/node-runtime-worker-thread", + "packages/browser-repl", "packages/connectivity-tests" ], "bin": { @@ -89,7 +89,7 @@ }, "configs/eslint-config-mongosh": { "name": "@mongodb-js/eslint-config-mongosh", - "version": "1.0.0", + "version": "1.0.2", "license": "SSPL", "dependencies": { "@babel/core": "^7.21.4", @@ -113,7 +113,7 @@ }, "configs/tsconfig-mongosh": { "name": "@mongodb-js/tsconfig-mongosh", - "version": "1.0.0", + "version": "1.0.2", "license": "SSPL", "devDependencies": { "@mongodb-js/prettier-config-devtools": "^1.0.0", @@ -28821,9 +28821,9 @@ }, "devDependencies": { "@mongodb-js/devtools-connect": "^3.3.4", - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", @@ -28873,9 +28873,9 @@ "async-rewrite": "bin/async-rewrite.js" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/babel__core": "^7.20.1", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -28895,9 +28895,9 @@ "semver": "^7.5.4" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", @@ -28928,9 +28928,9 @@ "@babel/preset-typescript": "^7.18.6", "@mongodb-js/compass-components": "*", "@mongodb-js/compass-editor": "*", - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8", "@testing-library/dom": "^8.20.1", "@testing-library/react": "^12.1.5", @@ -29105,7 +29105,7 @@ "@mongosh/shell-evaluator": "3.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", @@ -29129,7 +29129,7 @@ "@mongosh/types": "3.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "3.0.0", @@ -29177,7 +29177,7 @@ "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/command-exists": "^1.2.0", "@types/cross-spawn": "^6.0.6", "@types/download": "^8.0.1", @@ -29314,10 +29314,10 @@ "mongosh": "bin/mongosh.js" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.7.0", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/ansi-escape-sequences": "^4.0.0", "@types/chai-as-promised": "^7.1.3", "@types/js-yaml": "^4.0.5", @@ -29377,10 +29377,10 @@ "strip-ansi": "^6.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/oidc-mock-provider": "^0.10.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/chai-as-promised": "^7.1.3", "@types/node": "^14.14.6", "@types/rimraf": "^3.0.0", @@ -29494,9 +29494,9 @@ "js-beautify": "^1.15.1" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", @@ -29511,9 +29511,9 @@ "version": "2.4.0", "license": "Apache-2.0", "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "chalk": "^4.1.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -29534,9 +29534,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb-connection-string-url": "^3.0.1", @@ -29560,9 +29560,9 @@ "@mongosh/errors": "2.4.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" @@ -29576,7 +29576,7 @@ "version": "2.4.0", "license": "SSPL", "devDependencies": { - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "assert": "^1.5.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", @@ -29643,9 +29643,9 @@ "@babel/types": "^7.21.2" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/babel__core": "^7.1.18", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -29668,9 +29668,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" @@ -29708,7 +29708,7 @@ "web-worker": "^1.3.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/browser-runtime-core": "3.0.0", @@ -29741,9 +29741,9 @@ "mongodb-connection-string-url": "^3.0.1" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" @@ -29771,9 +29771,9 @@ "socks": "^2.8.3" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/sinon-chai": "^3.2.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -29800,7 +29800,7 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", @@ -29831,7 +29831,7 @@ "@mongosh/shell-api": "3.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", @@ -29860,9 +29860,9 @@ "tar": "^6.1.15" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", "depcheck": "^1.4.7", @@ -29892,9 +29892,9 @@ "@mongodb-js/devtools-connect": "^3.3.4" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", diff --git a/packages/arg-parser/package.json b/packages/arg-parser/package.json index 70d28b57fa..716af3ea74 100644 --- a/packages/arg-parser/package.json +++ b/packages/arg-parser/package.json @@ -41,9 +41,9 @@ }, "devDependencies": { "@mongodb-js/devtools-connect": "^3.3.4", - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", diff --git a/packages/async-rewriter2/package.json b/packages/async-rewriter2/package.json index 24296ddcd5..ae78c9a305 100644 --- a/packages/async-rewriter2/package.json +++ b/packages/async-rewriter2/package.json @@ -47,9 +47,9 @@ "@babel/types": "^7.22.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/babel__core": "^7.20.1", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/autocomplete/package.json b/packages/autocomplete/package.json index 86be1d100a..e580832df5 100644 --- a/packages/autocomplete/package.json +++ b/packages/autocomplete/package.json @@ -34,9 +34,9 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index 83fd63cfa1..9f2605fccb 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -73,9 +73,9 @@ "mongodb": "^6.12.0", "@mongodb-js/compass-components": "*", "@mongodb-js/compass-editor": "*", - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8", "@testing-library/dom": "^8.20.1", "@testing-library/react": "^12.1.5", diff --git a/packages/browser-runtime-core/package.json b/packages/browser-runtime-core/package.json index 86aefb58cd..4a5fd29366 100644 --- a/packages/browser-runtime-core/package.json +++ b/packages/browser-runtime-core/package.json @@ -38,7 +38,7 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", diff --git a/packages/browser-runtime-electron/package.json b/packages/browser-runtime-electron/package.json index b7ae4227f7..aa2666def8 100644 --- a/packages/browser-runtime-electron/package.json +++ b/packages/browser-runtime-electron/package.json @@ -38,7 +38,7 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "3.0.0", diff --git a/packages/build/package.json b/packages/build/package.json index 186a3b4e17..66660d4bb1 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -45,7 +45,7 @@ "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/command-exists": "^1.2.0", "@types/cross-spawn": "^6.0.6", "@types/download": "^8.0.1", diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index c444c315b4..37db9ea2d9 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -95,10 +95,10 @@ }, "devDependencies": { "mongodb": "^6.12.0", - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.7.0", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/ansi-escape-sequences": "^4.0.0", "@types/js-yaml": "^4.0.5", "@types/node": "^14.14.6", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 1a99809c1a..2e639af32d 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -33,10 +33,10 @@ "strip-ansi": "^6.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/oidc-mock-provider": "^0.10.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/chai-as-promised": "^7.1.3", "@types/node": "^14.14.6", "@types/rimraf": "^3.0.0", diff --git a/packages/editor/package.json b/packages/editor/package.json index e4d59ab6b3..424ed93f87 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -43,9 +43,9 @@ "js-beautify": "^1.15.1" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", diff --git a/packages/errors/package.json b/packages/errors/package.json index 401e4b46ea..2d21e5da3b 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -36,9 +36,9 @@ }, "dependencies": {}, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "chalk": "^4.1.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/history/package.json b/packages/history/package.json index c57e518dfb..14fbc57cde 100644 --- a/packages/history/package.json +++ b/packages/history/package.json @@ -39,9 +39,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb-connection-string-url": "^3.0.1", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 28c5093cc9..8e29d1010c 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -39,9 +39,9 @@ "@mongosh/errors": "2.4.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" diff --git a/packages/java-shell/package.json b/packages/java-shell/package.json index 2321f9dff1..a39fb07438 100644 --- a/packages/java-shell/package.json +++ b/packages/java-shell/package.json @@ -18,7 +18,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci" }, "devDependencies": { - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "assert": "^1.5.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", diff --git a/packages/js-multiline-to-singleline/package.json b/packages/js-multiline-to-singleline/package.json index 0506b6d105..5f8f5ea149 100644 --- a/packages/js-multiline-to-singleline/package.json +++ b/packages/js-multiline-to-singleline/package.json @@ -39,9 +39,9 @@ "@babel/types": "^7.21.2" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/babel__core": "^7.1.18", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/logging/package.json b/packages/logging/package.json index 1ad0aa0092..a5c8483e4a 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -25,9 +25,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index 1778c13717..f88b9e0819 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -34,7 +34,7 @@ "reformat": "npm run prettier -- --write . && npm run eslint --fix" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/browser-runtime-core": "3.0.0", diff --git a/packages/service-provider-core/package.json b/packages/service-provider-core/package.json index 8268e9555a..864213ae27 100644 --- a/packages/service-provider-core/package.json +++ b/packages/service-provider-core/package.json @@ -54,9 +54,9 @@ "mongodb-client-encryption": "^6.1.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" diff --git a/packages/service-provider-node-driver/package.json b/packages/service-provider-node-driver/package.json index 44658357ca..4aefa680d3 100644 --- a/packages/service-provider-node-driver/package.json +++ b/packages/service-provider-node-driver/package.json @@ -62,9 +62,9 @@ "mongodb-client-encryption": "^6.1.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/sinon-chai": "^3.2.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/shell-api/package.json b/packages/shell-api/package.json index e6ed831b59..39739b470f 100644 --- a/packages/shell-api/package.json +++ b/packages/shell-api/package.json @@ -48,7 +48,7 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", diff --git a/packages/shell-evaluator/package.json b/packages/shell-evaluator/package.json index acee13a618..f4dfcc728d 100644 --- a/packages/shell-evaluator/package.json +++ b/packages/shell-evaluator/package.json @@ -35,7 +35,7 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", diff --git a/packages/snippet-manager/package.json b/packages/snippet-manager/package.json index 8e15199779..d5836c57dc 100644 --- a/packages/snippet-manager/package.json +++ b/packages/snippet-manager/package.json @@ -46,9 +46,9 @@ "tar": "^6.1.15" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", "depcheck": "^1.4.7", diff --git a/packages/types/package.json b/packages/types/package.json index 93837fbd2b..f80a844454 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -41,9 +41,9 @@ "@mongodb-js/devtools-connect": "^3.3.4" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/eslint-config-mongosh": "^1.0.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.0", + "@mongodb-js/tsconfig-mongosh": "^1.0.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", From dfa6d5c8110548d984649b0aeb3f21744b5db295 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 30 Dec 2024 12:48:06 +0100 Subject: [PATCH 06/36] switch to bump script --- packages/build/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/build/package.json b/packages/build/package.json index 66660d4bb1..e66e9036ce 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -25,6 +25,7 @@ "depcheck": "depcheck", "evergreen-release": "ts-node -r ../../scripts/import-expansions.js src/index.ts", "release": "ts-node src/index.ts trigger-release", + "bump": "ts-node src/index.ts bump", "prettier": "prettier", "bump": "ts-node src/index.ts bump", "publish": "ts-node src/index.ts publish", From f54e2084c41bcfa567ee8f21bf08735388d089e4 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 30 Dec 2024 18:38:39 +0100 Subject: [PATCH 07/36] check if bump is necessary for installs --- packages/build/src/release.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/build/src/release.ts b/packages/build/src/release.ts index 6460a25494..bb220a1ecd 100644 --- a/packages/build/src/release.ts +++ b/packages/build/src/release.ts @@ -27,6 +27,7 @@ import { publishAuxiliaryPackages } from './publish-auxiliary'; export type ReleaseCommand = | 'bump' + | 'bump-packages' | 'compile' | 'package' | 'sign' From b55f0e8090c005fb5211d8c13bf46c3d4d5a692c Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 31 Dec 2024 10:30:33 +0100 Subject: [PATCH 08/36] add publish-packages --- .github/workflows/release-packages.yml | 62 ++++++++++++++++++++++++++ packages/build/src/release.ts | 1 - 2 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-packages.yml diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml new file mode 100644 index 0000000000..849fcc2a91 --- /dev/null +++ b/.github/workflows/release-packages.yml @@ -0,0 +1,62 @@ +name: Publish +on: + # NOTE: avoid using the manual execution unless is the only way to fix some issue, + # rather retry failed jobs in case of flakes. The manual execution can potentially + # cause the tags to point to a different commit that the one used to publish + # the packages + workflow_dispatch: + push: + branches: + - main + +jobs: + publish: + if: | + github.event_name == 'workflow_dispatch' || + startsWith(github.event.head_commit.message, 'chore(release): bump package versions') + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + # don't checkout a detatched HEAD + ref: ${{ github.head_ref }} + + # this is important so git log has the whole history + fetch-depth: '0' + + - name: Setup git + run: | + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + + - name: "Use Node.js 14" + uses: actions/setup-node@v3 + with: + node-version: 20.16.0 + + - name: Install npm@10.2.4 + run: npm install -g npm@10.2.4 + + - name: Install Dependencies + run: | + npm run bootstrap-ci + shell: bash + + - name: "Publish what is not already in NPM" + env: + NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + npm config list + echo "Publishing packages as $(npm whoami)" + git update-index --assume-unchanged .npmrc + npm run publish-packages + + - name: "Publish tags" + run: | + npx lerna list -a --json | \ + jq -r '.[] | .name + "@" + .version' | \ + xargs -i sh -c "git tag -a {} -m {} || true" + git push --follow-tags diff --git a/packages/build/src/release.ts b/packages/build/src/release.ts index bb220a1ecd..6460a25494 100644 --- a/packages/build/src/release.ts +++ b/packages/build/src/release.ts @@ -27,7 +27,6 @@ import { publishAuxiliaryPackages } from './publish-auxiliary'; export type ReleaseCommand = | 'bump' - | 'bump-packages' | 'compile' | 'package' | 'sign' From 986305e1fc1b8b5f7133db477c3408f05fa554a7 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 31 Dec 2024 11:05:53 +0100 Subject: [PATCH 09/36] remove package.json changes --- configs/eslint-config-mongosh/package.json | 2 +- configs/tsconfig-mongosh/package.json | 2 +- package-lock.json | 82 +++++++++---------- packages/arg-parser/package.json | 4 +- packages/async-rewriter2/package.json | 4 +- packages/autocomplete/package.json | 4 +- packages/browser-repl/package.json | 4 +- packages/browser-runtime-core/package.json | 2 +- .../browser-runtime-electron/package.json | 2 +- packages/build/package.json | 3 +- packages/cli-repl/package.json | 4 +- packages/e2e-tests/package.json | 4 +- packages/editor/package.json | 4 +- packages/errors/package.json | 4 +- packages/history/package.json | 4 +- packages/i18n/package.json | 4 +- packages/java-shell/package.json | 2 +- .../js-multiline-to-singleline/package.json | 4 +- packages/logging/package.json | 4 +- .../node-runtime-worker-thread/package.json | 2 +- packages/service-provider-core/package.json | 4 +- .../service-provider-node-driver/package.json | 4 +- packages/shell-api/package.json | 2 +- packages/shell-evaluator/package.json | 2 +- packages/snippet-manager/package.json | 4 +- packages/types/package.json | 4 +- 26 files changed, 82 insertions(+), 83 deletions(-) diff --git a/configs/eslint-config-mongosh/package.json b/configs/eslint-config-mongosh/package.json index d0c201384e..dd95cbf3f8 100644 --- a/configs/eslint-config-mongosh/package.json +++ b/configs/eslint-config-mongosh/package.json @@ -1,6 +1,6 @@ { "name": "@mongodb-js/eslint-config-mongosh", - "version": "1.0.2", + "version": "1.0.0", "private": true, "description": "Shared Mongosh eslint configuration", "license": "SSPL", diff --git a/configs/tsconfig-mongosh/package.json b/configs/tsconfig-mongosh/package.json index 4b846acf95..4b3440b2b7 100644 --- a/configs/tsconfig-mongosh/package.json +++ b/configs/tsconfig-mongosh/package.json @@ -1,6 +1,6 @@ { "name": "@mongodb-js/tsconfig-mongosh", - "version": "1.0.2", + "version": "1.0.0", "private": true, "description": "Shared Mongosh Typescript configuration", "license": "SSPL", diff --git a/package-lock.json b/package-lock.json index bf9a9db973..d1d343e244 100644 --- a/package-lock.json +++ b/package-lock.json @@ -89,7 +89,7 @@ }, "configs/eslint-config-mongosh": { "name": "@mongodb-js/eslint-config-mongosh", - "version": "1.0.2", + "version": "1.0.0", "license": "SSPL", "dependencies": { "@babel/core": "^7.21.4", @@ -113,7 +113,7 @@ }, "configs/tsconfig-mongosh": { "name": "@mongodb-js/tsconfig-mongosh", - "version": "1.0.2", + "version": "1.0.0", "license": "SSPL", "devDependencies": { "@mongodb-js/prettier-config-devtools": "^1.0.0", @@ -28821,9 +28821,9 @@ }, "devDependencies": { "@mongodb-js/devtools-connect": "^3.3.4", - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", @@ -28873,9 +28873,9 @@ "async-rewrite": "bin/async-rewrite.js" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.20.1", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -28895,9 +28895,9 @@ "semver": "^7.5.4" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", @@ -28928,9 +28928,9 @@ "@babel/preset-typescript": "^7.18.6", "@mongodb-js/compass-components": "*", "@mongodb-js/compass-editor": "*", - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8", "@testing-library/dom": "^8.20.1", "@testing-library/react": "^12.1.5", @@ -29105,7 +29105,7 @@ "@mongosh/shell-evaluator": "3.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", @@ -29129,7 +29129,7 @@ "@mongosh/types": "3.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "3.0.0", @@ -29177,7 +29177,7 @@ "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/command-exists": "^1.2.0", "@types/cross-spawn": "^6.0.6", "@types/download": "^8.0.1", @@ -29314,10 +29314,10 @@ "mongosh": "bin/mongosh.js" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.7.0", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/ansi-escape-sequences": "^4.0.0", "@types/chai-as-promised": "^7.1.3", "@types/js-yaml": "^4.0.5", @@ -29377,10 +29377,10 @@ "strip-ansi": "^6.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/oidc-mock-provider": "^0.10.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/chai-as-promised": "^7.1.3", "@types/node": "^14.14.6", "@types/rimraf": "^3.0.0", @@ -29494,9 +29494,9 @@ "js-beautify": "^1.15.1" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", @@ -29511,9 +29511,9 @@ "version": "2.4.0", "license": "Apache-2.0", "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "chalk": "^4.1.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -29534,9 +29534,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb-connection-string-url": "^3.0.1", @@ -29560,9 +29560,9 @@ "@mongosh/errors": "2.4.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" @@ -29576,7 +29576,7 @@ "version": "2.4.0", "license": "SSPL", "devDependencies": { - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "assert": "^1.5.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", @@ -29643,9 +29643,9 @@ "@babel/types": "^7.21.2" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.1.18", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -29668,9 +29668,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" @@ -29708,7 +29708,7 @@ "web-worker": "^1.3.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/browser-runtime-core": "3.0.0", @@ -29741,9 +29741,9 @@ "mongodb-connection-string-url": "^3.0.1" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" @@ -29771,9 +29771,9 @@ "socks": "^2.8.3" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/sinon-chai": "^3.2.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", @@ -29800,7 +29800,7 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", @@ -29831,7 +29831,7 @@ "@mongosh/shell-api": "3.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", @@ -29860,9 +29860,9 @@ "tar": "^6.1.15" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", "depcheck": "^1.4.7", @@ -29892,9 +29892,9 @@ "@mongodb-js/devtools-connect": "^3.3.4" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", diff --git a/packages/arg-parser/package.json b/packages/arg-parser/package.json index 716af3ea74..70d28b57fa 100644 --- a/packages/arg-parser/package.json +++ b/packages/arg-parser/package.json @@ -41,9 +41,9 @@ }, "devDependencies": { "@mongodb-js/devtools-connect": "^3.3.4", - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", diff --git a/packages/async-rewriter2/package.json b/packages/async-rewriter2/package.json index ae78c9a305..24296ddcd5 100644 --- a/packages/async-rewriter2/package.json +++ b/packages/async-rewriter2/package.json @@ -47,9 +47,9 @@ "@babel/types": "^7.22.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.20.1", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/autocomplete/package.json b/packages/autocomplete/package.json index e580832df5..86be1d100a 100644 --- a/packages/autocomplete/package.json +++ b/packages/autocomplete/package.json @@ -34,9 +34,9 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mocha": "^10.2.0", diff --git a/packages/browser-repl/package.json b/packages/browser-repl/package.json index 9f2605fccb..83fd63cfa1 100644 --- a/packages/browser-repl/package.json +++ b/packages/browser-repl/package.json @@ -73,9 +73,9 @@ "mongodb": "^6.12.0", "@mongodb-js/compass-components": "*", "@mongodb-js/compass-editor": "*", - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@pmmmwh/react-refresh-webpack-plugin": "^0.5.8", "@testing-library/dom": "^8.20.1", "@testing-library/react": "^12.1.5", diff --git a/packages/browser-runtime-core/package.json b/packages/browser-runtime-core/package.json index 4a5fd29366..86aefb58cd 100644 --- a/packages/browser-runtime-core/package.json +++ b/packages/browser-runtime-core/package.json @@ -38,7 +38,7 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", diff --git a/packages/browser-runtime-electron/package.json b/packages/browser-runtime-electron/package.json index aa2666def8..b7ae4227f7 100644 --- a/packages/browser-runtime-electron/package.json +++ b/packages/browser-runtime-electron/package.json @@ -38,7 +38,7 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/service-provider-node-driver": "3.0.0", diff --git a/packages/build/package.json b/packages/build/package.json index e66e9036ce..186a3b4e17 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -25,7 +25,6 @@ "depcheck": "depcheck", "evergreen-release": "ts-node -r ../../scripts/import-expansions.js src/index.ts", "release": "ts-node src/index.ts trigger-release", - "bump": "ts-node src/index.ts bump", "prettier": "prettier", "bump": "ts-node src/index.ts bump", "publish": "ts-node src/index.ts publish", @@ -46,7 +45,7 @@ "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/command-exists": "^1.2.0", "@types/cross-spawn": "^6.0.6", "@types/download": "^8.0.1", diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index 37db9ea2d9..c444c315b4 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -95,10 +95,10 @@ }, "devDependencies": { "mongodb": "^6.12.0", - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/sbom-tools": "^0.7.0", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/ansi-escape-sequences": "^4.0.0", "@types/js-yaml": "^4.0.5", "@types/node": "^14.14.6", diff --git a/packages/e2e-tests/package.json b/packages/e2e-tests/package.json index 2e639af32d..1a99809c1a 100644 --- a/packages/e2e-tests/package.json +++ b/packages/e2e-tests/package.json @@ -33,10 +33,10 @@ "strip-ansi": "^6.0.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/oidc-mock-provider": "^0.10.2", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/chai-as-promised": "^7.1.3", "@types/node": "^14.14.6", "@types/rimraf": "^3.0.0", diff --git a/packages/editor/package.json b/packages/editor/package.json index 424ed93f87..e4d59ab6b3 100644 --- a/packages/editor/package.json +++ b/packages/editor/package.json @@ -43,9 +43,9 @@ "js-beautify": "^1.15.1" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "nanobus": "^4.5.0", diff --git a/packages/errors/package.json b/packages/errors/package.json index 2d21e5da3b..401e4b46ea 100644 --- a/packages/errors/package.json +++ b/packages/errors/package.json @@ -36,9 +36,9 @@ }, "dependencies": {}, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "chalk": "^4.1.2", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/history/package.json b/packages/history/package.json index 14fbc57cde..c57e518dfb 100644 --- a/packages/history/package.json +++ b/packages/history/package.json @@ -39,9 +39,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb-connection-string-url": "^3.0.1", diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 8e29d1010c..28c5093cc9 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -39,9 +39,9 @@ "@mongosh/errors": "2.4.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" diff --git a/packages/java-shell/package.json b/packages/java-shell/package.json index a39fb07438..2321f9dff1 100644 --- a/packages/java-shell/package.json +++ b/packages/java-shell/package.json @@ -18,7 +18,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci" }, "devDependencies": { - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "assert": "^1.5.0", "buffer": "^6.0.3", "crypto-browserify": "^3.12.0", diff --git a/packages/js-multiline-to-singleline/package.json b/packages/js-multiline-to-singleline/package.json index 5f8f5ea149..0506b6d105 100644 --- a/packages/js-multiline-to-singleline/package.json +++ b/packages/js-multiline-to-singleline/package.json @@ -39,9 +39,9 @@ "@babel/types": "^7.21.2" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/babel__core": "^7.1.18", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/logging/package.json b/packages/logging/package.json index a5c8483e4a..1ad0aa0092 100644 --- a/packages/logging/package.json +++ b/packages/logging/package.json @@ -25,9 +25,9 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" diff --git a/packages/node-runtime-worker-thread/package.json b/packages/node-runtime-worker-thread/package.json index f88b9e0819..1778c13717 100644 --- a/packages/node-runtime-worker-thread/package.json +++ b/packages/node-runtime-worker-thread/package.json @@ -34,7 +34,7 @@ "reformat": "npm run prettier -- --write . && npm run eslint --fix" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/browser-runtime-core": "3.0.0", diff --git a/packages/service-provider-core/package.json b/packages/service-provider-core/package.json index 864213ae27..8268e9555a 100644 --- a/packages/service-provider-core/package.json +++ b/packages/service-provider-core/package.json @@ -54,9 +54,9 @@ "mongodb-client-encryption": "^6.1.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "prettier": "^2.8.8" diff --git a/packages/service-provider-node-driver/package.json b/packages/service-provider-node-driver/package.json index 4aefa680d3..44658357ca 100644 --- a/packages/service-provider-node-driver/package.json +++ b/packages/service-provider-node-driver/package.json @@ -62,9 +62,9 @@ "mongodb-client-encryption": "^6.1.0" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/sinon-chai": "^3.2.4", "depcheck": "^1.4.7", "eslint": "^7.25.0", diff --git a/packages/shell-api/package.json b/packages/shell-api/package.json index 39739b470f..e6ed831b59 100644 --- a/packages/shell-api/package.json +++ b/packages/shell-api/package.json @@ -48,7 +48,7 @@ "mongodb-redact": "^1.1.5" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", diff --git a/packages/shell-evaluator/package.json b/packages/shell-evaluator/package.json index f4dfcc728d..acee13a618 100644 --- a/packages/shell-evaluator/package.json +++ b/packages/shell-evaluator/package.json @@ -35,7 +35,7 @@ "unitTestsOnly": true }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@mongosh/types": "3.0.0", diff --git a/packages/snippet-manager/package.json b/packages/snippet-manager/package.json index d5836c57dc..8e15199779 100644 --- a/packages/snippet-manager/package.json +++ b/packages/snippet-manager/package.json @@ -46,9 +46,9 @@ "tar": "^6.1.15" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/cross-spawn": "^6.0.6", "@types/tar": "^4.0.4", "depcheck": "^1.4.7", diff --git a/packages/types/package.json b/packages/types/package.json index f80a844454..93837fbd2b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -41,9 +41,9 @@ "@mongodb-js/devtools-connect": "^3.3.4" }, "devDependencies": { - "@mongodb-js/eslint-config-mongosh": "^1.0.2", + "@mongodb-js/eslint-config-mongosh": "^1.0.0", "@mongodb-js/prettier-config-devtools": "^1.0.1", - "@mongodb-js/tsconfig-mongosh": "^1.0.2", + "@mongodb-js/tsconfig-mongosh": "^1.0.0", "depcheck": "^1.4.7", "eslint": "^7.25.0", "mongodb": "^6.12.0", From 7eab63a17103d25187fc7ebd870fe4e76051d83f Mon Sep 17 00:00:00 2001 From: Gagik Amaryan Date: Tue, 31 Dec 2024 13:18:56 +0100 Subject: [PATCH 10/36] Update .github/workflows/release-packages.yml Co-authored-by: Nikola Irinchev --- .github/workflows/release-packages.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 849fcc2a91..70e19e1c0b 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -18,14 +18,11 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: # don't checkout a detatched HEAD ref: ${{ github.head_ref }} - # this is important so git log has the whole history - fetch-depth: '0' - - name: Setup git run: | git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" From b2335d9b045fd49241ab8994248d0244705803d5 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 31 Dec 2024 13:19:18 +0100 Subject: [PATCH 11/36] fix removed compass skip --- .github/workflows/bump-packages.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bump-packages.yml b/.github/workflows/bump-packages.yml index a98adf2ef7..0f7348bd8c 100644 --- a/.github/workflows/bump-packages.yml +++ b/.github/workflows/bump-packages.yml @@ -39,7 +39,6 @@ jobs: - name: Bump packages env: LAST_BUMP_COMMIT_MESSAGE: "chore(release): bump package versions" - SKIP_BUMP_PACKAGES: "mongodb-compass" run: | npm run bump-packages git add . From 871a99cec8fde8a485abe50472443308b69abd30 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 31 Dec 2024 13:55:30 +0100 Subject: [PATCH 12/36] switch to use app token --- .github/workflows/release-packages.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 70e19e1c0b..2159589572 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -18,16 +18,18 @@ jobs: runs-on: ubuntu-latest steps: + - name: Create Github App Token + uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + id: app-token + with: + app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} + private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} + - uses: actions/checkout@v4 with: # don't checkout a detatched HEAD ref: ${{ github.head_ref }} - - name: Setup git - run: | - git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - - name: "Use Node.js 14" uses: actions/setup-node@v3 with: From 1cbc99a9970b57958cf92f40ac657050365154cd Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 31 Dec 2024 14:14:38 +0100 Subject: [PATCH 13/36] use bump in install script --- .evergreen/install-npm-deps.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/install-npm-deps.sh b/.evergreen/install-npm-deps.sh index daca8211eb..97cffcc7e9 100644 --- a/.evergreen/install-npm-deps.sh +++ b/.evergreen/install-npm-deps.sh @@ -31,5 +31,7 @@ npm run mark-ci-required-optional-dependencies # along with its types, but npm wouldn't try and compile the addon (npm ci && test -e node_modules/mongodb-client-encryption) || npm ci --ignore-scripts +npm run evergreen-release bump + echo "npm packages after installation" npm ls || true From 7d5b09902ce528ad1a5fcf5e4acf006ac2b36cf3 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 31 Dec 2024 15:19:42 +0100 Subject: [PATCH 14/36] remove bump step --- .evergreen/install-npm-deps.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.evergreen/install-npm-deps.sh b/.evergreen/install-npm-deps.sh index 97cffcc7e9..daca8211eb 100644 --- a/.evergreen/install-npm-deps.sh +++ b/.evergreen/install-npm-deps.sh @@ -31,7 +31,5 @@ npm run mark-ci-required-optional-dependencies # along with its types, but npm wouldn't try and compile the addon (npm ci && test -e node_modules/mongodb-client-encryption) || npm ci --ignore-scripts -npm run evergreen-release bump - echo "npm packages after installation" npm ls || true From 908ec91e33fd083f6dc18e4fce54680d8e537e22 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 6 Jan 2025 12:09:38 +0100 Subject: [PATCH 15/36] align with future release move changes --- .github/workflows/bump-packages.yml | 56 ------------------- ...ges.yml => release-auxiliary-packages.yml} | 8 +-- package-lock.json | 2 +- 3 files changed, 2 insertions(+), 64 deletions(-) delete mode 100644 .github/workflows/bump-packages.yml rename .github/workflows/{release-packages.yml => release-auxiliary-packages.yml} (87%) diff --git a/.github/workflows/bump-packages.yml b/.github/workflows/bump-packages.yml deleted file mode 100644 index 0f7348bd8c..0000000000 --- a/.github/workflows/bump-packages.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Bump packages -on: - workflow_dispatch: - push: - branches: - - main - -jobs: - update_generated_files: - name: Bump packages - runs-on: ubuntu-latest - steps: - - name: Create Github App Token - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main - id: app-token - with: - app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} - private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} - - - uses: actions/checkout@v4 - with: - # don't checkout a detatched HEAD - ref: ${{ github.head_ref }} - - - uses: actions/setup-node@v4 - with: - node-version: 20.16.0 - cache: "npm" - - - name: Install npm@10.2.4 - run: | - npm install -g npm@10.2.4 - - - name: Install Dependencies - run: | - npm -v - npm ci - - - name: Bump packages - env: - LAST_BUMP_COMMIT_MESSAGE: "chore(release): bump package versions" - run: | - npm run bump-packages - git add . - git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true - - - name: Create Pull Request - uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 - with: - token: ${{ steps.app-token.outputs.token }} - commit-message: "chore(release): bump package versions" - branch: ci/bump-packages - title: "chore(release): bump package versions" - labels: no-title-validation - body: | - - Bump package versions diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-auxiliary-packages.yml similarity index 87% rename from .github/workflows/release-packages.yml rename to .github/workflows/release-auxiliary-packages.yml index 2159589572..8e825b60e6 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-auxiliary-packages.yml @@ -1,4 +1,4 @@ -name: Publish +name: Publish Auxiliary Packages on: # NOTE: avoid using the manual execution unless is the only way to fix some issue, # rather retry failed jobs in case of flakes. The manual execution can potentially @@ -53,9 +53,3 @@ jobs: git update-index --assume-unchanged .npmrc npm run publish-packages - - name: "Publish tags" - run: | - npx lerna list -a --json | \ - jq -r '.[] | .name + "@" + .version' | \ - xargs -i sh -c "git tag -a {} -m {} || true" - git push --follow-tags diff --git a/package-lock.json b/package-lock.json index d1d343e244..9b60c7db06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5848,7 +5848,7 @@ "toposort": "^2.0.2" }, "bin": { - "bump-monorepo-packages": "bin/bump-packages.js", + "bump-monorepo-packages": "bin/bump-auxiliary.js", "depalign": "bin/depalign.js", "monorepo-where": "bin/where.js", "precommit": "bin/precommit.js" From 9f4b4621e85097f93480f2c9ce696d18a1b15c55 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 6 Jan 2025 14:09:37 +0100 Subject: [PATCH 16/36] fix naming --- .../workflows/release-auxiliary-packages.yml | 55 ------------------- 1 file changed, 55 deletions(-) delete mode 100644 .github/workflows/release-auxiliary-packages.yml diff --git a/.github/workflows/release-auxiliary-packages.yml b/.github/workflows/release-auxiliary-packages.yml deleted file mode 100644 index 8e825b60e6..0000000000 --- a/.github/workflows/release-auxiliary-packages.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Publish Auxiliary Packages -on: - # NOTE: avoid using the manual execution unless is the only way to fix some issue, - # rather retry failed jobs in case of flakes. The manual execution can potentially - # cause the tags to point to a different commit that the one used to publish - # the packages - workflow_dispatch: - push: - branches: - - main - -jobs: - publish: - if: | - github.event_name == 'workflow_dispatch' || - startsWith(github.event.head_commit.message, 'chore(release): bump package versions') - - runs-on: ubuntu-latest - - steps: - - name: Create Github App Token - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main - id: app-token - with: - app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} - private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} - - - uses: actions/checkout@v4 - with: - # don't checkout a detatched HEAD - ref: ${{ github.head_ref }} - - - name: "Use Node.js 14" - uses: actions/setup-node@v3 - with: - node-version: 20.16.0 - - - name: Install npm@10.2.4 - run: npm install -g npm@10.2.4 - - - name: Install Dependencies - run: | - npm run bootstrap-ci - shell: bash - - - name: "Publish what is not already in NPM" - env: - NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc - npm config list - echo "Publishing packages as $(npm whoami)" - git update-index --assume-unchanged .npmrc - npm run publish-packages - From a0c7deea0fc7bef5b2d1be0e9a1c024de18406a3 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 6 Jan 2025 16:25:47 +0100 Subject: [PATCH 17/36] re-add bump --- .evergreen/install-npm-deps.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.evergreen/install-npm-deps.sh b/.evergreen/install-npm-deps.sh index daca8211eb..97cffcc7e9 100644 --- a/.evergreen/install-npm-deps.sh +++ b/.evergreen/install-npm-deps.sh @@ -31,5 +31,7 @@ npm run mark-ci-required-optional-dependencies # along with its types, but npm wouldn't try and compile the addon (npm ci && test -e node_modules/mongodb-client-encryption) || npm ci --ignore-scripts +npm run evergreen-release bump + echo "npm packages after installation" npm ls || true From 723dff1b1891e8196940a9eaecca3045045bcc57 Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 8 Jan 2025 08:54:14 +0100 Subject: [PATCH 18/36] use npx and use tags in all cases --- packages/build/src/npm-packages/bump.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/build/src/npm-packages/bump.ts b/packages/build/src/npm-packages/bump.ts index f4c337e2df..ca5e9e6e4d 100644 --- a/packages/build/src/npm-packages/bump.ts +++ b/packages/build/src/npm-packages/bump.ts @@ -89,7 +89,7 @@ export async function updateShellApiMongoshVersion(version: string) { /** Bumps auxiliary packages without setting a new version of mongosh. */ export function bumpAuxiliaryPackages() { - spawnSync('bump-monorepo-packages', [], { + spawnSync('npx', ['bump-monorepo-packages'], { stdio: 'inherit', cwd: PROJECT_ROOT, encoding: 'utf8', From 2a569ceda92defa6e58c3695104c0712c30a94f8 Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 8 Jan 2025 13:10:14 +0100 Subject: [PATCH 19/36] use monorepo tools as dependency --- package-lock.json | 2 +- packages/build/src/npm-packages/bump.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b60c7db06..d1d343e244 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5848,7 +5848,7 @@ "toposort": "^2.0.2" }, "bin": { - "bump-monorepo-packages": "bin/bump-auxiliary.js", + "bump-monorepo-packages": "bin/bump-packages.js", "depalign": "bin/depalign.js", "monorepo-where": "bin/where.js", "precommit": "bin/precommit.js" diff --git a/packages/build/src/npm-packages/bump.ts b/packages/build/src/npm-packages/bump.ts index ca5e9e6e4d..f4c337e2df 100644 --- a/packages/build/src/npm-packages/bump.ts +++ b/packages/build/src/npm-packages/bump.ts @@ -89,7 +89,7 @@ export async function updateShellApiMongoshVersion(version: string) { /** Bumps auxiliary packages without setting a new version of mongosh. */ export function bumpAuxiliaryPackages() { - spawnSync('npx', ['bump-monorepo-packages'], { + spawnSync('bump-monorepo-packages', [], { stdio: 'inherit', cwd: PROJECT_ROOT, encoding: 'utf8', From f5bd30356021dcdc42ad09ef88c3e2c1abe9cf69 Mon Sep 17 00:00:00 2001 From: gagik Date: Wed, 8 Jan 2025 15:49:10 +0100 Subject: [PATCH 20/36] remove bump, use version --- .evergreen/install-npm-deps.sh | 2 -- packages/cli-repl/src/constants.ts | 3 +++ packages/cli-repl/src/mongosh-repl.ts | 7 ++++++- packages/e2e-tests/test/e2e.spec.ts | 1 + .../src/worker-thread-evaluation-listener.ts | 6 +++++- packages/shell-api/src/shell-instance-state.ts | 3 +++ 6 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.evergreen/install-npm-deps.sh b/.evergreen/install-npm-deps.sh index 97cffcc7e9..daca8211eb 100644 --- a/.evergreen/install-npm-deps.sh +++ b/.evergreen/install-npm-deps.sh @@ -31,7 +31,5 @@ npm run mark-ci-required-optional-dependencies # along with its types, but npm wouldn't try and compile the addon (npm ci && test -e node_modules/mongodb-client-encryption) || npm ci --ignore-scripts -npm run evergreen-release bump - echo "npm packages after installation" npm ls || true diff --git a/packages/cli-repl/src/constants.ts b/packages/cli-repl/src/constants.ts index 94bfc5c371..bbf5b4d8e5 100644 --- a/packages/cli-repl/src/constants.ts +++ b/packages/cli-repl/src/constants.ts @@ -1,6 +1,9 @@ import i18n from '@mongosh/i18n'; import { colorizeForStderr as clr } from './clr'; +// eslint-disable-next-line @typescript-eslint/no-var-requires +export const MONGOSH_VERSION: string = require('../package.json').version; + export const TELEMETRY_GREETING_MESSAGE = ` ${i18n.__('cli-repl.cli-repl.telemetry')} ${i18n.__('cli-repl.cli-repl.disableTelemetry')}${clr( diff --git a/packages/cli-repl/src/mongosh-repl.ts b/packages/cli-repl/src/mongosh-repl.ts index 7e2d0a729d..cc72c0fe8a 100644 --- a/packages/cli-repl/src/mongosh-repl.ts +++ b/packages/cli-repl/src/mongosh-repl.ts @@ -34,7 +34,11 @@ import { callbackify, promisify } from 'util'; import * as asyncRepl from './async-repl'; import type { StyleDefinition } from './clr'; import clr from './clr'; -import { MONGOSH_WIKI, TELEMETRY_GREETING_MESSAGE } from './constants'; +import { + MONGOSH_VERSION, + MONGOSH_WIKI, + TELEMETRY_GREETING_MESSAGE, +} from './constants'; import formatOutput, { formatError } from './format-output'; import { makeMultilineJSIntoSingleLine } from '@mongosh/js-multiline-to-singleline'; import { LineByLineInput } from './line-by-line-input'; @@ -147,6 +151,7 @@ class MongoshNodeRepl implements EvaluationListener { loadNestingLevel = 0; redactHistory: 'keep' | 'remove' | 'remove-redact' = 'remove'; rawValueToShellResult: WeakMap = new WeakMap(); + version: string = MONGOSH_VERSION; constructor(options: MongoshNodeReplOptions) { this.input = options.input; diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index c9b2b18c74..1a0575e6aa 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -22,6 +22,7 @@ import { once } from 'events'; import type { AddressInfo } from 'net'; const { EJSON } = bson; import { sleep } from './util-helpers'; +import { MONGOSH_VERSION } from '../../cli-repl/src/constants'; const jsContextFlagCombinations: `--jsContext=${'plain-vm' | 'repl'}`[][] = [ [], diff --git a/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts b/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts index 071588a74f..dd669bc2a2 100644 --- a/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts +++ b/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts @@ -7,7 +7,10 @@ import type { RuntimeEvaluationListener } from '@mongosh/browser-runtime-core'; export class WorkerThreadEvaluationListener { exposedListener: Exposed< Required< - Omit + Omit< + RuntimeEvaluationListener, + 'version' | 'onLoad' | 'getCryptLibraryOptions' + > > >; @@ -56,6 +59,7 @@ export class WorkerThreadEvaluationListener { (Promise.resolve() as Promise) ); }, + version: workerRuntime.evaluationListener?.version, }, worker ); diff --git a/packages/shell-api/src/shell-instance-state.ts b/packages/shell-api/src/shell-instance-state.ts index d22e75ef33..53e53897ac 100644 --- a/packages/shell-api/src/shell-instance-state.ts +++ b/packages/shell-api/src/shell-instance-state.ts @@ -116,6 +116,9 @@ export interface EvaluationListener * options used to access it. */ getCryptLibraryOptions?: () => Promise; + + /** References the mongosh version used by the EvaluationListener */ + version?: string; } /** From 5ffec0df1ff4f757f4c05588694b18cdf4a1108f Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 10 Jan 2025 14:13:35 +0100 Subject: [PATCH 21/36] use a shell-api constant and switch to 2.3.8 --- package-lock.json | 414 +++++++++++++++--- package.json | 12 +- packages/cli-repl/src/constants.ts | 3 - packages/cli-repl/src/mongosh-repl.ts | 7 +- .../src/worker-thread-evaluation-listener.ts | 1 - .../shell-api/src/shell-instance-state.ts | 3 - 6 files changed, 366 insertions(+), 74 deletions(-) diff --git a/package-lock.json b/package-lock.json index d1d343e244..3f812218db 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,24 +17,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/types", - "packages/i18n", "packages/logging", + "packages/node-runtime-worker-thread", "packages/service-provider-core", - "packages/arg-parser", + "packages/snippet-manager", + "packages/types", + "packages/i18n", "packages/service-provider-node-driver", + "packages/arg-parser", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", - "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", + "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", - "packages/node-runtime-worker-thread", - "packages/browser-repl", "packages/connectivity-tests" ], "bin": { @@ -5659,6 +5659,30 @@ "dev": true, "license": "Apache-2.0" }, + "node_modules/@mongodb-js/devtools-connect": { + "version": "3.3.4", + "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.3.4.tgz", + "integrity": "sha512-zD1uu/e2+/SbkSjzdxCg8PSVJkRY+/z1h75F1kZ2UPuy41PmLe9f7Lh8zC1rlR+uFUUcUc503QknfmvinnPSOg==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-proxy-support": "^0.4.2", + "@mongodb-js/oidc-http-server-pages": "1.1.3", + "lodash.merge": "^4.6.2", + "mongodb-connection-string-url": "^3.0.0", + "socks": "^2.7.3" + }, + "optionalDependencies": { + "kerberos": "^2.1.0", + "mongodb-client-encryption": "^6.1.0", + "os-dns-native": "^1.2.0", + "resolve-mongodb-srv": "^1.1.1" + }, + "peerDependencies": { + "@mongodb-js/oidc-plugin": "^1.1.0", + "mongodb": "^6.9.0", + "mongodb-log-writer": "^1.4.2" + } + }, "node_modules/@mongodb-js/devtools-github-repo": { "version": "1.2.0", "license": "Apache-2.0", @@ -28833,31 +28857,6 @@ "node": ">=14.15.1" } }, - "packages/arg-parser/node_modules/@mongodb-js/devtools-connect": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.3.4.tgz", - "integrity": "sha512-zD1uu/e2+/SbkSjzdxCg8PSVJkRY+/z1h75F1kZ2UPuy41PmLe9f7Lh8zC1rlR+uFUUcUc503QknfmvinnPSOg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.4.2", - "@mongodb-js/oidc-http-server-pages": "1.1.3", - "lodash.merge": "^4.6.2", - "mongodb-connection-string-url": "^3.0.0", - "socks": "^2.7.3" - }, - "optionalDependencies": { - "kerberos": "^2.1.0", - "mongodb-client-encryption": "^6.1.0", - "os-dns-native": "^1.2.0", - "resolve-mongodb-srv": "^1.1.1" - }, - "peerDependencies": { - "@mongodb-js/oidc-plugin": "^1.1.0", - "mongodb": "^6.9.0", - "mongodb-log-writer": "^1.4.2" - } - }, "packages/async-rewriter2": { "name": "@mongosh/async-rewriter2", "version": "2.4.0", @@ -29119,6 +29118,19 @@ "node": ">=14.15.1" } }, + "packages/browser-runtime-core/node_modules/@mongosh/types": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.8.tgz", + "integrity": "sha512-WFx/SPMWwQIcCeSBlYiIEbVg3YEYKo6Dr+IKVBpUw6Vr82CGQ1zZXRChIhdhu/H7jo3O+kdeGOPIftn0kvYmLA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/browser-runtime-electron": { "name": "@mongosh/browser-runtime-electron", "version": "3.0.0", @@ -29728,6 +29740,216 @@ "node": ">=14.15.1" } }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/arg-parser": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.8.tgz", + "integrity": "sha512-oo6glzgsOyZJYijHvWMhnYJOZOI16J/u5y+puRLHL0oNwAaRwumJ1Kx+Zp9gQI9s6C523X80Hrs6op6/fCRp9Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.8", + "@mongosh/i18n": "2.3.8", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/async-rewriter2": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/async-rewriter2/-/async-rewriter2-2.3.8.tgz", + "integrity": "sha512-YHt0m2MehX5UBILQqwDL1hToDRc1vtUPoD6Q2HH31iSY3Yer+uL83+BQe5AWaR5IBYGtNbul5IcKFwXCE5hA/w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@babel/core": "^7.22.8", + "@babel/plugin-transform-destructuring": "^7.22.5", + "@babel/plugin-transform-parameters": "^7.22.5", + "@babel/plugin-transform-shorthand-properties": "^7.22.5", + "@babel/types": "^7.22.5" + }, + "bin": { + "async-rewrite": "bin/async-rewrite.js" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/autocomplete": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/autocomplete/-/autocomplete-2.3.8.tgz", + "integrity": "sha512-uiUhqTIFEei/YD1+MJOGJYGXC0tBmbteyDLzIudXYN8oCzvX+hqyZq3wbAQEH0jxF7aUzdAhxKVulIg2HxpIqQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/mongodb-constants": "^0.10.1", + "@mongosh/shell-api": "2.3.8", + "semver": "^7.5.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-core": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-core/-/browser-runtime-core-2.3.8.tgz", + "integrity": "sha512-vn7T95tWi9B1lRrbS0ilctVh+bGWHKmEeKu3cxVJ+mF7gRHY12ZhqfUu4irfq3Aq9RGGL+5EBLM0Kw70ZZMAYA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/autocomplete": "2.3.8", + "@mongosh/service-provider-core": "2.3.8", + "@mongosh/shell-api": "2.3.8", + "@mongosh/shell-evaluator": "2.3.8" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-electron": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-electron/-/browser-runtime-electron-2.3.8.tgz", + "integrity": "sha512-O6PuwkNtHbuNkILj+WUNPAvK0y0JNVWCQv8YCGBoXWlwgg58UEbeUhKGoE4IlNRX9LUTWLPMjJe2N6z2P4iZow==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/browser-runtime-core": "2.3.8", + "@mongosh/service-provider-core": "2.3.8", + "@mongosh/types": "2.3.8" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/errors": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", + "integrity": "sha512-r7J2PxZec+Li0V6R7Mn1BgeTR9uyT2bYOqmXf1LApkuODTkjmrgZlZOwBl184eqF3jkLI7ZadUqZe8TBColXfw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/history": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.8.tgz", + "integrity": "sha512-u7R9dhk6qnbPoeSYkMu7h1JCkZuzFph6jEYy67e4lIviEL6J99u7hUHxNW70DqruOuoXyKREQ+mafPtxQNxu4w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "mongodb-connection-string-url": "^3.0.1", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/i18n": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.8.tgz", + "integrity": "sha512-PbjAR7Dg8fYGRnnGTBvihPt8sHEZbg1BTgPas1jZGki6gUSiI/bwYeP0rOr7jgmvU2GcARJ8tfnxXBCIEIBasA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.8" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-core": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.8.tgz", + "integrity": "sha512-zt7y+iXwPQhSojKzObPRICjKpQwJbOzOdo6yObF5iiG2/FX4Gi8WrVjwVqEAAZ//nVCXkMM7Y0epMhcZX+h5oQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-providers": "^3.525.0", + "@mongosh/errors": "2.3.8", + "bson": "^6.10.1", + "mongodb": "^6.12.0", + "mongodb-build-info": "^1.7.2", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + }, + "optionalDependencies": { + "mongodb-client-encryption": "^6.1.0" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-node-driver": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/service-provider-node-driver/-/service-provider-node-driver-2.3.8.tgz", + "integrity": "sha512-lohfxdHosjigTqeXT4gr2IXuLRvnSJ8N/KbnpDsziG40S7b/t31s9t8WPtBWfVu51tOPdst10GjI3RINJyXIsg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4", + "@mongodb-js/oidc-plugin": "^1.1.5", + "@mongosh/errors": "2.3.8", + "@mongosh/service-provider-core": "2.3.8", + "@mongosh/types": "2.3.8", + "aws4": "^1.12.0", + "mongodb": "^6.12.0", + "mongodb-connection-string-url": "^3.0.1", + "socks": "^2.8.3" + }, + "engines": { + "node": ">=14.15.1" + }, + "optionalDependencies": { + "kerberos": "2.1.0", + "mongodb-client-encryption": "^6.1.0" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-api": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.8.tgz", + "integrity": "sha512-ulzeBdiQ5aGMtRqVxkDc6EYO6cELhDfxlB6XHF/v9C0m85Y+pFcBJnpMvy6vfSorWzBXQB6W0/DXLR/+z7USdg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/arg-parser": "2.3.8", + "@mongosh/errors": "2.3.8", + "@mongosh/history": "2.3.8", + "@mongosh/i18n": "2.3.8", + "@mongosh/service-provider-core": "2.3.8", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-evaluator": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/shell-evaluator/-/shell-evaluator-2.3.8.tgz", + "integrity": "sha512-txC0yHDOjsy8a8Bg6PIY94M+KDcvHgLGlA/Ar/XoNZFSEAfF7I0Xj0wYf9iP22eqtfoU5FYEsqToVZLyyh+QFg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongosh/async-rewriter2": "2.3.8", + "@mongosh/history": "2.3.8", + "@mongosh/shell-api": "2.3.8" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/node-runtime-worker-thread/node_modules/@mongosh/types": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.8.tgz", + "integrity": "sha512-WFx/SPMWwQIcCeSBlYiIEbVg3YEYKo6Dr+IKVBpUw6Vr82CGQ1zZXRChIhdhu/H7jo3O+kdeGOPIftn0kvYmLA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/service-provider-core": { "name": "@mongosh/service-provider-core", "version": "3.0.0", @@ -29755,6 +29977,15 @@ "mongodb-client-encryption": "^6.1.0" } }, + "packages/service-provider-core/node_modules/@mongosh/errors": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", + "integrity": "sha512-r7J2PxZec+Li0V6R7Mn1BgeTR9uyT2bYOqmXf1LApkuODTkjmrgZlZOwBl184eqF3jkLI7ZadUqZe8TBColXfw==", + "license": "Apache-2.0", + "engines": { + "node": ">=14.15.1" + } + }, "packages/service-provider-node-driver": { "name": "@mongosh/service-provider-node-driver", "version": "3.0.0", @@ -29874,6 +30105,103 @@ "node": ">=14.15.1" } }, + "packages/snippet-manager/node_modules/@mongosh/arg-parser": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.8.tgz", + "integrity": "sha512-oo6glzgsOyZJYijHvWMhnYJOZOI16J/u5y+puRLHL0oNwAaRwumJ1Kx+Zp9gQI9s6C523X80Hrs6op6/fCRp9Q==", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.8", + "@mongosh/i18n": "2.3.8", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/errors": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", + "integrity": "sha512-r7J2PxZec+Li0V6R7Mn1BgeTR9uyT2bYOqmXf1LApkuODTkjmrgZlZOwBl184eqF3jkLI7ZadUqZe8TBColXfw==", + "license": "Apache-2.0", + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/history": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.8.tgz", + "integrity": "sha512-u7R9dhk6qnbPoeSYkMu7h1JCkZuzFph6jEYy67e4lIviEL6J99u7hUHxNW70DqruOuoXyKREQ+mafPtxQNxu4w==", + "license": "Apache-2.0", + "dependencies": { + "mongodb-connection-string-url": "^3.0.1", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/i18n": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.8.tgz", + "integrity": "sha512-PbjAR7Dg8fYGRnnGTBvihPt8sHEZbg1BTgPas1jZGki6gUSiI/bwYeP0rOr7jgmvU2GcARJ8tfnxXBCIEIBasA==", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/errors": "2.3.8" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/service-provider-core": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.8.tgz", + "integrity": "sha512-zt7y+iXwPQhSojKzObPRICjKpQwJbOzOdo6yObF5iiG2/FX4Gi8WrVjwVqEAAZ//nVCXkMM7Y0epMhcZX+h5oQ==", + "license": "Apache-2.0", + "dependencies": { + "@aws-sdk/credential-providers": "^3.525.0", + "@mongosh/errors": "2.3.8", + "bson": "^6.10.1", + "mongodb": "^6.12.0", + "mongodb-build-info": "^1.7.2", + "mongodb-connection-string-url": "^3.0.1" + }, + "engines": { + "node": ">=14.15.1" + }, + "optionalDependencies": { + "mongodb-client-encryption": "^6.1.0" + } + }, + "packages/snippet-manager/node_modules/@mongosh/shell-api": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.8.tgz", + "integrity": "sha512-ulzeBdiQ5aGMtRqVxkDc6EYO6cELhDfxlB6XHF/v9C0m85Y+pFcBJnpMvy6vfSorWzBXQB6W0/DXLR/+z7USdg==", + "license": "Apache-2.0", + "dependencies": { + "@mongosh/arg-parser": "2.3.8", + "@mongosh/errors": "2.3.8", + "@mongosh/history": "2.3.8", + "@mongosh/i18n": "2.3.8", + "@mongosh/service-provider-core": "2.3.8", + "mongodb-redact": "^1.1.2" + }, + "engines": { + "node": ">=14.15.1" + } + }, + "packages/snippet-manager/node_modules/@mongosh/types": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.8.tgz", + "integrity": "sha512-WFx/SPMWwQIcCeSBlYiIEbVg3YEYKo6Dr+IKVBpUw6Vr82CGQ1zZXRChIhdhu/H7jo3O+kdeGOPIftn0kvYmLA==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/devtools-connect": "^3.3.4" + }, + "engines": { + "node": ">=14.15.1" + } + }, "packages/snippet-manager/node_modules/@types/cross-spawn": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.6.tgz", @@ -29904,30 +30232,6 @@ "node": ">=14.15.1" } }, - "packages/types/node_modules/@mongodb-js/devtools-connect": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/@mongodb-js/devtools-connect/-/devtools-connect-3.3.4.tgz", - "integrity": "sha512-zD1uu/e2+/SbkSjzdxCg8PSVJkRY+/z1h75F1kZ2UPuy41PmLe9f7Lh8zC1rlR+uFUUcUc503QknfmvinnPSOg==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-proxy-support": "^0.4.2", - "@mongodb-js/oidc-http-server-pages": "1.1.3", - "lodash.merge": "^4.6.2", - "mongodb-connection-string-url": "^3.0.0", - "socks": "^2.7.3" - }, - "optionalDependencies": { - "kerberos": "^2.1.0", - "mongodb-client-encryption": "^6.1.0", - "os-dns-native": "^1.2.0", - "resolve-mongodb-srv": "^1.1.1" - }, - "peerDependencies": { - "@mongodb-js/oidc-plugin": "^1.1.0", - "mongodb": "^6.9.0", - "mongodb-log-writer": "^1.4.2" - } - }, "scripts/docker": { "name": "@mongosh/docker-build-scripts", "version": "3.0.0", diff --git a/package.json b/package.json index af12edefb6..9a6b14d705 100644 --- a/package.json +++ b/package.json @@ -149,24 +149,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/types", - "packages/i18n", "packages/logging", + "packages/node-runtime-worker-thread", "packages/service-provider-core", - "packages/arg-parser", + "packages/snippet-manager", + "packages/types", + "packages/i18n", "packages/service-provider-node-driver", + "packages/arg-parser", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", - "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", + "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", - "packages/node-runtime-worker-thread", - "packages/browser-repl", "packages/connectivity-tests" ], "overrides": { diff --git a/packages/cli-repl/src/constants.ts b/packages/cli-repl/src/constants.ts index bbf5b4d8e5..94bfc5c371 100644 --- a/packages/cli-repl/src/constants.ts +++ b/packages/cli-repl/src/constants.ts @@ -1,9 +1,6 @@ import i18n from '@mongosh/i18n'; import { colorizeForStderr as clr } from './clr'; -// eslint-disable-next-line @typescript-eslint/no-var-requires -export const MONGOSH_VERSION: string = require('../package.json').version; - export const TELEMETRY_GREETING_MESSAGE = ` ${i18n.__('cli-repl.cli-repl.telemetry')} ${i18n.__('cli-repl.cli-repl.disableTelemetry')}${clr( diff --git a/packages/cli-repl/src/mongosh-repl.ts b/packages/cli-repl/src/mongosh-repl.ts index cc72c0fe8a..7e2d0a729d 100644 --- a/packages/cli-repl/src/mongosh-repl.ts +++ b/packages/cli-repl/src/mongosh-repl.ts @@ -34,11 +34,7 @@ import { callbackify, promisify } from 'util'; import * as asyncRepl from './async-repl'; import type { StyleDefinition } from './clr'; import clr from './clr'; -import { - MONGOSH_VERSION, - MONGOSH_WIKI, - TELEMETRY_GREETING_MESSAGE, -} from './constants'; +import { MONGOSH_WIKI, TELEMETRY_GREETING_MESSAGE } from './constants'; import formatOutput, { formatError } from './format-output'; import { makeMultilineJSIntoSingleLine } from '@mongosh/js-multiline-to-singleline'; import { LineByLineInput } from './line-by-line-input'; @@ -151,7 +147,6 @@ class MongoshNodeRepl implements EvaluationListener { loadNestingLevel = 0; redactHistory: 'keep' | 'remove' | 'remove-redact' = 'remove'; rawValueToShellResult: WeakMap = new WeakMap(); - version: string = MONGOSH_VERSION; constructor(options: MongoshNodeReplOptions) { this.input = options.input; diff --git a/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts b/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts index dd669bc2a2..e2e399c96c 100644 --- a/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts +++ b/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts @@ -59,7 +59,6 @@ export class WorkerThreadEvaluationListener { (Promise.resolve() as Promise) ); }, - version: workerRuntime.evaluationListener?.version, }, worker ); diff --git a/packages/shell-api/src/shell-instance-state.ts b/packages/shell-api/src/shell-instance-state.ts index 53e53897ac..d22e75ef33 100644 --- a/packages/shell-api/src/shell-instance-state.ts +++ b/packages/shell-api/src/shell-instance-state.ts @@ -116,9 +116,6 @@ export interface EvaluationListener * options used to access it. */ getCryptLibraryOptions?: () => Promise; - - /** References the mongosh version used by the EvaluationListener */ - version?: string; } /** From 0df1e987551cd1147d73b63541b424ec1119e6f8 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 10 Jan 2025 14:27:08 +0100 Subject: [PATCH 22/36] set all packages to 2.3.8 --- .../src/worker-thread-evaluation-listener.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts b/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts index e2e399c96c..071588a74f 100644 --- a/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts +++ b/packages/node-runtime-worker-thread/src/worker-thread-evaluation-listener.ts @@ -7,10 +7,7 @@ import type { RuntimeEvaluationListener } from '@mongosh/browser-runtime-core'; export class WorkerThreadEvaluationListener { exposedListener: Exposed< Required< - Omit< - RuntimeEvaluationListener, - 'version' | 'onLoad' | 'getCryptLibraryOptions' - > + Omit > >; From b9a17265e36482e7c4f5be957233a50817b6c501 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 10 Jan 2025 14:34:30 +0100 Subject: [PATCH 23/36] revert to dev version --- package-lock.json | 260 +++++++++++------------ packages/build/package.json | 1 + packages/cli-repl/package.json | 2 +- packages/connectivity-tests/package.json | 2 +- packages/mongosh/package.json | 4 +- 5 files changed, 124 insertions(+), 145 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3f812218db..e3d3b33604 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5858,6 +5858,7 @@ "version": "1.1.16", "resolved": "https://registry.npmjs.org/@mongodb-js/monorepo-tools/-/monorepo-tools-1.1.16.tgz", "integrity": "sha512-LiIIGvpvgQl+8r72+GFS4QIcQa1Cp2wdtCRgnpVGbYqVKfr/URMA3j95dsBKrDbOsuFgNQ/6052TZdtTfho63g==", + "dev": true, "license": "SSPL", "dependencies": { "chalk": "^4.1.1", @@ -5880,6 +5881,7 @@ }, "node_modules/@mongodb-js/monorepo-tools/node_modules/find-up": { "version": "4.1.0", + "dev": true, "license": "MIT", "dependencies": { "locate-path": "^5.0.0", @@ -5891,6 +5893,7 @@ }, "node_modules/@mongodb-js/monorepo-tools/node_modules/locate-path": { "version": "5.0.0", + "dev": true, "license": "MIT", "dependencies": { "p-locate": "^4.1.0" @@ -5901,6 +5904,7 @@ }, "node_modules/@mongodb-js/monorepo-tools/node_modules/p-limit": { "version": "2.3.0", + "dev": true, "license": "MIT", "dependencies": { "p-try": "^2.0.0" @@ -5914,6 +5918,7 @@ }, "node_modules/@mongodb-js/monorepo-tools/node_modules/p-locate": { "version": "4.1.0", + "dev": true, "license": "MIT", "dependencies": { "p-limit": "^2.2.0" @@ -6733,6 +6738,7 @@ }, "node_modules/@npmcli/fs": { "version": "1.1.1", + "dev": true, "license": "ISC", "dependencies": { "@gar/promisify": "^1.0.1", @@ -6741,6 +6747,7 @@ }, "node_modules/@npmcli/git": { "version": "2.1.0", + "dev": true, "license": "ISC", "dependencies": { "@npmcli/promise-spawn": "^1.3.2", @@ -6755,6 +6762,7 @@ }, "node_modules/@npmcli/git/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -6765,6 +6773,7 @@ }, "node_modules/@npmcli/installed-package-contents": { "version": "1.0.7", + "dev": true, "license": "ISC", "dependencies": { "npm-bundled": "^1.1.1", @@ -7184,6 +7193,7 @@ }, "node_modules/@npmcli/move-file": { "version": "1.1.2", + "dev": true, "license": "MIT", "dependencies": { "mkdirp": "^1.0.4", @@ -7195,6 +7205,7 @@ }, "node_modules/@npmcli/move-file/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -7213,6 +7224,7 @@ }, "node_modules/@npmcli/node-gyp": { "version": "1.0.3", + "dev": true, "license": "ISC" }, "node_modules/@npmcli/package-json": { @@ -7351,6 +7363,7 @@ }, "node_modules/@npmcli/promise-spawn": { "version": "1.3.2", + "dev": true, "license": "ISC", "dependencies": { "infer-owner": "^1.0.4" @@ -7377,6 +7390,7 @@ }, "node_modules/@npmcli/run-script": { "version": "1.8.6", + "dev": true, "license": "ISC", "dependencies": { "@npmcli/node-gyp": "^1.0.2", @@ -7387,6 +7401,7 @@ }, "node_modules/@npmcli/run-script/node_modules/ansi-regex": { "version": "2.1.1", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -7394,10 +7409,12 @@ }, "node_modules/@npmcli/run-script/node_modules/aproba": { "version": "1.2.0", + "dev": true, "license": "ISC" }, "node_modules/@npmcli/run-script/node_modules/are-we-there-yet": { "version": "1.1.7", + "dev": true, "license": "ISC", "dependencies": { "delegates": "^1.0.0", @@ -7406,6 +7423,7 @@ }, "node_modules/@npmcli/run-script/node_modules/gauge": { "version": "2.7.4", + "dev": true, "license": "ISC", "dependencies": { "aproba": "^1.0.3", @@ -7420,6 +7438,7 @@ }, "node_modules/@npmcli/run-script/node_modules/glob": { "version": "7.2.3", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -7438,6 +7457,7 @@ }, "node_modules/@npmcli/run-script/node_modules/is-fullwidth-code-point": { "version": "1.0.0", + "dev": true, "license": "MIT", "dependencies": { "number-is-nan": "^1.0.0" @@ -7448,6 +7468,7 @@ }, "node_modules/@npmcli/run-script/node_modules/node-gyp": { "version": "7.1.2", + "dev": true, "license": "MIT", "dependencies": { "env-paths": "^2.2.0", @@ -7470,6 +7491,7 @@ }, "node_modules/@npmcli/run-script/node_modules/npmlog": { "version": "4.1.2", + "dev": true, "license": "ISC", "dependencies": { "are-we-there-yet": "~1.1.2", @@ -7480,6 +7502,7 @@ }, "node_modules/@npmcli/run-script/node_modules/string-width": { "version": "1.0.2", + "dev": true, "license": "MIT", "dependencies": { "code-point-at": "^1.0.0", @@ -7492,6 +7515,7 @@ }, "node_modules/@npmcli/run-script/node_modules/strip-ansi": { "version": "3.0.1", + "dev": true, "license": "MIT", "dependencies": { "ansi-regex": "^2.0.0" @@ -11063,6 +11087,7 @@ }, "node_modules/argv-formatter": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/aria-query": { @@ -11258,6 +11283,7 @@ }, "node_modules/assert-plus": { "version": "1.0.0", + "dev": true, "license": "MIT", "engines": { "node": ">=0.8" @@ -11318,6 +11344,7 @@ }, "node_modules/asynckit": { "version": "0.4.0", + "devOptional": true, "license": "MIT" }, "node_modules/available-typed-arrays": { @@ -11363,6 +11390,7 @@ }, "node_modules/aws-sign2": { "version": "0.7.0", + "dev": true, "license": "Apache-2.0", "engines": { "node": "*" @@ -12232,6 +12260,7 @@ }, "node_modules/builtins": { "version": "1.0.3", + "dev": true, "license": "MIT" }, "node_modules/bundle-name": { @@ -12264,6 +12293,7 @@ }, "node_modules/cacache": { "version": "15.3.0", + "dev": true, "license": "ISC", "dependencies": { "@npmcli/fs": "^1.0.0", @@ -12291,6 +12321,7 @@ }, "node_modules/cacache/node_modules/glob": { "version": "7.2.3", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -12309,6 +12340,7 @@ }, "node_modules/cacache/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -12527,6 +12559,7 @@ }, "node_modules/caseless": { "version": "0.12.0", + "dev": true, "license": "Apache-2.0" }, "node_modules/chai": { @@ -12723,6 +12756,7 @@ }, "node_modules/cli-cursor": { "version": "3.1.0", + "devOptional": true, "license": "MIT", "dependencies": { "restore-cursor": "^3.1.0" @@ -12745,6 +12779,7 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", + "devOptional": true, "license": "MIT", "engines": { "node": ">=6" @@ -12831,6 +12866,7 @@ }, "node_modules/code-point-at": { "version": "1.1.0", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -12887,6 +12923,7 @@ }, "node_modules/combined-stream": { "version": "1.0.8", + "devOptional": true, "license": "MIT", "dependencies": { "delayed-stream": "~1.0.0" @@ -13458,6 +13495,7 @@ }, "node_modules/dashdash": { "version": "1.14.1", + "dev": true, "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" @@ -13925,6 +13963,7 @@ }, "node_modules/defaults": { "version": "1.0.3", + "devOptional": true, "license": "MIT", "dependencies": { "clone": "^1.0.2" @@ -13932,6 +13971,7 @@ }, "node_modules/defaults/node_modules/clone": { "version": "1.0.4", + "devOptional": true, "license": "MIT", "engines": { "node": ">=0.8" @@ -13998,6 +14038,7 @@ }, "node_modules/delayed-stream": { "version": "1.0.0", + "devOptional": true, "license": "MIT", "engines": { "node": ">=0.4.0" @@ -14412,6 +14453,7 @@ }, "node_modules/duplexer2": { "version": "0.1.4", + "dev": true, "license": "BSD-3-Clause", "dependencies": { "readable-stream": "^2.0.2" @@ -14502,6 +14544,7 @@ }, "node_modules/ecc-jsbn": { "version": "0.1.2", + "dev": true, "license": "MIT", "dependencies": { "jsbn": "~0.1.0", @@ -15652,6 +15695,7 @@ }, "node_modules/extend": { "version": "3.0.2", + "dev": true, "license": "MIT" }, "node_modules/external-editor": { @@ -15713,6 +15757,7 @@ }, "node_modules/extsprintf": { "version": "1.3.0", + "dev": true, "engines": [ "node >=0.6.0" ], @@ -16139,6 +16184,7 @@ }, "node_modules/forever-agent": { "version": "0.6.1", + "dev": true, "license": "Apache-2.0", "engines": { "node": "*" @@ -16452,6 +16498,7 @@ }, "node_modules/getpass": { "version": "0.1.7", + "dev": true, "license": "MIT", "dependencies": { "assert-plus": "^1.0.0" @@ -16459,6 +16506,7 @@ }, "node_modules/git-log-parser": { "version": "1.2.0", + "dev": true, "license": "MIT", "dependencies": { "argv-formatter": "~1.0.0", @@ -16471,6 +16519,7 @@ }, "node_modules/git-log-parser/node_modules/split2": { "version": "1.0.0", + "dev": true, "license": "ISC", "dependencies": { "through2": "~2.0.0" @@ -16898,6 +16947,7 @@ }, "node_modules/har-schema": { "version": "2.0.0", + "dev": true, "license": "ISC", "engines": { "node": ">=4" @@ -16905,6 +16955,7 @@ }, "node_modules/har-validator": { "version": "5.1.5", + "dev": true, "license": "MIT", "dependencies": { "ajv": "^6.12.3", @@ -17152,6 +17203,7 @@ }, "node_modules/hosted-git-info": { "version": "4.1.0", + "devOptional": true, "license": "ISC", "dependencies": { "lru-cache": "^6.0.0" @@ -17454,6 +17506,7 @@ }, "node_modules/http-signature": { "version": "1.2.0", + "dev": true, "license": "MIT", "dependencies": { "assert-plus": "^1.0.0", @@ -17553,6 +17606,7 @@ }, "node_modules/ignore-walk": { "version": "3.0.4", + "dev": true, "license": "ISC", "dependencies": { "minimatch": "^3.0.4" @@ -17963,6 +18017,7 @@ }, "node_modules/is-interactive": { "version": "1.0.0", + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -18206,10 +18261,12 @@ }, "node_modules/is-typedarray": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/is-unicode-supported": { "version": "0.1.0", + "devOptional": true, "license": "MIT", "engines": { "node": ">=10" @@ -18305,6 +18362,7 @@ }, "node_modules/isstream": { "version": "0.1.2", + "dev": true, "license": "MIT" }, "node_modules/istanbul-lib-coverage": { @@ -18634,6 +18692,7 @@ }, "node_modules/jsbn": { "version": "0.1.1", + "dev": true, "license": "MIT" }, "node_modules/jsesc": { @@ -18657,10 +18716,12 @@ }, "node_modules/json-parse-even-better-errors": { "version": "2.3.1", + "devOptional": true, "license": "MIT" }, "node_modules/json-schema": { "version": "0.4.0", + "dev": true, "license": "(AFL-2.1 OR BSD-3-Clause)" }, "node_modules/json-schema-traverse": { @@ -18710,6 +18771,7 @@ }, "node_modules/jsonparse": { "version": "1.3.1", + "devOptional": true, "engines": [ "node >= 0.2.0" ], @@ -18732,6 +18794,7 @@ }, "node_modules/jsprim": { "version": "1.4.2", + "dev": true, "license": "MIT", "dependencies": { "assert-plus": "1.0.0", @@ -21110,6 +21173,7 @@ }, "node_modules/minipass-fetch": { "version": "1.4.1", + "dev": true, "license": "MIT", "dependencies": { "minipass": "^3.1.0", @@ -21135,6 +21199,7 @@ }, "node_modules/minipass-json-stream": { "version": "1.0.1", + "dev": true, "license": "MIT", "dependencies": { "jsonparse": "^1.3.1", @@ -21945,6 +22010,7 @@ }, "node_modules/nopt": { "version": "5.0.0", + "dev": true, "license": "ISC", "dependencies": { "abbrev": "1" @@ -22005,6 +22071,7 @@ }, "node_modules/npm-bundled": { "version": "1.1.2", + "dev": true, "license": "ISC", "dependencies": { "npm-normalize-package-bin": "^1.0.1" @@ -22012,6 +22079,7 @@ }, "node_modules/npm-install-checks": { "version": "4.0.0", + "dev": true, "license": "BSD-2-Clause", "dependencies": { "semver": "^7.1.1" @@ -22022,6 +22090,7 @@ }, "node_modules/npm-normalize-package-bin": { "version": "1.0.1", + "dev": true, "license": "ISC" }, "node_modules/npm-package-arg": { @@ -22056,6 +22125,7 @@ }, "node_modules/npm-packlist": { "version": "2.2.2", + "dev": true, "license": "ISC", "dependencies": { "glob": "^7.1.6", @@ -22072,6 +22142,7 @@ }, "node_modules/npm-packlist/node_modules/glob": { "version": "7.2.3", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -22090,6 +22161,7 @@ }, "node_modules/npm-pick-manifest": { "version": "6.1.1", + "dev": true, "license": "ISC", "dependencies": { "npm-install-checks": "^4.0.0", @@ -22100,6 +22172,7 @@ }, "node_modules/npm-pick-manifest/node_modules/npm-package-arg": { "version": "8.1.5", + "dev": true, "license": "ISC", "dependencies": { "hosted-git-info": "^4.0.1", @@ -22112,6 +22185,7 @@ }, "node_modules/npm-pick-manifest/node_modules/validate-npm-package-name": { "version": "3.0.0", + "dev": true, "license": "ISC", "dependencies": { "builtins": "^1.0.3" @@ -22195,6 +22269,7 @@ }, "node_modules/number-is-nan": { "version": "1.0.1", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -22676,6 +22751,7 @@ }, "node_modules/oauth-sign": { "version": "0.9.0", + "dev": true, "license": "Apache-2.0", "engines": { "node": "*" @@ -22901,6 +22977,7 @@ }, "node_modules/ora": { "version": "5.4.1", + "devOptional": true, "license": "MIT", "dependencies": { "bl": "^4.1.0", @@ -22922,6 +22999,7 @@ }, "node_modules/ora/node_modules/bl": { "version": "4.1.0", + "devOptional": true, "license": "MIT", "dependencies": { "buffer": "^5.5.0", @@ -22931,6 +23009,7 @@ }, "node_modules/ora/node_modules/buffer": { "version": "5.7.1", + "devOptional": true, "funding": [ { "type": "github", @@ -22953,6 +23032,7 @@ }, "node_modules/ora/node_modules/log-symbols": { "version": "4.1.0", + "devOptional": true, "license": "MIT", "dependencies": { "chalk": "^4.1.0", @@ -22967,6 +23047,7 @@ }, "node_modules/ora/node_modules/readable-stream": { "version": "3.6.2", + "devOptional": true, "license": "MIT", "dependencies": { "inherits": "^2.0.3", @@ -23239,6 +23320,7 @@ }, "node_modules/pacote": { "version": "11.3.5", + "dev": true, "license": "ISC", "dependencies": { "@npmcli/git": "^2.1.0", @@ -23270,6 +23352,7 @@ }, "node_modules/pacote/node_modules/@tootallnate/once": { "version": "1.1.2", + "dev": true, "license": "MIT", "engines": { "node": ">= 6" @@ -23277,6 +23360,7 @@ }, "node_modules/pacote/node_modules/agent-base": { "version": "6.0.2", + "dev": true, "license": "MIT", "dependencies": { "debug": "4" @@ -23287,6 +23371,7 @@ }, "node_modules/pacote/node_modules/http-proxy-agent": { "version": "4.0.1", + "dev": true, "license": "MIT", "dependencies": { "@tootallnate/once": "1", @@ -23299,6 +23384,7 @@ }, "node_modules/pacote/node_modules/https-proxy-agent": { "version": "5.0.1", + "dev": true, "license": "MIT", "dependencies": { "agent-base": "6", @@ -23310,6 +23396,7 @@ }, "node_modules/pacote/node_modules/make-fetch-happen": { "version": "9.1.0", + "dev": true, "license": "ISC", "dependencies": { "agentkeepalive": "^4.1.3", @@ -23335,6 +23422,7 @@ }, "node_modules/pacote/node_modules/mkdirp": { "version": "1.0.4", + "dev": true, "license": "MIT", "bin": { "mkdirp": "bin/cmd.js" @@ -23345,6 +23433,7 @@ }, "node_modules/pacote/node_modules/npm-package-arg": { "version": "8.1.5", + "dev": true, "license": "ISC", "dependencies": { "hosted-git-info": "^4.0.1", @@ -23357,6 +23446,7 @@ }, "node_modules/pacote/node_modules/npm-registry-fetch": { "version": "11.0.0", + "dev": true, "license": "ISC", "dependencies": { "make-fetch-happen": "^9.0.1", @@ -23372,6 +23462,7 @@ }, "node_modules/pacote/node_modules/socks-proxy-agent": { "version": "6.2.1", + "dev": true, "license": "MIT", "dependencies": { "agent-base": "^6.0.2", @@ -23384,6 +23475,7 @@ }, "node_modules/pacote/node_modules/validate-npm-package-name": { "version": "3.0.0", + "dev": true, "license": "ISC", "dependencies": { "builtins": "^1.0.3" @@ -23560,6 +23652,7 @@ }, "node_modules/path-exists": { "version": "4.0.0", + "devOptional": true, "license": "MIT", "engines": { "node": ">=8" @@ -23663,6 +23756,7 @@ }, "node_modules/performance-now": { "version": "2.1.0", + "dev": true, "license": "MIT" }, "node_modules/picocolors": { @@ -24158,6 +24252,7 @@ }, "node_modules/psl": { "version": "1.9.0", + "dev": true, "license": "MIT" }, "node_modules/public-encrypt": { @@ -24626,6 +24721,7 @@ }, "node_modules/read-package-json-fast": { "version": "2.0.3", + "dev": true, "license": "ISC", "dependencies": { "json-parse-even-better-errors": "^2.3.0", @@ -25069,6 +25165,7 @@ }, "node_modules/request": { "version": "2.88.2", + "dev": true, "license": "Apache-2.0", "dependencies": { "aws-sign2": "~0.7.0", @@ -25098,6 +25195,7 @@ }, "node_modules/request/node_modules/form-data": { "version": "2.3.3", + "dev": true, "license": "MIT", "dependencies": { "asynckit": "^0.4.0", @@ -25110,6 +25208,7 @@ }, "node_modules/request/node_modules/qs": { "version": "6.5.3", + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.6" @@ -25221,6 +25320,7 @@ }, "node_modules/restore-cursor": { "version": "3.1.0", + "devOptional": true, "license": "MIT", "dependencies": { "onetime": "^5.1.0", @@ -26148,6 +26248,7 @@ }, "node_modules/spawn-error-forwarder": { "version": "1.0.0", + "dev": true, "license": "MIT" }, "node_modules/spawn-wrap": { @@ -26335,6 +26436,7 @@ }, "node_modules/sshpk": { "version": "1.17.0", + "dev": true, "license": "MIT", "dependencies": { "asn1": "~0.2.3", @@ -26358,6 +26460,7 @@ }, "node_modules/ssri": { "version": "8.0.1", + "dev": true, "license": "ISC", "dependencies": { "minipass": "^3.1.1" @@ -26420,6 +26523,7 @@ }, "node_modules/stream-combiner2": { "version": "1.1.1", + "dev": true, "license": "MIT", "dependencies": { "duplexer2": "~0.1.0", @@ -27022,6 +27126,7 @@ }, "node_modules/through2": { "version": "2.0.5", + "devOptional": true, "license": "MIT", "dependencies": { "readable-stream": "~2.3.6", @@ -27103,6 +27208,7 @@ }, "node_modules/toposort": { "version": "2.0.2", + "dev": true, "license": "MIT" }, "node_modules/totalist": { @@ -27115,6 +27221,7 @@ }, "node_modules/tough-cookie": { "version": "2.5.0", + "dev": true, "license": "BSD-3-Clause", "dependencies": { "psl": "^1.1.28", @@ -27136,6 +27243,7 @@ }, "node_modules/traverse": { "version": "0.6.7", + "dev": true, "license": "MIT", "funding": { "url": "https://github.com/sponsors/ljharb" @@ -27361,6 +27469,7 @@ }, "node_modules/tunnel-agent": { "version": "0.6.0", + "devOptional": true, "license": "Apache-2.0", "dependencies": { "safe-buffer": "^5.0.1" @@ -27559,6 +27668,7 @@ }, "node_modules/unique-filename": { "version": "1.1.1", + "dev": true, "license": "ISC", "dependencies": { "unique-slug": "^2.0.0" @@ -27566,6 +27676,7 @@ }, "node_modules/unique-slug": { "version": "2.0.2", + "dev": true, "license": "ISC", "dependencies": { "imurmurhash": "^0.1.4" @@ -27702,6 +27813,7 @@ }, "node_modules/uuid": { "version": "3.4.0", + "dev": true, "license": "MIT", "bin": { "uuid": "bin/uuid" @@ -27742,6 +27854,7 @@ }, "node_modules/verror": { "version": "1.10.0", + "dev": true, "engines": [ "node >=0.6.0" ], @@ -27797,6 +27910,7 @@ }, "node_modules/wcwidth": { "version": "1.0.1", + "devOptional": true, "license": "MIT", "dependencies": { "defaults": "^1.0.3" @@ -29188,6 +29302,7 @@ }, "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/monorepo-tools": "^1.1.10", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/command-exists": "^1.2.0", @@ -29288,7 +29403,7 @@ }, "packages/cli-repl": { "name": "@mongosh/cli-repl", - "version": "2.3.8", + "version": "0.0.0-dev.0", "license": "Apache-2.0", "dependencies": { "@mongodb-js/devtools-proxy-support": "^0.4.2", @@ -29375,7 +29490,7 @@ "version": "2.4.0", "license": "Apache-2.0", "devDependencies": { - "mongosh": "2.3.8" + "mongosh": "0.0.0-dev.0" } }, "packages/e2e-tests": { @@ -29698,10 +29813,10 @@ "license": "Apache-2.0" }, "packages/mongosh": { - "version": "2.3.8", + "version": "0.0.0-dev.0", "license": "Apache-2.0", "dependencies": { - "@mongosh/cli-repl": "2.3.8" + "@mongosh/cli-repl": "0.0.0-dev.0" }, "bin": { "mongosh": "bin/mongosh.js" @@ -29790,37 +29905,6 @@ "node": ">=14.15.1" } }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-core": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-core/-/browser-runtime-core-2.3.8.tgz", - "integrity": "sha512-vn7T95tWi9B1lRrbS0ilctVh+bGWHKmEeKu3cxVJ+mF7gRHY12ZhqfUu4irfq3Aq9RGGL+5EBLM0Kw70ZZMAYA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/autocomplete": "2.3.8", - "@mongosh/service-provider-core": "2.3.8", - "@mongosh/shell-api": "2.3.8", - "@mongosh/shell-evaluator": "2.3.8" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/browser-runtime-electron": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/browser-runtime-electron/-/browser-runtime-electron-2.3.8.tgz", - "integrity": "sha512-O6PuwkNtHbuNkILj+WUNPAvK0y0JNVWCQv8YCGBoXWlwgg58UEbeUhKGoE4IlNRX9LUTWLPMjJe2N6z2P4iZow==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/browser-runtime-core": "2.3.8", - "@mongosh/service-provider-core": "2.3.8", - "@mongosh/types": "2.3.8" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/node-runtime-worker-thread/node_modules/@mongosh/errors": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", @@ -29858,52 +29942,6 @@ "node": ">=14.15.1" } }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-core": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.8.tgz", - "integrity": "sha512-zt7y+iXwPQhSojKzObPRICjKpQwJbOzOdo6yObF5iiG2/FX4Gi8WrVjwVqEAAZ//nVCXkMM7Y0epMhcZX+h5oQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-providers": "^3.525.0", - "@mongosh/errors": "2.3.8", - "bson": "^6.10.1", - "mongodb": "^6.12.0", - "mongodb-build-info": "^1.7.2", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - }, - "optionalDependencies": { - "mongodb-client-encryption": "^6.1.0" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/service-provider-node-driver": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/service-provider-node-driver/-/service-provider-node-driver-2.3.8.tgz", - "integrity": "sha512-lohfxdHosjigTqeXT4gr2IXuLRvnSJ8N/KbnpDsziG40S7b/t31s9t8WPtBWfVu51tOPdst10GjI3RINJyXIsg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4", - "@mongodb-js/oidc-plugin": "^1.1.5", - "@mongosh/errors": "2.3.8", - "@mongosh/service-provider-core": "2.3.8", - "@mongosh/types": "2.3.8", - "aws4": "^1.12.0", - "mongodb": "^6.12.0", - "mongodb-connection-string-url": "^3.0.1", - "socks": "^2.8.3" - }, - "engines": { - "node": ">=14.15.1" - }, - "optionalDependencies": { - "kerberos": "2.1.0", - "mongodb-client-encryption": "^6.1.0" - } - }, "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-api": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.8.tgz", @@ -29937,19 +29975,6 @@ "node": ">=14.15.1" } }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/types": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.8.tgz", - "integrity": "sha512-WFx/SPMWwQIcCeSBlYiIEbVg3YEYKo6Dr+IKVBpUw6Vr82CGQ1zZXRChIhdhu/H7jo3O+kdeGOPIftn0kvYmLA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/service-provider-core": { "name": "@mongosh/service-provider-core", "version": "3.0.0", @@ -29977,15 +30002,6 @@ "mongodb-client-encryption": "^6.1.0" } }, - "packages/service-provider-core/node_modules/@mongosh/errors": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", - "integrity": "sha512-r7J2PxZec+Li0V6R7Mn1BgeTR9uyT2bYOqmXf1LApkuODTkjmrgZlZOwBl184eqF3jkLI7ZadUqZe8TBColXfw==", - "license": "Apache-2.0", - "engines": { - "node": ">=14.15.1" - } - }, "packages/service-provider-node-driver": { "name": "@mongosh/service-provider-node-driver", "version": "3.0.0", @@ -30119,15 +30135,6 @@ "node": ">=14.15.1" } }, - "packages/snippet-manager/node_modules/@mongosh/errors": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", - "integrity": "sha512-r7J2PxZec+Li0V6R7Mn1BgeTR9uyT2bYOqmXf1LApkuODTkjmrgZlZOwBl184eqF3jkLI7ZadUqZe8TBColXfw==", - "license": "Apache-2.0", - "engines": { - "node": ">=14.15.1" - } - }, "packages/snippet-manager/node_modules/@mongosh/history": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.8.tgz", @@ -30173,35 +30180,6 @@ "mongodb-client-encryption": "^6.1.0" } }, - "packages/snippet-manager/node_modules/@mongosh/shell-api": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.8.tgz", - "integrity": "sha512-ulzeBdiQ5aGMtRqVxkDc6EYO6cELhDfxlB6XHF/v9C0m85Y+pFcBJnpMvy6vfSorWzBXQB6W0/DXLR/+z7USdg==", - "license": "Apache-2.0", - "dependencies": { - "@mongosh/arg-parser": "2.3.8", - "@mongosh/errors": "2.3.8", - "@mongosh/history": "2.3.8", - "@mongosh/i18n": "2.3.8", - "@mongosh/service-provider-core": "2.3.8", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/types": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.8.tgz", - "integrity": "sha512-WFx/SPMWwQIcCeSBlYiIEbVg3YEYKo6Dr+IKVBpUw6Vr82CGQ1zZXRChIhdhu/H7jo3O+kdeGOPIftn0kvYmLA==", - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/snippet-manager/node_modules/@types/cross-spawn": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.6.tgz", diff --git a/packages/build/package.json b/packages/build/package.json index 186a3b4e17..4c10274093 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -44,6 +44,7 @@ }, "devDependencies": { "@mongodb-js/eslint-config-mongosh": "^1.0.0", + "@mongodb-js/monorepo-tools": "^1.1.10", "@mongodb-js/prettier-config-devtools": "^1.0.1", "@mongodb-js/tsconfig-mongosh": "^1.0.0", "@types/command-exists": "^1.2.0", diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index c444c315b4..93436329b0 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -1,6 +1,6 @@ { "name": "@mongosh/cli-repl", - "version": "2.3.8", + "version": "0.0.0-dev.0", "description": "MongoDB Shell CLI REPL Package", "homepage": "https://github.com/mongodb-js/mongosh", "author": "Compass Team ", diff --git a/packages/connectivity-tests/package.json b/packages/connectivity-tests/package.json index 6ee099d2bc..930477eb20 100644 --- a/packages/connectivity-tests/package.json +++ b/packages/connectivity-tests/package.json @@ -11,7 +11,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci" }, "devDependencies": { - "mongosh": "2.3.8" + "mongosh": "0.0.0-dev.0" }, "mongosh": { "unitTestsOnly": true, diff --git a/packages/mongosh/package.json b/packages/mongosh/package.json index f9474439d7..dc77b76af1 100644 --- a/packages/mongosh/package.json +++ b/packages/mongosh/package.json @@ -1,6 +1,6 @@ { "name": "mongosh", - "version": "2.3.8", + "version": "0.0.0-dev.0", "description": "MongoDB Shell CLI REPL", "keywords": [ "mongosh", @@ -39,6 +39,6 @@ "variants": [] }, "dependencies": { - "@mongosh/cli-repl": "2.3.8" + "@mongosh/cli-repl": "0.0.0-dev.0" } } From 4fa2164bb358709d47c52e04e3608f225f6bff30 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 10 Jan 2025 14:36:19 +0100 Subject: [PATCH 24/36] use 2.3.8 --- package-lock.json | 199 ++--------------------- package.json | 12 +- packages/cli-repl/package.json | 2 +- packages/connectivity-tests/package.json | 2 +- packages/mongosh/package.json | 4 +- 5 files changed, 20 insertions(+), 199 deletions(-) diff --git a/package-lock.json b/package-lock.json index e3d3b33604..65f1825f9a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,24 +17,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/logging", - "packages/node-runtime-worker-thread", - "packages/service-provider-core", - "packages/snippet-manager", "packages/types", "packages/i18n", - "packages/service-provider-node-driver", + "packages/logging", + "packages/service-provider-core", "packages/arg-parser", + "packages/service-provider-node-driver", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", + "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", - "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", + "packages/node-runtime-worker-thread", + "packages/browser-repl", "packages/connectivity-tests" ], "bin": { @@ -29403,7 +29403,7 @@ }, "packages/cli-repl": { "name": "@mongosh/cli-repl", - "version": "0.0.0-dev.0", + "version": "2.3.8", "license": "Apache-2.0", "dependencies": { "@mongodb-js/devtools-proxy-support": "^0.4.2", @@ -29490,7 +29490,7 @@ "version": "2.4.0", "license": "Apache-2.0", "devDependencies": { - "mongosh": "0.0.0-dev.0" + "mongosh": "2.3.8" } }, "packages/e2e-tests": { @@ -29813,10 +29813,10 @@ "license": "Apache-2.0" }, "packages/mongosh": { - "version": "0.0.0-dev.0", + "version": "2.3.8", "license": "Apache-2.0", "dependencies": { - "@mongosh/cli-repl": "0.0.0-dev.0" + "@mongosh/cli-repl": "2.3.8" }, "bin": { "mongosh": "bin/mongosh.js" @@ -29855,126 +29855,6 @@ "node": ">=14.15.1" } }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/arg-parser": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.8.tgz", - "integrity": "sha512-oo6glzgsOyZJYijHvWMhnYJOZOI16J/u5y+puRLHL0oNwAaRwumJ1Kx+Zp9gQI9s6C523X80Hrs6op6/fCRp9Q==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.8", - "@mongosh/i18n": "2.3.8", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/async-rewriter2": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/async-rewriter2/-/async-rewriter2-2.3.8.tgz", - "integrity": "sha512-YHt0m2MehX5UBILQqwDL1hToDRc1vtUPoD6Q2HH31iSY3Yer+uL83+BQe5AWaR5IBYGtNbul5IcKFwXCE5hA/w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@babel/core": "^7.22.8", - "@babel/plugin-transform-destructuring": "^7.22.5", - "@babel/plugin-transform-parameters": "^7.22.5", - "@babel/plugin-transform-shorthand-properties": "^7.22.5", - "@babel/types": "^7.22.5" - }, - "bin": { - "async-rewrite": "bin/async-rewrite.js" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/autocomplete": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/autocomplete/-/autocomplete-2.3.8.tgz", - "integrity": "sha512-uiUhqTIFEei/YD1+MJOGJYGXC0tBmbteyDLzIudXYN8oCzvX+hqyZq3wbAQEH0jxF7aUzdAhxKVulIg2HxpIqQ==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/mongodb-constants": "^0.10.1", - "@mongosh/shell-api": "2.3.8", - "semver": "^7.5.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/errors": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/errors/-/errors-2.3.8.tgz", - "integrity": "sha512-r7J2PxZec+Li0V6R7Mn1BgeTR9uyT2bYOqmXf1LApkuODTkjmrgZlZOwBl184eqF3jkLI7ZadUqZe8TBColXfw==", - "dev": true, - "license": "Apache-2.0", - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/history": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.8.tgz", - "integrity": "sha512-u7R9dhk6qnbPoeSYkMu7h1JCkZuzFph6jEYy67e4lIviEL6J99u7hUHxNW70DqruOuoXyKREQ+mafPtxQNxu4w==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "mongodb-connection-string-url": "^3.0.1", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/i18n": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.8.tgz", - "integrity": "sha512-PbjAR7Dg8fYGRnnGTBvihPt8sHEZbg1BTgPas1jZGki6gUSiI/bwYeP0rOr7jgmvU2GcARJ8tfnxXBCIEIBasA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.8" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-api": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/shell-api/-/shell-api-2.3.8.tgz", - "integrity": "sha512-ulzeBdiQ5aGMtRqVxkDc6EYO6cELhDfxlB6XHF/v9C0m85Y+pFcBJnpMvy6vfSorWzBXQB6W0/DXLR/+z7USdg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/arg-parser": "2.3.8", - "@mongosh/errors": "2.3.8", - "@mongosh/history": "2.3.8", - "@mongosh/i18n": "2.3.8", - "@mongosh/service-provider-core": "2.3.8", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/node-runtime-worker-thread/node_modules/@mongosh/shell-evaluator": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/shell-evaluator/-/shell-evaluator-2.3.8.tgz", - "integrity": "sha512-txC0yHDOjsy8a8Bg6PIY94M+KDcvHgLGlA/Ar/XoNZFSEAfF7I0Xj0wYf9iP22eqtfoU5FYEsqToVZLyyh+QFg==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongosh/async-rewriter2": "2.3.8", - "@mongosh/history": "2.3.8", - "@mongosh/shell-api": "2.3.8" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/service-provider-core": { "name": "@mongosh/service-provider-core", "version": "3.0.0", @@ -30121,65 +30001,6 @@ "node": ">=14.15.1" } }, - "packages/snippet-manager/node_modules/@mongosh/arg-parser": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/arg-parser/-/arg-parser-2.3.8.tgz", - "integrity": "sha512-oo6glzgsOyZJYijHvWMhnYJOZOI16J/u5y+puRLHL0oNwAaRwumJ1Kx+Zp9gQI9s6C523X80Hrs6op6/fCRp9Q==", - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.8", - "@mongosh/i18n": "2.3.8", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/history": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/history/-/history-2.3.8.tgz", - "integrity": "sha512-u7R9dhk6qnbPoeSYkMu7h1JCkZuzFph6jEYy67e4lIviEL6J99u7hUHxNW70DqruOuoXyKREQ+mafPtxQNxu4w==", - "license": "Apache-2.0", - "dependencies": { - "mongodb-connection-string-url": "^3.0.1", - "mongodb-redact": "^1.1.2" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/i18n": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/i18n/-/i18n-2.3.8.tgz", - "integrity": "sha512-PbjAR7Dg8fYGRnnGTBvihPt8sHEZbg1BTgPas1jZGki6gUSiI/bwYeP0rOr7jgmvU2GcARJ8tfnxXBCIEIBasA==", - "license": "Apache-2.0", - "dependencies": { - "@mongosh/errors": "2.3.8" - }, - "engines": { - "node": ">=14.15.1" - } - }, - "packages/snippet-manager/node_modules/@mongosh/service-provider-core": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/service-provider-core/-/service-provider-core-2.3.8.tgz", - "integrity": "sha512-zt7y+iXwPQhSojKzObPRICjKpQwJbOzOdo6yObF5iiG2/FX4Gi8WrVjwVqEAAZ//nVCXkMM7Y0epMhcZX+h5oQ==", - "license": "Apache-2.0", - "dependencies": { - "@aws-sdk/credential-providers": "^3.525.0", - "@mongosh/errors": "2.3.8", - "bson": "^6.10.1", - "mongodb": "^6.12.0", - "mongodb-build-info": "^1.7.2", - "mongodb-connection-string-url": "^3.0.1" - }, - "engines": { - "node": ">=14.15.1" - }, - "optionalDependencies": { - "mongodb-client-encryption": "^6.1.0" - } - }, "packages/snippet-manager/node_modules/@types/cross-spawn": { "version": "6.0.6", "resolved": "https://registry.npmjs.org/@types/cross-spawn/-/cross-spawn-6.0.6.tgz", diff --git a/package.json b/package.json index 9a6b14d705..af12edefb6 100644 --- a/package.json +++ b/package.json @@ -149,24 +149,24 @@ "packages/history", "packages/java-shell", "packages/js-multiline-to-singleline", - "packages/logging", - "packages/node-runtime-worker-thread", - "packages/service-provider-core", - "packages/snippet-manager", "packages/types", "packages/i18n", - "packages/service-provider-node-driver", + "packages/logging", + "packages/service-provider-core", "packages/arg-parser", + "packages/service-provider-node-driver", "packages/shell-api", "packages/autocomplete", "packages/shell-evaluator", + "packages/snippet-manager", "packages/browser-runtime-core", "packages/editor", - "packages/browser-repl", "packages/browser-runtime-electron", "packages/cli-repl", "packages/e2e-tests", "packages/mongosh", + "packages/node-runtime-worker-thread", + "packages/browser-repl", "packages/connectivity-tests" ], "overrides": { diff --git a/packages/cli-repl/package.json b/packages/cli-repl/package.json index 93436329b0..c444c315b4 100644 --- a/packages/cli-repl/package.json +++ b/packages/cli-repl/package.json @@ -1,6 +1,6 @@ { "name": "@mongosh/cli-repl", - "version": "0.0.0-dev.0", + "version": "2.3.8", "description": "MongoDB Shell CLI REPL Package", "homepage": "https://github.com/mongodb-js/mongosh", "author": "Compass Team ", diff --git a/packages/connectivity-tests/package.json b/packages/connectivity-tests/package.json index 930477eb20..6ee099d2bc 100644 --- a/packages/connectivity-tests/package.json +++ b/packages/connectivity-tests/package.json @@ -11,7 +11,7 @@ "test-ci-coverage": "nyc --no-clean --cwd ../.. --reporter=none npm run test-ci" }, "devDependencies": { - "mongosh": "0.0.0-dev.0" + "mongosh": "2.3.8" }, "mongosh": { "unitTestsOnly": true, diff --git a/packages/mongosh/package.json b/packages/mongosh/package.json index dc77b76af1..f9474439d7 100644 --- a/packages/mongosh/package.json +++ b/packages/mongosh/package.json @@ -1,6 +1,6 @@ { "name": "mongosh", - "version": "0.0.0-dev.0", + "version": "2.3.8", "description": "MongoDB Shell CLI REPL", "keywords": [ "mongosh", @@ -39,6 +39,6 @@ "variants": [] }, "dependencies": { - "@mongosh/cli-repl": "0.0.0-dev.0" + "@mongosh/cli-repl": "2.3.8" } } From 75bc72d886584e4aab3f83516cbfa7c28740e8f4 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 10 Jan 2025 15:20:57 +0100 Subject: [PATCH 25/36] fix tests and match with mongosh --version --- packages/e2e-tests/test/e2e.spec.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/e2e-tests/test/e2e.spec.ts b/packages/e2e-tests/test/e2e.spec.ts index 1a0575e6aa..c9b2b18c74 100644 --- a/packages/e2e-tests/test/e2e.spec.ts +++ b/packages/e2e-tests/test/e2e.spec.ts @@ -22,7 +22,6 @@ import { once } from 'events'; import type { AddressInfo } from 'net'; const { EJSON } = bson; import { sleep } from './util-helpers'; -import { MONGOSH_VERSION } from '../../cli-repl/src/constants'; const jsContextFlagCombinations: `--jsContext=${'plain-vm' | 'repl'}`[][] = [ [], From 0feeebebfa953f3b9fc87a21c9fc533802071b91 Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 2 Jan 2025 12:44:15 +0100 Subject: [PATCH 26/36] add bumping --- .github/workflows/draft-release.yml | 94 +++++++++++++++++++++++++++++ package.json | 1 + packages/build/src/index.ts | 3 +- 3 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/draft-release.yml diff --git a/.github/workflows/draft-release.yml b/.github/workflows/draft-release.yml new file mode 100644 index 0000000000..1b33a906c9 --- /dev/null +++ b/.github/workflows/draft-release.yml @@ -0,0 +1,94 @@ +name: Draft release + +on: + workflow_dispatch: + inputs: + versionBump: + description: 'Version bump' + type: choice + required: true + default: 'patch' + options: + - patch + - minor + - major + - exact-version + + exactVersion: + description: 'Exact version: (Only effective selecting "exact-version" as version bump)' + required: false + +jobs: + prepare-release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + # NOTE: this is necessary to get the full history + # and check if tags are already present + fetch-depth: 0 + + - name: Setup Node.js Environment + uses: actions/setup-node@v4 + with: + node-version: 20.18.1 + + - name: Determine Next Version + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -e + + VERSION_BUMP=${{ github.event.inputs.versionBump }} + + if [[ "$VERSION_BUMP" == "major" || "$VERSION_BUMP" == "minor" || "$VERSION_BUMP" == "patch" ]]; then + PREV_VERSION_TAG=$(gh api repos/:owner/:repo/releases --jq '. | map(select(.draft == false)) | .[0] | .tag_name') + PREV_VERSION=$(npx semver --coerce ${PREV_VERSION_TAG}) + + NEXT_VERSION=$(npx semver -i $VERSION_BUMP $PREV_VERSION) + else + NEXT_VERSION=${{ github.event.inputs.exactVersion }} + fi + + # Validates the version before using it + npx semver v"${NEXT_VERSION}" + + npm version "${NEXT_VERSION}" --no-git-tag-version + echo "RELEASE_TAG=v${NEXT_VERSION}" >> "$GITHUB_ENV" + + - name: Validate release tag + shell: bash + run: | + if [ -z "${RELEASE_TAG}" ]; then + echo "RELEASE_TAG is not set or is empty" + exit 1 + fi + + if git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then + echo "Error: Tag $RELEASE_TAG already exists" + echo "If you are trying to re-create a draft release with this version, please delete the release and the tag first." + echo "If this version has already been release consider using a different one." + exit 1 + fi + + - name: Bump mongosh and package versions + run: | + set -e + echo Bumping mongosh versions to ${RELEASE_TAG} and packages + + MONGOSH_RELEASE_VERSION=${RELEASE_TAG} npm run bump + + - name: Create Draft Release + run: | + set -e + echo Creating draft release for: "${RELEASE_TAG}" + + git tag ${RELEASE_TAG} + git push origin ${RELEASE_TAG} + + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/package.json b/package.json index af12edefb6..36585872d8 100644 --- a/package.json +++ b/package.json @@ -71,6 +71,7 @@ "prepare": "husky", "precommit": "precommit", "preinstall": "node scripts/sort-workspaces.js", + "bump": "npm run bump --workspace @mongosh/build", "bump-auxiliary": "npm run bump-auxiliary --workspace @mongosh/build", "publish-auxiliary": "npm run publish-auxiliary --workspace @mongosh/build" }, diff --git a/packages/build/src/index.ts b/packages/build/src/index.ts index 665e90d946..4066089b8e 100644 --- a/packages/build/src/index.ts +++ b/packages/build/src/index.ts @@ -10,7 +10,8 @@ import type { Config, PackageVariant } from './config'; export { getArtifactUrl, downloadMongoDb }; const validCommands: (ReleaseCommand | 'trigger-release')[] = [ - 'bump', + 'bump-mongosh', + 'bump-packages', 'compile', 'package', 'upload', From 25df857d6c5f1de023b09022cc21da4e9babb041 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 6 Jan 2025 10:38:45 +0100 Subject: [PATCH 27/36] WIP: move parts of release to GitHub Actions --- ...elease.yml => prepare-release-mongosh.yml} | 51 ++++++++++------ .github/workflows/release-mongosh.yml | 59 +++++++++++++++++++ package.json | 1 + packages/build/src/index.ts | 3 +- 4 files changed, 95 insertions(+), 19 deletions(-) rename .github/workflows/{draft-release.yml => prepare-release-mongosh.yml} (58%) create mode 100644 .github/workflows/release-mongosh.yml diff --git a/.github/workflows/draft-release.yml b/.github/workflows/prepare-release-mongosh.yml similarity index 58% rename from .github/workflows/draft-release.yml rename to .github/workflows/prepare-release-mongosh.yml index 1b33a906c9..a7702cbf8c 100644 --- a/.github/workflows/draft-release.yml +++ b/.github/workflows/prepare-release-mongosh.yml @@ -1,8 +1,12 @@ -name: Draft release +name: Prepare mongosh release on: workflow_dispatch: inputs: + jiraTicket: + description: 'Jira ticket for the release, e.g. MONGOSH-1234' + required: true + versionBump: description: 'Version bump' type: choice @@ -22,6 +26,13 @@ jobs: prepare-release: runs-on: ubuntu-latest steps: + - name: Create Github App Token + uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + id: app-token + with: + app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} + private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} + - name: Checkout uses: actions/checkout@v4 with: @@ -36,8 +47,6 @@ jobs: - name: Determine Next Version shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | set -e @@ -51,6 +60,9 @@ jobs: else NEXT_VERSION=${{ github.event.inputs.exactVersion }} fi + + # Remove the 'v' prefix from NEXT_VERSION if it exists + NEXT_VERSION="${NEXT_VERSION#v}" # Validates the version before using it npx semver v"${NEXT_VERSION}" @@ -74,21 +86,26 @@ jobs: fi - name: Bump mongosh and package versions + shell: bash + env: + LAST_BUMP_COMMIT_MESSAGE: "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" run: | set -e - echo Bumping mongosh versions to ${RELEASE_TAG} and packages - - MONGOSH_RELEASE_VERSION=${RELEASE_TAG} npm run bump - - - name: Create Draft Release - run: | - set -e - echo Creating draft release for: "${RELEASE_TAG}" + echo Bumping mongosh versions to ${NEXT_VERSION} and packages - git tag ${RELEASE_TAG} - git push origin ${RELEASE_TAG} - - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + MONGOSH_RELEASE_VERSION=${NEXT_VERSION} npm run bump + + git add . + git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true + - name: Create Pull Request + uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 + with: + token: ${{ steps.app-token.outputs.token }} + commit-message: "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" + branch: release/${NEXT_VERSION} + title: "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" + body: | + - [${{ github.event.inputs.jiraTicket }}](https://jira.mongodb.org/browse/${{ github.event.inputs.jiraTicket }}) + - This PR is for the release of mongosh v${NEXT_VERSION}. + - **Do not merge manually, use the Release mongosh action instead.** \ No newline at end of file diff --git a/.github/workflows/release-mongosh.yml b/.github/workflows/release-mongosh.yml new file mode 100644 index 0000000000..0b1ae22920 --- /dev/null +++ b/.github/workflows/release-mongosh.yml @@ -0,0 +1,59 @@ +name: Release mongosh +on: + workflow_run: + workflows: ["CheckQL", "Run Smoke Tests", "evergreen"] + types: ["completed"] + branches: ["release/**"] + workflow_dispatch: + +jobs: + publish: + if: | + startsWith(github.head_ref, 'refs/heads/release/') + runs-on: ubuntu-latest + + steps: + - name: Create Github App Token + uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + id: app-token + with: + app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} + private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} + + - uses: actions/checkout@v4 + with: + # don't checkout a detatched HEAD + ref: ${{ github.head_ref }} + + - name: Extract version from the branch + run: | + set -e + export NEXT_VERSION=$(echo "${GITHUB_REF}" | sed -n 's/refs\/heads\/release\/\(.*\)/\1/p') + + echo "NEXT_VERSION=${NEXT_VERSION}" >> "$GITHUB_ENV" + echo "RELEASE_TAG=v${NEXT_VERSION}" >> "$GITHUB_ENV" + + - name: Validate release tag + shell: bash + run: | + if [ -z "${RELEASE_TAG}" ]; then + echo "RELEASE_TAG is not set or is empty" + exit 1 + fi + + if git rev-parse "$RELEASE_TAG" >/dev/null 2>&1; then + echo "Error: Tag $RELEASE_TAG already exists" + echo "If you are trying to re-create a draft release with this version, please delete the release and the tag first." + echo "If this version has already been released consider using a different one." + exit 1 + fi + + - name: "Publish what is not already in NPM" + env: + NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} + run: | + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + npm config list + echo "Publishing packages as $(npm whoami)" + git update-index --assume-unchanged .npmrc + npm run publish-packages \ No newline at end of file diff --git a/package.json b/package.json index 36585872d8..ea58691bfc 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "precommit": "precommit", "preinstall": "node scripts/sort-workspaces.js", "bump": "npm run bump --workspace @mongosh/build", + "publish": "npm run publish --workspace @mongosh/build", "bump-auxiliary": "npm run bump-auxiliary --workspace @mongosh/build", "publish-auxiliary": "npm run publish-auxiliary --workspace @mongosh/build" }, diff --git a/packages/build/src/index.ts b/packages/build/src/index.ts index 4066089b8e..665e90d946 100644 --- a/packages/build/src/index.ts +++ b/packages/build/src/index.ts @@ -10,8 +10,7 @@ import type { Config, PackageVariant } from './config'; export { getArtifactUrl, downloadMongoDb }; const validCommands: (ReleaseCommand | 'trigger-release')[] = [ - 'bump-mongosh', - 'bump-packages', + 'bump', 'compile', 'package', 'upload', From 68f93dd97219cbc4860b5ae50c7dd25b3e44be20 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 6 Jan 2025 16:46:08 +0100 Subject: [PATCH 28/36] use publish --- .github/workflows/release-mongosh.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-mongosh.yml b/.github/workflows/release-mongosh.yml index 0b1ae22920..862bdc2939 100644 --- a/.github/workflows/release-mongosh.yml +++ b/.github/workflows/release-mongosh.yml @@ -52,8 +52,7 @@ jobs: env: NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> .npmrc + echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc npm config list echo "Publishing packages as $(npm whoami)" - git update-index --assume-unchanged .npmrc - npm run publish-packages \ No newline at end of file + npm run publish \ No newline at end of file From a6e3cbe1f67c373b8cd2ef76115534098834f778 Mon Sep 17 00:00:00 2001 From: gagik Date: Mon, 6 Jan 2025 16:50:01 +0100 Subject: [PATCH 29/36] remove no-tagging --- .github/workflows/prepare-release-mongosh.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/prepare-release-mongosh.yml b/.github/workflows/prepare-release-mongosh.yml index a7702cbf8c..b9862db9eb 100644 --- a/.github/workflows/prepare-release-mongosh.yml +++ b/.github/workflows/prepare-release-mongosh.yml @@ -1,4 +1,4 @@ -name: Prepare mongosh release +name: Prepare mongosh Release on: workflow_dispatch: @@ -67,7 +67,6 @@ jobs: # Validates the version before using it npx semver v"${NEXT_VERSION}" - npm version "${NEXT_VERSION}" --no-git-tag-version echo "RELEASE_TAG=v${NEXT_VERSION}" >> "$GITHUB_ENV" - name: Validate release tag From fb65c9aa37e949fcbd14f55c438052a2331a5f6e Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 14 Jan 2025 09:54:03 +0100 Subject: [PATCH 30/36] add setting release publisher to the publish step --- .github/workflows/prepare-release-mongosh.yml | 22 +-- .github/workflows/release-mongosh.yml | 11 +- packages/build/src/npm-packages/bump.ts | 23 ++-- .../build/src/npm-packages/helpers.spec.ts | 130 ++++++++++++++++++ packages/build/src/npm-packages/helpers.ts | 56 ++++++++ packages/build/src/npm-packages/list.spec.ts | 66 --------- .../build/src/npm-packages/publish.spec.ts | 97 ++++++++++--- packages/build/src/npm-packages/publish.ts | 65 ++++----- 8 files changed, 327 insertions(+), 143 deletions(-) create mode 100644 packages/build/src/npm-packages/helpers.spec.ts create mode 100644 packages/build/src/npm-packages/helpers.ts delete mode 100644 packages/build/src/npm-packages/list.spec.ts diff --git a/.github/workflows/prepare-release-mongosh.yml b/.github/workflows/prepare-release-mongosh.yml index b9862db9eb..cdf406a721 100644 --- a/.github/workflows/prepare-release-mongosh.yml +++ b/.github/workflows/prepare-release-mongosh.yml @@ -26,19 +26,21 @@ jobs: prepare-release: runs-on: ubuntu-latest steps: - - name: Create Github App Token - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main id: app-token with: app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} - - name: Checkout - uses: actions/checkout@v4 + - uses: actions/checkout@v4 with: - # NOTE: this is necessary to get the full history - # and check if tags are already present - fetch-depth: 0 + # don't checkout a detatched HEAD + ref: ${{ github.head_ref }} + + # this is important so git log can pick up on + # the whole history to generate the list of AUTHORS + fetch-depth: "0" + token: ${{ steps.app-token.outputs.token }} - name: Setup Node.js Environment uses: actions/setup-node@v4 @@ -87,15 +89,15 @@ jobs: - name: Bump mongosh and package versions shell: bash env: - LAST_BUMP_COMMIT_MESSAGE: "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" + MONGOSH_RELEASE_VERSION: ${{ env.NEXT_VERSION }} run: | set -e echo Bumping mongosh versions to ${NEXT_VERSION} and packages - MONGOSH_RELEASE_VERSION=${NEXT_VERSION} npm run bump + npm run bump git add . - git commit --no-allow-empty -m "$LAST_BUMP_COMMIT_MESSAGE" || true + git commit --no-allow-empty -m "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" || true - name: Create Pull Request uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # 7.0.5 diff --git a/.github/workflows/release-mongosh.yml b/.github/workflows/release-mongosh.yml index 862bdc2939..44d1ab621d 100644 --- a/.github/workflows/release-mongosh.yml +++ b/.github/workflows/release-mongosh.yml @@ -13,18 +13,22 @@ jobs: runs-on: ubuntu-latest steps: - - name: Create Github App Token - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main id: app-token with: app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} - + - uses: actions/checkout@v4 with: # don't checkout a detatched HEAD ref: ${{ github.head_ref }} + # this is important so git log can pick up on + # the whole history to generate the list of AUTHORS + fetch-depth: "0" + token: ${{ steps.app-token.outputs.token }} + - name: Extract version from the branch run: | set -e @@ -51,6 +55,7 @@ jobs: - name: "Publish what is not already in NPM" env: NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} + MONGOSH_RELEASE_PUBLISHER: ${{ github.triggering_actor }} run: | echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc npm config list diff --git a/packages/build/src/npm-packages/bump.ts b/packages/build/src/npm-packages/bump.ts index f4c337e2df..a418c171e1 100644 --- a/packages/build/src/npm-packages/bump.ts +++ b/packages/build/src/npm-packages/bump.ts @@ -8,6 +8,7 @@ import { import { promises as fs } from 'fs'; import path from 'path'; import { getPackagesInTopologicalOrder } from '@mongodb-js/monorepo-tools'; +import { getPackageConfigurations } from './helpers'; /** Bumps only the main mongosh release packages to the set version. */ export async function bumpMongoshReleasePackages(): Promise { @@ -17,21 +18,21 @@ export async function bumpMongoshReleasePackages(): Promise { 'MONGOSH_RELEASE_VERSION version not specified during mongosh bump' ); } - console.info(`mongosh: Bumping package versions to ${version}`); - const monorepoRootPath = path.resolve(__dirname, '..', '..', '..', '..'); - const packages = await getPackagesInTopologicalOrder(monorepoRootPath); - - const workspaceNames = packages - .map((p) => p.name) - .filter((name) => MONGOSH_RELEASE_PACKAGES.includes(name)); - const locations = [monorepoRootPath, ...packages.map((p) => p.location)]; + console.info(`mongosh: Bumping package versions to ${version}`); + const packages = await getPackagesInTopologicalOrder(PROJECT_ROOT); + const packageConfigurations = await getPackageConfigurations(packages); - for (const location of locations) { - const packageJsonPath = path.join(location, 'package.json'); - const packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8')); + const mongoshReleasePackages = packages.filter((packageInfo) => + MONGOSH_RELEASE_PACKAGES.includes(packageInfo.name) + ); + const workspaceNames = mongoshReleasePackages.map( + (packageInfo) => packageInfo.name + ); + for (const [packageJsonPath, packageJson] of packageConfigurations) { packageJson.version = version; + for (const grouping of [ 'dependencies', 'devDependencies', diff --git a/packages/build/src/npm-packages/helpers.spec.ts b/packages/build/src/npm-packages/helpers.spec.ts new file mode 100644 index 0000000000..7c24f46a6d --- /dev/null +++ b/packages/build/src/npm-packages/helpers.spec.ts @@ -0,0 +1,130 @@ +import { expect } from 'chai'; +import path from 'path'; +import type { SinonStub } from 'sinon'; +import sinon from 'sinon'; +import type { PackageInfo } from '@mongodb-js/monorepo-tools'; +import { getPackagesInTopologicalOrder } from '@mongodb-js/monorepo-tools'; +import { PROJECT_ROOT } from './constants'; +import { promises as fs } from 'fs'; +import { + getPackageConfigurations, + markBumpedFilesAsAssumeUnchanged, +} from './helpers'; + +describe('npm-packages helpers', function () { + before(function () { + if (process.version.startsWith('v16.')) return this.skip(); + }); + + describe('markBumpedFilesAsAssumeUnchanged', function () { + let packages: PackageInfo[]; + let expectedFiles: string[]; + let spawnSync: SinonStub; + + beforeEach(async function () { + expectedFiles = [ + path.resolve(__dirname, '..', '..', '..', '..', 'lerna.json'), + path.resolve(__dirname, '..', '..', '..', '..', 'package.json'), + path.resolve(__dirname, '..', '..', '..', '..', 'package-lock.json'), + ]; + packages = await getPackagesInTopologicalOrder(PROJECT_ROOT); + for (const { location } of packages) { + expectedFiles.push(path.resolve(location, 'package.json')); + } + + spawnSync = sinon.stub(); + }); + + it('marks files with --assume-unchanged', function () { + markBumpedFilesAsAssumeUnchanged(packages, true, spawnSync); + expectedFiles.forEach((f) => { + expect(spawnSync).to.have.been.calledWith( + 'git', + ['update-index', '--assume-unchanged', f], + sinon.match.any + ); + }); + }); + + it('marks files with --no-assume-unchanged', function () { + markBumpedFilesAsAssumeUnchanged(packages, false, spawnSync); + expectedFiles.forEach((f) => { + expect(spawnSync).to.have.been.calledWith( + 'git', + ['update-index', '--no-assume-unchanged', f], + sinon.match.any + ); + }); + }); + }); + + describe('getPackageConfigurations', function () { + const packages: PackageInfo[] = [ + { + name: 'package1', + version: '1.0.0', + location: '/packages/package1', + private: false, + }, + { + name: 'package2', + version: '1.0.0', + location: '/packages/package2', + private: false, + }, + ]; + let readFileStub: sinon.SinonStub; + + beforeEach(function () { + readFileStub = sinon.stub(fs, 'readFile').throws('Unexpected path'); + readFileStub + .withArgs(path.join(packages[0].location, 'package.json')) + .resolves( + JSON.stringify({ + name: packages[0].name, + version: packages[0].version, + }) + ) + .withArgs(path.join(packages[1].location, 'package.json')) + .resolves( + JSON.stringify({ + name: packages[1].name, + version: packages[1].version, + }) + ); + }); + + afterEach(function () { + sinon.restore(); + }); + + it('should return package configurations', async function () { + const result = await getPackageConfigurations(packages); + + expect(result).to.deep.equal([ + [ + path.join(packages[0].location, 'package.json'), + { + name: packages[0].name, + version: packages[0].version, + }, + ], + [ + path.join(packages[1].location, 'package.json'), + { + name: packages[1].name, + version: packages[1].version, + }, + ], + ]); + + expect(readFileStub).has.callCount(2); + expect(readFileStub.firstCall.args[0]).to.equal( + path.join(packages[0].location, 'package.json') + ); + expect(readFileStub.secondCall.args[0]).to.equal( + path.join(packages[1].location, 'package.json') + ); + }); + }); +}); diff --git a/packages/build/src/npm-packages/helpers.ts b/packages/build/src/npm-packages/helpers.ts new file mode 100644 index 0000000000..ba9def3289 --- /dev/null +++ b/packages/build/src/npm-packages/helpers.ts @@ -0,0 +1,56 @@ +import path from 'path'; +import { promises as fs } from 'fs'; +import type { PackageInfo } from '@mongodb-js/monorepo-tools'; +import { PROJECT_ROOT } from './constants'; +import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync'; + +export async function getPackageConfigurations( + packages: PackageInfo[] + // eslint-disable-next-line @typescript-eslint/no-explicit-any +): Promise<[path: string, contents: Record][]> { + return Promise.all( + packages.map(async (packageInfo) => { + const packageJsonPath = path.join(packageInfo.location, 'package.json'); + // eslint-disable-next-line @typescript-eslint/no-explicit-any + const packageJsonContents: Record = JSON.parse( + await fs.readFile(packageJsonPath, 'utf8') + ); + return [packageJsonPath, packageJsonContents]; + }) + ); +} + +export function markBumpedFilesAsAssumeUnchanged( + packages: PackageInfo[], + assumeUnchanged: boolean, + spawnSync: typeof spawnSyncFn = spawnSyncFn +): void { + const filesToAssume = [ + path.resolve(PROJECT_ROOT, 'lerna.json'), + path.resolve(PROJECT_ROOT, 'package.json'), + path.resolve(PROJECT_ROOT, 'package-lock.json'), + ]; + for (const { location } of packages) { + filesToAssume.push(path.resolve(location, 'package.json')); + } + + for (const f of filesToAssume) { + spawnSync( + 'git', + [ + 'update-index', + assumeUnchanged ? '--assume-unchanged' : '--no-assume-unchanged', + f, + ], + { + stdio: 'inherit', + cwd: PROJECT_ROOT, + encoding: 'utf8', + }, + true + ); + console.info( + `File ${f} is now ${assumeUnchanged ? '' : 'NOT '}assumed to be unchanged` + ); + } +} diff --git a/packages/build/src/npm-packages/list.spec.ts b/packages/build/src/npm-packages/list.spec.ts deleted file mode 100644 index d8ab29600d..0000000000 --- a/packages/build/src/npm-packages/list.spec.ts +++ /dev/null @@ -1,66 +0,0 @@ -import { expect } from 'chai'; -import path from 'path'; -import type { SinonStub } from 'sinon'; -import sinon from 'sinon'; -import type { LernaPackageDescription } from './list'; -import { listNpmPackages } from './list'; -import { markBumpedFilesAsAssumeUnchanged } from './publish'; - -describe('npm-packages list', function () { - before(function () { - if (process.version.startsWith('v16.')) return this.skip(); - }); - - describe('listNpmPackages', function () { - it('lists packages', function () { - const packages = listNpmPackages(); - expect(packages.length).to.be.greaterThan(1); - for (const { name, version } of packages) { - expect(name).to.be.a('string'); - expect(version).to.be.a('string'); - } - }); - }); - - describe('markBumpedFilesAsAssumeUnchanged', function () { - let packages: LernaPackageDescription[]; - let expectedFiles: string[]; - let spawnSync: SinonStub; - - beforeEach(function () { - expectedFiles = [ - path.resolve(__dirname, '..', '..', '..', '..', 'lerna.json'), - path.resolve(__dirname, '..', '..', '..', '..', 'package.json'), - path.resolve(__dirname, '..', '..', '..', '..', 'package-lock.json'), - ]; - packages = listNpmPackages(); - for (const { location } of packages) { - expectedFiles.push(path.resolve(location, 'package.json')); - } - - spawnSync = sinon.stub(); - }); - - it('marks files with --assume-unchanged', function () { - markBumpedFilesAsAssumeUnchanged(packages, true, spawnSync); - expectedFiles.forEach((f) => { - expect(spawnSync).to.have.been.calledWith( - 'git', - ['update-index', '--assume-unchanged', f], - sinon.match.any - ); - }); - }); - - it('marks files with --no-assume-unchanged', function () { - markBumpedFilesAsAssumeUnchanged(packages, false, spawnSync); - expectedFiles.forEach((f) => { - expect(spawnSync).to.have.been.calledWith( - 'git', - ['update-index', '--no-assume-unchanged', f], - sinon.match.any - ); - }); - }); - }); -}); diff --git a/packages/build/src/npm-packages/publish.spec.ts b/packages/build/src/npm-packages/publish.spec.ts index e431774f02..24647f5c97 100644 --- a/packages/build/src/npm-packages/publish.spec.ts +++ b/packages/build/src/npm-packages/publish.spec.ts @@ -20,35 +20,38 @@ describe('npm-packages publishToNpm', function () { ); beforeEach(function () { - listNpmPackages = sinon.stub(); + getPackagesInTopologicalOrder = sinon.stub(); markBumpedFilesAsAssumeUnchanged = sinon.stub(); spawnSync = sinon.stub(); }); - it('throws if mongosh is not existent when publishing all', function () { + it('throws if mongosh is not existent when publishing all', async function () { const packages = [{ name: 'packageA', version: '0.7.0' }]; - listNpmPackages.returns(packages); + getPackagesInTopologicalOrder.resolves(packages); expect(() => publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, - listNpmPackages, + getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, spawnSync - ) - ).throws('mongosh package not found'); + ); + expect.fail('should throw'); + } catch (error) { + expect((error as Error).message).equals('mongosh package not found'); + } }); - it('takes mongosh version and pushes tags', function () { + it('takes mongosh version and pushes tags', async function () { const packages = [ { name: 'packageA', version: '0.7.0' }, { name: 'mongosh', version: '1.2.0' }, ]; - listNpmPackages.returns(packages); + getPackagesInTopologicalOrder.resolves(packages); publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, - listNpmPackages, + getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, spawnSync ); @@ -57,16 +60,16 @@ describe('npm-packages publishToNpm', function () { expect(spawnSync).calledWith('git', ['push', '--follow-tags']); }); - it('does not manually push tags with auxiliary packages', function () { + it('does not manually push tags with auxiliary packages', async function () { const packages = [ { name: 'packageA', version: '0.7.0' }, { name: 'mongosh', version: '1.2.0' }, ]; - listNpmPackages.returns(packages); + getPackagesInTopologicalOrder.resolves(packages); publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: true }, - listNpmPackages, + getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, spawnSync ); @@ -81,16 +84,16 @@ describe('npm-packages publishToNpm', function () { expect(spawnSync).not.calledWith('git', ['push', '--follow-tags']); }); - it('calls lerna to publish packages for a real version', function () { + it('calls lerna to publish packages for a real version', async function () { const packages = [ { name: 'packageA', version: '0.7.0' }, { name: 'mongosh', version: '1.2.0' }, ]; - listNpmPackages.returns(packages); + getPackagesInTopologicalOrder.resolves(packages); publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, - listNpmPackages, + getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, spawnSync ); @@ -118,15 +121,15 @@ describe('npm-packages publishToNpm', function () { ); }); - it('reverts the assume unchanged even on spawn failure', function () { + it('reverts the assume unchanged even on spawn failure', async function () { const packages = [{ name: 'packageA', version: '0.7.0' }]; - listNpmPackages.returns(packages); + getPackagesInTopologicalOrder.resolves(packages); spawnSync.throws(new Error('meeep')); try { publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, - listNpmPackages, + getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, spawnSync ); @@ -144,4 +147,62 @@ describe('npm-packages publishToNpm', function () { } expect.fail('Expected error'); }); + + describe('setReleasePublisher', function () { + let writeFileStub: sinon.SinonStub; + let readFileStub: sinon.SinonStub; + + const packages = [ + { name: 'package1', version: '1.0.0', location: 'packages/package1' }, + { name: 'package2', version: '2.0.0', location: 'packages/package2' }, + ]; + + beforeEach(() => { + writeFileStub = sinon.stub(fs, 'writeFile').resolves(); + + readFileStub = sinon.stub(fs, 'readFile'); + readFileStub.throws(); + readFileStub.withArgs('packages/package1/package.json', 'utf8').resolves( + JSON.stringify({ + name: packages[0].name, + version: packages[0].version, + }) + ); + readFileStub.withArgs('packages/package2/package.json', 'utf8').resolves( + JSON.stringify({ + name: packages[1].name, + version: packages[1].version, + }) + ); + }); + + afterEach(() => { + sinon.restore(); + }); + + it('should set the releasePublisher for each package and write the updated package.json', async () => { + const publisher = 'test-publisher'; + await setReleasePublisher(publisher, packages as PackageInfo[]); + + expect(writeFileStub.calledTwice).to.be.true; + + expect(writeFileStub.firstCall.args[0]).to.equal( + 'packages/package1/package.json' + ); + expect(JSON.parse(writeFileStub.firstCall.args[1])).to.deep.equal({ + name: 'package1', + version: '1.0.0', + releasePublisher: 'test-publisher', + }); + + expect(writeFileStub.secondCall.args[0]).to.equal( + 'packages/package2/package.json' + ); + expect(JSON.parse(writeFileStub.secondCall.args[1])).to.deep.equal({ + name: 'package2', + version: '2.0.0', + releasePublisher: 'test-publisher', + }); + }); + }); }); diff --git a/packages/build/src/npm-packages/publish.ts b/packages/build/src/npm-packages/publish.ts index 638138065f..dc57e211f8 100644 --- a/packages/build/src/npm-packages/publish.ts +++ b/packages/build/src/npm-packages/publish.ts @@ -5,17 +5,29 @@ import { MONGOSH_RELEASE_PACKAGES, PROJECT_ROOT, } from './constants'; -import type { LernaPackageDescription } from './list'; -import { listNpmPackages as listNpmPackagesFn } from './list'; import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync'; import type { SpawnSyncOptionsWithStringEncoding } from 'child_process'; +import { + getPackagesInTopologicalOrder as getPackagesInTopologicalOrderFn, + PackageInfo, +} from '@mongodb-js/monorepo-tools'; +import { + getPackageConfigurations, + markBumpedFilesAsAssumeUnchanged, +} from './helpers'; +import { promises as fs } from 'fs'; export function publishToNpm( { isDryRun = false, useAuxiliaryPackagesOnly = false }, - listNpmPackages: typeof listNpmPackagesFn = listNpmPackagesFn, + getPackagesInTopologicalOrder: typeof getPackagesInTopologicalOrderFn = getPackagesInTopologicalOrderFn, markBumpedFilesAsAssumeUnchangedFn: typeof markBumpedFilesAsAssumeUnchanged = markBumpedFilesAsAssumeUnchanged, spawnSync: typeof spawnSyncFn = spawnSyncFn -): void { +): Promise { + const publisher = process.env.MONGOSH_RELEASE_PUBLISHER; + if (!publisher) { + throw new Error('MONGOSH_RELEASE_PUBLISHER not specified for publishing'); + } + const commandOptions: SpawnSyncOptionsWithStringEncoding = { stdio: 'inherit', cwd: PROJECT_ROOT, @@ -25,7 +37,8 @@ export function publishToNpm( ...(isDryRun ? { npm_config_dry_run: 'true' } : {}), }, }; - let packages = listNpmPackages().filter( + + let packages = (await getPackagesInTopologicalOrder(PROJECT_ROOT)).filter( (packageConfig) => !EXCLUDE_RELEASE_PACKAGES.includes(packageConfig.name) ); @@ -34,6 +47,7 @@ export function publishToNpm( (packageConfig) => !MONGOSH_RELEASE_PACKAGES.includes(packageConfig.name) ); } + await setReleasePublisher(publisher, packages); // Lerna requires a clean repository for a publish from-package // we use git update-index --assume-unchanged on files we know have been bumped markBumpedFilesAsAssumeUnchangedFn(packages, true); @@ -74,37 +88,18 @@ export function publishToNpm( } } -export function markBumpedFilesAsAssumeUnchanged( - packages: LernaPackageDescription[], - assumeUnchanged: boolean, - spawnSync: typeof spawnSyncFn = spawnSyncFn -): void { - const filesToAssume = [ - path.resolve(PROJECT_ROOT, 'lerna.json'), - path.resolve(PROJECT_ROOT, 'package.json'), - path.resolve(PROJECT_ROOT, 'package-lock.json'), - ]; - for (const { location } of packages) { - filesToAssume.push(path.resolve(location, 'package.json')); - } +export async function setReleasePublisher( + publisher: string, + packages: PackageInfo[] +): Promise { + const packageConfigurations = await getPackageConfigurations(packages); - for (const f of filesToAssume) { - spawnSync( - 'git', - [ - 'update-index', - assumeUnchanged ? '--assume-unchanged' : '--no-assume-unchanged', - f, - ], - { - stdio: 'inherit', - cwd: PROJECT_ROOT, - encoding: 'utf8', - }, - true - ); - console.info( - `File ${f} is now ${assumeUnchanged ? '' : 'NOT '}assumed to be unchanged` + for (const [packageJsonPath, packageJson] of packageConfigurations) { + packageJson.releasePublisher = publisher; + + await fs.writeFile( + packageJsonPath, + JSON.stringify(packageJson, null, 2) + '\n' ); } } From f220798b9ac47c02d296f9d84f42a88cf26de336 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 14 Jan 2025 09:58:40 +0100 Subject: [PATCH 31/36] add spaces --- .github/workflows/prepare-release-mongosh.yml | 2 +- .github/workflows/release-mongosh.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/prepare-release-mongosh.yml b/.github/workflows/prepare-release-mongosh.yml index cdf406a721..a197e3fae3 100644 --- a/.github/workflows/prepare-release-mongosh.yml +++ b/.github/workflows/prepare-release-mongosh.yml @@ -109,4 +109,4 @@ jobs: body: | - [${{ github.event.inputs.jiraTicket }}](https://jira.mongodb.org/browse/${{ github.event.inputs.jiraTicket }}) - This PR is for the release of mongosh v${NEXT_VERSION}. - - **Do not merge manually, use the Release mongosh action instead.** \ No newline at end of file + - **Do not merge manually, use the Release mongosh action instead.** diff --git a/.github/workflows/release-mongosh.yml b/.github/workflows/release-mongosh.yml index 44d1ab621d..35b533da43 100644 --- a/.github/workflows/release-mongosh.yml +++ b/.github/workflows/release-mongosh.yml @@ -60,4 +60,4 @@ jobs: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc npm config list echo "Publishing packages as $(npm whoami)" - npm run publish \ No newline at end of file + npm run publish From f62b2a8b39db6fb45cc3121b7f1cfb5dc3685652 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 14 Jan 2025 10:33:03 +0100 Subject: [PATCH 32/36] set the release submitter papertrail in evergreen --- .evergreen.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.evergreen.yml b/.evergreen.yml index 3276782ade..9dc9ffda27 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4239,10 +4239,19 @@ functions: else tag="${triggered_by_git_tag}" fi - echo "Setting version for papertrail to $tag, with product ${product}" + + # Set the release publisher + submitter=$(node -p 'JSON.parse(fs.readFileSync("packages/cli-repl/package.json")).releasePublisher') + if [ -z "$submitter" ] || [ "$submitter" == "undefined" ]; then + echo "releasePublisher is not set" + exit 1 + fi + + echo "Setting version for papertrail to $tag, with product ${product} and submitter ${submitter}" version="$(echo $tag | sed -e 's/^[vr]//')" cat < trace-expansions.yml release_version: "$version" + submitter: "$submitter" EOT cat trace-expansions.yml - command: expansions.update From 837e516a4c127f1cf7d39efd756ad4e6ec665570 Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 14 Jan 2025 11:01:39 +0100 Subject: [PATCH 33/36] add papertrail submitter from package.json --- .evergreen.yml | 47 +++++++++++++++++++------------ .evergreen/evergreen.yml.in | 56 +++++++++++++++++++++++++------------ 2 files changed, 67 insertions(+), 36 deletions(-) diff --git a/.evergreen.yml b/.evergreen.yml index 9dc9ffda27..e00ff9e4c5 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4228,11 +4228,15 @@ functions: papertrail_trace: - command: shell.exec params: + env: + PAPERTRAIL_KEY_ID: ${papertrail_key_id} + PAPERTRAIL_SECRET_KEY: ${papertrail_secret_key} + EVERGREEN_TASK_ID: ${task_id} + EVERGREEN_EXECUTION: ${execution} working_dir: src shell: bash script: | set -e - set -x ls -lh dist/ if [ x"${triggered_by_git_tag}" == x"" ]; then tag=$(git describe --tags --always --dirty) @@ -4248,23 +4252,30 @@ functions: fi echo "Setting version for papertrail to $tag, with product ${product} and submitter ${submitter}" - version="$(echo $tag | sed -e 's/^[vr]//')" - cat < trace-expansions.yml - release_version: "$version" - submitter: "$submitter" - EOT - cat trace-expansions.yml - - command: expansions.update - params: - file: src/trace-expansions.yml - - command: papertrail.trace - params: - key_id: ${papertrail_key_id} - secret_key: ${papertrail_secret_key} - product: ${product} - version: ${release_version} - filenames: - - "src/dist/*" + + echo "X-PAPERTRAIL-KEY-ID: ${PAPERTRAIL_KEY_ID}" > .papertrail.headers + echo "X-PAPERTRAIL-SECRET-KEY: ${PAPERTRAIL_SECRET_KEY}" >> .papertrail.headers + + + for file in src/dist/* ; do + if [ -f "$file" ]; then + filename=$(basename "$file") + checksum=$(shasum -a 256 "$file" | cut -f1 -d' ') + platform="evergreen" + build="${EVERGREEN_TASK_ID}_${EVERGREEN_EXECUTION}" + + curl -G -X POST -H @.papertrail.headers "https://papertrail.devprod-infra.prod.corp.mongodb.com/trace" \ + --data-urlencode "version=${release_version}" \ + --data-urlencode "product=${product}" \ + --data-urlencode "sha256=${checksum}" \ + --data-urlencode "filename=${filename}" \ + --data-urlencode "build=${build}" \ + --data-urlencode "platform=${platform}" \ + --data-urlencode "submitter=${submitter}" + fi + done + + rm -f .papertrail.headers release_draft: - command: expansions.write diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 80c7828d29..5a55ace053 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -873,34 +873,54 @@ functions: papertrail_trace: - command: shell.exec params: + env: + PAPERTRAIL_KEY_ID: ${papertrail_key_id} + PAPERTRAIL_SECRET_KEY: ${papertrail_secret_key} + EVERGREEN_TASK_ID: ${task_id} + EVERGREEN_EXECUTION: ${execution} working_dir: src shell: bash script: | set -e - set -x ls -lh dist/ if [ x"${triggered_by_git_tag}" == x"" ]; then tag=$(git describe --tags --always --dirty) else tag="${triggered_by_git_tag}" fi - echo "Setting version for papertrail to $tag, with product ${product}" - version="$(echo $tag | sed -e 's/^[vr]//')" - cat < trace-expansions.yml - release_version: "$version" - EOT - cat trace-expansions.yml - - command: expansions.update - params: - file: src/trace-expansions.yml - - command: papertrail.trace - params: - key_id: ${papertrail_key_id} - secret_key: ${papertrail_secret_key} - product: ${product} - version: ${release_version} - filenames: - - "src/dist/*" + + # Set the release publisher + submitter=$(node -p 'JSON.parse(fs.readFileSync("packages/cli-repl/package.json")).releasePublisher') + if [ -z "$submitter" ] || [ "$submitter" == "undefined" ]; then + echo "releasePublisher is not set" + exit 1 + fi + + echo "Setting version for papertrail to $tag, with product ${product} and submitter ${submitter}" + + echo "X-PAPERTRAIL-KEY-ID: ${PAPERTRAIL_KEY_ID}" > .papertrail.headers + echo "X-PAPERTRAIL-SECRET-KEY: ${PAPERTRAIL_SECRET_KEY}" >> .papertrail.headers + + + for file in src/dist/* ; do + if [ -f "$file" ]; then + filename=$(basename "$file") + checksum=$(shasum -a 256 "$file" | cut -f1 -d' ') + platform="evergreen" + build="${EVERGREEN_TASK_ID}_${EVERGREEN_EXECUTION}" + + curl -G -X POST -H @.papertrail.headers "https://papertrail.devprod-infra.prod.corp.mongodb.com/trace" \ + --data-urlencode "version=${release_version}" \ + --data-urlencode "product=${product}" \ + --data-urlencode "sha256=${checksum}" \ + --data-urlencode "filename=${filename}" \ + --data-urlencode "build=${build}" \ + --data-urlencode "platform=${platform}" \ + --data-urlencode "submitter=${submitter}" + fi + done + + rm -f .papertrail.headers release_draft: - command: expansions.write From e880d3694804e09fc0f0cd2abd8744ada6109bfb Mon Sep 17 00:00:00 2001 From: gagik Date: Tue, 14 Jan 2025 12:16:19 +0100 Subject: [PATCH 34/36] feat: update docs, remove triggers, requrie publisher, use tag-based workflow --- .evergreen.yml | 6 +- .evergreen/evergreen.yml.in | 15 +- .github/workflows/merge-release-pr.yml | 35 +++ .github/workflows/prepare-release-mongosh.yml | 2 +- .github/workflows/release-mongosh.yml | 4 +- package-lock.json | 13 - package.json | 1 - packages/build/README.md | 17 +- packages/build/package.json | 1 - packages/build/src/index.ts | 48 ++-- packages/build/src/local/index.ts | 1 - .../src/local/trigger-release-draft.spec.ts | 256 ----------------- .../build/src/local/trigger-release-draft.ts | 133 --------- .../src/local/trigger-release-publish.spec.ts | 266 ------------------ .../src/local/trigger-release-publish.ts | 93 ------ packages/build/src/local/trigger-release.ts | 23 -- packages/build/src/npm-packages/bump.ts | 9 +- packages/build/src/npm-packages/list.ts | 18 -- .../build/src/npm-packages/publish.spec.ts | 61 ++-- packages/build/src/npm-packages/publish.ts | 25 +- packages/build/src/publish-auxiliary.ts | 4 +- packages/build/src/publish-mongosh.ts | 2 +- 22 files changed, 126 insertions(+), 907 deletions(-) create mode 100644 .github/workflows/merge-release-pr.yml delete mode 100644 packages/build/src/local/index.ts delete mode 100644 packages/build/src/local/trigger-release-draft.spec.ts delete mode 100644 packages/build/src/local/trigger-release-draft.ts delete mode 100644 packages/build/src/local/trigger-release-publish.spec.ts delete mode 100644 packages/build/src/local/trigger-release-publish.ts delete mode 100644 packages/build/src/local/trigger-release.ts delete mode 100644 packages/build/src/npm-packages/list.ts diff --git a/.evergreen.yml b/.evergreen.yml index e00ff9e4c5..f4b497a209 100644 --- a/.evergreen.yml +++ b/.evergreen.yml @@ -4233,6 +4233,7 @@ functions: PAPERTRAIL_SECRET_KEY: ${papertrail_secret_key} EVERGREEN_TASK_ID: ${task_id} EVERGREEN_EXECUTION: ${execution} + EVERGREEN_AUTHOR: ${author} working_dir: src shell: bash script: | @@ -4246,9 +4247,8 @@ functions: # Set the release publisher submitter=$(node -p 'JSON.parse(fs.readFileSync("packages/cli-repl/package.json")).releasePublisher') - if [ -z "$submitter" ] || [ "$submitter" == "undefined" ]; then - echo "releasePublisher is not set" - exit 1 + if [ -z "$submitter" ] || [ "$submitter" == "undefined" ] || [ "$submitter" == "null" ]; then + submitter="${EVERGREEN_AUTHOR}" fi echo "Setting version for papertrail to $tag, with product ${product} and submitter ${submitter}" diff --git a/.evergreen/evergreen.yml.in b/.evergreen/evergreen.yml.in index 5a55ace053..27dcda544e 100644 --- a/.evergreen/evergreen.yml.in +++ b/.evergreen/evergreen.yml.in @@ -878,10 +878,15 @@ functions: PAPERTRAIL_SECRET_KEY: ${papertrail_secret_key} EVERGREEN_TASK_ID: ${task_id} EVERGREEN_EXECUTION: ${execution} + EVERGREEN_AUTHOR: ${author} working_dir: src shell: bash script: | set -e + echo "X-PAPERTRAIL-KEY-ID: ${PAPERTRAIL_KEY_ID}" > .papertrail.headers + echo "X-PAPERTRAIL-SECRET-KEY: ${PAPERTRAIL_SECRET_KEY}" >> .papertrail.headers + + set -x ls -lh dist/ if [ x"${triggered_by_git_tag}" == x"" ]; then tag=$(git describe --tags --always --dirty) @@ -891,16 +896,12 @@ functions: # Set the release publisher submitter=$(node -p 'JSON.parse(fs.readFileSync("packages/cli-repl/package.json")).releasePublisher') - if [ -z "$submitter" ] || [ "$submitter" == "undefined" ]; then - echo "releasePublisher is not set" - exit 1 + if [ -z "$submitter" ] || [ "$submitter" == "undefined" ] || [ "$submitter" == "null" ]; then + echo "Using evergreen author as submitter" + submitter="${EVERGREEN_AUTHOR}" fi echo "Setting version for papertrail to $tag, with product ${product} and submitter ${submitter}" - - echo "X-PAPERTRAIL-KEY-ID: ${PAPERTRAIL_KEY_ID}" > .papertrail.headers - echo "X-PAPERTRAIL-SECRET-KEY: ${PAPERTRAIL_SECRET_KEY}" >> .papertrail.headers - for file in src/dist/* ; do if [ -f "$file" ]; then diff --git a/.github/workflows/merge-release-pr.yml b/.github/workflows/merge-release-pr.yml new file mode 100644 index 0000000000..8a4edc7041 --- /dev/null +++ b/.github/workflows/merge-release-pr.yml @@ -0,0 +1,35 @@ +name: Merge mongosh Release PR + +on: + push: + tags: + - 'v*' + +jobs: + prepare-release: + runs-on: ubuntu-latest + steps: + - uses: mongodb-js/devtools-shared/actions/setup-bot-token@main + id: app-token + with: + app-id: ${{ vars.DEVTOOLS_BOT_APP_ID }} + private-key: ${{ secrets.DEVTOOLS_BOT_PRIVATE_KEY }} + + - uses: actions/checkout@v4 + with: + # don't checkout a detatched HEAD + ref: ${{ github.head_ref }} + + # this is important so git log can pick up on + # the whole history to generate the list of AUTHORS + fetch-depth: "0" + token: ${{ steps.app-token.outputs.token }} + + + - name: Merge Pull Request + shell: bash + env: + MONGOSH_RELEASE_VERSION: ${{ env.NEXT_VERSION }} + GH_TOKEN: ${{ steps.app-token.outputs.token }} + run: | + gh pr merge release/${{ github.ref_name }} --squash \ No newline at end of file diff --git a/.github/workflows/prepare-release-mongosh.yml b/.github/workflows/prepare-release-mongosh.yml index a197e3fae3..f5c5ca3e89 100644 --- a/.github/workflows/prepare-release-mongosh.yml +++ b/.github/workflows/prepare-release-mongosh.yml @@ -104,7 +104,7 @@ jobs: with: token: ${{ steps.app-token.outputs.token }} commit-message: "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" - branch: release/${NEXT_VERSION} + branch: release/${RELEASE_TAG} title: "chore(release): prepare for mongosh v${NEXT_VERSION} ${{ github.event.inputs.jiraTicket }}" body: | - [${{ github.event.inputs.jiraTicket }}](https://jira.mongodb.org/browse/${{ github.event.inputs.jiraTicket }}) diff --git a/.github/workflows/release-mongosh.yml b/.github/workflows/release-mongosh.yml index 35b533da43..d11b2052a2 100644 --- a/.github/workflows/release-mongosh.yml +++ b/.github/workflows/release-mongosh.yml @@ -52,12 +52,10 @@ jobs: exit 1 fi - - name: "Publish what is not already in NPM" + - name: "Trigger mongosh publish" env: NPM_TOKEN: ${{ secrets.DEVTOOLSBOT_NPM_TOKEN }} MONGOSH_RELEASE_PUBLISHER: ${{ github.triggering_actor }} run: | echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" >> ~/.npmrc - npm config list - echo "Publishing packages as $(npm whoami)" npm run publish diff --git a/package-lock.json b/package-lock.json index 65f1825f9a..098d799730 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29232,19 +29232,6 @@ "node": ">=14.15.1" } }, - "packages/browser-runtime-core/node_modules/@mongosh/types": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/@mongosh/types/-/types-2.3.8.tgz", - "integrity": "sha512-WFx/SPMWwQIcCeSBlYiIEbVg3YEYKo6Dr+IKVBpUw6Vr82CGQ1zZXRChIhdhu/H7jo3O+kdeGOPIftn0kvYmLA==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "@mongodb-js/devtools-connect": "^3.3.4" - }, - "engines": { - "node": ">=14.15.1" - } - }, "packages/browser-runtime-electron": { "name": "@mongosh/browser-runtime-electron", "version": "3.0.0", diff --git a/package.json b/package.json index ea58691bfc..2fd326fa01 100644 --- a/package.json +++ b/package.json @@ -38,7 +38,6 @@ "compile-exec": "npm run evergreen-release compile", "compile-all": "npm run compile-compass && npm run compile-exec", "evergreen-release": "cd packages/build && npm run evergreen-release --", - "release": "cd packages/build && npm run release --", "report-missing-help": "npm run report-missing-help --workspace @mongosh/shell-api", "report-supported-api": "npm run report-supported-api --workspace @mongosh/shell-api", "post-process-nyc": "ts-node scripts/nyc/post-process-nyc-output.ts", diff --git a/packages/build/README.md b/packages/build/README.md index b39ea1e583..3a7d9e6df5 100644 --- a/packages/build/README.md +++ b/packages/build/README.md @@ -25,20 +25,11 @@ Execute the following steps to publish a new release: 1. Ensure there is a Jira _Release_ ticket in the [`MONGOSH` project](https://jira.mongodb.org/projects/MONGOSH) for the new release and move it to _In Progress_. 2. Verify that the Jira tickets you expect to be released are correctly mapped to the _Release_ ticket. Add any additional required documentation to the release ticket. -3. Trigger the draft release by running: - ``` - npm run release draft - ``` - Follow the instructions and ensure that the new draft tag to be created matches the expected release version. -4. Wait for Evergreen to finish the build and complete the draft stage.\ - _Repeat step 3 if there are any additional changes that need to be part of the release._ +3. Trigger the draft release by triggering the `Prepare mongosh Release` workflow. Set the release Jira ticket and ensure that the new draft tag that gets created matches the expected release version. +4. Wait for the workflow to create a PR for the release and ensure the changed files are correct. **Do not merge the PR!** 5. Sync main branch of the [mongodb-js/homebrew-core](https://github.com/mongodb-js/homebrew-core/) repository with the upstream. -6. Trigger the publication of the release by running: - ``` - npm run release publish - ``` - Follow the instructions and verify the inferred release version is correct. -7. Wait for Evergreen to finish the publication stage. +6. Trigger the `Release mongosh` workflow on the newly created `release/X.Y.Z` branch. This will start the release process and will automatically merge the PR once it is complete. +7. Wait for Evergreen to finish the publication stage and automatically merge the PR. 8. Close the Jira ticket for the release, post an update in the `#mongosh` Slack channel and ping the docs team. ### Branches and Tags diff --git a/packages/build/package.json b/packages/build/package.json index 4c10274093..d9ee536046 100644 --- a/packages/build/package.json +++ b/packages/build/package.json @@ -24,7 +24,6 @@ "check": "npm run lint && npm run depcheck", "depcheck": "depcheck", "evergreen-release": "ts-node -r ../../scripts/import-expansions.js src/index.ts", - "release": "ts-node src/index.ts trigger-release", "prettier": "prettier", "bump": "ts-node src/index.ts bump", "publish": "ts-node src/index.ts publish", diff --git a/packages/build/src/index.ts b/packages/build/src/index.ts index 665e90d946..d8827cb27c 100644 --- a/packages/build/src/index.ts +++ b/packages/build/src/index.ts @@ -2,14 +2,13 @@ import path from 'path'; import { validatePackageVariant } from './config'; import { downloadMongoDb } from '@mongodb-js/mongodb-downloader'; import { getArtifactUrl } from './evergreen'; -import { triggerRelease } from './local'; import type { ReleaseCommand } from './release'; import { release } from './release'; import type { Config, PackageVariant } from './config'; export { getArtifactUrl, downloadMongoDb }; -const validCommands: (ReleaseCommand | 'trigger-release')[] = [ +const validCommands: ReleaseCommand[] = [ 'bump', 'compile', 'package', @@ -19,12 +18,9 @@ const validCommands: (ReleaseCommand | 'trigger-release')[] = [ 'sign', 'download-crypt-shared-library', 'download-and-list-artifacts', - 'trigger-release', ] as const; -const isValidCommand = ( - cmd: string -): cmd is ReleaseCommand | 'trigger-release' => +const isValidCommand = (cmd: string): cmd is ReleaseCommand => (validCommands as string[]).includes(cmd); if (require.main === module) { @@ -38,31 +34,27 @@ if (require.main === module) { ); } - if (command === 'trigger-release') { - await triggerRelease(process.argv.slice(3)); - } else { - const config: Config = require(path.join( - __dirname, - '..', - '..', - '..', - 'config', - 'build.conf.js' - )); + const config: Config = require(path.join( + __dirname, + '..', + '..', + '..', + 'config', + 'build.conf.js' + )); - const cliBuildVariant = process.argv - .map((arg) => /^--build-variant=(.+)$/.exec(arg)) - .filter(Boolean)[0]; - if (cliBuildVariant) { - config.packageVariant = cliBuildVariant[1] as PackageVariant; - validatePackageVariant(config.packageVariant); - } + const cliBuildVariant = process.argv + .map((arg) => /^--build-variant=(.+)$/.exec(arg)) + .filter(Boolean)[0]; + if (cliBuildVariant) { + config.packageVariant = cliBuildVariant[1] as PackageVariant; + validatePackageVariant(config.packageVariant); + } - config.isDryRun ||= process.argv.includes('--dry-run'); - config.useAuxiliaryPackagesOnly ||= process.argv.includes('--auxiliary'); + config.isDryRun ||= process.argv.includes('--dry-run'); + config.useAuxiliaryPackagesOnly ||= process.argv.includes('--auxiliary'); - await release(command, config); - } + await release(command, config); })().then( () => process.exit(0), (err) => diff --git a/packages/build/src/local/index.ts b/packages/build/src/local/index.ts deleted file mode 100644 index bc1ec38cd6..0000000000 --- a/packages/build/src/local/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './trigger-release'; diff --git a/packages/build/src/local/trigger-release-draft.spec.ts b/packages/build/src/local/trigger-release-draft.spec.ts deleted file mode 100644 index ca4e109100..0000000000 --- a/packages/build/src/local/trigger-release-draft.spec.ts +++ /dev/null @@ -1,256 +0,0 @@ -import { expect } from 'chai'; -import sinon from 'sinon'; -import type { RepositoryStatus, TagDetails, TaggedCommit } from '../git'; -import { - computeNextTagNameFn, - triggerReleaseDraft, -} from './trigger-release-draft'; - -describe('local trigger-release-draft', function () { - describe('triggerReleaseDraft', function () { - let verifyGitStatus: sinon.SinonStub; - let getLatestDraftOrReleaseTagFromLog: sinon.SinonStub; - let choose: sinon.SinonStub; - let confirm: sinon.SinonStub; - let spawnSync: sinon.SinonStub; - - const cleanRepoStatus: RepositoryStatus = { - branch: { - local: 'main', - tracking: 'origin/main', - diverged: false, - }, - clean: true, - hasUnpushedTags: false, - }; - - beforeEach(function () { - verifyGitStatus = sinon.stub().returns(cleanRepoStatus); - getLatestDraftOrReleaseTagFromLog = sinon.stub(); - choose = sinon.stub(); - confirm = sinon.stub(); - spawnSync = sinon.stub(); - }); - - it('creates a new draft and pushes when everything is good', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: 7, - releaseVersion: '0.8.0', - semverName: '0.8.0-draft.7', - }, - }; - - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - confirm.resolves(true); - - await triggerReleaseDraft( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - choose, - confirm, - spawnSync - ); - - expect(verifyGitStatus).to.have.been.called; - expect(choose).to.not.have.been.called; - expect(confirm).to.have.been.called; - expect(spawnSync).to.have.been.calledTwice; - expect(spawnSync.getCall(0)).calledWith( - 'git', - ['tag', 'v0.8.0-draft.8'], - sinon.match.any - ); - expect(spawnSync.getCall(1)).calledWith( - 'git', - ['push', 'origin', 'v0.8.0-draft.8'], - sinon.match.any - ); - }); - - it('asks for the bump type and pushes a new draft if previous tag was a release on main', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: undefined, - releaseVersion: '0.8.0', - semverName: '0.8.0', - }, - }; - - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - choose.resolves('minor'); - confirm.resolves(true); - - await triggerReleaseDraft( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - choose, - confirm, - spawnSync - ); - - expect(verifyGitStatus).to.have.been.called; - expect(choose).to.have.been.called; - expect(confirm).to.have.been.called; - expect(spawnSync).to.have.been.calledTwice; - expect(spawnSync.getCall(0)).calledWith( - 'git', - ['tag', 'v0.9.0-draft.0'], - sinon.match.any - ); - expect(spawnSync.getCall(1)).calledWith( - 'git', - ['push', 'origin', 'v0.9.0-draft.0'], - sinon.match.any - ); - }); - - it('automatically does a patch when on a release branch (for a support release)', async function () { - const repoStatus: RepositoryStatus = { - branch: { - local: 'release/v0.8.2', - tracking: 'origin/release/v0.8.2', - diverged: false, - }, - clean: true, - hasUnpushedTags: false, - }; - - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: undefined, - releaseVersion: '0.8.2', - semverName: '0.8.2', - }, - }; - - verifyGitStatus.returns(repoStatus); - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - confirm.resolves(true); - - await triggerReleaseDraft( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - choose, - confirm, - spawnSync - ); - - expect(verifyGitStatus).to.have.been.called; - expect(confirm).to.have.been.calledTwice; - expect(spawnSync).to.have.been.calledTwice; - expect(spawnSync.getCall(0)).calledWith( - 'git', - ['tag', 'v0.8.3-draft.0'], - sinon.match.any - ); - expect(spawnSync.getCall(1)).calledWith( - 'git', - ['push', 'origin', 'v0.8.3-draft.0'], - sinon.match.any - ); - }); - - it('fails if no previous tag is found', async function () { - getLatestDraftOrReleaseTagFromLog.returns(undefined); - try { - await triggerReleaseDraft( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - choose, - confirm, - spawnSync - ); - } catch (e: any) { - expect(e.message).to.contain( - 'Could not find a previous draft or release tag.' - ); - expect(verifyGitStatus).to.have.been.called; - expect(choose).to.not.have.been.called; - expect(confirm).to.not.have.been.called; - expect(spawnSync).to.not.have.been.called; - return; - } - expect.fail('Expected error'); - }); - - it('aborts if user does not confirm', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: 7, - releaseVersion: '0.8.0', - semverName: '0.8.0-draft.7', - }, - }; - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - confirm.onFirstCall().resolves(true); - confirm.onSecondCall().resolves(false); - - try { - await triggerReleaseDraft( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - choose, - confirm, - spawnSync - ); - } catch (e: any) { - expect(e.message).to.contain('User aborted'); - expect(verifyGitStatus).to.have.been.called; - expect(choose).to.not.have.been.called; - expect(confirm).to.have.been.called; - expect(spawnSync).to.not.have.been.called; - return; - } - expect.fail('Expected error'); - }); - }); - - describe('computeNextTagName', function () { - const draftTag: TagDetails = { - semverName: '0.8.0-draft.8', - draftVersion: 8, - releaseVersion: '0.8.0', - }; - const releaseTag: TagDetails = { - semverName: '0.8.0', - draftVersion: undefined, - releaseVersion: '0.8.0', - }; - - it('computes the next draft bump', function () { - const result = computeNextTagNameFn(draftTag, 'draft'); - expect(result).to.equal('v0.8.0-draft.9'); - }); - it('computes the next patch bump', function () { - const result = computeNextTagNameFn(releaseTag, 'patch'); - expect(result).to.equal('v0.8.1-draft.0'); - }); - it('computes the next minor bump', function () { - const result = computeNextTagNameFn(releaseTag, 'minor'); - expect(result).to.equal('v0.9.0-draft.0'); - }); - it('computes the next major bump', function () { - const result = computeNextTagNameFn(releaseTag, 'major'); - expect(result).to.equal('v1.0.0-draft.0'); - }); - it('fails on unknown bump type', function () { - try { - computeNextTagNameFn(releaseTag, 'what' as any); - } catch (e: any) { - expect(e.message).to.contain('unexpected bump type'); - return; - } - expect.fail('Expected error'); - }); - }); -}); diff --git a/packages/build/src/local/trigger-release-draft.ts b/packages/build/src/local/trigger-release-draft.ts deleted file mode 100644 index 87c02f9ead..0000000000 --- a/packages/build/src/local/trigger-release-draft.ts +++ /dev/null @@ -1,133 +0,0 @@ -import assert from 'assert'; -import semver from 'semver'; -import type { TagDetails } from '../git'; -import { - getLatestDraftOrReleaseTagFromLog as getLatestDraftOrReleaseTagFromLogFn, - getReleaseVersionFromBranch, - verifyGitStatus as verifyGitStatusFn, -} from '../git'; -import { - choose as chooseFn, - confirm as confirmFn, - spawnSync as spawnSyncFn, -} from '../helpers'; - -type BumpType = 'draft' | 'patch' | 'minor' | 'major'; - -export async function triggerReleaseDraft( - repositoryRoot: string, - verifyGitStatus: typeof verifyGitStatusFn = verifyGitStatusFn, - getLatestDraftOrReleaseTagFromLog: typeof getLatestDraftOrReleaseTagFromLogFn = getLatestDraftOrReleaseTagFromLogFn, - choose: typeof chooseFn = chooseFn, - confirm: typeof confirmFn = confirmFn, - spawnSync: typeof spawnSyncFn = spawnSyncFn -): Promise { - console.info('Triggering process to create a new release draft...'); - - const repositoryStatus = verifyGitStatus(repositoryRoot); - const branchReleaseVersion = getReleaseVersionFromBranch( - repositoryStatus.branch?.local - ); - - const latestDraftOrReleaseTag = getLatestDraftOrReleaseTagFromLog( - repositoryRoot, - branchReleaseVersion - ); - if (!latestDraftOrReleaseTag) { - throw new Error('Could not find a previous draft or release tag.'); - } - console.info( - `-> Most recent tag: v${latestDraftOrReleaseTag.tag.semverName} on commit ${latestDraftOrReleaseTag.commit}` - ); - - let bumpType: BumpType | undefined = undefined; - if ( - branchReleaseVersion && - latestDraftOrReleaseTag.tag.draftVersion === undefined - ) { - console.info( - '-> You are on a release branch, last tag was a release - assuming patch...' - ); - bumpType = 'patch'; - } else if (latestDraftOrReleaseTag.tag.draftVersion !== undefined) { - console.info('-> Last tag was a draft - assuming another draft...'); - bumpType = 'draft'; - } - - let confirmInferred = false; - if (bumpType) { - confirmInferred = await confirm( - `-> Is it okay to continue with tag type ${bumpType}?`, - true - ); - } - - if (!bumpType || !confirmInferred) { - bumpType = (await choose( - '> Select the type of increment for the new version', - ['patch', 'minor', 'major'], - '... enter your choice:' - )) as BumpType; - } - - const nextTagName = computeNextTagNameFn( - latestDraftOrReleaseTag.tag, - bumpType - ); - console.info('-> New draft tag is:'); - console.info(` ${nextTagName}`); - - const confirmed = await confirm( - '!! Is this correct and should the draft process continue?' - ); - if (!confirmed) { - throw new Error('User aborted.'); - } - - console.info('... creating and pushing tag ...'); - spawnSync('git', ['tag', nextTagName], { - cwd: repositoryRoot, - encoding: 'utf-8', - }); - spawnSync('git', ['push', 'origin', nextTagName], { - cwd: repositoryRoot, - encoding: 'utf-8', - }); - - console.info('SUCCESS! Your new draft has been tagged and pushed.'); -} - -export function computeNextTagNameFn( - latestDraftOrReleaseTag: TagDetails, - bumpType: BumpType -): string { - if (bumpType === 'draft') { - assert(latestDraftOrReleaseTag.draftVersion !== undefined); - return `v${latestDraftOrReleaseTag.releaseVersion}-draft.${ - latestDraftOrReleaseTag.draftVersion + 1 - }`; - } - - let major = semver.major(latestDraftOrReleaseTag.releaseVersion); - let minor = semver.minor(latestDraftOrReleaseTag.releaseVersion); - let patch = semver.patch(latestDraftOrReleaseTag.releaseVersion); - - switch (bumpType) { - case 'patch': - patch += 1; - break; - case 'minor': - patch = 0; - minor += 1; - break; - case 'major': - patch = 0; - minor = 0; - major += 1; - break; - default: - throw new Error(`unexpected bump type ${bumpType}`); - } - - return `v${major}.${minor}.${patch}-draft.0`; -} diff --git a/packages/build/src/local/trigger-release-publish.spec.ts b/packages/build/src/local/trigger-release-publish.spec.ts deleted file mode 100644 index 7b63f9d423..0000000000 --- a/packages/build/src/local/trigger-release-publish.spec.ts +++ /dev/null @@ -1,266 +0,0 @@ -import { expect } from 'chai'; -import sinon from 'sinon'; -import type { EvergreenApi, EvergreenTask } from '../evergreen'; -import type { TaggedCommit } from '../git'; -import { - triggerReleasePublish, - verifyEvergreenStatusFn, -} from './trigger-release-publish'; - -describe('local trigger-release-publish', function () { - describe('triggerReleasePublish', function () { - let verifyGitStatus: sinon.SinonStub; - let getLatestDraftOrReleaseTagFromLog: sinon.SinonStub; - let confirm: sinon.SinonStub; - let verifyEvergreenStatus: sinon.SinonStub; - let spawnSync: sinon.SinonStub; - - beforeEach(function () { - verifyGitStatus = sinon.stub(); - getLatestDraftOrReleaseTagFromLog = sinon.stub(); - confirm = sinon.stub(); - verifyEvergreenStatus = sinon.stub(); - spawnSync = sinon.stub(); - }); - - it('creates a new release tag and pushes when everything is good', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: 7, - releaseVersion: '0.8.0', - semverName: '0.8.0-draft.7', - }, - }; - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - confirm.resolves(true); - - await triggerReleasePublish( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - confirm, - verifyEvergreenStatus, - spawnSync - ); - - expect(verifyGitStatus).to.have.been.called; - expect(confirm).to.have.been.called; - expect(verifyEvergreenStatus).to.have.been.called; - expect(spawnSync).to.have.been.calledTwice; - expect(spawnSync.getCall(0)).calledWith( - 'git', - ['tag', 'v0.8.0', 'hash'], - sinon.match.any - ); - expect(spawnSync.getCall(1)).calledWith( - 'git', - ['push', 'origin', 'v0.8.0'], - sinon.match.any - ); - }); - - it('fails if no previous tag is found', async function () { - getLatestDraftOrReleaseTagFromLog.returns(undefined); - try { - await triggerReleasePublish( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - confirm, - verifyEvergreenStatus, - spawnSync - ); - } catch (e: any) { - expect(e.message).to.contain( - 'Failed to find a prior tag to release from' - ); - expect(verifyGitStatus).to.have.been.called; - expect(confirm).to.not.have.been.called; - expect(verifyEvergreenStatus).to.not.have.been.called; - expect(spawnSync).to.not.have.been.called; - return; - } - expect.fail('Expected error'); - }); - - it('fails if the previous tag is not a draft', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: undefined, - releaseVersion: '0.8.0', - semverName: '0.8.0', - }, - }; - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - - try { - await triggerReleasePublish( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - confirm, - verifyEvergreenStatus, - spawnSync - ); - } catch (e: any) { - expect(e.message).to.contain("but it's not a draft"); - expect(verifyGitStatus).to.have.been.called; - expect(confirm).to.not.have.been.called; - expect(verifyEvergreenStatus).to.not.have.been.called; - expect(spawnSync).to.not.have.been.called; - return; - } - expect.fail('Expected error'); - }); - - it('fails if evergreen check fails', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: 7, - releaseVersion: '0.8.0', - semverName: '0.8.0-draft.7', - }, - }; - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - confirm.resolves(true); - const expectedError = new Error('that failed'); - verifyEvergreenStatus.rejects(expectedError); - - try { - await triggerReleasePublish( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - confirm, - verifyEvergreenStatus, - spawnSync - ); - } catch (e: any) { - expect(e).to.equal(expectedError); - expect(verifyGitStatus).to.have.been.called; - expect(confirm).to.have.been.called; - expect(spawnSync).to.not.have.been.called; - return; - } - expect.fail('Expected error'); - }); - - it('aborts if user does not confirm', async function () { - const latestTag: TaggedCommit = { - commit: 'hash', - tag: { - draftVersion: 7, - releaseVersion: '0.8.0', - semverName: '0.8.0-draft.7', - }, - }; - getLatestDraftOrReleaseTagFromLog.returns(latestTag); - confirm.resolves(false); - - try { - await triggerReleasePublish( - 'root', - verifyGitStatus, - getLatestDraftOrReleaseTagFromLog, - confirm, - verifyEvergreenStatus, - spawnSync - ); - } catch (e: any) { - expect(e.message).to.contain('User aborted'); - expect(verifyGitStatus).to.have.been.called; - expect(confirm).to.have.been.called; - expect(spawnSync).to.not.have.been.called; - return; - } - expect.fail('Expected error'); - }); - }); - - describe('verifyEvergreenStatus', function () { - let evergreenProvider: Promise; - let getTasks: sinon.SinonStub; - - const exampleTag: TaggedCommit = { - commit: 'sha', - tag: { - draftVersion: 5, - releaseVersion: '0.8.2', - semverName: '0.8.2-draft.5', - }, - }; - - const failedTask: EvergreenTask = { - task_id: 'task1', - version_id: 'v1', - build_variant: 'windows', - display_name: 'Task 1', - status: 'failed', - }; - const successTask: EvergreenTask = { - task_id: 'task2', - version_id: 'v2', - build_variant: 'windows', - display_name: 'Task 2', - status: 'success', - }; - - beforeEach(function () { - getTasks = sinon.stub(); - evergreenProvider = Promise.resolve({ - getTasks, - } as unknown as EvergreenApi); - }); - - it('works if all tasks are successful', async function () { - getTasks.resolves([successTask]); - await verifyEvergreenStatusFn(exampleTag, evergreenProvider); - expect(getTasks).to.have.been.calledWith( - 'mongosh', - 'sha', - 'v0.8.2-draft.5' - ); - }); - - it('fails if evergreen fails', async function () { - const expectedError = new Error('failed'); - getTasks.rejects(expectedError); - try { - await verifyEvergreenStatusFn(exampleTag, evergreenProvider); - } catch (e: any) { - expect(e).to.equal(expectedError); - return; - } - expect.fail('Expected error'); - }); - - it('fails if there are failed tasks and user cancels', async function () { - getTasks.resolves([successTask, failedTask]); - const confirm = sinon.stub().resolves(false); - try { - await verifyEvergreenStatusFn(exampleTag, evergreenProvider, confirm); - } catch (e: any) { - expect(e.message).to.contain( - 'Some Evergreen tasks were not successful' - ); - expect(getTasks).to.have.been.calledWith( - 'mongosh', - 'sha', - 'v0.8.2-draft.5' - ); - return; - } - expect.fail('Expected error'); - }); - - it('continues if there are failed tasks but user acknowledges', async function () { - getTasks.resolves([successTask, failedTask]); - const confirm = sinon.stub().resolves(true); - await verifyEvergreenStatusFn(exampleTag, evergreenProvider, confirm); - expect(confirm).to.have.been.called; - }); - }); -}); diff --git a/packages/build/src/local/trigger-release-publish.ts b/packages/build/src/local/trigger-release-publish.ts deleted file mode 100644 index 90dd06a94b..0000000000 --- a/packages/build/src/local/trigger-release-publish.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { EvergreenApi } from '../evergreen'; -import type { TaggedCommit } from '../git'; -import { - getLatestDraftOrReleaseTagFromLog as getLatestDraftOrReleaseTagFromLogFn, - verifyGitStatus as verifyGitStatusFn, -} from '../git'; -import { confirm as confirmFn, spawnSync as spawnSyncFn } from '../helpers'; - -export async function triggerReleasePublish( - repositoryRoot: string, - verifyGitStatus: typeof verifyGitStatusFn = verifyGitStatusFn, - getLatestDraftOrReleaseTagFromLog: typeof getLatestDraftOrReleaseTagFromLogFn = getLatestDraftOrReleaseTagFromLogFn, - confirm: typeof confirmFn = confirmFn, - verifyEvergreenStatus: typeof verifyEvergreenStatusFn = verifyEvergreenStatusFn, - spawnSync: typeof spawnSyncFn = spawnSyncFn -): Promise { - console.info('Triggering process to publish a new release...'); - - verifyGitStatus(repositoryRoot); - - const latestDraftTag = getLatestDraftOrReleaseTagFromLog( - repositoryRoot, - undefined - ); - if (!latestDraftTag) { - throw new Error('Failed to find a prior tag to release from.'); - } - if (latestDraftTag.tag.draftVersion === undefined) { - throw new Error( - `Found prior tag v${latestDraftTag.tag.semverName} - but it's not a draft.` - ); - } - const releaseTag = `v${latestDraftTag.tag.releaseVersion}`; - - console.info('-> Found most recent draft tag:'); - console.info(` version: v${latestDraftTag.tag.semverName}`); - console.info(` commit: ${latestDraftTag.commit}`); - console.info(` release: ${releaseTag}`); - const confirmed = await confirm( - `!! Is this correct and should we tag ${latestDraftTag.commit} as ${releaseTag}?` - ); - if (!confirmed) { - throw new Error('User aborted.'); - } - - console.info('... verifying evergreen status ...'); - await verifyEvergreenStatus(latestDraftTag); - - console.info('... tagging commit and pushing ...'); - spawnSync('git', ['tag', releaseTag, latestDraftTag.commit], { - cwd: repositoryRoot, - encoding: 'utf-8', - }); - spawnSync('git', ['push', 'origin', releaseTag], { - cwd: repositoryRoot, - encoding: 'utf-8', - }); - - console.info('SUCCESS! Your new release has been tagged and published.'); -} - -export async function verifyEvergreenStatusFn( - latestDraftTag: TaggedCommit, - evergreenApiProvider: Promise = EvergreenApi.fromUserConfiguration(), - confirm: typeof confirmFn = confirmFn -): Promise { - const evergreenApi = await evergreenApiProvider; - const tasks = await evergreenApi.getTasks( - 'mongosh', - latestDraftTag.commit, - `v${latestDraftTag.tag.semverName}` - ); - const unsuccessfulTasks = tasks.filter((t) => t.status !== 'success'); - - if (!unsuccessfulTasks.length) { - return; - } - - console.error('!! Detected the following not successful tasks on Evergreen:'); - unsuccessfulTasks.forEach((t) => { - console.error(` > ${t.display_name} on ${t.build_variant}`); - }); - - const stillContinue = await confirm( - '!! Do you want to continue and still release despite non-successful tasks?' - ); - if (!stillContinue) { - console.error( - '!! Please trigger a new draft and ensure all tasks complete successfully.' - ); - throw new Error('Some Evergreen tasks were not successful.'); - } -} diff --git a/packages/build/src/local/trigger-release.ts b/packages/build/src/local/trigger-release.ts deleted file mode 100644 index fb6f2c9685..0000000000 --- a/packages/build/src/local/trigger-release.ts +++ /dev/null @@ -1,23 +0,0 @@ -import path from 'path'; -import { triggerReleaseDraft } from './trigger-release-draft'; -import { triggerReleasePublish } from './trigger-release-publish'; - -export async function triggerRelease(args: string[]): Promise { - if (args.length < 1) { - throw new Error('Missing command to trigger release: draft/publish'); - } - - const repositoryRoot = path.resolve(__dirname, '..', '..', '..', '..'); - - const command = args[0]; - switch (command) { - case 'draft': - await triggerReleaseDraft(repositoryRoot); - break; - case 'publish': - await triggerReleasePublish(repositoryRoot); - break; - default: - throw new Error(`Unknown command ${command} - must be draft or publish`); - } -} diff --git a/packages/build/src/npm-packages/bump.ts b/packages/build/src/npm-packages/bump.ts index a418c171e1..c792940208 100644 --- a/packages/build/src/npm-packages/bump.ts +++ b/packages/build/src/npm-packages/bump.ts @@ -23,13 +23,6 @@ export async function bumpMongoshReleasePackages(): Promise { const packages = await getPackagesInTopologicalOrder(PROJECT_ROOT); const packageConfigurations = await getPackageConfigurations(packages); - const mongoshReleasePackages = packages.filter((packageInfo) => - MONGOSH_RELEASE_PACKAGES.includes(packageInfo.name) - ); - const workspaceNames = mongoshReleasePackages.map( - (packageInfo) => packageInfo.name - ); - for (const [packageJsonPath, packageJson] of packageConfigurations) { packageJson.version = version; @@ -44,7 +37,7 @@ export async function bumpMongoshReleasePackages(): Promise { } for (const name of Object.keys(packageJson[grouping])) { - if (!workspaceNames.includes(name)) { + if (!MONGOSH_RELEASE_PACKAGES.includes(name)) { continue; } packageJson[grouping][name] = version; diff --git a/packages/build/src/npm-packages/list.ts b/packages/build/src/npm-packages/list.ts deleted file mode 100644 index 1b4b896b6b..0000000000 --- a/packages/build/src/npm-packages/list.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { LERNA_BIN, PROJECT_ROOT } from './constants'; -import { spawnSync } from '../helpers/spawn-sync'; - -export interface LernaPackageDescription { - name: string; - version: string; - private: boolean; - location: string; -} - -export function listNpmPackages(): LernaPackageDescription[] { - const lernaListOutput = spawnSync(LERNA_BIN, ['list', '--json', '--all'], { - cwd: PROJECT_ROOT, - encoding: 'utf8', - }); - - return JSON.parse(lernaListOutput.stdout); -} diff --git a/packages/build/src/npm-packages/publish.spec.ts b/packages/build/src/npm-packages/publish.spec.ts index 24647f5c97..f1426cacb2 100644 --- a/packages/build/src/npm-packages/publish.spec.ts +++ b/packages/build/src/npm-packages/publish.spec.ts @@ -2,10 +2,12 @@ import { expect } from 'chai'; import path from 'path'; import type { SinonStub } from 'sinon'; import sinon from 'sinon'; -import { publishToNpm } from './publish'; +import { publishToNpm, setReleasePublisher } from './publish'; +import { promises as fs } from 'fs'; +import type { PackageInfo } from '@mongodb-js/monorepo-tools'; describe('npm-packages publishToNpm', function () { - let listNpmPackages: SinonStub; + let getPackagesInTopologicalOrder: SinonStub; let markBumpedFilesAsAssumeUnchanged: SinonStub; let spawnSync: SinonStub; const lernaBin = path.resolve( @@ -18,19 +20,23 @@ describe('npm-packages publishToNpm', function () { '.bin', 'lerna' ); + const packages = [ + { name: 'packageA', version: '0.7.0', location: '/packages/packageA' }, + { name: 'mongosh', version: '1.2.0', location: '/packages/mongosh' }, + ]; beforeEach(function () { getPackagesInTopologicalOrder = sinon.stub(); markBumpedFilesAsAssumeUnchanged = sinon.stub(); spawnSync = sinon.stub(); + process.env.MONGOSH_RELEASE_PUBLISHER = 'test-publisher'; }); it('throws if mongosh is not existent when publishing all', async function () { const packages = [{ name: 'packageA', version: '0.7.0' }]; getPackagesInTopologicalOrder.resolves(packages); - - expect(() => - publishToNpm( + try { + await publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, @@ -42,14 +48,28 @@ describe('npm-packages publishToNpm', function () { } }); + it('throws if publisher is not set when publishing all', async function () { + getPackagesInTopologicalOrder.resolves(packages); + + try { + await publishToNpm( + { isDryRun: false, useAuxiliaryPackagesOnly: false }, + getPackagesInTopologicalOrder, + markBumpedFilesAsAssumeUnchanged, + spawnSync + ); + expect.fail('should throw'); + } catch (error) { + expect((error as Error).message).equals( + 'MONGOSH_RELEASE_PUBLISHER is required for publishing mongosh' + ); + } + }); + it('takes mongosh version and pushes tags', async function () { - const packages = [ - { name: 'packageA', version: '0.7.0' }, - { name: 'mongosh', version: '1.2.0' }, - ]; getPackagesInTopologicalOrder.resolves(packages); - publishToNpm( + await publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, @@ -61,13 +81,9 @@ describe('npm-packages publishToNpm', function () { }); it('does not manually push tags with auxiliary packages', async function () { - const packages = [ - { name: 'packageA', version: '0.7.0' }, - { name: 'mongosh', version: '1.2.0' }, - ]; getPackagesInTopologicalOrder.resolves(packages); - publishToNpm( + await publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: true }, getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, @@ -85,13 +101,9 @@ describe('npm-packages publishToNpm', function () { }); it('calls lerna to publish packages for a real version', async function () { - const packages = [ - { name: 'packageA', version: '0.7.0' }, - { name: 'mongosh', version: '1.2.0' }, - ]; getPackagesInTopologicalOrder.resolves(packages); - publishToNpm( + await publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, @@ -122,12 +134,11 @@ describe('npm-packages publishToNpm', function () { }); it('reverts the assume unchanged even on spawn failure', async function () { - const packages = [{ name: 'packageA', version: '0.7.0' }]; getPackagesInTopologicalOrder.resolves(packages); spawnSync.throws(new Error('meeep')); try { - publishToNpm( + await publishToNpm( { isDryRun: false, useAuxiliaryPackagesOnly: false }, getPackagesInTopologicalOrder, markBumpedFilesAsAssumeUnchanged, @@ -157,7 +168,7 @@ describe('npm-packages publishToNpm', function () { { name: 'package2', version: '2.0.0', location: 'packages/package2' }, ]; - beforeEach(() => { + beforeEach(function () { writeFileStub = sinon.stub(fs, 'writeFile').resolves(); readFileStub = sinon.stub(fs, 'readFile'); @@ -176,11 +187,11 @@ describe('npm-packages publishToNpm', function () { ); }); - afterEach(() => { + afterEach(function () { sinon.restore(); }); - it('should set the releasePublisher for each package and write the updated package.json', async () => { + it('should set the releasePublisher for each package and write the updated package.json', async function () { const publisher = 'test-publisher'; await setReleasePublisher(publisher, packages as PackageInfo[]); diff --git a/packages/build/src/npm-packages/publish.ts b/packages/build/src/npm-packages/publish.ts index dc57e211f8..7d761a8327 100644 --- a/packages/build/src/npm-packages/publish.ts +++ b/packages/build/src/npm-packages/publish.ts @@ -1,4 +1,3 @@ -import path from 'path'; import { EXCLUDE_RELEASE_PACKAGES, LERNA_BIN, @@ -6,26 +5,28 @@ import { PROJECT_ROOT, } from './constants'; import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync'; -import type { SpawnSyncOptionsWithStringEncoding } from 'child_process'; -import { - getPackagesInTopologicalOrder as getPackagesInTopologicalOrderFn, - PackageInfo, -} from '@mongodb-js/monorepo-tools'; +import { type SpawnSyncOptionsWithStringEncoding } from 'child_process'; +import type { PackageInfo } from '@mongodb-js/monorepo-tools'; +import { getPackagesInTopologicalOrder as getPackagesInTopologicalOrderFn } from '@mongodb-js/monorepo-tools'; import { getPackageConfigurations, markBumpedFilesAsAssumeUnchanged, } from './helpers'; import { promises as fs } from 'fs'; -export function publishToNpm( +export async function publishToNpm( { isDryRun = false, useAuxiliaryPackagesOnly = false }, getPackagesInTopologicalOrder: typeof getPackagesInTopologicalOrderFn = getPackagesInTopologicalOrderFn, markBumpedFilesAsAssumeUnchangedFn: typeof markBumpedFilesAsAssumeUnchanged = markBumpedFilesAsAssumeUnchanged, spawnSync: typeof spawnSyncFn = spawnSyncFn ): Promise { const publisher = process.env.MONGOSH_RELEASE_PUBLISHER; - if (!publisher) { - throw new Error('MONGOSH_RELEASE_PUBLISHER not specified for publishing'); + if (!useAuxiliaryPackagesOnly) { + if (!publisher) { + throw new Error( + 'MONGOSH_RELEASE_PUBLISHER is required for publishing mongosh' + ); + } } const commandOptions: SpawnSyncOptionsWithStringEncoding = { @@ -47,7 +48,9 @@ export function publishToNpm( (packageConfig) => !MONGOSH_RELEASE_PACKAGES.includes(packageConfig.name) ); } - await setReleasePublisher(publisher, packages); + if (publisher) { + await setReleasePublisher(publisher, packages); + } // Lerna requires a clean repository for a publish from-package // we use git update-index --assume-unchanged on files we know have been bumped markBumpedFilesAsAssumeUnchangedFn(packages, true); @@ -80,7 +83,7 @@ export function publishToNpm( spawnSync( 'git', - ['tag', '-a', mongoshVersion, '-m', mongoshVersion], + ['tag', '-a', `v${mongoshVersion}`, '-m', `v${mongoshVersion}`], commandOptions ); diff --git a/packages/build/src/publish-auxiliary.ts b/packages/build/src/publish-auxiliary.ts index 6d465f80de..fa373a02df 100644 --- a/packages/build/src/publish-auxiliary.ts +++ b/packages/build/src/publish-auxiliary.ts @@ -1,11 +1,11 @@ import type { Config } from './config'; import { publishToNpm } from './npm-packages'; -export function publishAuxiliaryPackages(config: Config) { +export async function publishAuxiliaryPackages(config: Config) { if (!config.useAuxiliaryPackagesOnly) { throw new Error( 'This should only be used when publishing auxiliary packages' ); } - publishToNpm(config); + await publishToNpm(config); } diff --git a/packages/build/src/publish-mongosh.ts b/packages/build/src/publish-mongosh.ts index 726d82feed..82402905ec 100644 --- a/packages/build/src/publish-mongosh.ts +++ b/packages/build/src/publish-mongosh.ts @@ -81,7 +81,7 @@ export async function publishMongosh( // ensures the segment api key to be present in the published packages await writeBuildInfo(config, 'packaged'); - publishToNpm({ + await publishToNpm({ isDryRun: config.isDryRun, useAuxiliaryPackagesOnly: config.useAuxiliaryPackagesOnly, }); From 68c0e09aa62475684ece98af6b47d5eeb542876c Mon Sep 17 00:00:00 2001 From: gagik Date: Thu, 16 Jan 2025 18:38:42 +0100 Subject: [PATCH 35/36] refactor(ci): use more object-oriented structure during publishing and testing This ended up being a larger refactor than intended but it was getting increasingly difficult to add new helpers and test them with the current setup. Now, instead of passing all helpers as spies, they exist as properties on "Publisher" objects which makes them easier to stub them with sinon. --- packages/build/src/mongosh-publisher.spec.ts | 209 +++++++++++ packages/build/src/mongosh-publisher.ts | 176 ++++++++++ .../build/src/npm-packages/helpers.spec.ts | 50 +-- packages/build/src/npm-packages/helpers.ts | 37 -- packages/build/src/npm-packages/index.ts | 2 +- .../src/npm-packages/npm-publisher.spec.ts | 318 +++++++++++++++++ .../build/src/npm-packages/npm-publisher.ts | 154 +++++++++ .../build/src/npm-packages/publish.spec.ts | 219 ------------ packages/build/src/npm-packages/publish.ts | 108 ------ packages/build/src/publish-auxiliary.ts | 11 - packages/build/src/publish-mongosh.spec.ts | 327 ------------------ packages/build/src/publish-mongosh.ts | 145 -------- packages/build/src/release.ts | 35 +- packages/build/test/helpers.ts | 1 + 14 files changed, 870 insertions(+), 922 deletions(-) create mode 100644 packages/build/src/mongosh-publisher.spec.ts create mode 100644 packages/build/src/mongosh-publisher.ts create mode 100644 packages/build/src/npm-packages/npm-publisher.spec.ts create mode 100644 packages/build/src/npm-packages/npm-publisher.ts delete mode 100644 packages/build/src/npm-packages/publish.spec.ts delete mode 100644 packages/build/src/npm-packages/publish.ts delete mode 100644 packages/build/src/publish-auxiliary.ts delete mode 100644 packages/build/src/publish-mongosh.spec.ts delete mode 100644 packages/build/src/publish-mongosh.ts diff --git a/packages/build/src/mongosh-publisher.spec.ts b/packages/build/src/mongosh-publisher.spec.ts new file mode 100644 index 0000000000..a03f617938 --- /dev/null +++ b/packages/build/src/mongosh-publisher.spec.ts @@ -0,0 +1,209 @@ +/* eslint-disable @typescript-eslint/unbound-method */ +import chai, { expect } from 'chai'; +import sinon from 'sinon'; +import { Barque } from './barque'; +import type { Config } from './config'; +import { GithubRepo } from '@mongodb-js/devtools-github-repo'; +import { dummyConfig } from '../test/helpers'; +import { MongoshPublisher } from './mongosh-publisher'; + +chai.use(require('sinon-chai')); + +function createStubRepo(overrides?: any): GithubRepo { + return sinon.createStubInstance( + GithubRepo, + overrides + ) as unknown as GithubRepo; +} + +function createStubBarque(overrides?: any): Barque { + return sinon.createStubInstance(Barque, overrides) as unknown as Barque; +} + +describe('NpmPublisher publishMongosh', function () { + let config: Config; + let createAndPublishDownloadCenterConfig: sinon.SinonStub; + let getMostRecentDraftTagForRelease: sinon.SinonStub; + let publishToNpm: sinon.SinonStub; + let writeBuildInfo: sinon.SinonStub; + let publishToHomebrew: sinon.SinonStub; + let shouldDoPublicRelease: sinon.SinonStub; + let githubRepo: GithubRepo; + let mongoHomebrewCoreForkRepo: GithubRepo; + let homebrewCoreRepo: GithubRepo; + let barque: Barque; + + let testPublisher: MongoshPublisher; + + beforeEach(function () { + config = { ...dummyConfig }; + getMostRecentDraftTagForRelease = sinon.stub(); + githubRepo = createStubRepo({ + getMostRecentDraftTagForRelease, + }); + mongoHomebrewCoreForkRepo = createStubRepo(); + homebrewCoreRepo = createStubRepo(); + barque = createStubBarque({ + releaseToBarque: sinon.stub().resolves(['package-url']), + waitUntilPackagesAreAvailable: sinon.stub().resolves(), + }); + + testPublisher = new MongoshPublisher( + config, + githubRepo, + homebrewCoreRepo, + homebrewCoreRepo + ); + + createAndPublishDownloadCenterConfig = sinon + .stub(testPublisher, 'createAndPublishDownloadCenterConfig') + .resolves(); + publishToNpm = sinon.stub(testPublisher.npmPublisher, 'publish').resolves(); + writeBuildInfo = sinon.stub(testPublisher, 'writeBuildInfo').resolves(); + publishToHomebrew = sinon + .stub(testPublisher, 'publishToHomebrew') + .resolves(); + shouldDoPublicRelease = sinon + .stub(testPublisher, 'shouldDoPublicRelease') + .resolves(); + }); + + context('if is a public release', function () { + beforeEach(function () { + config.triggeringGitTag = 'v0.7.0'; + shouldDoPublicRelease.returns(true); + getMostRecentDraftTagForRelease.resolves({ + name: 'v0.7.0-draft.42', + sha: 'revision', + }); + + Object.assign(githubRepo, { + repo: { + owner: 'mongodb-js', + repo: 'mongosh', + }, + }); + }); + + context('validates configuration', function () { + it('fails if no draft tag is found', async function () { + getMostRecentDraftTagForRelease.resolves(undefined); + try { + await testPublisher.publishMongosh(barque); + } catch (e: any) { + return expect(e.message).to.contain('Could not find prior draft tag'); + } + expect.fail('Expected error'); + }); + + it('fails if draft tag SHA does not match revision', async function () { + getMostRecentDraftTagForRelease.resolves({ + name: 'v0.7.0-draft.42', + sha: 'wrong', + }); + try { + await testPublisher.publishMongosh(barque); + } catch (e: any) { + return expect(e.message).to.contain('Version mismatch'); + } + expect.fail('Expected error'); + }); + }); + + it('publishes artifacts to barque', async function () { + await testPublisher.publishMongosh(barque); + + expect(barque.releaseToBarque).to.have.been.callCount(26); + expect(barque.releaseToBarque).to.have.been.calledWith( + 'rpm-x64', + 'https://s3.amazonaws.com/mciuploads/project/v0.7.0-draft.42/mongodb-mongosh-0.7.0.x86_64.rpm' + ); + expect(barque.releaseToBarque).to.have.been.calledWith( + 'deb-x64', + 'https://s3.amazonaws.com/mciuploads/project/v0.7.0-draft.42/mongodb-mongosh_0.7.0_amd64.deb' + ); + expect(barque.releaseToBarque).to.have.been.calledWith( + 'rpm-arm64', + 'https://s3.amazonaws.com/mciuploads/project/v0.7.0-draft.42/mongodb-mongosh-0.7.0.aarch64.rpm' + ); + expect(barque.waitUntilPackagesAreAvailable).to.have.been.called; + }); + + it('updates the download center config', async function () { + await testPublisher.publishMongosh(barque); + + expect(createAndPublishDownloadCenterConfig).to.have.been.calledWith( + config.outputDir, + config.packageInformation, + config.downloadCenterAwsKey, + config.downloadCenterAwsSecret + ); + }); + + it('promotes the release in github', async function () { + await testPublisher.publishMongosh(barque); + + expect(githubRepo.promoteRelease).to.have.been.calledWith(config); + }); + + it('writes analytics config and then publishes NPM packages', async function () { + await testPublisher.publishMongosh(barque); + + expect(writeBuildInfo).to.have.been.calledOnceWith(config); + expect(publishToNpm).to.have.been.calledWith(); + expect(publishToNpm).to.have.been.calledAfter( + testPublisher.writeBuildInfo as any + ); + }); + it('publishes to homebrew', async function () { + await testPublisher.publishMongosh(barque); + + expect(publishToHomebrew).to.have.been.calledWith( + homebrewCoreRepo, + mongoHomebrewCoreForkRepo, + config.version + ); + expect(publishToHomebrew).to.have.been.calledAfter( + githubRepo.promoteRelease as any + ); + }); + }); + + context('if is not a public release', function () { + beforeEach(function () { + shouldDoPublicRelease.returns(false); + }); + + it('does not update the download center config', async function () { + await testPublisher.publishMongosh(barque); + + expect( + testPublisher.createAndPublishDownloadCenterConfig + ).not.to.have.been.called; + }); + + it('does not promote the release in github', async function () { + await testPublisher.publishMongosh(barque); + + expect(githubRepo.promoteRelease).not.to.have.been.called; + }); + + it('does not publish npm packages', async function () { + await testPublisher.publishMongosh(barque); + + expect(publishToNpm).not.to.have.been.called; + }); + + it('does not publish to homebrew', async function () { + await testPublisher.publishMongosh(barque); + + expect(publishToHomebrew).not.to.have.been.called; + }); + + it('does not release to barque', async function () { + await testPublisher.publishMongosh(barque); + + expect(barque.releaseToBarque).not.to.have.been.called; + }); + }); +}); diff --git a/packages/build/src/mongosh-publisher.ts b/packages/build/src/mongosh-publisher.ts new file mode 100644 index 0000000000..904db9da63 --- /dev/null +++ b/packages/build/src/mongosh-publisher.ts @@ -0,0 +1,176 @@ +import { writeBuildInfo as writeBuildInfoType } from './build-info'; +import { Barque } from './barque'; +import type { Config } from './config'; +import { + ALL_PACKAGE_VARIANTS, + getReleaseVersionFromTag, + shouldDoPublicRelease as shouldDoPublicReleaseFn, +} from './config'; +import { createAndPublishDownloadCenterConfig as createAndPublishDownloadCenterConfigFn } from './download-center'; +import { getArtifactUrl as getArtifactUrlFn } from './evergreen'; +import type { GithubRepo } from '@mongodb-js/devtools-github-repo'; +import { publishToHomebrew as publishToHomebrewFn } from './homebrew'; +import type { PackageInformationProvider } from './packaging'; +import { getPackageFile } from './packaging'; +import { NpmPublisher } from './npm-packages'; + +export class MongoshPublisher { + createAndPublishDownloadCenterConfig = createAndPublishDownloadCenterConfigFn; + writeBuildInfo = writeBuildInfoType; + publishToHomebrew = publishToHomebrewFn; + shouldDoPublicRelease = shouldDoPublicReleaseFn; + getEvergreenArtifactUrl = getArtifactUrlFn; + + config: Config; + mongoshGithubRepo: GithubRepo; + mongoHomebrewForkRepo: GithubRepo; + homebrewCoreRepo: GithubRepo; + npmPublisher: NpmPublisher; + + constructor( + config: Config, + githubRepo: GithubRepo, + mongoHomebrewForkRepo: GithubRepo, + homebrewCoreRepo: GithubRepo + ) { + this.config = config; + this.npmPublisher = new NpmPublisher(config); + this.mongoshGithubRepo = githubRepo; + this.mongoHomebrewForkRepo = mongoHomebrewForkRepo; + this.homebrewCoreRepo = homebrewCoreRepo; + } + + async publish() { + if (this.config.useAuxiliaryPackagesOnly === false) { + const barque = new Barque(this.config); + await this.publishMongosh(barque); + } else { + await this.publishAuxiliaryPackages(); + } + } + + async publishAuxiliaryPackages() { + if (!this.config.useAuxiliaryPackagesOnly) { + throw new Error( + 'This should only be used when publishing auxiliary packages' + ); + } + await this.npmPublisher.publish(); + } + + async publishMongosh(barque: Barque): Promise { + const config = this.config; + if (!this.shouldDoPublicRelease(config)) { + console.warn( + 'mongosh: Not triggering publish - configuration does not match a public release!' + ); + return; + } + + const releaseVersion = getReleaseVersionFromTag(config.triggeringGitTag); + const latestDraftTag = + await this.mongoshGithubRepo.getMostRecentDraftTagForRelease( + releaseVersion + ); + if (!latestDraftTag || !releaseVersion) { + throw new Error( + `Could not find prior draft tag for release version: ${ + releaseVersion ?? 'unknown' + }` + ); + } + if (latestDraftTag.sha !== config.revision) { + throw new Error( + `Version mismatch - latest draft tag was for revision ${ + latestDraftTag.sha + }, current revision is ${config.revision ?? 'unknown'}` + ); + } + + console.info( + 'mongosh: Re-using artifacts from most recent draft tag', + latestDraftTag.name + ); + + await this.publishArtifactsToBarque( + barque, + config.project as string, + releaseVersion, + latestDraftTag.name, + config.packageInformation as PackageInformationProvider, + !!config.isDryRun + ); + + await this.createAndPublishDownloadCenterConfig( + config.outputDir, + config.packageInformation as PackageInformationProvider, + config.downloadCenterAwsKey || '', + config.downloadCenterAwsSecret || '', + config.injectedJsonFeedFile || '', + !!config.isDryRun + ); + + await this.mongoshGithubRepo.promoteRelease(config); + + // ensures the segment api key to be present in the published packages + await this.writeBuildInfo(config, 'packaged'); + + await this.npmPublisher.publish(); + + await this.publishToHomebrew( + this.homebrewCoreRepo, + this.mongoHomebrewForkRepo, + config.version, + `https://github.com/${this.mongoshGithubRepo.repo.owner}/${this.mongoshGithubRepo.repo.repo}/releases/tag/v${config.version}`, + !!config.isDryRun + ); + + console.info('mongosh: finished release process.'); + } + + async publishArtifactsToBarque( + barque: Barque, + project: string, + releaseVersion: string, + mostRecentDraftTag: string, + packageInformation: PackageInformationProvider, + isDryRun: boolean + ): Promise { + const publishedPackages: string[] = []; + for await (const variant of ALL_PACKAGE_VARIANTS) { + const variantPackageInfo = packageInformation(variant); + const packageFile = getPackageFile(variant, () => ({ + ...variantPackageInfo, + metadata: { + ...variantPackageInfo.metadata, + version: releaseVersion, + }, + })); + const packageUrl = this.getEvergreenArtifactUrl( + project, + mostRecentDraftTag, + packageFile.path + ); + console.info( + `mongosh: Considering publishing ${variant} artifact to barque ${packageUrl}` + ); + const packageUrls = await barque.releaseToBarque( + variant, + packageUrl, + isDryRun + ); + for (const url of packageUrls) { + console.info(` -> ${url}`); + } + publishedPackages.push(...packageUrls); + } + + if (isDryRun) { + console.warn('Not waiting for package availability in dry run...'); + } else { + await barque.waitUntilPackagesAreAvailable(publishedPackages, 300); + } + + console.info('mongosh: Submitting to barque complete'); + } +} diff --git a/packages/build/src/npm-packages/helpers.spec.ts b/packages/build/src/npm-packages/helpers.spec.ts index 7c24f46a6d..d7175b8d80 100644 --- a/packages/build/src/npm-packages/helpers.spec.ts +++ b/packages/build/src/npm-packages/helpers.spec.ts @@ -1,63 +1,15 @@ import { expect } from 'chai'; import path from 'path'; -import type { SinonStub } from 'sinon'; import sinon from 'sinon'; import type { PackageInfo } from '@mongodb-js/monorepo-tools'; -import { getPackagesInTopologicalOrder } from '@mongodb-js/monorepo-tools'; -import { PROJECT_ROOT } from './constants'; import { promises as fs } from 'fs'; -import { - getPackageConfigurations, - markBumpedFilesAsAssumeUnchanged, -} from './helpers'; +import { getPackageConfigurations } from './helpers'; describe('npm-packages helpers', function () { before(function () { if (process.version.startsWith('v16.')) return this.skip(); }); - describe('markBumpedFilesAsAssumeUnchanged', function () { - let packages: PackageInfo[]; - let expectedFiles: string[]; - let spawnSync: SinonStub; - - beforeEach(async function () { - expectedFiles = [ - path.resolve(__dirname, '..', '..', '..', '..', 'lerna.json'), - path.resolve(__dirname, '..', '..', '..', '..', 'package.json'), - path.resolve(__dirname, '..', '..', '..', '..', 'package-lock.json'), - ]; - packages = await getPackagesInTopologicalOrder(PROJECT_ROOT); - for (const { location } of packages) { - expectedFiles.push(path.resolve(location, 'package.json')); - } - - spawnSync = sinon.stub(); - }); - - it('marks files with --assume-unchanged', function () { - markBumpedFilesAsAssumeUnchanged(packages, true, spawnSync); - expectedFiles.forEach((f) => { - expect(spawnSync).to.have.been.calledWith( - 'git', - ['update-index', '--assume-unchanged', f], - sinon.match.any - ); - }); - }); - - it('marks files with --no-assume-unchanged', function () { - markBumpedFilesAsAssumeUnchanged(packages, false, spawnSync); - expectedFiles.forEach((f) => { - expect(spawnSync).to.have.been.calledWith( - 'git', - ['update-index', '--no-assume-unchanged', f], - sinon.match.any - ); - }); - }); - }); - describe('getPackageConfigurations', function () { const packages: PackageInfo[] = [ { diff --git a/packages/build/src/npm-packages/helpers.ts b/packages/build/src/npm-packages/helpers.ts index ba9def3289..642c6e945c 100644 --- a/packages/build/src/npm-packages/helpers.ts +++ b/packages/build/src/npm-packages/helpers.ts @@ -1,8 +1,6 @@ import path from 'path'; import { promises as fs } from 'fs'; import type { PackageInfo } from '@mongodb-js/monorepo-tools'; -import { PROJECT_ROOT } from './constants'; -import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync'; export async function getPackageConfigurations( packages: PackageInfo[] @@ -19,38 +17,3 @@ export async function getPackageConfigurations( }) ); } - -export function markBumpedFilesAsAssumeUnchanged( - packages: PackageInfo[], - assumeUnchanged: boolean, - spawnSync: typeof spawnSyncFn = spawnSyncFn -): void { - const filesToAssume = [ - path.resolve(PROJECT_ROOT, 'lerna.json'), - path.resolve(PROJECT_ROOT, 'package.json'), - path.resolve(PROJECT_ROOT, 'package-lock.json'), - ]; - for (const { location } of packages) { - filesToAssume.push(path.resolve(location, 'package.json')); - } - - for (const f of filesToAssume) { - spawnSync( - 'git', - [ - 'update-index', - assumeUnchanged ? '--assume-unchanged' : '--no-assume-unchanged', - f, - ], - { - stdio: 'inherit', - cwd: PROJECT_ROOT, - encoding: 'utf8', - }, - true - ); - console.info( - `File ${f} is now ${assumeUnchanged ? '' : 'NOT '}assumed to be unchanged` - ); - } -} diff --git a/packages/build/src/npm-packages/index.ts b/packages/build/src/npm-packages/index.ts index f4225bedce..d72a3efa53 100644 --- a/packages/build/src/npm-packages/index.ts +++ b/packages/build/src/npm-packages/index.ts @@ -1,2 +1,2 @@ export { bumpAuxiliaryPackages } from './bump'; -export { publishToNpm } from './publish'; +export { NpmPublisher } from './npm-publisher'; diff --git a/packages/build/src/npm-packages/npm-publisher.spec.ts b/packages/build/src/npm-packages/npm-publisher.spec.ts new file mode 100644 index 0000000000..fc302ba91c --- /dev/null +++ b/packages/build/src/npm-packages/npm-publisher.spec.ts @@ -0,0 +1,318 @@ +import { expect } from 'chai'; +import path from 'path'; +import type { SinonStub } from 'sinon'; +import sinon from 'sinon'; +import fs from 'fs/promises'; +import type { NpmPublisherConfig } from './npm-publisher'; +import { NpmPublisher } from './npm-publisher'; +import type { PackageInfo } from '@mongodb-js/monorepo-tools'; + +describe('npm-packages NpmPublisher', function () { + let testPublisher: NpmPublisher; + let getPackagesInTopologicalOrderStub: SinonStub; + let markBumpedFilesAsAssumeUnchangedStub: SinonStub; + let spawnSync: SinonStub; + let writeFileStub: sinon.SinonStub; + let readFileStub: sinon.SinonStub; + let setPublisherStub: sinon.SinonStub; + + const lernaBin = path.resolve( + __dirname, + '..', + '..', + '..', + '..', + 'node_modules', + '.bin', + 'lerna' + ); + const packages: PackageInfo[] = [ + { + name: 'packageA', + version: '0.7.0', + location: 'packages/package1', + } as PackageInfo, + { + name: 'mongosh', + version: '1.2.0', + location: 'packages/mongosh', + } as PackageInfo, + ]; + + function setupTestPublisher( + config: NpmPublisherConfig, + { stubPublisher = true } = {} + ) { + testPublisher = new NpmPublisher(config); + + getPackagesInTopologicalOrderStub = sinon.stub( + testPublisher, + 'getPackagesInTopologicalOrder' + ); + getPackagesInTopologicalOrderStub.resolves([]); + markBumpedFilesAsAssumeUnchangedStub = sinon + .stub(testPublisher, 'markBumpedFilesAsAssumeUnchanged') + .resolves(); + spawnSync = sinon.stub(testPublisher, 'spawnSync').resolves(); + + if (stubPublisher) { + setPublisherStub = sinon + .stub(testPublisher, 'setReleasePublisher') + .resolves(); + } + + for (const packageInfo of packages) { + readFileStub + .withArgs(path.join(packageInfo.location, 'package.json'), 'utf8') + .resolves( + JSON.stringify({ + name: packageInfo.name, + version: packageInfo.version, + }) + ); + } + } + + beforeEach(function () { + writeFileStub = sinon.stub(fs, 'writeFile'); + writeFileStub.resolves(); + + readFileStub = sinon.stub(fs, 'readFile'); + readFileStub.throws('Unset path read from stub'); + }); + + afterEach(function () { + sinon.restore(); + }); + + describe('publish', function () { + describe('when releasing mongosh', function () { + beforeEach(function () { + setupTestPublisher({ + isDryRun: false, + useAuxiliaryPackagesOnly: false, + publisher: 'test-publisher', + }); + }); + + afterEach(function () { + sinon.restore(); + }); + + it('throws if mongosh package is not found ', async function () { + const packages = [{ name: 'packageA', version: '0.7.0' }]; + getPackagesInTopologicalOrderStub.resolves(packages); + + try { + await testPublisher.publish(); + expect.fail('should throw'); + } catch (error) { + expect((error as Error).message).equals('mongosh package not found'); + } + }); + + it('throws if publisher is not set', function () { + getPackagesInTopologicalOrderStub.resolves(packages); + try { + new NpmPublisher({ + useAuxiliaryPackagesOnly: false, + publisher: '', + isDryRun: false, + }); + expect.fail('should throw'); + } catch (error) { + expect((error as Error).message).equals( + 'Publisher is required for publishing mongosh' + ); + } + }); + + it('calls setReleasePublisher when it is set', async function () { + getPackagesInTopologicalOrderStub.resolves(packages); + await testPublisher.publish(); + expect(setPublisherStub).calledOnceWith(testPublisher.config.publisher); + }); + + it('takes mongosh version and pushes tags', async function () { + getPackagesInTopologicalOrderStub.resolves(packages); + + await testPublisher.publish(); + + expect(spawnSync).calledWith('git', [ + 'tag', + '-a', + 'v1.2.0', + '-m', + 'v1.2.0', + ]); + expect(spawnSync).calledWith('git', ['push', '--follow-tags']); + }); + + it('calls lerna to publish packages', async function () { + getPackagesInTopologicalOrderStub.resolves(packages); + + await testPublisher.publish(); + + expect(markBumpedFilesAsAssumeUnchangedStub).to.have.been.calledWith( + packages, + true + ); + expect(spawnSync).to.have.been.calledWith( + lernaBin, + [ + 'publish', + 'from-package', + '--no-private', + '--no-changelog', + '--exact', + '--yes', + '--no-verify-access', + ], + sinon.match.any + ); + expect(markBumpedFilesAsAssumeUnchangedStub).to.have.been.calledWith( + packages, + false + ); + }); + + it('reverts the assume unchanged even on spawn failure', async function () { + getPackagesInTopologicalOrderStub.resolves(packages); + spawnSync.throws(new Error('meeep')); + + try { + await testPublisher.publish(); + } catch (e: any) { + expect(markBumpedFilesAsAssumeUnchangedStub).to.have.been.calledWith( + packages, + true + ); + expect(spawnSync).to.have.been.called; + expect(markBumpedFilesAsAssumeUnchangedStub).to.have.been.calledWith( + packages, + false + ); + return; + } + expect.fail('Expected error'); + }); + }); + + describe('when releasing auxiliary packages', function () { + beforeEach(function () { + setupTestPublisher({ + isDryRun: false, + useAuxiliaryPackagesOnly: true, + publisher: 'test-publisher', + }); + }); + + it('does not manually push tags with auxiliary packages', async function () { + getPackagesInTopologicalOrderStub.resolves(packages); + + await testPublisher.publish(); + + expect(spawnSync).not.calledWith('git', [ + 'tag', + '-a', + '1.2.0', + '-m', + '1.2.0', + ]); + expect(spawnSync).not.calledWith('git', ['push', '--follow-tags']); + }); + }); + }); + + describe('markBumpedFilesAsAssumeUnchanged', function () { + let expectedFiles: string[]; + let spawnSync: SinonStub; + + beforeEach(function () { + expectedFiles = [ + path.resolve(__dirname, '..', '..', '..', '..', 'lerna.json'), + path.resolve(__dirname, '..', '..', '..', '..', 'package.json'), + path.resolve(__dirname, '..', '..', '..', '..', 'package-lock.json'), + ]; + for (const { location } of packages) { + expectedFiles.push(path.resolve(location, 'package.json')); + } + + spawnSync = sinon.stub(); + }); + + it('marks files with --assume-unchanged', function () { + testPublisher.markBumpedFilesAsAssumeUnchanged(packages, true, spawnSync); + expectedFiles.forEach((f) => { + expect(spawnSync).to.have.been.calledWith( + 'git', + ['update-index', '--assume-unchanged', f], + sinon.match.any + ); + }); + }); + + it('marks files with --no-assume-unchanged', function () { + testPublisher.markBumpedFilesAsAssumeUnchanged( + packages, + false, + spawnSync + ); + expectedFiles.forEach((f) => { + expect(spawnSync).to.have.been.calledWith( + 'git', + ['update-index', '--no-assume-unchanged', f], + sinon.match.any + ); + }); + }); + }); + + describe('setReleasePublisher', function () { + const publisherName = 'test-publisher-name'; + beforeEach(function () { + setupTestPublisher( + { + isDryRun: false, + useAuxiliaryPackagesOnly: false, + publisher: 'test-publisher', + }, + { stubPublisher: false } + ); + }); + + afterEach(function () { + sinon.restore(); + }); + + it('should set the releasePublisher for each package and write the updated package.json', async function () { + getPackagesInTopologicalOrderStub.resolves(packages); + await testPublisher.setReleasePublisher(publisherName, packages); + + expect(readFileStub).has.callCount(packages.length); + expect(writeFileStub).has.callCount(packages.length); + + expect(writeFileStub.firstCall.args[0]).to.equal( + 'packages/package1/package.json' + ); + expect( + JSON.parse(writeFileStub.firstCall.args[1] as string) + ).to.deep.equal({ + name: 'packageA', + version: '0.7.0', + releasePublisher: publisherName, + }); + + expect(writeFileStub.secondCall.args[0]).to.equal( + 'packages/mongosh/package.json' + ); + expect( + JSON.parse(writeFileStub.secondCall.args[1] as string) + ).to.deep.equal({ + name: 'mongosh', + version: '1.2.0', + releasePublisher: publisherName, + }); + }); + }); +}); diff --git a/packages/build/src/npm-packages/npm-publisher.ts b/packages/build/src/npm-packages/npm-publisher.ts new file mode 100644 index 0000000000..0602393e3c --- /dev/null +++ b/packages/build/src/npm-packages/npm-publisher.ts @@ -0,0 +1,154 @@ +import { + EXCLUDE_RELEASE_PACKAGES, + LERNA_BIN, + MONGOSH_RELEASE_PACKAGES, + PROJECT_ROOT, +} from './constants'; +import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync'; +import { type SpawnSyncOptionsWithStringEncoding } from 'child_process'; +import type { PackageInfo } from '@mongodb-js/monorepo-tools'; +import { getPackagesInTopologicalOrder as getPackagesInTopologicalOrderFn } from '@mongodb-js/monorepo-tools'; +import { getPackageConfigurations } from './helpers'; +import fs from 'fs/promises'; +import path from 'path'; + +export type NpmPublisherConfig = { + isDryRun?: boolean; + publisher?: string; + useAuxiliaryPackagesOnly?: boolean; +}; + +export class NpmPublisher { + getPackagesInTopologicalOrder = getPackagesInTopologicalOrderFn; + spawnSync = spawnSyncFn; + config: NpmPublisherConfig; + + constructor(config: NpmPublisherConfig) { + if (!config.useAuxiliaryPackagesOnly && !config.publisher) { + throw new Error('Publisher is required for publishing mongosh'); + } + + this.config = config; + } + + async publish(): Promise { + const { useAuxiliaryPackagesOnly, isDryRun, publisher } = this.config; + + const commandOptions: SpawnSyncOptionsWithStringEncoding = { + stdio: 'inherit', + cwd: PROJECT_ROOT, + encoding: 'utf8', + env: { + ...process.env, + ...(isDryRun ? { npm_config_dry_run: 'true' } : {}), + }, + }; + + let packages = ( + await this.getPackagesInTopologicalOrder(PROJECT_ROOT) + ).filter( + (packageConfig) => !EXCLUDE_RELEASE_PACKAGES.includes(packageConfig.name) + ); + + if (useAuxiliaryPackagesOnly) { + packages = packages.filter( + (packageConfig) => + !MONGOSH_RELEASE_PACKAGES.includes(packageConfig.name) + ); + } + if (publisher) { + await this.setReleasePublisher(publisher, packages); + } + // Lerna requires a clean repository for a publish from-package + // we use git update-index --assume-unchanged on files we know have been bumped + this.markBumpedFilesAsAssumeUnchanged(packages, true); + try { + this.spawnSync( + LERNA_BIN, + [ + 'publish', + 'from-package', + '--no-private', + '--no-changelog', + '--exact', + '--yes', + '--no-verify-access', + ], + commandOptions + ); + } finally { + this.markBumpedFilesAsAssumeUnchanged(packages, false); + } + + if (!useAuxiliaryPackagesOnly) { + const mongoshVersion = packages.find( + (packageConfig) => packageConfig.name === 'mongosh' + )?.version; + + if (!mongoshVersion) { + throw new Error('mongosh package not found'); + } + + this.spawnSync( + 'git', + ['tag', '-a', `v${mongoshVersion}`, '-m', `v${mongoshVersion}`], + commandOptions + ); + + this.spawnSync('git', ['push', '--follow-tags'], commandOptions); + } + } + + async setReleasePublisher( + publisher: string, + packages: PackageInfo[] + ): Promise { + const packageConfigurations = await getPackageConfigurations(packages); + + for (const [packageJsonPath, packageJson] of packageConfigurations) { + packageJson.releasePublisher = publisher; + + await fs.writeFile( + packageJsonPath, + JSON.stringify(packageJson, null, 2) + '\n' + ); + } + } + + markBumpedFilesAsAssumeUnchanged( + packages: PackageInfo[], + assumeUnchanged: boolean, + spawnSync: typeof spawnSyncFn = spawnSyncFn + ): void { + const filesToAssume = [ + path.resolve(PROJECT_ROOT, 'lerna.json'), + path.resolve(PROJECT_ROOT, 'package.json'), + path.resolve(PROJECT_ROOT, 'package-lock.json'), + ]; + for (const { location } of packages) { + filesToAssume.push(path.resolve(location, 'package.json')); + } + + for (const f of filesToAssume) { + spawnSync( + 'git', + [ + 'update-index', + assumeUnchanged ? '--assume-unchanged' : '--no-assume-unchanged', + f, + ], + { + stdio: 'inherit', + cwd: PROJECT_ROOT, + encoding: 'utf8', + }, + true + ); + console.info( + `File ${f} is now ${ + assumeUnchanged ? '' : 'NOT ' + }assumed to be unchanged` + ); + } + } +} diff --git a/packages/build/src/npm-packages/publish.spec.ts b/packages/build/src/npm-packages/publish.spec.ts deleted file mode 100644 index f1426cacb2..0000000000 --- a/packages/build/src/npm-packages/publish.spec.ts +++ /dev/null @@ -1,219 +0,0 @@ -import { expect } from 'chai'; -import path from 'path'; -import type { SinonStub } from 'sinon'; -import sinon from 'sinon'; -import { publishToNpm, setReleasePublisher } from './publish'; -import { promises as fs } from 'fs'; -import type { PackageInfo } from '@mongodb-js/monorepo-tools'; - -describe('npm-packages publishToNpm', function () { - let getPackagesInTopologicalOrder: SinonStub; - let markBumpedFilesAsAssumeUnchanged: SinonStub; - let spawnSync: SinonStub; - const lernaBin = path.resolve( - __dirname, - '..', - '..', - '..', - '..', - 'node_modules', - '.bin', - 'lerna' - ); - const packages = [ - { name: 'packageA', version: '0.7.0', location: '/packages/packageA' }, - { name: 'mongosh', version: '1.2.0', location: '/packages/mongosh' }, - ]; - - beforeEach(function () { - getPackagesInTopologicalOrder = sinon.stub(); - markBumpedFilesAsAssumeUnchanged = sinon.stub(); - spawnSync = sinon.stub(); - process.env.MONGOSH_RELEASE_PUBLISHER = 'test-publisher'; - }); - - it('throws if mongosh is not existent when publishing all', async function () { - const packages = [{ name: 'packageA', version: '0.7.0' }]; - getPackagesInTopologicalOrder.resolves(packages); - try { - await publishToNpm( - { isDryRun: false, useAuxiliaryPackagesOnly: false }, - getPackagesInTopologicalOrder, - markBumpedFilesAsAssumeUnchanged, - spawnSync - ); - expect.fail('should throw'); - } catch (error) { - expect((error as Error).message).equals('mongosh package not found'); - } - }); - - it('throws if publisher is not set when publishing all', async function () { - getPackagesInTopologicalOrder.resolves(packages); - - try { - await publishToNpm( - { isDryRun: false, useAuxiliaryPackagesOnly: false }, - getPackagesInTopologicalOrder, - markBumpedFilesAsAssumeUnchanged, - spawnSync - ); - expect.fail('should throw'); - } catch (error) { - expect((error as Error).message).equals( - 'MONGOSH_RELEASE_PUBLISHER is required for publishing mongosh' - ); - } - }); - - it('takes mongosh version and pushes tags', async function () { - getPackagesInTopologicalOrder.resolves(packages); - - await publishToNpm( - { isDryRun: false, useAuxiliaryPackagesOnly: false }, - getPackagesInTopologicalOrder, - markBumpedFilesAsAssumeUnchanged, - spawnSync - ); - - expect(spawnSync).calledWith('git', ['tag', '-a', '1.2.0', '-m', '1.2.0']); - expect(spawnSync).calledWith('git', ['push', '--follow-tags']); - }); - - it('does not manually push tags with auxiliary packages', async function () { - getPackagesInTopologicalOrder.resolves(packages); - - await publishToNpm( - { isDryRun: false, useAuxiliaryPackagesOnly: true }, - getPackagesInTopologicalOrder, - markBumpedFilesAsAssumeUnchanged, - spawnSync - ); - - expect(spawnSync).not.calledWith('git', [ - 'tag', - '-a', - '1.2.0', - '-m', - '1.2.0', - ]); - expect(spawnSync).not.calledWith('git', ['push', '--follow-tags']); - }); - - it('calls lerna to publish packages for a real version', async function () { - getPackagesInTopologicalOrder.resolves(packages); - - await publishToNpm( - { isDryRun: false, useAuxiliaryPackagesOnly: false }, - getPackagesInTopologicalOrder, - markBumpedFilesAsAssumeUnchanged, - spawnSync - ); - - expect(markBumpedFilesAsAssumeUnchanged).to.have.been.calledWith( - packages, - true - ); - expect(spawnSync).to.have.been.calledWith( - lernaBin, - [ - 'publish', - 'from-package', - '--no-private', - '--no-changelog', - '--exact', - '--yes', - '--no-verify-access', - ], - sinon.match.any - ); - expect(markBumpedFilesAsAssumeUnchanged).to.have.been.calledWith( - packages, - false - ); - }); - - it('reverts the assume unchanged even on spawn failure', async function () { - getPackagesInTopologicalOrder.resolves(packages); - spawnSync.throws(new Error('meeep')); - - try { - await publishToNpm( - { isDryRun: false, useAuxiliaryPackagesOnly: false }, - getPackagesInTopologicalOrder, - markBumpedFilesAsAssumeUnchanged, - spawnSync - ); - } catch (e: any) { - expect(markBumpedFilesAsAssumeUnchanged).to.have.been.calledWith( - packages, - true - ); - expect(spawnSync).to.have.been.called; - expect(markBumpedFilesAsAssumeUnchanged).to.have.been.calledWith( - packages, - false - ); - return; - } - expect.fail('Expected error'); - }); - - describe('setReleasePublisher', function () { - let writeFileStub: sinon.SinonStub; - let readFileStub: sinon.SinonStub; - - const packages = [ - { name: 'package1', version: '1.0.0', location: 'packages/package1' }, - { name: 'package2', version: '2.0.0', location: 'packages/package2' }, - ]; - - beforeEach(function () { - writeFileStub = sinon.stub(fs, 'writeFile').resolves(); - - readFileStub = sinon.stub(fs, 'readFile'); - readFileStub.throws(); - readFileStub.withArgs('packages/package1/package.json', 'utf8').resolves( - JSON.stringify({ - name: packages[0].name, - version: packages[0].version, - }) - ); - readFileStub.withArgs('packages/package2/package.json', 'utf8').resolves( - JSON.stringify({ - name: packages[1].name, - version: packages[1].version, - }) - ); - }); - - afterEach(function () { - sinon.restore(); - }); - - it('should set the releasePublisher for each package and write the updated package.json', async function () { - const publisher = 'test-publisher'; - await setReleasePublisher(publisher, packages as PackageInfo[]); - - expect(writeFileStub.calledTwice).to.be.true; - - expect(writeFileStub.firstCall.args[0]).to.equal( - 'packages/package1/package.json' - ); - expect(JSON.parse(writeFileStub.firstCall.args[1])).to.deep.equal({ - name: 'package1', - version: '1.0.0', - releasePublisher: 'test-publisher', - }); - - expect(writeFileStub.secondCall.args[0]).to.equal( - 'packages/package2/package.json' - ); - expect(JSON.parse(writeFileStub.secondCall.args[1])).to.deep.equal({ - name: 'package2', - version: '2.0.0', - releasePublisher: 'test-publisher', - }); - }); - }); -}); diff --git a/packages/build/src/npm-packages/publish.ts b/packages/build/src/npm-packages/publish.ts deleted file mode 100644 index 7d761a8327..0000000000 --- a/packages/build/src/npm-packages/publish.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { - EXCLUDE_RELEASE_PACKAGES, - LERNA_BIN, - MONGOSH_RELEASE_PACKAGES, - PROJECT_ROOT, -} from './constants'; -import { spawnSync as spawnSyncFn } from '../helpers/spawn-sync'; -import { type SpawnSyncOptionsWithStringEncoding } from 'child_process'; -import type { PackageInfo } from '@mongodb-js/monorepo-tools'; -import { getPackagesInTopologicalOrder as getPackagesInTopologicalOrderFn } from '@mongodb-js/monorepo-tools'; -import { - getPackageConfigurations, - markBumpedFilesAsAssumeUnchanged, -} from './helpers'; -import { promises as fs } from 'fs'; - -export async function publishToNpm( - { isDryRun = false, useAuxiliaryPackagesOnly = false }, - getPackagesInTopologicalOrder: typeof getPackagesInTopologicalOrderFn = getPackagesInTopologicalOrderFn, - markBumpedFilesAsAssumeUnchangedFn: typeof markBumpedFilesAsAssumeUnchanged = markBumpedFilesAsAssumeUnchanged, - spawnSync: typeof spawnSyncFn = spawnSyncFn -): Promise { - const publisher = process.env.MONGOSH_RELEASE_PUBLISHER; - if (!useAuxiliaryPackagesOnly) { - if (!publisher) { - throw new Error( - 'MONGOSH_RELEASE_PUBLISHER is required for publishing mongosh' - ); - } - } - - const commandOptions: SpawnSyncOptionsWithStringEncoding = { - stdio: 'inherit', - cwd: PROJECT_ROOT, - encoding: 'utf8', - env: { - ...process.env, - ...(isDryRun ? { npm_config_dry_run: 'true' } : {}), - }, - }; - - let packages = (await getPackagesInTopologicalOrder(PROJECT_ROOT)).filter( - (packageConfig) => !EXCLUDE_RELEASE_PACKAGES.includes(packageConfig.name) - ); - - if (useAuxiliaryPackagesOnly) { - packages = packages.filter( - (packageConfig) => !MONGOSH_RELEASE_PACKAGES.includes(packageConfig.name) - ); - } - if (publisher) { - await setReleasePublisher(publisher, packages); - } - // Lerna requires a clean repository for a publish from-package - // we use git update-index --assume-unchanged on files we know have been bumped - markBumpedFilesAsAssumeUnchangedFn(packages, true); - try { - spawnSync( - LERNA_BIN, - [ - 'publish', - 'from-package', - '--no-private', - '--no-changelog', - '--exact', - '--yes', - '--no-verify-access', - ], - commandOptions - ); - } finally { - markBumpedFilesAsAssumeUnchangedFn(packages, false); - } - - if (!useAuxiliaryPackagesOnly) { - const mongoshVersion = packages.find( - (packageConfig) => packageConfig.name === 'mongosh' - )?.version; - - if (!mongoshVersion) { - throw new Error('mongosh package not found'); - } - - spawnSync( - 'git', - ['tag', '-a', `v${mongoshVersion}`, '-m', `v${mongoshVersion}`], - commandOptions - ); - - spawnSync('git', ['push', '--follow-tags'], commandOptions); - } -} - -export async function setReleasePublisher( - publisher: string, - packages: PackageInfo[] -): Promise { - const packageConfigurations = await getPackageConfigurations(packages); - - for (const [packageJsonPath, packageJson] of packageConfigurations) { - packageJson.releasePublisher = publisher; - - await fs.writeFile( - packageJsonPath, - JSON.stringify(packageJson, null, 2) + '\n' - ); - } -} diff --git a/packages/build/src/publish-auxiliary.ts b/packages/build/src/publish-auxiliary.ts deleted file mode 100644 index fa373a02df..0000000000 --- a/packages/build/src/publish-auxiliary.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Config } from './config'; -import { publishToNpm } from './npm-packages'; - -export async function publishAuxiliaryPackages(config: Config) { - if (!config.useAuxiliaryPackagesOnly) { - throw new Error( - 'This should only be used when publishing auxiliary packages' - ); - } - await publishToNpm(config); -} diff --git a/packages/build/src/publish-mongosh.spec.ts b/packages/build/src/publish-mongosh.spec.ts deleted file mode 100644 index 36d19f988d..0000000000 --- a/packages/build/src/publish-mongosh.spec.ts +++ /dev/null @@ -1,327 +0,0 @@ -import chai, { expect } from 'chai'; -import sinon from 'sinon'; -import type { writeBuildInfo as writeBuildInfoType } from './build-info'; -import { Barque } from './barque'; -import type { - Config, - shouldDoPublicRelease as shouldDoPublicReleaseFn, -} from './config'; -import type { createAndPublishDownloadCenterConfig as createAndPublishDownloadCenterConfigFn } from './download-center'; -import { GithubRepo } from '@mongodb-js/devtools-github-repo'; -import type { publishToHomebrew as publishToHomebrewType } from './homebrew'; -import type { publishToNpm as publishToNpmType } from './npm-packages'; -import { publishMongosh } from './publish-mongosh'; -import { dummyConfig } from '../test/helpers'; - -chai.use(require('sinon-chai')); - -function createStubRepo(overrides?: any): GithubRepo { - return sinon.createStubInstance( - GithubRepo, - overrides - ) as unknown as GithubRepo; -} - -function createStubBarque(overrides?: any): Barque { - return sinon.createStubInstance(Barque, overrides) as unknown as Barque; -} - -describe('publishMongosh', function () { - let config: Config; - let createAndPublishDownloadCenterConfig: typeof createAndPublishDownloadCenterConfigFn; - let publishToNpm: typeof publishToNpmType; - let writeBuildInfo: typeof writeBuildInfoType; - let publishToHomebrew: typeof publishToHomebrewType; - let shouldDoPublicRelease: typeof shouldDoPublicReleaseFn; - let githubRepo: GithubRepo; - let mongoHomebrewCoreForkRepo: GithubRepo; - let homebrewCoreRepo: GithubRepo; - let barque: Barque; - - beforeEach(function () { - config = { ...dummyConfig }; - - createAndPublishDownloadCenterConfig = sinon.spy(); - publishToNpm = sinon.spy(); - writeBuildInfo = sinon.spy(); - publishToHomebrew = sinon.spy(); - shouldDoPublicRelease = sinon.spy(); - githubRepo = createStubRepo(); - mongoHomebrewCoreForkRepo = createStubRepo(); - homebrewCoreRepo = createStubRepo(); - barque = createStubBarque({ - releaseToBarque: sinon.stub().resolves(['package-url']), - waitUntilPackagesAreAvailable: sinon.stub().resolves(), - }); - }); - - context('if is a public release', function () { - beforeEach(function () { - config.triggeringGitTag = 'v0.7.0'; - shouldDoPublicRelease = sinon.stub().returns(true); - githubRepo = createStubRepo({ - getMostRecentDraftTagForRelease: sinon - .stub() - .resolves({ name: 'v0.7.0-draft.42', sha: 'revision' }), - }); - Object.assign(githubRepo, { - repo: { - owner: 'mongodb-js', - repo: 'mongosh', - }, - }); - }); - - context('validates configuration', function () { - it('fails if no draft tag is found', async function () { - githubRepo = createStubRepo({ - getMostRecentDraftTagForRelease: sinon.stub().resolves(undefined), - }); - try { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - } catch (e: any) { - return expect(e.message).to.contain('Could not find prior draft tag'); - } - expect.fail('Expected error'); - }); - - it('fails if draft tag SHA does not match revision', async function () { - githubRepo = createStubRepo({ - getMostRecentDraftTagForRelease: sinon - .stub() - .resolves({ name: 'v0.7.0-draft.42', sha: 'wrong' }), - }); - try { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - } catch (e: any) { - return expect(e.message).to.contain('Version mismatch'); - } - expect.fail('Expected error'); - }); - }); - - it('publishes artifacts to barque', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(barque.releaseToBarque).to.have.been.callCount(26); - expect(barque.releaseToBarque).to.have.been.calledWith( - 'rpm-x64', - 'https://s3.amazonaws.com/mciuploads/project/v0.7.0-draft.42/mongodb-mongosh-0.7.0.x86_64.rpm' - ); - expect(barque.releaseToBarque).to.have.been.calledWith( - 'deb-x64', - 'https://s3.amazonaws.com/mciuploads/project/v0.7.0-draft.42/mongodb-mongosh_0.7.0_amd64.deb' - ); - expect(barque.releaseToBarque).to.have.been.calledWith( - 'rpm-arm64', - 'https://s3.amazonaws.com/mciuploads/project/v0.7.0-draft.42/mongodb-mongosh-0.7.0.aarch64.rpm' - ); - expect(barque.waitUntilPackagesAreAvailable).to.have.been.called; - }); - - it('updates the download center config', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(createAndPublishDownloadCenterConfig).to.have.been.calledWith( - config.outputDir, - config.packageInformation, - config.downloadCenterAwsKey, - config.downloadCenterAwsSecret - ); - }); - - it('promotes the release in github', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(githubRepo.promoteRelease).to.have.been.calledWith(config); - }); - - it('writes analytics config and then publishes NPM packages', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(writeBuildInfo).to.have.been.calledOnceWith(config); - expect(publishToNpm).to.have.been.calledWith(); - expect(publishToNpm).to.have.been.calledAfter(writeBuildInfo as any); - }); - it('publishes to homebrew', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(publishToHomebrew).to.have.been.calledWith( - homebrewCoreRepo, - mongoHomebrewCoreForkRepo, - config.version - ); - expect(publishToHomebrew).to.have.been.calledAfter( - githubRepo.promoteRelease as any - ); - }); - }); - - context('if is not a public release', function () { - beforeEach(function () { - shouldDoPublicRelease = sinon.stub().returns(false); - }); - - it('does not update the download center config', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(createAndPublishDownloadCenterConfig).not.to.have.been.called; - }); - - it('does not promote the release in github', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(githubRepo.promoteRelease).not.to.have.been.called; - }); - - it('does not publish npm packages', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(publishToNpm).not.to.have.been.called; - }); - - it('does not publish to homebrew', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(publishToHomebrew).not.to.have.been.called; - }); - - it('does not release to barque', async function () { - await publishMongosh( - config, - githubRepo, - mongoHomebrewCoreForkRepo, - homebrewCoreRepo, - barque, - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew, - shouldDoPublicRelease - ); - - expect(barque.releaseToBarque).not.to.have.been.called; - }); - }); -}); diff --git a/packages/build/src/publish-mongosh.ts b/packages/build/src/publish-mongosh.ts deleted file mode 100644 index 82402905ec..0000000000 --- a/packages/build/src/publish-mongosh.ts +++ /dev/null @@ -1,145 +0,0 @@ -import type { writeBuildInfo as writeBuildInfoType } from './build-info'; -import type { Barque } from './barque'; -import type { Config } from './config'; -import { - ALL_PACKAGE_VARIANTS, - getReleaseVersionFromTag, - shouldDoPublicRelease as shouldDoPublicReleaseFn, -} from './config'; -import type { createAndPublishDownloadCenterConfig as createAndPublishDownloadCenterConfigFn } from './download-center'; -import { getArtifactUrl as getArtifactUrlFn } from './evergreen'; -import type { GithubRepo } from '@mongodb-js/devtools-github-repo'; -import type { publishToHomebrew as publishToHomebrewType } from './homebrew'; -import type { publishToNpm as publishToNpmType } from './npm-packages'; -import type { PackageInformationProvider } from './packaging'; -import { getPackageFile } from './packaging'; - -export async function publishMongosh( - config: Config, - mongoshGithubRepo: GithubRepo, - mongodbHomebrewForkGithubRepo: GithubRepo, - homebrewCoreGithubRepo: GithubRepo, - barque: Barque, - createAndPublishDownloadCenterConfig: typeof createAndPublishDownloadCenterConfigFn, - publishToNpm: typeof publishToNpmType, - writeBuildInfo: typeof writeBuildInfoType, - publishToHomebrew: typeof publishToHomebrewType, - shouldDoPublicRelease: typeof shouldDoPublicReleaseFn = shouldDoPublicReleaseFn, - getEvergreenArtifactUrl: typeof getArtifactUrlFn = getArtifactUrlFn -): Promise { - if (!shouldDoPublicRelease(config)) { - console.warn( - 'mongosh: Not triggering publish - configuration does not match a public release!' - ); - return; - } - - if (config.isDryRun) { - console.warn('Performing dry-run publish only'); - } - - const releaseVersion = getReleaseVersionFromTag(config.triggeringGitTag); - const latestDraftTag = - await mongoshGithubRepo.getMostRecentDraftTagForRelease(releaseVersion); - if (!latestDraftTag || !releaseVersion) { - throw new Error( - `Could not find prior draft tag for release version: ${releaseVersion}` - ); - } - if (latestDraftTag.sha !== config.revision) { - throw new Error( - `Version mismatch - latest draft tag was for revision ${latestDraftTag.sha}, current revision is ${config.revision}` - ); - } - - console.info( - 'mongosh: Re-using artifacts from most recent draft tag', - latestDraftTag.name - ); - - await publishArtifactsToBarque( - barque, - config.project as string, - releaseVersion, - latestDraftTag.name, - config.packageInformation as PackageInformationProvider, - !!config.isDryRun, - getEvergreenArtifactUrl - ); - - await createAndPublishDownloadCenterConfig( - config.outputDir, - config.packageInformation as PackageInformationProvider, - config.downloadCenterAwsKey || '', - config.downloadCenterAwsSecret || '', - config.injectedJsonFeedFile || '', - !!config.isDryRun - ); - - await mongoshGithubRepo.promoteRelease(config); - - // ensures the segment api key to be present in the published packages - await writeBuildInfo(config, 'packaged'); - - await publishToNpm({ - isDryRun: config.isDryRun, - useAuxiliaryPackagesOnly: config.useAuxiliaryPackagesOnly, - }); - - await publishToHomebrew( - homebrewCoreGithubRepo, - mongodbHomebrewForkGithubRepo, - config.version, - `https://github.com/${mongoshGithubRepo.repo.owner}/${mongoshGithubRepo.repo.repo}/releases/tag/v${config.version}`, - !!config.isDryRun - ); - - console.info('mongosh: finished release process.'); -} - -async function publishArtifactsToBarque( - barque: Barque, - project: string, - releaseVersion: string, - mostRecentDraftTag: string, - packageInformation: PackageInformationProvider, - isDryRun: boolean, - getEvergreenArtifactUrl: typeof getArtifactUrlFn -): Promise { - const publishedPackages: string[] = []; - for await (const variant of ALL_PACKAGE_VARIANTS) { - const variantPackageInfo = packageInformation(variant); - const packageFile = getPackageFile(variant, () => ({ - ...variantPackageInfo, - metadata: { - ...variantPackageInfo.metadata, - version: releaseVersion, - }, - })); - const packageUrl = getEvergreenArtifactUrl( - project, - mostRecentDraftTag, - packageFile.path - ); - console.info( - `mongosh: Considering publishing ${variant} artifact to barque ${packageUrl}` - ); - const packageUrls = await barque.releaseToBarque( - variant, - packageUrl, - isDryRun - ); - for (const url of packageUrls) { - console.info(` -> ${url}`); - } - publishedPackages.push(...packageUrls); - } - - if (isDryRun) { - console.warn('Not waiting for package availability in dry run...'); - } else { - await barque.waitUntilPackagesAreAvailable(publishedPackages, 300); - } - - console.info('mongosh: Submitting to barque complete'); -} diff --git a/packages/build/src/release.ts b/packages/build/src/release.ts index 6460a25494..e87f6d3eff 100644 --- a/packages/build/src/release.ts +++ b/packages/build/src/release.ts @@ -1,29 +1,22 @@ import { Octokit } from '@octokit/rest'; -import { writeBuildInfo } from './build-info'; -import { Barque } from './barque'; import { runCompile } from './compile'; import type { Config } from './config'; import { getReleaseVersionFromTag, redactConfig } from './config'; -import { - createAndPublishDownloadCenterConfig, - uploadArtifactToDownloadCenter, -} from './download-center'; +import { uploadArtifactToDownloadCenter } from './download-center'; import { downloadArtifactFromEvergreen, uploadArtifactToEvergreen, } from './evergreen'; import { GithubRepo } from '@mongodb-js/devtools-github-repo'; -import { publishToHomebrew } from './homebrew'; -import { bumpAuxiliaryPackages, publishToNpm } from './npm-packages'; +import { bumpAuxiliaryPackages } from './npm-packages'; import { runPackage } from './packaging'; import { runDraft } from './run-draft'; -import { publishMongosh } from './publish-mongosh'; import { runUpload } from './run-upload'; import { runSign } from './packaging/run-sign'; import { runDownloadAndListArtifacts } from './run-download-and-list-artifacts'; import { runDownloadCryptLibrary } from './packaging/run-download-crypt-library'; import { bumpMongoshReleasePackages } from './npm-packages/bump'; -import { publishAuxiliaryPackages } from './publish-auxiliary'; +import { MongoshPublisher } from './mongosh-publisher'; export type ReleaseCommand = | 'bump' @@ -114,21 +107,13 @@ export async function release( } else if (command === 'download-and-list-artifacts') { await runDownloadAndListArtifacts(config); } else if (command === 'publish') { - if (config.useAuxiliaryPackagesOnly) { - publishAuxiliaryPackages(config); - } else { - await publishMongosh( - config, - githubRepo, - mongoHomebrewForkRepo, - homebrewCoreRepo, - new Barque(config), - createAndPublishDownloadCenterConfig, - publishToNpm, - writeBuildInfo, - publishToHomebrew - ); - } + const mongoshPublisher = new MongoshPublisher( + config, + githubRepo, + mongoHomebrewForkRepo, + homebrewCoreRepo + ); + await mongoshPublisher.publish(); } else { throw new Error(`Unknown command: ${command}`); } diff --git a/packages/build/test/helpers.ts b/packages/build/test/helpers.ts index 27568d0bc0..c95c16d876 100644 --- a/packages/build/test/helpers.ts +++ b/packages/build/test/helpers.ts @@ -57,6 +57,7 @@ export const dummyConfig: Config = Object.freeze({ notaryAuthToken: 'notaryAuthToken', isCi: true, platform: 'linux', + publisher: 'dummy-test-publisher', repo: { owner: 'owner', repo: 'repo', From 233a4b4b2a8e97f25f7c2c3b03b037c5d31600a6 Mon Sep 17 00:00:00 2001 From: gagik Date: Fri, 17 Jan 2025 09:56:05 +0100 Subject: [PATCH 36/36] fix(ci): use path.join to fix cross-platform test failures --- packages/build/src/npm-packages/npm-publisher.spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/build/src/npm-packages/npm-publisher.spec.ts b/packages/build/src/npm-packages/npm-publisher.spec.ts index fc302ba91c..5180153760 100644 --- a/packages/build/src/npm-packages/npm-publisher.spec.ts +++ b/packages/build/src/npm-packages/npm-publisher.spec.ts @@ -293,7 +293,7 @@ describe('npm-packages NpmPublisher', function () { expect(writeFileStub).has.callCount(packages.length); expect(writeFileStub.firstCall.args[0]).to.equal( - 'packages/package1/package.json' + path.join(packages[0].location, 'package.json') ); expect( JSON.parse(writeFileStub.firstCall.args[1] as string) @@ -304,7 +304,7 @@ describe('npm-packages NpmPublisher', function () { }); expect(writeFileStub.secondCall.args[0]).to.equal( - 'packages/mongosh/package.json' + path.join(packages[1].location, 'package.json') ); expect( JSON.parse(writeFileStub.secondCall.args[1] as string)