feat: use typescript 3.0 project references
this simplifies test config a bit
MODIFY
package.json
package.json
"bin": "./bin/run",
"bugs": "https://github.com/oclif/oclif/issues",
"dependencies": {
- "@oclif/command": "^1.5.0",
+ "@oclif/command": "^1.5.1",
"@oclif/config": "^1.7.6",
- "@oclif/errors": "^1.2.0",
+ "@oclif/errors": "^1.2.1",
"@oclif/fixpack": "^2.3.0",
"@oclif/plugin-help": "^2.1.2",
"@oclif/plugin-not-found": "^1.2.0",
- "@oclif/plugin-warn-if-update-available": "^1.5.2",
+ "@oclif/plugin-warn-if-update-available": "^1.5.3",
"debug": "^4.0.1",
"lodash": "^4.17.11",
"nps-utils": "^1.7.0",
"yosay": "^2.0.2"
},
"devDependencies": {
- "@oclif/dev-cli": "^1.18.0",
+ "@oclif/dev-cli": "^1.18.1",
"@oclif/tslint": "^3.1.0",
"@types/lodash": "^4.14.116",
"@types/read-pkg": "^3.0.0",
"@types/yeoman-generator": "^2.0.3",
"@types/yosay": "^0.0.29",
"chai": "^4.1.2",
- "eslint": "^5.5.0",
+ "eslint": "^5.6.0",
"eslint-config-oclif": "^3.1.0",
"execa": "^1.0.0",
"fancy-test": "^1.4.1",

MODIFY
src/generators/app.ts
src/generators/app.ts
@@ -361,7 +361,6 @@ class App extends Generator {
if (eslintignore.trim()) this.fs.write(this.destinationPath('.eslintignore'), this._eslintignore())
}
if (this.mocha) {
- this.fs.copyTpl(this.templatePath('test/helpers/init.js'), this.destinationPath('test/helpers/init.js'), this)
this.fs.copyTpl(this.templatePath('test/mocha.opts'), this.destinationPath('test/mocha.opts'), this)
}
if (this.fs.exists(this.destinationPath('./package.json'))) {
@@ -372,10 +371,6 @@ class App extends Generator {
this.fs.writeJSON(this.destinationPath('./package.json'), sortPjson(this.pjson))
this.fs.copyTpl(this.templatePath('editorconfig'), this.destinationPath('.editorconfig'), this)
if (this.circleci) {
- // if (this.semantic_release) {
- // this.fs.copyTpl(this.templatePath('scripts/release'), this.destinationPath('.circleci/release'), this)
- // }
- // this.fs.copyTpl(this.templatePath('scripts/setup_git'), this.destinationPath('.circleci/setup_git'), this)
this.fs.copyTpl(this.templatePath('circle.yml.ejs'), this.destinationPath('.circleci/config.yml'), this)
}
if (this.appveyor) {
@@ -386,10 +381,6 @@ class App extends Generator {
this.fs.copyTpl(this.templatePath('LICENSE.mit'), this.destinationPath('LICENSE'), this)
}
- // git
- // if (this.fromScratch) this.spawnCommandSync('git', ['init'])
- this.fs.copyTpl(this.templatePath('gitattributes'), this.destinationPath('.gitattributes'), this)
-
this.fs.write(this.destinationPath('.gitignore'), this._gitignore())
switch (this.type) {

DELETE
templates/test/helpers/init.js
-const path = require('path')
-process.env.TS_NODE_PROJECT = path.resolve('test/tsconfig.json')

MODIFY
templates/test/mocha.opts
templates/test/mocha.opts
---require test/helpers/init.js
<%= ts ? '--require ts-node/register\n--require source-map-support/register\n--watch-extensions ts\n' : '' _%>
--recursive
--reporter spec

MODIFY
templates/test/tsconfig.json
templates/test/tsconfig.json
{
- "declaration": false,
"extends": "../tsconfig",
"compilerOptions": {
- "sourceMap": true
+ "noEmit": true
},
- "include": [
- "./**/*",
- "../src/**/*"
+ "references": [
+ {"path": ".."}
]
}

MODIFY
templates/tsconfig.json
templates/tsconfig.json
{
"compilerOptions": {
"declaration": true,
- "forceConsistentCasingInFileNames": true,
"importHelpers": true,
"module": "commonjs",
- "outDir": "./lib",
- "rootDirs": [ "./src" ],
+ "outDir": "lib",
+ "rootDir": "src",
"strict": true,
"target": "es2017",
- "typeRoots": [ "./node_modules/@types" ]
+ "composite": true
},
"include": [
- "./src/**/*"
+ "src/**/*"
]
}

MODIFY
yarn.lock
yarn.lock
supports-color "^5.4.0"
tslib "^1"
-"@oclif/command@^1.5.0":
- version "1.5.0"
- resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.5.0.tgz#d5276a19506349fff0254b0dd98e3b8a2bd971aa"
+"@oclif/command@^1.5.0", "@oclif/command@^1.5.1":
+ version "1.5.1"
+ resolved "https://registry.yarnpkg.com/@oclif/command/-/command-1.5.1.tgz#dd2e1c1f8e55dad73036d4cab036ac3550ff8c24"
dependencies:
- "@oclif/errors" "^1.1.2"
- "@oclif/parser" "^3.6.0"
- debug "^3.1.0"
- semver "^5.5.0"
+ "@oclif/errors" "^1.2.0"
+ "@oclif/parser" "^3.6.1"
+ debug "^4.0.1"
+ semver "^5.5.1"
-"@oclif/config@^1.7.2", "@oclif/config@^1.7.4", "@oclif/config@^1.7.6":
+"@oclif/config@^1.7.6":
version "1.7.6"
resolved "https://registry.yarnpkg.com/@oclif/config/-/config-1.7.6.tgz#849e5f79591c8dd29d99dd3aba0914b50e2c2e74"
dependencies:
debug "^4.0.1"
tslib "^1.9.3"
-"@oclif/dev-cli@^1.18.0":
- version "1.18.0"
- resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.18.0.tgz#729f8530dd183b2cbb9f92d6caee5ec5b490b5b5"
+"@oclif/dev-cli@^1.18.1":
+ version "1.18.1"
+ resolved "https://registry.yarnpkg.com/@oclif/dev-cli/-/dev-cli-1.18.1.tgz#e53a6fa13749262e0fe2495e59e7e2fa38c356d5"
dependencies:
- "@oclif/command" "^1.5.0"
- "@oclif/config" "^1.7.4"
- "@oclif/errors" "^1.2.0"
- "@oclif/plugin-help" "^2.1.1"
- cli-ux "^4.8.1"
- debug "^3.1.0"
+ "@oclif/command" "^1.5.1"
+ "@oclif/config" "^1.7.6"
+ "@oclif/errors" "^1.2.1"
+ "@oclif/plugin-help" "^2.1.2"
+ cli-ux "^4.8.2"
+ debug "^4.0.1"
fs-extra "^7.0.0"
- lodash "^4.17.10"
+ lodash "^4.17.11"
normalize-package-data "^2.4.0"
qqjs "^0.3.10"
tslib "^1.9.3"
-"@oclif/errors@^1.1.2", "@oclif/errors@^1.2.0":
- version "1.2.0"
- resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.2.0.tgz#4166952699724c25af2ab4528fe223e930655e72"
+"@oclif/errors@^1.2.0", "@oclif/errors@^1.2.1":
+ version "1.2.1"
+ resolved "https://registry.yarnpkg.com/@oclif/errors/-/errors-1.2.1.tgz#3d655bec6ce7eb7df2f3cd39c23eb62f0470b77d"
dependencies:
clean-stack "^1.3.0"
fs-extra "^7.0.0"
indent-string "^3.2.0"
strip-ansi "^4.0.0"
- wrap-ansi "^3.0.1"
+ wrap-ansi "^4.0.0"
"@oclif/fixpack@^2.3.0":
version "2.3.0"
version "1.0.0"
resolved "https://registry.yarnpkg.com/@oclif/linewrap/-/linewrap-1.0.0.tgz#aedcb64b479d4db7be24196384897b5000901d91"
-"@oclif/parser@^3.6.0":
+"@oclif/parser@^3.6.1":
version "3.6.1"
resolved "https://registry.yarnpkg.com/@oclif/parser/-/parser-3.6.1.tgz#dd0ad29d9178d75a2de30314874a6167675925ed"
dependencies:
chalk "^2.4.1"
tslib "^1.9.3"
-"@oclif/plugin-help@^2.1.1", "@oclif/plugin-help@^2.1.2":
+"@oclif/plugin-help@^2.1.2":
version "2.1.2"
resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-2.1.2.tgz#b6639e95157f563225a29b4329ce62e2e162afe9"
dependencies:
fast-levenshtein "^2.0.6"
lodash "^4.17.10"
-"@oclif/plugin-warn-if-update-available@^1.5.2":
- version "1.5.2"
- resolved "https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.5.2.tgz#b1e06a9e1c9d2f079f39831b67d2b1d8cb95d264"
+"@oclif/plugin-warn-if-update-available@^1.5.3":
+ version "1.5.3"
+ resolved "https://registry.yarnpkg.com/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-1.5.3.tgz#63734fd61c06558234176cb684a33bc7137facb0"
dependencies:
"@oclif/command" "^1.5.0"
- "@oclif/config" "^1.7.2"
+ "@oclif/config" "^1.7.6"
"@oclif/errors" "^1.2.0"
chalk "^2.4.1"
- debug "^3.1.0"
+ debug "^4.0.1"
fs-extra "^7.0.0"
- http-call "^5.2.1"
+ http-call "^5.2.2"
semver "^5.5.1"
"@oclif/screen@^1.0.2":
- version "1.0.2"
- resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.2.tgz#c9d7c84b0ea60ecec8dd7a9b22c012ba9967aed8"
+ version "1.0.3"
+ resolved "https://registry.yarnpkg.com/@oclif/screen/-/screen-1.0.3.tgz#da9f3481a0e386abd36ac7c0d2fe6e1d8c1058f7"
"@oclif/tslint@^3.1.0":
version "3.1.0"
@@ -669,7 +669,7 @@ cli-table@^0.3.1:
dependencies:
colors "1.0.3"
-cli-ux@^4.7.3, cli-ux@^4.8.1:
+cli-ux@^4.7.3, cli-ux@^4.8.2:
version "4.8.2"
resolved "https://registry.yarnpkg.com/cli-ux/-/cli-ux-4.8.2.tgz#6be3c966919727106fba875de1dc771b2567de1d"
dependencies:
@@ -1121,9 +1121,9 @@ eslint-visitor-keys@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#3f3180fb2e291017716acb4c9d6d5b5c34a6a81d"
-eslint@^5.5.0:
- version "5.5.0"
- resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.5.0.tgz#8557fcceab5141a8197da9ffd9904f89f64425c6"
+eslint@^5.6.0:
+ version "5.6.0"
+ resolved "https://registry.yarnpkg.com/eslint/-/eslint-5.6.0.tgz#b6f7806041af01f71b3f1895cbb20971ea4b6223"
dependencies:
"@babel/code-frame" "^7.0.0"
ajv "^6.5.3"
@@ -1673,7 +1673,7 @@ hosted-git-info@^2.1.4:
version "2.7.1"
resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.7.1.tgz#97f236977bd6e125408930ff6de3eec6281ec047"
-http-call@^5.1.2, http-call@^5.2.1:
+http-call@^5.1.2, http-call@^5.2.2:
version "5.2.2"
resolved "https://registry.yarnpkg.com/http-call/-/http-call-5.2.2.tgz#d8eb37eef701e566d44373ef19b22444ebb7c02e"
dependencies:
@@ -3591,13 +3591,6 @@ wrap-ansi@^2.0.0:
string-width "^1.0.1"
strip-ansi "^3.0.1"
-wrap-ansi@^3.0.1:
- version "3.0.1"
- resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-3.0.1.tgz#288a04d87eda5c286e060dfe8f135ce8d007f8ba"
- dependencies:
- string-width "^2.1.1"
- strip-ansi "^4.0.0"
-
wrap-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-4.0.0.tgz#b3570d7c70156159a2d42be5cc942e957f7b1131"

feat: use typescript 3.0 project references

this simplifies test config a bit