Skip to content

Commit 3d51ac0

Browse files
authored
Merge pull request #1 from trieb-work/feat-repo-name
feat: add repo starter command
2 parents d72b5a4 + 7c4e04e commit 3d51ac0

File tree

6 files changed

+50
-87
lines changed

6 files changed

+50
-87
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write # Grant write access to pull request comments
1416

1517
steps:
1618
- name: Checkout code

CHANGELOG.md

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +0,0 @@
1-
# 1.0.0 (2024-11-19)
2-
3-
4-
### Bug Fixes
5-
6-
* ci semantic release check ([df27fd8](https://github.com/trieb-work/next-optimized-redis-cache/commit/df27fd8228f95160603a000d917e1fa63a192319))
7-
* ci token ([6162dd9](https://github.com/trieb-work/next-optimized-redis-cache/commit/6162dd967386e6a55ee9cc909dd8c141cfa42018))
8-
* deps + fix: ci ([fe897c9](https://github.com/trieb-work/next-optimized-redis-cache/commit/fe897c931ba4fe1bcaec4ac4c1ebbbc81ca607a3))
9-
* deps + fix: ci ([eee7ca9](https://github.com/trieb-work/next-optimized-redis-cache/commit/eee7ca9b272aff595071084b812fcb0174caeee2))
10-
* git hooks ([69b1c2f](https://github.com/trieb-work/next-optimized-redis-cache/commit/69b1c2f922e85bd3ffeed42bc0e1be52c6fcf4e1))
11-
* move to dev packages ([e9c61c0](https://github.com/trieb-work/next-optimized-redis-cache/commit/e9c61c01ea092e55d47c559aafb2d29feaf89998))
12-
* public access ([cfe2845](https://github.com/trieb-work/next-optimized-redis-cache/commit/cfe2845b6e4a9b6f496a7d39f752b767c7670f93))
13-
* readme ([0129431](https://github.com/trieb-work/next-optimized-redis-cache/commit/0129431b40b017cab8f5192b1bffeae7d1bfa2be))
14-
* skip git setup in CI ([da64554](https://github.com/trieb-work/next-optimized-redis-cache/commit/da645547cef52b8d0a5cf59133d4184033c3ea60))
15-
16-
17-
### Features
18-
19-
* add coverage comment ([a2b8a18](https://github.com/trieb-work/next-optimized-redis-cache/commit/a2b8a18497e08790f3ebb8bb3f7f92b9de3690a5))
20-
* add coverage comment ([535c393](https://github.com/trieb-work/next-optimized-redis-cache/commit/535c393e20cbebec85d552eb9a7c3ca1346bdb4b))
21-
* add main protection ([e920d5d](https://github.com/trieb-work/next-optimized-redis-cache/commit/e920d5d4705118950830cd4fa9be4cdc033c07fb))
22-
* add vitest only to staged files ([f2f2156](https://github.com/trieb-work/next-optimized-redis-cache/commit/f2f2156e1b06679ed9d634545c958765e94e3b6c))
23-
* add vitest only to staged files ([5001642](https://github.com/trieb-work/next-optimized-redis-cache/commit/5001642c71a8f120cf78079cd954df37018cc2ec))
24-
* add vitest only to staged files ([02f83ee](https://github.com/trieb-work/next-optimized-redis-cache/commit/02f83ee1d4c53d8958d986aa43f8ce8b198971fe))
25-
* add vitest only to staged files ([9004ef7](https://github.com/trieb-work/next-optimized-redis-cache/commit/9004ef7f9fb6e244110bc8c5895de0aae9b8b965))
26-
* add vitest only to staged files ([b228ef1](https://github.com/trieb-work/next-optimized-redis-cache/commit/b228ef1f505f2253eb822cd3a68ec604eb7fac09))
27-
* add vitest only to staged files ([c246f10](https://github.com/trieb-work/next-optimized-redis-cache/commit/c246f1087f104f4080dd1ee59630c7db8180a71a))
28-
* add vitest only to staged files ([2353a2d](https://github.com/trieb-work/next-optimized-redis-cache/commit/2353a2ddce9973d390cb37c450faf7654804ac4f))
29-
* change to triebwork namespace ([7d6722f](https://github.com/trieb-work/next-optimized-redis-cache/commit/7d6722fa5668b41356721a4f18b1a03d0ebde992))
30-
* change to vitest + feat: add lint-staged ([d9412ae](https://github.com/trieb-work/next-optimized-redis-cache/commit/d9412aeaa0f9671f7289d2cea0e28baa48de49a1))
31-
* changed staged commits ([e464894](https://github.com/trieb-work/next-optimized-redis-cache/commit/e464894b0ca024d4e7d552ef3497d7d405aeab72))
32-
* initial commit ([85fc4f3](https://github.com/trieb-work/next-optimized-redis-cache/commit/85fc4f3c0b022ed35be8466e005422cc0d3a96c8))
33-
* run only vitest on staged ([f48cdbf](https://github.com/trieb-work/next-optimized-redis-cache/commit/f48cdbf1cc5961a68ba472ba19503308d8368295))
34-
* run only vitest on staged ([82a6757](https://github.com/trieb-work/next-optimized-redis-cache/commit/82a6757ac82d82c054a5842fbaf44da99ceb3f63))
35-
* update conf ([9c3623a](https://github.com/trieb-work/next-optimized-redis-cache/commit/9c3623ab9a0b09f9e3de29baecead33102796792))
36-
* update conf ([7d31a37](https://github.com/trieb-work/next-optimized-redis-cache/commit/7d31a3778f21df681c1e4e4d7677c344a86086a5))
37-
* update hooks ([7c04a6e](https://github.com/trieb-work/next-optimized-redis-cache/commit/7c04a6e4c4afd513737f37f8e1276f1ac92bd781))
38-
* update hooks ([610a94c](https://github.com/trieb-work/next-optimized-redis-cache/commit/610a94cf4728ccb728c99f73307379d2630909a0))
39-
* update hooks ([dfaf36b](https://github.com/trieb-work/next-optimized-redis-cache/commit/dfaf36be23c8d78337c4610725374590b3ddf434))
40-
* update hooks ([b892230](https://github.com/trieb-work/next-optimized-redis-cache/commit/b89223020b6ec6d2d94110dd66d12beafc1cd828))
41-
42-
# [1.0.0-beta.3](https://github.com/trieb-work/next-optimized-redis-cache/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2024-11-19)
43-
44-
### Bug Fixes
45-
46-
- move to dev packages ([e9c61c0](https://github.com/trieb-work/next-optimized-redis-cache/commit/e9c61c01ea092e55d47c559aafb2d29feaf89998))
47-
48-
# [1.0.0-beta.2](https://github.com/trieb-work/next-optimized-redis-cache/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2024-11-19)
49-
50-
### Bug Fixes
51-
52-
- public access ([cfe2845](https://github.com/trieb-work/next-optimized-redis-cache/commit/cfe2845b6e4a9b6f496a7d39f752b767c7670f93))
53-
54-
# 1.0.0-beta.1 (2024-11-19)
55-
56-
### Bug Fixes
57-
58-
- ci semantic release check ([df27fd8](https://github.com/trieb-work/next-optimized-redis-cache/commit/df27fd8228f95160603a000d917e1fa63a192319))
59-
- ci token ([6162dd9](https://github.com/trieb-work/next-optimized-redis-cache/commit/6162dd967386e6a55ee9cc909dd8c141cfa42018))
60-
- deps + fix: ci ([fe897c9](https://github.com/trieb-work/next-optimized-redis-cache/commit/fe897c931ba4fe1bcaec4ac4c1ebbbc81ca607a3))
61-
- deps + fix: ci ([eee7ca9](https://github.com/trieb-work/next-optimized-redis-cache/commit/eee7ca9b272aff595071084b812fcb0174caeee2))
62-
- git hooks ([69b1c2f](https://github.com/trieb-work/next-optimized-redis-cache/commit/69b1c2f922e85bd3ffeed42bc0e1be52c6fcf4e1))
63-
64-
### Features
65-
66-
- add coverage comment ([a2b8a18](https://github.com/trieb-work/next-optimized-redis-cache/commit/a2b8a18497e08790f3ebb8bb3f7f92b9de3690a5))
67-
- add coverage comment ([535c393](https://github.com/trieb-work/next-optimized-redis-cache/commit/535c393e20cbebec85d552eb9a7c3ca1346bdb4b))
68-
- add main protection ([e920d5d](https://github.com/trieb-work/next-optimized-redis-cache/commit/e920d5d4705118950830cd4fa9be4cdc033c07fb))
69-
- change to triebwork namespace ([7d6722f](https://github.com/trieb-work/next-optimized-redis-cache/commit/7d6722fa5668b41356721a4f18b1a03d0ebde992))
70-
- change to vitest + feat: add lint-staged ([d9412ae](https://github.com/trieb-work/next-optimized-redis-cache/commit/d9412aeaa0f9671f7289d2cea0e28baa48de49a1))
71-
- changed staged commits ([e464894](https://github.com/trieb-work/next-optimized-redis-cache/commit/e464894b0ca024d4e7d552ef3497d7d405aeab72))
72-
- initial commit ([85fc4f3](https://github.com/trieb-work/next-optimized-redis-cache/commit/85fc4f3c0b022ed35be8466e005422cc0d3a96c8))
73-
- update conf ([9c3623a](https://github.com/trieb-work/next-optimized-redis-cache/commit/9c3623ab9a0b09f9e3de29baecead33102796792))
74-
- update conf ([7d31a37](https://github.com/trieb-work/next-optimized-redis-cache/commit/7d31a3778f21df681c1e4e4d7677c344a86086a5))
75-
- update hooks ([7c04a6e](https://github.com/trieb-work/next-optimized-redis-cache/commit/7c04a6e4c4afd513737f37f8e1276f1ac92bd781))
76-
- update hooks ([610a94c](https://github.com/trieb-work/next-optimized-redis-cache/commit/610a94cf4728ccb728c99f73307379d2630909a0))
77-
- update hooks ([dfaf36b](https://github.com/trieb-work/next-optimized-redis-cache/commit/dfaf36be23c8d78337c4610725374590b3ddf434))
78-
- update hooks ([b892230](https://github.com/trieb-work/next-optimized-redis-cache/commit/b89223020b6ec6d2d94110dd66d12beafc1cd828))

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,18 @@ This is a template for creating a TypeScript package.
1616

1717
## Getting Started
1818

19-
1. Clone the repository
20-
2. For private repos: set NPM_TOKEN in repository secrets (For public repos, it is already set via organization secrets)
21-
3. Run `pnpm install` to install the dependencies
22-
4. Run `pnpm run build` to build the project
23-
5. Run `pnpm run dev` to develop the project
24-
6. Run `pnpm run test` to test the project
19+
1. Create a new repo using this as template repo
20+
2. Clone the new repository
21+
3. Run ./scripts/setup-repo-name.sh to configure the package name in all files
22+
4. For private repos: set NPM_TOKEN in repository secrets (For public repos, it is already set via organization secrets)
23+
5. Run `pnpm install` to install the dependencies
24+
6. Run `pnpm run build` to build the project
25+
7. Run `pnpm run dev` to develop the project
26+
8. Run `pnpm run test` to test the project
27+
10. Checkout into a new branch (main is protected)
28+
11. Change code and commit it using conventional commit. Staged code will get checked
29+
12. Push and create a PR (against main or beta) to run CI
30+
13. Merge to main or beta to create a release or pre-release
2531

2632
## License
2733

README_FINAL.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# public-typescript-npm-package-starter NPM Package
2+
3+
## Getting Started
4+
5+
5. Run `pnpm install` to install the dependencies
6+
6. Run `pnpm run build` to build the project
7+
7. Run `pnpm run dev` to develop the project
8+
8. Run `pnpm run test` to test the project
9+
10. Checkout into a new branch (main is protected)
10+
11. Change code and commit it using conventional commit. Staged code will get checked
11+
12. Push and create a PR (against main or beta) to run CI
12+
13. Merge to main or beta to create a release or pre-release
13+
14+
## License
15+
16+
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@trieb.work/next-optimized-redis-cache",
2+
"name": "@trieb.work/public-typescript-npm-package-starter",
33
"version": "1.0.0",
44
"scripts": {
55
"dev": "vitest --watch",
@@ -16,7 +16,7 @@
1616
"keywords": [],
1717
"author": "",
1818
"license": "ISC",
19-
"description": "A fast, optimized Redis cache for Next.js",
19+
"description": "",
2020
"publishConfig": {
2121
"access": "public"
2222
},
@@ -48,4 +48,4 @@
4848
"vitest": "^2.1.5"
4949
},
5050
"dependencies": {}
51-
}
51+
}

scripts/setup-repo-name.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/sh
2+
# Get the remote repository URL
3+
REPO_URL=$(git config --get remote.origin.url)
4+
5+
# Extract the repository name from the URL
6+
REPO_NAME=$(basename -s .git "$REPO_URL")
7+
echo "Renaming package to: $REPO_NAME"
8+
9+
# Rename README_FINAL.md to README.md
10+
mv README_FINAL.md README.md
11+
12+
# Replace placeholders in regular files only
13+
for file in *; do
14+
if [ -f "$file" ]; then
15+
sed -i '' "s/public-typescript-npm-package-starter/$REPO_NAME/g" "$file"
16+
fi
17+
done

0 commit comments

Comments
 (0)