comfy-pr 0.2.20 → 0.2.24
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/README.md +225 -225
- package/next-env.d.ts +5 -5
- package/package.json +10 -2
- package/src/Authors.ts +48 -0
- package/src/CMNodes.ts +60 -60
- package/src/CNRepos.ts +74 -72
- package/src/CRNodes.ts +27 -27
- package/src/CRPulls.ts +4 -4
- package/src/FORK_OWNER.ts +5 -5
- package/src/FORK_PREFIX.ts +5 -5
- package/src/FollowRules.ts +25 -25
- package/src/GIT_USEREMAIL.ts +5 -5
- package/src/GIT_USERNAME.ts +9 -9
- package/src/GithubIssueComments.ts +3 -3
- package/src/PushedBranch.ts +3 -3
- package/src/Totals.ts +9 -9
- package/src/TrackingPRs.ts +12 -12
- package/src/WorkerInstances.ts +89 -89
- package/src/addCommentAction.ts +65 -0
- package/src/analyzePullsStatus.ts +170 -134
- package/src/analyzeTotals.test.ts +5 -5
- package/src/analyzeTotals.ts +118 -120
- package/src/checkComfyActivated.ts +39 -39
- package/src/cli.ts +40 -40
- package/src/clone_modify_push_Branches.ts +21 -21
- package/src/createComfyRegistryPRsFromCandidates.ts +55 -55
- package/src/createComfyRegistryPullRequests.ts +22 -22
- package/src/createGithubForkForRepo.ts +37 -37
- package/src/createGithubPullRequest.ts +94 -94
- package/src/createIssueComment.ts +29 -29
- package/src/fetchCMNodes.ts +22 -22
- package/src/fetchComfyRegistryNodes.ts +11 -11
- package/src/fetchCurrentGeoInfo.ts +6 -6
- package/src/fetchRelatedPullWithComments.ts +15 -15
- package/src/fetchRepoDescriptionMap.ts +15 -15
- package/src/followRuleSchema.ts +76 -76
- package/src/getActivatedShell.ts +18 -18
- package/src/getBranchWorkingDir.ts +16 -16
- package/src/getRepoWorkingDir.ts +5 -5
- package/src/ghUser.ts +6 -6
- package/src/index.ts +22 -21
- package/src/initializeFollowRules.ts +26 -26
- package/src/makePublishBranch.ts +58 -58
- package/src/makeTomlBranch.ts +53 -53
- package/src/matchRelatedPulls.ts +60 -60
- package/src/muteInstances.ts +16 -16
- package/src/parseIssueUrl.ts +6 -6
- package/src/parseOwnerRepo.ts +33 -33
- package/src/parsePullUrl.ts +6 -6
- package/src/parsePullsState.ts +6 -6
- package/src/parseTitleBodyOfMarkdown.ts +8 -8
- package/src/postSlackMessage.ts +21 -21
- package/src/preload.ts +30 -30
- package/src/pullStatusFollowSchema.ts +12 -12
- package/src/readTemplateTitle.ts +11 -11
- package/src/showFollowRuleSet.ts +12 -0
- package/src/summaryLastPullComment.ts +8 -8
- package/src/tomlFillDescription.ts +17 -17
- package/src/updateAuthors.ts +7 -0
- package/src/updateAuthorsForGithub.ts +50 -0
- package/src/updateAuthorsFromCNRepo.ts +30 -0
- package/src/updateCMNodesDuplicationWarnings.ts +56 -56
- package/src/updateCMRepos.ts +27 -27
- package/src/updateCNRepos.ts +58 -58
- package/src/updateCNReposCRPullsComments.ts +40 -40
- package/src/updateCNReposInfo.ts +57 -57
- package/src/updateCNReposPRCandidate.ts +85 -85
- package/src/updateCNReposPulls.ts +28 -28
- package/src/updateCNReposPullsDashboard.ts +49 -49
- package/src/updateCNReposRelatedPulls.ts +25 -25
- package/src/updateCRNodes.ts +50 -50
- package/src/updateCRRepos.ts +26 -26
- package/src/updateComfyTotals.ts +43 -43
- package/src/updateFollowRuleSet.ts +127 -182
- package/src/updateOutdatedPullsTemplates.ts +160 -156
- package/src/updateSlackMessages.ts +43 -43
- package/tailwind.config.ts +20 -20
- package/CHANGELOG.md +0 -118
package/README.md
CHANGED
|
@@ -1,225 +1,225 @@
|
|
|
1
|
-
# Comfy-PR
|
|
2
|
-
|
|
3
|
-
Make PRs that publishes ComfyUI Custom Nodes to [ComfyUI Registry](https://www.comfyregistry.org/).
|
|
4
|
-
|
|
5
|
-
## Project Goals: (aka roadmap)
|
|
6
|
-
|
|
7
|
-
### Cli usage:
|
|
8
|
-
|
|
9
|
-
- [x] fork repo
|
|
10
|
-
- [x] clone repo locally
|
|
11
|
-
- [x] create pyproject branch, run comfy node init . Push branch.
|
|
12
|
-
- [x] create publish branch, create in a Github workflow file. Push branch.
|
|
13
|
-
- [x] create PR to original repository with template PR description.
|
|
14
|
-
- [x] Submit PR
|
|
15
|
-
- [x] Clean local debris before clone
|
|
16
|
-
- [/] DOING: Export PR status into csv for @haohao
|
|
17
|
-
|
|
18
|
-
### Github Actions Worker
|
|
19
|
-
|
|
20
|
-
- [x] Fetch repos from CM & CR list
|
|
21
|
-
- [x] Make diff
|
|
22
|
-
- [x] Notify to slack channel
|
|
23
|
-
- [x] Fetch repo status (private or archived or ...)
|
|
24
|
-
- [x] Fetch pr status (open / merged / closed) + comments
|
|
25
|
-
- [x] Fetch pr comments
|
|
26
|
-
- [x] Automaticaly find candidates, and do the cli does
|
|
27
|
-
- [x] Mention related prs in dashboard https://github.com/drip-art/Comfy-Registry-PR/issues/1
|
|
28
|
-
- [x] Analyze Totals
|
|
29
|
-
- [ ] Follow-up prs by state
|
|
30
|
-
- [ ] Issues Comment
|
|
31
|
-
- [ ] Slack
|
|
32
|
-
- [ ] Email
|
|
33
|
-
- [ ] Delete the forked repo which is Merged
|
|
34
|
-
|
|
35
|
-
### Web Site https://comfy-pr.vercel.app
|
|
36
|
-
|
|
37
|
-
- [x] A dashboard csv/yaml exporter site for @haohao
|
|
38
|
-
- [ ]
|
|
39
|
-
|
|
40
|
-
## Usages
|
|
41
|
-
|
|
42
|
-
### CLI Usage: Get Started by
|
|
43
|
-
|
|
44
|
-
```
|
|
45
|
-
bunx comfy-pr [...GITHUB_REPO_URLS]
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
### 1. Setup Envs
|
|
49
|
-
|
|
50
|
-
A demo .env should be sth like:
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
# your github token
|
|
54
|
-
GH_TOKEN=ghp_WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
|
|
55
|
-
|
|
56
|
-
# the pr source organization/ leave it blank to use yourself's account.
|
|
57
|
-
FORK_OWNER="ComfyNodePRs"
|
|
58
|
-
|
|
59
|
-
# PR prefix
|
|
60
|
-
FORK_PREFIX="PR-"
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
#### Github API Token (GH_TOKEN)
|
|
64
|
-
|
|
65
|
-
GO https://github.com/settings/tokens?type=beta to get an Github Access key
|
|
66
|
-
|
|
67
|
-
Check 3 permissions for all of your repositories
|
|
68
|
-
|
|
69
|
-
- Pull requests Access: Read and write
|
|
70
|
-
- Workflows Access: Read and write
|
|
71
|
-
- Metadata Access: Read-only
|
|
72
|
-
|
|
73
|
-
And save your GH_TOKEN into .env file
|
|
74
|
-
|
|
75
|
-
#### Github SSH Key (.ssh/id_rsa, .ssh/id_rsa.pub)
|
|
76
|
-
|
|
77
|
-
Must provide to push code automaticaly, btw prob. you've already setup.
|
|
78
|
-
|
|
79
|
-
Run `ssh-keygen`, got `id_rsa.pub`, Then add into here https://github.com/settings/keys
|
|
80
|
-
|
|
81
|
-
### 2. Run!
|
|
82
|
-
|
|
83
|
-
Ways to run this script
|
|
84
|
-
|
|
85
|
-
1. Local run
|
|
86
|
-
2. Docker run (also local)
|
|
87
|
-
3. Docker run at cloud (TODO)
|
|
88
|
-
|
|
89
|
-
#### 1. Launch by Docker Compose
|
|
90
|
-
|
|
91
|
-
After configured your .env file, run docker compose build and up.
|
|
92
|
-
|
|
93
|
-
```sh
|
|
94
|
-
git clone https://github.com/drip-art/Comfy-Registry-PR
|
|
95
|
-
cd Comfy-Registry-PR
|
|
96
|
-
docker compose build
|
|
97
|
-
docker compose up
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
#### 2. Docker usage (not stable)
|
|
101
|
-
|
|
102
|
-
```sh
|
|
103
|
-
docker run --rm -it \
|
|
104
|
-
-v $HOME/.ssh:/root/.ssh:ro \
|
|
105
|
-
-e GH_TOKEN=ghp_WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \
|
|
106
|
-
-e REPO=https://github.com/snomiao/ComfyNode-Registry-test \
|
|
107
|
-
snomiao/comfy-registry-pr
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
#### 3. Run native in Unix/Linux/MacOS/WSL
|
|
111
|
-
|
|
112
|
-
```sh
|
|
113
|
-
git clone https://github.com/drip-art/Comfy-Registry-PR
|
|
114
|
-
|
|
115
|
-
# setup comfy-cli environment
|
|
116
|
-
cd Comfy-Registry-PR
|
|
117
|
-
python3 -m venv .venv
|
|
118
|
-
chmod +x ./.venv/bin/*
|
|
119
|
-
source ./.venv/bin/activate
|
|
120
|
-
pip3 install comfy-cli
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# setup bun for js-script
|
|
125
|
-
curl -fsSL https://bun.sh/install | bash
|
|
126
|
-
bun i
|
|
127
|
-
|
|
128
|
-
# and
|
|
129
|
-
bun src/cli.ts [REPO_PATH_NEED_TO_PR]
|
|
130
|
-
# for example
|
|
131
|
-
bun src/cli.ts https://github.com/snomiao/ComfyNode-Registry-test
|
|
132
|
-
|
|
133
|
-
```
|
|
134
|
-
|
|
135
|
-
#### 4. Run natively in Windows
|
|
136
|
-
|
|
137
|
-
```bat
|
|
138
|
-
|
|
139
|
-
git clone https://github.com/drip-art/Comfy-Registry-PR
|
|
140
|
-
|
|
141
|
-
@REM setup comfy-cli environment
|
|
142
|
-
cd Comfy-Registry-PR
|
|
143
|
-
python3 -m venv .venv
|
|
144
|
-
.\.venv\Scripts\activate
|
|
145
|
-
pip3 install comfy-cli
|
|
146
|
-
|
|
147
|
-
@REM run with tsx
|
|
148
|
-
npx -y cross-env REPO=https://github.com/snomiao/ComfyNode-Registry-test npx -y tsx src/cli.ts
|
|
149
|
-
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
#### Other Configurations in dockerfile
|
|
153
|
-
|
|
154
|
-
Don't change it unless you know what you are doing.
|
|
155
|
-
|
|
156
|
-
```dockerfile
|
|
157
|
-
|
|
158
|
-
ENV FORK_OWNER=drip-art
|
|
159
|
-
ENV FORK_PREFIX=PR-
|
|
160
|
-
|
|
161
|
-
# Unset it into current authorized user's name and email (from your github api token).
|
|
162
|
-
ENV GIT_USEREMAIL=comfy-ci@drip.art
|
|
163
|
-
ENV GIT_USERNAME=comfy-ci
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Development
|
|
167
|
-
|
|
168
|
-
### Cli
|
|
169
|
-
|
|
170
|
-
```sh
|
|
171
|
-
# Create comfy pr dir and go into it
|
|
172
|
-
mkdir comfy-pr
|
|
173
|
-
cd comfy-pr
|
|
174
|
-
|
|
175
|
-
# Prepare code and environments
|
|
176
|
-
git clone https://github.com/drip-art/Comfy-Registry-PR .
|
|
177
|
-
|
|
178
|
-
# Prepare bun
|
|
179
|
-
# go here - [Installation \| Bun Docs]( https://bun.sh/docs/installation )
|
|
180
|
-
|
|
181
|
-
# Install project
|
|
182
|
-
bun i
|
|
183
|
-
|
|
184
|
-
# Prepare bun
|
|
185
|
-
bun i
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Github Action Worker & server
|
|
189
|
-
|
|
190
|
-
1. Setup envs in the usages section above (plz check bun src/cli.ts runnable first)
|
|
191
|
-
|
|
192
|
-
2. Run mongodb with docker compose
|
|
193
|
-
|
|
194
|
-
```sh
|
|
195
|
-
docker compose -f docker-compose.mongodb.yml up
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
```yaml
|
|
199
|
-
services:
|
|
200
|
-
mongdb:
|
|
201
|
-
restart: always
|
|
202
|
-
image: mongo
|
|
203
|
-
ports: ["27017:27017"]
|
|
204
|
-
volumes: [./data/mongodb:/data/db]
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
And fill URI into env
|
|
208
|
-
|
|
209
|
-
```env
|
|
210
|
-
MONGODB_URI=mongodb://localhost:27017
|
|
211
|
-
```
|
|
212
|
-
|
|
213
|
-
3. Play with codes...
|
|
214
|
-
|
|
215
|
-
```sh
|
|
216
|
-
# To initialize your database, run:
|
|
217
|
-
bun src/index.ts
|
|
218
|
-
|
|
219
|
-
# To start develop in any of other scripts:
|
|
220
|
-
# Feel free to run any scripts in src/, they are safe to re-run and stop in any time.
|
|
221
|
-
bun src/THAT_FILE_YOU_WANT_TO_RUN.ts
|
|
222
|
-
|
|
223
|
-
# To check if you didn't break anything?
|
|
224
|
-
bun test --watch
|
|
225
|
-
```
|
|
1
|
+
# Comfy-PR
|
|
2
|
+
|
|
3
|
+
Make PRs that publishes ComfyUI Custom Nodes to [ComfyUI Registry](https://www.comfyregistry.org/).
|
|
4
|
+
|
|
5
|
+
## Project Goals: (aka roadmap)
|
|
6
|
+
|
|
7
|
+
### Cli usage:
|
|
8
|
+
|
|
9
|
+
- [x] fork repo
|
|
10
|
+
- [x] clone repo locally
|
|
11
|
+
- [x] create pyproject branch, run comfy node init . Push branch.
|
|
12
|
+
- [x] create publish branch, create in a Github workflow file. Push branch.
|
|
13
|
+
- [x] create PR to original repository with template PR description.
|
|
14
|
+
- [x] Submit PR
|
|
15
|
+
- [x] Clean local debris before clone
|
|
16
|
+
- [/] DOING: Export PR status into csv for @haohao
|
|
17
|
+
|
|
18
|
+
### Github Actions Worker
|
|
19
|
+
|
|
20
|
+
- [x] Fetch repos from CM & CR list
|
|
21
|
+
- [x] Make diff
|
|
22
|
+
- [x] Notify to slack channel
|
|
23
|
+
- [x] Fetch repo status (private or archived or ...)
|
|
24
|
+
- [x] Fetch pr status (open / merged / closed) + comments
|
|
25
|
+
- [x] Fetch pr comments
|
|
26
|
+
- [x] Automaticaly find candidates, and do the cli does
|
|
27
|
+
- [x] Mention related prs in dashboard https://github.com/drip-art/Comfy-Registry-PR/issues/1
|
|
28
|
+
- [x] Analyze Totals
|
|
29
|
+
- [ ] Follow-up prs by state
|
|
30
|
+
- [ ] Issues Comment
|
|
31
|
+
- [ ] Slack
|
|
32
|
+
- [ ] Email
|
|
33
|
+
- [ ] Delete the forked repo which is Merged
|
|
34
|
+
|
|
35
|
+
### Web Site https://comfy-pr.vercel.app
|
|
36
|
+
|
|
37
|
+
- [x] A dashboard csv/yaml exporter site for @haohao
|
|
38
|
+
- [ ]
|
|
39
|
+
|
|
40
|
+
## Usages
|
|
41
|
+
|
|
42
|
+
### CLI Usage: Get Started by
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
bunx comfy-pr [...GITHUB_REPO_URLS]
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### 1. Setup Envs
|
|
49
|
+
|
|
50
|
+
A demo .env should be sth like:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
# your github token
|
|
54
|
+
GH_TOKEN=ghp_WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
|
|
55
|
+
|
|
56
|
+
# the pr source organization/ leave it blank to use yourself's account.
|
|
57
|
+
FORK_OWNER="ComfyNodePRs"
|
|
58
|
+
|
|
59
|
+
# PR prefix
|
|
60
|
+
FORK_PREFIX="PR-"
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
#### Github API Token (GH_TOKEN)
|
|
64
|
+
|
|
65
|
+
GO https://github.com/settings/tokens?type=beta to get an Github Access key
|
|
66
|
+
|
|
67
|
+
Check 3 permissions for all of your repositories
|
|
68
|
+
|
|
69
|
+
- Pull requests Access: Read and write
|
|
70
|
+
- Workflows Access: Read and write
|
|
71
|
+
- Metadata Access: Read-only
|
|
72
|
+
|
|
73
|
+
And save your GH_TOKEN into .env file
|
|
74
|
+
|
|
75
|
+
#### Github SSH Key (.ssh/id_rsa, .ssh/id_rsa.pub)
|
|
76
|
+
|
|
77
|
+
Must provide to push code automaticaly, btw prob. you've already setup.
|
|
78
|
+
|
|
79
|
+
Run `ssh-keygen`, got `id_rsa.pub`, Then add into here https://github.com/settings/keys
|
|
80
|
+
|
|
81
|
+
### 2. Run!
|
|
82
|
+
|
|
83
|
+
Ways to run this script
|
|
84
|
+
|
|
85
|
+
1. Local run
|
|
86
|
+
2. Docker run (also local)
|
|
87
|
+
3. Docker run at cloud (TODO)
|
|
88
|
+
|
|
89
|
+
#### 1. Launch by Docker Compose
|
|
90
|
+
|
|
91
|
+
After configured your .env file, run docker compose build and up.
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
git clone https://github.com/drip-art/Comfy-Registry-PR
|
|
95
|
+
cd Comfy-Registry-PR
|
|
96
|
+
docker compose build
|
|
97
|
+
docker compose up
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### 2. Docker usage (not stable)
|
|
101
|
+
|
|
102
|
+
```sh
|
|
103
|
+
docker run --rm -it \
|
|
104
|
+
-v $HOME/.ssh:/root/.ssh:ro \
|
|
105
|
+
-e GH_TOKEN=ghp_WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW \
|
|
106
|
+
-e REPO=https://github.com/snomiao/ComfyNode-Registry-test \
|
|
107
|
+
snomiao/comfy-registry-pr
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### 3. Run native in Unix/Linux/MacOS/WSL
|
|
111
|
+
|
|
112
|
+
```sh
|
|
113
|
+
git clone https://github.com/drip-art/Comfy-Registry-PR
|
|
114
|
+
|
|
115
|
+
# setup comfy-cli environment
|
|
116
|
+
cd Comfy-Registry-PR
|
|
117
|
+
python3 -m venv .venv
|
|
118
|
+
chmod +x ./.venv/bin/*
|
|
119
|
+
source ./.venv/bin/activate
|
|
120
|
+
pip3 install comfy-cli
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
# setup bun for js-script
|
|
125
|
+
curl -fsSL https://bun.sh/install | bash
|
|
126
|
+
bun i
|
|
127
|
+
|
|
128
|
+
# and
|
|
129
|
+
bun src/cli.ts [REPO_PATH_NEED_TO_PR]
|
|
130
|
+
# for example
|
|
131
|
+
bun src/cli.ts https://github.com/snomiao/ComfyNode-Registry-test
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### 4. Run natively in Windows
|
|
136
|
+
|
|
137
|
+
```bat
|
|
138
|
+
|
|
139
|
+
git clone https://github.com/drip-art/Comfy-Registry-PR
|
|
140
|
+
|
|
141
|
+
@REM setup comfy-cli environment
|
|
142
|
+
cd Comfy-Registry-PR
|
|
143
|
+
python3 -m venv .venv
|
|
144
|
+
.\.venv\Scripts\activate
|
|
145
|
+
pip3 install comfy-cli
|
|
146
|
+
|
|
147
|
+
@REM run with tsx
|
|
148
|
+
npx -y cross-env REPO=https://github.com/snomiao/ComfyNode-Registry-test npx -y tsx src/cli.ts
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
#### Other Configurations in dockerfile
|
|
153
|
+
|
|
154
|
+
Don't change it unless you know what you are doing.
|
|
155
|
+
|
|
156
|
+
```dockerfile
|
|
157
|
+
|
|
158
|
+
ENV FORK_OWNER=drip-art
|
|
159
|
+
ENV FORK_PREFIX=PR-
|
|
160
|
+
|
|
161
|
+
# Unset it into current authorized user's name and email (from your github api token).
|
|
162
|
+
ENV GIT_USEREMAIL=comfy-ci@drip.art
|
|
163
|
+
ENV GIT_USERNAME=comfy-ci
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
## Development
|
|
167
|
+
|
|
168
|
+
### Cli
|
|
169
|
+
|
|
170
|
+
```sh
|
|
171
|
+
# Create comfy pr dir and go into it
|
|
172
|
+
mkdir comfy-pr
|
|
173
|
+
cd comfy-pr
|
|
174
|
+
|
|
175
|
+
# Prepare code and environments
|
|
176
|
+
git clone https://github.com/drip-art/Comfy-Registry-PR .
|
|
177
|
+
|
|
178
|
+
# Prepare bun
|
|
179
|
+
# go here - [Installation \| Bun Docs]( https://bun.sh/docs/installation )
|
|
180
|
+
|
|
181
|
+
# Install project
|
|
182
|
+
bun i
|
|
183
|
+
|
|
184
|
+
# Prepare bun
|
|
185
|
+
bun i
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### Github Action Worker & server
|
|
189
|
+
|
|
190
|
+
1. Setup envs in the usages section above (plz check bun src/cli.ts runnable first)
|
|
191
|
+
|
|
192
|
+
2. Run mongodb with docker compose
|
|
193
|
+
|
|
194
|
+
```sh
|
|
195
|
+
docker compose -f docker-compose.mongodb.yml up
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
```yaml
|
|
199
|
+
services:
|
|
200
|
+
mongdb:
|
|
201
|
+
restart: always
|
|
202
|
+
image: mongo
|
|
203
|
+
ports: ["27017:27017"]
|
|
204
|
+
volumes: [./data/mongodb:/data/db]
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
And fill URI into env
|
|
208
|
+
|
|
209
|
+
```env
|
|
210
|
+
MONGODB_URI=mongodb://localhost:27017
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
3. Play with codes...
|
|
214
|
+
|
|
215
|
+
```sh
|
|
216
|
+
# To initialize your database, run:
|
|
217
|
+
bun src/index.ts
|
|
218
|
+
|
|
219
|
+
# To start develop in any of other scripts:
|
|
220
|
+
# Feel free to run any scripts in src/, they are safe to re-run and stop in any time.
|
|
221
|
+
bun src/THAT_FILE_YOU_WANT_TO_RUN.ts
|
|
222
|
+
|
|
223
|
+
# To check if you didn't break anything?
|
|
224
|
+
bun test --watch
|
|
225
|
+
```
|
package/next-env.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/// <reference types="next" />
|
|
2
|
-
/// <reference types="next/image-types/global" />
|
|
3
|
-
|
|
4
|
-
// NOTE: This file should not be edited
|
|
5
|
-
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
1
|
+
/// <reference types="next" />
|
|
2
|
+
/// <reference types="next/image-types/global" />
|
|
3
|
+
|
|
4
|
+
// NOTE: This file should not be edited
|
|
5
|
+
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "comfy-pr",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.24",
|
|
4
4
|
"description": "Make PRs that publishes ComfyUI Custom Nodes to [ComfyUI Registry]( https://www.comfyregistry.org/ ).",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"license": "ISC",
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
],
|
|
22
22
|
"scripts": {
|
|
23
23
|
"_postinstall": "bun ./src/muteInstances.ts",
|
|
24
|
+
"vercel:dev": "vercel dev",
|
|
25
|
+
"vercel:build": "vercel build",
|
|
24
26
|
"build": "next build",
|
|
25
27
|
"dev": "next dev",
|
|
26
28
|
"lint": "next lint",
|
|
@@ -34,13 +36,15 @@
|
|
|
34
36
|
"@ctrl/mac-address": "^3.0.3",
|
|
35
37
|
"@monaco-editor/react": "^4.6.0",
|
|
36
38
|
"@slack/web-api": "^7.2.0",
|
|
37
|
-
"@snomiao/die": "^1.0
|
|
39
|
+
"@snomiao/die": "^1.1.0",
|
|
38
40
|
"@trpc/server": "^10.45.2",
|
|
39
41
|
"@types/d3": "^7.4.3",
|
|
42
|
+
"@types/file-saver": "^2.0.7",
|
|
40
43
|
"d3": "^7.9.0",
|
|
41
44
|
"daisyui": "^4.12.7",
|
|
42
45
|
"dotenv": "^16.4.5",
|
|
43
46
|
"enhanced-ms": "^3.0.0",
|
|
47
|
+
"file-saver": "^2.0.5",
|
|
44
48
|
"globby": "^14.0.1",
|
|
45
49
|
"js-yaml": "^4.1.0",
|
|
46
50
|
"json-stable-stringify": "^1.1.1",
|
|
@@ -62,10 +66,14 @@
|
|
|
62
66
|
"react-api-doc": "^0.0.9",
|
|
63
67
|
"react-hook-form": "^7.52.0",
|
|
64
68
|
"react-markdown": "^9.0.1",
|
|
69
|
+
"snoflow": "^1.6.0",
|
|
70
|
+
"sparse-bitfield": "^3.0.3",
|
|
65
71
|
"toml": "^3.0.0",
|
|
66
72
|
"trpc-openapi": "^1.2.0",
|
|
67
73
|
"ts-pattern": "^5.2.0",
|
|
74
|
+
"unwind-array": "^1.1.4",
|
|
68
75
|
"use-swr-component": "^0.0.5",
|
|
76
|
+
"vercel": "^34.3.0",
|
|
69
77
|
"yaml": "^2.4.5",
|
|
70
78
|
"zod": "^3.23.8",
|
|
71
79
|
"zx": "^8.1.3"
|
package/src/Authors.ts
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Task } from "@/packages/mongodb-pipeline-ts/Task";
|
|
2
|
+
import console from "console";
|
|
3
|
+
import { db } from "./db";
|
|
4
|
+
import { gh } from "./gh";
|
|
5
|
+
import type { AwaitedReturnType } from "./types/AwaitedReturnType";
|
|
6
|
+
import { updateAuthors } from "./updateAuthors";
|
|
7
|
+
export type Author = {
|
|
8
|
+
email?: string;
|
|
9
|
+
// cold down
|
|
10
|
+
githubMtime?: Date;
|
|
11
|
+
instagramMtime?: Date;
|
|
12
|
+
discordMtime?: Date;
|
|
13
|
+
twitterMtime?: Date;
|
|
14
|
+
|
|
15
|
+
// id
|
|
16
|
+
githubId?: string;
|
|
17
|
+
instagramId?: string;
|
|
18
|
+
discordId?: string;
|
|
19
|
+
twitterId?: string;
|
|
20
|
+
|
|
21
|
+
// repos on cm and cr
|
|
22
|
+
cm: number; // comfy node manager
|
|
23
|
+
cr: number; // comfy registry
|
|
24
|
+
|
|
25
|
+
// common info
|
|
26
|
+
nicknames?: string[];
|
|
27
|
+
bios?: string[];
|
|
28
|
+
links?: string[]; // one could be url or markdown style link: [name](link)
|
|
29
|
+
blogs?: string[]; // one could be url or markdown style link: [name](link)
|
|
30
|
+
companies?: string[];
|
|
31
|
+
locations?: string[];
|
|
32
|
+
avatars?: string[];
|
|
33
|
+
hireable?: boolean; // github
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Authors = db.collection<Author>("Authors");
|
|
37
|
+
await Authors.createIndex('githubId')
|
|
38
|
+
await Authors.createIndex('email')
|
|
39
|
+
export const GithubUsers = db.collection<
|
|
40
|
+
{ username: string } & Task<AwaitedReturnType<typeof gh.users.getByUsername>["data"]>
|
|
41
|
+
>("GithubUsers");
|
|
42
|
+
|
|
43
|
+
if (import.meta.main) {
|
|
44
|
+
// collect github id from cn repos
|
|
45
|
+
await updateAuthors();
|
|
46
|
+
console.log("done");
|
|
47
|
+
}
|
|
48
|
+
|
package/src/CMNodes.ts
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
import jsonStableStringify from "json-stable-stringify";
|
|
2
|
-
import md5 from "md5";
|
|
3
|
-
import type { ObjectId } from "mongodb";
|
|
4
|
-
import { db } from "./db";
|
|
5
|
-
import { fetchCMNodes } from "./fetchCMNodes";
|
|
6
|
-
import { type SlackMsg } from "./slack/SlackMsgs";
|
|
7
|
-
import { updateCMNodesDuplicationWarnings } from "./updateCMNodesDuplicationWarnings";
|
|
8
|
-
|
|
9
|
-
// Raw version maybe duplicated with id or reference
|
|
10
|
-
type CMNodeRaw = Awaited<ReturnType<typeof fetchCMNodesWithHash>>[number];
|
|
11
|
-
export type CMNode = CMNodeRaw & {
|
|
12
|
-
repo_id?: ObjectId;
|
|
13
|
-
duplicated?: {
|
|
14
|
-
[k: string]: { hashes: string[]; slackNotification: SlackMsg };
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export const CMNodes = db.collection<CMNode>("CMNodes");
|
|
18
|
-
await CMNodes.createIndex({ mtime: -1 });
|
|
19
|
-
await CMNodes.createIndex({ hash: 1 }, { unique: true }).catch(() => {});
|
|
20
|
-
|
|
21
|
-
if (import.meta.main) {
|
|
22
|
-
console.time("CMNodes");
|
|
23
|
-
console.log(await updateCMNodes());
|
|
24
|
-
// check dups
|
|
25
|
-
console.timeLog("CMNodes");
|
|
26
|
-
const all = await CMNodes.countDocuments({});
|
|
27
|
-
console.timeLog("CMNodes");
|
|
28
|
-
const dups = await CMNodes.countDocuments({ duplicated: { $exists: true } });
|
|
29
|
-
console.timeEnd("CMNodes");
|
|
30
|
-
console.log("CMNodes updated, duplicates:", dups, "all:", all);
|
|
31
|
-
}
|
|
32
|
-
export async function updateCMNodes() {
|
|
33
|
-
const nodes = await fetchCMNodesWithHash();
|
|
34
|
-
console.log("CMNodes updating (" + nodes.length + " nodes)");
|
|
35
|
-
|
|
36
|
-
// updating nodes
|
|
37
|
-
const updateResult = await CMNodes.bulkWrite(
|
|
38
|
-
nodes.flatMap((node) => ({
|
|
39
|
-
updateOne: {
|
|
40
|
-
filter: { hash: node.hash },
|
|
41
|
-
update: { $set: node },
|
|
42
|
-
upsert: true,
|
|
43
|
-
},
|
|
44
|
-
})),
|
|
45
|
-
{ ordered: false },
|
|
46
|
-
);
|
|
47
|
-
// delete outdated
|
|
48
|
-
// await CMNodes.deleteMany({ hash: { $nin: nodes.map(prop("hash")) } });
|
|
49
|
-
|
|
50
|
-
await updateCMNodesDuplicationWarnings(nodes);
|
|
51
|
-
|
|
52
|
-
return [updateResult];
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function fetchCMNodesWithHash() {
|
|
56
|
-
return (await fetchCMNodes()).map((e) => ({
|
|
57
|
-
...e,
|
|
58
|
-
hash: md5("SALT=Bvxmh8mGYh6qzLGE " + jsonStableStringify(e)),
|
|
59
|
-
}));
|
|
60
|
-
}
|
|
1
|
+
import jsonStableStringify from "json-stable-stringify";
|
|
2
|
+
import md5 from "md5";
|
|
3
|
+
import type { ObjectId } from "mongodb";
|
|
4
|
+
import { db } from "./db";
|
|
5
|
+
import { fetchCMNodes } from "./fetchCMNodes";
|
|
6
|
+
import { type SlackMsg } from "./slack/SlackMsgs";
|
|
7
|
+
import { updateCMNodesDuplicationWarnings } from "./updateCMNodesDuplicationWarnings";
|
|
8
|
+
|
|
9
|
+
// Raw version maybe duplicated with id or reference
|
|
10
|
+
type CMNodeRaw = Awaited<ReturnType<typeof fetchCMNodesWithHash>>[number];
|
|
11
|
+
export type CMNode = CMNodeRaw & {
|
|
12
|
+
repo_id?: ObjectId;
|
|
13
|
+
duplicated?: {
|
|
14
|
+
[k: string]: { hashes: string[]; slackNotification: SlackMsg };
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export const CMNodes = db.collection<CMNode>("CMNodes");
|
|
18
|
+
await CMNodes.createIndex({ mtime: -1 });
|
|
19
|
+
await CMNodes.createIndex({ hash: 1 }, { unique: true }).catch(() => {});
|
|
20
|
+
|
|
21
|
+
if (import.meta.main) {
|
|
22
|
+
console.time("CMNodes");
|
|
23
|
+
console.log(await updateCMNodes());
|
|
24
|
+
// check dups
|
|
25
|
+
console.timeLog("CMNodes");
|
|
26
|
+
const all = await CMNodes.countDocuments({});
|
|
27
|
+
console.timeLog("CMNodes");
|
|
28
|
+
const dups = await CMNodes.countDocuments({ duplicated: { $exists: true } });
|
|
29
|
+
console.timeEnd("CMNodes");
|
|
30
|
+
console.log("CMNodes updated, duplicates:", dups, "all:", all);
|
|
31
|
+
}
|
|
32
|
+
export async function updateCMNodes() {
|
|
33
|
+
const nodes = await fetchCMNodesWithHash();
|
|
34
|
+
console.log("CMNodes updating (" + nodes.length + " nodes)");
|
|
35
|
+
|
|
36
|
+
// updating nodes
|
|
37
|
+
const updateResult = await CMNodes.bulkWrite(
|
|
38
|
+
nodes.flatMap((node) => ({
|
|
39
|
+
updateOne: {
|
|
40
|
+
filter: { hash: node.hash },
|
|
41
|
+
update: { $set: node },
|
|
42
|
+
upsert: true,
|
|
43
|
+
},
|
|
44
|
+
})),
|
|
45
|
+
{ ordered: false },
|
|
46
|
+
);
|
|
47
|
+
// delete outdated
|
|
48
|
+
// await CMNodes.deleteMany({ hash: { $nin: nodes.map(prop("hash")) } });
|
|
49
|
+
|
|
50
|
+
await updateCMNodesDuplicationWarnings(nodes);
|
|
51
|
+
|
|
52
|
+
return [updateResult];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function fetchCMNodesWithHash() {
|
|
56
|
+
return (await fetchCMNodes()).map((e) => ({
|
|
57
|
+
...e,
|
|
58
|
+
hash: md5("SALT=Bvxmh8mGYh6qzLGE " + jsonStableStringify(e)),
|
|
59
|
+
}));
|
|
60
|
+
}
|