@oh-my-ghaad/core 0.0.7 → 0.0.9
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 +19 -0
- package/CHANGELOG.md +13 -0
- package/dist/index.cjs +6 -25
- package/dist/index.d.cts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +6 -25
- package/package.json +1 -1
- package/src/adapter.ts +3 -8
- package/src/engine.ts +7 -24
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
> @oh-my-ghaad/core@0.0.7 build /Volumes/T7/repos/oh-my-ghaad/packages/core
|
|
4
|
+
> tsup src/index.ts --dts --format esm,cjs
|
|
5
|
+
|
|
6
|
+
[34mCLI[39m Building entry: src/index.ts
|
|
7
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
8
|
+
[34mCLI[39m tsup v8.5.0
|
|
9
|
+
[34mCLI[39m Target: esnext
|
|
10
|
+
[34mESM[39m Build start
|
|
11
|
+
[34mCJS[39m Build start
|
|
12
|
+
[32mCJS[39m [1mdist/index.cjs [22m[32m12.34 KB[39m
|
|
13
|
+
[32mCJS[39m ⚡️ Build success in 12ms
|
|
14
|
+
[32mESM[39m [1mdist/index.js [22m[32m11.11 KB[39m
|
|
15
|
+
[32mESM[39m ⚡️ Build success in 12ms
|
|
16
|
+
DTS Build start
|
|
17
|
+
DTS ⚡️ Build success in 362ms
|
|
18
|
+
DTS dist/index.d.ts 7.40 KB
|
|
19
|
+
DTS dist/index.d.cts 7.40 KB
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
## [0.0.9](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.8...v0.0.9) (2025-10-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## [0.0.8](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.7...v0.0.8) (2025-10-04)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* instead of storing owner and repo separate, store the whole RepositoryResponse object ([db60e6b](https://github.com/cmgriffing/oh-my-ghaad/commit/db60e6b65f2232613a2de3ba6c0a45a51cbb0b27))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
1
14
|
## [0.0.7](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.6...v0.0.7) (2025-10-04)
|
|
2
15
|
|
|
3
16
|
|
package/dist/index.cjs
CHANGED
|
@@ -85,14 +85,8 @@ var Engine = class {
|
|
|
85
85
|
const persistedRepo = storage?.getItem(
|
|
86
86
|
this.appConfig.persistedRepoKey || "repo"
|
|
87
87
|
);
|
|
88
|
-
if (persistedRepo) {
|
|
89
|
-
this.getAdapter()?.setRepo(persistedRepo);
|
|
90
|
-
}
|
|
91
|
-
const persistedOwner = storage?.getItem(
|
|
92
|
-
this.appConfig.persistedOwnerKey || "owner"
|
|
93
|
-
);
|
|
94
|
-
if (persistedOwner) {
|
|
95
|
-
this.getAdapter()?.setOwner(persistedOwner);
|
|
88
|
+
if (persistedRepo && typeof persistedRepo === "string") {
|
|
89
|
+
this.getAdapter()?.setRepo(JSON.parse(persistedRepo));
|
|
96
90
|
}
|
|
97
91
|
}
|
|
98
92
|
}
|
|
@@ -112,24 +106,15 @@ var Engine = class {
|
|
|
112
106
|
(subscription) => subscription(this.collections)
|
|
113
107
|
);
|
|
114
108
|
}
|
|
115
|
-
|
|
109
|
+
setRepo(repo) {
|
|
116
110
|
if (this.appConfig.persisted) {
|
|
117
111
|
storage?.setItem(
|
|
118
|
-
this.appConfig.
|
|
119
|
-
|
|
112
|
+
this.appConfig.persistedRepoKey || "repo",
|
|
113
|
+
JSON.stringify(repo || {})
|
|
120
114
|
);
|
|
121
115
|
}
|
|
122
116
|
this.adapters.forEach((adapter) => {
|
|
123
|
-
adapter.
|
|
124
|
-
});
|
|
125
|
-
this.notifySubscribers();
|
|
126
|
-
}
|
|
127
|
-
setRepoName(name) {
|
|
128
|
-
if (this.appConfig.persisted) {
|
|
129
|
-
storage?.setItem(this.appConfig.persistedRepoKey || "repo", name || "");
|
|
130
|
-
}
|
|
131
|
-
this.adapters.forEach((adapter) => {
|
|
132
|
-
adapter.setRepo(name);
|
|
117
|
+
adapter.setRepo(repo);
|
|
133
118
|
});
|
|
134
119
|
this.notifySubscribers();
|
|
135
120
|
}
|
|
@@ -428,7 +413,6 @@ var Adapter = class {
|
|
|
428
413
|
clientId;
|
|
429
414
|
redirectUri;
|
|
430
415
|
token;
|
|
431
|
-
owner;
|
|
432
416
|
repo;
|
|
433
417
|
accessManagementUrl;
|
|
434
418
|
scopes;
|
|
@@ -439,9 +423,6 @@ var Adapter = class {
|
|
|
439
423
|
this.accessManagementUrl = props.accessManagementUrl;
|
|
440
424
|
this.scopes = props.scopes;
|
|
441
425
|
}
|
|
442
|
-
setOwner(owner) {
|
|
443
|
-
this.owner = owner;
|
|
444
|
-
}
|
|
445
426
|
setRepo(repo) {
|
|
446
427
|
this.repo = repo;
|
|
447
428
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -83,14 +83,12 @@ declare class Adapter implements AdapterProps {
|
|
|
83
83
|
clientId: string;
|
|
84
84
|
redirectUri: string;
|
|
85
85
|
token: string | null;
|
|
86
|
-
|
|
87
|
-
repo: string | null;
|
|
86
|
+
repo: RepositoryResponse | null;
|
|
88
87
|
accessManagementUrl: string;
|
|
89
88
|
scopes: string[];
|
|
90
89
|
protected unauthorizedHandler: (() => void | Promise<void>) | null;
|
|
91
90
|
constructor(props: AdapterProps);
|
|
92
|
-
|
|
93
|
-
setRepo(repo: string | null): void;
|
|
91
|
+
setRepo(repo: RepositoryResponse | null): void;
|
|
94
92
|
setToken(token: string | null): void;
|
|
95
93
|
setUnauthorizedHandler(handler: () => void | Promise<void>): void;
|
|
96
94
|
}
|
|
@@ -132,6 +130,13 @@ type RepoConfig = z.infer<typeof repoConfigSchema> & {
|
|
|
132
130
|
status: RepoStatus;
|
|
133
131
|
};
|
|
134
132
|
|
|
133
|
+
interface RepositoryResponse$1 {
|
|
134
|
+
id: string | number;
|
|
135
|
+
org: string;
|
|
136
|
+
name: string;
|
|
137
|
+
url: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
135
140
|
declare class Engine {
|
|
136
141
|
private status;
|
|
137
142
|
private subscriptions;
|
|
@@ -150,8 +155,7 @@ declare class Engine {
|
|
|
150
155
|
subscribe(subscription: Subscription): void;
|
|
151
156
|
unsubscribe(subscription: Subscription): void;
|
|
152
157
|
private notifySubscribers;
|
|
153
|
-
|
|
154
|
-
setRepoName(name: string | null): void;
|
|
158
|
+
setRepo(repo: RepositoryResponse$1 | null): void;
|
|
155
159
|
getRepoStatus(): RepoStatus;
|
|
156
160
|
getAppConfig(): {
|
|
157
161
|
appName?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -83,14 +83,12 @@ declare class Adapter implements AdapterProps {
|
|
|
83
83
|
clientId: string;
|
|
84
84
|
redirectUri: string;
|
|
85
85
|
token: string | null;
|
|
86
|
-
|
|
87
|
-
repo: string | null;
|
|
86
|
+
repo: RepositoryResponse | null;
|
|
88
87
|
accessManagementUrl: string;
|
|
89
88
|
scopes: string[];
|
|
90
89
|
protected unauthorizedHandler: (() => void | Promise<void>) | null;
|
|
91
90
|
constructor(props: AdapterProps);
|
|
92
|
-
|
|
93
|
-
setRepo(repo: string | null): void;
|
|
91
|
+
setRepo(repo: RepositoryResponse | null): void;
|
|
94
92
|
setToken(token: string | null): void;
|
|
95
93
|
setUnauthorizedHandler(handler: () => void | Promise<void>): void;
|
|
96
94
|
}
|
|
@@ -132,6 +130,13 @@ type RepoConfig = z.infer<typeof repoConfigSchema> & {
|
|
|
132
130
|
status: RepoStatus;
|
|
133
131
|
};
|
|
134
132
|
|
|
133
|
+
interface RepositoryResponse$1 {
|
|
134
|
+
id: string | number;
|
|
135
|
+
org: string;
|
|
136
|
+
name: string;
|
|
137
|
+
url: string;
|
|
138
|
+
}
|
|
139
|
+
|
|
135
140
|
declare class Engine {
|
|
136
141
|
private status;
|
|
137
142
|
private subscriptions;
|
|
@@ -150,8 +155,7 @@ declare class Engine {
|
|
|
150
155
|
subscribe(subscription: Subscription): void;
|
|
151
156
|
unsubscribe(subscription: Subscription): void;
|
|
152
157
|
private notifySubscribers;
|
|
153
|
-
|
|
154
|
-
setRepoName(name: string | null): void;
|
|
158
|
+
setRepo(repo: RepositoryResponse$1 | null): void;
|
|
155
159
|
getRepoStatus(): RepoStatus;
|
|
156
160
|
getAppConfig(): {
|
|
157
161
|
appName?: string;
|
package/dist/index.js
CHANGED
|
@@ -56,14 +56,8 @@ var Engine = class {
|
|
|
56
56
|
const persistedRepo = storage?.getItem(
|
|
57
57
|
this.appConfig.persistedRepoKey || "repo"
|
|
58
58
|
);
|
|
59
|
-
if (persistedRepo) {
|
|
60
|
-
this.getAdapter()?.setRepo(persistedRepo);
|
|
61
|
-
}
|
|
62
|
-
const persistedOwner = storage?.getItem(
|
|
63
|
-
this.appConfig.persistedOwnerKey || "owner"
|
|
64
|
-
);
|
|
65
|
-
if (persistedOwner) {
|
|
66
|
-
this.getAdapter()?.setOwner(persistedOwner);
|
|
59
|
+
if (persistedRepo && typeof persistedRepo === "string") {
|
|
60
|
+
this.getAdapter()?.setRepo(JSON.parse(persistedRepo));
|
|
67
61
|
}
|
|
68
62
|
}
|
|
69
63
|
}
|
|
@@ -83,24 +77,15 @@ var Engine = class {
|
|
|
83
77
|
(subscription) => subscription(this.collections)
|
|
84
78
|
);
|
|
85
79
|
}
|
|
86
|
-
|
|
80
|
+
setRepo(repo) {
|
|
87
81
|
if (this.appConfig.persisted) {
|
|
88
82
|
storage?.setItem(
|
|
89
|
-
this.appConfig.
|
|
90
|
-
|
|
83
|
+
this.appConfig.persistedRepoKey || "repo",
|
|
84
|
+
JSON.stringify(repo || {})
|
|
91
85
|
);
|
|
92
86
|
}
|
|
93
87
|
this.adapters.forEach((adapter) => {
|
|
94
|
-
adapter.
|
|
95
|
-
});
|
|
96
|
-
this.notifySubscribers();
|
|
97
|
-
}
|
|
98
|
-
setRepoName(name) {
|
|
99
|
-
if (this.appConfig.persisted) {
|
|
100
|
-
storage?.setItem(this.appConfig.persistedRepoKey || "repo", name || "");
|
|
101
|
-
}
|
|
102
|
-
this.adapters.forEach((adapter) => {
|
|
103
|
-
adapter.setRepo(name);
|
|
88
|
+
adapter.setRepo(repo);
|
|
104
89
|
});
|
|
105
90
|
this.notifySubscribers();
|
|
106
91
|
}
|
|
@@ -399,7 +384,6 @@ var Adapter = class {
|
|
|
399
384
|
clientId;
|
|
400
385
|
redirectUri;
|
|
401
386
|
token;
|
|
402
|
-
owner;
|
|
403
387
|
repo;
|
|
404
388
|
accessManagementUrl;
|
|
405
389
|
scopes;
|
|
@@ -410,9 +394,6 @@ var Adapter = class {
|
|
|
410
394
|
this.accessManagementUrl = props.accessManagementUrl;
|
|
411
395
|
this.scopes = props.scopes;
|
|
412
396
|
}
|
|
413
|
-
setOwner(owner) {
|
|
414
|
-
this.owner = owner;
|
|
415
|
-
}
|
|
416
397
|
setRepo(repo) {
|
|
417
398
|
this.repo = repo;
|
|
418
399
|
}
|
package/package.json
CHANGED
package/src/adapter.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { AdapterProps } from "./types";
|
|
1
|
+
import { AdapterProps, RepositoryResponse } from "./types";
|
|
2
2
|
|
|
3
3
|
export class Adapter implements AdapterProps {
|
|
4
4
|
clientId: string;
|
|
5
5
|
redirectUri: string;
|
|
6
6
|
token: string | null;
|
|
7
|
-
|
|
8
|
-
repo: string | null;
|
|
7
|
+
repo: RepositoryResponse | null;
|
|
9
8
|
accessManagementUrl: string;
|
|
10
9
|
scopes: string[];
|
|
11
10
|
protected unauthorizedHandler: (() => void | Promise<void>) | null = null;
|
|
@@ -17,11 +16,7 @@ export class Adapter implements AdapterProps {
|
|
|
17
16
|
this.scopes = props.scopes;
|
|
18
17
|
}
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
this.owner = owner;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
setRepo(repo: string | null) {
|
|
19
|
+
setRepo(repo: RepositoryResponse | null) {
|
|
25
20
|
this.repo = repo;
|
|
26
21
|
}
|
|
27
22
|
|
package/src/engine.ts
CHANGED
|
@@ -5,6 +5,7 @@ import type { IAdapter, PrResponse, RepoStatus, Subscription } from "./types";
|
|
|
5
5
|
import { Adapter } from "./adapter";
|
|
6
6
|
import type { AppConfig, RepoConfig } from "./validators";
|
|
7
7
|
import { repoConfigSchema } from "./validators";
|
|
8
|
+
import { RepositoryResponse } from "../dist";
|
|
8
9
|
|
|
9
10
|
const storage = typeof window !== "undefined" ? window.localStorage : null;
|
|
10
11
|
|
|
@@ -63,15 +64,8 @@ export class Engine {
|
|
|
63
64
|
const persistedRepo = storage?.getItem(
|
|
64
65
|
this.appConfig.persistedRepoKey || "repo"
|
|
65
66
|
);
|
|
66
|
-
if (persistedRepo) {
|
|
67
|
-
this.getAdapter()?.setRepo(persistedRepo);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const persistedOwner = storage?.getItem(
|
|
71
|
-
this.appConfig.persistedOwnerKey || "owner"
|
|
72
|
-
);
|
|
73
|
-
if (persistedOwner) {
|
|
74
|
-
this.getAdapter()?.setOwner(persistedOwner);
|
|
67
|
+
if (persistedRepo && typeof persistedRepo === "string") {
|
|
68
|
+
this.getAdapter()?.setRepo(JSON.parse(persistedRepo));
|
|
75
69
|
}
|
|
76
70
|
}
|
|
77
71
|
}
|
|
@@ -96,27 +90,16 @@ export class Engine {
|
|
|
96
90
|
);
|
|
97
91
|
}
|
|
98
92
|
|
|
99
|
-
|
|
93
|
+
setRepo(repo: RepositoryResponse | null) {
|
|
100
94
|
if (this.appConfig.persisted) {
|
|
101
95
|
storage?.setItem(
|
|
102
|
-
this.appConfig.
|
|
103
|
-
|
|
96
|
+
this.appConfig.persistedRepoKey || "repo",
|
|
97
|
+
JSON.stringify(repo || {})
|
|
104
98
|
);
|
|
105
99
|
}
|
|
106
100
|
|
|
107
101
|
this.adapters.forEach((adapter) => {
|
|
108
|
-
adapter.
|
|
109
|
-
});
|
|
110
|
-
this.notifySubscribers();
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
setRepoName(name: string | null) {
|
|
114
|
-
if (this.appConfig.persisted) {
|
|
115
|
-
storage?.setItem(this.appConfig.persistedRepoKey || "repo", name || "");
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
this.adapters.forEach((adapter) => {
|
|
119
|
-
adapter.setRepo(name);
|
|
102
|
+
adapter.setRepo(repo);
|
|
120
103
|
});
|
|
121
104
|
this.notifySubscribers();
|
|
122
105
|
}
|