Skip to content

Commit

Permalink
feat: regex
Browse files Browse the repository at this point in the history
  • Loading branch information
nikkeyl committed Apr 26, 2024
1 parent 250ae2f commit da7bf43
Show file tree
Hide file tree
Showing 13 changed files with 463 additions and 1,048 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ on:
branches:
- main
paths:
- index.ts
- package.json
- src/**/*.ts
push:
branches:
- main
paths:
- index.ts
- package.json
- src/**/*.ts

permissions:
actions: read
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,5 @@ jobs:
- name: Create Release
env:
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }}
# NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
run: pnpm release
415 changes: 0 additions & 415 deletions CHANGELOG.md

Large diffs are not rendered by default.

252 changes: 11 additions & 241 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,248 +1,18 @@
# Archoleat Repo Template

![CodeQL](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/codeql.yaml?label=CodeQL)
![Specs](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/spec.yaml?label=Specs)
![Commitlint](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/commitlint.yaml?label=Commitlint)
![Editorconfig](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/editorconfig.yaml?label=Editorconfig)
![Prettier](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/prettier.yaml?label=Prettier)
![ESLint](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/eslint.yaml?label=ESLint)
![Markdown](https://img.shields.io/github/actions/workflow/status/archoleat/repo-template/markdown.yaml?label=Markdown)
# Regex Patterns

![CodeQL](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/codeql.yaml?label=CodeQL)
![Specs](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/spec.yaml?label=Specs)
![Commitlint](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/commitlint.yaml?label=Commitlint)
![Editorconfig](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/editorconfig.yaml?label=Editorconfig)
![Prettier](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/prettier.yaml?label=Prettier)
![ESLint](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/eslint.yaml?label=ESLint)
![Markdown](https://img.shields.io/github/actions/workflow/status/archoleat/regex-patterns/markdown.yaml?label=Markdown)
![ESM Only](https://img.shields.io/badge/ESM-only-gray?labelColor=fe0)

## Table of Contents

- [Getting Started](#getting-started)
- [Features](#features)
- [Scripts](#scripts)
- [Workflows](#workflows)
- [Prettier](#prettier)
- [Change of Maintainer](#change-of-maintainer)
- [Contributing](#contributing)
- [License](#license)

**Archoleat Repo Template** is a template repository designed for quickly
starting new projects with pre-configured tools and best development practices.

This template includes ready-made solutions for integration with:

- **Git**.
- **GitHub**.
- **Commitizen**.
- **Commitlint**.
- **Conventional Commits**.
- **Husky & Lint Staged**.
- **GitHub Actions**.
- **Semantic Release**.
- **PNPM**.
- **CodeQL**.
- **EditorConfig**.
- **ESLint**.
- **Remark**.
- **Prettier**.
- **Vitest**.
- **TypeScript**.
- **Dependabot**.

> \[!TIP]
> **A good solution for your business!**
>
> Now you don't have to worry about unnecessary costs.
> Everything is already set up and prepared for you!
>
> And also the template is very good for teams,
> because you can easily standardize projects with this template.
## Getting Started

1. **Create a Repository**: Use this template
to create a new repository on GitHub.

> Since this is a **Public Template** you can click the button
> **Use this template** for a faster and more convenient cloning.
1. **Clone the Repository**: Clone your new repository to your local machine.

1. **Start Development**: Develop your project,
making changes according to your project's needs.

1. **Configure GitHub Actions**: Modify GitHub Actions
settings to fit your requirements.

> **For those unfamiliar with GitHub Actions**,
> our workflows use
> [**chain**](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run),
> if you want to add more workflows to this chain,
> workflows, it won't work, because the chain only supports
> only three levels, example: `workflow A` > `workflow B` >
> `workflow C` > `workflow D`, if you add `workflow E`
> to the chain. it won't work!
## Features

- **Flexibility**: Easily customizable template to adapt
to different project types.

- **Git and GitHub Integration**: Pre-configured `.gitignore`, `.gitmodules`
and `.gitattributes` for efficient work with Git and GitHub.

- **Conventional Commits, Commitlint & Commitizen**: If you don't want
to think about how to write a commit every time,
these plugins will help you.

> It will be especially useful for teams that
> have an ongoing debate about writing commits.
- **Husky & Lint Staged**: Won't let you submit
bad code to the repository!

- **Continuous Integration (CI)**: Built-in CI support using GitHub Actions
for automatic linting, testing and building of your code with each change.

> Also suitable for private repositories! GitHub Actions use
> **cache**, **timeout-minutes**, **path filters** and **workflow run**
> to reduce the execution time, which means it will significantly
> reduce your costs!
- **Security**: Included **CodeQL** workflow for detecting
and preventing potential vulnerabilities in your code.

- **Linters**: Help you maintain a consistent code writing style
and find errors.

- **Specs**: Automated testing will help you focus on
writing better code!

- **Semantic Release**: For those who are tired of writing changelogs
and thinking about what the next version number will be.

> If you have **Branch and Tag Protection** rules configured,
> please read this [article](https://gonzalohirsch.com/blog/semantic-release-and-branch-protection-rules).
- **TypeScript**: Pre-configured **TypeScript** setup
for improved reliability and development convenience.

- **Bots**:

- **Dependabot**: No more wasting time updating dependencies!

## Scripts

- `init`: Installs dependencies and **Husky**.

- `spec`: Runs **Vitest** and the tests in the **specs/** folder.

> Also runs using the [`spec.yaml`](.github/workflows/spec.yaml)
> workflow.
- `spec:coverage`: Runs **Vitest** with **Coverage-V8**.

- `release`: Runs **Semantic Release**.

- `lint:editorconfig`: Runs **Editorconfig Checker** and
checks all files in the project.

> Also runs with the [`editorconfig.yaml`](.github/workflows/editorconfig.yaml)
> workflow.
- `lint:formatting`: Runs **Prettier** with the `--check` flag
for all files.

> Runs with the [`prettier.yaml`](.github/workflows/prettier.yaml)
>
> Also run with a `pre-commit` hook.
- `lint:md`: Runs **Remark** with the `--quiet` flag and
checks all **Markdown** files.

> Also runs with the [`markdown.yaml`](.github/workflows/markdown.yaml)
> workflow.
- `lint:ts`: Runs **ESLint** with the flag `--fix`
for all **TypeScript** files.

> Runs with the [`eslint.yaml`](.github/workflows/eslint.yaml)
> workflow.
>
> Also run with a `pre-commit` hook.
- `prettify`: Runs **Prettier** with the `--write` flag
for all files.

- `commit`: Runs **Commitlint** to create commits according to
**Conventional Commits** standards.

## Workflows

- [`codeql.yaml`](.github/workflows/codeql.yaml):
Checks **JavaScript** and **TypeScript** for vulnerabilities.

- [`commitlint.yaml`](.github/workflows/commitlint.yaml):
Checks the commit message according
to the **Conventional Commits** standard.

- [`create-pull-request.yaml`](.github/workflows/create-pull-request.yaml):
Automatically creates a **Pull Request**
when pushing a branch to the repository.

- [`auto-merge-dependabot-pull-request.yaml`](.github/workflows/auto-merge-dependabot-pull-request.yaml):
Automatically merges dependabot **Pull Requests** to the **main** branch.

- [`editorconfig.yaml`](.github/workflows/editorconfig.yaml):
Checks all files with **Editorconfig Checker**.

- [`eslint.yaml`](.github/workflows/eslint.yaml):
Checks all **TypeScript** files with **ESLint**.

- [`markdown.yaml`](.github/workflows/markdown.yaml):
Checks all **Markdown** files with **Remark**.

- [`pre-commit.yaml`](.github/workflows/pre-commit.yaml):
Runs a check on the contents of the **Pull Request** before merging.

- [`prettier.yaml`](.github/workflows/prettier.yaml):
Checks all files with **Prettier**.

- [`release.yaml`](.github/workflows/release.yaml): Creates release.

- [`semantic-pull-request.yaml`](.github/workflows/semantic-pull-request-title.yaml):
Validates the **Pull Request** title
against the **conventional commits** standard.

- [`stale.yaml`](.github/workflows/stale.yaml):
Removes **Issues** and **Pull Requests** that have not been active
for more than **60 days**.

- [`spec.yaml`](.github/workflows/spec.yaml):
Tests all **TypeScript** files with **Vitest**.

## Prettier

> \[!WARNING]
> You need to install the **Prettier** extension for it to work.
>
> You can see all necessary extensions for **Visual Studio Code** in
> [**.vscode**](https://github.com/archoleat/.vscode/extensions.json).
> \[!TIP]
> If you want to change the rules in `prettier.config.js` you can do it
> in `.editorconfig`, prettier will automatically pick up the rules
> from **Editorconfig**.
> \[!NOTE]
> All **Markdown** and **.\*ignore** files [**ignored**](.prettierignore).
## Change of Maintainer

The following files use the names **Archoleat** and **nikkeyl** by default:

- [`CODEOWNERS`](.github/CODEOWNERS).
- [`package.json`](package.json).

Before using this template, replace this name with your
name, name of your team or the name of your organization.

> \[!CAUTION]
> Don't forget to change your license!
- [Contributing](#contributing)
- [License](#license)

## Contributing

Expand Down
3 changes: 0 additions & 3 deletions index.ts

This file was deleted.

2 changes: 1 addition & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export default {
'**/*': 'prettier --write',
'index.ts': 'eslint --fix',
'src/**/*.ts': 'eslint --fix',
};
32 changes: 18 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
{
"name": "@archoleat/repo-template",
"description": "Repository template",
"name": "@archoleat/regex-patterns",
"description": "Mini library with ready-to-use regex",
"version": "1.0.0",
"license": "MIT",
"author": {
"email": "[email protected]",
"name": "Archoleat",
"url": "https://github.com/archoleat"
},
"homepage": "https://github.com/archoleat/repo-template#readme",
"homepage": "https://github.com/archoleat/regex-patterns#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/archoleat/repo-template.git"
"url": "git+https://github.com/archoleat/regex-patterns.git"
},
"bugs": {
"url": "https://github.com/archoleat/repo-template/issues"
"url": "https://github.com/archoleat/regex-patterns/issues"
},
"keywords": [
"repo-template"
"regex-patterns"
],
"packageManager": "[email protected]",
"engines": {
Expand All @@ -42,25 +42,27 @@
"init": "pnpm i && husky",
"spec": "vitest",
"spec:coverage": "vitest run --coverage",
"build": "rollup -c",
"release": "semantic-release",
"lint:editorconfig": "editorconfig-checker",
"lint:formatting": "prettier . --check",
"lint:md": "remark . --quiet",
"lint:ts": "eslint index.ts --fix",
"lint:ts": "eslint src/**/*.ts --fix",
"prettify": "prettier . --write",
"commit": "cz"
},
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.6",
"@archoleat/eslint-flat-compatibility": "^1.1.5",
"@archoleat/semantic-release-define-config": "^1.1.3",
"@archoleat/commitlint-define-config": "^1.0.7",
"@archoleat/eslint-flat-compatibility": "^1.1.6",
"@archoleat/semantic-release-define-config": "^1.1.4",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@rollup/plugin-typescript": "^11.1.6",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@typescript-eslint/eslint-plugin": "^7.6.0",
"@typescript-eslint/eslint-plugin": "^7.7.1",
"@typescript-eslint/parser": "^7.7.1",
"@vitest/coverage-v8": "^1.4.0",
"@vitest/coverage-v8": "^1.5.2",
"conventional-changelog-conventionalcommits": "^7.0.2",
"cz-conventional-changelog": "^3.3.0",
"editorconfig-checker": "^5.1.5",
Expand All @@ -80,8 +82,10 @@
"remark-preset-lint-consistent": "^6.0.0",
"remark-preset-lint-markdown-style-guide": "^5.1.3",
"remark-preset-lint-recommended": "^7.0.0",
"semantic-release": "^23.0.7",
"rollup": "^4.16.4",
"rollup-plugin-esbuild": "^6.1.1",
"semantic-release": "^23.0.8",
"typescript": "^5.4.5",
"vitest": "^1.4.0"
"vitest": "^1.5.2"
}
}
Loading

0 comments on commit da7bf43

Please sign in to comment.