Implement Turbo Workspaces, among other things

This commit is contained in:
Amruth Pillai
2022-08-21 22:18:12 +02:00
parent 73af4a6859
commit 0630369087
35 changed files with 569 additions and 50703 deletions

View File

@ -1,22 +1,18 @@
FROM node:lts-alpine as dependencies
RUN apk add --no-cache curl g++ make python3 \
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
FROM node:lts-alpine AS base
WORKDIR /app
RUN apk add --no-cache g++ git curl make python3 \
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
COPY package.json pnpm-*.yaml ./
FROM base as dependencies
COPY package.json pnpm-*.yaml turbo.json ./
COPY ./schema/package.json ./schema/package.json
COPY ./client/package.json ./client/package.json
RUN pnpm install --frozen-lockfile
FROM node:lts-alpine as builder
RUN apk add --no-cache curl g++ make python3 \
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
WORKDIR /app
FROM base as builder
COPY . .
@ -24,21 +20,14 @@ COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=dependencies /app/schema/node_modules ./schema/node_modules
COPY --from=dependencies /app/client/node_modules ./client/node_modules
RUN pnpm run build:schema
RUN pnpm run build:client
RUN pnpm run build --filter client
FROM node:lts-alpine as production
FROM base as production
WORKDIR /app
RUN apk add --no-cache curl \
&& curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm
COPY --from=builder /app/pnpm-*.yaml ./
COPY --from=builder /app/package.json ./
COPY --from=builder /app/package.json /app/pnpm-*.yaml /app/turbo.json ./
COPY --from=builder /app/client/package.json ./client/package.json
RUN pnpm install -F client --frozen-lockfile --prod
RUN pnpm install --filter client --prod --frozen-lockfile --workspace-root
COPY --from=builder /app/client/.next ./client/.next
COPY --from=builder /app/client/public ./client/public
@ -52,4 +41,4 @@ ENV PORT 3000
HEALTHCHECK --interval=30s --timeout=20s --retries=3 --start-period=15s \
CMD curl -fSs 127.0.0.1:3000 || exit 1
CMD [ "pnpm", "run", "start:client" ]
CMD [ "pnpm", "run", "start", "--filter", "client" ]

View File

@ -97,7 +97,7 @@ const Settings = () => {
<List sx={{ padding: 0 }}>
{/* Global Settings */}
<>
<ListSubheader className="rounded">
<ListSubheader disableSticky className="rounded">
{t<string>('builder.rightSidebar.sections.settings.global.heading')}
</ListSubheader>
@ -155,7 +155,7 @@ const Settings = () => {
{/* Page Settings */}
<>
<ListSubheader className="rounded">
<ListSubheader disableSticky className="rounded">
{t<string>('builder.rightSidebar.sections.settings.page.heading')}
</ListSubheader>
@ -187,7 +187,7 @@ const Settings = () => {
{/* Resume Settings */}
<>
<ListSubheader className="rounded">
<ListSubheader disableSticky className="rounded">
{t<string>('builder.rightSidebar.sections.settings.resume.heading')}
</ListSubheader>

View File

@ -1,6 +1,6 @@
import { createTheme } from '@mui/material';
import { createTheme, ThemeOptions } from '@mui/material/styles';
const theme = createTheme({
const theme: ThemeOptions = {
typography: {
fontSize: 12,
fontFamily: 'Inter, sans-serif',
@ -49,7 +49,7 @@ const theme = createTheme({
},
},
},
});
};
export const lightTheme = createTheme({
...theme,

View File

@ -2,81 +2,84 @@
"name": "@reactive-resume/client",
"scripts": {
"dev": "react-env --prefix PUBLIC -- next dev",
"lint": "next lint --fix",
"build": "next build && npm run sitemap",
"start": "react-env --prefix PUBLIC -- next start",
"lint": "next lint --fix",
"sitemap": "next-sitemap --config next-sitemap.config.js"
},
"dependencies": {
"@beam-australia/react-env": "^3.1.1",
"@date-io/dayjs": "^2.15.0",
"@emotion/css": "^11.10.0",
"@emotion/react": "^11.10.0",
"@emotion/styled": "^11.10.0",
"@hookform/resolvers": "2.9.7",
"@monaco-editor/react": "^4.4.5",
"@mui/icons-material": "^5.8.4",
"@mui/lab": "^5.0.0-alpha.95",
"@mui/material": "^5.10.1",
"@mui/system": "^5.10.1",
"@mui/x-date-pickers": "5.0.0-beta.6",
"@next/env": "^12.2.5",
"@reduxjs/toolkit": "^1.8.5",
"axios": "^0.27.2",
"clsx": "^1.2.1",
"dayjs": "^1.11.5",
"downloadjs": "^1.4.7",
"joi": "^17.6.0",
"lodash": "^4.17.21",
"md5-hex": "^4.0.0",
"monaco-editor": "^0.34.0",
"nanoid": "^3.3.4",
"clsx": "^1.2.1",
"next": "12.2.5",
"next-i18next": "^11.3.0",
"uuid": "^8.3.2",
"axios": "^0.27.2",
"dayjs": "^1.11.5",
"react": "18.2.0",
"react-beautiful-dnd": "^13.1.0",
"react-colorful": "^5.6.1",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1",
"react-dom": "18.2.0",
"react-hook-form": "^7.34.2",
"react-hot-toast": "2.3.0",
"react-hotkeys-hook": "^3.4.7",
"react-icons": "^4.4.0",
"react-markdown": "^8.0.3",
"react-query": "^3.39.2",
"react-redux": "^8.0.2",
"react-zoom-pan-pinch": "^2.1.3",
"redux": "^4.2.0",
"redux-persist": "^6.0.0",
"sharp": "^0.30.7",
"lodash": "^4.17.21",
"nanoid": "^3.3.4",
"md5-hex": "^4.0.0",
"@mui/lab": "^5.0.0-alpha.95",
"@next/env": "^12.2.5",
"react-dnd": "16.0.1",
"react-dom": "18.2.0",
"downloadjs": "^1.4.7",
"redux-saga": "^1.2.1",
"remark-gfm": "^3.0.1",
"sharp": "^0.30.7",
"uuid": "^8.3.2",
"webfontloader": "^1.6.28"
"@mui/system": "^5.10.1",
"react-icons": "^4.4.0",
"react-query": "^3.39.2",
"react-redux": "^8.0.2",
"@emotion/css": "^11.10.0",
"next-i18next": "^11.3.0",
"@mui/material": "^5.10.1",
"monaco-editor": "^0.34.0",
"redux-persist": "^6.0.0",
"webfontloader": "^1.6.28",
"@date-io/dayjs": "^2.15.0",
"@emotion/react": "^11.10.0",
"react-colorful": "^5.6.1",
"react-markdown": "^8.0.3",
"@emotion/styled": "^11.10.0",
"react-hook-form": "^7.34.2",
"react-hot-toast": "2.3.0",
"@reduxjs/toolkit": "^1.8.5",
"react-hotkeys-hook": "^3.4.7",
"@hookform/resolvers": "2.9.7",
"@mui/icons-material": "^5.8.4",
"@mui/x-date-pickers": "5.0.0-beta.6",
"react-beautiful-dnd": "^13.1.0",
"@monaco-editor/react": "^4.4.5",
"react-zoom-pan-pinch": "^2.1.3",
"react-dnd-html5-backend": "16.0.1",
"@beam-australia/react-env": "^3.1.1"
},
"resolutions": {
"@types/react": "18.0.17",
"@types/react-dom": "18.0.6"
},
"devDependencies": {
"sass": "^1.54.5",
"csstype": "^3.1.0",
"postcss": "^8.4.16",
"typescript": "^4.7.4",
"@babel/core": "^7.18.10",
"@reactive-resume/schema": "workspace:*",
"@tailwindcss/typography": "^0.5.4",
"@types/downloadjs": "^1.4.3",
"@types/lodash": "^4.14.184",
"@types/node": "18.7.8",
"@types/uuid": "^8.3.4",
"tailwindcss": "^3.1.8",
"@types/react": "18.0.17",
"@types/react-beautiful-dnd": "^13.1.2",
"autoprefixer": "^10.4.8",
"next-sitemap": "^3.1.21",
"@types/lodash": "^4.14.184",
"@types/react-dom": "18.0.6",
"@types/downloadjs": "^1.4.3",
"@types/react-redux": "^7.1.24",
"@types/tailwindcss": "^3.0.11",
"@types/uuid": "^8.3.4",
"@types/webfontloader": "^1.6.34",
"autoprefixer": "^10.4.8",
"csstype": "^3.1.0",
"eslint": "^8.22.0",
"eslint-config-next": "12.2.5",
"next-sitemap": "^3.1.20",
"postcss": "^8.4.16",
"prettier": "^2.7.1",
"sass": "^1.54.5",
"tailwindcss": "^3.1.8",
"typescript": "^4.7.4"
"@types/webfontloader": "^1.6.34",
"@reactive-resume/schema": "workspace:*",
"@tailwindcss/typography": "^0.5.4",
"@types/react-beautiful-dnd": "^13.1.2"
}
}

View File

@ -3,7 +3,6 @@ import clsx from 'clsx';
import get from 'lodash/get';
import isEmpty from 'lodash/isEmpty';
import { GetServerSideProps, NextPage } from 'next';
import { useRouter } from 'next/router';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import { useEffect } from 'react';
@ -55,8 +54,6 @@ export const getServerSideProps: GetServerSideProps<Props | Promise<Props>, Quer
};
const Printer: NextPage<Props> = ({ resume: initialData, locale }) => {
const router = useRouter();
const dispatch = useAppDispatch();
const resume = useAppSelector((state) => state.resume);
@ -65,12 +62,6 @@ const Printer: NextPage<Props> = ({ resume: initialData, locale }) => {
if (initialData) dispatch(setResume(initialData));
}, [dispatch, initialData]);
useEffect(() => {
const { pathname, asPath, query } = router;
router.push({ pathname, query }, asPath, { locale });
}, [router, locale]);
if (!resume || isEmpty(resume)) return null;
const layout: string[][][] = get(resume, 'metadata.layout', []);

View File

@ -1,39 +1,39 @@
{
"extends": "../tsconfig.base.json",
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": [".next"],
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"jsx": "preserve",
"target": "es5",
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"allowJs": true,
"baseUrl": "./",
"incremental": true,
"skipLibCheck": true,
"esModuleInterop": true,
"isolatedModules": true,
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"baseUrl": "./",
"forceConsistentCasingInFileNames": true,
"paths": {
"@/components/*": ["components/*"],
"@/config/*": ["config/*"],
"@/constants/*": ["constants/*"],
"@/data/*": ["data/*"],
"@/i18n/*": ["i18n/*"],
"@/modals/*": ["modals/*"],
"@/pages/*": ["pages/*"],
"@/public/*": ["public/*"],
"@/services/*": ["services/*"],
"@/store/*": ["store/*"],
"@/styles/*": ["styles/*"],
"@/templates/*": ["templates/*"],
"@/types/*": ["types/*"],
"@/utils/*": ["utils/*"],
"@/wrappers/*": ["wrappers/*"]
"@/config/*": ["config/*"],
"@/modals/*": ["modals/*"],
"@/public/*": ["public/*"],
"@/styles/*": ["styles/*"],
"@/services/*": ["services/*"],
"@/wrappers/*": ["wrappers/*"],
"@/constants/*": ["constants/*"],
"@/templates/*": ["templates/*"],
"@/components/*": ["components/*"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": [".next"]
}
}