build(simulator): use node.js builtin source maps support
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 5 Nov 2023 21:59:15 +0000 (22:59 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 5 Nov 2023 21:59:15 +0000 (22:59 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
docker/start.sh
manifest-cf-template.yml
package.json
pnpm-lock.yaml

index a244fcafb83e6836b917c9995b292b6f6419ac75..a47dc38591cd072edbe054750d4b17903bbac65a 100755 (executable)
@@ -1,4 +1,4 @@
 #!/usr/bin/env sh
 
-node -r source-map-support/register dist/start.js &
+node --enable-source-maps dist/start.js &
 node webui/start.js
index f472369402684b269ada23246317fd542a599428..8804ef1dd58677dd1d9ca80c946fd919ffd5b9a8 100644 (file)
@@ -9,9 +9,7 @@ applications:
     routes:
       - route: e-mobility-charging-stations-simulator.cfapps.sap.hana.ondemand.com
     health-check-type: process
-    # debug deployed app development build
-    # command: node -r source-map-support/register dist/start.js
     command: node dist/start.js
     env:
       # OPTIMIZE_MEMORY: true
-      NODE_OPTIONS: --stack-trace-limit=1024 --max-old-space-size=768
+      NODE_OPTIONS: --enable-source-maps --stack-trace-limit=1024 --max-old-space-size=768
index b5e79c96292de518b7c7c43f7bb2f8a75e83ce83..42d00538fccca76ab241e3f1e4aaed938449ffbf 100644 (file)
     "preinstall": "node skip-preinstall.js || npx --yes only-allow pnpm",
     "prepare": "node prepare.js",
     "build-requirements": "node --no-warnings build-requirements.js",
-    "start": "pnpm build && cross-env NODE_ENV=production node dist/start.js",
-    "start:dev": "pnpm build:dev && cross-env NODE_ENV=development node -r source-map-support/register dist/start.js",
-    "start:dev:debug": "pnpm build:dev && cross-env NODE_ENV=development node -r source-map-support/register --inspect dist/start.js",
-    "start:prof": "cross-env NODE_ENV=production node -r source-map-support/register --prof dist/start.js",
-    "start:doctorprof": "cross-env NODE_ENV=production clinic doctor -- node -r source-map-support/register dist/start.js",
-    "start:flameprof": "cross-env NODE_ENV=production clinic flame -- node -r source-map-support/register dist/start.js",
-    "start:bubbleprof": "cross-env NODE_ENV=production clinic bubbleprof -- node -r source-map-support/register dist/start.js",
-    "start:heapprofiler": "cross-env NODE_ENV=production clinic heapprofiler -- node -r source-map-support/register dist/start.js",
+    "start": "pnpm build && cross-env NODE_ENV=production node --enable-source-maps dist/start.js",
+    "start:dev": "pnpm build:dev && cross-env NODE_ENV=development node --enable-source-maps dist/start.js",
+    "start:dev:debug": "pnpm build:dev && cross-env NODE_ENV=development node --enable-source-maps --inspect dist/start.js",
+    "start:prof": "cross-env NODE_ENV=production node --enable-source-maps --prof dist/start.js",
+    "start:doctorprof": "cross-env NODE_ENV=production clinic doctor -- node --enable-source-maps dist/start.js",
+    "start:flameprof": "cross-env NODE_ENV=production clinic flame -- node --enable-source-maps dist/start.js",
+    "start:bubbleprof": "cross-env NODE_ENV=production clinic bubbleprof -- node --enable-source-maps dist/start.js",
+    "start:heapprofiler": "cross-env NODE_ENV=production clinic heapprofiler -- node --enable-source-maps dist/start.js",
     "esbuild": "pnpm build-requirements && node bundle.js",
     "build": "pnpm esbuild",
     "build:cf": "pnpm clean:node_modules && npx cross-env SKIP_PREINSTALL=1 npm install && pnpm esbuild",
     "mnemonist": "^0.39.5",
     "mongodb": "^6.2.0",
     "poolifier": "^3.0.5",
-    "source-map-support": "^0.5.21",
     "tar": "^6.2.0",
     "tslib": "^2.6.2",
     "winston": "^3.11.0",
index 33cd776f377082fbe7c456d964866a93b35ff0c0..3d7fef65cd49e09783ad4f17e2a92c1d16e6fd72 100644 (file)
@@ -59,9 +59,6 @@ dependencies:
   poolifier:
     specifier: ^3.0.5
     version: 3.0.5
-  source-map-support:
-    specifier: ^0.5.21
-    version: 0.5.21
   tar:
     specifier: ^6.2.0
     version: 6.2.0
@@ -2655,6 +2652,7 @@ packages:
 
   /buffer-from@1.1.2:
     resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==}
+    dev: true
 
   /buffer-xor@1.0.3:
     resolution: {integrity: sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==}
@@ -8697,6 +8695,7 @@ packages:
     dependencies:
       buffer-from: 1.1.2
       source-map: 0.6.1
+    dev: true
 
   /source-map@0.5.7:
     resolution: {integrity: sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==}
@@ -8706,6 +8705,7 @@ packages:
   /source-map@0.6.1:
     resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==}
     engines: {node: '>=0.10.0'}
+    dev: true
 
   /sourcemap-codec@1.4.8:
     resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==}