Переглянути джерело

Merge branch 'agile' of https://github.com/visuddhinanda/mint into agile

visuddhinanda 3 роки тому
батько
коміт
65ffac33df
40 змінених файлів з 543 додано та 18 видалено
  1. 2 1
      .vscode/extensions.json
  2. 10 0
      dashboard-fluent/.env.orig
  3. 12 0
      dashboard-fluent/.gitignore
  4. 87 0
      dashboard-fluent/package.json
  5. BIN
      dashboard-fluent/public/favicon.ico
  6. 43 0
      dashboard-fluent/public/index.html
  7. BIN
      dashboard-fluent/public/logo192.png
  8. BIN
      dashboard-fluent/public/logo512.png
  9. 25 0
      dashboard-fluent/public/manifest.json
  10. 3 0
      dashboard-fluent/public/robots.txt
  11. 6 0
      dashboard-fluent/src/App.css
  12. 9 0
      dashboard-fluent/src/App.test.tsx
  13. 29 0
      dashboard-fluent/src/App.tsx
  14. 16 0
      dashboard-fluent/src/Router.tsx
  15. 15 0
      dashboard-fluent/src/index.tsx
  16. 3 0
      dashboard-fluent/src/locales/en-US/index.ts
  17. 60 0
      dashboard-fluent/src/locales/index.ts
  18. 11 0
      dashboard-fluent/src/locales/languages.ts
  19. 3 0
      dashboard-fluent/src/locales/zh-Hans/index.ts
  20. 3 0
      dashboard-fluent/src/locales/zh-Hant/index.ts
  21. 20 0
      dashboard-fluent/src/pages/Home.tsx
  22. 9 0
      dashboard-fluent/src/pages/NotFound.tsx
  23. 1 0
      dashboard-fluent/src/react-app-env.d.ts
  24. 15 0
      dashboard-fluent/src/reportWebVitals.ts
  25. 5 0
      dashboard-fluent/src/setupTests.ts
  26. 26 0
      dashboard-fluent/tsconfig.json
  27. 1 0
      dashboard/.env.orig
  28. 7 12
      dashboard/package.json
  29. 8 0
      dashboard/src/components/nut/Home.tsx
  30. 45 0
      dashboard/src/components/nut/MarkdownForm.tsx
  31. 21 0
      dashboard/src/components/nut/MarkdownShow.tsx
  32. 16 1
      dashboard/src/pages/nut/index.tsx
  33. 18 2
      documents/development/frontend/README.md
  34. 0 0
      documents/development/frontend/demo/img.png
  35. BIN
      documents/development/frontend/demo/md-form.png
  36. BIN
      documents/development/frontend/demo/md-show.png
  37. BIN
      documents/development/frontend/demo/md-view.png
  38. BIN
      documents/development/frontend/demo/on-click.png
  39. 6 0
      scripts/spring/user/create.sh
  40. 8 2
      scripts/spring/user/setup.sh

+ 2 - 1
.vscode/extensions.json

@@ -18,6 +18,7 @@
     "dbaeumer.vscode-eslint",
     "esbenp.prettier-vscode",
     "editorconfig.editorconfig",
-    "gruntfuggly.todo-tree"
+    "gruntfuggly.todo-tree",
+    "streetsidesoftware.code-spell-checker"
   ]
 }

+ 10 - 0
dashboard-fluent/.env.orig

@@ -0,0 +1,10 @@
+GENERATE_SOURCEMAP=false
+BROWSER=none
+PUBLIC_URL=/my
+HOST=0.0.0.0
+PORT=20080
+
+#REACT_APP_GRPC_HOST=http://127.0.0.1:10012
+REACT_APP_DEFAULT_LOCALE=zh-Hans
+REACT_APP_LANGUAGES=en-US,zh-Hans,zh-Hant
+REACT_APP_API_HOST=https://jeremy.spring.wikipali.org

+ 12 - 0
dashboard-fluent/.gitignore

@@ -0,0 +1,12 @@
+/node_modules/
+/yarn.lock
+
+# production
+/build/
+
+# misc
+.env
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local

+ 87 - 0
dashboard-fluent/package.json

@@ -0,0 +1,87 @@
+{
+  "name": "dashboard",
+  "version": "0.1.0",
+  "private": true,
+  "dependencies": {
+    "@fluentui/react": "^8.98.7",
+    "@fortawesome/fontawesome-free": "^6.2.0",
+    "@reduxjs/toolkit": "^1.8.6",
+    "@testing-library/jest-dom": "^5.14.1",
+    "@testing-library/react": "^13.0.0",
+    "@testing-library/user-event": "^13.2.1",
+    "@types/google-protobuf": "^3.15.6",
+    "@types/jest": "^27.0.1",
+    "@types/js-cookie": "^3.0.2",
+    "@types/node": "^16.7.13",
+    "@types/react": "^18.0.0",
+    "@types/react-big-calendar": "^0.38.2",
+    "@types/react-color": "^3.0.6",
+    "@types/react-copy-to-clipboard": "^5.0.4",
+    "@types/react-dom": "^18.0.0",
+    "@types/react-pdf": "^5.7.2",
+    "@uiw/react-md-editor": "^3.19.1",
+    "dayjs": "^1.11.6",
+    "dinero.js": "^2.0.0-alpha.8",
+    "emoji-mart": "^5.2.2",
+    "famfamfam-flags": "^1.0.0",
+    "famfamfam-mini": "^1.0.0",
+    "famfamfam-silk": "^1.0.0",
+    "filesize": "^10.0.5",
+    "google-map-react": "^2.2.0",
+    "google-protobuf": "^3.21.2",
+    "grpc-web": "^1.4.1",
+    "js-cookie": "^3.0.1",
+    "jwt-decode": "^3.1.2",
+    "qrcode.react": "^3.1.0",
+    "react": "^18.2.0",
+    "react-big-calendar": "^1.5.0",
+    "react-color": "^2.19.3",
+    "react-copy-to-clipboard": "^5.1.0",
+    "react-dom": "^18.2.0",
+    "react-draggable": "^4.4.5",
+    "react-dropzone": "^14.2.3",
+    "react-highlight-words": "^0.18.0",
+    "react-hook-form": "^7.38.0",
+    "react-image-crop": "^10.0.8",
+    "react-intl": "^6.2.1",
+    "react-json-view": "^1.21.3",
+    "react-markdown": "^8.0.3",
+    "react-number-format": "^5.1.0",
+    "react-pdf": "^5.7.2",
+    "react-player": "^2.11.0",
+    "react-quill": "^2.0.0",
+    "react-redux": "^8.0.4",
+    "react-router-dom": "^6.4.2",
+    "react-scripts": "5.0.1",
+    "react-sparklines": "^1.7.0",
+    "react-syntax-highlighter": "^15.5.0",
+    "timezones-list": "^3.0.1",
+    "typescript": "^4.4.2",
+    "video.js": "^7.20.3",
+    "web-vitals": "^2.1.0"
+  },
+  "scripts": {
+    "start": "react-scripts start",
+    "build": "react-scripts build",
+    "test": "react-scripts test",
+    "eject": "react-scripts eject"
+  },
+  "eslintConfig": {
+    "extends": [
+      "react-app",
+      "react-app/jest"
+    ]
+  },
+  "browserslist": {
+    "production": [
+      ">0.2%",
+      "not dead",
+      "not op_mini all"
+    ],
+    "development": [
+      "last 1 chrome version",
+      "last 1 firefox version",
+      "last 1 safari version"
+    ]
+  }
+}

BIN
dashboard-fluent/public/favicon.ico


+ 43 - 0
dashboard-fluent/public/index.html

@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="utf-8" />
+    <link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
+    <meta name="viewport" content="width=device-width, initial-scale=1" />
+    <meta name="theme-color" content="#000000" />
+    <meta
+      name="description"
+      content="Web site created using create-react-app"
+    />
+    <link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
+    <!--
+      manifest.json provides metadata used when your web app is installed on a
+      user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
+    -->
+    <link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
+    <!--
+      Notice the use of %PUBLIC_URL% in the tags above.
+      It will be replaced with the URL of the `public` folder during the build.
+      Only files inside the `public` folder can be referenced from the HTML.
+
+      Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
+      work correctly both with client-side routing and a non-root public URL.
+      Learn how to configure a non-root public URL by running `npm run build`.
+    -->
+    <title>React App</title>
+  </head>
+  <body>
+    <noscript>You need to enable JavaScript to run this app.</noscript>
+    <div id="root"></div>
+    <!--
+      This HTML file is a template.
+      If you open it directly in the browser, you will see an empty page.
+
+      You can add webfonts, meta tags, or analytics to this file.
+      The build step will place the bundled scripts into the <body> tag.
+
+      To begin the development, run `npm start` or `yarn start`.
+      To create a production bundle, use `npm run build` or `yarn build`.
+    -->
+  </body>
+</html>

BIN
dashboard-fluent/public/logo192.png


BIN
dashboard-fluent/public/logo512.png


+ 25 - 0
dashboard-fluent/public/manifest.json

@@ -0,0 +1,25 @@
+{
+  "short_name": "React App",
+  "name": "Create React App Sample",
+  "icons": [
+    {
+      "src": "favicon.ico",
+      "sizes": "64x64 32x32 24x24 16x16",
+      "type": "image/x-icon"
+    },
+    {
+      "src": "logo192.png",
+      "type": "image/png",
+      "sizes": "192x192"
+    },
+    {
+      "src": "logo512.png",
+      "type": "image/png",
+      "sizes": "512x512"
+    }
+  ],
+  "start_url": ".",
+  "display": "standalone",
+  "theme_color": "#000000",
+  "background_color": "#ffffff"
+}

+ 3 - 0
dashboard-fluent/public/robots.txt

@@ -0,0 +1,3 @@
+# https://www.robotstxt.org/robotstxt.html
+User-agent: *
+Disallow:

+ 6 - 0
dashboard-fluent/src/App.css

@@ -0,0 +1,6 @@
+@import "~react-quill/dist/quill.snow.css";
+
+body {
+  margin: 0;
+  padding: 0;
+}

+ 9 - 0
dashboard-fluent/src/App.test.tsx

@@ -0,0 +1,9 @@
+import React from 'react';
+import { render, screen } from '@testing-library/react';
+import App from './App';
+
+test('renders learn react link', () => {
+  render(<App />);
+  const linkElement = screen.getByText(/learn react/i);
+  expect(linkElement).toBeInTheDocument();
+});

+ 29 - 0
dashboard-fluent/src/App.tsx

@@ -0,0 +1,29 @@
+import { BrowserRouter } from "react-router-dom";
+import { IntlProvider } from "react-intl";
+
+import Router from "./Router";
+import locales, {
+  get as getLocale,
+  DEFAULT as DEFAULT_LOCALE,
+} from "./locales";
+
+import "./App.css";
+
+const lang = getLocale();
+const i18n = locales(lang);
+
+function Widget() {
+  return (
+    <IntlProvider
+      messages={i18n.messages}
+      locale={lang}
+      defaultLocale={DEFAULT_LOCALE}
+    >
+      <BrowserRouter basename={process.env.PUBLIC_URL}>
+        <Router />
+      </BrowserRouter>
+    </IntlProvider>
+  );
+}
+
+export default Widget;

+ 16 - 0
dashboard-fluent/src/Router.tsx

@@ -0,0 +1,16 @@
+import { Route, Routes } from "react-router-dom";
+
+import Home from "./pages/Home";
+import NotFound from "./pages/NotFound";
+
+const Widget = () => {
+  return (
+    <Routes>
+      {/* PLEASE KEEP THOSE ARE THE LAST TWO ROUTES */}
+      <Route path="" element={<Home />} />
+      <Route path="*" element={<NotFound />} />
+    </Routes>
+  );
+};
+
+export default Widget;

+ 15 - 0
dashboard-fluent/src/index.tsx

@@ -0,0 +1,15 @@
+import React from "react";
+import ReactDOM from "react-dom/client";
+
+import App from "./App";
+import reportWebVitals from "./reportWebVitals";
+
+const root = ReactDOM.createRoot(
+  document.getElementById("root") as HTMLElement
+);
+root.render(<App />);
+
+// If you want to start measuring performance in your app, pass a function
+// to log results (for example: reportWebVitals(console.log))
+// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
+reportWebVitals();

+ 3 - 0
dashboard-fluent/src/locales/en-US/index.ts

@@ -0,0 +1,3 @@
+const items = {};
+
+export default items;

+ 60 - 0
dashboard-fluent/src/locales/index.ts

@@ -0,0 +1,60 @@
+import Cookies from "js-cookie";
+import "moment/locale/zh-cn";
+import "moment/locale/zh-tw";
+import "moment/locale/es";
+import "moment/locale/fr";
+import "moment/locale/ja";
+import "moment/locale/ko";
+
+import languages from "./languages";
+import enUS from "./en-US";
+import zhHans from "./zh-Hans";
+import zhHant from "./zh-Hant";
+
+const KEY = "locale";
+
+export const DEFAULT: string =
+  process.env.REACT_APP_DEFAULT_LOCALE || "zh-Hans";
+export const LANGUAGES: string[] = process.env.REACT_APP_LANGUAGES?.split(
+  ","
+) || ["en-US", "zh-Hans"];
+
+export const get = (): string => {
+  return localStorage.getItem(KEY) || Cookies.get(KEY) || DEFAULT;
+};
+
+export const set = (lang: string, reload: boolean) => {
+  Cookies.set(KEY, lang);
+  localStorage.setItem(KEY, lang);
+  if (reload) {
+    window.location.reload();
+  }
+};
+
+export const remove = () => {
+  Cookies.remove(KEY);
+  localStorage.removeItem(KEY);
+};
+
+interface ILocale {
+  messages: Record<string, string>;
+}
+
+const messages = (lang: string): ILocale => {
+  switch (lang) {
+    case "en-US":
+      return {
+        messages: { ...enUS, ...languages },
+      };
+    case "zh-Hant":
+      return {
+        messages: { ...zhHant, ...languages },
+      };
+    default:
+      return {
+        messages: { ...zhHans, ...languages },
+      };
+  }
+};
+
+export default messages;

+ 11 - 0
dashboard-fluent/src/locales/languages.ts

@@ -0,0 +1,11 @@
+const items = {
+  "languages.en-US": "English",
+  "languages.zh-Hans": "简体中文",
+  "languages.zh-Hant": "繁體中文",
+  "languages.fr": "Français",
+  "languages.es": "Español",
+  "languages.ja": "日本語",
+  "languages.ko": "한국어",
+};
+
+export default items;

+ 3 - 0
dashboard-fluent/src/locales/zh-Hans/index.ts

@@ -0,0 +1,3 @@
+const items = {};
+
+export default items;

+ 3 - 0
dashboard-fluent/src/locales/zh-Hant/index.ts

@@ -0,0 +1,3 @@
+const items = {};
+
+export default items;

+ 20 - 0
dashboard-fluent/src/pages/Home.tsx

@@ -0,0 +1,20 @@
+import { PrimaryButton } from "@fluentui/react";
+
+const Widget = () => {
+  return (
+    <div>
+      <h1>home</h1>
+      <div>
+        <PrimaryButton
+          onClick={() => {
+            alert("aaa");
+          }}
+        >
+          Demo
+        </PrimaryButton>
+      </div>
+    </div>
+  );
+};
+
+export default Widget;

+ 9 - 0
dashboard-fluent/src/pages/NotFound.tsx

@@ -0,0 +1,9 @@
+const Widget = () => {
+  return (
+    <div>
+      <h1>not found</h1>
+    </div>
+  );
+};
+
+export default Widget;

+ 1 - 0
dashboard-fluent/src/react-app-env.d.ts

@@ -0,0 +1 @@
+/// <reference types="react-scripts" />

+ 15 - 0
dashboard-fluent/src/reportWebVitals.ts

@@ -0,0 +1,15 @@
+import { ReportHandler } from 'web-vitals';
+
+const reportWebVitals = (onPerfEntry?: ReportHandler) => {
+  if (onPerfEntry && onPerfEntry instanceof Function) {
+    import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
+      getCLS(onPerfEntry);
+      getFID(onPerfEntry);
+      getFCP(onPerfEntry);
+      getLCP(onPerfEntry);
+      getTTFB(onPerfEntry);
+    });
+  }
+};
+
+export default reportWebVitals;

+ 5 - 0
dashboard-fluent/src/setupTests.ts

@@ -0,0 +1,5 @@
+// jest-dom adds custom jest matchers for asserting on DOM nodes.
+// allows you to do things like:
+// expect(element).toHaveTextContent(/react/i)
+// learn more: https://github.com/testing-library/jest-dom
+import '@testing-library/jest-dom';

+ 26 - 0
dashboard-fluent/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,
+    "noFallthroughCasesInSwitch": true,
+    "module": "esnext",
+    "moduleResolution": "node",
+    "resolveJsonModule": true,
+    "isolatedModules": true,
+    "noEmit": true,
+    "jsx": "react-jsx"
+  },
+  "include": [
+    "src"
+  ]
+}

+ 1 - 0
dashboard/.env.orig

@@ -1,3 +1,4 @@
+GENERATE_SOURCEMAP=false
 BROWSER=none
 PUBLIC_URL=/my
 HOST=0.0.0.0

+ 7 - 12
dashboard/package.json

@@ -4,14 +4,8 @@
   "private": true,
   "dependencies": {
     "@ant-design/charts": "^1.4.2",
-    "@ant-design/pro-components": "^2.3.16",
-    "@emotion/react": "^11.10.4",
-    "@emotion/styled": "^11.10.4",
-    "@fluentui/react": "^8.98.0",
-    "@fontsource/roboto": "^4.5.8",
+    "@ant-design/pro-components": "^2.3.25",
     "@fortawesome/fontawesome-free": "^6.2.0",
-    "@mui/icons-material": "^5.10.9",
-    "@mui/material": "^5.10.9",
     "@reduxjs/toolkit": "^1.8.6",
     "@testing-library/jest-dom": "^5.14.1",
     "@testing-library/react": "^13.0.0",
@@ -26,8 +20,9 @@
     "@types/react-copy-to-clipboard": "^5.0.4",
     "@types/react-dom": "^18.0.0",
     "@types/react-pdf": "^5.7.2",
-    "antd": "^4.23.5",
-    "dayjs": "^1.11.5",
+    "@uiw/react-md-editor": "^3.19.1",
+    "antd": "^4.23.6",
+    "dayjs": "^1.11.6",
     "dinero.js": "^2.0.0-alpha.8",
     "emoji-mart": "^5.2.2",
     "famfamfam-flags": "^1.0.0",
@@ -48,12 +43,12 @@
     "react-draggable": "^4.4.5",
     "react-dropzone": "^14.2.3",
     "react-highlight-words": "^0.18.0",
-    "react-hook-form": "^7.37.0",
+    "react-hook-form": "^7.38.0",
     "react-image-crop": "^10.0.8",
-    "react-intl": "^6.2.0",
+    "react-intl": "^6.2.1",
     "react-json-view": "^1.21.3",
     "react-markdown": "^8.0.3",
-    "react-number-format": "^5.0.1",
+    "react-number-format": "^5.1.0",
     "react-pdf": "^5.7.2",
     "react-player": "^2.11.0",
     "react-quill": "^2.0.0",

+ 8 - 0
dashboard/src/components/nut/Home.tsx

@@ -1,9 +1,17 @@
 import code_png from "../../assets/nut/code.png";
+import MarkdownForm from "./MarkdownForm";
+import MarkdownShow from "./MarkdownShow";
 
 const Widget = () => {
   return (
     <div>
       <h1>Home</h1>
+      <br />
+      <MarkdownShow body="- Hello, **《mint》**!" />
+      <br />
+      <h3>Form</h3>
+      <MarkdownForm />
+      <br />
       <img alt="code" src={code_png} />
     </div>
   );

+ 45 - 0
dashboard/src/components/nut/MarkdownForm.tsx

@@ -0,0 +1,45 @@
+import { useState } from "react";
+import { useIntl } from "react-intl";
+import { ProForm, ProFormTextArea } from "@ant-design/pro-components";
+import { message } from "antd";
+import MDEditor from "@uiw/react-md-editor";
+
+interface IFormData {
+  plain: string;
+}
+const Widget = () => {
+  const intl = useIntl();
+  const [mdValue, setMdValue] = useState("**Hello mint!!!**");
+
+  return (
+    <ProForm<IFormData>
+      onFinish={async (values: IFormData) => {
+        // TODO
+        console.log(mdValue, values);
+        message.success(intl.formatMessage({ id: "flashes.success" }));
+      }}
+    >
+      <ProForm.Group>
+        <ProFormTextArea
+          width="md"
+          name="plain"
+          required
+          label="Plain text"
+          rules={[{ required: true }]}
+        />
+      </ProForm.Group>
+      <ProForm.Group>
+        <MDEditor
+          value={mdValue}
+          onChange={(value: string | undefined) => {
+            if (value) {
+              setMdValue(value);
+            }
+          }}
+        />
+      </ProForm.Group>
+    </ProForm>
+  );
+};
+
+export default Widget;

+ 21 - 0
dashboard/src/components/nut/MarkdownShow.tsx

@@ -0,0 +1,21 @@
+import MDEditor from "@uiw/react-md-editor";
+import ReactMarkdown from "react-markdown";
+import { Card } from "antd";
+
+interface IProps {
+  body: string;
+}
+
+const Widget = ({ body }: IProps) => (
+  <>
+    <Card title="Markdown Viewer 1">
+      <MDEditor.Markdown source={body} />
+    </Card>
+
+    <Card title="Markdown Viewer 2">
+      <ReactMarkdown>{body}</ReactMarkdown>
+    </Card>
+  </>
+);
+
+export default Widget;

+ 16 - 1
dashboard/src/pages/nut/index.tsx

@@ -1,11 +1,26 @@
-import HeadBar from "../../components/library/HeadBar";
+import { Tag } from "antd";
 import FooterBar from "../../components/library/FooterBar";
 
+import HeadBar from "../../components/library/HeadBar";
+import Home from "../../components/nut/Home";
+
 const Widget = () => {
 	return (
 		<div>
 			<HeadBar />
 			<div>Home Page</div>
+			<div>
+				<Tag
+					onClick={() => {
+						console.log("test tag was clicked");
+					}}
+				>
+					Test
+				</Tag>
+			</div>
+			<div>
+				<Home />
+			</div>
 			<FooterBar />
 		</div>
 	);

+ 18 - 2
documents/development/frontend/README.md

@@ -53,6 +53,22 @@ yarn start
 
 ### 其它例子
 
-- img 组件
+- 常见组件
 
-  ![img](img.png)
+  - img
+
+    ![img](demo/img.png)
+
+  - Markdown
+
+    - Viewer
+
+      ![markdown show](demo/md-show.png)
+
+    - Editor
+
+      ![markdown form](demo/md-form.png)
+
+  - on click event
+
+    ![on click](demo/on-click.png)

+ 0 - 0
documents/development/frontend/img.png → documents/development/frontend/demo/img.png


BIN
documents/development/frontend/demo/md-form.png


BIN
documents/development/frontend/demo/md-show.png


BIN
documents/development/frontend/demo/md-view.png


BIN
documents/development/frontend/demo/on-click.png


+ 6 - 0
scripts/spring/user/create.sh

@@ -36,6 +36,12 @@ then
     chown www-data:www-data /workspace/www/$1/logs
 fi
 
+if [ ! -d /workspace/www/$1/tmp ]
+then
+    mkdir -p /workspace/tmp/$1
+    chown $1:$1 /workspace/tmp/$1
+fi
+
 if [ ! -f /workspace/www/$1/nginx.conf ]
 then
     # https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names

+ 8 - 2
scripts/spring/user/setup.sh

@@ -37,7 +37,7 @@ then
     npm install yarn -g
 fi
 
-mkdir -p $HOME/.local/bin $HOME/tmp $HOME/local $HOME/downloads
+mkdir -p $HOME/.local/bin $HOME/local $HOME/downloads
 
 echo 'setup php'
 if [ ! -f "$HOME/downloads/composer" ]
@@ -60,12 +60,18 @@ then
 fi
 
 
-echo 'setup workspace'
+echo 'setup workspace folder'
 if [ ! -L $HOME/www ]
 then
     ln -sf /workspace/www/$USER $HOME/www
 fi
 
+echo 'setup tmp folder'
+if [ ! -L $HOME/tmp ]
+then
+    ln -sf /workspace/tmp/$USER $HOME/tmp
+fi
+
 echo 'setup tmux'
 if [ ! -f $HOME/.tmux.conf ]
 then