From 3d78cac19f496b7084c1e51d5a9372ea7e7417f0 Mon Sep 17 00:00:00 2001 From: Sammers21 Date: Sun, 10 Mar 2024 19:07:25 +0300 Subject: [PATCH] Initial commit (via bun create) --- .github/workflows/ci.yml | 37 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 22 ++++++++++++++++++++ .gitignore | 2 ++ LICENSE | 21 +++++++++++++++++++ README.md | 26 ++++++++++++++++++++++++ build.mjs | 8 ++++++++ bun.lockb | Bin 0 -> 9106 bytes package.json | 30 +++++++++++++++++++++++++++ src/index.ts | 2 ++ test/index.test.ts | 12 +++++++++++ tsconfig.json | 16 +++++++++++++++ 11 files changed, 176 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 README.md create mode 100644 build.mjs create mode 100755 bun.lockb create mode 100644 package.json create mode 100644 src/index.ts create mode 100644 test/index.test.ts create mode 100644 tsconfig.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..49a420b --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: CI + +on: + push: + branches: + - main + + pull_request: + branches: + - main + +jobs: + test: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + fail-fast: false + + steps: + - id: checkout + name: Checkout + uses: actions/checkout@v3 + - id: setup-bun + name: Setup Bun + uses: oven-sh/setup-bun@v1 + with: + bun-version: latest + - id: install-deps + name: Install dependencies + run: | + bun install + - id: test + name: Run test + run: | + bun test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..216ba3b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,22 @@ +name: Release + +on: + push: + tags: + - 'v*' + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v3 + with: + node-version: 16.x + + - run: npx changelogithub + env: + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f06235c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +dist diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..53c76fc --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 Robert Soriano + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a52c4a0 --- /dev/null +++ b/README.md @@ -0,0 +1,26 @@ +# bun starter + +## Getting Started + +Click the [Use this template](https://github.com/wobsoriano/bun-lib-starter/generate) button to create a new repository with the contents starter. + +OR + +Run `bun create wobsoriano/bun-lib-starter ./my-lib`. + +## Setup + +```bash +# install dependencies +bun install + +# test the app +bun test + +# build the app, available under dist +bun run build +``` + +## License + +MIT diff --git a/build.mjs b/build.mjs new file mode 100644 index 0000000..dd6ef5f --- /dev/null +++ b/build.mjs @@ -0,0 +1,8 @@ +import dts from 'bun-plugin-dts' + +await Bun.build({ + entrypoints: ['./src/index.ts'], + outdir: './dist', + minify: true, + plugins: [dts()] +}) diff --git a/bun.lockb b/bun.lockb new file mode 100755 index 0000000000000000000000000000000000000000..7b8645eedc19e20b45ca276ade0b90afb07d8b86 GIT binary patch literal 9106 zcmeHNd011|5)T+uK%i_c6f`ULK2b?1sAa50v6Hd`qa8r z#VR81TdNdA1w|{kR0^x(%7ilY-^1wtM(RxC~A%9#phJ#89|#t5i5kPskw(Kn;{**LE* z_x&PPcy>K~)jQ-t|BlBz$JuGyLL;EADn{%04o_E?JxK$aB!SNqaT9r1p+}>o!;fYN zya;$F;D%Z>+E>8yp=<^`g)8OD;Mon_L3s+>Qv^ktgSvbdIO6nar{d*M?gHf^;QGM3 z0yhS(3)~1ePZrG;a$|VWLP4?saH>I17wT>4s`f(Q22ef>9C6VWa(5k7JMQ$|LkD*c zjab_=-Lda%UeuzC1uGt#yqIckI5<2y?vht`mmqFU>QWm{X2rd+4=asxYHx4#NUv}7 z;r|{pZEn2Xz^7VI?;VjBHVL%~BsK%DTG`yPE!4F+7_POtD(J;pNuHR!M_3=drY6dpx^@fFgHKT{{R3A0Dbe%v=3@Z!tp~QD_2$e@L%Hp_we8k_A&lg z2g|5UMD*+70q0M9wbrM`&lL=k`G*jns!yD4tKXzO@m~UpzTkgbi+}K_X2%fyPrbDe-=zUj6cpl>_c0L=%;{UAn23w zr}|$4`Z)hc?9h+4kj5Sin44O^EqbI4(f0%W{uF%^(x43-<3(bI95HeJU|-03M2_`1 zzj2J<>{Jq!qb}M-JyWIh(>UsPh9B~7@IxF6HUAno5^}7!#DbczJ^ql8|8M!{q}{uhj150g z469OW&Y=fmRVZHdaJ{jUi$aK8!qfADpq)`*0vT1)03yB z?zGmY*IYG{t-UeyYLzhkz}&zKJLCB4w^#p_I9EC%bXa+SYA?I)7>B{*e<A52bCk z$P8}M&uAAmWJmKO#;O;`4X06X;V!NrdSTweL3+`>hjh%{p0T}GgvH6zJrgW)R~oz9 z2hXXWQ@3>3o69FVY~rLoZQeU|!Pb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BBZom@p%GQv@<* zY_d?O^pP1Yj)8#`3q&xPVIDKNBAK8SXImPnEvYn^%DoQlpuWmXD=00E0Hvh>s{po( zkMx$(5m2U-U|eAz{D`*lKmt7_S86EjO_p*$+I3AEP}e*&m7A}oM@m@bqgH+^TtQ9u#pA`3$Qd{WB*7< lTlPlK#Vtv*p0S|Z@LI8~X`@zFwpT*1J<+ggfByUZ{WtPU)@}d* literal 0 HcmV?d00001 diff --git a/package.json b/package.json new file mode 100644 index 0000000..3ecc0fc --- /dev/null +++ b/package.json @@ -0,0 +1,30 @@ +{ + "name": "ring-of-gyges", + "version": "0.0.0", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "description": "", + "scripts": { + "build": "bun run build.mjs", + "prepublishOnly": "bun run build" + }, + "files": [ + "dist" + ], + "keywords": [ + "bun" + ], + "license": "MIT", + "homepage": "https://github.com/wobsoriano/pkg-name#readme", + "repository": { + "type": "git", + "url": "git+https://github.com/wobsoriano/pkg-name.git" + }, + "bugs": "https://github.com/wobsoriano/pkg-name/issues", + "author": "Robert Soriano ", + "devDependencies": { + "bun-plugin-dts": "^0.2.1", + "@types/bun": "^1.0.0", + "typescript": "^5.2.2" + } +} \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..e1c8f2c --- /dev/null +++ b/src/index.ts @@ -0,0 +1,2 @@ +export const one = 1 +export const two = 2 diff --git a/test/index.test.ts b/test/index.test.ts new file mode 100644 index 0000000..ecd2e9e --- /dev/null +++ b/test/index.test.ts @@ -0,0 +1,12 @@ +import { describe, it, expect } from 'bun:test' +import { one, two } from '../src' + +describe('should', () => { + it('export 1', () => { + expect(one).toBe(1) + }) + + it('export 2', () => { + expect(two).toBe(2) + }) +}) diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..b7cd75b --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,16 @@ +{ + "compilerOptions": { + "target": "es2020", + "module": "esnext", + "strict": true, + "esModuleInterop": true, + "moduleResolution": "node", + "skipLibCheck": true, + "noUnusedLocals": true, + "noImplicitAny": true, + "allowJs": true, + "noEmit": true, + "outDir": "dist", + "resolveJsonModule": true + } +}