mirror of
https://github.com/actions/setup-node.git
synced 2025-12-19 06:47:08 +00:00
feat: migrate to ESM and update Jest configuration
- Added package.json in dist/setup to specify module type as ESM. - Updated jest.config.js to support ESM with ts-jest and added moduleNameMapper for .js extensions. - Created jest.setup.js to ensure Jest globals are available in ESM mode. - Modified test script in package.json to use node with experimental VM modules for Jest. - Updated imports in various distribution files to include .js extensions for ESM compatibility. - Adjusted tsconfig.json to exclude __tests__ directory and maintain ESM settings. - Updated package-lock.json to include new dependencies and their versions.
This commit is contained in:
parent
100690a6a6
commit
81b484e462
28 changed files with 3641 additions and 5337 deletions
|
|
@ -2,8 +2,8 @@ import * as tc from '@actions/tool-cache';
|
|||
|
||||
import semver from 'semver';
|
||||
|
||||
import BaseDistribution from './base-distribution';
|
||||
import {NodeInputs} from './base-models';
|
||||
import BaseDistribution from './base-distribution.js';
|
||||
import {NodeInputs} from './base-models.js';
|
||||
|
||||
export default abstract class BasePrereleaseNodejs extends BaseDistribution {
|
||||
protected abstract distribution: string;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ import * as path from 'path';
|
|||
import os from 'os';
|
||||
import fs from 'fs';
|
||||
|
||||
import {NodeInputs, INodeVersion, INodeVersionInfo} from './base-models';
|
||||
import {NodeInputs, INodeVersion, INodeVersionInfo} from './base-models.js';
|
||||
|
||||
export default abstract class BaseDistribution {
|
||||
protected httpClient: hc.HttpClient;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
import BaseDistribution from './base-distribution';
|
||||
import {NodeInputs} from './base-models';
|
||||
import NightlyNodejs from './nightly/nightly_builds';
|
||||
import OfficialBuilds from './official_builds/official_builds';
|
||||
import RcBuild from './rc/rc_builds';
|
||||
import CanaryBuild from './v8-canary/canary_builds';
|
||||
import BaseDistribution from './base-distribution.js';
|
||||
import {NodeInputs} from './base-models.js';
|
||||
import NightlyNodejs from './nightly/nightly_builds.js';
|
||||
import OfficialBuilds from './official_builds/official_builds.js';
|
||||
import RcBuild from './rc/rc_builds.js';
|
||||
import CanaryBuild from './v8-canary/canary_builds.js';
|
||||
|
||||
enum Distributions {
|
||||
DEFAULT = '',
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import BasePrereleaseNodejs from '../base-distribution-prerelease';
|
||||
import {NodeInputs} from '../base-models';
|
||||
import BasePrereleaseNodejs from '../base-distribution-prerelease.js';
|
||||
import {NodeInputs} from '../base-models.js';
|
||||
|
||||
export default class NightlyNodejs extends BasePrereleaseNodejs {
|
||||
protected distribution = 'nightly';
|
||||
|
|
|
|||
|
|
@ -2,8 +2,8 @@ import * as core from '@actions/core';
|
|||
import * as tc from '@actions/tool-cache';
|
||||
import path from 'path';
|
||||
|
||||
import BaseDistribution from '../base-distribution';
|
||||
import {NodeInputs, INodeVersion, INodeVersionInfo} from '../base-models';
|
||||
import BaseDistribution from '../base-distribution.js';
|
||||
import {NodeInputs, INodeVersion, INodeVersionInfo} from '../base-models.js';
|
||||
|
||||
interface INodeRelease extends tc.IToolRelease {
|
||||
lts?: string;
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import BaseDistribution from '../base-distribution';
|
||||
import {NodeInputs} from '../base-models';
|
||||
import BaseDistribution from '../base-distribution.js';
|
||||
import {NodeInputs} from '../base-models.js';
|
||||
|
||||
export default class RcBuild extends BaseDistribution {
|
||||
constructor(nodeInfo: NodeInputs) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import BasePrereleaseNodejs from '../base-distribution-prerelease';
|
||||
import {NodeInputs} from '../base-models';
|
||||
import BasePrereleaseNodejs from '../base-distribution-prerelease.js';
|
||||
import {NodeInputs} from '../base-models.js';
|
||||
|
||||
export default class CanaryBuild extends BasePrereleaseNodejs {
|
||||
protected distribution = 'v8-canary';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue