feat: move the apt-fast installer to setup-apt package

This commit is contained in:
Amin Yahyaabadi 2025-05-20 02:32:22 -07:00
parent 350b16f518
commit 62036a9dd7
27 changed files with 181 additions and 160 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,51 @@
import { join } from "path"
import { execRootSync } from "admina"
import spawn from "cross-spawn"
import { pathExists } from "path-exists"
import { addExeExt } from "patha"
import which from "which"
import { hasAptGet, setupAptFast } from "../src/index.js"
jest.setTimeout(300000)
describe("setup-apt-fast", () => {
if (!hasAptGet()) {
test.skip("should setup apt-fast", () => {})
return
}
it("should setup apt-fast", async () => {
const installInfo = await setupAptFast("", "", process.arch)
await testBin("apt-fast", ["--version"], installInfo?.binDir)
})
afterAll(() => {
// remove apt-fast to run the rest of the tests with apt-get
execRootSync("apt-get", ["remove", "-y", "apt-fast"])
})
})
async function testBin(
name: string,
args: string[] | null = ["--version"],
binDir: string | undefined = undefined,
) {
try {
let bin = name
if (typeof binDir === "string") {
console.log(`Testing the existence of ${binDir}`)
expect(binDir).toBeDefined()
expect(binDir).not.toHaveLength(0)
expect(await pathExists(binDir)).toBeTruthy()
bin = join(binDir, addExeExt(name))
}
if (args !== null) {
console.log(`Running ${bin} ${args.join(" ")}`)
const { status } = spawn.sync(bin, args, { stdio: "inherit" })
expect(status).toBe(0)
}
expect((await which(name, { nothrow: true }))?.includes(bin))
} catch (err) {
throw new Error(`Failed to test bin ${name}: ${err}`)
}
}

View File

@ -0,0 +1,4 @@
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"]
}

View File

@ -0,0 +1,2 @@
import jestConfig from "../../jest.config.mjs"
export default jestConfig

View File

@ -19,20 +19,21 @@
"dev": "tsc --watch --pretty",
"lint.tsc": "tsc --noEmit --pretty",
"lint.eslint": "eslint '**/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml}' --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/ --fix",
"prepublishOnly": "pnpm run build"
"prepublishOnly": "pnpm run build",
"test": "jest --coverage"
},
"dependencies": {
"@types/node": "22.15.3",
"admina": "^1.0.1",
"ci-info": "^4.0.0",
"path-exists": "^5.0.0",
"ci-log": "workspace:*",
"envosman": "workspace:*",
"which": "4.0.0",
"execa": "7.2.0",
"escape-string-regexp": "^5.0.0",
"execa": "7.2.0",
"memoizee": "^0.4.17",
"node-downloader-helper": "2.1.9",
"memoizee": "^0.4.17"
"path-exists": "^5.0.0",
"which": "4.0.0"
},
"engines": {
"node": ">=12"
@ -56,6 +57,8 @@
],
"devDependencies": {
"@types/memoizee": "0.4.11",
"@types/which": "~3.0.4"
"@types/which": "~3.0.4",
"cross-spawn": "^7.0.6",
"patha": "^0.4.1"
}
}

View File

@ -4,8 +4,9 @@ import { execRootSync } from "admina"
import { error } from "ci-log"
import { readFile, writeFile } from "fs/promises"
import { DownloaderHelper } from "node-downloader-helper"
import { hasAptGet, installAptPack } from "setup-apt"
import which from "which"
import { hasAptGet } from "./get-apt.js"
import { installAptPack } from "./install.js"
let binDir: string | undefined

View File

@ -1,4 +1,5 @@
export * from "./alternatives.js"
export * from "./apt-fast.js"
export * from "./apt-key.js"
export * from "./apt-repository.js"
export * from "./apt-timeout.js"

View File

@ -45,7 +45,7 @@ importers:
version: 2.2.5
'@liuli-util/vite-plugin-node':
specifier: ^0.9.0
version: 0.9.0(@types/node@22.15.19)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))
version: 0.9.0(@types/node@22.15.3)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))
'@octokit/core':
specifier: ^6.1.4
version: 6.1.5
@ -96,10 +96,10 @@ importers:
version: 29.5.14
'@types/memoizee':
specifier: ^0.4.11
version: 0.4.12
version: 0.4.11
'@types/node':
specifier: ^22.13.8
version: 22.15.19
version: 22.15.3
'@types/semver':
specifier: ^7.5.8
version: 7.7.0
@ -171,7 +171,7 @@ importers:
version: 1.5.0
jest:
specifier: ^29.7.0
version: 29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
version: 29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
lefthook:
specifier: ^1.11.2
version: 1.11.13
@ -267,7 +267,7 @@ importers:
version: 2.0.12
ts-node:
specifier: ^10.9.2
version: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3)
version: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3)
ts-readme:
specifier: ^1.1.3
version: 1.1.3(typescript@5.8.3)
@ -291,10 +291,10 @@ importers:
version: 0.0.2
vite:
specifier: ^6.2.0
version: 6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
version: 6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
vite-plugin-babel:
specifier: ^1.3.0
version: 1.3.1(@babel/core@7.27.1)(vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))
version: 1.3.1(@babel/core@7.27.1)(vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))
web-streams-polyfill:
specifier: ^4.1.0
version: 4.1.0
@ -358,7 +358,7 @@ importers:
dependencies:
'@types/node':
specifier: ^22.0.0
version: 22.15.19
version: 22.15.3
execa:
specifier: 7.2.0
version: 7.2.0
@ -446,6 +446,12 @@ importers:
'@types/which':
specifier: ~3.0.4
version: 3.0.4
cross-spawn:
specifier: ^7.0.6
version: 7.0.6
patha:
specifier: ^0.4.1
version: 0.4.1
packages/setup-brew:
dependencies:
@ -2184,9 +2190,6 @@ packages:
'@types/memoizee@0.4.11':
resolution: {integrity: sha512-2gyorIBZu8GoDr9pYjROkxWWcFtHCquF7TVbN2I+/OvgZhnIGQS0vX5KJz4lXNKb8XOSfxFOSG5OLru1ESqLUg==}
'@types/memoizee@0.4.12':
resolution: {integrity: sha512-EdtpwNYNhe3kZ+4TlXj/++pvBoU0KdrAICMzgI7vjWgu9sIvvUhu9XR8Ks4L6Wh3sxpZ22wkZR7yCLAqUjnZuQ==}
'@types/minimatch@5.1.2':
resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==}
@ -2196,9 +2199,6 @@ packages:
'@types/node@18.19.101':
resolution: {integrity: sha512-Ykg7fcE3+cOQlLUv2Ds3zil6DVjriGQaSN/kEpl5HQ3DIGM6W0F2n9+GkWV4bRt7KjLymgzNdTnSKCbFUUJ7Kw==}
'@types/node@22.15.19':
resolution: {integrity: sha512-3vMNr4TzNQyjHcRZadojpRaD9Ofr6LsonZAoQ+HMUa/9ORTPoxVIw0e0mpqWpdjj8xybyCM+oKOUH2vwFu/oEw==}
'@types/node@22.15.3':
resolution: {integrity: sha512-lX7HFZeHf4QG/J7tBZqrCAXwz9J5RD56Y6MpP0eJkka8p+K0RY/yBTW7CYFJ4VGCclxqOLKmiGP5juQc6MKgcw==}
@ -5614,8 +5614,8 @@ packages:
resolution: {integrity: sha512-wpKu3DvFuymcRvPqJR7VN5J6wnqR+SYZ4SZmnJa9ckpV+BuoE0XYHZYsoWaJbt6oz8OwOXb4eoMjlEBM6hwhBw==}
hasBin: true
sort-package-json@https://codeload.github.com/aminya/sort-package-json/tar.gz/076051b58be7b198732d1ce2b9a415ccd0c63a97:
resolution: {tarball: https://codeload.github.com/aminya/sort-package-json/tar.gz/076051b58be7b198732d1ce2b9a415ccd0c63a97}
sort-package-json@git+https://git@github.com:aminya/sort-package-json.git#076051b58be7b198732d1ce2b9a415ccd0c63a97:
resolution: {commit: 076051b58be7b198732d1ce2b9a415ccd0c63a97, repo: git@github.com:aminya/sort-package-json.git, type: git}
version: 0.0.0-development
hasBin: true
@ -7284,27 +7284,27 @@ snapshots:
'@jest/console@29.7.0':
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
chalk: 4.1.2
jest-message-util: 29.7.0
jest-util: 29.7.0
slash: 3.0.0
'@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))':
'@jest/core@29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))':
dependencies:
'@jest/console': 29.7.0
'@jest/reporters': 29.7.0
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
ansi-escapes: 4.3.2
chalk: 4.1.2
ci-info: 3.9.0
exit: 0.1.2
graceful-fs: 4.2.11
jest-changed-files: 29.7.0
jest-config: 29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
jest-config: 29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
jest-haste-map: 29.7.0
jest-message-util: 29.7.0
jest-regex-util: 29.6.3
@ -7333,7 +7333,7 @@ snapshots:
dependencies:
'@jest/fake-timers': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
jest-mock: 29.7.0
'@jest/expect-utils@29.7.0':
@ -7351,7 +7351,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
'@sinonjs/fake-timers': 10.3.0
'@types/node': 22.15.19
'@types/node': 22.15.3
jest-message-util: 29.7.0
jest-mock: 29.7.0
jest-util: 29.7.0
@ -7373,7 +7373,7 @@ snapshots:
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@jridgewell/trace-mapping': 0.3.25
'@types/node': 22.15.19
'@types/node': 22.15.3
chalk: 4.1.2
collect-v8-coverage: 1.0.2
exit: 0.1.2
@ -7443,7 +7443,7 @@ snapshots:
'@jest/schemas': 29.6.3
'@types/istanbul-lib-coverage': 2.0.6
'@types/istanbul-reports': 3.0.4
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/yargs': 17.0.33
chalk: 4.1.2
@ -7474,45 +7474,45 @@ snapshots:
'@jridgewell/resolve-uri': 3.1.2
'@jridgewell/sourcemap-codec': 1.5.0
'@liuli-util/vite-plugin-node@0.9.0(@types/node@22.15.19)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))':
'@liuli-util/vite-plugin-node@0.9.0(@types/node@22.15.3)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))':
dependencies:
'@microsoft/api-extractor': 7.51.1(@types/node@22.15.19)
'@microsoft/api-extractor': 7.51.1(@types/node@22.15.3)
magic-string: 0.30.17
pathe: 1.1.2
rollup-plugin-node-externals: 7.1.3(rollup@4.41.0)
vite: 6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
vite-plugin-dts: 3.9.1(@types/node@22.15.19)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))
vite: 6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
vite-plugin-dts: 3.9.1(@types/node@22.15.3)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1))
transitivePeerDependencies:
- '@types/node'
- rollup
- supports-color
- typescript
'@microsoft/api-extractor-model@7.28.13(@types/node@22.15.19)':
'@microsoft/api-extractor-model@7.28.13(@types/node@22.15.3)':
dependencies:
'@microsoft/tsdoc': 0.14.2
'@microsoft/tsdoc-config': 0.16.2
'@rushstack/node-core-library': 4.0.2(@types/node@22.15.19)
'@rushstack/node-core-library': 4.0.2(@types/node@22.15.3)
transitivePeerDependencies:
- '@types/node'
'@microsoft/api-extractor-model@7.30.3(@types/node@22.15.19)':
'@microsoft/api-extractor-model@7.30.3(@types/node@22.15.3)':
dependencies:
'@microsoft/tsdoc': 0.15.1
'@microsoft/tsdoc-config': 0.17.1
'@rushstack/node-core-library': 5.11.0(@types/node@22.15.19)
'@rushstack/node-core-library': 5.11.0(@types/node@22.15.3)
transitivePeerDependencies:
- '@types/node'
'@microsoft/api-extractor@7.43.0(@types/node@22.15.19)':
'@microsoft/api-extractor@7.43.0(@types/node@22.15.3)':
dependencies:
'@microsoft/api-extractor-model': 7.28.13(@types/node@22.15.19)
'@microsoft/api-extractor-model': 7.28.13(@types/node@22.15.3)
'@microsoft/tsdoc': 0.14.2
'@microsoft/tsdoc-config': 0.16.2
'@rushstack/node-core-library': 4.0.2(@types/node@22.15.19)
'@rushstack/node-core-library': 4.0.2(@types/node@22.15.3)
'@rushstack/rig-package': 0.5.2
'@rushstack/terminal': 0.10.0(@types/node@22.15.19)
'@rushstack/ts-command-line': 4.19.1(@types/node@22.15.19)
'@rushstack/terminal': 0.10.0(@types/node@22.15.3)
'@rushstack/ts-command-line': 4.19.1(@types/node@22.15.3)
lodash: 4.17.21
minimatch: 3.0.8
resolve: 1.22.10
@ -7522,15 +7522,15 @@ snapshots:
transitivePeerDependencies:
- '@types/node'
'@microsoft/api-extractor@7.51.1(@types/node@22.15.19)':
'@microsoft/api-extractor@7.51.1(@types/node@22.15.3)':
dependencies:
'@microsoft/api-extractor-model': 7.30.3(@types/node@22.15.19)
'@microsoft/api-extractor-model': 7.30.3(@types/node@22.15.3)
'@microsoft/tsdoc': 0.15.1
'@microsoft/tsdoc-config': 0.17.1
'@rushstack/node-core-library': 5.11.0(@types/node@22.15.19)
'@rushstack/node-core-library': 5.11.0(@types/node@22.15.3)
'@rushstack/rig-package': 0.5.3
'@rushstack/terminal': 0.15.0(@types/node@22.15.19)
'@rushstack/ts-command-line': 4.23.5(@types/node@22.15.19)
'@rushstack/terminal': 0.15.0(@types/node@22.15.3)
'@rushstack/ts-command-line': 4.23.5(@types/node@22.15.3)
lodash: 4.17.21
minimatch: 3.0.8
resolve: 1.22.10
@ -7813,7 +7813,7 @@ snapshots:
'@rtsao/scc@1.1.0': {}
'@rushstack/node-core-library@4.0.2(@types/node@22.15.19)':
'@rushstack/node-core-library@4.0.2(@types/node@22.15.3)':
dependencies:
fs-extra: 7.0.1
import-lazy: 4.0.0
@ -7822,9 +7822,9 @@ snapshots:
semver: 7.5.4
z-schema: 5.0.5
optionalDependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@rushstack/node-core-library@5.11.0(@types/node@22.15.19)':
'@rushstack/node-core-library@5.11.0(@types/node@22.15.3)':
dependencies:
ajv: 8.13.0
ajv-draft-04: 1.0.0(ajv@8.13.0)
@ -7835,7 +7835,7 @@ snapshots:
resolve: 1.22.10
semver: 7.5.4
optionalDependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@rushstack/rig-package@0.5.2':
dependencies:
@ -7847,32 +7847,32 @@ snapshots:
resolve: 1.22.10
strip-json-comments: 3.1.1
'@rushstack/terminal@0.10.0(@types/node@22.15.19)':
'@rushstack/terminal@0.10.0(@types/node@22.15.3)':
dependencies:
'@rushstack/node-core-library': 4.0.2(@types/node@22.15.19)
'@rushstack/node-core-library': 4.0.2(@types/node@22.15.3)
supports-color: 8.1.1
optionalDependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@rushstack/terminal@0.15.0(@types/node@22.15.19)':
'@rushstack/terminal@0.15.0(@types/node@22.15.3)':
dependencies:
'@rushstack/node-core-library': 5.11.0(@types/node@22.15.19)
'@rushstack/node-core-library': 5.11.0(@types/node@22.15.3)
supports-color: 8.1.1
optionalDependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@rushstack/ts-command-line@4.19.1(@types/node@22.15.19)':
'@rushstack/ts-command-line@4.19.1(@types/node@22.15.3)':
dependencies:
'@rushstack/terminal': 0.10.0(@types/node@22.15.19)
'@rushstack/terminal': 0.10.0(@types/node@22.15.3)
'@types/argparse': 1.0.38
argparse: 1.0.10
string-argv: 0.3.2
transitivePeerDependencies:
- '@types/node'
'@rushstack/ts-command-line@4.23.5(@types/node@22.15.19)':
'@rushstack/ts-command-line@4.23.5(@types/node@22.15.3)':
dependencies:
'@rushstack/terminal': 0.15.0(@types/node@22.15.19)
'@rushstack/terminal': 0.15.0(@types/node@22.15.3)
'@types/argparse': 1.0.38
argparse: 1.0.10
string-argv: 0.3.2
@ -8029,7 +8029,7 @@ snapshots:
'@types/cross-spawn@6.0.6':
dependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/debug@4.1.12':
dependencies:
@ -8049,22 +8049,22 @@ snapshots:
'@types/fs-extra@11.0.4':
dependencies:
'@types/jsonfile': 6.1.4
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/glob@7.2.0':
dependencies:
'@types/minimatch': 5.1.2
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/graceful-fs@4.1.9':
dependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/http-cache-semantics@4.0.4': {}
'@types/iarna__toml@2.0.5':
dependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/istanbul-lib-coverage@2.0.6': {}
@ -8087,7 +8087,7 @@ snapshots:
'@types/jsonfile@6.1.4':
dependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
'@types/mdast@4.0.4':
dependencies:
@ -8095,8 +8095,6 @@ snapshots:
'@types/memoizee@0.4.11': {}
'@types/memoizee@0.4.12': {}
'@types/minimatch@5.1.2': {}
'@types/ms@2.1.0': {}
@ -8106,10 +8104,6 @@ snapshots:
undici-types: 5.26.5
optional: true
'@types/node@22.15.19':
dependencies:
undici-types: 6.21.0
'@types/node@22.15.3':
dependencies:
undici-types: 6.21.0
@ -9070,13 +9064,13 @@ snapshots:
crc-32: 1.2.2
readable-stream: 3.6.2
create-jest@29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3)):
create-jest@29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3)):
dependencies:
'@jest/types': 29.6.3
chalk: 4.1.2
exit: 0.1.2
graceful-fs: 4.2.11
jest-config: 29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
jest-config: 29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
jest-util: 29.7.0
prompts: 2.4.2
transitivePeerDependencies:
@ -10799,7 +10793,7 @@ snapshots:
'@jest/expect': 29.7.0
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
chalk: 4.1.2
co: 4.6.0
dedent: 1.5.3
@ -10819,16 +10813,16 @@ snapshots:
- babel-plugin-macros
- supports-color
jest-cli@29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3)):
jest-cli@29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3)):
dependencies:
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
chalk: 4.1.2
create-jest: 29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
create-jest: 29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
exit: 0.1.2
import-local: 3.2.0
jest-config: 29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
jest-config: 29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
jest-util: 29.7.0
jest-validate: 29.7.0
yargs: 17.7.2
@ -10838,7 +10832,7 @@ snapshots:
- supports-color
- ts-node
jest-config@29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3)):
jest-config@29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3)):
dependencies:
'@babel/core': 7.27.1
'@jest/test-sequencer': 29.7.0
@ -10863,8 +10857,8 @@ snapshots:
slash: 3.0.0
strip-json-comments: 3.1.1
optionalDependencies:
'@types/node': 22.15.19
ts-node: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3)
'@types/node': 22.15.3
ts-node: 10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3)
transitivePeerDependencies:
- babel-plugin-macros
- supports-color
@ -10893,7 +10887,7 @@ snapshots:
'@jest/environment': 29.7.0
'@jest/fake-timers': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
jest-mock: 29.7.0
jest-util: 29.7.0
@ -10903,7 +10897,7 @@ snapshots:
dependencies:
'@jest/types': 29.6.3
'@types/graceful-fs': 4.1.9
'@types/node': 22.15.19
'@types/node': 22.15.3
anymatch: 3.1.3
fb-watchman: 2.0.2
graceful-fs: 4.2.11
@ -10942,7 +10936,7 @@ snapshots:
jest-mock@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
jest-util: 29.7.0
jest-pnp-resolver@1.2.3(jest-resolve@29.7.0):
@ -10977,7 +10971,7 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
chalk: 4.1.2
emittery: 0.13.1
graceful-fs: 4.2.11
@ -11005,7 +10999,7 @@ snapshots:
'@jest/test-result': 29.7.0
'@jest/transform': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
chalk: 4.1.2
cjs-module-lexer: 1.4.3
collect-v8-coverage: 1.0.2
@ -11051,7 +11045,7 @@ snapshots:
jest-util@29.7.0:
dependencies:
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
chalk: 4.1.2
ci-info: 3.9.0
graceful-fs: 4.2.11
@ -11070,7 +11064,7 @@ snapshots:
dependencies:
'@jest/test-result': 29.7.0
'@jest/types': 29.6.3
'@types/node': 22.15.19
'@types/node': 22.15.3
ansi-escapes: 4.3.2
chalk: 4.1.2
emittery: 0.13.1
@ -11079,17 +11073,17 @@ snapshots:
jest-worker@29.7.0:
dependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
jest-util: 29.7.0
merge-stream: 2.0.0
supports-color: 8.1.1
jest@29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3)):
jest@29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3)):
dependencies:
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
'@jest/core': 29.7.0(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
'@jest/types': 29.6.3
import-local: 3.2.0
jest-cli: 29.7.0(@types/node@22.15.19)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3))
jest-cli: 29.7.0(@types/node@22.15.3)(ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3))
transitivePeerDependencies:
- '@types/node'
- babel-plugin-macros
@ -11868,7 +11862,7 @@ snapshots:
prettier: 3.1.1
prettier-plugin-jsdoc: 1.3.2(prettier@3.1.1)
prettier-plugin-packagejson: 2.5.9(prettier@3.1.1)
sort-package-json: https://codeload.github.com/aminya/sort-package-json/tar.gz/076051b58be7b198732d1ce2b9a415ccd0c63a97
sort-package-json: git+https://git@github.com:aminya/sort-package-json.git#076051b58be7b198732d1ce2b9a415ccd0c63a97
transitivePeerDependencies:
- supports-color
@ -12326,7 +12320,7 @@ snapshots:
sort-object-keys: 1.1.3
tinyglobby: 0.2.13
sort-package-json@https://codeload.github.com/aminya/sort-package-json/tar.gz/076051b58be7b198732d1ce2b9a415ccd0c63a97:
sort-package-json@git+https://git@github.com:aminya/sort-package-json.git#076051b58be7b198732d1ce2b9a415ccd0c63a97:
dependencies:
detect-indent: 6.1.0
detect-newline: 3.1.0
@ -12621,14 +12615,14 @@ snapshots:
dependencies:
typescript: 5.8.3
ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.19)(typescript@5.8.3):
ts-node@10.9.2(@swc/core@1.7.23(@swc/helpers@0.5.13))(@types/node@22.15.3)(typescript@5.8.3):
dependencies:
'@cspotcode/source-map-support': 0.8.1
'@tsconfig/node10': 1.0.11
'@tsconfig/node12': 1.0.11
'@tsconfig/node14': 1.0.3
'@tsconfig/node16': 1.0.4
'@types/node': 22.15.19
'@types/node': 22.15.3
acorn: 8.14.0
acorn-walk: 8.3.4
arg: 4.1.3
@ -12858,14 +12852,14 @@ snapshots:
validator@13.12.0: {}
vite-plugin-babel@1.3.1(@babel/core@7.27.1)(vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)):
vite-plugin-babel@1.3.1(@babel/core@7.27.1)(vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)):
dependencies:
'@babel/core': 7.27.1
vite: 6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
vite: 6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
vite-plugin-dts@3.9.1(@types/node@22.15.19)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)):
vite-plugin-dts@3.9.1(@types/node@22.15.3)(rollup@4.41.0)(typescript@5.8.3)(vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)):
dependencies:
'@microsoft/api-extractor': 7.43.0(@types/node@22.15.19)
'@microsoft/api-extractor': 7.43.0(@types/node@22.15.3)
'@rollup/pluginutils': 5.1.4(rollup@4.41.0)
'@vue/language-core': 1.8.27(typescript@5.8.3)
debug: 4.4.0
@ -12874,13 +12868,13 @@ snapshots:
typescript: 5.8.3
vue-tsc: 1.8.27(typescript@5.8.3)
optionalDependencies:
vite: 6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
vite: 6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1)
transitivePeerDependencies:
- '@types/node'
- rollup
- supports-color
vite@6.3.5(@types/node@22.15.19)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1):
vite@6.3.5(@types/node@22.15.3)(lightningcss@1.26.0)(terser@5.39.2)(tsx@4.19.4)(yaml@2.7.1):
dependencies:
esbuild: 0.25.4
fdir: 6.4.4(picomatch@4.0.2)
@ -12889,7 +12883,7 @@ snapshots:
rollup: 4.41.0
tinyglobby: 0.2.13
optionalDependencies:
'@types/node': 22.15.19
'@types/node': 22.15.3
fsevents: 2.3.3
lightningcss: 1.26.0
terser: 5.39.2

View File

@ -1,21 +0,0 @@
import { execRootSync } from "admina"
import { hasAptGet } from "../../utils/env/hasAptGet.js"
import { testBin } from "../../utils/tests/test-helpers.js"
import { setupAptFast } from "../apt-fast.js"
jest.setTimeout(300000)
describe("setup-apt-fast", () => {
if (!hasAptGet()) {
test.skip("should setup apt-fast", () => {})
return
}
it("should setup apt-fast", async () => {
const installInfo = await setupAptFast("", "", process.arch)
await testBin("apt-fast", ["--version"], installInfo?.binDir)
})
afterAll(() => {
// remove apt-fast to run the rest of the tests with apt-get
execRootSync("apt-get", ["remove", "-y", "apt-fast"])
})
})

View File

@ -3,7 +3,7 @@ import { fileURLToPath } from "url"
import { execaSync } from "execa"
import { chmod } from "fs/promises"
import { addExeExt } from "patha"
import { hasAptGet } from "../../utils/env/hasAptGet.js"
import { hasAptGet } from "setup-apt"
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"

View File

@ -1,5 +1,5 @@
import { info } from "ci-log"
import { hasAptGet } from "../../utils/env/hasAptGet.js"
import { hasAptGet } from "setup-apt"
import { ubuntuVersion } from "../../utils/env/ubuntu_version.js"
import { cleanupTmpDir, setupTmpDir, testBin } from "../../utils/tests/test-helpers.js"
import { getVersion } from "../../versions/versions.js"

View File

@ -1,5 +1,5 @@
import { execRootSync } from "admina"
import { hasAptGet } from "../../utils/env/hasAptGet.js"
import { hasAptGet } from "setup-apt"
import { testBin } from "../../utils/tests/test-helpers.js"
import { setupNala } from "../nala.js"

View File

@ -1,5 +1,5 @@
import { hasAptGet } from "setup-apt"
import { getUbuntuVersion } from "ubuntu-version"
import { hasAptGet } from "../../utils/env/hasAptGet.js"
import type { InstallationInfo } from "../../utils/setup/setupBin.js"
import { testBin } from "../../utils/tests/test-helpers.js"
import { setupSccache } from "../sccache.js"

View File

@ -1,5 +1,5 @@
import { setupAptFast } from "setup-apt"
import { setupBrew } from "setup-brew"
import { setupAptFast } from "./apt-fast/apt-fast.js"
import { setupBazel } from "./bazel/bazel.js"
import { setupCcache } from "./ccache/ccache.js"
import { setupChocolatey } from "./chocolatey/chocolatey.js"

View File

@ -1,11 +0,0 @@
import memoize from "memoizee"
import which from "which"
function hasAptGet_(): boolean {
if (process.platform !== "linux") {
return false
}
return which.sync("apt-get", { nothrow: true }) !== null
}
export const hasAptGet = memoize(hasAptGet_)

View File

@ -1,10 +1,9 @@
import os from "os"
import { warning } from "ci-log"
import memoize from "memoizee"
import { installAptPack } from "setup-apt"
import { hasAptGet, installAptPack } from "setup-apt"
import { getUbuntuVersion } from "ubuntu-version"
import which from "which"
import { hasAptGet } from "./hasAptGet.js"
async function ubuntuVersion_(): Promise<number[] | null> {
try {

View File

@ -5,10 +5,9 @@ import { execa } from "execa"
import { mkdirp, move } from "fs-extra"
import { rm } from "fs/promises"
import { hasApk, installApkPack } from "setup-alpine"
import { installAptPack } from "setup-apt"
import { hasAptGet, installAptPack } from "setup-apt"
import which from "which"
import { setupSevenZip } from "../../sevenzip/sevenzip.js"
import { hasAptGet } from "../env/hasAptGet.js"
import { hasDnf } from "../env/hasDnf.js"
import { isArch } from "../env/isArch.js"
import { setupDnfPack } from "./setupDnfPack.js"

View File

@ -9,14 +9,13 @@ import { mkdirp } from "mkdirp"
import { pathExists } from "path-exists"
import { addExeExt } from "patha"
import { hasApk, installApkPack } from "setup-alpine"
import { installAptPack } from "setup-apt"
import { hasAptGet, installAptPack } from "setup-apt"
import { installBrewPack } from "setup-brew"
import { untildifyUser } from "untildify-user"
import which from "which"
import { rcOptions } from "../../options.js"
import { setupPython } from "../../python/python.js"
import { getVersion } from "../../versions/versions.js"
import { hasAptGet } from "../env/hasAptGet.js"
import { hasDnf } from "../env/hasDnf.js"
import { isArch } from "../env/isArch.js"
import { ubuntuVersion } from "../env/ubuntu_version.js"