git0 0.2.3 → 0.2.4
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/docs/404.html +4 -0
- package/docs/CNAME +1 -0
- package/docs/Footer/index.html +4 -0
- package/docs/assets/css/styles.36dc19db.css +1 -0
- package/docs/assets/js/17896441.859f1a34.js +1 -0
- package/docs/assets/js/196.f2323311.js +1 -0
- package/docs/assets/js/1df93b7f.b886b8fe.js +1 -0
- package/docs/assets/js/22dd74f7.9915da9b.js +1 -0
- package/docs/assets/js/294.067938e2.js +101 -0
- package/docs/assets/js/4a829dc8.22596b01.js +1 -0
- package/docs/assets/js/5e95c892.a050489a.js +1 -0
- package/docs/assets/js/61.78a4a5cd.js +1 -0
- package/docs/assets/js/66a0d7f4.a57db0e1.js +1 -0
- package/docs/assets/js/990.0223f00f.js +1 -0
- package/docs/assets/js/a7456010.eaa69c24.js +1 -0
- package/docs/assets/js/a7bd4aaa.6bf60595.js +1 -0
- package/docs/assets/js/a94703ab.233c731c.js +1 -0
- package/docs/assets/js/aba21aa0.3975ceaf.js +1 -0
- package/docs/assets/js/ac46717f.20537802.js +1 -0
- package/docs/assets/js/c3a618e1.b288e34c.js +1 -0
- package/docs/assets/js/d140250a.42194f66.js +1 -0
- package/docs/assets/js/main.9107865a.js +38 -0
- package/docs/assets/js/runtime~main.d42315b4.js +1 -0
- package/docs/customize-home/index.html +4 -0
- package/docs/functions/globals/index.html +4 -0
- package/docs/functions/index.html +4 -0
- package/docs/index.html +4 -0
- package/docs/lunr-index-1749598895331.json +1 -0
- package/docs/lunr-index.json +1 -0
- package/docs/search-doc-1749598895331.json +1 -0
- package/docs/search-doc.json +1 -0
- package/docs/sitemap.xml +1 -0
- package/docs-config/config/customize-docs.js +30 -0
- package/docs-config/config/docs-theme.css +358 -0
- package/docs-config/config/openapi.mustache +39 -0
- package/docs-config/config/sidebars.ts +21 -0
- package/docs-config/config/typedoc.json +40 -0
- package/docs-config/docusaurus.config.ts +348 -0
- package/docs-config/package.json +40 -0
- package/docs-config/src/functions/globals.md +153 -0
- package/docs-config/src/functions/index.md +114 -0
- package/docs-config/src/functions/typedoc-sidebar.cjs +6 -0
- package/docs-config/src/index.md +126 -0
- package/docs-config/src/pages/Footer.tsx +57 -0
- package/docs-config/src/pages/customize-home.tsx +147 -0
- package/docs-config/src/pages/index.tsx +292 -0
- package/docs-config/static/CNAME +1 -0
- package/docs-config/tailwind.config.js +13 -0
- package/docs-config/tsconfig.json +26 -0
- package/git0.js +6 -6
- package/package.json +15 -15
- package/readme.md +16 -18
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import type * as Preset from "@docusaurus/preset-classic";
|
|
2
|
+
import type { Config } from "@docusaurus/types";
|
|
3
|
+
import type * as Plugin from "@docusaurus/types/src/plugin";
|
|
4
|
+
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
|
|
5
|
+
import { type ApiPageMetadata } from "docusaurus-plugin-openapi-docs/lib/types";
|
|
6
|
+
import { type MediaTypeObject } from "docusaurus-plugin-openapi-docs/lib/openapi/types";
|
|
7
|
+
//OpenAPI integration
|
|
8
|
+
import { createAuthorization } from "docusaurus-plugin-openapi-docs/lib/markdown/createAuthorization";
|
|
9
|
+
import { createCallbacks } from "docusaurus-plugin-openapi-docs/lib/markdown/createCallbacks";
|
|
10
|
+
import { createDeprecationNotice } from "docusaurus-plugin-openapi-docs/lib/markdown/createDeprecationNotice";
|
|
11
|
+
import { createDescription } from "docusaurus-plugin-openapi-docs/lib/markdown/createDescription";
|
|
12
|
+
import { createHeading } from "docusaurus-plugin-openapi-docs/lib/markdown/createHeading";
|
|
13
|
+
import { createMethodEndpoint } from "docusaurus-plugin-openapi-docs/lib/markdown/createMethodEndpoint";
|
|
14
|
+
import { createParamsDetails } from "docusaurus-plugin-openapi-docs/lib/markdown/createParamsDetails";
|
|
15
|
+
import { createRequestBodyDetails } from "docusaurus-plugin-openapi-docs/lib/markdown/createRequestBodyDetails";
|
|
16
|
+
import { createRequestHeader } from "docusaurus-plugin-openapi-docs/lib/markdown/createRequestHeader";
|
|
17
|
+
import { createStatusCodes } from "docusaurus-plugin-openapi-docs/lib/markdown/createStatusCodes";
|
|
18
|
+
import { createVendorExtensions } from "docusaurus-plugin-openapi-docs/lib/markdown/createVendorExtensions";
|
|
19
|
+
import { render } from "docusaurus-plugin-openapi-docs/lib/markdown/utils";
|
|
20
|
+
import customizeDocs from "./config/customize-docs";
|
|
21
|
+
import fs from "fs";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Generate docs from JSDoc comments in files, OpenAPI.yml spec for
|
|
25
|
+
* routes, search index of everything, custom pages, sidebar & theme.
|
|
26
|
+
*
|
|
27
|
+
* Files: openapi-docs.yaml, docs-theme.css, plugin-openapi.mustache,
|
|
28
|
+
* plugin-typedoc.js, sidebars.ts, docusaurus.config.ts, typedoc.json, tsconfig.json
|
|
29
|
+
*
|
|
30
|
+
* *Install dependencies*:
|
|
31
|
+
* bun install -D @docusaurus/core @docusaurus/faster @docusaurus/plugin-google-gtag
|
|
32
|
+
* @docusaurus/preset-classic docusaurus-lunr-search docusaurus-plugin-openapi-docs
|
|
33
|
+
* docusaurus-plugin-typedoc docusaurus-theme-openapi-docs prism-react-renderer react
|
|
34
|
+
* react-dom clsx typedoc typedoc-plugin-markdown typescript
|
|
35
|
+
* https://github.com/vtempest/ai-research-agent/blob/master/docs/api.mustache
|
|
36
|
+
* *Add to package.json*:
|
|
37
|
+
* "docs": "docusaurus serve --dir web-app/static/docs",
|
|
38
|
+
* "docs:build": "NODE_NO_WARNINGS=1 docusaurus clean-api-docs all --all-versions ;
|
|
39
|
+
* NODE_NO_WARNINGS=1 docusaurus gen-api-docs all --all-versions ;
|
|
40
|
+
* rm -rf web-app/static/docs; DOCUSAURUS_IGNORE_SSG_WARNINGS=true docusaurus
|
|
41
|
+
* build --out-dir web-app/static/docs",
|
|
42
|
+
*
|
|
43
|
+
* For homepage Add to docs/functions/index.md
|
|
44
|
+
*
|
|
45
|
+
---
|
|
46
|
+
sidebar_position: 1
|
|
47
|
+
sidebar_label: Introduction
|
|
48
|
+
title: Introduction
|
|
49
|
+
slug: /
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
* @see
|
|
53
|
+
* [Docusaurus Docs](https://docusaurus.io/docs)
|
|
54
|
+
* [Typedoc Docs](https://typedoc.org/documents/)
|
|
55
|
+
* [Typedoc Plugin Docs](https://typedoc-plugin-markdown.org/docs/options)
|
|
56
|
+
* [OpenAPI Plugin Docs](https://docusaurus-openapi.tryingpan.dev)
|
|
57
|
+
* @returns {Promise<Config>}
|
|
58
|
+
* @author [vtempest](https://github.com/vtempest/)
|
|
59
|
+
*/
|
|
60
|
+
export default async function createConfig(options: any = {}) {
|
|
61
|
+
const {
|
|
62
|
+
name = "App",
|
|
63
|
+
domain = "https://example.org",
|
|
64
|
+
baseFolder = "./",
|
|
65
|
+
typedocFolders = [],
|
|
66
|
+
showEditsOnGitHub = true,
|
|
67
|
+
GOOGLE_ANALYTICS_ID = undefined,
|
|
68
|
+
compileForSubdomain = !!process.env.DOCS_ON_SUBDOMAIN,
|
|
69
|
+
tsconfig = "./tsconfig.json",
|
|
70
|
+
readme = "../readme.md",
|
|
71
|
+
sanitizeComments = false,
|
|
72
|
+
favicon = undefined,
|
|
73
|
+
logo = undefined,
|
|
74
|
+
logoURL = "/",
|
|
75
|
+
topbar = [],
|
|
76
|
+
enableFuture = true,
|
|
77
|
+
} = { ...customizeDocs, ...options };
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
// make sure src folder exists
|
|
81
|
+
if (!fs.existsSync(baseFolder + "src")) {
|
|
82
|
+
fs.mkdirSync(baseFolder + "src");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//copy readme into ./src
|
|
86
|
+
if (fs.existsSync(readme)) {
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
var index_frontmatter = '---\nid: index\ntitle: Overview\n' +
|
|
90
|
+
'sidebar_position: 1\ndisplayed_sidebar: '
|
|
91
|
+
+ 'default' + '\n---\n\n'
|
|
92
|
+
|
|
93
|
+
var readmeContent = fs.readFileSync(readme, "utf8")
|
|
94
|
+
fs.writeFileSync(baseFolder + "src/index.md",
|
|
95
|
+
index_frontmatter + readmeContent);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
//prepend to index
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
// foldersWithFunctions - should also add to tsconfig.json include:[]
|
|
102
|
+
// compileForSubdomain is used to generate at domain.com/docs
|
|
103
|
+
// but on github pages workflow, it outputs to
|
|
104
|
+
// subdomain like docprojects.user.github.io
|
|
105
|
+
// sanitizeComments helps avoid errors in markdown like <> {} etc
|
|
106
|
+
return {
|
|
107
|
+
future: enableFuture ? {
|
|
108
|
+
v4: {
|
|
109
|
+
removeLegacyPostBuildHeadAttribute: true, // REQUIRED for ssgWorkerThreads
|
|
110
|
+
},
|
|
111
|
+
experimental_faster: true,
|
|
112
|
+
} : undefined,
|
|
113
|
+
title: name + " Docs",
|
|
114
|
+
url: domain,
|
|
115
|
+
baseUrl: compileForSubdomain ? "/" : "/docs/",
|
|
116
|
+
onBrokenLinks: "ignore",
|
|
117
|
+
onBrokenMarkdownLinks: "ignore",
|
|
118
|
+
favicon,
|
|
119
|
+
projectName: name.replaceAll(" ", "-"),
|
|
120
|
+
presets: [
|
|
121
|
+
[
|
|
122
|
+
"classic",
|
|
123
|
+
{
|
|
124
|
+
docs: {
|
|
125
|
+
path: "src",
|
|
126
|
+
routeBasePath: "/",
|
|
127
|
+
sidebarPath: "./config/sidebars.ts",
|
|
128
|
+
},
|
|
129
|
+
blog: false,
|
|
130
|
+
theme: {
|
|
131
|
+
customCss: baseFolder + "config/docs-theme.css",
|
|
132
|
+
},
|
|
133
|
+
gtag: {
|
|
134
|
+
trackingID: GOOGLE_ANALYTICS_ID,
|
|
135
|
+
anonymizeIP: false,
|
|
136
|
+
},
|
|
137
|
+
} satisfies Preset.Options,
|
|
138
|
+
],
|
|
139
|
+
],
|
|
140
|
+
|
|
141
|
+
headTags: [
|
|
142
|
+
{
|
|
143
|
+
tagName: 'script',
|
|
144
|
+
attributes: {
|
|
145
|
+
src: 'https://cdn.tailwindcss.com',
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
|
|
150
|
+
plugins: [
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
require.resolve("docusaurus-lunr-search"),
|
|
154
|
+
|
|
155
|
+
...(typedocFolders.map(({ id, entryPoints }) => [
|
|
156
|
+
"docusaurus-plugin-typedoc",
|
|
157
|
+
{
|
|
158
|
+
id,
|
|
159
|
+
entryPoints,
|
|
160
|
+
exclude: [
|
|
161
|
+
"**/node_modules/**/*",
|
|
162
|
+
],
|
|
163
|
+
tsconfig,
|
|
164
|
+
out: baseFolder + "src/" + id,
|
|
165
|
+
readme,
|
|
166
|
+
disableSources: !showEditsOnGitHub,
|
|
167
|
+
sidebar: { pretty: true },
|
|
168
|
+
textContentMappings: {
|
|
169
|
+
"title.indexPage": name + " API",
|
|
170
|
+
"title.memberPage": "{name}",
|
|
171
|
+
},
|
|
172
|
+
parametersFormat: "htmlTable",
|
|
173
|
+
indexFormat: "list",
|
|
174
|
+
expandParameters: true,
|
|
175
|
+
interfacePropertiesFormat: "htmlTable",
|
|
176
|
+
propertyMembersFormat: "htmlTable",
|
|
177
|
+
enumMembersFormat: "htmlTable",
|
|
178
|
+
typeDeclarationFormat: "htmlTable",
|
|
179
|
+
typeDeclarationVisibility: "compact",
|
|
180
|
+
sanitizeComments,
|
|
181
|
+
useHTMLEncodedBrackets: true,
|
|
182
|
+
hideBreadcrumbs: false,
|
|
183
|
+
hideGroupHeadings: true,
|
|
184
|
+
hidePageHeader: true,
|
|
185
|
+
hidePageTitle: true,
|
|
186
|
+
outputFileStrategy: "modules",
|
|
187
|
+
useCodeBlocks: true,
|
|
188
|
+
},
|
|
189
|
+
]))
|
|
190
|
+
],
|
|
191
|
+
|
|
192
|
+
themeConfig: {
|
|
193
|
+
src: {
|
|
194
|
+
sidebar: {
|
|
195
|
+
hideable: true,
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
navbar: {
|
|
199
|
+
title: name + " Docs",
|
|
200
|
+
logo: {
|
|
201
|
+
alt: "logo",
|
|
202
|
+
src: logo,
|
|
203
|
+
href: logoURL || "/",
|
|
204
|
+
},
|
|
205
|
+
items: topbar
|
|
206
|
+
},
|
|
207
|
+
|
|
208
|
+
languageTabs: [
|
|
209
|
+
{
|
|
210
|
+
highlight: "javascript",
|
|
211
|
+
language: "nodejs",
|
|
212
|
+
logoClass: "nodejs",
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
highlight: "javascript",
|
|
216
|
+
language: "javascript",
|
|
217
|
+
logoClass: "javascript",
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
highlight: "python",
|
|
221
|
+
language: "python",
|
|
222
|
+
logoClass: "python",
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
highlight: "bash",
|
|
226
|
+
language: "curl",
|
|
227
|
+
logoClass: "curl",
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
highlight: "powershell",
|
|
231
|
+
language: "powershell",
|
|
232
|
+
logoClass: "powershell",
|
|
233
|
+
},
|
|
234
|
+
|
|
235
|
+
{
|
|
236
|
+
highlight: "rust",
|
|
237
|
+
language: "rust",
|
|
238
|
+
logoClass: "rust",
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
highlight: "c",
|
|
242
|
+
language: "c",
|
|
243
|
+
logoClass: "c",
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
highlight: "swift",
|
|
247
|
+
language: "swift",
|
|
248
|
+
logoClass: "swift",
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
highlight: "kotlin",
|
|
252
|
+
language: "kotlin",
|
|
253
|
+
logoClass: "kotlin",
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
highlight: "java",
|
|
257
|
+
language: "java",
|
|
258
|
+
logoClass: "java",
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
highlight: "php",
|
|
262
|
+
language: "php",
|
|
263
|
+
logoClass: "php",
|
|
264
|
+
},
|
|
265
|
+
],
|
|
266
|
+
} satisfies Preset.ThemeConfig,
|
|
267
|
+
|
|
268
|
+
themes: [
|
|
269
|
+
"docusaurus-theme-openapi-docs"
|
|
270
|
+
],
|
|
271
|
+
stylesheets: [
|
|
272
|
+
{
|
|
273
|
+
href: "https://use.fontawesome.com/releases/v5.11.0/css/all.css",
|
|
274
|
+
type: "text/css",
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
} satisfies Config;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
function createServersTable(servers: any = []) {
|
|
282
|
+
if (typeof servers === 'object' && servers && servers.length) {
|
|
283
|
+
return `| URL | Description |
|
|
284
|
+
| ---- | ----- |
|
|
285
|
+
${servers
|
|
286
|
+
.map((server) => {
|
|
287
|
+
return `| ${server.url} | ${server.description} | `.replace("\n", "<br/>");
|
|
288
|
+
})
|
|
289
|
+
.join("\n")}
|
|
290
|
+
`;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export function createApiPageMD({
|
|
295
|
+
title,
|
|
296
|
+
api: {
|
|
297
|
+
deprecated,
|
|
298
|
+
"x-deprecated-description": deprecatedDescription,
|
|
299
|
+
description,
|
|
300
|
+
method,
|
|
301
|
+
path,
|
|
302
|
+
extensions,
|
|
303
|
+
parameters,
|
|
304
|
+
requestBody,
|
|
305
|
+
responses,
|
|
306
|
+
callbacks,
|
|
307
|
+
servers, // destructure servers here
|
|
308
|
+
},
|
|
309
|
+
infoPath,
|
|
310
|
+
frontMatter,
|
|
311
|
+
}: ApiPageMetadata) {
|
|
312
|
+
return render([
|
|
313
|
+
`import MethodEndpoint from "@theme/ApiExplorer/MethodEndpoint";\n`,
|
|
314
|
+
`import ParamsDetails from "@theme/ParamsDetails";\n`,
|
|
315
|
+
`import RequestSchema from "@theme/RequestSchema";\n`,
|
|
316
|
+
`import StatusCodes from "@theme/StatusCodes";\n`,
|
|
317
|
+
`import OperationTabs from "@theme/OperationTabs";\n`,
|
|
318
|
+
`import TabItem from "@theme/TabItem";\n`,
|
|
319
|
+
`import Heading from "@theme/Heading";\n\n`,
|
|
320
|
+
createHeading(title),
|
|
321
|
+
createMethodEndpoint(method, path),
|
|
322
|
+
// createServersTable(servers),
|
|
323
|
+
infoPath && createAuthorization(infoPath),
|
|
324
|
+
frontMatter.show_extensions
|
|
325
|
+
? createVendorExtensions(extensions)
|
|
326
|
+
: undefined,
|
|
327
|
+
createDeprecationNotice({ deprecated, description: deprecatedDescription }),
|
|
328
|
+
createDescription(description),
|
|
329
|
+
requestBody || parameters ? createRequestHeader("Request") : undefined,
|
|
330
|
+
createParamsDetails({ parameters }),
|
|
331
|
+
createRequestBodyDetails({
|
|
332
|
+
title: "Body",
|
|
333
|
+
body: requestBody,
|
|
334
|
+
} as RequestBodyProps),
|
|
335
|
+
createStatusCodes({ responses }),
|
|
336
|
+
createCallbacks({ callbacks }),
|
|
337
|
+
]);
|
|
338
|
+
}
|
|
339
|
+
interface RequestBodyProps {
|
|
340
|
+
title: string;
|
|
341
|
+
body: {
|
|
342
|
+
content?: {
|
|
343
|
+
[key: string]: MediaTypeObject;
|
|
344
|
+
};
|
|
345
|
+
description?: string;
|
|
346
|
+
required?: boolean;
|
|
347
|
+
};
|
|
348
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "create-apidocs",
|
|
3
|
+
"version": "4.2.0",
|
|
4
|
+
"description": "Docusaurus autogenerated from OpenAPI spec & Typedoc functions (with Lunr Search)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"create-apidocs": "./bin/create-apidocs"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"docs": "concurrently \"npx docusaurus serve --dir ../docs\" \"wait-on http://localhost:3000 && opener http://localhost:3000\"",
|
|
10
|
+
"build:docs:subdomain": "DOCS_ON_SUBDOMAIN=true npm run docs:build",
|
|
11
|
+
"build:docs": " mkdir ../docs; NODE_NO_WARNINGS=1 npx docusaurus clean-api-docs all --all-versions ; NODE_NO_WARNINGS=1 npx docusaurus gen-api-docs all --all-versions ; DOCUSAURUS_IGNORE_SSG_WARNINGS=true npx docusaurus build --out-dir ../docs; npm run docs",
|
|
12
|
+
"docs:copy": "cp ../docs/functions/index.html ../docs/index.html; rm -rf ../web-app/static/docs; cp -r ../docs ../web-app/static; mv ../web-app/static/dist ../web-app/static/docs"
|
|
13
|
+
},
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@docusaurus/core": "^3.8.0",
|
|
16
|
+
"@docusaurus/faster": "^3.8.0",
|
|
17
|
+
"@docusaurus/plugin-google-gtag": "^3.8.0",
|
|
18
|
+
"@docusaurus/preset-classic": "^3.8.0",
|
|
19
|
+
"@tailwindcss/postcss": "^4.1.8",
|
|
20
|
+
"ajv": "^8.17.1",
|
|
21
|
+
"clsx": "^2.1.1",
|
|
22
|
+
"docusaurus": "^1.14.7",
|
|
23
|
+
"docusaurus-lunr-search": "^3.6.0",
|
|
24
|
+
"docusaurus-plugin-openapi-docs": "^4.4.0",
|
|
25
|
+
"docusaurus-plugin-typedoc": "^1.4.0",
|
|
26
|
+
"docusaurus-theme-openapi-docs": "^4.4.0",
|
|
27
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
28
|
+
"postcss": "^8.5.4",
|
|
29
|
+
"prism-react-renderer": "^2.4.1",
|
|
30
|
+
"react": "^19.1.0",
|
|
31
|
+
"react-dom": "^19.1.0",
|
|
32
|
+
"tailwindcss": "^4.1.8"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"concurrently": "^9.1.2",
|
|
36
|
+
"lucide-react": "^0.513.0",
|
|
37
|
+
"opener": "^1.5.2",
|
|
38
|
+
"wait-on": "^8.0.3"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
## downloadRepo()
|
|
2
|
+
|
|
3
|
+
```ts
|
|
4
|
+
function downloadRepo(repo: any): Promise<void>;
|
|
5
|
+
```
|
|
6
|
+
|
|
7
|
+
Defined in: [git0.js:506](https://github.com/vtempest/git0/blob/5ad15f56050b5bcd90d629bc617422361c7db421/git0.js#L506)
|
|
8
|
+
|
|
9
|
+
### Parameters
|
|
10
|
+
|
|
11
|
+
<table>
|
|
12
|
+
<thead>
|
|
13
|
+
<tr>
|
|
14
|
+
<th>Parameter</th>
|
|
15
|
+
<th>Type</th>
|
|
16
|
+
</tr>
|
|
17
|
+
</thead>
|
|
18
|
+
<tbody>
|
|
19
|
+
<tr>
|
|
20
|
+
<td>
|
|
21
|
+
|
|
22
|
+
`repo`
|
|
23
|
+
|
|
24
|
+
</td>
|
|
25
|
+
<td>
|
|
26
|
+
|
|
27
|
+
`any`
|
|
28
|
+
|
|
29
|
+
</td>
|
|
30
|
+
</tr>
|
|
31
|
+
</tbody>
|
|
32
|
+
</table>
|
|
33
|
+
|
|
34
|
+
### Returns
|
|
35
|
+
|
|
36
|
+
`Promise`<`void`>
|
|
37
|
+
|
|
38
|
+
***
|
|
39
|
+
|
|
40
|
+
## installDependencies()
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
function installDependencies(targetDir: any): Promise<void>;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Defined in: [git0.js:397](https://github.com/vtempest/git0/blob/5ad15f56050b5bcd90d629bc617422361c7db421/git0.js#L397)
|
|
47
|
+
|
|
48
|
+
### Parameters
|
|
49
|
+
|
|
50
|
+
<table>
|
|
51
|
+
<thead>
|
|
52
|
+
<tr>
|
|
53
|
+
<th>Parameter</th>
|
|
54
|
+
<th>Type</th>
|
|
55
|
+
</tr>
|
|
56
|
+
</thead>
|
|
57
|
+
<tbody>
|
|
58
|
+
<tr>
|
|
59
|
+
<td>
|
|
60
|
+
|
|
61
|
+
`targetDir`
|
|
62
|
+
|
|
63
|
+
</td>
|
|
64
|
+
<td>
|
|
65
|
+
|
|
66
|
+
`any`
|
|
67
|
+
|
|
68
|
+
</td>
|
|
69
|
+
</tr>
|
|
70
|
+
</tbody>
|
|
71
|
+
</table>
|
|
72
|
+
|
|
73
|
+
### Returns
|
|
74
|
+
|
|
75
|
+
`Promise`<`void`>
|
|
76
|
+
|
|
77
|
+
***
|
|
78
|
+
|
|
79
|
+
## openInIDE()
|
|
80
|
+
|
|
81
|
+
```ts
|
|
82
|
+
function openInIDE(targetDir: any): void;
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Defined in: [git0.js:354](https://github.com/vtempest/git0/blob/5ad15f56050b5bcd90d629bc617422361c7db421/git0.js#L354)
|
|
86
|
+
|
|
87
|
+
### Parameters
|
|
88
|
+
|
|
89
|
+
<table>
|
|
90
|
+
<thead>
|
|
91
|
+
<tr>
|
|
92
|
+
<th>Parameter</th>
|
|
93
|
+
<th>Type</th>
|
|
94
|
+
</tr>
|
|
95
|
+
</thead>
|
|
96
|
+
<tbody>
|
|
97
|
+
<tr>
|
|
98
|
+
<td>
|
|
99
|
+
|
|
100
|
+
`targetDir`
|
|
101
|
+
|
|
102
|
+
</td>
|
|
103
|
+
<td>
|
|
104
|
+
|
|
105
|
+
`any`
|
|
106
|
+
|
|
107
|
+
</td>
|
|
108
|
+
</tr>
|
|
109
|
+
</tbody>
|
|
110
|
+
</table>
|
|
111
|
+
|
|
112
|
+
### Returns
|
|
113
|
+
|
|
114
|
+
`void`
|
|
115
|
+
|
|
116
|
+
***
|
|
117
|
+
|
|
118
|
+
## searchRepositories()
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
function searchRepositories(query: any): Promise<any>;
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Defined in: [git0.js:467](https://github.com/vtempest/git0/blob/5ad15f56050b5bcd90d629bc617422361c7db421/git0.js#L467)
|
|
125
|
+
|
|
126
|
+
### Parameters
|
|
127
|
+
|
|
128
|
+
<table>
|
|
129
|
+
<thead>
|
|
130
|
+
<tr>
|
|
131
|
+
<th>Parameter</th>
|
|
132
|
+
<th>Type</th>
|
|
133
|
+
</tr>
|
|
134
|
+
</thead>
|
|
135
|
+
<tbody>
|
|
136
|
+
<tr>
|
|
137
|
+
<td>
|
|
138
|
+
|
|
139
|
+
`query`
|
|
140
|
+
|
|
141
|
+
</td>
|
|
142
|
+
<td>
|
|
143
|
+
|
|
144
|
+
`any`
|
|
145
|
+
|
|
146
|
+
</td>
|
|
147
|
+
</tr>
|
|
148
|
+
</tbody>
|
|
149
|
+
</table>
|
|
150
|
+
|
|
151
|
+
### Returns
|
|
152
|
+
|
|
153
|
+
`Promise`<`any`>
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://i.imgur.com/poOtI3N.png" />
|
|
3
|
+
</p>
|
|
4
|
+
<p align="center">
|
|
5
|
+
<a href="https://discord.gg/SJdBqBz3tV">
|
|
6
|
+
<img src="https://img.shields.io/discord/1110227955554209923.svg?label=Chat&logo=Discord&colorB=7289da&style=flat"
|
|
7
|
+
alt="Join Discord" />
|
|
8
|
+
</a>
|
|
9
|
+
<a href="https://github.com/vtempest/gg/discussions">
|
|
10
|
+
<img alt="GitHub Stars" src="https://img.shields.io/github/stars/vtempest/gg" /></a>
|
|
11
|
+
<a href="https://github.com/vtempest/gg/discussions">
|
|
12
|
+
<img alt="GitHub Discussions"
|
|
13
|
+
src="https://img.shields.io/github/discussions/vtempest/gg" />
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://github.com/vtempest/gg/pulse" alt="Activity">
|
|
16
|
+
<img src="https://img.shields.io/github/commit-activity/m/vtempest/gg" />
|
|
17
|
+
</a>
|
|
18
|
+
<img src="https://img.shields.io/github/last-commit/vtempest/gg.svg?style=flat-square" alt="GitHub last commit" />
|
|
19
|
+
</p>
|
|
20
|
+
<p align="center">
|
|
21
|
+
<img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square"
|
|
22
|
+
alt="PRs Welcome" />
|
|
23
|
+
<a href="https://codespaces.new/vtempest/gg">
|
|
24
|
+
<img src="https://github.com/codespaces/badge.svg" width="150" height="20" />
|
|
25
|
+
</a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
# Git0: Download Git Repo on Step Zero
|
|
29
|
+
CLI tool to search GitHub repositories, download source & releases for your system, and instantly set up, then install dependencies and open code editor.
|
|
30
|
+
|
|
31
|
+
## 🚀 Installation
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install -g git0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
bun install -g git0
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+

|
|
42
|
+

|
|
43
|
+
|
|
44
|
+
## ✨ Features
|
|
45
|
+
|
|
46
|
+
- **Search GitHub repositories** by name with fuzzy matching
|
|
47
|
+
- **Download repositories** directly from GitHub URLs or owner/repo shortcuts. Skip the manual git clone, cd, install dance
|
|
48
|
+
- **Get Releases** instantly download latest release for your system or all systems
|
|
49
|
+
- **Automatic dependency detection** and installation for multiple project types
|
|
50
|
+
- **Smart IDE integration** - automatically opens projects in your preferred editor
|
|
51
|
+
- **Cross-platform support** - works on Windows, macOS, and Linux
|
|
52
|
+
- **Conflict resolution** - handles directory naming conflicts automatically
|
|
53
|
+
|
|
54
|
+
## 🎯 Usage
|
|
55
|
+
|
|
56
|
+
### Search and Download
|
|
57
|
+
```bash
|
|
58
|
+
# Search for repositories by name
|
|
59
|
+
gg react starter
|
|
60
|
+
|
|
61
|
+
# Direct download from GitHub URL
|
|
62
|
+
gg https://github.com/facebook/react
|
|
63
|
+
|
|
64
|
+
# Download using owner/repo shorthand
|
|
65
|
+
## gg and git0 both work
|
|
66
|
+
git0 facebook/react
|
|
67
|
+
|
|
68
|
+
## Use without installing
|
|
69
|
+
npx git0 react starter
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Supported Project Types
|
|
73
|
+
|
|
74
|
+
GG automatically detects and sets up the following project types:
|
|
75
|
+
|
|
76
|
+
| Project Type | Detection | Installation |
|
|
77
|
+
|-------------|-----------|-------------|
|
|
78
|
+
| **Node.js** | `package.json` | `bun install` (fallback to `npm install`) |
|
|
79
|
+
| **Docker** | `Dockerfile`, `docker-compose.yml` | `docker-compose up -d` or `docker build` |
|
|
80
|
+
| **Python** | `requirements.txt`, `setup.py` | Virtual environment + pip install |
|
|
81
|
+
| **Rust** | `Cargo.toml` | `cargo build` |
|
|
82
|
+
| **Go** | `go.mod` | `go mod tidy` |
|
|
83
|
+
|
|
84
|
+
### Supported IDEs
|
|
85
|
+
|
|
86
|
+
GG automatically detects and opens projects in your preferred IDE:
|
|
87
|
+
|
|
88
|
+
- **Cursor** (`cursor`)
|
|
89
|
+
- **Windsurf** (`windsurf`)
|
|
90
|
+
- **VS Code** (`code`)
|
|
91
|
+
- **Code Server** (`code-server`)
|
|
92
|
+
- **Neovim** (`nvim`)
|
|
93
|
+
|
|
94
|
+
## 🔧 Configuration
|
|
95
|
+
|
|
96
|
+
### GitHub Token (Optional)
|
|
97
|
+
|
|
98
|
+
For higher API rate limits, set [your GitHub token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token):
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
export GITHUB_TOKEN=your_github_token_here
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Without a token, you're limited to 60 requests per hour. With a token, you get 5,000 requests per hour.
|
|
105
|
+
|
|
106
|
+
### What Happens After Download
|
|
107
|
+
|
|
108
|
+
1. **Repository is downloaded** to your current directory
|
|
109
|
+
2. **Project type is detected** automatically
|
|
110
|
+
3. **Dependencies are installed** based on project type
|
|
111
|
+
4. **IDE is launched** automatically (if available)
|
|
112
|
+
5. **Development server starts** (for Node.js projects)
|
|
113
|
+
|
|
114
|
+
If a directory with the same name exists, GG automatically appends a number (e.g., `react-2`, `react-3`).
|