git0 0.2.41 → 0.2.56
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/dist/cli.js +3 -3
- package/dist/cli.js.map +2 -2
- package/package.json +16 -8
- package/readme.md +6 -0
- package/test/download.test.ts +1 -1
- package/test/github-api.test.ts +1 -1
- package/test/package-menu.test.ts +1 -1
- package/test/platform.test.ts +21 -16
- package/test/releases.test.ts +1 -1
- package/vitest.config.ts +34 -0
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "git0",
|
|
3
3
|
"description": "CLI tool to search GitHub repositories, download source & releases for your system, and instantly set up, then install dependencies and open code editor.",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.56",
|
|
5
5
|
"author": "vtempest",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "bun build src/cli.ts --outdir dist --target node --format esm --sourcemap",
|
|
8
8
|
"test": "bun test",
|
|
9
|
+
"test:ci": "bun test --reporter=junit --reporter-outfile=./junit.xml --coverage --coverage-reporter=lcov --coverage-dir=./coverage",
|
|
9
10
|
"docs": "cd docs-config && bun run build:docs",
|
|
10
11
|
"demo": "bun src/cli.ts react template",
|
|
11
|
-
"publish:npm": "npm version patch && npm publish --access public"
|
|
12
|
+
"publish:npm": "npm version patch && npm publish --access public",
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"coverage": "vitest run --coverage"
|
|
12
15
|
},
|
|
13
16
|
"dependencies": {
|
|
14
17
|
"chalk": "^5.4.1",
|
|
@@ -22,10 +25,10 @@
|
|
|
22
25
|
".": "./dist/cli.js"
|
|
23
26
|
},
|
|
24
27
|
"bin": {
|
|
25
|
-
"g": "
|
|
26
|
-
"gg": "
|
|
27
|
-
"fm": "
|
|
28
|
-
"git0": "
|
|
28
|
+
"g": "dist/cli.js",
|
|
29
|
+
"gg": "dist/cli.js",
|
|
30
|
+
"fm": "src/fm.js",
|
|
31
|
+
"git0": "dist/cli.js"
|
|
29
32
|
},
|
|
30
33
|
"type": "module",
|
|
31
34
|
"keywords": [
|
|
@@ -39,7 +42,12 @@
|
|
|
39
42
|
"license": "MIT",
|
|
40
43
|
"repository": {
|
|
41
44
|
"type": "git",
|
|
42
|
-
"url": "https://github.com/OpenSourceAGI/dev-tools-starter-agent
|
|
45
|
+
"url": "git+https://github.com/OpenSourceAGI/dev-tools-starter-agent.git",
|
|
46
|
+
"directory": "packages/git0-repo-downloader"
|
|
43
47
|
},
|
|
44
|
-
"homepage": "https://github.com/OpenSourceAGI/dev-tools-starter-agent/tree/master/packages/git0-repo-downloader"
|
|
48
|
+
"homepage": "https://github.com/OpenSourceAGI/dev-tools-starter-agent/tree/master/packages/git0-repo-downloader",
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@vitest/coverage-v8": "^4.1.0",
|
|
51
|
+
"vitest": "^4.1.0"
|
|
52
|
+
}
|
|
45
53
|
}
|
package/readme.md
CHANGED
|
@@ -104,3 +104,9 @@ export GITHUB_TOKEN=your_github_token_here
|
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
Without a token, you're limited to 60 requests per hour. With a token, you get 5,000 requests per hour.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
[](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request)
|
|
111
|
+
|
|
112
|
+
Please star this repo for updates! 🌟
|
package/test/download.test.ts
CHANGED
package/test/github-api.test.ts
CHANGED
package/test/platform.test.ts
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
|
-
import { describe, test, expect, mock,
|
|
1
|
+
import { describe, test, expect, mock, afterAll } from 'bun:test';
|
|
2
2
|
import os from 'os';
|
|
3
3
|
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
// `mock.module` is process-global and is never rolled back on its own, so a
|
|
5
|
+
// bare `{ platform, arch }` stub here would follow us into every test file
|
|
6
|
+
// that bun happens to run afterwards (download.test.ts calls os.tmpdir()).
|
|
7
|
+
// Keep the real module underneath the two functions we override, and put the
|
|
8
|
+
// untouched module back once this file is done.
|
|
9
|
+
const realOs = os;
|
|
7
10
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
11
|
+
function mockPlatform(platform: string, arch: string) {
|
|
12
|
+
mock.module('os', () => ({ ...realOs, default: { ...realOs, platform: () => platform, arch: () => arch } }));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
afterAll(() => {
|
|
16
|
+
mock.module('os', () => ({ ...realOs, default: realOs }));
|
|
17
|
+
});
|
|
14
18
|
|
|
19
|
+
describe('getCurrentPlatform', () => {
|
|
15
20
|
test('maps darwin/x64 → macos/x86_64', async () => {
|
|
16
|
-
|
|
21
|
+
mockPlatform('darwin', 'x64');
|
|
17
22
|
const fn = await load();
|
|
18
23
|
const p = fn();
|
|
19
24
|
expect(p.os).toBe('macos');
|
|
@@ -23,7 +28,7 @@ describe('getCurrentPlatform', () => {
|
|
|
23
28
|
});
|
|
24
29
|
|
|
25
30
|
test('maps win32/ia32 → windows/i386', async () => {
|
|
26
|
-
|
|
31
|
+
mockPlatform('win32', 'ia32');
|
|
27
32
|
const fn = await load();
|
|
28
33
|
const p = fn();
|
|
29
34
|
expect(p.os).toBe('windows');
|
|
@@ -31,7 +36,7 @@ describe('getCurrentPlatform', () => {
|
|
|
31
36
|
});
|
|
32
37
|
|
|
33
38
|
test('maps linux/arm64 → linux/arm64', async () => {
|
|
34
|
-
|
|
39
|
+
mockPlatform('linux', 'arm64');
|
|
35
40
|
const fn = await load();
|
|
36
41
|
const p = fn();
|
|
37
42
|
expect(p.os).toBe('linux');
|
|
@@ -39,7 +44,7 @@ describe('getCurrentPlatform', () => {
|
|
|
39
44
|
});
|
|
40
45
|
|
|
41
46
|
test('maps darwin/arm64 → macos/arm64 (Apple Silicon)', async () => {
|
|
42
|
-
|
|
47
|
+
mockPlatform('darwin', 'arm64');
|
|
43
48
|
const fn = await load();
|
|
44
49
|
const p = fn();
|
|
45
50
|
expect(p.os).toBe('macos');
|
|
@@ -47,7 +52,7 @@ describe('getCurrentPlatform', () => {
|
|
|
47
52
|
});
|
|
48
53
|
|
|
49
54
|
test('passes through unknown platform/arch as-is', async () => {
|
|
50
|
-
|
|
55
|
+
mockPlatform('freebsd', 'mips');
|
|
51
56
|
const fn = await load();
|
|
52
57
|
const p = fn();
|
|
53
58
|
expect(p.os).toBe('freebsd');
|
|
@@ -55,7 +60,7 @@ describe('getCurrentPlatform', () => {
|
|
|
55
60
|
});
|
|
56
61
|
|
|
57
62
|
test('returns raw platform and architecture fields alongside mapped ones', async () => {
|
|
58
|
-
|
|
63
|
+
mockPlatform('linux', 'x64');
|
|
59
64
|
const fn = await load();
|
|
60
65
|
const p = fn();
|
|
61
66
|
expect(p.platform).toBe('linux');
|
package/test/releases.test.ts
CHANGED
package/vitest.config.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/// <reference types="vitest/config" />
|
|
2
|
+
import { defineConfig } from "vitest/config";
|
|
3
|
+
|
|
4
|
+
// Per-package Vitest setup. Coverage is written to this package's own
|
|
5
|
+
// ./coverage/lcov.info so Codecov can flag it under "git0-repo-downloader".
|
|
6
|
+
export default defineConfig({
|
|
7
|
+
test: {
|
|
8
|
+
environment: "node",
|
|
9
|
+
include: ["{test,tests,src}/**/*.{test,spec}.{js,mjs,ts,tsx}"],
|
|
10
|
+
exclude: ["**/node_modules/**", "**/dist/**"],
|
|
11
|
+
// Infrastructure is in place before every package has a suite.
|
|
12
|
+
passWithNoTests: true,
|
|
13
|
+
coverage: {
|
|
14
|
+
provider: "v8",
|
|
15
|
+
reporter: ["text", "json", "lcov"],
|
|
16
|
+
reportsDirectory: "./coverage",
|
|
17
|
+
reportOnFailure: true,
|
|
18
|
+
include: [
|
|
19
|
+
"src/**/*.{ts,js}",
|
|
20
|
+
],
|
|
21
|
+
exclude: [
|
|
22
|
+
"**/node_modules/**",
|
|
23
|
+
"**/dist/**",
|
|
24
|
+
"**/build/**",
|
|
25
|
+
"**/coverage/**",
|
|
26
|
+
"**/demo/**",
|
|
27
|
+
"**/*.d.ts",
|
|
28
|
+
"**/*.config.*",
|
|
29
|
+
"**/*.{test,spec}.*",
|
|
30
|
+
"**/*.template.*",
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|