generated from essentialib/template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit aaf425d
Showing
19 changed files
with
146,810 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
name: Release on version change | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'package.json' | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '18' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build the project | ||
run: npm run build | ||
|
||
- name: Get package name and version | ||
id: package_info | ||
run: | | ||
name=$(jq -r '.name' < package.json) | ||
version=$(jq -r '.version' < package.json) | ||
echo "name=$name" >> $GITHUB_OUTPUT | ||
echo "version=$version" >> $GITHUB_OUTPUT | ||
- name: Check if version is prerelease | ||
id: prerelease_check | ||
run: | | ||
if [[ "${{ steps.package_info.outputs.version }}" == *"-"* ]]; then | ||
echo "prerelease=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "prerelease=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Prepare files for zipping | ||
run: | | ||
mkdir -p ${{ steps.package_info.outputs.name }} # {name} ํด๋ ์์ฑ | ||
cp -r dist/preserve/* ${{ steps.package_info.outputs.name }}/ # ์์ค์ฝ๋๋ฅผ {name} ํด๋๋ก ์ด๋ | ||
- name: Zip {name} folder | ||
run: | | ||
zip -r ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}.zip ${{ steps.package_info.outputs.name }} | ||
- name: Rename index.js to {name}.js | ||
run: mv dist/all/index.js dist/all/${{ steps.package_info.outputs.name }}.js | ||
|
||
- name: Create GitHub Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub Token ์ค์ | ||
with: | ||
tag_name: v${{ steps.package_info.outputs.version }} # ๋ฆด๋ฆฌ์ฆ ํ๊ทธ | ||
release_name: v${{ steps.package_info.outputs.version }} # ๋ฆด๋ฆฌ์ฆ ์ด๋ฆ | ||
body: | | ||
Automated release for version ${{ steps.package_info.outputs.version }}. | ||
draft: false | ||
prerelease: ${{ steps.prerelease_check.outputs.prerelease }} # prerelease ๊ฐ ๋์ ์ค์ | ||
|
||
- name: Upload {name}.js to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub Token ์ค์ | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: dist/all/${{ steps.package_info.outputs.name }}.js | ||
asset_name: ${{ steps.package_info.outputs.name }}.js | ||
asset_content_type: application/javascript | ||
|
||
- name: Upload {name}-{version}.zip to release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub Token ์ค์ | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}.zip | ||
asset_name: ${{ steps.package_info.outputs.name }}-${{ steps.package_info.outputs.version }}.zip | ||
asset_content_type: application/zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
### Node template | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
lerna-debug.log* | ||
.pnpm-debug.log* | ||
|
||
# Diagnostic reports (https://nodejs.org/api/report.html) | ||
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
*.lcov | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Snowpack dependency directory (https://snowpack.dev/) | ||
web_modules/ | ||
|
||
# TypeScript cache | ||
*.tsbuildinfo | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional stylelint cache | ||
.stylelintcache | ||
|
||
# Microbundle cache | ||
.rpt2_cache/ | ||
.rts2_cache_cjs/ | ||
.rts2_cache_es/ | ||
.rts2_cache_umd/ | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variable files | ||
.env | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env.local | ||
|
||
# parcel-bundler cache (https://parceljs.org/) | ||
.cache | ||
.parcel-cache | ||
|
||
# Next.js build output | ||
.next | ||
out | ||
|
||
# Nuxt.js build / generate output | ||
.nuxt | ||
dist | ||
|
||
# Gatsby files | ||
.cache/ | ||
# Comment in the public line in if your project uses Gatsby and not Next.js | ||
# https://nextjs.org/blog/next-9-1#public-directory-support | ||
# public | ||
|
||
# vuepress build output | ||
.vuepress/dist | ||
|
||
# vuepress v2.x temp and cache directory | ||
.temp | ||
|
||
# Docusaurus cache and generated files | ||
.docusaurus | ||
|
||
# Serverless directories | ||
.serverless/ | ||
|
||
# FuseBox cache | ||
.fusebox/ | ||
|
||
# DynamoDB Local files | ||
.dynamodb/ | ||
|
||
# TernJS port file | ||
.tern-port | ||
|
||
# Stores VSCode versions used for testing VSCode extensions | ||
.vscode-test | ||
|
||
# yarn v2 | ||
.yarn/cache | ||
.yarn/unplugged | ||
.yarn/build-state.yml | ||
.yarn/install-state.gz | ||
.pnp.* | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "tsx", | ||
"type": "node", | ||
"request": "launch", | ||
"program": "${file}", | ||
"runtimeExecutable": "tsx", | ||
"console": "integratedTerminal", | ||
"internalConsoleOptions": "neverOpen", | ||
"skipFiles": [ | ||
"<node_internals>/**", | ||
"${workspaceFolder}/node_modules/**" | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Hyunseung Ryu | ||
|
||
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 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# ๐งฉ typescript-module | ||
|
||
TypeScript๋ฅผ ์ฌ์ฉํ ๋ชจ๋์ ์ฝ๊ฒ ๋ง๋ค๊ธฐ ์ํ ํ ํ๋ฆฟ ๋ ํฌ์งํ ๋ฆฌ. | ||
|
||
- Bot App: [`๋ฉ์ ์ ๋ดR`](https://github.com/MessengerBotTeam/msgbot-old-release/releases/tag/0.7.36a) (0.7.36a ๋ฒ์ ์ด์) | ||
- CI/CD: [`GitHub Actions`](https://github.com/features/actions) | ||
- Module Bundler: [`Rollup`](https://rollupjs.org/) | ||
- Test: [`Vitest`](https://vitest.dev/) | ||
- Execute: [`TSX`](https://tsx.is/) | ||
- Runtime: [`Node.js`](https://nodejs.org/en) | ||
|
||
## ๐ features | ||
- `npm run build:all-in-one`: `src` ํด๋์ ๋ชจ๋ ์์ค๋ฅผ ํ๋์ `.js`, `.d.ts` ํ์ผ๋ก ๋ง๋ค์ด `dist/all`์ ๋น๋ | ||
- `npm run build:no-all-in-one`: `src` ํด๋์ ๊ฐ ํ์ผ๋ค์ ํ์ผ ๊ตฌ์กฐ๋ฅผ ์ ์งํ ์ฑ `.js`, `.d.ts` ํ์ผ๋ก ๋ณํํด `dist/preserve`์ ๋น๋ | ||
- `package.json`์ `version` ํค๊ฐ ๋ณ๊ฒฝ๋ ์ฑ๋ก ํธ์ฌํ๋ฉด ์๋์ผ๋ก ํด๋น ๋ฒ์ ์ผ๋ก ๋ฆด๋ฆฌ์ฆ ์์ฑ. (`v1.0.0-alpha` ์ฒ๋ผ ์ฐ๋ฉด prerelease๋ก ์ค์ ๋จ) | ||
|
||
> [!NOTE] | ||
> `package.json` ์์ `directories` ํค๋ฅผ ์์ ํ์ฌ ๋น๋ ํ๊ฒ ๋ณ๊ฒฝ ๊ฐ๋ฅ | ||
## โ prepare | ||
1. ๋ ํฌ์งํ ๋ฆฌ ์ค์ ์์ `GitHub Actions` ๊ฐ ์ ์ ํ ๊ถํ์ ๊ฐ์ง๊ณ ์๋์ง ํ์ธํ์ธ์. | ||
- `Settings > Actions > General` ๋ก ์ด๋ํฉ๋๋ค. | ||
- `Workflow permissions` ์์ `Read and write permissions` ๋ฅผ ์ ํํ๊ณ ์ ์ฅํฉ๋๋ค. | ||
2. `package.json` ํ์ผ์ ์ด์ด `name`, `version`, `description`, `author`, `license` ๋ฑ์ ํ๋๋ฅผ ์ ์ ํ ์์ ํฉ๋๋ค. | ||
3. `npm install` ๋ช ๋ น์ด๋ฅผ ์คํํ์ฌ ์์กด์ฑ ํจํค์ง๋ฅผ ์ค์นํฉ๋๋ค. |
Oops, something went wrong.