This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Showing
29 changed files
with
11,934 additions
and
258 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,16 @@ | ||
{ | ||
"plugins": [ | ||
"@babel/proposal-object-rest-spread", | ||
"@babel/plugin-proposal-class-properties" | ||
], | ||
"presets": [ | ||
[ | ||
"@babel/env", | ||
{ | ||
"targets": { | ||
"node": "current" | ||
} | ||
} | ||
] | ||
] | ||
} |
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 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 @@ | ||
{ | ||
"env": { | ||
"node": true | ||
}, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:@typescript-eslint/recommended-requiring-type-checking", | ||
"prettier", | ||
"prettier/@typescript-eslint" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"parserOptions": { | ||
"ecmaVersion": 2019, | ||
// "extraFileExtensions": [".vue"], | ||
"parser": "babel-eslint", | ||
"project": "./tsconfig.json", | ||
"sourceType": "module" | ||
}, | ||
"plugins": ["@typescript-eslint"], | ||
"rules": { | ||
"@typescript-eslint/no-explicit-any": 0 | ||
} | ||
} |
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,61 +1,11 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
node_modules | ||
build | ||
test | ||
src/**.js | ||
.idea/* | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
*.log | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# TypeScript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env | ||
|
||
# next.js build output | ||
.next | ||
yarn.lock |
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 @@ | ||
src | ||
test | ||
tsconfig.json | ||
tsconfig.module.json | ||
tslint.json | ||
.travis.yml | ||
.github | ||
.prettierignore | ||
.vscode | ||
build/docs | ||
**/*.spec.* | ||
coverage | ||
.nyc_output | ||
*.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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
sudo: false | ||
language: node_js | ||
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.