git0 0.2.5 → 0.2.6
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/bun.lock +159 -0
- package/docs/404.html +2 -2
- package/docs/Footer/index.html +2 -2
- package/docs/assets/js/{22dd74f7.5e857962.js → 22dd74f7.040a4546.js} +1 -1
- package/docs/assets/js/4a829dc8.10d7db0a.js +1 -0
- package/docs/assets/js/{main.c71c09a5.js → main.6b27aee7.js} +2 -2
- package/docs/assets/js/{runtime~main.ef55418f.js → runtime~main.5c54c19c.js} +1 -1
- package/docs/functions/globals/index.html +18 -27
- package/docs/functions/index.html +2 -2
- package/docs/index.html +2 -2
- package/docs/lunr-index-1749612068805.json +1 -0
- package/docs/lunr-index.json +1 -1
- package/docs/search-doc-1749612068805.json +1 -0
- package/docs/search-doc.json +1 -1
- package/docs-config/.docusaurus/DONT-EDIT-THIS-FOLDER +5 -0
- package/docs-config/.docusaurus/client-manifest.json +247 -0
- package/docs-config/.docusaurus/client-modules.js +8 -0
- package/docs-config/.docusaurus/codeTranslations.json +1 -0
- package/docs-config/.docusaurus/docusaurus-lunr-search/default/__plugin.json +4 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-docs/default/__mdx-loader-dependency.json +1 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-docs/default/__plugin.json +4 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-docs/default/p/index-466.json +1 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-docs/default/site-src-functions-globals-md-4a8.json +19 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-docs/default/site-src-functions-index-md-c3a.json +19 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-docs/default/site-src-index-md-d14.json +21 -0
- package/docs-config/.docusaurus/docusaurus-plugin-content-pages/default/__plugin.json +4 -0
- package/docs-config/.docusaurus/docusaurus-plugin-google-gtag/default/__plugin.json +4 -0
- package/docs-config/.docusaurus/docusaurus.config.mjs +385 -0
- package/docs-config/.docusaurus/globalData.json +60 -0
- package/docs-config/.docusaurus/i18n.json +17 -0
- package/docs-config/.docusaurus/lunr.client.js +5 -0
- package/docs-config/.docusaurus/registry.js +14 -0
- package/docs-config/.docusaurus/routes.js +55 -0
- package/docs-config/.docusaurus/routesChunkNames.json +41 -0
- package/docs-config/.docusaurus/site-metadata.json +51 -0
- package/docs-config/.docusaurus/site-storage.json +4 -0
- package/docs-config/bun.lock +6139 -0
- package/docs-config/config/customize-docs.js +1 -1
- package/docs-config/src/functions/globals.md +25 -79
- package/docs-config/tsconfig.json +1 -1
- package/package.json +10 -7
- package/src/git0.js +380 -0
- package/src/github-api.js +473 -0
- package/docs/assets/js/4a829dc8.728a4445.js +0 -1
- package/docs/lunr-index-1749601667754.json +0 -1
- package/docs/search-doc-1749601667754.json +0 -1
- package/docs-config/tailwind.config.js +0 -13
- package/git0.js +0 -646
- /package/docs/assets/js/{main.c71c09a5.js.LICENSE.txt → main.6b27aee7.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1,473 @@
|
|
|
1
|
+
import grab from 'grab-api.js';
|
|
2
|
+
import chalk from 'chalk';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import gitUrlParse from 'git-url-parse';
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import * as tar from 'tar';
|
|
7
|
+
import path from 'path';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* GitHub API client for downloading repositories, searching, and managing releases
|
|
11
|
+
* @class GithubAPI
|
|
12
|
+
* @example
|
|
13
|
+
* const github = new GithubAPI();
|
|
14
|
+
* const repos = await github.searchRepositories('nodejs');
|
|
15
|
+
* await github.downloadRepo('user/repo', './my-downloads');
|
|
16
|
+
*/
|
|
17
|
+
class GithubAPI {
|
|
18
|
+
/** @constant {number} Number of results to return per page for repository searches */
|
|
19
|
+
static DEFAULT_RESULTS_PER_PAGE = 10;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Creates a new GithubAPI instance
|
|
23
|
+
* @param {Object} [options={}] - Configuration options
|
|
24
|
+
* @param {string} [options.token] - GitHub personal access token (defaults to GITHUB_TOKEN env var)
|
|
25
|
+
* @param {boolean} [options.debug=false] - Enable debug logging
|
|
26
|
+
* @param {string} [options.baseURL='https://api.github.com'] - GitHub API base URL
|
|
27
|
+
* @example
|
|
28
|
+
* // Use default settings with environment token
|
|
29
|
+
*
|
|
30
|
+
* // Use custom token
|
|
31
|
+
* const github = new GithubAPI({ token: 'ghp_xxxxxxxxxxxx' });
|
|
32
|
+
*
|
|
33
|
+
* // Enable debug mode
|
|
34
|
+
* const github = new GithubAPI({ debug: true });
|
|
35
|
+
*/
|
|
36
|
+
constructor(options = {}) {
|
|
37
|
+
this.token = options.token || process.env.GITHUB_TOKEN;
|
|
38
|
+
this.debug = options.debug || false;
|
|
39
|
+
this.baseURL = options.baseURL || 'https://api.github.com';
|
|
40
|
+
|
|
41
|
+
this.client = grab.instance({
|
|
42
|
+
debug: this.debug,
|
|
43
|
+
baseURL: this.baseURL,
|
|
44
|
+
headers: this.token ? { Authorization: `token ${this.token}` } : {},
|
|
45
|
+
onError: (error) => {
|
|
46
|
+
if (error.includes('403')) {
|
|
47
|
+
const githubHelpUrl = 'https://github.com/settings/personal-access-tokens/new';
|
|
48
|
+
console.log(chalk.red('Rate limit exceeded. Please set env var GITHUB_TOKEN. Help:\n' + githubHelpUrl));
|
|
49
|
+
process.exit(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Downloads a GitHub repository as a tarball and extracts it to a local directory
|
|
57
|
+
* @param {string} repo - Repository URL or owner/name format
|
|
58
|
+
* @param {string|null} [targetDir=null] - Target directory name (defaults to repo name)
|
|
59
|
+
* @returns {Promise<string>} Path to the extracted repository directory
|
|
60
|
+
* @throws {Error} When repository download fails
|
|
61
|
+
* @example
|
|
62
|
+
*
|
|
63
|
+
* // Download repository to current directory
|
|
64
|
+
* const repoPath = await github.downloadRepo('https://github.com/user/repo');
|
|
65
|
+
*
|
|
66
|
+
* // Download to specific directory
|
|
67
|
+
* const repoPath = await github.downloadRepo('user/repo', 'my-custom-dir');
|
|
68
|
+
*/
|
|
69
|
+
async downloadRepo(repo, targetDir = null) {
|
|
70
|
+
const parsed = gitUrlParse(repo);
|
|
71
|
+
const defaultDir = path.resolve(process.cwd(), targetDir?.length ? targetDir : parsed.name);
|
|
72
|
+
const extractPath = this._getAvailableDirectoryName(defaultDir);
|
|
73
|
+
|
|
74
|
+
// if it picks up a larger owner name, slice to the last part
|
|
75
|
+
if (parsed.owner.includes('/')) {
|
|
76
|
+
parsed.owner = parsed.owner.split('/').slice(-1).join('');
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
fs.mkdirSync(extractPath, { recursive: true });
|
|
80
|
+
|
|
81
|
+
let url = `/repos/${parsed.owner}/${parsed.name}/tarball/${parsed.default_branch || 'master'}`;
|
|
82
|
+
|
|
83
|
+
console.log(chalk.blue(`📦 Downloading ${parsed.name} into ${path.basename(extractPath)}...`));
|
|
84
|
+
|
|
85
|
+
const params = {
|
|
86
|
+
onStream: async (res) => {
|
|
87
|
+
const nodeStream = (await import('stream'))?.Readable.fromWeb(res);
|
|
88
|
+
await new Promise((resolve, reject) => {
|
|
89
|
+
nodeStream.pipe(tar.x({
|
|
90
|
+
C: extractPath,
|
|
91
|
+
strip: 1
|
|
92
|
+
})).on('finish', resolve).on('error', reject);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
let response = await this.client(url, params);
|
|
98
|
+
|
|
99
|
+
if (response.error) {
|
|
100
|
+
response = await this.client(url.replace("/master", "/main"), params);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
return extractPath;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Searches for GitHub repositories by name and enriches results with release information
|
|
108
|
+
* @param {string} query - Search query for repository names
|
|
109
|
+
* @param {Object} [options={}] - Search options
|
|
110
|
+
*
|
|
111
|
+
* @param {number} [options.perPage] - Number of results per page (defaults to DEFAULT_RESULTS_PER_PAGE)
|
|
112
|
+
* @param {string} [options.sort='stars'] - Sort field (stars, forks, updated)
|
|
113
|
+
* @param {string} [options.order='desc'] - Sort order (asc, desc)
|
|
114
|
+
* @returns {Promise<Array<Object>>} Array of repository objects with release information
|
|
115
|
+
* @throws {Error} When search fails
|
|
116
|
+
* @example
|
|
117
|
+
*
|
|
118
|
+
* const repos = await github.searchRepositories('nodejs');
|
|
119
|
+
* repos.forEach(repo => {
|
|
120
|
+
* console.log(`${repo.name}: ${repo.hasReleases ? 'Has releases' : 'No releases'}`);
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* // Custom search options
|
|
124
|
+
* const repos = await github.searchRepositories('react', {
|
|
125
|
+
* perPage: 5,
|
|
126
|
+
* sort: 'updated',
|
|
127
|
+
* order: 'desc'
|
|
128
|
+
* });
|
|
129
|
+
*/
|
|
130
|
+
async searchRepositories(query, options = {}) {
|
|
131
|
+
try {
|
|
132
|
+
const {
|
|
133
|
+
perPage = GithubAPI.DEFAULT_RESULTS_PER_PAGE,
|
|
134
|
+
sort = 'stars',
|
|
135
|
+
order = 'desc',
|
|
136
|
+
getReleaseInfo = true
|
|
137
|
+
} = options;
|
|
138
|
+
|
|
139
|
+
const response = await this.client('/search/repositories', {
|
|
140
|
+
q: `${query} in:name`,
|
|
141
|
+
sort,
|
|
142
|
+
order,
|
|
143
|
+
per_page: perPage,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
if (response.error || !response.items) {
|
|
147
|
+
console.log("No response");
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return !getReleaseInfo ? response :
|
|
152
|
+
// Check for releases for each repository
|
|
153
|
+
await Promise.all(
|
|
154
|
+
response.items.map(async (repo) => {
|
|
155
|
+
const releases = await this.client(`/repos/${repo.owner.login}/${repo.name}/releases`);
|
|
156
|
+
|
|
157
|
+
const currentPlatform = this.getCurrentPlatform();
|
|
158
|
+
const compatibleReleases = this._filterReleasesByPlatform(releases, currentPlatform);
|
|
159
|
+
const categorizedReleases = this._categorizeReleasesByPlatform(releases);
|
|
160
|
+
|
|
161
|
+
return {
|
|
162
|
+
...repo,
|
|
163
|
+
hasReleases: releases?.length > 0,
|
|
164
|
+
hasCompatibleReleases: compatibleReleases.length > 0,
|
|
165
|
+
releases: compatibleReleases,
|
|
166
|
+
allReleases: categorizedReleases
|
|
167
|
+
};
|
|
168
|
+
})
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
} catch (error) {
|
|
172
|
+
console.error(chalk.red('Search failed:'), error.message);
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Downloads a release asset from GitHub and provides installation instructions
|
|
179
|
+
* @param {Object} packageURL - Download URL for the asset
|
|
180
|
+
* @param {string} downloadPath - Directory to download the asset to
|
|
181
|
+
* @returns {Promise<string>} Path to the downloaded file
|
|
182
|
+
* @throws {Error} When download fails
|
|
183
|
+
* @example
|
|
184
|
+
*
|
|
185
|
+
* const asset = 'https://github.com/user/repo/releases/download/v1.0.0/myapp-v1.0.0-linux-x64'
|
|
186
|
+
* const downloadPath = await github.downloadPackage(asset, './downloads/myapp');
|
|
187
|
+
*/
|
|
188
|
+
async downloadPackage(packageURL, downloadPath) {
|
|
189
|
+
const fileName = downloadPath.split('/').slice(-1)?.[0];
|
|
190
|
+
|
|
191
|
+
console.log(chalk.blue(`📦 Downloading ${fileName}...`));
|
|
192
|
+
|
|
193
|
+
try {
|
|
194
|
+
await this.client(packageURL, {
|
|
195
|
+
onStream: async (res) => {
|
|
196
|
+
const nodeStream = (await import('stream'))?.Readable.fromWeb(res);
|
|
197
|
+
await new Promise((resolve, reject) => {
|
|
198
|
+
nodeStream.pipe(fs.createWriteStream(downloadPath)).on('finish', resolve).on('error', reject);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
console.log(chalk.green(`✅ Downloaded ${fileName} to ${downloadPath}`));
|
|
204
|
+
|
|
205
|
+
// Try to make executable if it's a binary
|
|
206
|
+
if (process.platform !== 'win32' && !fileName.includes('.')) {
|
|
207
|
+
try {
|
|
208
|
+
fs.chmodSync(downloadPath, '755');
|
|
209
|
+
console.log(chalk.green(`✅ Made ${fileName} executable`));
|
|
210
|
+
} catch (error) {
|
|
211
|
+
console.log(chalk.yellow(`⚠️ Could not make ${fileName} executable`));
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// Provide installation instructions
|
|
216
|
+
this._provideInstallationInstructions(downloadPath, asset);
|
|
217
|
+
|
|
218
|
+
return downloadPath;
|
|
219
|
+
} catch (error) {
|
|
220
|
+
console.error(chalk.red(`❌ Failed to download ${fileName}:`), error.message);
|
|
221
|
+
throw error;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/**
|
|
226
|
+
* Parses a GitHub URL or shorthand repository reference
|
|
227
|
+
* @param {string} query - GitHub URL or owner/repo format
|
|
228
|
+
* @returns {Object|false} Parsed git URL object or false if invalid
|
|
229
|
+
* @example
|
|
230
|
+
*
|
|
231
|
+
* // Parse full URL
|
|
232
|
+
* const parsed = github.parseURL('https://github.com/user/repo');
|
|
233
|
+
*
|
|
234
|
+
* // Parse shorthand
|
|
235
|
+
* const parsed = github.parseURL('user/repo');
|
|
236
|
+
*
|
|
237
|
+
* if (parsed) {
|
|
238
|
+
* console.log(`Owner: ${parsed.owner}, Name: ${parsed.name}`);
|
|
239
|
+
* }
|
|
240
|
+
*/
|
|
241
|
+
parseURL(query) {
|
|
242
|
+
if (query.includes('github.com') || query.startsWith('git@github.com:') ||
|
|
243
|
+
query.startsWith('https://') || query.startsWith('git://')) {
|
|
244
|
+
return gitUrlParse(query);
|
|
245
|
+
} else if (/^[\w-]+\/[\w.-]+$/.test(query)) {
|
|
246
|
+
return gitUrlParse(`https://github.com/${query}`);
|
|
247
|
+
}
|
|
248
|
+
return false;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Detects the current operating system and architecture
|
|
253
|
+
* @returns {Object} Platform information object
|
|
254
|
+
* @returns {string} returns.os - Normalized OS name (windows, macos, linux)
|
|
255
|
+
* @returns {string} returns.arch - Normalized architecture (x86_64, arm64, arm, i386)
|
|
256
|
+
* @returns {string} returns.platform - Raw Node.js platform string
|
|
257
|
+
* @returns {string} returns.architecture - Raw Node.js architecture string
|
|
258
|
+
* @example
|
|
259
|
+
* const platform = github.getCurrentPlatform();
|
|
260
|
+
* console.log(`Running on ${platform.os} ${platform.arch}`);
|
|
261
|
+
*/
|
|
262
|
+
getCurrentPlatform() {
|
|
263
|
+
const platform = os.platform();
|
|
264
|
+
const arch = os.arch();
|
|
265
|
+
|
|
266
|
+
const platformMap = {
|
|
267
|
+
'win32': 'windows',
|
|
268
|
+
'darwin': 'macos',
|
|
269
|
+
'linux': 'linux'
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
const archMap = {
|
|
273
|
+
'x64': 'x86_64',
|
|
274
|
+
'arm64': 'arm64',
|
|
275
|
+
'arm': 'arm',
|
|
276
|
+
'ia32': 'i386'
|
|
277
|
+
};
|
|
278
|
+
|
|
279
|
+
return {
|
|
280
|
+
os: platformMap[platform] || platform,
|
|
281
|
+
arch: archMap[arch] || arch,
|
|
282
|
+
platform,
|
|
283
|
+
architecture: arch
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Gets repository releases with platform categorization
|
|
289
|
+
* @param {string} owner - Repository owner
|
|
290
|
+
* @param {string} repo - Repository name
|
|
291
|
+
* @returns {Promise<Array<Object>>} Array of categorized releases
|
|
292
|
+
* @example
|
|
293
|
+
* const releases = await github.getReleases('microsoft', 'vscode');
|
|
294
|
+
* console.log(`Found ${releases.length} releases`);
|
|
295
|
+
*/
|
|
296
|
+
async getReleases(owner, repo) {
|
|
297
|
+
const releases = await this.client(`/repos/${owner}/${repo}/releases`);
|
|
298
|
+
return this._categorizeReleasesByPlatform(releases);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Gets releases compatible with the current platform
|
|
303
|
+
* @param {string} owner - Repository owner
|
|
304
|
+
* @param {string} repo - Repository name
|
|
305
|
+
* @returns {Promise<Array<Object>>} Array of compatible releases
|
|
306
|
+
* @example
|
|
307
|
+
* const compatible = await github.getCompatibleReleases('user', 'repo');
|
|
308
|
+
* console.log(`Found ${compatible.length} compatible releases`);
|
|
309
|
+
*/
|
|
310
|
+
async getCompatibleReleases(owner, repo) {
|
|
311
|
+
const releases = await this.client(`/repos/${owner}/${repo}/releases`);
|
|
312
|
+
const currentPlatform = this.getCurrentPlatform();
|
|
313
|
+
return this._filterReleasesByPlatform(releases, currentPlatform);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* Generates an available directory name by appending a counter if the base path exists
|
|
318
|
+
* @private
|
|
319
|
+
* @param {string} basePath - The desired base directory path
|
|
320
|
+
* @returns {string} An available directory path
|
|
321
|
+
*/
|
|
322
|
+
_getAvailableDirectoryName(basePath) {
|
|
323
|
+
if (!fs.existsSync(basePath)) return basePath;
|
|
324
|
+
let counter = 2;
|
|
325
|
+
let newPath;
|
|
326
|
+
while (true) {
|
|
327
|
+
newPath = `${basePath}-${counter}`;
|
|
328
|
+
if (!fs.existsSync(newPath)) return newPath;
|
|
329
|
+
counter++;
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/**
|
|
334
|
+
* Categorizes GitHub releases by platform and architecture based on asset names
|
|
335
|
+
* @private
|
|
336
|
+
* @param {Array<Object>} releases - Array of GitHub release objects
|
|
337
|
+
* @returns {Array<Object>} Releases with platformAssets property containing categorized assets
|
|
338
|
+
*/
|
|
339
|
+
_categorizeReleasesByPlatform(releases) {
|
|
340
|
+
const platformKeywords = {
|
|
341
|
+
windows: ['win', 'windows', 'win32', 'win64', '.exe', '.msi'],
|
|
342
|
+
macos: ['mac', 'macos', 'darwin', 'osx', '.dmg', '.pkg'],
|
|
343
|
+
linux: ['linux', 'ubuntu', 'debian', '.deb', '.rpm', '.tar.gz', '.AppImage']
|
|
344
|
+
};
|
|
345
|
+
|
|
346
|
+
const archKeywords = {
|
|
347
|
+
x86_64: ['x86_64', 'x64', 'amd64', '64'],
|
|
348
|
+
arm64: ['arm64', 'aarch64'],
|
|
349
|
+
arm: ['arm', 'armv7'],
|
|
350
|
+
i386: ['i386', 'x86', '32']
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
const categorizedReleases = [];
|
|
354
|
+
|
|
355
|
+
Object.entries(releases).forEach(([key, release]) => {
|
|
356
|
+
const platformAssets = {
|
|
357
|
+
windows: [],
|
|
358
|
+
macos: [],
|
|
359
|
+
linux: [],
|
|
360
|
+
universal: []
|
|
361
|
+
};
|
|
362
|
+
|
|
363
|
+
release?.assets?.forEach(asset => {
|
|
364
|
+
const name = asset.name.toLowerCase();
|
|
365
|
+
let categorized = false;
|
|
366
|
+
|
|
367
|
+
// Check each platform
|
|
368
|
+
Object.entries(platformKeywords).forEach(([platform, keywords]) => {
|
|
369
|
+
if (keywords.some(keyword => name.includes(keyword.toLowerCase()))) {
|
|
370
|
+
// Determine architecture
|
|
371
|
+
let detectedArch = 'unknown';
|
|
372
|
+
Object.entries(archKeywords).forEach(([arch, archKeys]) => {
|
|
373
|
+
if (archKeys.some(archKey => name.includes(archKey.toLowerCase()))) {
|
|
374
|
+
detectedArch = arch;
|
|
375
|
+
}
|
|
376
|
+
});
|
|
377
|
+
|
|
378
|
+
platformAssets[platform].push({
|
|
379
|
+
...asset,
|
|
380
|
+
detectedArch,
|
|
381
|
+
platform
|
|
382
|
+
});
|
|
383
|
+
categorized = true;
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
// If not categorized, check for universal binaries
|
|
388
|
+
if (!categorized && (name.includes('universal') || name.includes('all') ||
|
|
389
|
+
(!name.includes('win') && !name.includes('mac') && !name.includes('linux')))) {
|
|
390
|
+
platformAssets.universal.push({
|
|
391
|
+
...asset,
|
|
392
|
+
detectedArch: 'universal',
|
|
393
|
+
platform: 'universal'
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
// Only include releases that have assets
|
|
399
|
+
const hasAssets = Object.values(platformAssets).some(assets => assets.length > 0);
|
|
400
|
+
if (hasAssets) {
|
|
401
|
+
categorizedReleases.push({
|
|
402
|
+
...release,
|
|
403
|
+
platformAssets
|
|
404
|
+
});
|
|
405
|
+
}
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
return categorizedReleases;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Filters releases to only include those compatible with the specified platform
|
|
413
|
+
* @private
|
|
414
|
+
* @param {Array<Object>} releases - Array of GitHub release objects
|
|
415
|
+
* @param {Object} currentPlatform - Platform information from getCurrentPlatform()
|
|
416
|
+
* @returns {Array<Object>} Filtered array of compatible releases
|
|
417
|
+
*/
|
|
418
|
+
_filterReleasesByPlatform(releases, currentPlatform) {
|
|
419
|
+
const categorized = this._categorizeReleasesByPlatform(releases);
|
|
420
|
+
return categorized.filter(release =>
|
|
421
|
+
release.platformAssets[currentPlatform.os].length > 0 ||
|
|
422
|
+
release.platformAssets.universal.length > 0
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Provides platform-specific installation instructions for a downloaded asset
|
|
428
|
+
* @private
|
|
429
|
+
* @param {string} filePath - Path to the downloaded file
|
|
430
|
+
* @param {Object} asset - GitHub release asset object
|
|
431
|
+
* @param {string} asset.name - Name of the asset file
|
|
432
|
+
*/
|
|
433
|
+
_provideInstallationInstructions(filePath, asset) {
|
|
434
|
+
const fileName = asset.name;
|
|
435
|
+
const platform = this.getCurrentPlatform();
|
|
436
|
+
|
|
437
|
+
if (platform.platform === 'win32') {
|
|
438
|
+
if (fileName.endsWith('.exe')) {
|
|
439
|
+
console.log(chalk.white(' Run the executable:'));
|
|
440
|
+
console.log(chalk.gray(` ${filePath}`));
|
|
441
|
+
} else if (fileName.endsWith('.msi')) {
|
|
442
|
+
console.log(chalk.white(' Install the MSI package:'));
|
|
443
|
+
console.log(chalk.gray(` msiexec /i "${filePath}"`));
|
|
444
|
+
}
|
|
445
|
+
} else if (platform.platform === 'darwin') {
|
|
446
|
+
if (fileName.endsWith('.dmg')) {
|
|
447
|
+
console.log(chalk.white(' Mount and install the DMG:'));
|
|
448
|
+
console.log(chalk.gray(` open "${filePath}"`));
|
|
449
|
+
} else if (fileName.endsWith('.pkg')) {
|
|
450
|
+
console.log(chalk.white(' Install the package:'));
|
|
451
|
+
console.log(chalk.gray(` sudo installer -pkg "${filePath}" -target /`));
|
|
452
|
+
}
|
|
453
|
+
} else {
|
|
454
|
+
if (fileName.endsWith('.deb')) {
|
|
455
|
+
console.log(chalk.white(' Install the DEB package:'));
|
|
456
|
+
console.log(chalk.gray(` sudo dpkg -i "${filePath}"`));
|
|
457
|
+
} else if (fileName.endsWith('.rpm')) {
|
|
458
|
+
console.log(chalk.white(' Install the RPM package:'));
|
|
459
|
+
console.log(chalk.gray(` sudo rpm -i "${filePath}"`));
|
|
460
|
+
} else if (fileName.endsWith('.AppImage')) {
|
|
461
|
+
console.log(chalk.white(' Run the AppImage:'));
|
|
462
|
+
console.log(chalk.gray(` chmod +x "${filePath}" && "${filePath}"`));
|
|
463
|
+
} else if (!fileName.includes('.')) {
|
|
464
|
+
console.log(chalk.white(' Binary is ready to use:'));
|
|
465
|
+
console.log(chalk.gray(` "${filePath}"`));
|
|
466
|
+
console.log(chalk.white(' Consider moving to PATH:'));
|
|
467
|
+
console.log(chalk.gray(` sudo mv "${filePath}" /usr/local/bin/`));
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
export default GithubAPI;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkcreate_apidocs=self.webpackChunkcreate_apidocs||[]).push([[26],{5576:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>o,frontMatter:()=>t,metadata:()=>r,toc:()=>a});const r=JSON.parse('{"id":"functions/globals","title":"globals","description":"downloadRepo()","source":"@site/src/functions/globals.md","sourceDirName":"functions","slug":"/functions/globals","permalink":"/functions/globals","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{},"sidebar":"default","next":{"title":"index","permalink":"/functions/"}}');var i=s(4848),d=s(8453);const t={},c=void 0,l={},a=[{value:"downloadRepo()",id:"downloadrepo",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"installDependencies()",id:"installdependencies",level:2},{value:"Parameters",id:"parameters-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"openInIDE()",id:"openinide",level:2},{value:"Parameters",id:"parameters-2",level:3},{value:"Returns",id:"returns-2",level:3},{value:"searchRepositories()",id:"searchrepositories",level:2},{value:"Parameters",id:"parameters-3",level:3},{value:"Returns",id:"returns-3",level:3}];function h(e){const n={a:"a",code:"code",h2:"h2",h3:"h3",hr:"hr",p:"p",pre:"pre",...(0,d.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"downloadrepo",children:"downloadRepo()"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:"function downloadRepo(repo: any): Promise<void>;\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Defined in: ",(0,i.jsx)(n.a,{href:"https://github.com/vtempest/git0/blob/f5565c601a25c627e02f22dfda1f72982fbcaeae/git0.js#L506",children:"git0.js:506"})]}),"\n",(0,i.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Parameter"}),(0,i.jsx)("th",{children:"Type"})]})}),(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"repo"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"any"})})})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.code,{children:"void"}),">"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"installdependencies",children:"installDependencies()"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:"function installDependencies(targetDir: any): Promise<void>;\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Defined in: ",(0,i.jsx)(n.a,{href:"https://github.com/vtempest/git0/blob/f5565c601a25c627e02f22dfda1f72982fbcaeae/git0.js#L397",children:"git0.js:397"})]}),"\n",(0,i.jsx)(n.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Parameter"}),(0,i.jsx)("th",{children:"Type"})]})}),(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"targetDir"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"any"})})})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-1",children:"Returns"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.code,{children:"void"}),">"]}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"openinide",children:"openInIDE()"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:"function openInIDE(targetDir: any): void;\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Defined in: ",(0,i.jsx)(n.a,{href:"https://github.com/vtempest/git0/blob/f5565c601a25c627e02f22dfda1f72982fbcaeae/git0.js#L354",children:"git0.js:354"})]}),"\n",(0,i.jsx)(n.h3,{id:"parameters-2",children:"Parameters"}),"\n",(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Parameter"}),(0,i.jsx)("th",{children:"Type"})]})}),(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"targetDir"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"any"})})})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-2",children:"Returns"}),"\n",(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"void"})}),"\n",(0,i.jsx)(n.hr,{}),"\n",(0,i.jsx)(n.h2,{id:"searchrepositories",children:"searchRepositories()"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-ts",children:"function searchRepositories(query: any): Promise<any>;\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Defined in: ",(0,i.jsx)(n.a,{href:"https://github.com/vtempest/git0/blob/f5565c601a25c627e02f22dfda1f72982fbcaeae/git0.js#L467",children:"git0.js:467"})]}),"\n",(0,i.jsx)(n.h3,{id:"parameters-3",children:"Parameters"}),"\n",(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Parameter"}),(0,i.jsx)("th",{children:"Type"})]})}),(0,i.jsx)("tbody",{children:(0,i.jsxs)("tr",{children:[(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"query"})})}),(0,i.jsx)("td",{children:(0,i.jsx)(n.p,{children:(0,i.jsx)(n.code,{children:"any"})})})]})})]}),"\n",(0,i.jsx)(n.h3,{id:"returns-3",children:"Returns"}),"\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"Promise"}),"<",(0,i.jsx)(n.code,{children:"any"}),">"]})]})}function o(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>t,x:()=>c});var r=s(6540);const i={},d=r.createContext(i);function t(e){const n=r.useContext(d);return r.useMemo((function(){return"function"==typeof e?e(n):{...n,...e}}),[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:t(e.components),r.createElement(d.Provider,{value:n},e.children)}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":"2.3.9","fields":["title","content","keywords"],"fieldVectors":[["title/0",[0,654.564]],["content/0",[]],["keywords/0",[]],["title/1",[1,654.564]],["content/1",[2,4.24,3,7.096,4,4.24,5,4.24,6,7.096]],["keywords/1",[]],["title/2",[7,238.668]],["content/2",[7,2.852,8,3.211,9,6.358]],["keywords/2",[]],["title/3",[10,391.156]],["content/3",[4,5.207]],["keywords/3",[]],["title/4",[11,654.564]],["content/4",[2,4.24,4,4.24,5,4.24,12,7.096,13,7.096]],["keywords/4",[]],["title/5",[7,238.668]],["content/5",[7,2.852,8,3.211,14,6.358]],["keywords/5",[]],["title/6",[10,391.156]],["content/6",[4,5.207]],["keywords/6",[]],["title/7",[15,654.564]],["content/7",[2,4.24,5,4.24,16,7.096,17,5.768,18,7.096]],["keywords/7",[]],["title/8",[7,238.668]],["content/8",[7,2.852,8,3.211,14,6.358]],["keywords/8",[]],["title/9",[10,391.156]],["content/9",[17,7.083]],["keywords/9",[]],["title/10",[19,654.564]],["content/10",[2,4.24,5,4.24,20,7.096,21,5.768,22,7.096]],["keywords/10",[]],["title/11",[7,238.668]],["content/11",[7,2.852,8,3.211,23,7.822]],["keywords/11",[]],["title/12",[10,391.156]],["content/12",[21,7.083]],["keywords/12",[]],["title/13",[9,216.469,24,123.265,25,139.56,26,216.469,27,266.296,28,266.296]],["content/13",[]],["keywords/13",[]],["title/14",[29,234.583,30,234.583]],["content/14",[24,3.797,30,3.797,31,5.063,32,8.203,33,5.063]],["keywords/14",[]],["title/15",[29,234.583,34,506.783]],["content/15",[25,1.186,26,1.84,30,1.763,35,1.84,36,2.276,37,2.627,38,2.627,39,2.263,40,2.263,41,2.263,42,1.84,43,1.84,44,2.263,45,2.263,46,2.263,47,2.263,48,2.263,49,2.263,50,3.809,51,2.263,52,2.263,53,2.263,54,2.263,55,2.263,56,1.353,57,2.263,58,1.996,59,2.263,60,1.561,61,2.263,62,2.276,63,1.84,64,1.84,65,2.263,66,2.263,67,1.561,68,1.84,69,2.263,70,2.263,71,2.263,72,2.263,73,2.263,74,1.84,75,2.263]],["keywords/15",[]],["title/16",[29,234.583,76,506.783]],["content/16",[24,2.896,25,2.217,29,3.447,30,1.188,35,2.087,36,1.534,37,1.771,38,1.771,42,2.087,43,2.087,68,2.087,77,5.396,78,3.439,79,4.231,80,2.567,81,2.567,82,2.567,83,4.231,84,2.567,85,2.087,86,2.567,87,2.567,88,2.567,89,2.567,90,2.567,91,2.567,92,2.567,93,2.567,94,2.567]],["keywords/16",[]],["title/17",[8,169.704,58,216.675,67,285.124]],["content/17",[8,1.69,24,1.15,29,1.15,30,2.44,31,2.019,33,2.019,56,2.46,58,2.158,62,1.484,95,2.019,96,4.117,97,2.484,98,2.484,99,2.484,100,2.484,101,6.132,102,2.484,103,2.484,104,2.484,105,2.484,106,4.117,107,2.484,108,2.484,109,2.484,110,2.484,111,2.484,112,2.484,113,2.484,114,2.484,115,2.484,116,4.117,117,2.484,118,2.484,119,2.484]],["keywords/17",[]],["title/18",[60,349.497,67,349.497]],["content/18",[24,2.174,56,2.807,58,2.462,60,3.24,62,2.807,63,3.819,64,3.819,120,4.697,121,4.697,122,4.697,123,6.754,124,4.697,125,3.819,126,4.697,127,4.697]],["keywords/18",[]],["title/19",[29,234.583,128,506.783]],["content/19",[]],["keywords/19",[]],["title/20",[25,265.593,129,506.783]],["content/20",[8,1.32,24,1.488,25,1.685,30,1.488,37,2.218,38,2.218,56,1.922,58,2.659,62,3.032,74,2.614,78,4.124,125,2.614,130,3.215,131,3.215,132,3.215,133,3.215,134,3.215,135,3.215,136,3.215,137,3.215,138,3.215,139,3.215,140,3.215,141,3.215,142,3.215,143,3.215,144,3.215,145,3.215]],["keywords/20",[]],["title/21",[36,247.065,146,336.08,147,413.441]],["content/21",[36,2.37,85,3.224,95,3.224,146,5.825,148,3.966,149,3.966,150,3.966,151,5.963,152,3.966,153,3.966,154,3.966,155,3.966,156,5.963,157,5.963,158,5.963,159,3.966]],["keywords/21",[]]],"invertedIndex":[["",{"_index":29,"title":{"14":{"position":[[0,2]]},"15":{"position":[[0,1]]},"16":{"position":[[0,2]]},"19":{"position":[[0,2]]}},"content":{"16":{"position":[[1,1],[52,1],[86,2],[148,1],[205,2],[256,1]]},"17":{"position":[[293,1]]}},"keywords":{}}],["2",{"_index":144,"title":{},"content":{"20":{"position":[[322,2]]}},"keywords":{}}],["3",{"_index":145,"title":{},"content":{"20":{"position":[[331,3]]}},"keywords":{}}],["5,000",{"_index":159,"title":{},"content":{"21":{"position":[[177,5]]}},"keywords":{}}],["60",{"_index":155,"title":{},"content":{"21":{"position":[[133,2]]}},"keywords":{}}],["api",{"_index":149,"title":{},"content":{"21":{"position":[[12,3]]}},"keywords":{}}],["append",{"_index":141,"title":{},"content":{"20":{"position":[[292,7]]}},"keywords":{}}],["automat",{"_index":62,"title":{},"content":{"15":{"position":[[347,13],[516,13]]},"17":{"position":[[6,13]]},"18":{"position":[[6,13]]},"20":{"position":[[153,13],[278,13]]}},"keywords":{}}],["automaticallydepend",{"_index":132,"title":{},"content":{"20":{"position":[[76,25]]}},"keywords":{}}],["available)develop",{"_index":136,"title":{},"content":{"20":{"position":[[171,21]]}},"keywords":{}}],["base",{"_index":133,"title":{},"content":{"20":{"position":[[116,5]]}},"keywords":{}}],["both",{"_index":81,"title":{},"content":{"16":{"position":[[101,4]]}},"keywords":{}}],["build",{"_index":106,"title":{},"content":{"17":{"position":[[233,5],[329,5]]}},"keywords":{}}],["bun",{"_index":33,"title":{},"content":{"14":{"position":[[23,3]]},"17":{"position":[[126,3]]}},"keywords":{}}],["cargo",{"_index":115,"title":{},"content":{"17":{"position":[[323,5]]}},"keywords":{}}],["cargo.toml",{"_index":114,"title":{},"content":{"17":{"position":[[312,10]]}},"keywords":{}}],["cd",{"_index":48,"title":{},"content":{"15":{"position":[[155,3]]}},"keywords":{}}],["clone",{"_index":47,"title":{},"content":{"15":{"position":[[148,6]]}},"keywords":{}}],["code",{"_index":123,"title":{},"content":{"18":{"position":[[108,4],[131,5]]}},"keywords":{}}],["code)cod",{"_index":124,"title":{},"content":{"18":{"position":[[113,10]]}},"keywords":{}}],["compos",{"_index":104,"title":{},"content":{"17":{"position":[[209,7]]}},"keywords":{}}],["compose.yml",{"_index":103,"title":{},"content":{"17":{"position":[[190,11]]}},"keywords":{}}],["configur",{"_index":128,"title":{"19":{"position":[[3,14]]}},"content":{},"keywords":{}}],["conflict",{"_index":75,"title":{},"content":{"15":{"position":[[506,9]]}},"keywords":{}}],["copi",{"_index":88,"title":{},"content":{"16":{"position":[[258,5]]}},"keywords":{}}],["current",{"_index":130,"title":{},"content":{"20":{"position":[[34,7]]}},"keywords":{}}],["cursor",{"_index":120,"title":{},"content":{"18":{"position":[[71,6]]}},"keywords":{}}],["cursor)windsurf",{"_index":121,"title":{},"content":{"18":{"position":[[78,16]]}},"keywords":{}}],["d",{"_index":105,"title":{},"content":{"17":{"position":[[221,1]]}},"keywords":{}}],["danceget",{"_index":49,"title":{},"content":{"15":{"position":[[167,8]]}},"keywords":{}}],["defin",{"_index":5,"title":{},"content":{"1":{"position":[[58,7]]},"4":{"position":[[70,7]]},"7":{"position":[[45,7]]},"10":{"position":[[64,7]]}},"keywords":{}}],["depend",{"_index":55,"title":{},"content":{"15":{"position":[[259,10]]}},"keywords":{}}],["detect",{"_index":56,"title":{},"content":{"15":{"position":[[270,9]]},"17":{"position":[[20,7],[83,9]]},"18":{"position":[[20,7]]},"20":{"position":[[67,8]]}},"keywords":{}}],["direct",{"_index":80,"title":{},"content":{"16":{"position":[[54,6]]}},"keywords":{}}],["directli",{"_index":41,"title":{},"content":{"15":{"position":[[77,8]]}},"keywords":{}}],["directori",{"_index":74,"title":{},"content":{"15":{"position":[[489,9]]},"20":{"position":[[236,9]]}},"keywords":{}}],["directoryproject",{"_index":131,"title":{},"content":{"20":{"position":[[42,16]]}},"keywords":{}}],["docker",{"_index":101,"title":{},"content":{"17":{"position":[[164,6],[183,6],[202,6],[226,6]]}},"keywords":{}}],["dockerfil",{"_index":102,"title":{},"content":{"17":{"position":[[171,11]]}},"keywords":{}}],["download",{"_index":25,"title":{"13":{"position":[[6,8]]},"20":{"position":[[19,9]]}},"content":{"15":{"position":[[195,8]]},"16":{"position":[[61,8],[150,8]]},"20":{"position":[[15,10]]}},"keywords":{}}],["downloadrepo",{"_index":1,"title":{"1":{"position":[[0,15]]}},"content":{},"keywords":{}}],["downloadrepo(repo",{"_index":3,"title":{},"content":{"1":{"position":[[10,18]]}},"keywords":{}}],["e.g",{"_index":143,"title":{},"content":{"20":{"position":[[309,6]]}},"keywords":{}}],["editorcross",{"_index":65,"title":{},"content":{"15":{"position":[[394,11]]}},"keywords":{}}],["environ",{"_index":111,"title":{},"content":{"17":{"position":[[281,11]]}},"keywords":{}}],["exist",{"_index":140,"title":{},"content":{"20":{"position":[[265,7]]}},"keywords":{}}],["export",{"_index":152,"title":{},"content":{"21":{"position":[[53,6]]}},"keywords":{}}],["facebook/react",{"_index":94,"title":{},"content":{"16":{"position":[[317,14]]}},"keywords":{}}],["fallback",{"_index":100,"title":{},"content":{"17":{"position":[[138,9]]}},"keywords":{}}],["featur",{"_index":34,"title":{"15":{"position":[[2,9]]}},"content":{},"keywords":{}}],["follow",{"_index":97,"title":{},"content":{"17":{"position":[[44,9]]}},"keywords":{}}],["function",{"_index":2,"title":{},"content":{"1":{"position":[[1,8]]},"4":{"position":[[1,8]]},"7":{"position":[[1,8]]},"10":{"position":[[1,8]]}},"keywords":{}}],["fuzzi",{"_index":39,"title":{},"content":{"15":{"position":[[41,5]]}},"keywords":{}}],["g",{"_index":32,"title":{},"content":{"14":{"position":[[14,1],[36,1]]}},"keywords":{}}],["gg",{"_index":77,"title":{},"content":{"16":{"position":[[35,2],[89,2],[111,2]]}},"keywords":{}}],["git",{"_index":26,"title":{"13":{"position":[[15,3]]}},"content":{"15":{"position":[[144,3]]}},"keywords":{}}],["git0",{"_index":24,"title":{"13":{"position":[[0,5]]}},"content":{"14":{"position":[[16,4],[38,4]]},"16":{"position":[[96,4],[186,4],[212,4],[312,4]]},"17":{"position":[[1,4]]},"18":{"position":[[1,4]]},"20":{"position":[[273,4]]}},"keywords":{}}],["git0.js:354",{"_index":18,"title":{},"content":{"7":{"position":[[57,11]]}},"keywords":{}}],["git0.js:397",{"_index":13,"title":{},"content":{"4":{"position":[[82,11]]}},"keywords":{}}],["git0.js:467",{"_index":22,"title":{},"content":{"10":{"position":[[76,11]]}},"keywords":{}}],["git0.js:506",{"_index":6,"title":{},"content":{"1":{"position":[[70,11]]}},"keywords":{}}],["github",{"_index":36,"title":{"21":{"position":[[0,6]]}},"content":{"15":{"position":[[8,6],[91,6]]},"16":{"position":[[75,6]]},"21":{"position":[[38,6]]}},"keywords":{}}],["github_token=your_github_token_her",{"_index":153,"title":{},"content":{"21":{"position":[[60,35]]}},"keywords":{}}],["global",{"_index":0,"title":{"0":{"position":[[0,7]]}},"content":{},"keywords":{}}],["go",{"_index":116,"title":{},"content":{"17":{"position":[[335,2],[345,2]]}},"keywords":{}}],["go.mod",{"_index":117,"title":{},"content":{"17":{"position":[[338,6]]}},"keywords":{}}],["handl",{"_index":73,"title":{},"content":{"15":{"position":[[481,7]]}},"keywords":{}}],["happen",{"_index":129,"title":{"20":{"position":[[5,7]]}},"content":{},"keywords":{}}],["higher",{"_index":148,"title":{},"content":{"21":{"position":[[5,6]]}},"keywords":{}}],["hour",{"_index":158,"title":{},"content":{"21":{"position":[[149,5],[196,5]]}},"keywords":{}}],["https://github.com/facebook/react",{"_index":82,"title":{},"content":{"16":{"position":[[114,33]]}},"keywords":{}}],["id",{"_index":60,"title":{"18":{"position":[[10,5]]}},"content":{"15":{"position":[[329,3]]},"18":{"position":[[65,4]]}},"keywords":{}}],["instal",{"_index":30,"title":{"14":{"position":[[3,13]]}},"content":{"14":{"position":[[5,7],[27,7]]},"15":{"position":[[159,7],[284,12]]},"16":{"position":[[225,11]]},"17":{"position":[[130,7],[155,8],[299,7]]},"20":{"position":[[106,9]]}},"keywords":{}}],["installationnode.j",{"_index":98,"title":{},"content":{"17":{"position":[[93,19]]}},"keywords":{}}],["installdepend",{"_index":11,"title":{"4":{"position":[[0,22]]}},"content":{},"keywords":{}}],["installdependencies(targetdir",{"_index":12,"title":{},"content":{"4":{"position":[[10,30]]}},"keywords":{}}],["instantli",{"_index":51,"title":{},"content":{"15":{"position":[[185,9]]}},"keywords":{}}],["integr",{"_index":61,"title":{},"content":{"15":{"position":[[333,11]]}},"keywords":{}}],["latest",{"_index":52,"title":{},"content":{"15":{"position":[[204,6]]}},"keywords":{}}],["launch",{"_index":135,"title":{},"content":{"20":{"position":[[144,8]]}},"keywords":{}}],["limit",{"_index":151,"title":{},"content":{"21":{"position":[[21,7],[122,7]]}},"keywords":{}}],["linuxconflict",{"_index":71,"title":{},"content":{"15":{"position":[[454,13]]}},"keywords":{}}],["maco",{"_index":70,"title":{},"content":{"15":{"position":[[443,6]]}},"keywords":{}}],["manual",{"_index":46,"title":{},"content":{"15":{"position":[[137,6]]}},"keywords":{}}],["matchingdownload",{"_index":40,"title":{},"content":{"15":{"position":[[47,16]]}},"keywords":{}}],["mod",{"_index":118,"title":{},"content":{"17":{"position":[[348,3]]}},"keywords":{}}],["multipl",{"_index":57,"title":{},"content":{"15":{"position":[[301,8]]}},"keywords":{}}],["name",{"_index":38,"title":{},"content":{"15":{"position":[[31,4],[499,6]]},"16":{"position":[[30,4]]},"20":{"position":[[260,4]]}},"keywords":{}}],["need",{"_index":87,"title":{},"content":{"16":{"position":[[248,7]]}},"keywords":{}}],["node",{"_index":86,"title":{},"content":{"16":{"position":[[243,4]]}},"keywords":{}}],["node.j",{"_index":138,"title":{},"content":{"20":{"position":[[212,7]]}},"keywords":{}}],["npm",{"_index":31,"title":{},"content":{"14":{"position":[[1,3]]},"17":{"position":[[151,3]]}},"keywords":{}}],["npx",{"_index":93,"title":{},"content":{"16":{"position":[[308,3]]}},"keywords":{}}],["number",{"_index":142,"title":{},"content":{"20":{"position":[[302,6]]}},"keywords":{}}],["nvim",{"_index":127,"title":{},"content":{"18":{"position":[[151,6]]}},"keywords":{}}],["open",{"_index":63,"title":{},"content":{"15":{"position":[[361,5]]},"18":{"position":[[32,5]]}},"keywords":{}}],["openinid",{"_index":15,"title":{"7":{"position":[[0,12]]}},"content":{},"keywords":{}}],["openinide(targetdir",{"_index":16,"title":{},"content":{"7":{"position":[[10,20]]}},"keywords":{}}],["option",{"_index":147,"title":{"21":{"position":[[13,11]]}},"content":{},"keywords":{}}],["owner/repo",{"_index":43,"title":{},"content":{"15":{"position":[[106,10]]},"16":{"position":[[165,10]]}},"keywords":{}}],["package.json",{"_index":99,"title":{},"content":{"17":{"position":[[113,12]]}},"keywords":{}}],["paramet",{"_index":7,"title":{"2":{"position":[[0,11]]},"5":{"position":[[0,11]]},"8":{"position":[[0,11]]},"11":{"position":[[0,11]]}},"content":{"2":{"position":[[1,9]]},"5":{"position":[[1,9]]},"8":{"position":[[1,9]]},"11":{"position":[[1,9]]}},"keywords":{}}],["per",{"_index":157,"title":{},"content":{"21":{"position":[[145,3],[192,3]]}},"keywords":{}}],["pip",{"_index":112,"title":{},"content":{"17":{"position":[[295,3]]}},"keywords":{}}],["platform",{"_index":66,"title":{},"content":{"15":{"position":[[406,8]]}},"keywords":{}}],["prefer",{"_index":64,"title":{},"content":{"15":{"position":[[384,9]]},"18":{"position":[[55,9]]}},"keywords":{}}],["project",{"_index":58,"title":{"17":{"position":[[10,7]]}},"content":{"15":{"position":[[310,7],[367,8]]},"17":{"position":[[54,7],[70,7]]},"18":{"position":[[38,8]]},"20":{"position":[[125,7],[220,9]]}},"keywords":{}}],["project'",{"_index":89,"title":{},"content":{"16":{"position":[[274,9]]}},"keywords":{}}],["promise<any>",{"_index":21,"title":{},"content":{"10":{"position":[[42,19]]},"12":{"position":[[1,18]]}},"keywords":{}}],["promise<void>",{"_index":4,"title":{},"content":{"1":{"position":[[35,20]]},"3":{"position":[[1,19]]},"4":{"position":[[47,20]]},"6":{"position":[[1,19]]}},"keywords":{}}],["python",{"_index":107,"title":{},"content":{"17":{"position":[[239,6]]}},"keywords":{}}],["queri",{"_index":23,"title":{},"content":{"11":{"position":[[16,5]]}},"keywords":{}}],["quick",{"_index":91,"title":{},"content":{"16":{"position":[[295,5]]}},"keywords":{}}],["rate",{"_index":150,"title":{},"content":{"21":{"position":[[16,4]]}},"keywords":{}}],["react",{"_index":78,"title":{},"content":{"16":{"position":[[38,5],[191,5]]},"20":{"position":[[316,5],[325,5]]}},"keywords":{}}],["readm",{"_index":90,"title":{},"content":{"16":{"position":[[284,6]]}},"keywords":{}}],["releas",{"_index":50,"title":{},"content":{"15":{"position":[[176,8],[211,7]]}},"keywords":{}}],["repo",{"_index":9,"title":{"13":{"position":[[19,4]]}},"content":{"2":{"position":[[16,4]]}},"keywords":{}}],["repositori",{"_index":37,"title":{},"content":{"15":{"position":[[15,12],[64,12]]},"16":{"position":[[14,12]]},"20":{"position":[[1,10]]}},"keywords":{}}],["request",{"_index":156,"title":{},"content":{"21":{"position":[[136,8],[183,8]]}},"keywords":{}}],["requirements.txt",{"_index":108,"title":{},"content":{"17":{"position":[[246,17]]}},"keywords":{}}],["resolut",{"_index":72,"title":{},"content":{"15":{"position":[[468,10]]}},"keywords":{}}],["return",{"_index":10,"title":{"3":{"position":[[0,8]]},"6":{"position":[[0,8]]},"9":{"position":[[0,8]]},"12":{"position":[[0,8]]}},"content":{},"keywords":{}}],["rust",{"_index":113,"title":{},"content":{"17":{"position":[[307,4]]}},"keywords":{}}],["same",{"_index":139,"title":{},"content":{"20":{"position":[[255,4]]}},"keywords":{}}],["search",{"_index":35,"title":{},"content":{"15":{"position":[[1,6]]},"16":{"position":[[3,6]]}},"keywords":{}}],["searchrepositori",{"_index":19,"title":{"10":{"position":[[0,21]]}},"content":{},"keywords":{}}],["searchrepositories(queri",{"_index":20,"title":{},"content":{"10":{"position":[[10,25]]}},"keywords":{}}],["server",{"_index":125,"title":{},"content":{"18":{"position":[[124,6]]},"20":{"position":[[193,6]]}},"keywords":{}}],["server)neovim",{"_index":126,"title":{},"content":{"18":{"position":[[137,13]]}},"keywords":{}}],["set",{"_index":95,"title":{},"content":{"17":{"position":[[32,4]]},"21":{"position":[[29,3]]}},"keywords":{}}],["setup",{"_index":92,"title":{},"content":{"16":{"position":[[301,6]]}},"keywords":{}}],["setup.pi",{"_index":109,"title":{},"content":{"17":{"position":[[264,8]]}},"keywords":{}}],["shortcut",{"_index":44,"title":{},"content":{"15":{"position":[[117,10]]}},"keywords":{}}],["shorthand",{"_index":84,"title":{},"content":{"16":{"position":[[176,9]]}},"keywords":{}}],["skip",{"_index":45,"title":{},"content":{"15":{"position":[[128,4]]}},"keywords":{}}],["start",{"_index":137,"title":{},"content":{"20":{"position":[[200,6]]}},"keywords":{}}],["starter",{"_index":79,"title":{},"content":{"16":{"position":[[44,7],[197,7]]}},"keywords":{}}],["step",{"_index":27,"title":{"13":{"position":[[27,4]]}},"content":{},"keywords":{}}],["support",{"_index":67,"title":{"17":{"position":[[0,9]]},"18":{"position":[[0,9]]}},"content":{"15":{"position":[[415,7]]}},"keywords":{}}],["system",{"_index":53,"title":{},"content":{"15":{"position":[[228,6]]}},"keywords":{}}],["systemsautomat",{"_index":54,"title":{},"content":{"15":{"position":[[242,16]]}},"keywords":{}}],["targetdir",{"_index":14,"title":{},"content":{"5":{"position":[[16,9]]},"8":{"position":[[16,9]]}},"keywords":{}}],["tidi",{"_index":119,"title":{},"content":{"17":{"position":[[352,4]]}},"keywords":{}}],["token",{"_index":146,"title":{"21":{"position":[[7,5]]}},"content":{"21":{"position":[[45,6],[108,6],[162,6]]}},"keywords":{}}],["type",{"_index":8,"title":{"17":{"position":[[18,6]]}},"content":{"2":{"position":[[11,4]]},"5":{"position":[[11,4]]},"8":{"position":[[11,4]]},"11":{"position":[[11,4]]},"17":{"position":[[62,6],[78,4]]},"20":{"position":[[59,4]]}},"keywords":{}}],["typeid",{"_index":134,"title":{},"content":{"20":{"position":[[133,7]]}},"keywords":{}}],["typessmart",{"_index":59,"title":{},"content":{"15":{"position":[[318,10]]}},"keywords":{}}],["up",{"_index":96,"title":{},"content":{"17":{"position":[[37,2],[217,2]]}},"keywords":{}}],["url",{"_index":42,"title":{},"content":{"15":{"position":[[98,4]]},"16":{"position":[[82,3]]}},"keywords":{}}],["us",{"_index":83,"title":{},"content":{"16":{"position":[[159,5],[208,3]]}},"keywords":{}}],["usag",{"_index":76,"title":{"16":{"position":[[3,6]]}},"content":{},"keywords":{}}],["virtual",{"_index":110,"title":{},"content":{"17":{"position":[[273,7]]}},"keywords":{}}],["void",{"_index":17,"title":{},"content":{"7":{"position":[[37,5]]},"9":{"position":[[1,4]]}},"keywords":{}}],["window",{"_index":69,"title":{},"content":{"15":{"position":[[434,8]]}},"keywords":{}}],["windsurf)v",{"_index":122,"title":{},"content":{"18":{"position":[[95,12]]}},"keywords":{}}],["without",{"_index":85,"title":{},"content":{"16":{"position":[[217,7]]},"21":{"position":[[98,7]]}},"keywords":{}}],["work",{"_index":68,"title":{},"content":{"15":{"position":[[425,5]]},"16":{"position":[[106,4]]}},"keywords":{}}],["you'r",{"_index":154,"title":{},"content":{"21":{"position":[[115,6]]}},"keywords":{}}],["zero",{"_index":28,"title":{"13":{"position":[[32,4]]}},"content":{},"keywords":{}}]],"pipeline":["stemmer"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"searchDocs":[{"title":"globals","type":0,"sectionRef":"#","url":"/functions/globals","content":"","keywords":"","version":"Next"},{"title":"downloadRepo()","type":1,"pageTitle":"globals","url":"/functions/globals#downloadrepo","content":" function downloadRepo(repo: any): Promise<void>; Defined in: git0.js:506 ","version":"Next","tagName":"h2"},{"title":"Parameters","type":1,"pageTitle":"globals","url":"/functions/globals#parameters","content":" Parameter\tType repo any ","version":"Next","tagName":"h3"},{"title":"Returns","type":1,"pageTitle":"globals","url":"/functions/globals#returns","content":" Promise<void> ","version":"Next","tagName":"h3"},{"title":"installDependencies()","type":1,"pageTitle":"globals","url":"/functions/globals#installdependencies","content":" function installDependencies(targetDir: any): Promise<void>; Defined in: git0.js:397 ","version":"Next","tagName":"h2"},{"title":"Parameters","type":1,"pageTitle":"globals","url":"/functions/globals#parameters-1","content":" Parameter\tType targetDir any ","version":"Next","tagName":"h3"},{"title":"Returns","type":1,"pageTitle":"globals","url":"/functions/globals#returns-1","content":" Promise<void> ","version":"Next","tagName":"h3"},{"title":"openInIDE()","type":1,"pageTitle":"globals","url":"/functions/globals#openinide","content":" function openInIDE(targetDir: any): void; Defined in: git0.js:354 ","version":"Next","tagName":"h2"},{"title":"Parameters","type":1,"pageTitle":"globals","url":"/functions/globals#parameters-2","content":" Parameter\tType targetDir any ","version":"Next","tagName":"h3"},{"title":"Returns","type":1,"pageTitle":"globals","url":"/functions/globals#returns-2","content":" void ","version":"Next","tagName":"h3"},{"title":"searchRepositories()","type":1,"pageTitle":"globals","url":"/functions/globals#searchrepositories","content":" function searchRepositories(query: any): Promise<any>; Defined in: git0.js:467 ","version":"Next","tagName":"h2"},{"title":"Parameters","type":1,"pageTitle":"globals","url":"/functions/globals#parameters-3","content":" Parameter\tType query any ","version":"Next","tagName":"h3"},{"title":"Returns","type":1,"pageTitle":"globals","url":"/functions/globals#returns-3","content":" Promise<any> ","version":"Next","tagName":"h3"},{"title":"Git0: Download Git Repo on Step Zero","type":0,"sectionRef":"#","url":"/functions/","content":"","keywords":"","version":"Next"},{"title":"🚀 Installation","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#-installation","content":" npm install -g git0 bun install -g git0 ","version":"Next","tagName":"h2"},{"title":"✨ Features","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#-features","content":" Search GitHub repositories by name with fuzzy matchingDownload repositories directly from GitHub URLs or owner/repo shortcuts. Skip the manual git clone, cd, install danceGet Releases instantly download latest release for your system or all systemsAutomatic dependency detection and installation for multiple project typesSmart IDE integration - automatically opens projects in your preferred editorCross-platform support - works on Windows, macOS, and LinuxConflict resolution - handles directory naming conflicts automatically ","version":"Next","tagName":"h2"},{"title":"🎯 Usage","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#-usage","content":" # Search for repositories by name gg react starter # Direct download from GitHub URL ## gg and git0 both work gg https://github.com/facebook/react # Download using owner/repo shorthand git0 react starter ## Use git0 without installing, (only node needed) # (copy into your project's readme for quick setup) npx git0 facebook/react ","version":"Next","tagName":"h2"},{"title":"Supported Project Types","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#supported-project-types","content":" git0 automatically detects and sets up the following project types: Project Type\tDetection\tInstallationNode.js\tpackage.json\tbun install (fallback to npm install) Docker\tDockerfile, docker-compose.yml\tdocker-compose up -d or docker build Python\trequirements.txt, setup.py\tVirtual environment + pip install Rust\tCargo.toml\tcargo build Go\tgo.mod\tgo mod tidy ","version":"Next","tagName":"h3"},{"title":"Supported IDEs","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#supported-ides","content":" git0 automatically detects and opens projects in your preferred IDE: Cursor (cursor)Windsurf (windsurf)VS Code (code)Code Server (code-server)Neovim (nvim) ","version":"Next","tagName":"h3"},{"title":"🔧 Configuration","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#-configuration","content":" ","version":"Next","tagName":"h2"},{"title":"What Happens After Download","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#what-happens-after-download","content":" Repository is downloaded to your current directoryProject type is detected automaticallyDependencies are installed based on project typeIDE is launched automatically (if available)Development server starts (for Node.js projects) If a directory with the same name exists, git0 automatically appends a number (e.g., react-2, react-3). ","version":"Next","tagName":"h3"},{"title":"GitHub Token (Optional)","type":1,"pageTitle":"Git0: Download Git Repo on Step Zero","url":"/functions/#github-token-optional","content":" For higher API rate limits, set your GitHub token: export GITHUB_TOKEN=your_github_token_here Without a token, you're limited to 60 requests per hour. With a token, you get 5,000 requests per hour. ","version":"Next","tagName":"h3"}],"options":{"id":"default"}}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
content: [
|
|
4
|
-
"./src/**/*.{js,jsx,ts,tsx,md,mdx}",
|
|
5
|
-
"./docs/**/*.{md,mdx}"
|
|
6
|
-
],
|
|
7
|
-
theme: { extend: {} },
|
|
8
|
-
plugins: [],
|
|
9
|
-
darkMode: ["class", '[data-theme="dark"]'],
|
|
10
|
-
corePlugins: { preflight: false }, // Prevents Tailwind from overriding Docusaurus defaults
|
|
11
|
-
blocklist: ["container"], // Optional: disables Tailwind's container class
|
|
12
|
-
};
|
|
13
|
-
|