feat: supported watcher

This commit is contained in:
Wyatt Johnson
2018-07-04 10:17:48 -06:00
parent eacdb7db59
commit 679ad01a7d
9 changed files with 41 additions and 103 deletions
-8
View File
@@ -1,8 +0,0 @@
{
"exec": "npm-run-all compile:relay-stream",
"ext": "ts,tsx,graphql",
"watch": [
"./src/core/client/stream",
"./src/core/**/*.graphql"
]
}
-10
View File
@@ -1,10 +0,0 @@
{
"exec": "npm run start:development",
"ext": "ts,graphql",
"watch": [
"./src"
],
"ignore": [
"./src/client"
]
}
-7
View File
@@ -1,7 +0,0 @@
{
"exec": "npm run compile:server:types",
"ext": "graphql",
"watch": [
"./src/core/server/graph"
]
}
+6
View File
@@ -8,6 +8,12 @@ import {
const config: Config = {
rootDir: path.resolve(__dirname, "../src"),
watchers: {
compileGraphQLTypes: {
paths: ["core/server/graph/**/*.graphql"],
executor: new CommandExecutor("npm run compile:server:types", {
runOnInit: true,
}),
},
compileRelayStream: {
paths: [
"core/client/stream/**/*.ts",
+11 -10
View File
@@ -3,23 +3,24 @@
"version": "5.0.0",
"description": "A better commenting experience from Mozilla, The Washington Post, and The New York Times.",
"scripts": {
"start": "node dist/index.js",
"test": "node scripts/test.js --env=jsdom",
"build": "npm-run-all --parallel compile:* --parallel build:*",
"build:client": "node ./scripts/build.js",
"build:server": "tsc -p ./src/tsconfig.json",
"watch": "NODE_ENV=development ts-node ./scripts/watcher/bin/watcher.ts ./config/watcher.ts",
"build": "npm-run-all --parallel compile:* --parallel build:*",
"compile:css-types": "tcm src/core/client/",
"watch:types": "nodemon --config ./config/nodemon/types.json",
"compile:graphql": "node ./scripts/types.js",
"compile:relay-stream": "relay-compiler --src ./src/core/client/stream --schema $(ts-node ./scripts/schemaPath.ts tenant) --language typescript --artifactDirectory ./src/core/client/stream/__generated__ --no-watchman",
"start:development": "NODE_ENV=development ts-node --project ./src/tsconfig.json -r tsconfig-paths/register ./src/index.ts",
"start:webpackDevServer": "node ./scripts/start.js",
"docz:watch": "docz dev",
"lint-fix": "npm run lint:server -- --fix && npm run lint:client -- --fix && npm run lint:scripts -- --fix",
"lint": "npm-run-all --parallel lint:*",
"lint:server": "tslint --project ./src/tsconfig.json",
"lint:client": "tslint --project ./src/core/client/tsconfig.json",
"lint:scripts": "tslint --project ./tsconfig.json",
"docz:watch": "docz dev"
"lint:server": "tslint --project ./src/tsconfig.json",
"lint": "npm-run-all --parallel lint:*",
"start:development": "NODE_ENV=development ts-node --project ./src/tsconfig.json -r tsconfig-paths/register ./src/index.ts",
"start:webpackDevServer": "node ./scripts/start.js",
"start": "node dist/index.js",
"test": "node scripts/test.js --env=jsdom",
"watch:types": "nodemon --config ./config/nodemon/types.json",
"watch": "NODE_ENV=development ts-node ./scripts/watcher/bin/watcher.ts ./config/watcher.ts"
},
"author": "",
"license": "Apache-2.0",
+4 -2
View File
@@ -4,7 +4,7 @@ const { getGraphQLConfig } = require("graphql-config");
const path = require("path");
const fs = require("fs");
function lint(files) {
function lintAndWrite(files) {
const linter = new Linter({ fix: true });
for (const { fileName, types } of files) {
@@ -80,7 +80,7 @@ async function main() {
}
// Send the files off to the linter to be linted and written.
lint(files);
lintAndWrite(files);
return files;
}
@@ -88,9 +88,11 @@ async function main() {
main()
.then(files => {
for (const { fileName } of files) {
// tslint:disable-next-line:no-console
console.log(`Generated ${fileName}`);
}
})
.catch(err => {
// tslint:disable-next-line:no-console
console.error(err);
});
+10 -33
View File
@@ -5,40 +5,17 @@
"module": "esnext",
"jsx": "preserve",
"allowJs": false,
"lib": [
"dom",
"es7",
"scripthost",
"es2015",
"esnext.asynciterable"
],
"lib": ["dom", "es7", "scripthost", "es2015", "esnext.asynciterable"],
"baseUrl": "./",
"paths": {
"talk-admin/*": [
"./admin/*"
],
"talk-stream/*": [
"./stream/*"
],
"talk-framework/*": [
"./framework/*"
],
"talk-ui/*": [
"./ui/*"
],
"talk-common/*": [
"../common/*"
],
"talk-locales/*": [
"../../locales/*"
]
"talk-admin/*": ["./admin/*"],
"talk-stream/*": ["./stream/*"],
"talk-framework/*": ["./framework/*"],
"talk-ui/*": ["./ui/*"],
"talk-common/*": ["../common/*"],
"talk-locales/*": ["../../locales/*"]
}
},
"include": [
"./**/*",
"../../types/**/*.d.ts"
],
"exclude": [
"node_modules"
]
}
"include": ["./**/*", "../../types/**/*.d.ts"],
"exclude": ["node_modules"]
}
+6 -19
View File
@@ -9,26 +9,13 @@
"outDir": "../dist",
// See https://github.com/prismagraphql/graphql-request/issues/26 for why we
// have to include "dom" here.
"lib": [
"es6",
"esnext.asynciterable",
"dom"
],
"lib": ["es2017", "es6", "esnext.asynciterable", "dom"],
"baseUrl": "./",
"paths": {
"talk-server/*": [
"./core/server/*"
],
"talk-common/*": [
"./core/common/*"
]
"talk-server/*": ["./core/server/*"],
"talk-common/*": ["./core/common/*"]
}
},
"include": [
"./**/*"
],
"exclude": [
"node_modules",
"./core/client"
]
}
"include": ["./**/*"],
"exclude": ["node_modules", "./core/client"]
}
+4 -14
View File
@@ -13,18 +13,8 @@
"noImplicitAny": true,
"strictNullChecks": true,
"noErrorTruncation": true,
"lib": [
"es6",
"esnext.asynciterable"
]
"lib": ["es6", "esnext.asynciterable"]
},
"include": [
"./src/**/.*.js",
"./scripts/**/*",
"./config/**/*",
"*.js"
],
"exclude": [
"node_modules"
]
}
"include": ["./src/**/.*.js", "./scripts/**/*", "./config/**/*", "*.js"],
"exclude": ["node_modules"]
}