Repository navigation
Expand file tree
/
Copy pathindex.ts
More file actions
110 lines (105 loc) · 1.9 KB
/
Copy pathindex.ts
File metadata and controls
110 lines (105 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
import type { InstallToolType } from '../utils';
export const NoPrepareTools = [
'android-sdk-cmdline-tools',
'apko',
'apm',
'bazelisk',
'bower',
'buf',
'buildx',
'bun',
'bundler',
'checkov',
'cocoapods',
'composer',
'copier',
'corepack',
'deno',
'devbox',
'docker-compose',
'flux',
'gh',
'git-lfs',
'gleam',
'gradle',
'hashin',
'helm',
'helmfile',
'jb',
'jq',
'kubectl',
'kustomize',
'lerna',
'maven',
'mise',
'nix',
'nub',
'nuget',
'npm',
'paket',
'pdm',
'pip-tools',
'pipenv',
'pnpm',
'pixi',
'poetry',
'protoc',
'renovate',
'scala',
'skopeo',
'sops',
'terraform',
'tofu',
'uv',
'vendir',
'vp',
'wally',
'yarn',
'yarn-slim',
];
export const NoInitTools = [
...NoPrepareTools,
'erlang',
'powershell',
'python',
];
/**
* Tools in this map are implicit mapped from `install-tool` to `install-<type>`.
* So no need for an extra install service.
*/
export const ResolverMap: Record<string, InstallToolType> = {
bundler: 'gem',
checkov: 'pip',
copier: 'pip',
corepack: 'npm',
hashin: 'pip',
kas: 'pip',
npm: 'npm',
pnpm: 'npm',
pdm: 'pip',
'pip-tools': 'pip',
pipenv: 'pip',
poetry: 'pip',
uv: 'pip',
};
/**
* This tools are deprecated and should not be used anymore via `install-tool`.
* They are implicit mapped from `install-tool` to `install-<type>`.
*/
export const DeprecatedTools: Record<string, InstallToolType> = {
bower: 'npm',
lerna: 'npm',
};
/**
* Looks up the install type of a tool in the given map.
* Only own keys resolve, so names like `constructor` never match.
* @param map - tool to install type map
* @param name - tool name
* @returns the mapped install type or `undefined`
*/
export function getToolType(
map: Record<string, InstallToolType>,
name: string,
): InstallToolType | undefined {
return Object.hasOwn(map, name) ? map[name] : undefined;
}