Skip to content

Commit

Permalink
cherry-pick(#15237): chore: roll source-map-support to 0.5.21 (#15241)
Browse files Browse the repository at this point in the history
SHA: 28f382b
Co-authored-by: Max Schmitt <[email protected]>
  • Loading branch information
mxschmitt authored Jun 29, 2022
1 parent 389aa59 commit e9200c5
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 39 deletions.
41 changes: 34 additions & 7 deletions packages/playwright-test/ThirdPartyNotices.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ This project incorporates components from the projects listed below. The origina
- [email protected] (https://github.com/airbnb/babel-plugin-dynamic-import-node)
- [email protected] (https://github.com/micromatch/braces)
- [email protected] (https://github.com/browserslist/browserslist)
- [email protected] (https://github.com/LinusU/buffer-from)
- [email protected] (https://github.com/ljharb/call-bind)
- [email protected] (https://github.com/browserslist/caniuse-lite)
- [email protected] (https://github.com/chalk/chalk)
Expand Down Expand Up @@ -133,8 +134,8 @@ This project incorporates components from the projects listed below. The origina
- [email protected] (https://github.com/feross/safe-buffer)
- [email protected] (https://github.com/npm/node-semver)
- [email protected] (https://github.com/sindresorhus/slash)
- source-map-support@0.4.18 (https://github.com/evanw/node-source-map-support)
- source-map@0.5.7 (https://github.com/mozilla/source-map)
- source-map-support@0.5.21 (https://github.com/evanw/node-source-map-support)
- source-map@0.6.1 (https://github.com/mozilla/source-map)
- [email protected] (https://github.com/tapjs/stack-utils)
- [email protected] (https://github.com/chalk/supports-color)
- [email protected] (https://github.com/chalk/supports-color)
Expand Down Expand Up @@ -2262,6 +2263,32 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
=========================================
END OF [email protected] AND INFORMATION

%% [email protected] NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License

Copyright (c) 2016, 2018 Linus Unnebäck

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.
=========================================
END OF [email protected] AND INFORMATION

%% [email protected] NOTICES AND INFORMATION BEGIN HERE
=========================================
MIT License
Expand Down Expand Up @@ -3820,7 +3847,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
=========================================
END OF [email protected] AND INFORMATION

%% source-map-support@0.4.18 NOTICES AND INFORMATION BEGIN HERE
%% source-map-support@0.5.21 NOTICES AND INFORMATION BEGIN HERE
=========================================
The MIT License (MIT)

Expand All @@ -3844,9 +3871,9 @@ 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.
=========================================
END OF source-map-support@0.4.18 AND INFORMATION
END OF source-map-support@0.5.21 AND INFORMATION

%% source-map@0.5.7 NOTICES AND INFORMATION BEGIN HERE
%% source-map@0.6.1 NOTICES AND INFORMATION BEGIN HERE
=========================================
Copyright (c) 2009-2011, Mozilla Foundation and contributors
All rights reserved.
Expand Down Expand Up @@ -3876,7 +3903,7 @@ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
=========================================
END OF source-map@0.5.7 AND INFORMATION
END OF source-map@0.6.1 AND INFORMATION

%% [email protected] NOTICES AND INFORMATION BEGIN HERE
=========================================
Expand Down Expand Up @@ -3975,6 +4002,6 @@ END OF [email protected] AND INFORMATION

SUMMARY BEGIN HERE
=========================================
Total Packages: 136
Total Packages: 137
=========================================
END OF SUMMARY
11 changes: 7 additions & 4 deletions packages/playwright-test/bundles/utils/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,17 @@ const esbuild = require('esbuild');

// Can be removed once source-map-support was is fixed.
/** @type{import('esbuild').Plugin} */
let patchSourceMapSupportHideBufferDeprecationWarning = {
let patchSource = {
name: 'patch-source-map-support-deprecation',
setup(build) {
build.onResolve({ filter: /^source-map-support$/ }, () => {
const originalPath = require.resolve('source-map-support');
const patchedPath = path.join(path.dirname(originalPath), path.basename(originalPath, '.js') + '.pw-patched.js');
let sourceFileContent = fs.readFileSync(originalPath, 'utf8')
sourceFileContent = sourceFileContent.replace(/new Buffer\(rawData/g, 'Buffer.from(rawData');
let sourceFileContent = fs.readFileSync(originalPath, 'utf8');
// source-map-support is overwriting __PW_ZONE__ with func in core if source maps are present.
const original = `return state.nextPosition.name || originalFunctionName();`;
const insertedLine = `if (state.nextPosition.name === 'func') return originalFunctionName() || 'func';`;
sourceFileContent = sourceFileContent.replace(original, insertedLine + original);
fs.writeFileSync(patchedPath, sourceFileContent);
return { path: patchedPath }
});
Expand All @@ -39,7 +42,7 @@ esbuild.build({
entryPoints: [path.join(__dirname, 'src/utilsBundleImpl.ts')],
bundle: true,
outdir: path.join(__dirname, '../../lib'),
plugins: [patchSourceMapSupportHideBufferDeprecationWarning],
plugins: [patchSource],
format: 'cjs',
platform: 'node',
target: 'ES2019',
Expand Down
49 changes: 22 additions & 27 deletions packages/playwright-test/bundles/utils/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/playwright-test/bundles/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"json5": "2.2.1",
"open": "8.4.0",
"pirates": "4.0.4",
"source-map-support": "0.4.18"
"source-map-support": "0.5.21"
},
"devDependencies": {
"@types/source-map-support": "^0.5.4"
Expand Down

0 comments on commit e9200c5

Please sign in to comment.