Skip to content

Commit d82a198

Browse files
committed
feat: initial version
1 parent 3297259 commit d82a198

16 files changed

+3867
-3
lines changed

.eslintrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "@jcamp"
3+
}

.github/workflows/release.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# .github/workflows/release.yml
2+
3+
name: Release
4+
5+
permissions:
6+
contents: write
7+
8+
on:
9+
push:
10+
tags:
11+
- 'v*'
12+
13+
jobs:
14+
release:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
with:
19+
fetch-depth: 0
20+
21+
- uses: actions/setup-node@v3
22+
with:
23+
node-version: 18.x
24+
25+
- run: npx changelogen gh release
26+
env:
27+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
node_modules
2+
*.log*
3+
.cache
4+
.output
5+
.env
6+
dist
7+
.DS_Store
8+
/coverage
9+
*.tgz
10+
.DS_Store
11+
.idea
12+
.temp
13+
cache
14+
temp
15+
pnpm-global

.lintstagedrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"*": ["prettier --write --ignore-unknown"],
3+
"*.ts": ["eslint"]
4+
}

.npmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
shamefully-hoist=true

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dist
2+
pnpm-lock.yaml
3+
cache
4+
temp

.prettierrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
const baseConfig = require('@jcamp/eslint-config/.prettierrc.js')
2+
3+
module.exports = {
4+
...baseConfig,
5+
/* make any changes here*/
6+
}

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2023 jcamp
3+
Copyright (c) 2023 jcamp-test
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,43 @@
1-
# npm-package-repo-template
2-
A starter repo for TypeScript NPM packages with various integrations already done.
1+
# learn-changelog
2+
3+
working on setting up empty repo for easy start for future projects
4+
5+
# Integrations
6+
7+
## [Changelogen](https://github.com/unjs/changelogen)
8+
9+
Creates / updates CHANGELOG.md; has GH Action for automatic release creation on GitHub
10+
11+
Note for prerelease versions (0.x.x), considers the 0.x.0 as the major, with the 0.0.x as the minor.
12+
13+
## [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)
14+
15+
Easily allows GitHub hooks in a project \
16+
Used for commitlint and lintstaged below
17+
18+
## [commitlint](https://commitlint.js.org/#/)
19+
20+
Ensures commit messages follow conventions
21+
22+
## [lint-staged](https://github.com/okonet/lint-staged)
23+
24+
Lints all staged files to ensure code formatting is consistent.
25+
26+
## [Eslint Config](https://github.com/jcamp-code/eslint-config)
27+
28+
My preferred eslint / prettier setup; extends [@antfu's config](https://github.com/antfu/eslint-config)
29+
30+
## [Prettier](https://prettier.io/)
31+
32+
Standardized code formatting
33+
34+
## [Netlify](https://www.netlify.com)
35+
36+
Standard deploy file (obviously delete if not needed)
37+
38+
# Workflow
39+
40+
- Make changes
41+
- push commits / merge branches
42+
- `pnpm release` - updates changelog and release version, commits, tags and pushes; publishes too by default
43+
- GitHub Action creates GitHub release from the version (`v*`) tag

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] }

netlify.toml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[build.environment]
2+
NPM_FLAGS = "--prefix=/dev/null"
3+
NODE_VERSION = "16"
4+
5+
[build]
6+
publish = "dist"
7+
command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"
8+
9+
[[redirects]]
10+
from = "/*"
11+
to = "/index.html"
12+
status = 200

package.json

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"name": "@jcamp/test",
3+
"version": "0.0.3",
4+
"private": true,
5+
"repository": "https://github.com/jcamp-test/learn-changelog",
6+
"scripts": {
7+
"dev": "tsc -w",
8+
"build": "tsc",
9+
"lint": "eslint .",
10+
"lint:fix": "eslint . --fix",
11+
"format": "prettier --check --write .",
12+
"postinstall": "npx simple-git-hooks",
13+
"release": "pnpm changelogen --release --push && pnpm publish",
14+
"release:minor": "pnpm changelogen --release --minor --push && pnpm publish",
15+
"release:major": "pnpm changelogen --release --major --push && pnpm publish",
16+
"release:patch": "pnpm changelogen --release --patch --push && pnpm publish"
17+
},
18+
"devDependencies": {
19+
"@commitlint/cli": "^17.5.1",
20+
"@commitlint/config-conventional": "^17.4.4",
21+
"@jcamp/eslint-config": "0.5.0",
22+
"changelogen": "^0.5.2",
23+
"eslint": "8.37.0",
24+
"lint-staged": "^13.2.0",
25+
"prettier": "2.8.7",
26+
"simple-git-hooks": "^2.8.1",
27+
"typescript": "^5.0.3"
28+
}
29+
}

0 commit comments

Comments
 (0)