From 8cba7935b7b01e3c25770e3033713b550991fca8 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Thu, 1 Aug 2024 12:45:38 +0200 Subject: [PATCH] Merge pull request #19689 from overleaf/jpa-editor-core-cjs [overleaf-editor-core] remove Node.js stdlib import and tweak babel config GitOrigin-RevId: 2ac13cc17651a3b522606f8df23c7e6915be19a6 --- libraries/overleaf-editor-core/lib/safe_pathname.js | 2 +- libraries/overleaf-editor-core/package.json | 3 ++- package-lock.json | 10 +++++----- services/web/babel.config.json | 4 ++++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/libraries/overleaf-editor-core/lib/safe_pathname.js b/libraries/overleaf-editor-core/lib/safe_pathname.js index 637c003604..04deafdb29 100644 --- a/libraries/overleaf-editor-core/lib/safe_pathname.js +++ b/libraries/overleaf-editor-core/lib/safe_pathname.js @@ -1,7 +1,7 @@ /** @module */ 'use strict' -const path = require('path') +const path = require('path-browserify') /** * Regular expressions for Overleaf v2 taken from diff --git a/libraries/overleaf-editor-core/package.json b/libraries/overleaf-editor-core/package.json index 1c57be6403..8dbf72952f 100644 --- a/libraries/overleaf-editor-core/package.json +++ b/libraries/overleaf-editor-core/package.json @@ -26,6 +26,7 @@ "@overleaf/o-error": "*", "check-types": "^5.1.0", "lodash": "^4.17.19", - "p-map": "^4.0.0" + "p-map": "^4.0.0", + "path-browserify": "^1.0.1" } } diff --git a/package-lock.json b/package-lock.json index c8238732f0..132def7afa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -341,7 +341,8 @@ "@overleaf/o-error": "*", "check-types": "^5.1.0", "lodash": "^4.17.19", - "p-map": "^4.0.0" + "p-map": "^4.0.0", + "path-browserify": "^1.0.1" }, "devDependencies": { "chai": "^3.3.0", @@ -31535,8 +31536,7 @@ "node_modules/path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, "node_modules/path-exists": { "version": "4.0.0", @@ -72070,6 +72070,7 @@ "lodash": "^4.17.19", "mocha": "^10.2.0", "p-map": "^4.0.0", + "path-browserify": "^1.0.1", "sinon": "^9.2.4", "typescript": "^5.0.4" }, @@ -72477,8 +72478,7 @@ "path-browserify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-1.0.1.tgz", - "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==", - "dev": true + "integrity": "sha512-b7uo2UCUOYZcnF/3ID0lulOJi/bafxa1xPe7ZPsammBSpjSWQkjNxlt635YGS2MiR9GjvuXCtz2emr3jbsz98g==" }, "path-exists": { "version": "4.0.0", diff --git a/services/web/babel.config.json b/services/web/babel.config.json index 26fc60f388..75c21e2cb2 100644 --- a/services/web/babel.config.json +++ b/services/web/babel.config.json @@ -33,6 +33,10 @@ { "test": "../../**/*.cjs", "sourceType": "script" + }, + { + "test": "../../libraries/overleaf-editor-core/**/*.js", + "sourceType": "script" } ] }