generated from JS-DevTools/template-node-typescript
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit de642e5
Showing
32 changed files
with
1,029 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Editor config | ||
# http://EditorConfig.org | ||
|
||
# This EditorConfig overrides any parent EditorConfigs | ||
root = true | ||
|
||
# Default rules applied to all file types | ||
[*] | ||
|
||
# No trailing spaces, newline at EOF | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
end_of_line = lf | ||
|
||
# 2 space indentation | ||
indent_style = space | ||
indent_size = 2 | ||
|
||
# JavaScript-specific settings | ||
[*.{js,ts}] | ||
quote_type = double | ||
continuation_indent_size = 2 | ||
curly_bracket_next_line = false | ||
indent_brace_style = BSD | ||
spaces_around_operators = true | ||
spaces_around_brackets = none |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Git attributes | ||
# https://git-scm.com/docs/gitattributes | ||
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes | ||
|
||
# Normalize line endings for all files that git determines to be text. | ||
# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvalueauto | ||
* text=auto | ||
|
||
# Normalize line endings to LF on checkin, and do NOT convert to CRLF when checking-out on Windows. | ||
# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvaluelf | ||
*.txt text eol=lf | ||
*.html text eol=lf | ||
*.md text eol=lf | ||
*.css text eol=lf | ||
*.scss text eol=lf | ||
*.map text eol=lf | ||
*.js text eol=lf | ||
*.jsx text eol=lf | ||
*.ts text eol=lf | ||
*.tsx text eol=lf | ||
*.json text eol=lf | ||
*.yml text eol=lf | ||
*.yaml text eol=lf | ||
*.xml text eol=lf | ||
*.svg text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Git ignore | ||
# https://git-scm.com/docs/gitignore | ||
|
||
# Private files | ||
.env | ||
|
||
# Miscellaneous | ||
*~ | ||
*# | ||
.DS_STORE | ||
Thumbs.db | ||
.netbeans | ||
nbproject | ||
.node_history | ||
|
||
# IDEs & Text Editors | ||
.idea | ||
.sublime-* | ||
.vscode/settings.json | ||
.netbeans | ||
nbproject | ||
|
||
# Temporary files | ||
.tmp | ||
.temp | ||
.grunt | ||
.lock-wscript | ||
|
||
# Logs | ||
/logs | ||
*.log | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
|
||
# Dependencies | ||
node_modules | ||
|
||
# Build output | ||
/lib | ||
|
||
# Test output | ||
/.nyc_output | ||
/coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Mocha options | ||
# https://mochajs.org/#configuring-mocha-nodejs | ||
# https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml | ||
|
||
spec: | ||
# Test fixtures | ||
- test/fixtures/**/*.js | ||
|
||
# Test specs | ||
- test/specs/**/*.spec.js | ||
|
||
bail: true | ||
recursive: true | ||
require: source-map-support/register |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# NYC config | ||
# https://github.com/istanbuljs/nyc#configuration-files | ||
|
||
extension: | ||
- .js | ||
- .ts | ||
|
||
reporter: | ||
- text | ||
- lcov |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Travis CI config | ||
# http://docs.travis-ci.com/user/languages/javascript-with-nodejs/ | ||
# https://docs.travis-ci.com/user/customizing-the-build/ | ||
# https://docs.travis-ci.com/user/migrating-from-legacy/ | ||
|
||
filter_secrets: false | ||
language: node_js | ||
|
||
node_js: | ||
- 8 | ||
- 10 | ||
- 12 | ||
|
||
os: | ||
- linux | ||
- osx | ||
- windows | ||
|
||
before_script: | ||
- npm run lint | ||
- npm run build | ||
|
||
script: | ||
- npm run coverage | ||
|
||
after_success: | ||
# send code-coverage data to Coveralls | ||
- cat ./coverage/lcov.info | coveralls | ||
|
||
jobs: | ||
include: | ||
- stage: Deploy | ||
name: Publish to npm | ||
script: true | ||
after_success: true | ||
deploy: | ||
provider: npm | ||
email: $NPM_EMAIL | ||
api_key: $NPM_API_KEY | ||
skip_cleanup: true | ||
on: | ||
tags: true | ||
branch: master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// VSCode Launch Configuration | ||
// https://code.visualstudio.com/docs/editor/debugging#_launch-configurations | ||
|
||
// Available variables which can be used inside of strings. | ||
// ${workspaceRoot}: the root folder of the team | ||
// ${file}: the current opened file | ||
// ${fileBasename}: the current opened file's basename | ||
// ${fileDirname}: the current opened file's dirname | ||
// ${fileExtname}: the current opened file's extension | ||
// ${cwd}: the current working directory of the spawned process | ||
|
||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Run Mocha", | ||
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha", | ||
"args": [ | ||
"--timeout=60000", | ||
"--retries=0", | ||
], | ||
"outFiles": [ | ||
"${workspaceFolder}/lib/**/*.js" | ||
], | ||
"smartStep": true, | ||
"skipFiles": [ | ||
"<node_internals>/**/*.js" | ||
], | ||
}, | ||
|
||
|
||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Run CLI", | ||
"program": "${workspaceRoot}/bin/project-cli-name.js", | ||
"args": [], | ||
"env": { | ||
"NODE_ENV": "development" | ||
}, | ||
"outputCapture": "std", | ||
"outFiles": [ | ||
"${workspaceFolder}/lib/**/*.js" | ||
], | ||
"smartStep": true, | ||
"skipFiles": [ | ||
"<node_internals>/**/*.js" | ||
], | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// VSCode Tasks | ||
// https://code.visualstudio.com/docs/editor/tasks | ||
|
||
// Available variables which can be used inside of strings. | ||
// ${workspaceRoot}: the root folder of the team | ||
// ${file}: the current opened file | ||
// ${fileBasename}: the current opened file's basename | ||
// ${fileDirname}: the current opened file's dirname | ||
// ${fileExtname}: the current opened file's extension | ||
// ${cwd}: the current working directory of the spawned process | ||
|
||
{ | ||
"version": "2.0.0", | ||
"command": "npm", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "build", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": "$tsc" | ||
}, | ||
|
||
|
||
{ | ||
"type": "npm", | ||
"script": "test", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": "$tslint5" | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
layout: 404 | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2019 James Messinger | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
Node.js TypeScript Template | ||
=========================== | ||
This is a **template repo** for Node.js projects written in TypeScript. This template works for libraries and/or CLIs. | ||
|
||
|
||
|
||
Step 1: Copy this repo | ||
--------------------------------------------- | ||
Create a new git repo and copy the contents of this repo into it. | ||
|
||
|
||
|
||
Step 2: Delete unneeded files | ||
--------------------------------------------- | ||
If you **don't** need a CLI, then: | ||
- Delete the following files and directories: | ||
- `bin` | ||
- `src/cli` | ||
- `test/specs/cli.spec.js` | ||
- `test/utils/project-cli-name.js` | ||
- Delete the following fields in `package.json`: | ||
- `bin` | ||
- `files.bin` | ||
- `devDependencies.chai-exec` | ||
- `devDependencies.@types/command-line-args` | ||
- `dependencies.command-line-args` | ||
- Delete the `Run CLI` config from `.vscode/launch.json` | ||
|
||
|
||
|
||
Step 3: Replace placeholders | ||
--------------------------------------------- | ||
Replace all occurrences of the following placeholders in all files: | ||
|
||
|Placeholder |Description | ||
|:----------------------------------|:------------------------------------------------------------ | ||
|`project-package-name` |This is the name of the NPM package. It should also match the GitHub repo name. It should be kebab-cased. | ||
|`project-cli-name` |The name of the CLI program for this project, if any. | ||
|`projectExportName` |The name of the library's default export, if any. This should be a valid JavaScript identifier name. | ||
|`Friendly Project Name` |This is the human friendly name of the project that is used in the ReadMe, descriptions, and docs pages | ||
|`This is the project description` |A short, human friendly description of the project that is used in the ReadMe and package.json | ||
|
||
|
||
|
||
Step 4: TODOs | ||
--------------------------------------------- | ||
Find all "TODO" notes in the code and follow their instructions. | ||
|
||
|
||
|
||
Step 5: ReadMe | ||
--------------------------------------------- | ||
Delete this file and replace it with `README_md`. |
Oops, something went wrong.