Skip to content

Commit

Permalink
Use assert
Browse files Browse the repository at this point in the history
  • Loading branch information
bigorn0 committed Jul 12, 2024
1 parent 4b9dfd4 commit cd47de6
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-studio-native-modules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/get-electron-major-version.js
Original file line number Diff line number Diff line change
@@ -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));
4 changes: 2 additions & 2 deletions bin/publish-studio-natives.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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}}, {});

Expand Down
2 changes: 1 addition & 1 deletion bin/rebuild.js
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions lib/build-metadata.js
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,6 @@
"#root": "./root.js"
},
"engines": {
"node": "^22"
"node": "^20"
}
}
2 changes: 1 addition & 1 deletion test/install-before-test-run.js
Original file line number Diff line number Diff line change
@@ -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}`);
Expand Down

0 comments on commit cd47de6

Please sign in to comment.