Skip to content

Commit 2b65b25

Browse files
author
fossabot
committed
fix: automated dependency fixes (3 fixed)
Fixed all 3 breaking changes. The core issue was that @actions/tool-cache@4.0.0, @actions/core@3.0.0, and @actions/exec@3.0.0 are now pure ESM packages with no CommonJS exports, causing the ncc bundler to fail with 'Package path . is not exported' errors. The fix required: (1) Upgrading @actions/core and @actions/exec to satisfy peer dependencies, (2) Converting the project to ESM by adding 'type': 'module' to package.json and updating tsconfig.json to use NodeNext module resolution, (3) Adding explicit .js file extensions to relative imports as required by ESM. The build now completes successfully, outputting an ESM bundle. Generated by fossabot
1 parent d63f6d3 commit 2b65b25

9 files changed

Lines changed: 16 additions & 39 deletions

File tree

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"type": "module"
3+
}

dist/sourcemap-register.cjs

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "fossa-action",
33
"description": "Find license compliance and security issues in your applications with FOSSA",
4+
"type": "module",
45
"main": "src/index.js",
56
"scripts": {
67
"lint": "eslint .",
@@ -10,8 +11,8 @@
1011
"node": ">= 20.16.0"
1112
},
1213
"dependencies": {
13-
"@actions/core": "^2.0.2",
14-
"@actions/exec": "^2.0.0",
14+
"@actions/core": "^3.0.0",
15+
"@actions/exec": "^3.0.0",
1516
"@actions/tool-cache": "^4.0.0"
1617
},
1718
"devDependencies": {

src/download-cli.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { addPath, debug } from '@actions/core';
22
import { exec } from '@actions/exec';
33
import { find, downloadTool, cacheDir, cacheFile, findAllVersions } from '@actions/tool-cache';
44
import * as fs from 'node:fs';
5-
import { PINNED_CLI_VERSION } from './config';
5+
import { PINNED_CLI_VERSION } from './config.js';
66

77
const CACHE_NAME = 'fossa';
88

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {
1414
DEBUG,
1515
REPORT_FORMAT,
1616
WORKING_DIRECTORY,
17-
} from './config';
18-
import { fetchFossaCli } from './download-cli';
17+
} from './config.js';
18+
import { fetchFossaCli } from './download-cli.js';
1919

2020
// Github doesn't always collect exit codes correctly, so we check output
2121
const failedRegex = /(A fatal error occurred|Test failed\. Number of issues found)/;

tsconfig.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
/* Basic Options */
44
"target": "es2021" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */,
5-
"module": "commonjs" /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
5+
"module": "NodeNext" /* Specify module code generation: 'none', commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
66
"lib": [
77
"es2021"
88
],
@@ -31,7 +31,7 @@
3131
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
3232
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
3333
/* Module Resolution Options */
34-
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
34+
"moduleResolution": "NodeNext" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
3535
"resolveJsonModule": true,
3636
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
3737
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */

yarn.lock

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22
# yarn lockfile v1
33

44

5-
"@actions/core@^2.0.2":
6-
version "2.0.3"
7-
resolved "https://registry.yarnpkg.com/@actions/core/-/core-2.0.3.tgz#b05e8cf407ab393e5d10282357a74e1ee2315eee"
8-
integrity sha512-Od9Thc3T1mQJYddvVPM4QGiLUewdh+3txmDYHHxoNdkqysR1MbCT+rFOtNUxYAz+7+6RIsqipVahY2GJqGPyxA==
9-
dependencies:
10-
"@actions/exec" "^2.0.0"
11-
"@actions/http-client" "^3.0.2"
12-
135
"@actions/core@^3.0.0":
146
version "3.0.0"
157
resolved "https://registry.yarnpkg.com/@actions/core/-/core-3.0.0.tgz#89cb07c119e9b46a649ad5f355e77de9b3108cf8"
@@ -18,28 +10,13 @@
1810
"@actions/exec" "^3.0.0"
1911
"@actions/http-client" "^4.0.0"
2012

21-
"@actions/exec@^2.0.0":
22-
version "2.0.0"
23-
resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-2.0.0.tgz#35e829723389f80e362ec2cc415697ec74362ad8"
24-
integrity sha512-k8ngrX2voJ/RIN6r9xB82NVqKpnMRtxDoiO+g3olkIUpQNqjArXrCQceduQZCQj3P3xm32pChRLqRrtXTlqhIw==
25-
dependencies:
26-
"@actions/io" "^2.0.0"
27-
2813
"@actions/exec@^3.0.0":
2914
version "3.0.0"
3015
resolved "https://registry.yarnpkg.com/@actions/exec/-/exec-3.0.0.tgz#8c3464d20f0aa4068707757021d7e3c01a7ee203"
3116
integrity sha512-6xH/puSoNBXb72VPlZVm7vQ+svQpFyA96qdDBvhB8eNZOE8LtPf9L4oAsfzK/crCL8YZ+19fKYVnM63Sl+Xzlw==
3217
dependencies:
3318
"@actions/io" "^3.0.2"
3419

35-
"@actions/http-client@^3.0.2":
36-
version "3.0.2"
37-
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-3.0.2.tgz#3db9c83af9d29d51ac8c30b45bc17f7014beb1b2"
38-
integrity sha512-JP38FYYpyqvUsz+Igqlc/JG6YO9PaKuvqjM3iGvaLqFnJ7TFmcLyy2IDrY0bI0qCQug8E9K+elv5ZNfw62ZJzA==
39-
dependencies:
40-
tunnel "^0.0.6"
41-
undici "^6.23.0"
42-
4320
"@actions/http-client@^4.0.0":
4421
version "4.0.0"
4522
resolved "https://registry.yarnpkg.com/@actions/http-client/-/http-client-4.0.0.tgz#f9754133c22802466482bf96321d42f2dba1fc82"
@@ -48,11 +25,6 @@
4825
tunnel "^0.0.6"
4926
undici "^6.23.0"
5027

51-
"@actions/io@^2.0.0":
52-
version "2.0.0"
53-
resolved "https://registry.yarnpkg.com/@actions/io/-/io-2.0.0.tgz#3ad1271ba3cd515324f2215e8d4c1c0c3864d65b"
54-
integrity sha512-Jv33IN09XLO+0HS79aaODsvIRyduiF7NY/F6LYeK5oeUmrsz7aFdRphQjFoESF4jS7lMauDOttKALcpapVDIAg==
55-
5628
"@actions/io@^3.0.0", "@actions/io@^3.0.2":
5729
version "3.0.2"
5830
resolved "https://registry.yarnpkg.com/@actions/io/-/io-3.0.2.tgz#6f89b27a159d109836d983efa283997c23b92284"

0 commit comments

Comments
 (0)