Skip to content

Commit

Permalink
fix: fix ci-info not running in an ESM context
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Oct 7, 2024
1 parent d485b24 commit 24f9b03
Show file tree
Hide file tree
Showing 28 changed files with 56 additions and 30 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/legacy/setup-cpp.js.map

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/modern/setup-cpp.mjs.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/ci-log/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ci-log",
"version": "1.0.1",
"version": "1.0.2",
"description": "Colorful logging and print for any environment including GitHub Actions",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/ci-log",
Expand Down
3 changes: 2 additions & 1 deletion packages/ci-log/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as core from "@actions/core"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo

export function error(err: string | Error) {
return GITHUB_ACTIONS ? core.error(err) : console.log(`\x1b[31m${err}\x1b[0m`)
Expand Down
2 changes: 1 addition & 1 deletion packages/envosman/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "envosman",
"version": "1.0.2",
"version": "1.0.3",
"description": "Manage environment variables, PATH, and rc files",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/envosman",
Expand Down
3 changes: 2 additions & 1 deletion packages/envosman/src/add-env.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { promises } from "fs"
import { exportVariable as ghExportVariable } from "@actions/core"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { error, info } from "ci-log"
import { execPowershell } from "exec-powershell"
import { defaultRcPath, sourceRCInRc } from "./rc-file.js"
Expand Down
3 changes: 2 additions & 1 deletion packages/envosman/src/add-path.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { promises } from "fs"
import { delimiter } from "path"
import { addPath as ghAddPath } from "@actions/core"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { error, info } from "ci-log"
import { execPowershell } from "exec-powershell"
import { defaultRcPath, sourceRCInRc } from "./rc-file.js"
Expand Down
7 changes: 6 additions & 1 deletion packages/setup-apt/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-apt",
"version": "2.0.0",
"version": "2.0.2",
"description": "Setup apt packages and repositories in Debian/Ubuntu-based distributions",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/setup-apt",
Expand All @@ -9,6 +9,11 @@
"main": "./dist/index.js",
"source": "./src/index.ts",
"type": "module",
"files": [
"dist",
"src",
"tsconfig.json"
],
"scripts": {
"build": "tsc --pretty",
"dev": "tsc --watch --pretty",
Expand Down
3 changes: 2 additions & 1 deletion packages/setup-apt/src/alternatives.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { promises } from "fs"
import { execRoot } from "admina"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { sourceRC } from "envosman"
import type { RcOptions } from "envosman/dist/rc-file.js"
const { appendFile } = promises
Expand Down
7 changes: 6 additions & 1 deletion packages/setup-brew/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "setup-brew",
"version": "1.0.1",
"version": "1.0.2",
"description": "Setup brew and brew packages",
"repository": "https://github.com/aminya/setup-cpp",
"homepage": "https://github.com/aminya/setup-cpp/tree/master/packages/setup-brew",
Expand All @@ -9,6 +9,11 @@
"main": "./dist/index.js",
"source": "./src/index.ts",
"type": "module",
"files": [
"dist",
"src",
"tsconfig.json"
],
"scripts": {
"build": "tsc --pretty",
"dev": "tsc --watch --pretty",
Expand Down
3 changes: 2 additions & 1 deletion src/cmake/__tests__/cmake.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupCmake } from "../cmake.js"
Expand Down
3 changes: 2 additions & 1 deletion src/gcc/gcc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from "path"
import { fileURLToPath } from "url"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { error, info, warning } from "ci-log"
import { addEnv } from "envosman"
import { execa } from "execa"
Expand Down
3 changes: 2 additions & 1 deletion src/gcc/mingw.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path, { join } from "path"
import { fileURLToPath } from "url"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info } from "ci-log"
import { addEnv, addPath } from "envosman"
import { pathExists } from "path-exists"
Expand Down
3 changes: 2 additions & 1 deletion src/llvm/llvm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { tmpdir } from "os"
import path, { delimiter, join } from "path"
import { fileURLToPath } from "url"
import { execRootSync } from "admina"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info, warning } from "ci-log"
import { addEnv } from "envosman"
import memoize from "memoizee"
Expand Down
3 changes: 2 additions & 1 deletion src/msvc/msvc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import path, { join } from "path"
import { fileURLToPath } from "url"
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { error, info, warning } from "ci-log"
import { findVcvarsall, vsversion_to_versionnumber } from "msvc-dev-cmd/lib.js"
import { pathExists } from "path-exists"
Expand Down
3 changes: 2 additions & 1 deletion src/ninja/__tests__/ninja.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupNinja } from "../ninja.js"
Expand Down
3 changes: 2 additions & 1 deletion src/powershell/__tests__/powershell.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupPowershell } from "../powershell.js"
Expand Down
3 changes: 2 additions & 1 deletion src/python/__tests__/python.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info } from "ci-log"
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
Expand Down
3 changes: 2 additions & 1 deletion src/python/actions_python.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import path, { join } from "path"
import { fileURLToPath } from "url"
import { debug } from "@actions/core"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info, warning } from "ci-log"
import { pathExists } from "path-exists"
import { findPyPyVersion } from "setup-python/src/find-pypy.js"
Expand Down
3 changes: 2 additions & 1 deletion src/python/python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import assert from "assert"
import { homedir } from "os"
import { dirname, join, parse as pathParse } from "path"
import { getExecOutput } from "@actions/exec"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info, warning } from "ci-log"
import { addPath } from "envosman"
import { execa } from "execa"
Expand Down
3 changes: 2 additions & 1 deletion src/task/__tests__/task.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"
import { setupTask } from "../task.js"
Expand Down
3 changes: 2 additions & 1 deletion src/utils/setup/setupBin.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { tmpdir } from "os"
import { basename, join } from "path"
import { cacheDir, downloadTool, find } from "@actions/tool-cache"
import { GITHUB_ACTIONS } from "ci-info"
import ciInfo from "ci-info"
const { GITHUB_ACTIONS } = ciInfo
import { info, warning } from "ci-log"
import { addPath } from "envosman"
import { chmod } from "fs/promises"
Expand Down

0 comments on commit 24f9b03

Please sign in to comment.