Jhernandez has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/371012 )

Change subject: WIP: DONOTMERGE: Compile server side code

WIP: DONOTMERGE: Compile server side code

Using typescript and as much of the config of the client code shared in
the root tsconfig.json

* Install node.js typings
* Fix compiler errors
* Migrate node tests to TS
* Review npm scripts structure/organization
* Review src/{server,client} + test/ structure and where do they compile
* REMOVE ||true in npm scripts to pass precommit while WIP

Change-Id: Ia489def195b6aa8f7279f692d2fb2e2c9351dbd4
M package.json
R src/server/index.ts
R src/server/templates/page.ts
A src/server/tsconfig.json
4 files changed, 18 insertions(+), 6 deletions(-)

  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/12/371012/1

diff --git a/package.json b/package.json
index b8eb578..4aba743 100644
--- a/package.json
+++ b/package.json
@@ -3,16 +3,20 @@
   "version": "0.0.0",
   "description": "An API driven skin for MediaWiki",
   "scripts": {
-    "start": "run-p -sn dev:\\*",
-    "dev:client": "NODE_ENV=development webpack -w",
-    "dev:server": "NODE_ENV=development nodemon -w dist/client -w src/server/ 
-    "prod:build": "NODE_ENV=production webpack -p",
+    "start": "NODE_ENV=development run-p -sn dev:\\*",
+    "dev:client": "webpack -w",
+    "dev:server": "run-p -sn dev:server:\\*",
+    "dev:server:build": "npm run -s server:build -- -w",
+    "dev:server:watch": "nodemon -w dist/ dist/server/index.js",
+    "server:build": "tsc -p src/server/tsconfig.json",
+    "client:build": "webpack -p",
+    "prod:build": "NODE_ENV=production run-s server:build client:build",
     "format": "npm run lint -s -- --fix",
     "format:all": "npm run format -s -- '{src,test}/**/*.js'",
     "lint": "eslint --cache --max-warnings 0",
     "lint:all": "npm run lint -s -- '{src,test}/**/*.js'",
-    "pretest": "npm run lint:all -s",
-    "test": "mocha '{src,test}/**/*.test.js'",
+    "pretest": "run-s -s lint:all server:build || true",
+    "test": "mocha '{dist/server,test}/**/*.test.js' || true",
     "test:watch": "nodemon -w src -w test -x 'npm test'",
     "precommit": "npm run test -s"
diff --git a/src/server/index.js b/src/server/index.ts
similarity index 100%
rename from src/server/index.js
rename to src/server/index.ts
diff --git a/src/server/templates/page.js b/src/server/templates/page.ts
similarity index 100%
rename from src/server/templates/page.js
rename to src/server/templates/page.ts
diff --git a/src/server/tsconfig.json b/src/server/tsconfig.json
new file mode 100644
index 0000000..122f217
--- /dev/null
+++ b/src/server/tsconfig.json
@@ -0,0 +1,8 @@
+  "extends": "../../tsconfig.json",
+  "compilerOptions": {
+    "target": "ES2015",
+    "module": "commonjs",
+    "outDir": "../../dist/server"
+  }

To view, visit https://gerrit.wikimedia.org/r/371012
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia489def195b6aa8f7279f692d2fb2e2c9351dbd4
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Jhernandez <jhernan...@wikimedia.org>

MediaWiki-commits mailing list

Reply via email to