├── .github └── workflows │ ├── deno.yml │ └── test.yml ├── .releaserc.json ├── .vscode └── settings.json ├── LICENSE ├── README.md ├── _config.yml ├── cli.ts ├── mod.ts └── mod_test.ts /.github/workflows/deno.yml: -------------------------------------------------------------------------------- 1 | name: Deno CI 2 | on: 3 | push: 4 | branches: 5 | - master 6 | jobs: 7 | build: 8 | name: ${{ matrix.kind }} ${{ matrix.os }} 9 | runs-on: ${{ matrix.os }} 10 | if: "!contains(github.event.head_commit.message, '[skip ci]')" 11 | strategy: 12 | matrix: 13 | os: [macOS-latest, ubuntu-latest, windows-latest] 14 | env: 15 | GH_ACTIONS: true 16 | DENO_BUILD_MODE: release 17 | V8_BINARY: true 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Setup Deno 21 | uses: denolib/setup-deno@master 22 | with: 23 | deno-version: 1.x 24 | - name: Tests 25 | run: deno test --allow-read 26 | release: 27 | name: Release 28 | runs-on: ubuntu-18.04 29 | if: "!contains(github.event.head_commit.message, '[skip ci]')" 30 | steps: 31 | - name: Checkout 32 | uses: actions/checkout@v2 33 | - name: Setup Node.js 34 | uses: actions/setup-node@v1 35 | with: 36 | node-version: 12.17.0 37 | - name: Setup package.json 38 | run: echo '{"name":"@denorg/starter","version":"0.0.0","publishConfig":{"access":"public"},"scripts":{"semantic-release":"semantic-release"},"repository":{"type":"git","url":"https://github.com/denorg/starter.git"},"author":"Denorg","license":"MIT","bugs":{"url":"https://github.com/denorg/starter/issues"},"homepage":"https://denorg.github.io/starter/","devDependencies":{"semantic-release":"^17.0.4","semantic-release-gitmoji":"^1.3.3"}}' > package.json 39 | - name: Install dependencies 40 | run: npm install 41 | - name: Release 42 | run: npx semantic-release 43 | env: 44 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 45 | NPM_TOKEN: ${{ secrets.NPM_TOKEN }} 46 | -------------------------------------------------------------------------------- /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | name: Test CI 2 | on: 3 | push: 4 | branches-ignore: 5 | - "master" 6 | pull_request: 7 | branches-ignore: 8 | - "master" 9 | jobs: 10 | build: 11 | name: ${{ matrix.kind }} ${{ matrix.os }} 12 | runs-on: ${{ matrix.os }} 13 | if: "!contains(github.event.head_commit.message, '[skip ci]')" 14 | strategy: 15 | matrix: 16 | os: [macOS-latest, ubuntu-latest, windows-latest] 17 | env: 18 | GH_ACTIONS: true 19 | DENO_BUILD_MODE: release 20 | V8_BINARY: true 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Setup Deno 24 | uses: denolib/setup-deno@master 25 | with: 26 | deno-version: 1.x 27 | - name: Run tests 28 | run: deno test --allow-read 29 | -------------------------------------------------------------------------------- /.releaserc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | [ 4 | "semantic-release-gitmoji", 5 | { 6 | "releaseRules": { 7 | "patch": { 8 | "include": [":bento:", ":recycle:"] 9 | } 10 | } 11 | } 12 | ], 13 | "@semantic-release/github", 14 | "@semantic-release/npm" 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "deno.enable": true 3 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Anand Chowdhary 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🏁 Deno Starter 2 | 3 | This is a starter template for building Deno packages in TypeScript, with GitHub Actions-powered CI, tests, CLI, and Semantic Release on GitHub and npm. 4 | 5 | [![Deno CI](https://github.com/denorg/starter/workflows/Deno%20CI/badge.svg)](https://github.com/denorg/starter/actions) 6 | [![GitHub](https://img.shields.io/github/license/denorg/starter)](https://github.com/denorg/starter/blob/master/LICENSE) 7 | [![Contributors](https://img.shields.io/github/contributors/denorg/starter)](https://github.com/denorg/starter/graphs/contributors) 8 | [![Deno Starter](https://img.shields.io/badge/deno-starter-brightgreen)](https://denorg.github.io/starter/) 9 | [![Made by Denorg](https://img.shields.io/badge/made%20by-denorg-0082fb)](https://github.com/denorg) 10 | [![TypeScript](https://img.shields.io/badge/types-TypeScript-blue)](https://github.com/denorg/starter) 11 | [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release) 12 | 13 | ## 💡 How to use 14 | 15 | 1. [Create a new repository](https://github.com/denorg/starter/generate) using this template 16 | 2. Update the project name ("Deno Starter") from the first line in `README.md` 17 | 3. Find and replace "denorg/starter" with your "username/repository" in `README.md` 18 | 4. Update the "Getting started" guide with your exported functions' names 19 | 5. In `.github/workflows/*.yml` files, add additional permissions after `deno test` 20 | 6. Setup Semantic Release 21 | - Add a repository secret `NPM_TOKEN` with your npm token 22 | - In `.github/workflows/deno.yml`, find and replace "denorg/starter" with your "username/repository" 23 | 7. Remove this section ("How to use") after setting up your respoitory 24 | 25 | If you're not building a Denorg project, the following steps are required too: 26 | 27 | 1. Remove the "A project by Denorg..." footer from `README.md` 28 | 2. Remove the "Made by Denorg" shield from the `README.md` badges section 29 | 3. Change the "Denorg" name to yours in `LICENSE` and under "License" in `README.md` 30 | 31 | ## ⭐ Getting started 32 | 33 | Import the `mode` function and use it: 34 | 35 | ```ts 36 | import { mode } from "https://raw.githubusercontent.com/denorg/starter/master/mod.ts"; 37 | 38 | const result = mode(); 39 | ``` 40 | 41 | ### CLI with [DPX](https://github.com/denorg/dpx) 42 | 43 | After [installing DPX](https://github.com/denorg/dpx), you can directly use the CLI using the `dpx` command: 44 | 45 | ```bash 46 | dpx --allow-read starter 47 | ``` 48 | 49 | ### CLI 50 | 51 | Alternatively, you can use it directly from the CLI by using `deno run`: 52 | 53 | ```bash 54 | deno run --allow-read https://raw.githubusercontent.com/denorg/starter/master/cli.ts 55 | ``` 56 | 57 | You can also install it globally using the following: 58 | 59 | ```bash 60 | deno install --allow-read -n starter https://raw.githubusercontent.com/denorg/starter/master/cli.ts 61 | ``` 62 | 63 | Then, the package is available to run: 64 | 65 | ```bash 66 | starter 67 | ``` 68 | 69 | ### Configuration 70 | 71 | Required permissions: 72 | 73 | 1. `--allow-read` 74 | 75 | ## 👩‍💻 Development 76 | 77 | Run tests: 78 | 79 | ```bash 80 | deno test --allow-read 81 | ``` 82 | 83 | ## 📄 License 84 | 85 | MIT © [Denorg](https://den.org.in) 86 | 87 |

88 | 89 | 90 | 91 |

92 |

93 | A project by Denorg, the world's first Deno-focused community
organization and consulting company. Work with us →
94 |

95 | -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-minimal 2 | -------------------------------------------------------------------------------- /cli.ts: -------------------------------------------------------------------------------- 1 | import { mode } from "./mod.ts"; 2 | 3 | // https://deno.land/manual/tools/script_installer 4 | if (import.meta.main) { 5 | for (let arg of Deno.args) { 6 | console.log(arg, mode()); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /mod.ts: -------------------------------------------------------------------------------- 1 | /** JSDoc for this line */ 2 | export function mode() { 3 | return 0; 4 | } 5 | -------------------------------------------------------------------------------- /mod_test.ts: -------------------------------------------------------------------------------- 1 | import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; 2 | import { mode } from "./mod.ts"; 3 | 4 | Deno.test("test starter function", async (): Promise => { 5 | assertEquals(mode(), 0); 6 | }); 7 | --------------------------------------------------------------------------------