-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
7a7aa77
commit 95c07d6
Showing
71 changed files
with
8,807 additions
and
23,241 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,48 @@ | ||
# https://circleci.com/docs/2.0/language-javascript/ | ||
version: 2 | ||
jobs: | ||
'node-10': | ||
docker: | ||
- image: circleci/node:10 | ||
working_directory: ~/typescript-starter | ||
steps: | ||
- checkout | ||
# Download and cache dependencies | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
# fallback to using the latest cache if no exact match is found | ||
- v1-dependencies- | ||
- run: npm install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- run: npm test | ||
- run: npm run cov:send | ||
- run: npm run cov:check | ||
'node-latest': | ||
docker: | ||
- image: circleci/node:latest | ||
working_directory: ~/typescript-starter | ||
steps: | ||
- checkout | ||
- restore_cache: | ||
keys: | ||
- v1-dependencies-{{ checksum "package.json" }} | ||
- v1-dependencies- | ||
- run: npm install | ||
- save_cache: | ||
paths: | ||
- node_modules | ||
key: v1-dependencies-{{ checksum "package.json" }} | ||
- run: npm test | ||
- run: npm run cov:send | ||
- run: npm run cov:check | ||
|
||
workflows: | ||
version: 2 | ||
build: | ||
jobs: | ||
- 'node-10' | ||
- 'node-latest' |
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,15 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
max_line_length = 80 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 @@ | ||
# Example Contributing Guidelines | ||
|
||
This is an example of GitHub's contributing guidelines file. Check out GitHub's [CONTRIBUTING.md help center article](https://help.github.com/articles/setting-guidelines-for-repository-contributors/) for more information. |
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,11 @@ | ||
* **I'm submitting a ...** | ||
[ ] bug report | ||
[ ] feature request | ||
[ ] question about the decisions made in the repository | ||
[ ] question about how to use this project | ||
|
||
* **Summary** | ||
|
||
|
||
|
||
* **Other information** (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. StackOverflow, personal fork, etc.) |
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,13 @@ | ||
* **What kind of change does this PR introduce?** (Bug fix, feature, docs update, ...) | ||
|
||
|
||
|
||
* **What is the current behavior?** (You can also link to an open issue here) | ||
|
||
|
||
|
||
* **What is the new behavior (if this is a feature change)?** | ||
|
||
|
||
|
||
* **Other information**: |
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 |
---|---|---|
@@ -1,21 +1,13 @@ | ||
.DS_Store | ||
node_modules/ | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
package-lock.json | ||
|
||
# Editor directories and files | ||
.idea | ||
.vscode | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
node_modules | ||
build | ||
test | ||
src/**.js | ||
.idea/* | ||
|
||
# dist/*.js | ||
# dist/*.js.map | ||
coverage | ||
.nyc_output | ||
*.log | ||
|
||
dist/test.js | ||
package-lock.json | ||
|
||
tmpfiles/ | ||
log/* |
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,15 @@ | ||
src | ||
test | ||
tsconfig.json | ||
tsconfig.module.json | ||
tslint.json | ||
.travis.yml | ||
.github | ||
.prettierignore | ||
.vscode | ||
build/docs | ||
**/*.spec.* | ||
coverage | ||
.nyc_output | ||
*.log | ||
log/ |
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,2 @@ | ||
# package.json is formatted by package managers, so we ignore it here | ||
package.json |
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 |
---|---|---|
@@ -1,5 +1,12 @@ | ||
sudo: false | ||
language: node_js | ||
node_js: stable | ||
script: npm run test | ||
notifications: | ||
email: false | ||
node_js: | ||
- '10' | ||
- '12' | ||
# keep the npm cache to speed up installs | ||
cache: | ||
directories: | ||
- '$HOME/.npm' | ||
after_success: | ||
- npm run cov:send | ||
- npm run cov:check |
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,52 @@ | ||
'use strict'; | ||
const meow = require('meow'); | ||
const path = require('path'); | ||
|
||
const tsFile = getTSFile(); | ||
const jsFile = TS2JS(tsFile); | ||
|
||
replaceCLIArg(tsFile, jsFile); | ||
|
||
// Ava debugger | ||
require('ava/profile'); | ||
|
||
/** | ||
* get ts file path from CLI args | ||
* | ||
* @return string path | ||
*/ | ||
function getTSFile() { | ||
const cli = meow(); | ||
return cli.input[0]; | ||
} | ||
|
||
/** | ||
* get associated compiled js file path | ||
* | ||
* @param tsFile path | ||
* @return string path | ||
*/ | ||
function TS2JS(tsFile) { | ||
const srcFolder = path.join(__dirname, '..', 'src'); | ||
const distFolder = path.join(__dirname, '..', 'build', 'main'); | ||
|
||
const tsPathObj = path.parse(tsFile); | ||
|
||
return path.format({ | ||
dir: tsPathObj.dir.replace(srcFolder, distFolder), | ||
ext: '.js', | ||
name: tsPathObj.name, | ||
root: tsPathObj.root | ||
}); | ||
} | ||
|
||
/** | ||
* replace a value in CLI args | ||
* | ||
* @param search value to search | ||
* @param replace value to replace | ||
* @return void | ||
*/ | ||
function replaceCLIArg(search, replace) { | ||
process.argv[process.argv.indexOf(search)] = replace; | ||
} |
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,39 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Project", | ||
// we test in `build` to make cleanup fast and easy | ||
"cwd": "${workspaceFolder}/build", | ||
// Replace this with your project root. If there are multiple, you can | ||
// automatically run the currently visible file with: "program": ${file}" | ||
"program": "${workspaceFolder}/src/cli/cli.ts", | ||
// "args": ["--no-install"], | ||
"outFiles": ["${workspaceFolder}/build/main/**/*.js"], | ||
"skipFiles": [ | ||
"<node_internals>/**/*.js", | ||
"${workspaceFolder}/node_modules/**/*.js" | ||
], | ||
"preLaunchTask": "npm: build", | ||
"stopOnEntry": true, | ||
"smartStep": true, | ||
"runtimeArgs": ["--nolazy"], | ||
"env": { | ||
"TYPESCRIPT_STARTER_REPO_URL": "${workspaceFolder}" | ||
}, | ||
"console": "externalTerminal" | ||
}, | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Debug Spec", | ||
"program": "${workspaceRoot}/.vscode/debug-ts.js", | ||
"args": ["${file}"], | ||
"skipFiles": ["<node_internals>/**/*.js"], | ||
// Consider using `npm run watch` or `yarn watch` for faster debugging | ||
// "preLaunchTask": "npm: build", | ||
// "smartStep": true, | ||
"runtimeArgs": ["--nolazy"] | ||
}] | ||
} |
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,5 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
// "typescript.implementationsCodeLens.enabled": true | ||
// "typescript.referencesCodeLens.enabled": true | ||
} |
Oops, something went wrong.