From c5e7fd981238487176a43b438872439c7f50c05f Mon Sep 17 00:00:00 2001 From: Robert Knight <95928279+microbit-robert@users.noreply.github.com> Date: Thu, 5 Sep 2024 09:41:03 +0100 Subject: [PATCH] Update header-gen package.json to fix import issue (#8) * Update header-gen package.json to fix import issue * Move jest config to json file to handle es module --- header-gen/jest.config.js | 5 ----- header-gen/jest.config.json | 5 +++++ header-gen/package.json | 6 ++++++ 3 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 header-gen/jest.config.js create mode 100644 header-gen/jest.config.json diff --git a/header-gen/jest.config.js b/header-gen/jest.config.js deleted file mode 100644 index 1c8de09..0000000 --- a/header-gen/jest.config.js +++ /dev/null @@ -1,5 +0,0 @@ -module.exports = { - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/?(*.)+(spec|test).[tj]s?(x)'] -}; diff --git a/header-gen/jest.config.json b/header-gen/jest.config.json new file mode 100644 index 0000000..e2273a3 --- /dev/null +++ b/header-gen/jest.config.json @@ -0,0 +1,5 @@ +{ + "preset": "ts-jest", + "testEnvironment": "node", + "testMatch": ["**/?(*.)+(spec|test).[tj]s?(x)"] +} diff --git a/header-gen/package.json b/header-gen/package.json index 809e62d..8bbaedb 100644 --- a/header-gen/package.json +++ b/header-gen/package.json @@ -4,12 +4,18 @@ "description": "A simple TS script to generate a header blob for the ML runner", "author": "Micro:bit Educational Foundation ", "license": "MIT", + "type": "module", "module": "./built/main.js", "typings": "./built/main.d.ts", "files": [ "./built/*.js", "./built/*.d.ts" ], + "exports": { + ".": { + "import": "./built/main.js" + } + }, "scripts": { "start": "ts-node --project tsconfig.cli.json src/cli.ts", "test": "jest",