Skip to content

Commit 841ceb4

Browse files
committed
Initial commit
0 parents  commit 841ceb4

19 files changed

+2395
-0
lines changed

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
3+
updates:
4+
5+
# ECMAScript Module (ESM)
6+
- package-ecosystem: npm
7+
directory: "/"
8+
schedule:
9+
interval: weekly
10+
time: "06:00"
11+
open-pull-requests-limit: 10
12+
versioning-strategy: increase
13+
target-branch: "master"
14+
labels:
15+
- dependencies

.github/release-drafter.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Release Drafter template
2+
# Ref: https://github.com/marketplace/actions/release-drafter
3+
4+
name-template: 'v$RESOLVED_VERSION'
5+
tag-template: 'v$RESOLVED_VERSION'
6+
categories:
7+
- title: 🚀 Enhancements
8+
labels:
9+
- enhancement
10+
- title: 🎨 Improvements
11+
labels:
12+
- improvement
13+
- title: 🐛 Bug Fixes
14+
labels:
15+
- bug
16+
- title: 🔧 Under the hood
17+
labels:
18+
- debt
19+
- dev-dependencies
20+
- title: ⬆️ Dependencies
21+
labels:
22+
- dependencies
23+
exclude-labels:
24+
- DevOps
25+
- dev-dependencies
26+
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
27+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
28+
version-resolver:
29+
major:
30+
labels:
31+
- 'major'
32+
minor:
33+
labels:
34+
- 'minor'
35+
patch:
36+
labels:
37+
- 'patch'
38+
default: patch
39+
template: |
40+
## Changes
41+
42+
$CHANGES
43+
44+
## NPM release
45+
NPM release: [@borewit/text-codec@$RESOLVED_VERSION](https://www.npmjs.com/package/@borewit/text-codec/v/$RESOLVED_VERSION)

.github/update-license.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update License Year
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 1 1 *" # Runs on January 1st every year
6+
workflow_dispatch: # Allows manual triggering
7+
8+
jobs:
9+
update-license:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Update LICENSE year
19+
run: |
20+
CURRENT_YEAR=$(date +"%Y")
21+
sed -E -i "s/(Copyright © )[0-9]{4}/\1$CURRENT_YEAR/" LICENSE.txt
22+
23+
- name: Commit and push changes
24+
run: |
25+
CURRENT_YEAR=$(date +"%Y")
26+
git config --global user.name "Borewit"
27+
git config --global user.email "Borewit@users.noreply.github.com"
28+
git diff --quiet LICENSE.txt || (git add LICENSE.txt && git commit -m "Update license year to $CURRENT_YEAR" && git push)

.github/workflows/nodejs-ci.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ "master" ]
6+
push:
7+
8+
jobs:
9+
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 22.x
21+
22+
- name: Install Dependencies
23+
run: npm install
24+
25+
- name: Lint
26+
run: npm run lint
27+
28+
- name: Build Project
29+
run: npm run build
30+
31+
- name: Upload Build Artifacts
32+
uses: actions/upload-artifact@v4
33+
with:
34+
name: build
35+
path: |
36+
lib/**/*.js
37+
lib/**/*.js.map
38+
lib/**/*.d.ts
39+
test/**/*.js
40+
test/**/*.js.map
41+
42+
test:
43+
runs-on: ubuntu-latest
44+
needs: build
45+
46+
strategy:
47+
matrix:
48+
node-version: [18.x, 20.x, 22.x, 24.x]
49+
50+
steps:
51+
- name: Checkout Code
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Node.js ${{ matrix.node-version }}
55+
uses: actions/setup-node@v4
56+
with:
57+
node-version: ${{ matrix.node-version }}
58+
59+
- name: Install Dependencies
60+
run: npm install
61+
62+
- name: Download Build Artifacts
63+
uses: actions/download-artifact@v4
64+
with:
65+
name: build
66+
67+
- name: Run Tests
68+
run: npm run test
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Dependabot Pull Request
2+
on: pull_request_target
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
7+
steps:
8+
- name: Fetch Dependabot metadata
9+
id: dependabot-metadata
10+
uses: dependabot/fetch-metadata@v1
11+
with:
12+
github-token: "${{ secrets.GITHUB_TOKEN }}"
13+
- name: Add dev-dependencies label
14+
uses: actions-ecosystem/action-add-labels@v1
15+
if: ${{ steps.dependabot-metadata.outputs.dependency-type == 'direct:development' }}
16+
with:
17+
labels: dev-dependencies
18+
- name: Remove dependencies label
19+
uses: actions-ecosystem/action-remove-labels@v1
20+
if: ${{ steps.dependabot-metadata.outputs.dependency-type == 'direct:development' }}
21+
with:
22+
labels: dependencies
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
types: [opened, reopened, synchronize]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
update_release_draft:
15+
permissions:
16+
contents: write
17+
pull-requests: write
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: release-drafter/release-drafter@v6
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Update License Year
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 1 1 *" # Runs on January 1st every year
6+
workflow_dispatch: # Allows manual triggering
7+
8+
jobs:
9+
update-license:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v3
15+
with:
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Update LICENSE year
19+
run: |
20+
CURRENT_YEAR=$(date +"%Y")
21+
sed -E -i "s/(Copyright © )[0-9]{4}/\1$CURRENT_YEAR/" LICENSE.txt
22+
23+
- name: Commit and push changes
24+
run: |
25+
CURRENT_YEAR=$(date +"%Y")
26+
git config --global user.name "Borewit"
27+
git config --global user.email "Borewit@users.noreply.github.com"
28+
git diff --quiet LICENSE.txt || (git add LICENSE.txt && git commit -m "Update license year to $CURRENT_YEAR" && git push)

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.iml
2+
node_modules
3+
coverage
4+
.nyc_output
5+
lib/**/*.js
6+
lib/**/*.js.map
7+
lib/**/*.d.ts
8+
test/**/*.js
9+
test/**/*.js.map
10+
test/**/*.d.ts
11+
12+
.pnp.*
13+
.yarn/*
14+
15+
**/*.log
16+
17+
# IntelliJ IDEA
18+
.idea

.mocharc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extension": ["ts", "tsx"],
3+
"watch-files": ["lib/**/*.ts", "test/**/*.ts"],
4+
"spec": ["test/*.ts"],
5+
"loader": ["ts-node/esm"],
6+
"extensions": ["ts", "tsx"]
7+
}

LICENSE.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright © 2025 Borewit
4+
5+
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:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
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.

0 commit comments

Comments
 (0)