Skip to content

Commit 2929806

Browse files
committed
feat: Add script to enhance TypeDoc-generated Markdown files with Just the Docs frontmatter
fix: Update manual-publish script to handle errors during git push feat: Create a new script for publishing canonical packages refactor: Improve publish script to handle versioning and release branches chore: Update rc.js to manage exports in package.json for new components feat: Implement rebranding script enhancements for project title and package name chore: Add component template for React components without SCSS chore: Update update-pm script to ensure pnpm is up to date fix: Enhance update-security-md script to handle errors gracefully chore: Create upgrade script to manage dependencies and devDependencies chore: Simplify turbo.json task dependencies chore: Update typedoc configuration for improved documentation generation
1 parent 733ff75 commit 2929806

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+3853
-851
lines changed

.github/workflows/docs.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,35 @@
1-
name: Update dependencies and Docs
1+
name: Generate Docs
22

33
on:
44
push:
55
branches: [main]
6-
schedule:
7-
- cron: "0 */8 * * *"
6+
workflow_dispatch:
7+
88
jobs:
99
generate-docs:
10-
if: github.event.repository.owner.login == 'react18-tools'
10+
if: github.run_number != 1 && github.event.repository.owner.login == 'react18-tools'
1111
runs-on: ubuntu-latest
1212
permissions:
1313
contents: write
1414
steps:
1515
- uses: actions/checkout@v4
1616
with:
1717
token: ${{ secrets.GITHUB_TOKEN }}
18+
ref: ${{ github.event.before }}
19+
20+
- name: Check if package.json was modified
21+
id: pub
22+
run: |
23+
git fetch origin main && git checkout main
24+
if git diff --name-only ${{ github.event.before }} HEAD | grep -q "lib/package.json"; then
25+
echo "file_changed=true" >> $GITHUB_ENV
26+
else
27+
echo "file_changed=false" >> $GITHUB_ENV
28+
fi
29+
30+
- name: Exit early if lib/package.json was modified
31+
if: env.file_changed == 'true'
32+
run: exit 1
1833

1934
- uses: actions/setup-node@v4
2035
with:

.github/workflows/manual-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
# fail and not publish if any of the unit tests are failing
3131
- name: Test
3232
run: pnpm test
33+
working-directory: ./lib
3334
- name: clean up working directory
3435
run: git status && git clean -f -d && git status
3536
- name: Copy Readme file

.github/workflows/publish.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
permissions:
1616
contents: write
1717
id-token: write
18+
actions: write
1819

1920
steps:
2021
- uses: actions/checkout@v4
@@ -44,3 +45,7 @@ jobs:
4445
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
4546
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4647
token: ${{ secrets.GITHUB_TOKEN }}
48+
- name: Run docs workflow as it will fail when trying to make parallel updates
49+
run: gh workflow run docs.yml
50+
env:
51+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,18 @@ jobs:
99
test:
1010
if: github.run_number != 1
1111
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
1214
steps:
1315
- uses: actions/checkout@v4
1416
- uses: actions/setup-node@v4
1517
with:
1618
node-version: 20
17-
- run: npm i -g pnpm && pnpm i
19+
- run: npm i -g pnpm && pnpm i --no-frozen-lockfile
1820
name: Install dependencies
1921
- name: Run unit tests
2022
run: pnpm test
23+
working-directory: ./lib
2124
- name: Upload coverage reports to Codecov
2225
continue-on-error: true
2326
uses: codecov/codecov-action@v4

.github/workflows/upgrade.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Update dependencies
2+
3+
on:
4+
schedule:
5+
- cron: "0 */8 * * *"
6+
jobs:
7+
update-deps:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
token: ${{ secrets.GITHUB_TOKEN }}
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
registry-url: https://registry.npmjs.org
19+
node-version: 20
20+
- name: Setup Git
21+
run: |
22+
git config --global user.name "mayank1513"
23+
git config --global user.email "[email protected]"
24+
git fetch
25+
git checkout main
26+
git pull
27+
- run: npm i -g pnpm && pnpm i --no-frozen-lockfile
28+
name: Install dependencies
29+
- run: git stash --include-untracked
30+
name: clean up working directory
31+
- run: pnpx @turbo/codemod update . && node ./scripts/upgrade.js
32+
name: Update dependencies
33+
- run: pnpm build --filter @example/nextjs
34+
name: Build all apps to make sure it is not broken due to dependency upgrades
35+
- name: Run unit tests
36+
run: cd lib && pnpm test
37+
- name: Save upgraded packages back to repo
38+
run: |
39+
echo "$(git rev-parse HEAD)" > .turborepo-template.lst
40+
echo $(date +%F_%H:%M:%S) > .lst && git add . && git commit -m "upgrade deps && docs [skip ci]" && git push origin main

.prettierignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,3 @@
22

33
# ignore hbs files as prettier removes all spaces and makes it ugly
44
*hbs
5-
docs
6-
.vscode

.turborepo-template.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
9960340d9b7fa816619bad41dd88a5a828099685

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["esbenp.prettier-vscode", "mayank1513.trello-kanban-task-board"]
2+
"recommendations": ["esbenp.prettier-vscode", "mayank1513.trello-kanban-task-board"]
33
}

.vscode/settings.json

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{
2-
// Formatting using Prettier by default for all languages
3-
"editor.defaultFormatter": "esbenp.prettier-vscode",
2+
// Formatting using Prettier by default for all languages
3+
"editor.defaultFormatter": "esbenp.prettier-vscode",
44

5-
// Ensure enough terminal history is preserved when running tests.
6-
"terminal.integrated.scrollback": 10000,
5+
// Ensure enough terminal history is preserved when running tests.
6+
"terminal.integrated.scrollback": 10000,
77

8-
// Disable TypeScript surveys.
9-
"typescript.surveys.enabled": false,
8+
// Disable TypeScript surveys.
9+
"typescript.surveys.enabled": false,
1010

11-
"editor.tabSize": 2,
12-
"editor.wordWrap": "on",
13-
"editor.formatOnSave": true,
14-
"editor.formatOnPaste": true,
15-
"editor.formatOnSaveMode": "file",
16-
"mayank1513.trello-kanban.Workspace.filePath": ".tkb"
11+
"editor.tabSize": 2,
12+
"editor.wordWrap": "on",
13+
"editor.formatOnSave": true,
14+
"editor.formatOnPaste": true,
15+
"editor.formatOnSaveMode": "file",
16+
"mayank1513.trello-kanban.Workspace.filePath": ".tkb",
17+
"cSpell.words": ["noscss"]
1718
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ Without `resolvedTheme`, you would only know the theme is "system", not what it
124124

125125
This library is licensed under the MPL-2.0 open-source license.
126126

127-
> <img src="https://github.com/react18-tools/turborepo-template/blob/main/popper.png?raw=true" style="height: 20px"/> Please consider enrolling in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsoring](https://github.com/sponsors/mayank1513) our work.
127+
> <img src="https://raw.githubusercontent.com/mayank1513/mayank1513/main/popper.png" style="height: 20px"/> Enrolling in [our courses](https://mayank-chaudhari.vercel.app/courses) or [sponsor](https://github.com/sponsors/mayank1513) our work.
128128

129129
<hr />
130130

0 commit comments

Comments
 (0)