From 10b358a7326170faafc0f4b8d630fcc3e012c6d7 Mon Sep 17 00:00:00 2001 From: Thijs Louisse Date: Tue, 23 Nov 2021 10:06:15 +0100 Subject: [PATCH] fix(providence): example conf file esm compatible --- .changeset/kind-zoos-bathe.md | 1 + packages-node/providence-analytics/package.json | 2 +- packages-node/providence-analytics/providence.conf.mjs | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.changeset/kind-zoos-bathe.md b/.changeset/kind-zoos-bathe.md index 88fc0f632..b65e63e0b 100644 --- a/.changeset/kind-zoos-bathe.md +++ b/.changeset/kind-zoos-bathe.md @@ -4,3 +4,4 @@ - correctly dedupe match-imports exportSpecifiers - windows compatibility +- example conf file esm compatible diff --git a/packages-node/providence-analytics/package.json b/packages-node/providence-analytics/package.json index 0baf424d8..a1171a30b 100644 --- a/packages-node/providence-analytics/package.json +++ b/packages-node/providence-analytics/package.json @@ -21,7 +21,7 @@ "scripts": { "dashboard": "node ./dashboard/src/server.js --serve-from-package-root", "match-lion-imports": "npm run providence analyze match-imports --search-target-collection @lion-targets --reference-collection @lion-references", - "providence": "node --max-old-space-size=8192 ./src/cli/index.js", + "providence": "node --max-old-space-size=8192 ./src/cli/index.mjs", "publish-docs": "node ../../packages-node/publish-docs/src/cli.js --github-url https://github.com/ing-bank/lion/ --git-root-dir ../../", "prepublishOnly": "npm run publish-docs", "test:node": "mocha './test-node/**/*.test.js'", diff --git a/packages-node/providence-analytics/providence.conf.mjs b/packages-node/providence-analytics/providence.conf.mjs index aad770c56..d59e9fe30 100644 --- a/packages-node/providence-analytics/providence.conf.mjs +++ b/packages-node/providence-analytics/providence.conf.mjs @@ -1,5 +1,8 @@ -import pathLib from 'path'; +import pathLib, { dirname } from 'path'; import fs from 'fs'; +import { fileURLToPath } from 'url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); // This file is read by dashboard and cli and needs to be present under process.cwd() // It mainly serves as an example and it allows to run the dashboard locally