Skip to content

Commit 8d749d4

Browse files
committed
chore: minor adjustments
ci: update to checkout@v6 fix(ci): only update what's needed fix(sync:deps): allow existing deps to udpate fix(.npmrc): opt out of legacy deps chore: remove sync:mods script in package.json chore: update readme
1 parent 644a8b5 commit 8d749d4

6 files changed

Lines changed: 21 additions & 21 deletions

File tree

.github/workflows/sync.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ jobs:
2121

2222
steps:
2323
- name: Checkout
24-
uses: actions/checkout@v5
24+
uses: actions/checkout@v6
2525
with:
2626
submodules: recursive
2727
fetch-depth: 0
2828

2929
- name: Update submodule
30-
run: npm run sync:mods
30+
run: git submodule update --remote
3131

32-
- name: Check update
32+
- name: Check status
3333
id: check
3434
run: |
3535
if [[ -n "$(git status --porcelain)" ]]; then
@@ -38,13 +38,13 @@ jobs:
3838
echo "update=false" >> $GITHUB_OUTPUT
3939
fi
4040
41-
- name: Commit update
41+
- name: Commit changes
4242
if: steps.check.outputs.update == 'true'
4343
run: |
4444
git config user.name "github-actions[bot]"
4545
git config user.email "github-actions[bot]@users.noreply.github.com"
46-
git add .
47-
git commit -m "chore: sync with ejs"
46+
git add ejs
47+
git commit -m "chore(main): sync with ejs"
4848
git push origin main
4949
5050
update:
@@ -53,24 +53,24 @@ jobs:
5353
runs-on: ubuntu-latest
5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@v5
56+
uses: actions/checkout@v6
5757
with:
5858
submodules: recursive
5959
fetch-depth: 0
6060

6161
- name: Setup Node
6262
uses: actions/setup-node@v5
6363

64-
- name: Sync deps
64+
- name: Sync dependencies
6565
run: npm run sync:deps
6666

67-
- name: Commit deps
67+
- name: Commit changes
6868
run: |
6969
if [[ -n "$(git status --porcelain)" ]]; then
7070
git config user.name "github-actions[bot]"
7171
git config user.email "github-actions[bot]@users.noreply.github.com"
72-
git add .
73-
git commit -m "deps: sync with ejs"
72+
git add package.json
73+
git commit -m "chore(deps): sync with ejs"
7474
git push origin main
7575
else
7676
exit 0

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "ejs"]
22
path = ejs
33
url = https://github.com/yt-dlp/ejs
4+
branch = main

.npmrc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
package-lock = false
2-
legacy-peer-deps = true
1+
package-lock = false

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
## Setup
22

33
- Clone this repository
4-
- Run `npm run sync:mods` to bring submodules
4+
- Run `git config submodule.recurse true`
5+
- Run `git pull` to clone the ejs subdmodule
56
- Run `npm install` to install all dependencies
6-
- Configure the service in `.env` and run `npm start`
7+
- Configure the service in `.env`
78

89
## Maintain
910

10-
- Run `npm run sync:mods` to sync with ejs
11-
- Run `npm run sync:deps` to bring any new dependencies from ejs
11+
- A workflow keeps the branch up-to-date
12+
- You can run `git submodule update --remote` to update manually
13+
- Run `npm run sync:deps` after update to sync all dependencies
1214
- Run `npm run build` to build and ensure changes were compatible
13-
- The built file would be under `lib`
15+
- The built files would be under `lib`

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
"scripts": {
77
"build": "tsup",
88
"start": "node lib/index.js",
9-
"sync:deps": "node scripts/deps.js",
10-
"sync:mods": "git submodule update --init --remote --recursive --rebase"
9+
"sync:deps": "node scripts/deps.js"
1110
},
1211
"devDependencies": {
1312
"@types/express": "^5.0.3",

scripts/deps.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ const src = JSON.parse(readFileSync("package.json", "utf8"));
44
const ejs = JSON.parse(readFileSync("./ejs/package.json", "utf8"));
55

66
for (const dep in ejs.dependencies) {
7-
if (dep in src.dependencies) continue;
87
src.dependencies[dep] = ejs.dependencies[dep];
98
}
109

0 commit comments

Comments
 (0)