mirror of
https://github.com/actions/setup-node.git
synced 2025-12-18 22:37:08 +00:00
Upgrade to ESM and upgrade node fetch
This commit is contained in:
parent
2028fbc5c2
commit
100690a6a6
20 changed files with 16193 additions and 7907 deletions
|
|
@ -5,13 +5,13 @@ import path from 'path';
|
|||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
|
||||
import {State} from './constants';
|
||||
import {State} from './constants.js';
|
||||
import {
|
||||
getCacheDirectories,
|
||||
getPackageManagerInfo,
|
||||
repoHasYarnBerryManagedDependencies,
|
||||
PackageManagerInfo
|
||||
} from './cache-utils';
|
||||
} from './cache-utils.js';
|
||||
|
||||
export const restoreCache = async (
|
||||
packageManager: string,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import * as core from '@actions/core';
|
||||
import * as cache from '@actions/cache';
|
||||
|
||||
import {State} from './constants';
|
||||
import {getPackageManagerInfo} from './cache-utils';
|
||||
import {State} from './constants.js';
|
||||
import {getPackageManagerInfo} from './cache-utils.js';
|
||||
|
||||
// Catch and log any unhandled exceptions. These exceptions can leak out of the uploadChunk method in
|
||||
// @actions/toolkit when a failed upload closes the file descriptor causing any in-process reads to
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ import * as cache from '@actions/cache';
|
|||
import * as glob from '@actions/glob';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import {unique} from './util';
|
||||
import {unique} from './util.js';
|
||||
|
||||
export interface PackageManagerInfo {
|
||||
name: string;
|
||||
|
|
|
|||
12
src/main.ts
12
src/main.ts
|
|
@ -3,13 +3,13 @@ import * as core from '@actions/core';
|
|||
import os from 'os';
|
||||
import fs from 'fs';
|
||||
|
||||
import * as auth from './authutil';
|
||||
import * as auth from './authutil.js';
|
||||
import * as path from 'path';
|
||||
import {restoreCache} from './cache-restore';
|
||||
import {isCacheFeatureAvailable} from './cache-utils';
|
||||
import {getNodejsDistribution} from './distributions/installer-factory';
|
||||
import {getNodeVersionFromFile, printEnvDetailsAndSetOutput} from './util';
|
||||
import {State} from './constants';
|
||||
import {restoreCache} from './cache-restore.js';
|
||||
import {isCacheFeatureAvailable} from './cache-utils.js';
|
||||
import {getNodejsDistribution} from './distributions/installer-factory.js';
|
||||
import {getNodeVersionFromFile, printEnvDetailsAndSetOutput} from './util.js';
|
||||
import {State} from './constants.js';
|
||||
|
||||
export async function run() {
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import {run} from './main';
|
||||
import {run} from './main.js';
|
||||
|
||||
run();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue