From 3bca6dd4f3c147588d05878d24387b7649004f89 Mon Sep 17 00:00:00 2001 From: Andrew Mao Date: Sat, 9 Nov 2019 17:36:07 -0500 Subject: [PATCH 1/3] Meteor 1.8 --- .travis.yml | 2 +- package.js | 12 +++--------- tsconfig.json | 23 ++++++++++++++++------- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc4c680..b3d67ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ before_install: env: # barbatus:typescript requires ecmascript and modules from 1.6.x, so we just # use that to run the test - - CXX=g++-4.8 METEOR_RELEASE=1.6.1.4 + - CXX=g++-4.8 METEOR_RELEASE=1.8.2-rc.7 addons: apt: sources: diff --git a/package.js b/package.js index b8225aa..ae735a8 100644 --- a/package.js +++ b/package.js @@ -14,16 +14,13 @@ Npm.depends({ }); Package.onUse(function(api) { - api.versionsFrom("1.4.4.6"); + api.versionsFrom("1.8.2-rc.7"); // TypeScript support // Modules: https://docs.meteor.com/v1.4/packages/modules.html api.use("modules"); api.use("ecmascript"); - // Should be replaced with straight up built-in 'typescript' in Meteor 1.8.2 - // adornis:typescript from [1.4, 1.8) - // api.use("adornis:typescript@0.8.1"); - api.use("barbatus:typescript@0.7.0"); + api.use("typescript"); // Client-only deps api.use(["session", "ui", "templating", "reactive-var"], "client"); @@ -146,10 +143,7 @@ Package.onTest(function(api) { // Need these specific versions for tests to agree to run api.use("modules"); api.use("ecmascript"); - - // For compiling TS - api.use("barbatus:typescript"); - // api.use("adornis:typescript"); + api.use("typescript"); api.use([ "accounts-base", diff --git a/tsconfig.json b/tsconfig.json index 0601958..553f927 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,28 +1,37 @@ { "compilerOptions": { - "target": "es6", - "module": "commonjs", - "lib": ["es2015", "dom"], + "target": "es2018", + "module": "esNext", + "lib": ["esnext", "dom"], "allowJs": true, "checkJs": false, "jsx": "preserve", + "incremental": true, "noEmit": true, + /* Strict Type-Checking Options */ "strict": false, - "noImplicitAny": false, - "strictNullChecks": false, + "noImplicitAny": false, // TODO flip to true when ready + "strictNullChecks": false, // TODO flip to true when ready + /* Additional Checks */ "noUnusedLocals": true, "noUnusedParameters": true, "noImplicitReturns": false, "noFallthroughCasesInSwitch": false, + /* Module Resolution Options */ "baseUrl": ".", "paths": { + /* Support absolute /imports/* with a leading '/' */ "/*": ["*"] }, "moduleResolution": "node", + "resolveJsonModule": true, "types": ["node"], - "typeRoots": ["types/", "node_modules/@types"] - } + "typeRoots": ["types/", "node_modules/@types"], + "esModuleInterop": true, + "preserveSymlinks": true + }, + "exclude": ["./.meteor/**", "./packages/**"] } From 56039b4228d7ea683bd6a9b0c93ad4e87b9c963c Mon Sep 17 00:00:00 2001 From: Andrew Mao Date: Sun, 10 Nov 2019 00:07:25 -0500 Subject: [PATCH 2/3] proper moment import --- .vscode/extensions.json | 10 ++++++++++ lib/util.ts | 2 +- types/shims.d.ts | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .vscode/extensions.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7234a5c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,10 @@ +{ + // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. + // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp + // List of extensions which should be recommended for users of this workspace. + "recommendations": [ + "esbenp.prettier-vscode" + ], + // List of extensions recommended by VS Code that should not be recommended for users of this workspace. + "unwantedRecommendations": [] +} \ No newline at end of file diff --git a/lib/util.ts b/lib/util.ts index fca1f18..e149a0a 100644 --- a/lib/util.ts +++ b/lib/util.ts @@ -9,7 +9,7 @@ /* Server/client util files */ -import * as moment from "moment"; +import * as moment from "meteor/momentjs:moment"; import * as _ from "underscore"; export function formatMillis(millis) { diff --git a/types/shims.d.ts b/types/shims.d.ts index 84288ba..9f7b338 100644 --- a/types/shims.d.ts +++ b/types/shims.d.ts @@ -25,6 +25,8 @@ declare module "meteor/tracker" { declare module "meteor/mizzao:partitioner"; declare module "meteor/mizzao:user-status"; +declare module "meteor/momentjs:moment"; + // Old MTurk stuff declare module "mturk-api"; declare module "jspath"; From 9b54748f77ff72d1b5f52cf6105847551d4b98ad Mon Sep 17 00:00:00 2001 From: Andrew Mao Date: Sun, 10 Nov 2019 01:16:12 -0500 Subject: [PATCH 3/3] 1.8 fixes --- server/config.ts | 2 +- tsconfig.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/server/config.ts b/server/config.ts index d89d0b9..6a7fef9 100644 --- a/server/config.ts +++ b/server/config.ts @@ -1,5 +1,5 @@ import * as os from "os"; -import * as merge from "deepmerge"; +import merge from "deepmerge"; import { Meteor } from "meteor/meteor"; diff --git a/tsconfig.json b/tsconfig.json index 553f927..d8b9a0e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,5 +1,6 @@ { "compilerOptions": { + /* Basic Options */ "target": "es2018", "module": "esNext", "lib": ["esnext", "dom"],