Skip to content

Commit

Permalink
feat: initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCampionJr committed Apr 3, 2023
1 parent 3297259 commit d82a198
Show file tree
Hide file tree
Showing 16 changed files with 3,867 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@jcamp"
}
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# .github/workflows/release.yml

name: Release

permissions:
contents: write

on:
push:
tags:
- 'v*'

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
with:
node-version: 18.x

- run: npx changelogen gh release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
node_modules
*.log*
.cache
.output
.env
dist
.DS_Store
/coverage
*.tgz
.DS_Store
.idea
.temp
cache
temp
pnpm-global
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*": ["prettier --write --ignore-unknown"],
"*.ts": ["eslint"]
}
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
dist
pnpm-lock.yaml
cache
temp
6 changes: 6 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
const baseConfig = require('@jcamp/eslint-config/.prettierrc.js')

module.exports = {
...baseConfig,
/* make any changes here*/
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 jcamp
Copyright (c) 2023 jcamp-test

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
45 changes: 43 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,43 @@
# npm-package-repo-template
A starter repo for TypeScript NPM packages with various integrations already done.
# learn-changelog

working on setting up empty repo for easy start for future projects

# Integrations

## [Changelogen](https://github.com/unjs/changelogen)

Creates / updates CHANGELOG.md; has GH Action for automatic release creation on GitHub

Note for prerelease versions (0.x.x), considers the 0.x.0 as the major, with the 0.0.x as the minor.

## [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)

Easily allows GitHub hooks in a project \
Used for commitlint and lintstaged below

## [commitlint](https://commitlint.js.org/#/)

Ensures commit messages follow conventions

## [lint-staged](https://github.com/okonet/lint-staged)

Lints all staged files to ensure code formatting is consistent.

## [Eslint Config](https://github.com/jcamp-code/eslint-config)

My preferred eslint / prettier setup; extends [@antfu's config](https://github.com/antfu/eslint-config)

## [Prettier](https://prettier.io/)

Standardized code formatting

## [Netlify](https://www.netlify.com)

Standard deploy file (obviously delete if not needed)

# Workflow

- Make changes
- push commits / merge branches
- `pnpm release` - updates changelog and release version, commits, tags and pushes; publishes too by default
- GitHub Action creates GitHub release from the version (`v*`) tag
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] }
12 changes: 12 additions & 0 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[build.environment]
NPM_FLAGS = "--prefix=/dev/null"
NODE_VERSION = "16"

[build]
publish = "dist"
command = "npx pnpm i --store=node_modules/.pnpm-store && npx pnpm run build"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
29 changes: 29 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"name": "@jcamp/test",
"version": "0.0.3",
"private": true,
"repository": "https://github.com/jcamp-test/learn-changelog",
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"format": "prettier --check --write .",
"postinstall": "npx simple-git-hooks",
"release": "pnpm changelogen --release --push && pnpm publish",
"release:minor": "pnpm changelogen --release --minor --push && pnpm publish",
"release:major": "pnpm changelogen --release --major --push && pnpm publish",
"release:patch": "pnpm changelogen --release --patch --push && pnpm publish"
},
"devDependencies": {
"@commitlint/cli": "^17.5.1",
"@commitlint/config-conventional": "^17.4.4",
"@jcamp/eslint-config": "0.5.0",
"changelogen": "^0.5.2",
"eslint": "8.37.0",
"lint-staged": "^13.2.0",
"prettier": "2.8.7",
"simple-git-hooks": "^2.8.1",
"typescript": "^5.0.3"
}
}
Loading

0 comments on commit d82a198

Please sign in to comment.