Skip to content

Commit 5a48cd8

Browse files
committedJun 15, 2019
Initial commit
0 parents  commit 5a48cd8

31 files changed

+1005
-0
lines changed
 

‎.editorconfig

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Editor config
2+
# http://EditorConfig.org
3+
4+
# This EditorConfig overrides any parent EditorConfigs
5+
root = true
6+
7+
# Default rules applied to all file types
8+
[*]
9+
10+
# No trailing spaces, newline at EOF
11+
charset = utf-8
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true
14+
end_of_line = lf
15+
16+
# 2 space indentation
17+
indent_style = space
18+
indent_size = 2
19+
20+
# JavaScript-specific settings
21+
[*.{js,ts}]
22+
quote_type = double
23+
continuation_indent_size = 2
24+
curly_bracket_next_line = false
25+
indent_brace_style = BSD
26+
spaces_around_operators = true
27+
spaces_around_brackets = none

‎.gitattributes

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Git attributes
2+
# https://git-scm.com/docs/gitattributes
3+
# https://git-scm.com/book/en/v2/Customizing-Git-Git-Attributes
4+
5+
# Normalize line endings for all files that git determines to be text.
6+
# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvalueauto
7+
* text=auto
8+
9+
# Normalize line endings to LF on checkin, and do NOT convert to CRLF when checking-out on Windows.
10+
# https://git-scm.com/docs/gitattributes#gitattributes-Settostringvaluelf
11+
*.txt text eol=lf
12+
*.html text eol=lf
13+
*.md text eol=lf
14+
*.css text eol=lf
15+
*.scss text eol=lf
16+
*.map text eol=lf
17+
*.js text eol=lf
18+
*.jsx text eol=lf
19+
*.ts text eol=lf
20+
*.tsx text eol=lf
21+
*.json text eol=lf
22+
*.yml text eol=lf
23+
*.yaml text eol=lf
24+
*.xml text eol=lf
25+
*.svg text eol=lf

‎.gitignore

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Git ignore
2+
# https://git-scm.com/docs/gitignore
3+
4+
# Miscellaneous
5+
*~
6+
*#
7+
.DS_STORE
8+
Thumbs.db
9+
.netbeans
10+
nbproject
11+
.node_history
12+
13+
# IDEs & Text Editors
14+
.idea
15+
.sublime-*
16+
.vscode/settings.json
17+
.netbeans
18+
nbproject
19+
20+
# Temporary files
21+
.tmp
22+
.temp
23+
.grunt
24+
.lock-wscript
25+
26+
# Logs
27+
/logs
28+
*.log
29+
30+
# Runtime data
31+
pids
32+
*.pid
33+
*.seed
34+
35+
# Dependencies
36+
node_modules
37+
38+
# Build output
39+
/lib
40+
41+
# Test output
42+
/.nyc_output
43+
/coverage

‎.mocharc.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Mocha options
2+
# https://mochajs.org/#configuring-mocha-nodejs
3+
# https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.yml
4+
5+
spec:
6+
# Test fixtures
7+
- test/fixtures/**/*.js
8+
9+
# Test specs
10+
- test/specs/**/*.spec.js
11+
12+
bail: true
13+
recursive: true

‎.travis.yml

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Travis CI config
2+
# http://docs.travis-ci.com/user/languages/javascript-with-nodejs/
3+
# https://docs.travis-ci.com/user/customizing-the-build/
4+
# https://docs.travis-ci.com/user/migrating-from-legacy/
5+
6+
filter_secrets: false
7+
language: node_js
8+
9+
node_js:
10+
- 8
11+
- 10
12+
- 12
13+
14+
os:
15+
- linux
16+
- osx
17+
- windows
18+
19+
before_script:
20+
- npm run lint
21+
- npm run build
22+
23+
script:
24+
- npm run coverage
25+
26+
after_success:
27+
# send code-coverage data to Coveralls
28+
- cat ./coverage/lcov.info | coveralls
29+
30+
jobs:
31+
include:
32+
- stage: Deploy
33+
name: Publish to npm
34+
script: true
35+
after_success: true
36+
deploy:
37+
provider: npm
38+
email: $NPM_EMAIL
39+
api_key: $NPM_API_KEY
40+
skip_cleanup: true
41+
on:
42+
tags: true
43+
branch: master

‎.vscode/launch.json

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// VSCode Launch Configuration
2+
// https://code.visualstudio.com/docs/editor/debugging#_launch-configurations
3+
4+
// Available variables which can be used inside of strings.
5+
// ${workspaceRoot}: the root folder of the team
6+
// ${file}: the current opened file
7+
// ${fileBasename}: the current opened file's basename
8+
// ${fileDirname}: the current opened file's dirname
9+
// ${fileExtname}: the current opened file's extension
10+
// ${cwd}: the current working directory of the spawned process
11+
12+
{
13+
"version": "0.2.0",
14+
"configurations": [
15+
{
16+
"type": "node",
17+
"request": "launch",
18+
"name": "Run Mocha",
19+
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
20+
"args": [
21+
"--timeout=60000",
22+
"--retries=0",
23+
],
24+
"outFiles": [
25+
"${workspaceFolder}/lib/**/*.js"
26+
],
27+
"smartStep": true,
28+
"skipFiles": [
29+
"<node_internals>/**/*.js"
30+
],
31+
},
32+
33+
34+
{
35+
"type": "node",
36+
"request": "launch",
37+
"name": "Run CLI",
38+
"program": "${workspaceRoot}/bin/project-cli-name.js",
39+
"args": [],
40+
"env": {
41+
"NODE_ENV": "development"
42+
},
43+
"outputCapture": "std",
44+
"outFiles": [
45+
"${workspaceFolder}/lib/**/*.js"
46+
],
47+
"smartStep": true,
48+
"skipFiles": [
49+
"<node_internals>/**/*.js"
50+
],
51+
}
52+
]
53+
}

‎.vscode/tasks.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// VSCode Tasks
2+
// https://code.visualstudio.com/docs/editor/tasks
3+
4+
// Available variables which can be used inside of strings.
5+
// ${workspaceRoot}: the root folder of the team
6+
// ${file}: the current opened file
7+
// ${fileBasename}: the current opened file's basename
8+
// ${fileDirname}: the current opened file's dirname
9+
// ${fileExtname}: the current opened file's extension
10+
// ${cwd}: the current working directory of the spawned process
11+
12+
{
13+
"version": "2.0.0",
14+
"command": "npm",
15+
"tasks": [
16+
{
17+
"type": "npm",
18+
"script": "build",
19+
"group": {
20+
"kind": "build",
21+
"isDefault": true
22+
},
23+
"problemMatcher": "$tsc"
24+
},
25+
26+
27+
{
28+
"type": "npm",
29+
"script": "test",
30+
"group": {
31+
"kind": "test",
32+
"isDefault": true
33+
},
34+
},
35+
]
36+
}

‎404.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
layout: 404
3+
---

‎LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2019 James Messinger
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
13+
all 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
21+
THE SOFTWARE.

‎README.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Node.js TypeScript Template
2+
===========================
3+
This is a **template repo** for Node.js projects written in TypeScript. This template works for libraries and/or CLIs.
4+
5+
6+
7+
Step 1: Copy this repo
8+
---------------------------------------------
9+
Create a new git repo and copy the contents of this repo into it.
10+
11+
12+
13+
Step 2: Delete unneeded files
14+
---------------------------------------------
15+
If you **don't** need a CLI, then:
16+
- Delete the following files and directories:
17+
- `bin`
18+
- `src/cli`
19+
- `test/specs/cli.spec.js`
20+
- `test/utils/project-cli-name.js`
21+
- Delete the following fields in `package.json`:
22+
- `bin`
23+
- `files.bin`
24+
- `devDependencies.chai-exec`
25+
- `dependencies.command-line-args`
26+
27+
28+
29+
Step 3: Replace placeholders
30+
---------------------------------------------
31+
Replace all occurrences of the following placeholders in all files:
32+
33+
|Placeholder |Description
34+
|:----------------------------------|:------------------------------------------------------------
35+
|`project-package-name` |This is the name of the NPM package. It should also match the GitHub repo name. It should be kebab-cased.
36+
|`project-cli-name` |The name of the CLI program for this project, if any.
37+
|`projectExportName` |The name of the library's default export, if any. This should be a valid JavaScript identifier name.
38+
|`Friendly Project Name` |This is the human friendly name of the project that is used in the ReadMe, descriptions, and docs pages
39+
|`This is the project description` |A short, human friendly description of the project that is used in the ReadMe and package.json
40+
41+
42+
43+
Step 4: TODOs
44+
---------------------------------------------
45+
Find all "TODO" notes in the code and follow their instructions.
46+
47+
48+
49+
Step 5: ReadMe
50+
---------------------------------------------
51+
Delete this file and replace it with `README_md`.

0 commit comments

Comments
 (0)
Failed to load comments.