Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

shared: Add TypeScript build step.

Anders Kaseorgd41917ecd098
diff --git a/static/shared/.gitignore b/static/shared/.gitignore
index 5baea434c9f..b94f0f85539 100644
--- a/static/shared/.gitignore
+++ b/static/shared/.gitignore
@@ -2,3 +2,4 @@
# But it does appear when developing this package in tandem with
# mobile, using `yarn link`.
/node_modules
+/lib
diff --git a/static/shared/package.json b/static/shared/package.json
index b3d0560910d..f9ff0c4f13d 100644
--- a/static/shared/package.json
+++ b/static/shared/package.json
@@ -3,11 +3,15 @@
"version": "0.0.16",
"license": "Apache-2.0",
"scripts": {
+ "prepare": "rm -rf lib && tsc && cp js/*.flow lib",
"version": "tools/npm-version",
"postversion": "tools/npm-postversion"
},
"dependencies": {
"katex": "^0.16.2",
"lodash": "^4.17.19"
+ },
+ "devDependencies": {
+ "typescript": "^4.8.2"
}
}
diff --git a/static/shared/tsconfig.json b/static/shared/tsconfig.json
new file mode 100644
index 00000000000..8c4d84eeeb8
--- /dev/null
+++ b/static/shared/tsconfig.json
@@ -0,0 +1,32 @@
+{
+ "compilerOptions": {
+ /* Language and Environment */
+ "target": "es2019",
+
+ /* Modules */
+ "rootDir": "js",
+ "moduleResolution": "node",
+
+ /* JavaScript Support */
+ "allowJs": true,
+
+ /* Emit */
+ "declaration": true,
+ "sourceMap": true,
+ "outDir": "lib",
+
+ /* Interop Constraints */
+ "isolatedModules": true,
+ "esModuleInterop": true,
+ "forceConsistentCasingInFileNames": true,
+
+ /* Type Checking */
+ "strict": true,
+ "noUnusedLocals": true,
+ "noUnusedParameters": true,
+ "noImplicitReturns": true,
+ "noFallthroughCasesInSwitch": true,
+ "noImplicitOverride": true,
+ },
+ "include": ["js"],
+}