@ribershamoelias/forge 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +203 -0
- package/README.md +374 -0
- package/bin/forge.js +2 -0
- package/dist/cli.js +100 -0
- package/dist/core/clean.js +9 -0
- package/dist/core/doctor.js +42 -0
- package/dist/core/list.js +22 -0
- package/dist/core/profile.js +136 -0
- package/dist/core/setup.js +67 -0
- package/dist/lib/config.js +22 -0
- package/dist/lib/detect.js +34 -0
- package/dist/lib/editor.js +102 -0
- package/dist/lib/exec.js +21 -0
- package/dist/lib/logger.js +77 -0
- package/dist/lib/terminal.js +65 -0
- package/dist/lib/timer.js +15 -0
- package/dist/lib/tools.js +67 -0
- package/dist/lib/version.js +50 -0
- package/forge.json +13 -0
- package/package.json +30 -0
- package/presets/backend.json +14 -0
- package/presets/minimal.json +11 -0
- package/presets/web-dev.json +14 -0
- package/tsconfig.json +14 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TOOL_VERSION_CHECKS = void 0;
|
|
4
|
+
exports.getToolVersion = getToolVersion;
|
|
5
|
+
exports.compareVersions = compareVersions;
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
exports.TOOL_VERSION_CHECKS = [
|
|
8
|
+
{
|
|
9
|
+
name: 'git',
|
|
10
|
+
command: 'git --version',
|
|
11
|
+
parse: (out) => /git version ([\d.]+)/.exec(out)?.[1] || null,
|
|
12
|
+
recommended: '2.30.0',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'node',
|
|
16
|
+
command: 'node --version',
|
|
17
|
+
parse: (out) => /v([\d.]+)/.exec(out)?.[1] || null,
|
|
18
|
+
recommended: '18.0.0',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'python',
|
|
22
|
+
command: 'python3 --version',
|
|
23
|
+
parse: (out) => /Python ([\d.]+)/.exec(out)?.[1] || null,
|
|
24
|
+
recommended: '3.9.0',
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
function getToolVersion(tool) {
|
|
28
|
+
try {
|
|
29
|
+
const output = (0, child_process_1.execSync)(tool.command, { encoding: 'utf8' });
|
|
30
|
+
const version = tool.parse(output);
|
|
31
|
+
return { version };
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
return { version: null, error: e.message };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
function compareVersions(a, b) {
|
|
38
|
+
// returns -1 if a < b, 0 if equal, 1 if a > b
|
|
39
|
+
const pa = a.split('.').map(Number);
|
|
40
|
+
const pb = b.split('.').map(Number);
|
|
41
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
42
|
+
const na = pa[i] || 0;
|
|
43
|
+
const nb = pb[i] || 0;
|
|
44
|
+
if (na < nb)
|
|
45
|
+
return -1;
|
|
46
|
+
if (na > nb)
|
|
47
|
+
return 1;
|
|
48
|
+
}
|
|
49
|
+
return 0;
|
|
50
|
+
}
|
package/forge.json
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@ribershamoelias/forge",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The standard way developers set up their machines.",
|
|
5
|
+
"main": "dist/cli.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"forge": "./bin/forge.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"start": "node ./bin/forge.js",
|
|
12
|
+
"dev": "ts-node ./bin/forge.ts"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"type": "commonjs",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@types/fs-extra": "^11.0.4",
|
|
19
|
+
"@types/node": "^25.5.0",
|
|
20
|
+
"chalk": "^5.3.0",
|
|
21
|
+
"commander": "^11.0.0",
|
|
22
|
+
"fs-extra": "^11.3.4",
|
|
23
|
+
"inquirer": "^9.2.7",
|
|
24
|
+
"ora": "^7.0.1"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"ts-node": "^10.9.2",
|
|
28
|
+
"typescript": "^5.3.3"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tools": ["git", "node", "python", "docker"],
|
|
3
|
+
"editor": {
|
|
4
|
+
"name": "vscode",
|
|
5
|
+
"extensions": ["ms-python.python", "ms-azuretools.vscode-docker"]
|
|
6
|
+
},
|
|
7
|
+
"terminal": {
|
|
8
|
+
"shell": "zsh",
|
|
9
|
+
"aliases": {
|
|
10
|
+
"gs": "git status",
|
|
11
|
+
"pyv": "python --version"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"tools": ["git", "node", "docker", "zsh"],
|
|
3
|
+
"editor": {
|
|
4
|
+
"name": "vscode",
|
|
5
|
+
"extensions": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
|
|
6
|
+
},
|
|
7
|
+
"terminal": {
|
|
8
|
+
"shell": "zsh",
|
|
9
|
+
"aliases": {
|
|
10
|
+
"gs": "git status",
|
|
11
|
+
"npmi": "npm install"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"outDir": "dist",
|
|
7
|
+
"rootDir": "src",
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"skipLibCheck": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"]
|
|
14
|
+
}
|