[chrome-launcher] Publish type definitions instead of source TypeScript files (https://github.com/GoogleChrome/lighthouse/pull/2898)

* install rimraf types

* enable outputting declaration files

* disable publishing typescript files

* do not check formatting of d.ts files

* do not format d.ts files
This commit is contained in:
Mike Deverell 2017-08-14 10:17:16 -04:00 коммит произвёл Sam Saccone
Родитель 9b094b2a9b
Коммит 7529201747
7 изменённых файлов: 21 добавлений и 5 удалений

Просмотреть файл

@ -9,3 +9,9 @@ test/
.eslintrc.js
.travis.yml
gulpfile.js
# exclude source TypeScript files
*.ts
# allow TypeScript Declaration Files
!*.d.ts

Просмотреть файл

@ -7,12 +7,12 @@
import * as childProcess from 'child_process';
import * as fs from 'fs';
import * as net from 'net';
import * as rimraf from 'rimraf';
import * as chromeFinder from './chrome-finder';
import {getRandomPort} from './random-port';
import {DEFAULT_FLAGS} from './flags';
import {makeTmpDir, defaults, delay} from './utils';
import * as net from 'net';
const rimraf = require('rimraf');
const log = require('lighthouse-logger');
const spawn = childProcess.spawn;
const execSync = childProcess.execSync;

Просмотреть файл

@ -7,7 +7,7 @@
"test": "mocha --require ts-node/register --reporter=dot test/**/*-test.ts --timeout=10000",
"coverage": "nyc yarn test && nyc report --reporter=text-lcov > lcov.info",
"test-formatting": "test/check-formatting.sh",
"format": "clang-format -i -style=file **/*.ts *.ts"
"format": "scripts/format.sh"
},
"devDependencies": {
"@types/mocha": "^2.2.41",
@ -23,6 +23,7 @@
"@types/core-js": "^0.9.41",
"@types/mkdirp": "^0.3.29",
"@types/node": "6.0.66",
"@types/rimraf": "^0.0.28",
"lighthouse-logger": "^1.0.0",
"mkdirp": "0.5.1",
"rimraf": "^2.6.1"

5
scripts/format.sh Executable file
Просмотреть файл

@ -0,0 +1,5 @@
#!/usr/bin/env bash
FILES="`find . -type f \! -path '*node_modules*' \! -name '*.d.ts' -name '*.ts'`"
./node_modules/.bin/clang-format -i -style=file $FILES

Просмотреть файл

@ -12,5 +12,4 @@ check_formatting ()
fi
}
check_formatting "*.ts"
check_formatting "**/*.ts"
check_formatting "`find . -type f \! -path '*node_modules*' \! -name '*.d.ts' -name '*.ts'`"

Просмотреть файл

@ -2,6 +2,7 @@
"compilerOptions": {
"module": "commonjs",
"target": "es2016",
"declaration": true,
"noImplicitAny": true,
"inlineSourceMap": true,
"noEmitOnError": false,

Просмотреть файл

@ -18,6 +18,10 @@
version "6.0.66"
resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.66.tgz#5680b74a6135d33d4c00447e7c3dc691a4601625"
"@types/rimraf@^0.0.28":
version "0.0.28"
resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-0.0.28.tgz#5562519bc7963caca8abf7f128cae3b594d41d06"
"@types/sinon@^2.3.1":
version "2.3.1"
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-2.3.1.tgz#5e214093e9e2345219ab0f31bf310c9790ad0712"