@a5gard/asgard 0.0.1

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.
Files changed (207) hide show
  1. package/.env +2 -0
  2. package/.gitignore copy +6 -0
  3. package/.vscode/ntrsync/.vscode/ocrmnavigator/id.txt +1 -0
  4. package/.vscode/ntrsync/.vscode/ocrmnavigator.code-snippets +3664 -0
  5. package/.vscode/ntrsync/00002_CRM URGENT_todo.md +79 -0
  6. package/.vscode/ntrsync/10005_notes repo url.md +3 -0
  7. package/.vscode/ntrsync/10012_vscode_color_settings.md +133 -0
  8. package/.vscode/ntrsync/10013_Googles Snapchat Upload Hack note.md +11 -0
  9. package/.vscode/ntrsync/10014_APP IDEA - Lawyer CRM.md +229 -0
  10. package/.vscode/ntrsync/10015_APP IDEA - Onlyfans.md +293 -0
  11. package/.vscode/ntrsync/10016_notes repo url.md +3 -0
  12. package/.vscode/ntrsync/10504_adhd symptom.md +3 -0
  13. package/.vscode/ntrsync/10505_APP IDEA - GMAIL.md +39 -0
  14. package/.vscode/ntrsync/10506_container home - build mats.md +18 -0
  15. package/.vscode/ntrsync/10507_cleint facing site meta and loader function.md +25 -0
  16. package/.vscode/ntrsync/10508_Sabaak VSCode 1-8 players - private teams, solo q, duos q.md +11 -0
  17. package/.vscode/ntrsync/10509_schema dump.md +80 -0
  18. package/.vscode/ntrsync/10510_APPT BEACONHILL_reminder.md +7 -0
  19. package/.vscode/ntrsync/10512_clipboard very usefull should use asap within all apps.md +101 -0
  20. package/.vscode/ntrsync/10516_DevStack_todo.md +130 -0
  21. package/.vscode/ntrsync/10517_CRM_todo.md +95 -0
  22. package/.vscode/ntrsync/10518_Catalyst POS_todo.md +73 -0
  23. package/.vscode/ntrsync/10519_Catalyst Software_todo.md +497 -0
  24. package/.vscode/ntrsync/10523_new note.md +6 -0
  25. package/.vscode/ntrsync/10524_New Reminder_reminder.md +5 -0
  26. package/.vscode/ntrsync/10525_Mobile - Notes, To-Dos And Things_todo.md +4 -0
  27. package/.vscode/ntrsync/90002_COMPLETED_todo.md +97 -0
  28. package/.vscode/ntrsync/README.md +1 -0
  29. package/.vscode/ocrmnavigator/id.txt +1 -0
  30. package/.vscode/ocrmnavigator.code-snippets +349 -0
  31. package/.vscode/settings.json +1 -0
  32. package/CHANGELOG.md +6 -0
  33. package/LICENSE.md +21 -0
  34. package/README.md +1612 -0
  35. package/bin/dev.cmd +3 -0
  36. package/bin/dev.js +17 -0
  37. package/bin/run.cmd +3 -0
  38. package/bin/run.js +5 -0
  39. package/config.asgard +8 -0
  40. package/dist/commands/add-source.d.ts +9 -0
  41. package/dist/commands/add-source.d.ts.map +1 -0
  42. package/dist/commands/add-source.js +68 -0
  43. package/dist/commands/add-source.js.map +1 -0
  44. package/dist/commands/baldr.d.ts +5 -0
  45. package/dist/commands/baldr.d.ts.map +1 -0
  46. package/dist/commands/baldr.js +35 -0
  47. package/dist/commands/baldr.js.map +1 -0
  48. package/dist/commands/combine-timelines.d.ts +5 -0
  49. package/dist/commands/combine-timelines.d.ts.map +1 -0
  50. package/dist/commands/combine-timelines.js +53 -0
  51. package/dist/commands/combine-timelines.js.map +1 -0
  52. package/dist/commands/create-project.d.ts +10 -0
  53. package/dist/commands/create-project.d.ts.map +1 -0
  54. package/dist/commands/create-project.js +195 -0
  55. package/dist/commands/create-project.js.map +1 -0
  56. package/dist/commands/create-timeline.d.ts +8 -0
  57. package/dist/commands/create-timeline.d.ts.map +1 -0
  58. package/dist/commands/create-timeline.js +54 -0
  59. package/dist/commands/create-timeline.js.map +1 -0
  60. package/dist/commands/delete-project.d.ts +5 -0
  61. package/dist/commands/delete-project.d.ts.map +1 -0
  62. package/dist/commands/delete-project.js +47 -0
  63. package/dist/commands/delete-project.js.map +1 -0
  64. package/dist/commands/delete-source.d.ts +8 -0
  65. package/dist/commands/delete-source.d.ts.map +1 -0
  66. package/dist/commands/delete-source.js +57 -0
  67. package/dist/commands/delete-source.js.map +1 -0
  68. package/dist/commands/delete-timeline.d.ts +8 -0
  69. package/dist/commands/delete-timeline.d.ts.map +1 -0
  70. package/dist/commands/delete-timeline.js +54 -0
  71. package/dist/commands/delete-timeline.js.map +1 -0
  72. package/dist/commands/delete-version.d.ts +8 -0
  73. package/dist/commands/delete-version.d.ts.map +1 -0
  74. package/dist/commands/delete-version.js +65 -0
  75. package/dist/commands/delete-version.js.map +1 -0
  76. package/dist/commands/download-file.d.ts +17 -0
  77. package/dist/commands/download-file.d.ts.map +1 -0
  78. package/dist/commands/download-file.js +87 -0
  79. package/dist/commands/download-file.js.map +1 -0
  80. package/dist/commands/download-folder.d.ts +18 -0
  81. package/dist/commands/download-folder.d.ts.map +1 -0
  82. package/dist/commands/download-folder.js +111 -0
  83. package/dist/commands/download-folder.js.map +1 -0
  84. package/dist/commands/download-source.d.ts +12 -0
  85. package/dist/commands/download-source.d.ts.map +1 -0
  86. package/dist/commands/download-source.js +46 -0
  87. package/dist/commands/download-source.js.map +1 -0
  88. package/dist/commands/gh-setup.d.ts +7 -0
  89. package/dist/commands/gh-setup.d.ts.map +1 -0
  90. package/dist/commands/gh-setup.js +106 -0
  91. package/dist/commands/gh-setup.js.map +1 -0
  92. package/dist/commands/load-project.d.ts +5 -0
  93. package/dist/commands/load-project.d.ts.map +1 -0
  94. package/dist/commands/load-project.js +56 -0
  95. package/dist/commands/load-project.js.map +1 -0
  96. package/dist/commands/menu.d.ts +5 -0
  97. package/dist/commands/menu.d.ts.map +1 -0
  98. package/dist/commands/menu.js +41 -0
  99. package/dist/commands/menu.js.map +1 -0
  100. package/dist/commands/midgardr.d.ts +5 -0
  101. package/dist/commands/midgardr.d.ts.map +1 -0
  102. package/dist/commands/midgardr.js +24 -0
  103. package/dist/commands/midgardr.js.map +1 -0
  104. package/dist/commands/publish-project.d.ts +5 -0
  105. package/dist/commands/publish-project.d.ts.map +1 -0
  106. package/dist/commands/publish-project.js +102 -0
  107. package/dist/commands/publish-project.js.map +1 -0
  108. package/dist/commands/replace-timeline.d.ts +8 -0
  109. package/dist/commands/replace-timeline.d.ts.map +1 -0
  110. package/dist/commands/replace-timeline.js +63 -0
  111. package/dist/commands/replace-timeline.js.map +1 -0
  112. package/dist/commands/restore-version.d.ts +8 -0
  113. package/dist/commands/restore-version.d.ts.map +1 -0
  114. package/dist/commands/restore-version.js +67 -0
  115. package/dist/commands/restore-version.js.map +1 -0
  116. package/dist/commands/save-project.d.ts +8 -0
  117. package/dist/commands/save-project.d.ts.map +1 -0
  118. package/dist/commands/save-project.js +43 -0
  119. package/dist/commands/save-project.js.map +1 -0
  120. package/dist/commands/set-source.d.ts +9 -0
  121. package/dist/commands/set-source.d.ts.map +1 -0
  122. package/dist/commands/set-source.js +59 -0
  123. package/dist/commands/set-source.js.map +1 -0
  124. package/dist/commands/switch-timeline.d.ts +8 -0
  125. package/dist/commands/switch-timeline.d.ts.map +1 -0
  126. package/dist/commands/switch-timeline.js +61 -0
  127. package/dist/commands/switch-timeline.js.map +1 -0
  128. package/dist/commands/sync-source.d.ts +5 -0
  129. package/dist/commands/sync-source.d.ts.map +1 -0
  130. package/dist/commands/sync-source.js +29 -0
  131. package/dist/commands/sync-source.js.map +1 -0
  132. package/dist/commands/upload-project+++.d.ts +5 -0
  133. package/dist/commands/upload-project+++.d.ts.map +1 -0
  134. package/dist/commands/upload-project+++.js +32 -0
  135. package/dist/commands/upload-project+++.js.map +1 -0
  136. package/dist/commands/upload-project++.d.ts +5 -0
  137. package/dist/commands/upload-project++.d.ts.map +1 -0
  138. package/dist/commands/upload-project++.js +33 -0
  139. package/dist/commands/upload-project++.js.map +1 -0
  140. package/dist/commands/upload-project+.d.ts +5 -0
  141. package/dist/commands/upload-project+.d.ts.map +1 -0
  142. package/dist/commands/upload-project+.js +40 -0
  143. package/dist/commands/upload-project+.js.map +1 -0
  144. package/dist/commands/upload-project.d.ts +5 -0
  145. package/dist/commands/upload-project.d.ts.map +1 -0
  146. package/dist/commands/upload-project.js +29 -0
  147. package/dist/commands/upload-project.js.map +1 -0
  148. package/dist/commands/view-timeline.d.ts +5 -0
  149. package/dist/commands/view-timeline.d.ts.map +1 -0
  150. package/dist/commands/view-timeline.js +39 -0
  151. package/dist/commands/view-timeline.js.map +1 -0
  152. package/dist/commands/view-versions.d.ts +5 -0
  153. package/dist/commands/view-versions.d.ts.map +1 -0
  154. package/dist/commands/view-versions.js +45 -0
  155. package/dist/commands/view-versions.js.map +1 -0
  156. package/dist/git/helpers.d.ts +10 -0
  157. package/dist/git/helpers.d.ts.map +1 -0
  158. package/dist/git/helpers.js +300 -0
  159. package/dist/git/helpers.js.map +1 -0
  160. package/dist/git/sync-repo.d.ts +2 -0
  161. package/dist/git/sync-repo.d.ts.map +1 -0
  162. package/dist/git/sync-repo.js +17 -0
  163. package/dist/git/sync-repo.js.map +1 -0
  164. package/dist/index.d.ts +2 -0
  165. package/dist/index.d.ts.map +1 -0
  166. package/dist/index.js +3 -0
  167. package/dist/index.js.map +1 -0
  168. package/dist/utils/box.d.ts +11 -0
  169. package/dist/utils/box.d.ts.map +1 -0
  170. package/dist/utils/box.js +158 -0
  171. package/dist/utils/box.js.map +1 -0
  172. package/ideas.md +46 -0
  173. package/package.json +53 -0
  174. package/src/commands/add-source.js +72 -0
  175. package/src/commands/baldr.js +38 -0
  176. package/src/commands/combine-timelines.js +65 -0
  177. package/src/commands/create-project.js +216 -0
  178. package/src/commands/create-timeline.js +60 -0
  179. package/src/commands/delete-project.js +54 -0
  180. package/src/commands/delete-source.js +63 -0
  181. package/src/commands/delete-timeline.js +63 -0
  182. package/src/commands/delete-version.js +74 -0
  183. package/src/commands/download-file.js +101 -0
  184. package/src/commands/download-folder.js +123 -0
  185. package/src/commands/download-source.js +51 -0
  186. package/src/commands/gh-setup.js +77 -0
  187. package/src/commands/load-project.js +63 -0
  188. package/src/commands/menu.js +46 -0
  189. package/src/commands/midgardr.js +25 -0
  190. package/src/commands/publish-project.js +167 -0
  191. package/src/commands/replace-timeline.js +76 -0
  192. package/src/commands/restore-version.js +80 -0
  193. package/src/commands/save-project.js +48 -0
  194. package/src/commands/set-source.js +65 -0
  195. package/src/commands/switch-timeline.js +69 -0
  196. package/src/commands/sync-source.js +32 -0
  197. package/src/commands/upload-project+++.js +34 -0
  198. package/src/commands/upload-project++.js +35 -0
  199. package/src/commands/upload-project+.js +47 -0
  200. package/src/commands/upload-project.js +31 -0
  201. package/src/commands/view-timeline.js +43 -0
  202. package/src/commands/view-versions.js +50 -0
  203. package/src/git/helpers.js +333 -0
  204. package/src/git/sync-repo.js +16 -0
  205. package/src/index.js +2 -0
  206. package/src/utils/box.js +282 -0
  207. package/tsconfig.json +23 -0
@@ -0,0 +1,300 @@
1
+ import simpleGit from 'simple-git';
2
+ import ora from 'ora';
3
+ import { success, error } from '../utils/box.js';
4
+ import inquirer from 'inquirer';
5
+ import fs from 'fs-extra';
6
+ import path from 'path';
7
+ import os from 'os';
8
+ import { execSync } from 'child_process';
9
+ import chalk from 'chalk';
10
+ export async function bumpVersion(releaseType = 'patch') {
11
+ const packagePath = path.resolve(process.cwd(), 'package.json');
12
+ const cwd = process.cwd();
13
+ const configPath = path.join(cwd, 'config.asgard');
14
+ let packageManager = 'pnpm';
15
+ if (fs.existsSync(configPath)) {
16
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
17
+ packageManager = config.packageManager || 'pnpm';
18
+ }
19
+ execSync(`${packageManager} version ${releaseType}`, { cwd, stdio: 'inherit' });
20
+ execSync(`git push`, { cwd, stdio: 'inherit' });
21
+ execSync(`git push --tags`, { cwd, stdio: 'inherit' });
22
+ }
23
+ export async function addCommitPush(message) {
24
+ const spinner = ora('Saving changes...').start();
25
+ const cwd = process.cwd();
26
+ try {
27
+ spinner.text = 'Staging changes...';
28
+ execSync('git add .', { cwd });
29
+ spinner.text = 'Committing...';
30
+ // We use a check to see if there are actually changes to avoid "nothing to commit" errors
31
+ execSync(`git commit -m "${message}"`, { cwd, stdio: 'pipe' });
32
+ spinner.text = 'Pushing to remote...';
33
+ execSync('git push', { cwd, stdio: 'pipe' });
34
+ spinner.stop();
35
+ return true;
36
+ }
37
+ catch (err) {
38
+ spinner.stop();
39
+ // If the error is just "nothing to commit", we can handle it gracefully
40
+ if (err.stdout && err.stdout.toString().includes('nothing to commit')) {
41
+ return true;
42
+ }
43
+ throw new Error(err.stderr ? err.stderr.toString() : err.message);
44
+ }
45
+ }
46
+ export async function downloadFolder(repoUrl, folder, branch = 'main') {
47
+ const spinner = ora('Downloading folder').start();
48
+ const git = simpleGit();
49
+ const tempDir = `.temp-${Date.now()}`;
50
+ try {
51
+ await git.init(tempDir);
52
+ await git.cwd(tempDir);
53
+ await git.addRemote('origin', repoUrl);
54
+ await git.addConfig('core.sparseCheckout', 'true');
55
+ const sparseCheckoutPath = `${tempDir}/.git/info/sparse-checkout`;
56
+ await Bun.write(sparseCheckoutPath, folder);
57
+ spinner.text = 'Pulling folder';
58
+ await git.pull('origin', branch);
59
+ spinner.stop();
60
+ success(`Folder downloaded to: ${tempDir}`);
61
+ return tempDir;
62
+ }
63
+ catch (err) {
64
+ spinner.stop();
65
+ error(`Failed to download folder: ${err.message}`);
66
+ return null;
67
+ }
68
+ }
69
+ export async function downloadFolderRaw(owner, repo, folder, branch = 'main') {
70
+ const spinner = ora('Downloading folder (raw)').start();
71
+ try {
72
+ const apiUrl = `https://api.github.com/repos/${owner}/${repo}/contents/${folder}?ref=${branch}`;
73
+ const response = await fetch(apiUrl);
74
+ const files = await response.json();
75
+ if (!Array.isArray(files)) {
76
+ throw new Error('Not a folder');
77
+ }
78
+ const targetDir = `./${folder.split('/').pop()}`;
79
+ await Bun.write(`${targetDir}/.gitkeep`, '');
80
+ for (const file of files) {
81
+ if (file.type === 'file') {
82
+ const fileResponse = await fetch(file.download_url);
83
+ const content = await fileResponse.text();
84
+ await Bun.write(`${targetDir}/${file.name}`, content);
85
+ }
86
+ }
87
+ spinner.stop();
88
+ success(`Folder downloaded to: ${targetDir}`);
89
+ return targetDir;
90
+ }
91
+ catch (err) {
92
+ spinner.stop();
93
+ error(`Failed to download folder: ${err.message}`);
94
+ return null;
95
+ }
96
+ }
97
+ export async function downloadFile(owner, repo, filePath, branch = 'main') {
98
+ const spinner = ora('Downloading file').start();
99
+ try {
100
+ const url = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}`;
101
+ const response = await fetch(url);
102
+ if (!response.ok) {
103
+ throw new Error('File not found');
104
+ }
105
+ const content = await response.text();
106
+ const fileName = filePath.split('/').pop();
107
+ await Bun.write(`./${fileName}`, content);
108
+ spinner.stop();
109
+ success(`File downloaded: ${fileName}`);
110
+ return fileName;
111
+ }
112
+ catch (err) {
113
+ spinner.stop();
114
+ error(`Failed to download file: ${err.message}`);
115
+ return null;
116
+ }
117
+ }
118
+ export async function cloneRepo(repoUrl, targetDir = '') {
119
+ const spinner = ora(`Cloning ${repoUrl}...`).start();
120
+ try {
121
+ // Git handles the URL parsing and directory creation itself
122
+ execSync(`git clone ${repoUrl} ${targetDir}`, { stdio: 'pipe' });
123
+ spinner.stop();
124
+ return true;
125
+ }
126
+ catch (err) {
127
+ spinner.stop();
128
+ throw new Error(err.stderr ? err.stderr.toString() : err.message);
129
+ }
130
+ }
131
+ export async function ensureGitConfig() {
132
+ const cwd = process.cwd();
133
+ try {
134
+ execSync('git config user.name', { stdio: 'ignore' });
135
+ execSync('git config user.email', { stdio: 'ignore' });
136
+ }
137
+ catch (e) {
138
+ const gitAnswers = await inquirer.prompt([
139
+ { type: 'input', name: 'name', message: 'Git username:', validate: i => i.length > 0 },
140
+ { type: 'input', name: 'email', message: 'Git email:', validate: i => i.includes('@') }
141
+ ]);
142
+ execSync(`git config --global user.name "${gitAnswers.name}"`, { cwd });
143
+ execSync(`git config --global user.email "${gitAnswers.email}"`, { cwd });
144
+ }
145
+ }
146
+ export function getGitHubToken() {
147
+ try {
148
+ return execSync('gh auth token', { encoding: 'utf-8', stdio: ['pipe', 'pipe', 'ignore'] }).trim();
149
+ }
150
+ catch {
151
+ const envToken = process.env.GITHUB_TOKEN;
152
+ if (!envToken) {
153
+ console.error(chalk.red('GitHub token not found. Run: gh auth login'));
154
+ process.exit(1);
155
+ }
156
+ return envToken;
157
+ }
158
+ }
159
+ export function getLicenseContent(type, owner) {
160
+ const year = new Date().getFullYear();
161
+ const licenses = {
162
+ 'MIT': `MIT License
163
+
164
+ Copyright (c) ${year} ${owner}
165
+
166
+ Permission is hereby granted, free of charge, to any person obtaining a copy
167
+ of this software and associated documentation files (the "Software"), to deal
168
+ in the Software without restriction, including without limitation the rights
169
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
170
+ copies of the Software, and to permit persons to whom the Software is
171
+ furnished to do so, subject to the following conditions:
172
+
173
+ The above copyright notice and this permission notice shall be included in all
174
+ copies or substantial portions of the Software.
175
+
176
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
177
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
178
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
179
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
180
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
181
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
182
+ SOFTWARE.`,
183
+ 'Apache-2.0': `Apache License
184
+ Version 2.0, January 2004
185
+ http://www.apache.org/licenses/
186
+
187
+ Copyright ${year} ${owner}
188
+
189
+ Licensed under the Apache License, Version 2.0 (the "License");
190
+ you may not use this file except in compliance with the License.
191
+ You may obtain a copy of the License at
192
+
193
+ http://www.apache.org/licenses/LICENSE-2.0
194
+
195
+ Unless required by applicable law or agreed to in writing, software
196
+ distributed under the License is distributed on an "AS IS" BASIS,
197
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
198
+ See the License for the specific language governing permissions and
199
+ limitations under the License.`,
200
+ 'GPL-3.0': `GNU GENERAL PUBLIC LICENSE
201
+ Version 3, 29 June 2007
202
+
203
+ Copyright (C) ${year} ${owner}
204
+
205
+ This program is free software: you can redistribute it and/or modify
206
+ it under the terms of the GNU General Public License as published by
207
+ the Free Software Foundation, either version 3 of the License, or
208
+ (at your option) any later version.
209
+
210
+ This program is distributed in the hope that it will be useful,
211
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
212
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
213
+ GNU General Public License for more details.
214
+
215
+ You should have received a copy of the GNU General Public License
216
+ along with this program. If not, see <https://www.gnu.org/licenses/>.`,
217
+ 'BSD-3-Clause': `BSD 3-Clause License
218
+
219
+ Copyright (c) ${year}, ${owner}
220
+
221
+ Redistribution and use in source and binary forms, with or without
222
+ modification, are permitted provided that the following conditions are met:
223
+
224
+ 1. Redistributions of source code must retain the above copyright notice, this
225
+ list of conditions and the following disclaimer.
226
+
227
+ 2. Redistributions in binary form must reproduce the above copyright notice,
228
+ this list of conditions and the following disclaimer in the documentation
229
+ and/or other materials provided with the distribution.
230
+
231
+ 3. Neither the name of the copyright holder nor the names of its
232
+ contributors may be used to endorse or promote products derived from
233
+ this software without specific prior written permission.
234
+
235
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
236
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
237
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
238
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
239
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
240
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
241
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
242
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
243
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
244
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.`,
245
+ 'ISC': `ISC License
246
+
247
+ Copyright (c) ${year}, ${owner}
248
+
249
+ Permission to use, copy, modify, and/or distribute this software for any
250
+ purpose with or without fee is hereby granted, provided that the above
251
+ copyright notice and this permission notice appear in all copies.
252
+
253
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
254
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
255
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
256
+ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
257
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
258
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
259
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.`
260
+ };
261
+ return licenses[type] || licenses['MIT'];
262
+ }
263
+ /**The short answer is: **Not with a standard `git clone`.** When you clone, Git is designed to grab the entire history of the repository. However, if you are looking to save space or time, there is a modern workflow called **Sparse Checkout** that allows you to tell Git, "I only want to see these specific folders."
264
+
265
+ Here is how you can achieve this without downloading the entire project’s history and files.
266
+
267
+ ---
268
+
269
+ ## The "Sparse Checkout" Method
270
+
271
+ This is the most efficient way to handle this in modern Git (version 2.25 or later). It downloads the repository data but only "checks out" (shows) the folders you care about.
272
+
273
+ 1. **Initialize the repo locally:**
274
+ `git clone --filter=blob:none --sparse <url>`
275
+ *The `--filter=blob:none` flag tells Git not to download the actual file contents until you ask for them.*
276
+ 2. **Navigate into the folder:**
277
+ `cd <repo-name>`
278
+ 3. **Set the specific folder you want:**
279
+ `git sparse-checkout set <path/to/folder>`
280
+
281
+ ---
282
+
283
+ ## Comparison of Approaches
284
+
285
+ | Method | Best For... | Pros | Cons |
286
+ | --- | --- | --- | --- |
287
+ | **Standard Clone** | Small projects | Simple, one command | Downloads everything |
288
+ | **Sparse Checkout** | Monorepos | Saves disk space, very fast | Requires a few extra commands |
289
+ | **Shallow Clone** | Quick CI/CD builds | Fastest download | No commit history (`--depth 1`) |
290
+
291
+ ---
292
+
293
+ ## A Simpler Alternative: GitHub Web
294
+
295
+ If you don't actually need to *code* and just need the files once, tools like **DownGit** or simply using the **GitHub CLI** can sometimes be faster than messing with Git commands.
296
+
297
+ > **Tip:** If you're on GitHub, you can also press the `.` key while viewing the repo in your browser to open the web editor. From there, you can right-click and download specific files without cloning anything.
298
+
299
+ Would you like me to walk you through the exact commands for a specific folder path you have in mind? */
300
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/git/helpers.js"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,WAAW,GAAG,OAAO;IACrD,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAA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;;;;;;;;;;;UAkBnB;QAEN,YAAY,EAAE;;;;YAIN,IAAI,IAAI,KAAK;;;;;;;;;;;;+BAYM;QAE3B,SAAS,EAAE;;;gBAGC,IAAI,IAAI,KAAK;;;;;;;;;;;;;uEAa0C;QAEnE,cAAc,EAAE;;gBAEJ,IAAI,KAAK,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;qEAyBuC;QAEjE,KAAK,EAAE;;gBAEK,IAAI,KAAK,KAAK;;;;;;;;;;;;+DAYiC;KAC5D,CAAC;IAEF,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wGAoCwG"}
@@ -0,0 +1,2 @@
1
+ export function syncRepo(): Promise<void>;
2
+ //# sourceMappingURL=sync-repo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-repo.d.ts","sourceRoot":"","sources":["../../src/git/sync-repo.js"],"names":[],"mappings":"AAKA,0CAUC"}
@@ -0,0 +1,17 @@
1
+ import fs from 'fs-extra';
2
+ import path from 'path';
3
+ import simpleGit from 'simple-git';
4
+ import { execSync } from 'child_process';
5
+ export async function syncRepo() {
6
+ try {
7
+ const cwd = process.cwd();
8
+ execSync('git add .', { cwd, stdio: 'inherit' });
9
+ execSync('git commit -m "Syncing local repo with remote" || true', { cwd, stdio: 'inherit' });
10
+ execSync('git pull --rebase', { cwd, stdio: 'inherit' });
11
+ execSync('git push', { cwd, stdio: 'inherit' });
12
+ }
13
+ catch (error) {
14
+ throw new Error(`Sync failed on branch detection/sync: ${error.message}`);
15
+ }
16
+ }
17
+ //# sourceMappingURL=sync-repo.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sync-repo.js","sourceRoot":"","sources":["../../src/git/sync-repo.js"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,UAAU,CAAC;AAC1B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,CAAC,KAAK,UAAU,QAAQ;IAC5B,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,QAAQ,CAAC,WAAW,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACjD,QAAQ,CAAC,wDAAwD,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QAC9F,QAAQ,CAAC,mBAAmB,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;QACzD,QAAQ,CAAC,UAAU,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAClD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,yCAAyC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;AACH,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { default as run } from "@oclif/core";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ // src/index.js
2
+ export { default as run } from '@oclif/core';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":"AAAA,eAAe;AACf,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,11 @@
1
+ export function boxStart(boxTitle: any): void;
2
+ export function boxLine(message: any, type?: string): void;
3
+ export function boxDivider(): void;
4
+ export function boxEnd(success?: boolean, message?: string): void;
5
+ export function boxList(message: any, choices: any): Promise<any>;
6
+ export function boxPrompt(message: any): Promise<any>;
7
+ export function error(message: any): void;
8
+ export function success(message: any): void;
9
+ export function info(message: any): void;
10
+ export function warning(message: any): void;
11
+ //# sourceMappingURL=box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/utils/box.js"],"names":[],"mappings":"AAkCA,8CAIC;AAED,2DAwBC;AAED,mCAGC;AAED,kEAQC;AAED,kEAgEC;AAED,sDA+BC;AAED,0CAEC;AAED,4CAEC;AAED,yCAEC;AAED,4CAEC"}
@@ -0,0 +1,158 @@
1
+ import readline from 'readline';
2
+ import chalk from 'chalk';
3
+ let lines = [];
4
+ let width = 120;
5
+ let title = '';
6
+ const BORDERS = {
7
+ topLeft: '╭',
8
+ topRight: '╮',
9
+ bottomLeft: '╰',
10
+ bottomRight: '╯',
11
+ horizontal: '─',
12
+ vertical: '│',
13
+ leftT: '├',
14
+ rightT: '┤'
15
+ };
16
+ function render() {
17
+ console.clear();
18
+ const titlePadding = Math.floor((width - title.length - 2) / 2);
19
+ const titleLine = ' '.repeat(titlePadding) + title + ' '.repeat(width - title.length - titlePadding - 2);
20
+ console.log(chalk.cyan(BORDERS.topLeft + BORDERS.horizontal.repeat(width - 2) + BORDERS.topRight));
21
+ console.log(chalk.cyan(BORDERS.vertical) + chalk.bold.white(titleLine) + chalk.cyan(BORDERS.vertical));
22
+ lines.forEach(line => {
23
+ console.log(line);
24
+ });
25
+ console.log(chalk.cyan(BORDERS.bottomLeft + BORDERS.horizontal.repeat(width - 2) + BORDERS.bottomRight));
26
+ }
27
+ export function boxStart(boxTitle) {
28
+ title = boxTitle;
29
+ lines = [];
30
+ render();
31
+ }
32
+ export function boxLine(message, type = 'info') {
33
+ let coloredMessage = message;
34
+ switch (type) {
35
+ case 'success':
36
+ coloredMessage = chalk.green(message);
37
+ break;
38
+ case 'error':
39
+ coloredMessage = chalk.red(message);
40
+ break;
41
+ case 'warning':
42
+ coloredMessage = chalk.yellow(message);
43
+ break;
44
+ case 'info':
45
+ coloredMessage = chalk.blue(message);
46
+ break;
47
+ default:
48
+ coloredMessage = message;
49
+ }
50
+ const padding = width - message.length - 2;
51
+ lines.push(chalk.cyan(BORDERS.vertical) + ' ' + coloredMessage + ' '.repeat(padding - 1) + chalk.cyan(BORDERS.vertical));
52
+ render();
53
+ }
54
+ export function boxDivider() {
55
+ lines.push(chalk.cyan(BORDERS.leftT + BORDERS.horizontal.repeat(width - 2) + BORDERS.rightT));
56
+ render();
57
+ }
58
+ export function boxEnd(success = true, message = '') {
59
+ if (message) {
60
+ const text = message;
61
+ const coloredText = success ? chalk.green(message) : chalk.red(message);
62
+ const padding = width - text.length - 2;
63
+ lines.push(chalk.cyan(BORDERS.vertical) + ' ' + coloredText + ' '.repeat(padding - 1) + chalk.cyan(BORDERS.vertical));
64
+ }
65
+ render();
66
+ }
67
+ export async function boxList(message, choices) {
68
+ let selected = 0;
69
+ const renderList = () => {
70
+ const tempLines = [...lines];
71
+ choices.forEach((choice, i) => {
72
+ const prefix = i === selected ? '▶ ' : ' ';
73
+ const text = i === selected ? chalk.bold.white(prefix + choice) : chalk.gray(prefix + choice);
74
+ const plainText = prefix + choice;
75
+ const padding = width - plainText.length - 2;
76
+ tempLines.push(chalk.cyan(BORDERS.vertical) + ' ' + text + ' '.repeat(padding - 1) + chalk.cyan(BORDERS.vertical));
77
+ });
78
+ console.clear();
79
+ const titlePadding = Math.floor((width - title.length - 2) / 2);
80
+ const titleLine = ' '.repeat(titlePadding) + title + ' '.repeat(width - title.length - titlePadding - 2);
81
+ console.log(chalk.cyan(BORDERS.topLeft + BORDERS.horizontal.repeat(width - 2) + BORDERS.topRight));
82
+ console.log(chalk.cyan(BORDERS.vertical) + chalk.bold.white(titleLine) + chalk.cyan(BORDERS.vertical));
83
+ tempLines.forEach(line => console.log(line));
84
+ console.log(chalk.cyan(BORDERS.bottomLeft + BORDERS.horizontal.repeat(width - 2) + BORDERS.bottomRight));
85
+ };
86
+ return new Promise((resolve) => {
87
+ readline.emitKeypressEvents(process.stdin);
88
+ if (process.stdin.isTTY) {
89
+ process.stdin.setRawMode(true);
90
+ }
91
+ renderList();
92
+ const onKeypress = (str, key) => {
93
+ if (key.name === 'up' && selected > 0) {
94
+ selected--;
95
+ renderList();
96
+ }
97
+ else if (key.name === 'down' && selected < choices.length - 1) {
98
+ selected++;
99
+ renderList();
100
+ }
101
+ else if (key.name === 'return') {
102
+ process.stdin.setRawMode(false);
103
+ process.stdin.removeListener('keypress', onKeypress);
104
+ process.stdin.pause();
105
+ const prefix = '▶ ';
106
+ const text = chalk.bold.white(prefix + choices[selected]);
107
+ const plainText = prefix + choices[selected];
108
+ const padding = width - plainText.length - 2;
109
+ lines.push(chalk.cyan(BORDERS.vertical) + ' ' + text + ' '.repeat(padding - 1) + chalk.cyan(BORDERS.vertical));
110
+ render();
111
+ resolve({ value: selected, label: choices[selected] });
112
+ }
113
+ else if (key.ctrl && key.name === 'c') {
114
+ process.stdin.setRawMode(false);
115
+ render();
116
+ process.exit(0);
117
+ }
118
+ };
119
+ process.stdin.on('keypress', onKeypress);
120
+ });
121
+ }
122
+ export async function boxPrompt(message) {
123
+ const rl = readline.createInterface({
124
+ input: process.stdin,
125
+ output: process.stdout
126
+ });
127
+ return new Promise((resolve) => {
128
+ console.clear();
129
+ const titlePadding = Math.floor((width - title.length - 2) / 2);
130
+ const titleLine = ' '.repeat(titlePadding) + title + ' '.repeat(width - title.length - titlePadding - 2);
131
+ console.log(chalk.cyan(BORDERS.topLeft + BORDERS.horizontal.repeat(width - 2) + BORDERS.topRight));
132
+ console.log(chalk.cyan(BORDERS.vertical) + chalk.bold.white(titleLine) + chalk.cyan(BORDERS.vertical));
133
+ lines.forEach(line => console.log(line));
134
+ const promptText = chalk.yellow(message + ' › ');
135
+ process.stdout.write(chalk.cyan(BORDERS.vertical) + ' ' + promptText);
136
+ rl.question('', (answer) => {
137
+ rl.close();
138
+ const plainPromptText = message + ' › ' + answer;
139
+ const padding = width - plainPromptText.length - 2;
140
+ lines.push(chalk.cyan(BORDERS.vertical) + ' ' + promptText + chalk.white(answer) + ' '.repeat(padding - 1) + chalk.cyan(BORDERS.vertical));
141
+ render();
142
+ resolve(answer);
143
+ });
144
+ });
145
+ }
146
+ export function error(message) {
147
+ boxLine(message, 'error');
148
+ }
149
+ export function success(message) {
150
+ boxLine(message, 'success');
151
+ }
152
+ export function info(message) {
153
+ boxLine(message, 'info');
154
+ }
155
+ export function warning(message) {
156
+ boxLine(message, 'warning');
157
+ }
158
+ //# sourceMappingURL=box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.js","sourceRoot":"","sources":["../../src/utils/box.js"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,IAAI,KAAK,GAAG,EAAE,CAAC;AACf,IAAI,KAAK,GAAG,GAAG,CAAC;AAChB,IAAI,KAAK,GAAG,EAAE,CAAC;AAEf,MAAM,OAAO,GAAG;IACd,OAAO,EAAE,GAAG;IACZ,QAAQ,EAAE,GAAG;IACb,UAAU,EAAE,GAAG;IACf,WAAW,EAAE,GAAG;IAChB,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,GAAG;IACb,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,GAAG;CACZ,CAAC;AAEF,SAAS,MAAM;IACb,OAAO,CAAC,KAAK,EAAE,CAAC;IAEhB,MAAM,YAAY,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,YAAY,GAAG,CAAC,CAAC,CAAC;IAEzG,OAAO,CAAC,GAAG,CAAC,KAAK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AAC9B,CAAC"}
package/ideas.md ADDED
@@ -0,0 +1,46 @@
1
+ * sync, pull merge and push
2
+ * single command to create a branch
3
+ * single command to switch branches
4
+ * single command to delete branchess
5
+ * OH shit yes... single command to merge branches like one command to merge branches but leaving both there, and another to merge branches but then deleting the one we are merging away from thus also making that new branch the new main because that is always afucking pain, having to prep both branches, then making sure ur putting the right branch in the right palce sending the data over and then making one the new main and then deleting... fuck that shit man
6
+ * command to view uploads, ie view commit history (YES THIS NOW GIVES ME THE NAMING CONVETION I WAS LOOKING FOR )
7
+ * pushing the repo to github will be called uploads or uploading, meanwhile stashing (because thats sucha stupid fucking name and its so hard to put the two together from afundamentl point of view ) instead of stash, it would be called saving... because when you get down to the very root of it.... thats what it does... i dont know why the didnt just call it that...
8
+ * upload+ will be push and bump patch while upload++, and upload+++ will take care of the other two
9
+ * a single command to revert back to a specific commit
10
+ * what do u mean by cherry pick commits
11
+ * single command to delete specfic tags
12
+ * a single command for setting a new remote that also delete the current one, but we would also need a command to be able to create a remote and leave the current ones intact
13
+ * single command to load a save and in addition to that to load a save and push it at the same time, and we also need a way to delete saves
14
+ * what does rebase mean? ANSWER Rebase = replay your commits on top of another branch (makes history linear/cleaner vs merge which creates merge commits)
15
+ * Cherry-pick = copy a specific commit from one branch to another (like "I want JUST that bug fix commit from dev branch into main")
16
+
17
+
18
+ **What we actually have now:**
19
+
20
+ - `create-project` - create GitHub repo
21
+ - `download-source` - clone repo
22
+ - `save-project` - stash your work temporarily
23
+ - `load-project` - restore saved work
24
+ - `delete-project` - delete a save
25
+ - `upload-project` - add, commit, push (replaces the old `save` command)
26
+ - `upload-project+` - push + bump patch version
27
+ - `upload-project++` - push + bump minor version
28
+ - `upload-project+++` - push + bump major version
29
+ - `sync-source` - pull and push in one go
30
+ - `add-source` - add additional remote
31
+ - `set-source` - replace remote
32
+ - `delete-source` - replace remote
33
+ - `view-timeline` - view branch
34
+ - `create-timeline` - create branch
35
+ - `switch-timeline` - switch branches
36
+ - `delete-timeline` - delete a branch
37
+ - `combine-timelines` - merge branch (keeps both)
38
+ - `replace-timeline` - merge branch into main and delete the source
39
+ - `view-versions` - view commit history
40
+ - `restore-version` - revert to specific commit
41
+ - `delete-version` - delete tags
42
+ - `download-folder` - download specific folder
43
+ - `download-file` - download specific file
44
+
45
+ That's clean, no bullshit. Everything actually makes sense.
46
+
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@a5gard/asgard",
3
+ "version": "0.0.1",
4
+ "description": "Modern CLI toolkit for developers",
5
+ "main": "index.js",
6
+ "type": "module",
7
+ "bin": {
8
+ "asgard": "./bin/run.js"
9
+ },
10
+ "scripts": {
11
+ "build": "tsc",
12
+ "test": "echo \"Error: no test specified\" && exit 1"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/asgard/asgard.git"
17
+ },
18
+ "keywords": [
19
+ "cli",
20
+ "developer-tools",
21
+ "git",
22
+ "automation"
23
+ ],
24
+ "author": "",
25
+ "license": "MIT",
26
+ "bugs": {
27
+ "url": "https://github.com/asgard/asgard/issues"
28
+ },
29
+ "homepage": "https://github.com/asgard/asgard#readme",
30
+ "dependencies": {
31
+ "@oclif/core": "^4.8.0",
32
+ "@oclif/plugin-help": "^6.2.37",
33
+ "blessed": "^0.1.81",
34
+ "chalk": "^4.1.2",
35
+ "fs-extra": "^11.3.3",
36
+ "inquirer": "^8.2.5",
37
+ "octokit": "^3.1.2",
38
+ "ora": "^5.4.1",
39
+ "simple-git": "^3.22.0"
40
+ },
41
+ "devDependencies": {
42
+ "@types/node": "^18.19.130",
43
+ "oclif": "^4.1.3",
44
+ "ts-node": "^10.9.2"
45
+ },
46
+ "oclif": {
47
+ "bin": "asgard",
48
+ "dirname": "asgard",
49
+ "commands": "./dist/commands",
50
+ "topicSeparator": " ",
51
+ "flexibleTaxonomy": true
52
+ }
53
+ }