From 52d8f731beab1a27149f2204c00ebe106a4c3951 Mon Sep 17 00:00:00 2001 From: Julien Ganichot Date: Wed, 15 Nov 2023 10:53:04 +0100 Subject: [PATCH] fix: tryfix --- action.yml | 2 +- bootstrap.cjs | 14 -------------- bootstrap.mjs | 13 +++++++++++++ scripts/install-dependencies.sh | 2 +- tsconfig.common.json | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 bootstrap.cjs create mode 100644 bootstrap.mjs diff --git a/action.yml b/action.yml index 8de9703dc..9e543a33a 100644 --- a/action.yml +++ b/action.yml @@ -71,5 +71,5 @@ outputs: Released version in format of X.Y.Z (major.minor.patch-prerelease+build). name: Release me! runs: - main: bootstrap.cjs + main: bootstrap.mjs using: node20 diff --git a/bootstrap.cjs b/bootstrap.cjs deleted file mode 100644 index 41c874df7..000000000 --- a/bootstrap.cjs +++ /dev/null @@ -1,14 +0,0 @@ -const { execSync } = require('child_process'); - -try { - // Install dependencies - execSync( - 'npm ci --only=production --no-audit --no-progress --prefer-offline', - { stdio: 'inherit' }, - ); - - require('./dist/index.js'); -} catch (error) { - console.error('Error during installation of dependencies:', error); - process.exit(1); -} diff --git a/bootstrap.mjs b/bootstrap.mjs new file mode 100644 index 000000000..6d0daa44a --- /dev/null +++ b/bootstrap.mjs @@ -0,0 +1,13 @@ +import { execSync } from 'child_process'; + +try { + // Install dependencies + execSync('npm ci --omit=dev --no-audit --no-progress --prefer-offline', { + stdio: 'inherit', + }); + + await import('./dist/index.js'); +} catch (error) { + console.error('Error during installation of dependencies:', error); + process.exit(1); +} diff --git a/scripts/install-dependencies.sh b/scripts/install-dependencies.sh index dacf6ab62..5b6bb07df 100755 --- a/scripts/install-dependencies.sh +++ b/scripts/install-dependencies.sh @@ -2,7 +2,7 @@ set -ex -npm --prefix "$1" ci "$1" --only=production --no-audit --no-progress --prefer-offline +npm --prefix "$1" ci "$1" --omit=dev --no-audit --no-progress --prefer-offline if [ "$#" -gt 1 ]; then # Install additional packages. diff --git a/tsconfig.common.json b/tsconfig.common.json index 4f7a38892..530d1f98b 100644 --- a/tsconfig.common.json +++ b/tsconfig.common.json @@ -1,7 +1,7 @@ { "extends": "@tsconfig/node20/tsconfig.json", "exclude": ["node_modules"], - "include": ["./jest.config.ts", "./src/**/*.ts", "./__mocks__/**/*.ts"], + "include": ["./bootstrap.mjs", "./jest.config.ts", "./src/**/*.ts", "./__mocks__/**/*.ts"], "compilerOptions": { "declaration": true, "declarationMap": true,