From 25897e6ceaf873d265a4c0afb4d6b9c68a074a93 Mon Sep 17 00:00:00 2001 From: Anthony Wang <40553084+cosmicgenius@users.noreply.github.com> Date: Thu, 24 Dec 2020 14:53:46 -0800 Subject: [PATCH] Fix babel not working with typescript project referencing Note: the critical code is NOT mine; see https://github.com/facebook/create-react-app/issues/6799#issuecomment-570081122. --- .shared/.gitignore | 5 ++- .shared/index.d.ts.map | 1 + .shared/index.ts | 1 + .shared/package.json | 2 +- .shared/src/types.d.ts.map | 1 + .shared/tsconfig.json | 4 +- client/.gitignore | 3 ++ client/config-overrides.js | 26 ++++++++++++ client/package-lock.json | 28 +++++++++++++ client/package.json | 8 ++-- client/src/Constants/types.ts | 7 +--- client/src/Firebase/index.ts | 2 +- .../Project/View/Details/Reply/index.tsx | 6 +-- .../Project/View/Details/index.tsx | 2 +- .../ProjectView/Project/View/Problem/index.js | 41 ------------------- client/src/ProjectView/Project/index.tsx | 2 +- .../ProjectView/Selection/Table/constants.tsx | 2 +- .../src/ProjectView/Selection/Table/index.tsx | 3 +- .../src/ProjectView/Selection/Table/modal.tsx | 2 +- .../Selection/Table/projectrow.tsx | 2 +- .../Selection/Table/projecttoolbar.tsx | 2 +- client/src/ProjectView/Selection/index.tsx | 2 +- client/src/ProjectView/TopBar/index.tsx | 2 +- client/src/ProjectView/index.tsx | 2 +- client/tsconfig.json | 12 ++++-- tsconfig.json | 8 ++++ 26 files changed, 100 insertions(+), 76 deletions(-) create mode 100644 .shared/index.d.ts.map create mode 100644 .shared/index.ts create mode 100644 .shared/src/types.d.ts.map create mode 100644 client/config-overrides.js delete mode 100644 client/src/ProjectView/Project/View/Problem/index.js create mode 100644 tsconfig.json diff --git a/.shared/.gitignore b/.shared/.gitignore index 3874ba5..1548895 100644 --- a/.shared/.gitignore +++ b/.shared/.gitignore @@ -115,5 +115,6 @@ dist .yarn/install-state.gz .pnp.* -# ts built js files -/built-src +# ts built files +*.js +*.d.ts \ No newline at end of file diff --git a/.shared/index.d.ts.map b/.shared/index.d.ts.map new file mode 100644 index 0000000..c4985f9 --- /dev/null +++ b/.shared/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"} \ No newline at end of file diff --git a/.shared/index.ts b/.shared/index.ts new file mode 100644 index 0000000..a246a8f --- /dev/null +++ b/.shared/index.ts @@ -0,0 +1 @@ +export * from "./src/types"; diff --git a/.shared/package.json b/.shared/package.json index f7f33f1..dc4893e 100644 --- a/.shared/package.json +++ b/.shared/package.json @@ -2,6 +2,6 @@ "name": "opal-shared", "version": "1.0.0", "scripts": { - "start": "tsc -w" + "start": "tsc -b -w" } } diff --git a/.shared/src/types.d.ts.map b/.shared/src/types.d.ts.map new file mode 100644 index 0000000..763ac5c --- /dev/null +++ b/.shared/src/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,2BAA2B,EAAE,MAAM,CAAC;IACpC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACf;AAGD,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,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ared/tsconfig.json b/.shared/tsconfig.json index 92da9e5..f16fc6d 100644 --- a/.shared/tsconfig.json +++ b/.shared/tsconfig.json @@ -8,6 +8,8 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "strictNullChecks": true, + "declaration": true, + "declarationMap": true, "strictFunctionTypes": true, "forceConsistentCasingInFileNames": true, "noFallthroughCasesInSwitch": true, @@ -16,7 +18,5 @@ "emitDecoratorMetadata": true, "experimentalDecorators": true, "resolveJsonModule": true, - "outDir": "built-src" }, - "include": ["src"] } diff --git a/client/.gitignore b/client/.gitignore index 4d29575..6fca6ca 100644 --- a/client/.gitignore +++ b/client/.gitignore @@ -21,3 +21,6 @@ npm-debug.log* yarn-debug.log* yarn-error.log* + +# ts built js files +/built-src diff --git a/client/config-overrides.js b/client/config-overrides.js new file mode 100644 index 0000000..5a15389 --- /dev/null +++ b/client/config-overrides.js @@ -0,0 +1,26 @@ +/* + * Code by @DakotaLarson on Github. + * See https://github.com/facebook/create-react-app/issues/6799#issuecomment-570081122 + */ + +const { + override, + removeModuleScopePlugin, + getBabelLoader, +} = require("customize-cra"); +const path = require("path"); + +console.log("f"); + +const addShared = (config) => { + console.log(config); + const loader = getBabelLoader(config, false); + const sharedPath = path + .normalize(path.join(process.cwd(), "../.shared/src/types")) + .replace(/\\/g, "\\"); + + loader.include = [loader.include, sharedPath]; + return config; +}; + +module.exports = override(addShared, removeModuleScopePlugin()); diff --git a/client/package-lock.json b/client/package-lock.json index f16835f..8b86fec 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -4539,6 +4539,14 @@ "resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.13.tgz", "integrity": "sha512-ul26pfSQTZW8dcOnD2iiJssfXw0gdNVX9IJDH/X3K5DGPfj+fUYe3kB+swUY6BF3oZDxaID3AJt+9/ojSAE05A==" }, + "customize-cra": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/customize-cra/-/customize-cra-1.0.0.tgz", + "integrity": "sha512-DbtaLuy59224U+xCiukkxSq8clq++MOtJ1Et7LED1fLszWe88EoblEYFBJ895sB1mC6B4uu3xPT/IjClELhMbA==", + "requires": { + "lodash.flow": "^3.5.0" + } + }, "cyclist": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-1.0.1.tgz", @@ -8939,6 +8947,11 @@ "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=" }, + "lodash.flow": { + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/lodash.flow/-/lodash.flow-3.5.0.tgz", + "integrity": "sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o=" + }, "lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -11567,6 +11580,21 @@ } } }, + "react-app-rewired": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/react-app-rewired/-/react-app-rewired-2.1.8.tgz", + "integrity": "sha512-wjXPdKPLscA7mn0I1de1NHrbfWdXz4S1ladaGgHVKdn1hTgKK5N6EdGIJM0KrS6bKnJBj7WuqJroDTsPKKr66Q==", + "requires": { + "semver": "^5.6.0" + }, + "dependencies": { + "semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" + } + } + }, "react-dev-utils": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/react-dev-utils/-/react-dev-utils-10.2.1.tgz", diff --git a/client/package.json b/client/package.json index f682eb5..2659068 100644 --- a/client/package.json +++ b/client/package.json @@ -9,9 +9,11 @@ "@types/react-dom": "^16.9.10", "@types/react-router-dom": "^5.1.6", "@types/recompose": "^0.30.7", + "customize-cra": "^1.0.0", "firebase": "^7.23.0", "katex": "^0.12.0", "react": "^16.13.1", + "react-app-rewired": "^2.1.8", "react-dom": "^16.13.1", "react-feather": "^2.0.8", "react-router-dom": "^5.2.0", @@ -21,9 +23,9 @@ "typescript": "^4.1.3" }, "scripts": { - "start": "react-scripts start", - "build": "react-scripts build", - "test": "react-scripts test", + "start": "react-app-rewired start", + "build": "react-app-rewired build", + "test": "react-app-rewired test", "eject": "react-scripts eject" }, "proxy": "https://localhost:2718", diff --git a/client/src/Constants/types.ts b/client/src/Constants/types.ts index 9acf93f..336b11d 100644 --- a/client/src/Constants/types.ts +++ b/client/src/Constants/types.ts @@ -1,9 +1,4 @@ -import { - data, - problemAction, - reply, - ReplyType, -} from "../../../.shared/src/types"; +import { data, problemAction, ReplyType } from "../../../.shared"; /* * The idea here is that if success is true, the value must be of type output. diff --git a/client/src/Firebase/index.ts b/client/src/Firebase/index.ts index a992540..15c2bde 100644 --- a/client/src/Firebase/index.ts +++ b/client/src/Firebase/index.ts @@ -8,7 +8,7 @@ import { Client, projectActionProtected, data, -} from "../../../.shared//src/types"; +} from "../../../.shared/"; import { Result } from "../Constants/types"; export { FirebaseContext, withFirebase }; diff --git a/client/src/ProjectView/Project/View/Details/Reply/index.tsx b/client/src/ProjectView/Project/View/Details/Reply/index.tsx index 936e139..9c96f31 100644 --- a/client/src/ProjectView/Project/View/Details/Reply/index.tsx +++ b/client/src/ProjectView/Project/View/Details/Reply/index.tsx @@ -23,11 +23,7 @@ import Latex from "../../../../../Constants/latex"; import { formatTime } from "../../../../../Constants"; import * as ROUTES from "../../../../../Constants/routes"; import { compose } from "recompose"; -import { - problemAction, - reply, - ReplyType, -} from "../../../../../../../.shared/src/types"; +import { problemAction, reply, ReplyType } from "../../../../../../../.shared"; import styles from "./index.css"; type ReplyProps = WithStyles & diff --git a/client/src/ProjectView/Project/View/Details/index.tsx b/client/src/ProjectView/Project/View/Details/index.tsx index d76b870..002fb28 100644 --- a/client/src/ProjectView/Project/View/Details/index.tsx +++ b/client/src/ProjectView/Project/View/Details/index.tsx @@ -7,7 +7,7 @@ import { compose } from "recompose"; import * as ROUTES from "../../../../Constants/routes"; import Reply from "./Reply"; -import { reply as replyType } from "../../../../../../.shared/src/types"; +import { reply as replyType } from "../../../../../../.shared"; import styles from "./index.css"; import { ProblemDetails } from "../../../../Constants/types"; diff --git a/client/src/ProjectView/Project/View/Problem/index.js b/client/src/ProjectView/Project/View/Problem/index.js deleted file mode 100644 index a19ec5c..0000000 --- a/client/src/ProjectView/Project/View/Problem/index.js +++ /dev/null @@ -1,41 +0,0 @@ -import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; -import React from "react"; -import { Paper, withStyles } from "@material-ui/core"; -import { AlignLeft, ArrowDown, ArrowUp, CornerDownRight, MessageSquare, } from "react-feather"; -import Latex from "../../../../Constants/latex"; -import { Link } from "react-router-dom"; -import * as ROUTES from "../../../../Constants/routes"; -import generateStyles from "./index.css"; -const blankStyles = generateStyles({ name: "", color: "black" }, { name: 0, color: "black" }); -class ProblemBase extends React.Component { - render() { - const { classes, ind, uuid, text, category, difficulty, author, tags, votes, myVote, problemAction, replyTypes, repliable, authUser, } = this.props; - const Tag = ({ text }) => { - return _jsx("span", Object.assign({ className: classes.tag }, { children: text }), void 0); - }; - return (_jsxs(Paper, Object.assign({ elevation: 3, className: classes.root }, { children: [_jsxs("div", Object.assign({ className: classes.left }, { children: [_jsxs("div", Object.assign({ className: classes.leftIndex }, { children: ["#", ind + 1] }), void 0), - _jsxs("div", Object.assign({ className: classes.leftVote }, { children: [_jsx("div", { children: _jsx(ArrowUp, { size: "1.2rem", strokeWidth: 3, className: myVote === 1 - ? classes.leftVoteArrowActivated - : classes.leftVoteArrow, onClick: (_) => problemAction(1, "vote") }, void 0) }, void 0), - _jsx("div", { children: _jsx("span", Object.assign({ className: classes.leftVoteNumber }, { children: votes }), void 0) }, void 0), - _jsx("div", { children: _jsx(ArrowDown, { size: "1.2rem", strokeWidth: 3, className: myVote === -1 - ? classes.leftVoteArrowActivated - : classes.leftVoteArrow, onClick: (_) => problemAction(-1, "vote") }, void 0) }, void 0)] }), void 0)] }), void 0), - _jsxs("div", Object.assign({ className: classes.body }, { children: [_jsx("div", Object.assign({ className: classes.bodyTitle }, { children: "Epic Problem" }), void 0), - _jsxs("div", Object.assign({ className: classes.bodyAuthor }, { children: ["Proposed by ", author] }), void 0), - _jsx("div", Object.assign({ className: classes.bodyText }, { children: _jsx(Latex, { children: text }, void 0) }), void 0), - _jsx("div", { className: classes.bodyFiller }, void 0), - _jsxs("div", Object.assign({ className: classes.bodyTags }, { children: ["Tags:", " ", !!tags ? tags.map((tag) => _jsx(Tag, { text: tag }, tag)) : null] }), void 0), - repliable ? (_jsx("div", Object.assign({ className: classes.bodyReply }, { children: _jsxs(Link, Object.assign({ className: classes.bodyReplyLink, to: `${ROUTES.PROJECT_VIEW.replace(":uuid", uuid)}/p${ind}` }, { children: [_jsx(CornerDownRight, { className: classes.icon }, void 0), "Reply"] }), void 0) }), void 0)) : null] }), void 0), - _jsxs("div", Object.assign({ className: classes.right }, { children: [_jsxs("div", Object.assign({ className: classes.rightCategory }, { children: [_jsx("div", { className: `${classes.icon} ${classes.rightDot} ${classes.rightCategoryDot}` }, void 0), category.name] }), void 0), - _jsxs("div", Object.assign({ className: classes.rightDifficulty }, { children: [_jsx("div", { className: `${classes.icon} ${classes.rightDot} ${classes.rightDifficultyDot}` }, void 0), "d-", difficulty.name] }), void 0), - _jsx("div", { className: classes.rightFiller }, void 0), - _jsxs("div", Object.assign({ className: classes.rightComments }, { children: [_jsx(MessageSquare, { className: classes.icon }, void 0), replyTypes.COMMENT, "\u00A0comment", replyTypes.COMMENT === 1 ? "" : "s"] }), void 0), - _jsxs("div", Object.assign({ className: classes.rightSolutions }, { children: [_jsx(AlignLeft, { className: classes.icon }, void 0), replyTypes.SOLUTION, "\u00A0solution", replyTypes.SOLUTION === 1 ? "" : "s"] }), void 0)] }), void 0)] }), void 0)); - } -} -const Problem = (props) => { - const StyledProblem = withStyles(generateStyles(props.category, props.difficulty))(ProblemBase); - return _jsx(StyledProblem, Object.assign({}, props), void 0); -}; -export default Problem; diff --git a/client/src/ProjectView/Project/index.tsx b/client/src/ProjectView/Project/index.tsx index 5a82c2f..fcf5431 100644 --- a/client/src/ProjectView/Project/index.tsx +++ b/client/src/ProjectView/Project/index.tsx @@ -7,7 +7,7 @@ import { vote, problemAction, ReplyType, -} from "../../../../.shared/src/types"; +} from "../../../../.shared"; import { poll } from "../../Constants"; import { Result } from "../../Constants/types"; import { getProjectPrivate, tryProblemAction } from "../../Firebase"; diff --git a/client/src/ProjectView/Selection/Table/constants.tsx b/client/src/ProjectView/Selection/Table/constants.tsx index d11932c..d5c5de6 100644 --- a/client/src/ProjectView/Selection/Table/constants.tsx +++ b/client/src/ProjectView/Selection/Table/constants.tsx @@ -1,7 +1,7 @@ import React from "react"; import { lighten, darken, createStyles, Theme } from "@material-ui/core"; import { formatTime } from "../../../Constants"; -import { Client } from "../../../../../.shared/src/types"; +import { Client } from "../../../../../.shared"; import { ProjectDataPoint } from "../../../Constants/types"; export const getDataPoint = ( diff --git a/client/src/ProjectView/Selection/Table/index.tsx b/client/src/ProjectView/Selection/Table/index.tsx index 96b3a65..9654507 100644 --- a/client/src/ProjectView/Selection/Table/index.tsx +++ b/client/src/ProjectView/Selection/Table/index.tsx @@ -20,10 +20,9 @@ import { camelToTitle } from "../../../Constants"; import { Client, projectAction, - ProjectActionProtected, isProjectActionProtected, isProjectActionTrivial, -} from "../../../../../.shared/src/types"; +} from "../../../../../.shared"; import { ProjectDataPoint, ProjectViewSort, diff --git a/client/src/ProjectView/Selection/Table/modal.tsx b/client/src/ProjectView/Selection/Table/modal.tsx index 3b22fbd..4a795d1 100644 --- a/client/src/ProjectView/Selection/Table/modal.tsx +++ b/client/src/ProjectView/Selection/Table/modal.tsx @@ -15,7 +15,7 @@ import { projectAction, ProjectActionProtected, ProjectActionTrivial, -} from "../../../../../.shared/src/types"; +} from "../../../../../.shared"; interface ModalProps { show: boolean; diff --git a/client/src/ProjectView/Selection/Table/projectrow.tsx b/client/src/ProjectView/Selection/Table/projectrow.tsx index 3c8af7b..7c08b47 100644 --- a/client/src/ProjectView/Selection/Table/projectrow.tsx +++ b/client/src/ProjectView/Selection/Table/projectrow.tsx @@ -16,7 +16,7 @@ import { WithStyles, withStyles } from "@material-ui/core/styles"; import { UserPlus, Trash2, Edit, Star, CornerLeftUp } from "react-feather"; import { Link } from "react-router-dom"; import { rowStyles, dataPointDisplay, IfDisplay } from "./constants"; -import { Client, projectAction } from "../../../../../.shared/src/types"; +import { Client, projectAction } from "../../../../../.shared"; import { ProjectDataPoint } from "../../../Constants/types"; interface ProjectRowProps extends WithStyles { diff --git a/client/src/ProjectView/Selection/Table/projecttoolbar.tsx b/client/src/ProjectView/Selection/Table/projecttoolbar.tsx index c3be1ee..c3fd73c 100644 --- a/client/src/ProjectView/Selection/Table/projecttoolbar.tsx +++ b/client/src/ProjectView/Selection/Table/projecttoolbar.tsx @@ -9,7 +9,7 @@ import { } from "@material-ui/core"; import { Filter, Trash2 } from "react-feather"; import { toolbarStyles } from "./constants"; -import { projectAction } from "../../../../../.shared/src/types"; +import { projectAction } from "../../../../../.shared"; interface ProjectToolbarProps extends WithStyles { selected: string[]; diff --git a/client/src/ProjectView/Selection/index.tsx b/client/src/ProjectView/Selection/index.tsx index 0125aeb..ae21e1e 100644 --- a/client/src/ProjectView/Selection/index.tsx +++ b/client/src/ProjectView/Selection/index.tsx @@ -10,7 +10,7 @@ import Table from "./Table"; import { getVisibleProjects } from "../../Firebase"; import MenuBase from "../MenuBase"; import { poll, projectViewTypes } from "../../Constants"; -import { Client } from "../../../../.shared/src/types"; +import { Client } from "../../../../.shared"; import { ProjectViewSort, ProjectDataPoint, diff --git a/client/src/ProjectView/TopBar/index.tsx b/client/src/ProjectView/TopBar/index.tsx index d91642d..20fbe5b 100644 --- a/client/src/ProjectView/TopBar/index.tsx +++ b/client/src/ProjectView/TopBar/index.tsx @@ -16,7 +16,7 @@ import { } from "@material-ui/core"; import React from "react"; import { Bell, User, Loader } from "react-feather"; -import { Notification } from "../../../../.shared/src/types"; +import { Notification } from "../../../../.shared"; import { Result } from "../../Constants/types"; import Loading from "../../Loading"; import styles from "./index.css"; diff --git a/client/src/ProjectView/index.tsx b/client/src/ProjectView/index.tsx index 338e81f..4c9380a 100644 --- a/client/src/ProjectView/index.tsx +++ b/client/src/ProjectView/index.tsx @@ -12,7 +12,7 @@ import TopBar from "./TopBar"; import { poll } from "../Constants"; import Fail from "../Fail"; import { WithAuthorization } from "../Session/withAuthorization"; -import { Notification } from "../../../.shared/src/types"; +import { Notification } from "../../../.shared"; import { Result } from "../Constants/types"; interface ProjectViewProps extends WithAuthorization {} diff --git a/client/tsconfig.json b/client/tsconfig.json index edf08d0..c051b6f 100644 --- a/client/tsconfig.json +++ b/client/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "es6", + "target": "es5", "lib": [ "dom", "dom.iterable", @@ -12,15 +12,19 @@ "allowSyntheticDefaultImports": true, "strict": true, "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, "module": "esnext", "moduleResolution": "node", "resolveJsonModule": true, "isolatedModules": true, - "jsx": "react-jsx", + "noEmit": true, + "jsx": "react", }, "include": [ "src" ], - "references": [{ "path": "../.shared" }], + "references": [ + { + "path": "../.shared" + } + ] } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..ad012e5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,8 @@ +{ + "references": [ + { + "path": "./.shared" + } + ], + "files": [] +} \ No newline at end of file