Skip to content

Commit

Permalink
14 chapters and loadDiscussionsData
Browse files Browse the repository at this point in the history
  • Loading branch information
tima101 committed Jul 29, 2019
1 parent 08482e5 commit 79f2706
Show file tree
Hide file tree
Showing 1,053 changed files with 46,443 additions and 55,770 deletions.
150 changes: 0 additions & 150 deletions book/1-begin-end/README.md

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
82 changes: 82 additions & 0 deletions book/1-begin/api/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
// 4
// {
// "name": "2-begin-api",
// "version": "1",
// "license": "MIT",
// "scripts": {
// "dev": "nodemon server/app.ts",
// "build": "rm -rf production-server/ && tsc --project tsconfig.server.json",
// "postinstall": "rm -rf production-server/ && tsc --project tsconfig.server.json",
// "start": "node production-server/app.js",
// "lint": "tslint -p tsconfig.json",
// "test": "jest --coverage",
// "processes-8000": "ss -lptn 'sport = :8000'",
// "processes-node": "ps -e|grep node",
// "kill-processes-at-port": "lsof -i tcp:8000 | awk 'NR!=1 {print $2}' | xargs kill"
// },
// "husky": {
// "hooks": {
// "pre-commit": "yarn lint && yarn build && cd ../app && yarn lint"
// }
// },
// "jest": {
// "coverageDirectory": "./.coverage",
// "preset": "ts-jest",
// "testPathIgnorePatterns": [
// "production-server"
// ]
// },
// "dependencies": {
// "@types/dotenv": "^6.1.1",
// "@types/mongoose": "5.5.6",
// "@types/node": "12.0.10",
// "aws-sdk": "2.485.0",
// "bcrypt": "^3.0.6",
// "compression": "1.7.4",
// "connect-mongo": "3.0.0",
// "cors": "^2.8.5",
// "dotenv": "8.0.0",
// "express": "4.17.1",
// "express-session": "1.16.2",
// "front-matter": "3.0.2",
// "googleapis": "40.0.0",
// "he": "1.2.0",
// "helmet": "3.18.0",
// "highlight.js": "9.15.8",
// "isomorphic-unfetch": "3.0.0",
// "lodash": "4.17.11",
// "marked": "0.6.3",
// "mongoose": "5.6.2",
// "passport": "0.4.0",
// "passport-google-oauth": "2.0.0",
// "passwordless": "^1.1.3",
// "passwordless-tokenstore": "^0.0.10",
// "qs": "6.7.0",
// "request": "2.88.0",
// "socket.io": "^2.2.0",
// "stripe": "7.4.0",
// "typescript": "3.5.2",
// "winston": "3.2.1"
// },
// "devDependencies": {
// "@types/compression": "^0.0.36",
// "@types/connect-mongo": "^0.0.42",
// "@types/cors": "^2.8.5",
// "@types/express": "4.17.0",
// "@types/express-session": "^1.15.13",
// "@types/jest": "^24.0.15",
// "@types/lodash": "4.14.135",
// "@types/passport": "1.0.0",
// "@types/request": "^2.48.1",
// "@types/socket.io": "^2.1.2",
// "@types/stripe": "6.30.5",
// "husky": "2.7.0",
// "jest": "24.8.0",
// "mockingoose": "^2.13.1",
// "nodemon": "^1.19.1",
// "ts-jest": "^24.0.2",
// "ts-node": "8.3.0",
// "ts-node-dev": "^1.0.0-pre.40",
// "tslint": "5.18.0"
// }
// }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,14 @@
// // const { discussionSlug } = body;

// // if (!discussionSlug) {
// // return {};
// // return [];
// // }

// // const { discussions } = await Discussion.getList({
// // userId,
// // teamId: team._id,
// // });

// // const data: any = { initialDiscussions: discussions };

// // for (const discussion of discussions) {
// // if (discussion.slug === discussionSlug) {
// // Object.assign(discussion, {
Expand All @@ -70,7 +68,7 @@
// // }
// // }

// // return data;
// // return discussions;
// // }

// // 10
Expand Down Expand Up @@ -108,9 +106,9 @@
// // });
// // }

// // Object.assign(team, await loadDiscussionsData(team, userId, body));
// // const initialDiscussions = await loadDiscussionsData(team, userId, body);

// // const data: any = { initialMembers, initialInvitations };
// // const data: any = { initialMembers, initialInvitations, initialDiscussions };

// // return data;
// // }
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 12 additions & 0 deletions book/1-begin/app/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// 2
// {
// "presets": [
// [
// "next/babel",
// {
// "class-properties": { "loose": true }
// }
// ],
// "@zeit/next-typescript/babel"
// ]
// }
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 25 additions & 0 deletions book/1-begin/app/lib/isMobile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// 2
// // tslint:disable-next-line:max-line-length
// const mobileRE = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i;

// function isMobile(opts) {
// if (!opts) {
// opts = {};
// }

// let ua = opts.ua;
// if (!ua && typeof navigator !== 'undefined') {
// ua = navigator.userAgent;
// }
// if (!ua && opts.req && opts.req.headers && typeof opts.req.headers['user-agent'] === 'string') {
// ua = opts.req.headers['user-agent'];
// }

// if (typeof ua !== 'string') {
// return false;
// }

// return mobileRE.test(ua);
// }

// export { isMobile };
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions book/1-begin/app/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 2
// const withTypescript = require('@zeit/next-typescript');

// module.exports = withTypescript();

// 4
// const dotenv = require('dotenv');
// const fs = require('fs');
// const withTypescript = require('@zeit/next-typescript');
// const webpack = require('webpack');


// var current = { ...process.env };
// const result = dotenv.config();
// if (!result.error) {
// current = { ...current, ...result.parsed };
// }

// var blueprint = { NODE_ENV: process.env.NODE_ENV };
// try {
// blueprint = { ...blueprint, ...dotenv.parse(fs.readFileSync('./.env.blueprint', 'utf8')) };
// } catch (err) {
// console.log(err);
// }
// const rules = Object.keys(blueprint).reduce((obj, key) => {
// obj[`process.env.${key}`] = JSON.stringify(current[key]);
// return obj
// }, {});

// const config = {
// webpack: config => {
// config.plugins = config.plugins || []

// config.plugins = [
// ...config.plugins,

// // Read the .env file
// new webpack.DefinePlugin(rules)
// ]

// return config
// }
// };
// module.exports = withTypescript(config);
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// 2
// {
// "name": "2-end-app",
// "name": "2-begin-app",
// "version": "1",
// "license": "MIT",
// "scripts": {
Expand Down
Loading

0 comments on commit 79f2706

Please sign in to comment.