Skip to content

Commit

Permalink
feat!: initial creation of the package (#1)
Browse files Browse the repository at this point in the history
Just the initial Version of the package.
  • Loading branch information
mheob authored Oct 18, 2022
1 parent 38f35f8 commit 57d3b5c
Show file tree
Hide file tree
Showing 31 changed files with 5,746 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works with multi-package
repos, or single-package repos to help you version and publish your code. You can find the full documentation for it
[in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json",
"access": "public",
"baseBranch": "main",
"changelog": ["@mheob/changeset-changelog", { "repo": "mheob/changeset-changelog" }],
"commit": false,
"fixed": [],
"ignore": [],
"linked": [],
"updateInternalDependencies": "patch"
}
5 changes: 5 additions & 0 deletions .changeset/sixty-insects-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@mheob/changeset-changelog': major
---

Initial creation of the package
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Editor configuration, see http://editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = tab
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
indent_style = space
max_line_length = off
trim_trailing_whitespace = false

[*.{yml,yaml}]
max_line_length = off
indent_style = space
8 changes: 8 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/** @type {import('eslint').ESLint.ConfigData} */
module.exports = {
root: true,
extends: ['@mheob/eslint-config'],
rules: {
'unicorn/no-null': 'off',
},
};
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Learn how to add code owners here:
# https://help.github.com/en/articles/about-code-owners

* @mheob
8 changes: 8 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
day: "friday"
time: "00:23"
5 changes: 5 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": ["local>mheob/.github:renovate-config"],
"schedule": ["before 4am on Wednesday"]
}
40 changes: 40 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check

on:
pull_request:
branches:
- main
push:
branches:
- main

jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3

- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 7

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build files
run: pnpm run build

- name: Lint files
run: pnpm run lint

- name: Test files
run: pnpm run test:run
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
push:
paths:
- ".changeset/**"
- "src/**"
- "package.json"
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
token: ${{ secrets.MACHINE_USER_TOKEN }}

- name: Setup PNPM
uses: pnpm/action-setup@v2
with:
version: 7

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "pnpm"

- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Build files
run: pnpm run build

- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
commit: "chore(release): bump version and deploy"
title: "chore(release): bump version and deploy"
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.MACHINE_USER_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# build
dist

# test
coverage

# dependencies
node_modules
.pnpm-debug.log*
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm exec commitlint --edit "$1"
14 changes: 14 additions & 0 deletions .husky/post-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

[ -n "$CI" ] && exit 0

changedFiles="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"

hasChanged() {
echo "$changedFiles" | grep -q "$1"
}

if hasChanged 'pnpm-lock.yaml'; then
pnpm install
fi
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

[ -n "$CI" ] && exit 0

pnpm exec lint-staged
6 changes: 6 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

[ -n "$CI" ] && exit 0

pnpm dlx @mheob/check-package-manager
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node
9 changes: 9 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# build
dist

# dependencies
node_modules
pnpm-lock.yaml

# changelog
CHANGELOG.md
3 changes: 3 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@mheob/prettier-config'),
};
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"typescript.tsdk": "node_modules/typescript/lib"
}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License Copyright (c) 2022 Alexander Böhm

Permission is hereby granted, free
of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice
(including the next paragraph) shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# `@mheob/changeset-changelog` - My changelog for `changesets`

Add my own style for the changelogs generated by the awesome [changesets](https://github.com/changesets/changesets) library. The
style was inspired by the original
[@changesets/changelog-github](https://github.com/changesets/changesets/tree/main/packages/changelog-github) package.

## Install

### With NPM

```sh
npm install -D @mheob/changeset-changelog
```

### With YARN

```sh
yarn add -D @mheob/changeset-changelog
```

### With PNPM

```sh
pnpm add -D @mheob/changeset-changelog
```

## Usage

Add in your `.changeset/config.json` file the following snippet:

```jsonc
{
// ...
"changelog": ["@mheob/changeset-changelog", { "repo": "YOUR_USER/YOUR_REPO" }]
// ...
}
```
3 changes: 0 additions & 3 deletions REDME.md

This file was deleted.

75 changes: 75 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"name": "@mheob/changeset-changelog",
"version": "0.0.0",
"description": "My personal changeset changelog configuration.",
"keywords": [
"changelog",
"changeset",
"config"
],
"homepage": "https://github.com/mheob/changeset-changelog",
"bugs": "https://github.com/mheob/changeset-changelog/issues",
"repository": {
"type": "git",
"url": "https://github.com/mheob/changeset-changelog"
},
"license": "MIT",
"author": "Alexander Böhm <tools@boehm.work>",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "tsup",
"changeset": "changeset",
"dev": "tsup --watch",
"format": "prettier --write \"**/*.{cjs,js,mjs,ts,json,md,mdx,yaml,yml}\"",
"lint": "eslint . --ext .cjs,.js,.mjs,.ts --fix --ignore-path .gitignore",
"prepare": "ts-node ./scripts/prepare.ts",
"release": "changeset publish",
"test": "vitest",
"test:cov": "vitest run --coverage",
"test:run": "vitest run",
"test:ui": "vitest --ui"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
]
},
"lint-staged": {
"*.{cjs,js,mjs,ts}": "eslint --fix",
"!(pnpm-)*.{cjs,js,mjs,ts,json,md,mdx,yaml,yml}": "pnpm exec prettier --write",
"package.json": "pnpm dlx sort-package-json"
},
"dependencies": {
"@changesets/get-github-info": "^0.5.1",
"@changesets/types": "^5.2.0"
},
"devDependencies": {
"@changesets/cli": "^2.25.0",
"@changesets/parse": "^0.3.15",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@mheob/eslint-config": "^3.0.0",
"@mheob/prettier-config": "^2.0.2",
"@mheob/tsconfig": "^1.0.1",
"@types/node": "^18.11.0",
"@vitest/coverage-c8": "^0.24.3",
"husky": "^8.0.1",
"lint-staged": "^13.0.3",
"ts-node": "^10.9.1",
"tsup": "^6.3.0",
"typescript": "^4.8.4",
"vite": "^3.1.8",
"vitest": "^0.24.3"
},
"tsup": {
"clean": true,
"entry": [
"src/index.ts"
],
"dts": true
}
}
Loading

0 comments on commit 57d3b5c

Please sign in to comment.