Skip to content

Commit c67c13e

Browse files
authored
Merge pull request #127 from MekDrop/convert-ts-to-js
Converted TypeScript code into JavaScript
2 parents c4f3ec5 + 1574723 commit c67c13e

20 files changed

+7858
-351
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
root = true
22

3-
[*.{js, ts}]
3+
[*.js]
44
charset = utf-8
55
indent_style = space
66
indent_size = 2

.eslintignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 78 deletions
This file was deleted.

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Set default behavior to automatically normalize line endings
2+
* text=auto
3+
4+
# JavaScript files should always use LF line endings
5+
*.js text eol=lf
6+
*.json text eol=lf
7+
8+
# Markdown files
9+
*.md text eol=lf
10+
11+
# Config files
12+
.editorconfig text eol=lf
13+
.gitignore text eol=lf
14+
.prettierignore text eol=lf
15+
16+
# YAML files
17+
*.yml text eol=lf
Lines changed: 125 additions & 139 deletions
Original file line numberDiff line numberDiff line change
@@ -1,139 +1,125 @@
1-
name: On pull request
2-
3-
on:
4-
pull_request:
5-
branches:
6-
- main
7-
8-
permissions: write-all
9-
10-
jobs:
11-
test:
12-
runs-on: ubuntu-latest
13-
14-
strategy:
15-
matrix:
16-
node-version:
17-
- 20.x
18-
19-
steps:
20-
- name: Checkouting code...
21-
uses: actions/checkout@v4
22-
with:
23-
ref: ${{ github.head_ref }}
24-
25-
- name: Use Node.js ${{ matrix.node-version }}
26-
uses: actions/setup-node@v4
27-
with:
28-
node-version: ${{ matrix.node-version }}
29-
30-
- name: NPM install
31-
run: npm install
32-
33-
- name: NPM test
34-
run: npm run test
35-
36-
build:
37-
38-
runs-on: ubuntu-latest
39-
needs: test
40-
41-
strategy:
42-
matrix:
43-
node-version:
44-
- 20.x
45-
46-
steps:
47-
- name: Checkouting code...
48-
uses: actions/checkout@v4
49-
with:
50-
ref: ${{ github.head_ref }}
51-
52-
- name: Use Node.js ${{ matrix.node-version }}
53-
uses: actions/setup-node@v4
54-
with:
55-
node-version: ${{ matrix.node-version }}
56-
57-
- name: NPM install
58-
run: npm install
59-
60-
- name: NPM build
61-
run: npm run build
62-
63-
- name: NPM format
64-
run: npm run format
65-
66-
- name: NPM format check
67-
run: npm run format-check
68-
69-
- name: Lint
70-
run: npm run lint
71-
72-
- name: Pack
73-
run: npm run pack
74-
75-
- name: Uploading build artifact...
76-
uses: actions/upload-artifact@v4
77-
with:
78-
name: build
79-
path: dist/*.js
80-
81-
commit_and_push:
82-
83-
runs-on: ubuntu-latest
84-
name: Commit and push build if needed
85-
needs: build
86-
87-
steps:
88-
- name: Checkouting code...
89-
uses: actions/checkout@v4
90-
with:
91-
ref: ${{ github.head_ref }}
92-
93-
- name: Downloading build artifact....
94-
uses: actions/download-artifact@v4
95-
with:
96-
name: build
97-
path: dist/
98-
99-
- name: Auto commiting changes...
100-
uses: stefanzweifel/git-auto-commit-action@v5
101-
with:
102-
commit_message: Automatically builded and updated
103-
file_pattern: dist/*.js
104-
skip_fetch: true
105-
skip_checkout: true
106-
107-
dependabot:
108-
needs:
109-
- build
110-
- commit_and_push
111-
permissions:
112-
pull-requests: write
113-
contents: write
114-
runs-on: ubuntu-latest
115-
# Checking the actor will prevent your Action run failing on non-Dependabot
116-
# PRs but also ensures that it only does work for Dependabot PRs.
117-
if: ${{ github.actor == 'dependabot[bot]' }}
118-
steps:
119-
# This first step will fail if there's no metadata and so the approval
120-
# will not occur.
121-
- name: Dependabot metadata
122-
id: dependabot-metadata
123-
uses: dependabot/[email protected]
124-
with:
125-
github-token: "${{ secrets.GITHUB_TOKEN }}"
126-
# Here the PR gets approved.
127-
- name: Approve a PR
128-
run: gh pr review --approve "$PR_URL"
129-
env:
130-
PR_URL: ${{ github.event.pull_request.html_url }}
131-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
132-
# Finally, this sets the PR to allow auto-merging for patch and minor
133-
# updates if all checks pass
134-
- name: Enable auto-merge for Dependabot PRs
135-
# if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
136-
run: gh pr merge --auto --squash "$PR_URL"
137-
env:
138-
PR_URL: ${{ github.event.pull_request.html_url }}
139-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1+
name: On pull request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
permissions: write-all
9+
10+
jobs:
11+
test:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version:
17+
- 20.x
18+
19+
steps:
20+
- name: Checkouting code...
21+
uses: actions/checkout@v4
22+
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
28+
- name: NPM install
29+
run: npm install
30+
31+
- name: NPM test
32+
run: npm run test
33+
34+
build:
35+
36+
runs-on: ubuntu-latest
37+
needs: test
38+
39+
steps:
40+
- name: Checkouting code...
41+
uses: actions/checkout@v4
42+
43+
- name: Use Node.js ${{ matrix.node-version }}
44+
uses: actions/setup-node@v4
45+
with:
46+
node-version: 20.x
47+
48+
- name: NPM install
49+
run: npm install
50+
51+
- name: NPM format
52+
run: npm run format
53+
54+
- name: NPM format check
55+
run: npm run format-check
56+
57+
- name: Lint
58+
run: npm run lint
59+
60+
- name: Pack
61+
run: npm run pack
62+
63+
- name: Uploading build artifact...
64+
uses: actions/upload-artifact@v4
65+
with:
66+
name: build
67+
path: dist/*.*
68+
69+
commit_and_push:
70+
71+
runs-on: ubuntu-latest
72+
name: Commit and push build if needed
73+
needs: build
74+
75+
steps:
76+
- name: Checkouting code...
77+
uses: actions/checkout@v4
78+
79+
- name: Downloading build artifact....
80+
uses: actions/download-artifact@v4
81+
with:
82+
name: build
83+
path: dist/
84+
85+
- name: Auto commiting changes...
86+
uses: stefanzweifel/git-auto-commit-action@v5
87+
with:
88+
commit_message: Automatically builded and updated
89+
file_pattern: dist/*.js dist/*.json
90+
skip_fetch: true
91+
skip_checkout: true
92+
93+
dependabot:
94+
needs:
95+
- build
96+
- commit_and_push
97+
permissions:
98+
pull-requests: write
99+
contents: write
100+
runs-on: ubuntu-latest
101+
# Checking the actor will prevent your Action run failing on non-Dependabot
102+
# PRs but also ensures that it only does work for Dependabot PRs.
103+
if: ${{ github.actor == 'dependabot[bot]' }}
104+
steps:
105+
# This first step will fail if there's no metadata and so the approval
106+
# will not occur.
107+
- name: Dependabot metadata
108+
id: dependabot-metadata
109+
uses: dependabot/[email protected]
110+
with:
111+
github-token: "${{ secrets.GITHUB_TOKEN }}"
112+
# Here the PR gets approved.
113+
- name: Approve a PR
114+
run: gh pr review --approve "$PR_URL"
115+
env:
116+
PR_URL: ${{ github.event.pull_request.html_url }}
117+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
# Finally, this sets the PR to allow auto-merging for patch and minor
119+
# updates if all checks pass
120+
- name: Enable auto-merge for Dependabot PRs
121+
# if: ${{ steps.dependabot-metadata.outputs.update-type != 'version-update:semver-major' }}
122+
run: gh pr merge --auto --squash "$PR_URL"
123+
env:
124+
PR_URL: ${{ github.event.pull_request.html_url }}
125+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,4 @@ Thumbs.db
9898
__tests__/runner/*
9999
lib/**/*
100100

101-
.idea/
102-
package-lock.json
101+
.idea/

dist/index.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/package.json

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

0 commit comments

Comments
 (0)