diff --git a/.gitignore b/.gitignore index 7b5c7dfc4..49451383a 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ coverage # build build +dist # misc xrank_data diff --git a/Procfile b/Procfile index 5ec9cc2c5..feff0592c 100644 --- a/Procfile +++ b/Procfile @@ -1 +1,2 @@ -web: node index.js \ No newline at end of file +release: npm run migrate:latest +web: node dist/index.js \ No newline at end of file diff --git a/graphql-schemas/salmonRunRecord.ts b/graphql-schemas/salmonRunRecord.ts index e5cdbefbd..b3622e654 100644 --- a/graphql-schemas/salmonRunRecord.ts +++ b/graphql-schemas/salmonRunRecord.ts @@ -31,7 +31,7 @@ const typeDef = gql` const resolvers = { Mutation: { - createSalmonRunRecord: async (root, args) => { + createSalmonRunRecord: async (root: any, args: any) => { console.log(args) return true }, diff --git a/package.json b/package.json index 184a6ddb1..48d588c1c 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,9 @@ "withdev": "cross-env LOGGED_IN=TRUE node index.js", "watchdev": "cross-env LOGGED_IN=TRUE nodemon index.js", "watchprod": "cross-env LOGGED_IN=TRUE USE_PRODUCTION_DB=TRUE nodemon index.js", - "build": "cd frontend-react && npm install && npm run build && mv build ../build", + "build": "npm run build:frontend && npm run build:backend", + "build:frontend": "rm -rf build && cd frontend-react && npm install && npm run build && mv build ../build", + "build:backend": "rm -rf dist && tsc", "testbuild": "rmdir /s /q build && cd frontend-react && npm run build && move build ../build", "migrate:make": "knex migrate:make", "migrate:rollback": "knex migrate:rollback", diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..7b2d0faa0 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,26 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "esModuleInterop": true, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "commonjs", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": false, + "downlevelIteration": true, + "outDir": "dist/" + }, + "exclude": [ + "node_modules", + "frontend-react", + "dist", + "migrations", + "scripts", + "build" + ] +}