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 0000000..7b8645e Binary files /dev/null and b/bun.lockb differ 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 + } +}