Skip to content

Commit

Permalink
build: ensure documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
EdJoPaTo committed Nov 23, 2023
1 parent 13818ad commit 2c7a6d4
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/deno.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ jobs:
- run: deno lint
- run: deno fmt --check

doc:
runs-on: ubuntu-latest
steps:
- uses: denoland/setup-deno@v1
with:
deno-version: v1.x
- uses: actions/checkout@v4

- run: deno cache source/mod.ts
- run: deno doc --lint source/mod.ts

test:
runs-on: ubuntu-latest
steps:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
/*-*.*.*.tgz
dist
docs
node_modules
2 changes: 1 addition & 1 deletion copy-template-into-existing-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ echo "everything copied"
# Replace template name with folder name
# macOS: add '' after -i like this: sed -i '' "s/…
sed -i "s/deno-node-module-template/$name/g" package.json LICENSE ./*.md ./**/*.md .github/**/*.yml
sed -i "s/deno_node_module_template/$denoname/g" ./*.md ./**/*.md
sed -i "s/deno_node_module_template/$denoname/g" ./*.md ./**/*.md deno.jsonc

deno fmt

Expand Down
4 changes: 4 additions & 0 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"exclude": [
"./dist/",
"./docs/",
"./node_modules/"
],
"fmt": {
Expand All @@ -35,5 +36,8 @@
"no-sparse-arrays"
]
}
},
"tasks": {
"doc": "deno doc --html --name=deno_node_module_template source/mod.ts"
}
}
3 changes: 2 additions & 1 deletion source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@

See the
[README on GitHub](https://github.com/EdJoPaTo/deno-node-module-template#readme)
for more information on this package.
or the
[documentation on deno.land](https://deno.land/x/deno-node-module-template?doc).
5 changes: 5 additions & 0 deletions source/mod.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
* Exemplary code documentation
* @param input defaults to "Glitter"
* @returns more rainbows
*/
export function moduleName(input: string | undefined): string {
if (typeof input !== "string" && input !== undefined) {
throw new TypeError(`Expected a string, got ${typeof input}`);
Expand Down

0 comments on commit 2c7a6d4

Please sign in to comment.