@oh-my-ghaad/core 0.0.11 → 0.0.13
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/.turbo/turbo-build.log +8 -8
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +2 -21
- package/dist/index.d.cts +7 -17
- package/dist/index.d.ts +7 -17
- package/dist/index.js +2 -21
- package/package.json +1 -1
- package/src/engine.ts +2 -31
- package/src/types.ts +0 -9
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> @oh-my-ghaad/core@0.0.
|
|
3
|
+
> @oh-my-ghaad/core@0.0.12 build /Volumes/T7/repos/oh-my-ghaad/packages/core
|
|
4
4
|
> tsup src/index.ts --dts --format esm,cjs
|
|
5
5
|
|
|
6
6
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
[34mCLI[39m Target: esnext
|
|
10
10
|
[34mESM[39m Build start
|
|
11
11
|
[34mCJS[39m Build start
|
|
12
|
-
[
|
|
13
|
-
[
|
|
14
|
-
[
|
|
15
|
-
[
|
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m10.58 KB[39m
|
|
13
|
+
[32mESM[39m ⚡️ Build success in 11ms
|
|
14
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m11.81 KB[39m
|
|
15
|
+
[32mCJS[39m ⚡️ Build success in 11ms
|
|
16
16
|
DTS Build start
|
|
17
|
-
DTS ⚡️ Build success in
|
|
18
|
-
DTS dist/index.d.ts
|
|
19
|
-
DTS dist/index.d.cts
|
|
17
|
+
DTS ⚡️ Build success in 341ms
|
|
18
|
+
DTS dist/index.d.ts 6.90 KB
|
|
19
|
+
DTS dist/index.d.cts 6.90 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [0.0.13](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.12...v0.0.13) (2025-10-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* remove PR methods and other unused methods ([2227905](https://github.com/cmgriffing/oh-my-ghaad/commit/222790537f47c5cc385187cc4656d2450d47f7a7))
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
## [0.0.12](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.11...v0.0.12) (2025-10-06)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
1
14
|
## [0.0.11](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.10...v0.0.11) (2025-10-06)
|
|
2
15
|
|
|
3
16
|
|
package/dist/index.cjs
CHANGED
|
@@ -264,8 +264,7 @@ var Engine = class {
|
|
|
264
264
|
id: collection.idFunction()
|
|
265
265
|
};
|
|
266
266
|
const item = collection.validator.parse(rawNewItem);
|
|
267
|
-
|
|
268
|
-
request = this.currentAdapter.createFile(
|
|
267
|
+
const request = this.currentAdapter.createFile(
|
|
269
268
|
`collections/${collection.names.path}/${item.id}.json`,
|
|
270
269
|
JSON.stringify(item, null, 2),
|
|
271
270
|
`Add ${collection.names.singular} ${item.id}`
|
|
@@ -286,8 +285,7 @@ var Engine = class {
|
|
|
286
285
|
if (!collection) {
|
|
287
286
|
throw new Error("Collection not found");
|
|
288
287
|
}
|
|
289
|
-
|
|
290
|
-
request = this.currentAdapter.deleteFile(
|
|
288
|
+
const request = this.currentAdapter.deleteFile(
|
|
291
289
|
`collections/${collection.names.path}/${itemId}.json`,
|
|
292
290
|
`Remove ${collection.names.singular} ${itemId}`
|
|
293
291
|
);
|
|
@@ -370,23 +368,6 @@ var Engine = class {
|
|
|
370
368
|
this.status = "valid";
|
|
371
369
|
this.notifySubscribers();
|
|
372
370
|
}
|
|
373
|
-
// Grouping together props and methods for caching PRs
|
|
374
|
-
lastFetchPullRequestTimestamp = 0;
|
|
375
|
-
cachedPullRequests = [];
|
|
376
|
-
async fetchPullRequests(force = false) {
|
|
377
|
-
const adapter = this.getAdapter();
|
|
378
|
-
if (!adapter) {
|
|
379
|
-
throw new Error("No adapter selected");
|
|
380
|
-
}
|
|
381
|
-
if (force) {
|
|
382
|
-
this.lastFetchPullRequestTimestamp = 0;
|
|
383
|
-
}
|
|
384
|
-
if (this.lastFetchPullRequestTimestamp > Date.now() - 1e3 * 60 * 5) {
|
|
385
|
-
return this.cachedPullRequests;
|
|
386
|
-
} else {
|
|
387
|
-
return adapter.fetchPullRequests();
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
371
|
};
|
|
391
372
|
|
|
392
373
|
// src/collection.ts
|
package/dist/index.d.cts
CHANGED
|
@@ -31,7 +31,7 @@ interface AdapterProps {
|
|
|
31
31
|
scopes: string[];
|
|
32
32
|
}
|
|
33
33
|
type Subscription = (collections: Collection[]) => void | Promise<void>;
|
|
34
|
-
interface RepositoryResponse {
|
|
34
|
+
interface RepositoryResponse$1 {
|
|
35
35
|
id: string | number;
|
|
36
36
|
org: string;
|
|
37
37
|
name: string;
|
|
@@ -60,19 +60,12 @@ interface IAdapter extends AdapterProps {
|
|
|
60
60
|
readonly secondaryColor: string;
|
|
61
61
|
readonly oauthUrl: string;
|
|
62
62
|
readonly baseUrl: string;
|
|
63
|
-
fetchRepositories(): Promise<RepositoryResponse[]>;
|
|
63
|
+
fetchRepositories(): Promise<RepositoryResponse$1[]>;
|
|
64
64
|
fetchFile(filePath: string): Promise<string>;
|
|
65
|
-
fetchFileHistory(filePath: string): Promise<CommitResponse[]>;
|
|
66
65
|
fetchDirectory(directoryPath: string): Promise<string[]>;
|
|
67
|
-
createCommit(commitRequest: CommitRequest): Promise<void>;
|
|
68
66
|
createFile(filePath: string, content: string, message?: string): Promise<void>;
|
|
69
67
|
updateFile(filePath: string, content: string, message?: string): Promise<void>;
|
|
70
68
|
deleteFile(filePath: string, message?: string): Promise<void>;
|
|
71
|
-
fetchPullRequests(): Promise<PrResponse[]>;
|
|
72
|
-
createPullRequest(prRequest: PrRequest): Promise<void>;
|
|
73
|
-
fetchPullRequest(): Promise<PrResponse>;
|
|
74
|
-
updatePullRequest(prRequest: PrRequest): Promise<void>;
|
|
75
|
-
deletePullRequest(id: string): Promise<void>;
|
|
76
69
|
}
|
|
77
70
|
interface BaseCollectionItem {
|
|
78
71
|
id: string;
|
|
@@ -83,12 +76,12 @@ declare class Adapter implements AdapterProps {
|
|
|
83
76
|
clientId: string;
|
|
84
77
|
redirectUri: string;
|
|
85
78
|
token: string | null;
|
|
86
|
-
repo: RepositoryResponse | null;
|
|
79
|
+
repo: RepositoryResponse$1 | null;
|
|
87
80
|
accessManagementUrl: string;
|
|
88
81
|
scopes: string[];
|
|
89
82
|
protected unauthorizedHandler: (() => void | Promise<void>) | null;
|
|
90
83
|
constructor(props: AdapterProps);
|
|
91
|
-
setRepo(repo: RepositoryResponse | null): void;
|
|
84
|
+
setRepo(repo: RepositoryResponse$1 | null): void;
|
|
92
85
|
setToken(token: string | null): void;
|
|
93
86
|
setUnauthorizedHandler(handler: () => void | Promise<void>): void;
|
|
94
87
|
}
|
|
@@ -130,7 +123,7 @@ type RepoConfig = z.infer<typeof repoConfigSchema> & {
|
|
|
130
123
|
status: RepoStatus;
|
|
131
124
|
};
|
|
132
125
|
|
|
133
|
-
interface RepositoryResponse
|
|
126
|
+
interface RepositoryResponse {
|
|
134
127
|
id: string | number;
|
|
135
128
|
org: string;
|
|
136
129
|
name: string;
|
|
@@ -155,7 +148,7 @@ declare class Engine {
|
|
|
155
148
|
subscribe(subscription: Subscription): void;
|
|
156
149
|
unsubscribe(subscription: Subscription): void;
|
|
157
150
|
private notifySubscribers;
|
|
158
|
-
setRepo(repo: RepositoryResponse
|
|
151
|
+
setRepo(repo: RepositoryResponse | null): void;
|
|
159
152
|
getRepoStatus(): RepoStatus;
|
|
160
153
|
getAppConfig(): {
|
|
161
154
|
appName?: string;
|
|
@@ -185,9 +178,6 @@ declare class Engine {
|
|
|
185
178
|
initializeCollection(collection: Collection): Promise<void>;
|
|
186
179
|
initializeRepoConfig(repoConfig: RepoConfig): Promise<void>;
|
|
187
180
|
initialize(): Promise<void>;
|
|
188
|
-
private lastFetchPullRequestTimestamp;
|
|
189
|
-
private cachedPullRequests;
|
|
190
|
-
fetchPullRequests(force?: boolean): Promise<PrResponse[]>;
|
|
191
181
|
}
|
|
192
182
|
|
|
193
|
-
export { Adapter, type AdapterProps, type AppConfig, type BaseCollectionItem, Collection, type CollectionItemStatus, type CollectionStatus, type CommitRequest, type CommitResponse, Engine, type IAdapter, type InvalidRepoStatus, type PendingCollectionItemType, type PrRequest, type PrResponse, type RepoConfig, type RepoStatus, type RepositoryResponse, type Subscription, type ValidRepoStatus, appConfigSchema, repoConfigSchema };
|
|
183
|
+
export { Adapter, type AdapterProps, type AppConfig, type BaseCollectionItem, Collection, type CollectionItemStatus, type CollectionStatus, type CommitRequest, type CommitResponse, Engine, type IAdapter, type InvalidRepoStatus, type PendingCollectionItemType, type PrRequest, type PrResponse, type RepoConfig, type RepoStatus, type RepositoryResponse$1 as RepositoryResponse, type Subscription, type ValidRepoStatus, appConfigSchema, repoConfigSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ interface AdapterProps {
|
|
|
31
31
|
scopes: string[];
|
|
32
32
|
}
|
|
33
33
|
type Subscription = (collections: Collection[]) => void | Promise<void>;
|
|
34
|
-
interface RepositoryResponse {
|
|
34
|
+
interface RepositoryResponse$1 {
|
|
35
35
|
id: string | number;
|
|
36
36
|
org: string;
|
|
37
37
|
name: string;
|
|
@@ -60,19 +60,12 @@ interface IAdapter extends AdapterProps {
|
|
|
60
60
|
readonly secondaryColor: string;
|
|
61
61
|
readonly oauthUrl: string;
|
|
62
62
|
readonly baseUrl: string;
|
|
63
|
-
fetchRepositories(): Promise<RepositoryResponse[]>;
|
|
63
|
+
fetchRepositories(): Promise<RepositoryResponse$1[]>;
|
|
64
64
|
fetchFile(filePath: string): Promise<string>;
|
|
65
|
-
fetchFileHistory(filePath: string): Promise<CommitResponse[]>;
|
|
66
65
|
fetchDirectory(directoryPath: string): Promise<string[]>;
|
|
67
|
-
createCommit(commitRequest: CommitRequest): Promise<void>;
|
|
68
66
|
createFile(filePath: string, content: string, message?: string): Promise<void>;
|
|
69
67
|
updateFile(filePath: string, content: string, message?: string): Promise<void>;
|
|
70
68
|
deleteFile(filePath: string, message?: string): Promise<void>;
|
|
71
|
-
fetchPullRequests(): Promise<PrResponse[]>;
|
|
72
|
-
createPullRequest(prRequest: PrRequest): Promise<void>;
|
|
73
|
-
fetchPullRequest(): Promise<PrResponse>;
|
|
74
|
-
updatePullRequest(prRequest: PrRequest): Promise<void>;
|
|
75
|
-
deletePullRequest(id: string): Promise<void>;
|
|
76
69
|
}
|
|
77
70
|
interface BaseCollectionItem {
|
|
78
71
|
id: string;
|
|
@@ -83,12 +76,12 @@ declare class Adapter implements AdapterProps {
|
|
|
83
76
|
clientId: string;
|
|
84
77
|
redirectUri: string;
|
|
85
78
|
token: string | null;
|
|
86
|
-
repo: RepositoryResponse | null;
|
|
79
|
+
repo: RepositoryResponse$1 | null;
|
|
87
80
|
accessManagementUrl: string;
|
|
88
81
|
scopes: string[];
|
|
89
82
|
protected unauthorizedHandler: (() => void | Promise<void>) | null;
|
|
90
83
|
constructor(props: AdapterProps);
|
|
91
|
-
setRepo(repo: RepositoryResponse | null): void;
|
|
84
|
+
setRepo(repo: RepositoryResponse$1 | null): void;
|
|
92
85
|
setToken(token: string | null): void;
|
|
93
86
|
setUnauthorizedHandler(handler: () => void | Promise<void>): void;
|
|
94
87
|
}
|
|
@@ -130,7 +123,7 @@ type RepoConfig = z.infer<typeof repoConfigSchema> & {
|
|
|
130
123
|
status: RepoStatus;
|
|
131
124
|
};
|
|
132
125
|
|
|
133
|
-
interface RepositoryResponse
|
|
126
|
+
interface RepositoryResponse {
|
|
134
127
|
id: string | number;
|
|
135
128
|
org: string;
|
|
136
129
|
name: string;
|
|
@@ -155,7 +148,7 @@ declare class Engine {
|
|
|
155
148
|
subscribe(subscription: Subscription): void;
|
|
156
149
|
unsubscribe(subscription: Subscription): void;
|
|
157
150
|
private notifySubscribers;
|
|
158
|
-
setRepo(repo: RepositoryResponse
|
|
151
|
+
setRepo(repo: RepositoryResponse | null): void;
|
|
159
152
|
getRepoStatus(): RepoStatus;
|
|
160
153
|
getAppConfig(): {
|
|
161
154
|
appName?: string;
|
|
@@ -185,9 +178,6 @@ declare class Engine {
|
|
|
185
178
|
initializeCollection(collection: Collection): Promise<void>;
|
|
186
179
|
initializeRepoConfig(repoConfig: RepoConfig): Promise<void>;
|
|
187
180
|
initialize(): Promise<void>;
|
|
188
|
-
private lastFetchPullRequestTimestamp;
|
|
189
|
-
private cachedPullRequests;
|
|
190
|
-
fetchPullRequests(force?: boolean): Promise<PrResponse[]>;
|
|
191
181
|
}
|
|
192
182
|
|
|
193
|
-
export { Adapter, type AdapterProps, type AppConfig, type BaseCollectionItem, Collection, type CollectionItemStatus, type CollectionStatus, type CommitRequest, type CommitResponse, Engine, type IAdapter, type InvalidRepoStatus, type PendingCollectionItemType, type PrRequest, type PrResponse, type RepoConfig, type RepoStatus, type RepositoryResponse, type Subscription, type ValidRepoStatus, appConfigSchema, repoConfigSchema };
|
|
183
|
+
export { Adapter, type AdapterProps, type AppConfig, type BaseCollectionItem, Collection, type CollectionItemStatus, type CollectionStatus, type CommitRequest, type CommitResponse, Engine, type IAdapter, type InvalidRepoStatus, type PendingCollectionItemType, type PrRequest, type PrResponse, type RepoConfig, type RepoStatus, type RepositoryResponse$1 as RepositoryResponse, type Subscription, type ValidRepoStatus, appConfigSchema, repoConfigSchema };
|
package/dist/index.js
CHANGED
|
@@ -235,8 +235,7 @@ var Engine = class {
|
|
|
235
235
|
id: collection.idFunction()
|
|
236
236
|
};
|
|
237
237
|
const item = collection.validator.parse(rawNewItem);
|
|
238
|
-
|
|
239
|
-
request = this.currentAdapter.createFile(
|
|
238
|
+
const request = this.currentAdapter.createFile(
|
|
240
239
|
`collections/${collection.names.path}/${item.id}.json`,
|
|
241
240
|
JSON.stringify(item, null, 2),
|
|
242
241
|
`Add ${collection.names.singular} ${item.id}`
|
|
@@ -257,8 +256,7 @@ var Engine = class {
|
|
|
257
256
|
if (!collection) {
|
|
258
257
|
throw new Error("Collection not found");
|
|
259
258
|
}
|
|
260
|
-
|
|
261
|
-
request = this.currentAdapter.deleteFile(
|
|
259
|
+
const request = this.currentAdapter.deleteFile(
|
|
262
260
|
`collections/${collection.names.path}/${itemId}.json`,
|
|
263
261
|
`Remove ${collection.names.singular} ${itemId}`
|
|
264
262
|
);
|
|
@@ -341,23 +339,6 @@ var Engine = class {
|
|
|
341
339
|
this.status = "valid";
|
|
342
340
|
this.notifySubscribers();
|
|
343
341
|
}
|
|
344
|
-
// Grouping together props and methods for caching PRs
|
|
345
|
-
lastFetchPullRequestTimestamp = 0;
|
|
346
|
-
cachedPullRequests = [];
|
|
347
|
-
async fetchPullRequests(force = false) {
|
|
348
|
-
const adapter = this.getAdapter();
|
|
349
|
-
if (!adapter) {
|
|
350
|
-
throw new Error("No adapter selected");
|
|
351
|
-
}
|
|
352
|
-
if (force) {
|
|
353
|
-
this.lastFetchPullRequestTimestamp = 0;
|
|
354
|
-
}
|
|
355
|
-
if (this.lastFetchPullRequestTimestamp > Date.now() - 1e3 * 60 * 5) {
|
|
356
|
-
return this.cachedPullRequests;
|
|
357
|
-
} else {
|
|
358
|
-
return adapter.fetchPullRequests();
|
|
359
|
-
}
|
|
360
|
-
}
|
|
361
342
|
};
|
|
362
343
|
|
|
363
344
|
// src/collection.ts
|
package/package.json
CHANGED
package/src/engine.ts
CHANGED
|
@@ -329,11 +329,7 @@ export class Engine {
|
|
|
329
329
|
|
|
330
330
|
const item = collection.validator.parse(rawNewItem);
|
|
331
331
|
|
|
332
|
-
|
|
333
|
-
IAdapter["createCommit"] | IAdapter["createPullRequest"]
|
|
334
|
-
>;
|
|
335
|
-
|
|
336
|
-
request = this.currentAdapter.createFile(
|
|
332
|
+
const request = this.currentAdapter.createFile(
|
|
337
333
|
`collections/${collection.names.path}/${item.id}.json`,
|
|
338
334
|
JSON.stringify(item, null, 2),
|
|
339
335
|
`Add ${collection.names.singular} ${item.id}`
|
|
@@ -366,11 +362,7 @@ export class Engine {
|
|
|
366
362
|
throw new Error("Collection not found");
|
|
367
363
|
}
|
|
368
364
|
|
|
369
|
-
|
|
370
|
-
IAdapter["createCommit"] | IAdapter["createPullRequest"]
|
|
371
|
-
>;
|
|
372
|
-
|
|
373
|
-
request = this.currentAdapter.deleteFile(
|
|
365
|
+
const request = this.currentAdapter.deleteFile(
|
|
374
366
|
`collections/${collection.names.path}/${itemId}.json`,
|
|
375
367
|
`Remove ${collection.names.singular} ${itemId}`
|
|
376
368
|
);
|
|
@@ -486,25 +478,4 @@ export class Engine {
|
|
|
486
478
|
this.status = "valid";
|
|
487
479
|
this.notifySubscribers();
|
|
488
480
|
}
|
|
489
|
-
|
|
490
|
-
// Grouping together props and methods for caching PRs
|
|
491
|
-
private lastFetchPullRequestTimestamp = 0;
|
|
492
|
-
private cachedPullRequests: PrResponse[] = [];
|
|
493
|
-
async fetchPullRequests(force = false) {
|
|
494
|
-
const adapter = this.getAdapter();
|
|
495
|
-
|
|
496
|
-
if (!adapter) {
|
|
497
|
-
throw new Error("No adapter selected");
|
|
498
|
-
}
|
|
499
|
-
|
|
500
|
-
if (force) {
|
|
501
|
-
this.lastFetchPullRequestTimestamp = 0;
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
if (this.lastFetchPullRequestTimestamp > Date.now() - 1000 * 60 * 5) {
|
|
505
|
-
return this.cachedPullRequests;
|
|
506
|
-
} else {
|
|
507
|
-
return adapter.fetchPullRequests();
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
481
|
}
|
package/src/types.ts
CHANGED
|
@@ -55,11 +55,8 @@ export interface IAdapter extends AdapterProps {
|
|
|
55
55
|
fetchRepositories(): Promise<RepositoryResponse[]>;
|
|
56
56
|
|
|
57
57
|
fetchFile(filePath: string): Promise<string>;
|
|
58
|
-
fetchFileHistory(filePath: string): Promise<CommitResponse[]>;
|
|
59
58
|
fetchDirectory(directoryPath: string): Promise<string[]>;
|
|
60
59
|
|
|
61
|
-
createCommit(commitRequest: CommitRequest): Promise<void>;
|
|
62
|
-
// This method is ONLY used for initialization for now. We may end up using it for the non-PR workflow as well.
|
|
63
60
|
createFile(
|
|
64
61
|
filePath: string,
|
|
65
62
|
content: string,
|
|
@@ -71,12 +68,6 @@ export interface IAdapter extends AdapterProps {
|
|
|
71
68
|
message?: string
|
|
72
69
|
): Promise<void>;
|
|
73
70
|
deleteFile(filePath: string, message?: string): Promise<void>;
|
|
74
|
-
|
|
75
|
-
fetchPullRequests(): Promise<PrResponse[]>;
|
|
76
|
-
createPullRequest(prRequest: PrRequest): Promise<void>;
|
|
77
|
-
fetchPullRequest(): Promise<PrResponse>;
|
|
78
|
-
updatePullRequest(prRequest: PrRequest): Promise<void>;
|
|
79
|
-
deletePullRequest(id: string): Promise<void>;
|
|
80
71
|
}
|
|
81
72
|
|
|
82
73
|
export interface BaseCollectionItem {
|