Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
justjavac committed Dec 8, 2019
0 parents commit 7944da0
Show file tree
Hide file tree
Showing 9 changed files with 139 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,23 @@
name: ci

on: [push, pull_request]

jobs:
build:
name: run test with deno version ${{ matrix.deno }}
runs-on: ubuntu-latest
strategy:
matrix:
deno: [0.26.0]
steps:
- name: clone repo
uses: actions/checkout@v1
- name: install deno
uses: denolib/setup-deno@master
with:
deno-version: ${{ matrix.deno }}
- name: run tests
run: |
deno --version
deno fmt --check .
deno test --allow-net .
6 changes: 6 additions & 0 deletions .gitignore
@@ -0,0 +1,6 @@
*.log
.cache
.DS_Store
*bak
.history
.temp/**
3 changes: 3 additions & 0 deletions .vscode/extensions.json
@@ -0,0 +1,3 @@
{
"recommendations": ["justjavac.vscode-deno"]
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
@@ -0,0 +1,3 @@
{
"deno.enable": true
}
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,5 @@
# Changelog

## x.y.z - [yyy-mm-dd]

- xxxx
21 changes: 21 additions & 0 deletions LICENSE
@@ -0,0 +1,21 @@
MIT License

Copyright (c) justjavac.

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.
48 changes: 48 additions & 0 deletions README.md
@@ -0,0 +1,48 @@
# deno-starter

[![tag](https://img.shields.io/github/release/denomod/deno-starter)](https://github.com/denomod/deno-starter/releases)
[![Build Status](https://github.com/denomod/deno-starter/workflows/ci/badge.svg?branch=master)](https://github.com/denomod/deno-starter/actions)
[![license](https://img.shields.io/github/license/denomod/deno-starter)](https://github.com/denomod/deno-starter/blob/master/LICENSE)
[![](https://img.shields.io/badge/deno-v0.26.0-green.svg)](https://github.com/denoland/deno)

Quickly start a Deno module.

## 🧐 What's inside?

A quick look at the files and directories you'll see in a Deno project.

.
├─ .github
│ └─ workflows
│ └─ ci.yml
├─ .vscode
├─ .vscode
│ ├─ extensions.json
│ └─ settings.json
├─ .gitignore
├─ CHANGELOG.md
├─ LICENSE
├─ mod_test.ts
├─ mod.ts
└─ README.md

1. **`.github\workflows\ci.yml`**: GitHub Actions.

1. **`.vscode\extensions.json`**: Workspace recommended extensions for Deno Developers.

1. **`.gitignore`**: This file tells git which files it should not track / not maintain a version history for.

1. **`CHANGELOG.md`**: This file contains a curated, chronologically ordered list of notable changes for each version of a project. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

1. **`LICENSE`**: Deno is licensed under the MIT license.

1. **`mod.ts`**: Deno's default entry point. The filename mod.ts follows Rust’s convention, is shorter than index.ts, and doesn’t come with any preconceived notions about how it might work. Deno does not treat "index.js" or "index.ts" in a special way. By using these filenames, it suggests that they can be left out of the module specifier when they cannot. This is confusing.

1. **`mod_test.ts`**: Each module should come with its test as a sibling with the name `modulename_test.ts`. For example the module `foo.ts` should come with its sibling `foo_test.ts`.

1. **`README.md`**: A text file containing useful reference information about your project.

### License

[deno-starter](https://github.com/denomod/deno-starter) is released under the MIT License. See the bundled [LICENSE](./LICENSE) file for details.
15 changes: 15 additions & 0 deletions mod.ts
@@ -0,0 +1,15 @@
/**
* Every exported symbol ideally should have a documentation line.
*
* It is important that documentation is easily human readable,
* but there is also a need to provide additional styling information to ensure
* generated documentation is more rich text.
* Therefore JSDoc should generally follow markdown markup to enrich the text.
*
* follow https://deno.land/std/style_guide.md
*
* @param foo - Description of non obvious parameter
*/
export default function starter(foo: string): string {
return foo;
}
15 changes: 15 additions & 0 deletions mod_test.ts
@@ -0,0 +1,15 @@
import { test } from "https://deno.land/std@v0.24.0/testing/mod.ts";
import { assertEquals } from "https://deno.land/std@v0.24.0/testing/asserts.ts";

import starter from "./mod.ts";

test({
name: "test starter function",
fn(): void {
assertEquals(starter("abc"), "abc");
}
});

test(function myTestFunction(): void {
assertEquals(starter("foo bar"), "foo bar");
});

0 comments on commit 7944da0

Please sign in to comment.