From cd47de6da94317a6e15231e8e270779325bab13f Mon Sep 17 00:00:00 2001 From: Ugo Bechameil Date: Fri, 12 Jul 2024 15:52:22 +0200 Subject: [PATCH] Use assert --- .github/workflows/publish-studio-native-modules.yml | 2 +- bin/get-electron-major-version.js | 2 +- bin/publish-studio-natives.js | 4 ++-- bin/rebuild.js | 2 +- lib/build-metadata.js | 4 ++-- package.json | 2 +- test/install-before-test-run.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/publish-studio-native-modules.yml b/.github/workflows/publish-studio-native-modules.yml index f8b68f0..9e92cc2 100644 --- a/.github/workflows/publish-studio-native-modules.yml +++ b/.github/workflows/publish-studio-native-modules.yml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-node@v4 with: cache: npm - node-version: 22 + node-version: 20 - name: Install toolkit run: npm ci - name: Set Electron Major version in env diff --git a/bin/get-electron-major-version.js b/bin/get-electron-major-version.js index 5bd3d92..40d0af9 100755 --- a/bin/get-electron-major-version.js +++ b/bin/get-electron-major-version.js @@ -1,4 +1,4 @@ import semver from 'semver'; -import electron from 'electron/package.json' with { type: 'json' }; +import electron from 'electron/package.json' assert { type: 'json' }; console.log(semver.major(electron.version)); diff --git a/bin/publish-studio-natives.js b/bin/publish-studio-natives.js index e56c3d3..d40db00 100644 --- a/bin/publish-studio-natives.js +++ b/bin/publish-studio-natives.js @@ -1,4 +1,4 @@ -import pkg from '../modulesToBuild.json' with { type: 'json' }; +import pkg from '../modulesToBuild.json' assert { type: 'json' }; import { resolve } from 'node:path'; import { writeFile } from 'node:fs/promises'; import { publishToNPM } from '../lib/publish.js'; @@ -10,7 +10,7 @@ const deps = pkg.map(({ name, rescopedModuleName, version }) => { const windowsSpecificDep = [{'@hackolade/winapi-detect-rdp': '1.2.0'}]; const { default: studioNativesPkg } = await import('../studio-natives-modules/package.json', { - with: { type: 'json' }, + assert: { type: 'json' }, }); studioNativesPkg.dependencies = [...deps, ...windowsSpecificDep].reduce((acc, dep) => {return {...dep, ...acc}}, {}); diff --git a/bin/rebuild.js b/bin/rebuild.js index e14b5e0..97d133f 100644 --- a/bin/rebuild.js +++ b/bin/rebuild.js @@ -1,5 +1,5 @@ import { build } from '#lib/build.js'; -import modules from '../modulesToBuild.json' with { type: 'json' }; +import modules from '../modulesToBuild.json' assert { type: 'json' }; import { LOGGER } from '#lib/logger.js'; import { ROOT_DIR } from '#root'; import { runPatchPackage } from '../lib/install.js'; diff --git a/lib/build-metadata.js b/lib/build-metadata.js index b971aad..2fc8fc0 100644 --- a/lib/build-metadata.js +++ b/lib/build-metadata.js @@ -1,5 +1,5 @@ -import pkg from '../package.json' with { type: 'json' }; -import electron from 'electron/package.json' with { type: 'json' }; +import pkg from '../package.json' assert { type: 'json' }; +import electron from 'electron/package.json' assert { type: 'json' }; import semver from 'semver'; import { join, resolve, sep } from 'node:path'; diff --git a/package.json b/package.json index 9049320..1662e6b 100644 --- a/package.json +++ b/package.json @@ -139,6 +139,6 @@ "#root": "./root.js" }, "engines": { - "node": "^22" + "node": "^20" } } diff --git a/test/install-before-test-run.js b/test/install-before-test-run.js index c071376..d1e17bc 100644 --- a/test/install-before-test-run.js +++ b/test/install-before-test-run.js @@ -1,7 +1,7 @@ import { npmCommand } from '../lib/commands.js'; import { exec } from '../lib/exec.js'; -import pkg from '../modulesToBuild.json' with { type: 'json' }; +import pkg from '../modulesToBuild.json' assert { type: 'json' }; import { platform } from 'node:os'; const deps = pkg.map(({ rescopedModuleName, version }) => `${rescopedModuleName}@${version}`);