From b5c05d6049ca29f5de8a52d567b761a84e379b34 Mon Sep 17 00:00:00 2001 From: Ben Houston Date: Sat, 22 Jul 2023 22:27:06 -0400 Subject: [PATCH] cross-platform source-map support for node.js apps. --- apps/exec-graph/bin/cli.js | 3 ++- apps/exec-graph/src/index.ts | 1 - apps/export-node-spec/bin/cli.js | 3 ++- package-lock.json | 22 +++++++++++++++------- package.json | 1 + 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/apps/exec-graph/bin/cli.js b/apps/exec-graph/bin/cli.js index 8c6aa33c..9fe65a5d 100755 --- a/apps/exec-graph/bin/cli.js +++ b/apps/exec-graph/bin/cli.js @@ -1,4 +1,5 @@ -#!/usr/bin/env node --enable-source-maps +#!/usr/bin/env node +import 'source-map-support/register.js'; // required for cross platform source map support, other options didn't work across OSes. import { main } from '../dist/index.js'; diff --git a/apps/exec-graph/src/index.ts b/apps/exec-graph/src/index.ts index 300328fd..db1dbad8 100644 --- a/apps/exec-graph/src/index.ts +++ b/apps/exec-graph/src/index.ts @@ -52,7 +52,6 @@ async function execGraph({ if (programOptions.logLevel) { Logger.logLevel = programOptions.logLevel as LogLevel; } - const graphJsonPath = jsonPattern; Logger.verbose(`reading behavior graph: ${graphJsonPath}`); const textFile = await fs.readFile(graphJsonPath); diff --git a/apps/export-node-spec/bin/cli.js b/apps/export-node-spec/bin/cli.js index 8c6aa33c..9fe65a5d 100755 --- a/apps/export-node-spec/bin/cli.js +++ b/apps/export-node-spec/bin/cli.js @@ -1,4 +1,5 @@ -#!/usr/bin/env node --enable-source-maps +#!/usr/bin/env node +import 'source-map-support/register.js'; // required for cross platform source map support, other options didn't work across OSes. import { main } from '../dist/index.js'; diff --git a/package-lock.json b/package-lock.json index 8b5e56a8..9b5917b7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,6 +16,7 @@ "commander": "^9.4.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "source-map-support": "^0.5.21", "vite": "^3.2.4" }, "devDependencies": { @@ -6331,8 +6332,7 @@ "node_modules/buffer-from": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", - "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", - "dev": true + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "node_modules/builtins": { "version": "5.0.1", @@ -12603,6 +12603,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/jest-runner/node_modules/source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, "node_modules/jest-runner/node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -18232,7 +18242,6 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -18247,10 +18256,9 @@ } }, "node_modules/source-map-support": { - "version": "0.5.13", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", - "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", - "dev": true, + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" diff --git a/package.json b/package.json index 0192841b..d71e7c20 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "commander": "^9.4.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "source-map-support": "^0.5.21", "vite": "^3.2.4" }, "devDependencies": {