Skip to content

Commit b21a0f9

Browse files
authored
Merge pull request #1 from IDScript/dev
Development
2 parents 6d73c62 + 23a3841 commit b21a0f9

54 files changed

Lines changed: 2975 additions & 65 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
DATABASE_URL="mysql://root:root@localhost:3306/bunapi"
2+
APP_VERSION=0.1.0
3+
APP_ENV=production
4+
APP_DEBUG=true
5+
API_PORT=3030
6+
LOG_LEVEL=info
7+
EXAMPLE_EMAIL=test@idscript.my.id

.github/workflows/codeql.yml

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ name: "CodeQL Advanced"
1313

1414
on:
1515
push:
16-
branches: [ "main" ]
16+
branches: ["main"]
1717
pull_request:
18-
branches: [ "main" ]
18+
branches: ["main"]
1919
schedule:
20-
- cron: '40 22 * * 5'
20+
- cron: "40 22 * * 5"
2121

2222
jobs:
2323
analyze:
@@ -43,8 +43,8 @@ jobs:
4343
fail-fast: false
4444
matrix:
4545
include:
46-
- language: javascript-typescript
47-
build-mode: none
46+
- language: javascript-typescript
47+
build-mode: none
4848
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
4949
# Use `c-cpp` to analyze code written in C, C++ or both
5050
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
@@ -54,39 +54,39 @@ jobs:
5454
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
5555
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
5656
steps:
57-
- name: Checkout repository
58-
uses: actions/checkout@v4
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
5959

60-
# Initializes the CodeQL tools for scanning.
61-
- name: Initialize CodeQL
62-
uses: github/codeql-action/init@v3
63-
with:
64-
languages: ${{ matrix.language }}
65-
build-mode: ${{ matrix.build-mode }}
66-
# If you wish to specify custom queries, you can do so here or in a config file.
67-
# By default, queries listed here will override any specified in a config file.
68-
# Prefix the list here with "+" to use these queries and those in the config file.
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
build-mode: ${{ matrix.build-mode }}
66+
# If you wish to specify custom queries, you can do so here or in a config file.
67+
# By default, queries listed here will override any specified in a config file.
68+
# Prefix the list here with "+" to use these queries and those in the config file.
6969

70-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71-
# queries: security-extended,security-and-quality
70+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71+
# queries: security-extended,security-and-quality
7272

73-
# If the analyze step fails for one of the languages you are analyzing with
74-
# "We were unable to automatically build your code", modify the matrix above
75-
# to set the build mode to "manual" for that language. Then modify this step
76-
# to build your code.
77-
# ℹ️ Command-line programs to run using the OS shell.
78-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79-
- if: matrix.build-mode == 'manual'
80-
shell: bash
81-
run: |
82-
echo 'If you are using a "manual" build mode for one or more of the' \
83-
'languages you are analyzing, replace this with the commands to build' \
84-
'your code, for example:'
85-
echo ' make bootstrap'
86-
echo ' make release'
87-
exit 1
73+
# If the analyze step fails for one of the languages you are analyzing with
74+
# "We were unable to automatically build your code", modify the matrix above
75+
# to set the build mode to "manual" for that language. Then modify this step
76+
# to build your code.
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
- if: matrix.build-mode == 'manual'
80+
shell: bash
81+
run: |
82+
echo 'If you are using a "manual" build mode for one or more of the' \
83+
'languages you are analyzing, replace this with the commands to build' \
84+
'your code, for example:'
85+
echo ' make bootstrap'
86+
echo ' make release'
87+
exit 1
8888
89-
- name: Perform CodeQL Analysis
90-
uses: github/codeql-action/analyze@v3
91-
with:
92-
category: "/language:${{matrix.language}}"
89+
- name: Perform CodeQL Analysis
90+
uses: github/codeql-action/analyze@v3
91+
with:
92+
category: "/language:${{matrix.language}}"

.github/workflows/dependency-review.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#
88
# Source repository: https://github.com/actions/dependency-review-action
99
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
10-
name: 'Dependency review'
10+
name: "Dependency review"
1111
on:
1212
pull_request:
13-
branches: [ "main" ]
13+
branches: ["main"]
1414

1515
# If using a dependency submission action in this workflow this permission will need to be set to:
1616
#
@@ -27,9 +27,9 @@ jobs:
2727
dependency-review:
2828
runs-on: ubuntu-latest
2929
steps:
30-
- name: 'Checkout repository'
30+
- name: "Checkout repository"
3131
uses: actions/checkout@v4
32-
- name: 'Dependency Review'
32+
- name: "Dependency Review"
3333
uses: actions/dependency-review-action@v4
3434
# Commonly enabled options, see https://github.com/actions/dependency-review-action#configuration-options for all available options.
3535
with:

.github/workflows/github-ci.yaml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Unit Test 🧪
2+
3+
on:
4+
push:
5+
branches: ["main", "stg"]
6+
pull_request:
7+
branches: ["main", "stg"]
8+
9+
jobs:
10+
Format_and_Check:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
bun-version: [canary, 1.0.0, 1.0.36, 1.1.0, 1.1.16, 1.1.42]
15+
name: Bun ${{ matrix.bun-version }} sample
16+
steps:
17+
- uses: actions/checkout@v4.2.2
18+
- name: Use Bun ${{ matrix.bun-version }}
19+
uses: oven-sh/setup-bun@v2
20+
with:
21+
bun-version: ${{ matrix.bun-version }}
22+
- name: Install dependencies
23+
run: bun i
24+
- name: Format and Check code
25+
run: bun run fc
26+
Jest_Test:
27+
runs-on: ubuntu-latest
28+
needs: Format_and_Check
29+
strategy:
30+
matrix:
31+
bun-version: [canary, 1.0.0, 1.0.36, 1.1.0, 1.1.16, 1.1.42]
32+
name: Test with Jest Bun ${{ matrix.bun-version }}
33+
steps:
34+
- name: Start MySQL
35+
run: |
36+
sudo /etc/init.d/mysql start
37+
mysql -e "CREATE DATABASE IF NOT EXISTS bunapi;" -uroot -proot
38+
- uses: actions/checkout@v4.2.2
39+
- name: Use Bun ${{ matrix.bun-version }}
40+
uses: oven-sh/setup-bun@v2
41+
with:
42+
bun-version: ${{ matrix.bun-version }}
43+
- name: create .env
44+
run: mv .env.example .env
45+
- name: Install dependencies
46+
run: bun i
47+
- name: Migration
48+
run: bun run mig
49+
- name: Test
50+
run: bun test
51+
Create_Test_Coverage_Badges:
52+
runs-on: ubuntu-latest
53+
needs: Format_and_Check
54+
name: Test with Jest Bun Latest
55+
steps:
56+
- name: Start MySQL
57+
run: |
58+
sudo /etc/init.d/mysql start
59+
mysql -e "CREATE DATABASE IF NOT EXISTS bunapi;" -uroot -proot
60+
- uses: actions/checkout@v4.2.2
61+
- name: Setup Bun
62+
uses: oven-sh/setup-bun@v2
63+
- name: create .env
64+
run: mv .env.example .env
65+
- name: Install dependencies
66+
run: bun i
67+
- name: Migration
68+
run: bun run mig
69+
- name: Test
70+
run: bun test
71+
- name: Generating coverage badges
72+
uses: jpb06/jest-badges-action@v1.9.18
73+
with:
74+
branches: main, stg

.gitignore

Lines changed: 129 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,130 @@
1-
# deps
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Diagnostic reports (https://nodejs.org/api/report.html)
11+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
12+
13+
# Runtime data
14+
pids
15+
*.pid
16+
*.seed
17+
*.pid.lock
18+
19+
# Directory for instrumented libs generated by jscoverage/JSCover
20+
lib-cov
21+
22+
# Coverage directory used by tools like istanbul
23+
coverage
24+
*.lcov
25+
26+
# nyc test coverage
27+
.nyc_output
28+
29+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
30+
.grunt
31+
32+
# Bower dependency directory (https://bower.io/)
33+
bower_components
34+
35+
# node-waf configuration
36+
.lock-wscript
37+
38+
# Compiled binary addons (https://nodejs.org/api/addons.html)
39+
build/Release
40+
41+
# Dependency directories
242
node_modules/
43+
jspm_packages/
44+
45+
# Snowpack dependency directory (https://snowpack.dev/)
46+
web_modules/
47+
48+
# TypeScript cache
49+
*.tsbuildinfo
50+
51+
# Optional npm cache directory
52+
.npm
53+
54+
# Optional eslint cache
55+
.eslintcache
56+
57+
# Optional stylelint cache
58+
.stylelintcache
59+
60+
# Microbundle cache
61+
.rpt2_cache/
62+
.rts2_cache_cjs/
63+
.rts2_cache_es/
64+
.rts2_cache_umd/
65+
66+
# Optional REPL history
67+
.node_repl_history
68+
69+
# Output of 'npm pack'
70+
*.tgz
71+
72+
# Yarn Integrity file
73+
.yarn-integrity
74+
75+
# dotenv environment variable files
76+
.env
77+
.env.development.local
78+
.env.test.local
79+
.env.production.local
80+
.env.local
81+
82+
# parcel-bundler cache (https://parceljs.org/)
83+
.cache
84+
.parcel-cache
85+
86+
# Next.js build output
87+
.next
88+
out
89+
90+
# Nuxt.js build / generate output
91+
.nuxt
92+
dist
93+
94+
# Gatsby files
95+
.cache/
96+
# Comment in the public line in if your project uses Gatsby and not Next.js
97+
# https://nextjs.org/blog/next-9-1#public-directory-support
98+
# public
99+
100+
# vuepress build output
101+
.vuepress/dist
102+
103+
# vuepress v2.x temp and cache directory
104+
.temp
105+
.cache
106+
107+
# Docusaurus cache and generated files
108+
.docusaurus
109+
110+
# Serverless directories
111+
.serverless/
112+
113+
# FuseBox cache
114+
.fusebox/
115+
116+
# DynamoDB Local files
117+
.dynamodb/
118+
119+
# TernJS port file
120+
.tern-port
121+
122+
# Stores VSCode versions used for testing VSCode extensions
123+
.vscode-test
124+
125+
# yarn v2
126+
.yarn/cache
127+
.yarn/unplugged
128+
.yarn/build-state.yml
129+
.yarn/install-state.gz
130+
.pnp.*

.idea/.gitignore

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

.idea/BunAPI.iml

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

.idea/bun.xml

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

0 commit comments

Comments
 (0)