From edbd97a10800a7cb97c5d937f90322161b36ca9f Mon Sep 17 00:00:00 2001 From: Thomas Scholtes Date: Tue, 26 Nov 2024 22:47:03 +0100 Subject: [PATCH] chore: remove legacy import assertion unsupported by Node v22 (#754) --- .github/workflows/test.yml | 9 ++++++++- packages/core/rollup.config.js | 8 ++++++-- packages/vite/rollup.config.js | 7 +++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b6e22c25..ae121dee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,11 @@ name: Unit tests -on: pull_request + +on: + push: + branches: + - main + pull_request: + jobs: test: @@ -16,6 +22,7 @@ jobs: - uses: pnpm/action-setup@v4.0.0 - uses: actions/setup-node@v4 with: + node-version: ${{ matrix.node-version }} cache: 'pnpm' - name: Install dependencies run: pnpm install diff --git a/packages/core/rollup.config.js b/packages/core/rollup.config.js index 8f864372..8a335b6d 100644 --- a/packages/core/rollup.config.js +++ b/packages/core/rollup.config.js @@ -1,6 +1,10 @@ import typescript from '@rollup/plugin-typescript' -import pkg from './package.json' assert { type: 'json' } -import { builtinModules as builtins } from 'module' +import * as fs from 'node:fs/promises' +import * as path from 'node:path' +import { builtinModules as builtins } from 'node:module' +import { fileURLToPath } from 'node:url' + +const pkg = JSON.parse(await fs.readFile(path.join(fileURLToPath(import.meta.url), '..', 'package.json'))) const deps = Object.keys(pkg.dependencies || {}) diff --git a/packages/vite/rollup.config.js b/packages/vite/rollup.config.js index 8f864372..4ade68b9 100644 --- a/packages/vite/rollup.config.js +++ b/packages/vite/rollup.config.js @@ -1,7 +1,10 @@ import typescript from '@rollup/plugin-typescript' -import pkg from './package.json' assert { type: 'json' } -import { builtinModules as builtins } from 'module' +import * as fs from 'node:fs/promises' +import * as path from 'node:path' +import { builtinModules as builtins } from 'node:module' +import { fileURLToPath } from 'node:url' +const pkg = JSON.parse(await fs.readFile(path.join(fileURLToPath(import.meta.url), '..', 'package.json'))) const deps = Object.keys(pkg.dependencies || {}) export default {