Virtual whiteboard for sketching hand-drawn like diagrams
Update Prettier scripts and supported files (#402)
Lipis86eadf379de3
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.ymlindex d87bcb9dcd..f88321cde7 100644--- a/.github/workflows/deploy.yml+++ b/.github/workflows/deploy.yml@@ -8,17 +8,17 @@ jobs:build-and-deploy:runs-on: ubuntu-lateststeps:- - uses: actions/checkout@v1+ - uses: actions/checkout@v1- - name: Build- run: |- npm ci- npm run build+ - name: Build+ run: |+ npm ci+ npm run build- - name: Deploy- uses: JamesIves/github-pages-deploy-action@releases/v3- with:- ACCESS_TOKEN: ${{ secrets.GH_DEPLOY }}- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}- BRANCH: gh-pages- FOLDER: build\ No newline at end of file+ - name: Deploy+ uses: JamesIves/github-pages-deploy-action@releases/v3+ with:+ ACCESS_TOKEN: ${{secrets.GH_DEPLOY}}+ GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}+ BRANCH: gh-pages+ FOLDER: builddiff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlnew file mode 100644index 0000000000..3d3791827c--- /dev/null+++ b/.github/workflows/lint.yml@@ -0,0 +1,22 @@+name: Node CI++on: [push]++jobs:+ lint:+ runs-on: ubuntu-latest++ steps:+ - uses: actions/checkout@v1++ - name: Setup Node.js 12.x+ uses: actions/setup-node@v1+ with:+ node-version: 12.x++ - name: Install and lint+ run: |+ npm ci+ npm run test:code+ env:+ CI: truediff --git a/.github/workflows/nodejs.yml b/.github/workflows/nodejs.ymldeleted file mode 100644index b20b278c4e..0000000000--- a/.github/workflows/nodejs.yml+++ /dev/null@@ -1,23 +0,0 @@-name: Node CI--on: [push]--jobs:- build:-- runs-on: ubuntu-latest-- steps:- - uses: actions/checkout@v1-- - name: Setup Node.js 12.x- uses: actions/setup-node@v1- with:- node-version: 12.x-- - name: Install and test- run: |- npm ci- npm test- env:- CI: true\ No newline at end of filediff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlnew file mode 100644index 0000000000..643eedcd03--- /dev/null+++ b/.github/workflows/test.yml@@ -0,0 +1,22 @@+name: Node CI++on: [push]++jobs:+ test:+ runs-on: ubuntu-latest++ steps:+ - uses: actions/checkout@v1++ - name: Setup Node.js 12.x+ uses: actions/setup-node@v1+ with:+ node-version: 12.x++ - name: Install and test+ run: |+ npm ci+ npm run test:app+ env:+ CI: truediff --git a/README.md b/README.mdindex 2efdd51233..57f09fd1a7 100644--- a/README.md+++ b/README.md@@ -32,23 +32,22 @@ Go to https://www.excalidraw.com to start sketchingThese instructions will get you a copy of the project up and running on your local machine for development and testing purposes.-Clone the repo+#### Clone the repo```bashgit clone https://github.com/excalidraw/excalidraw.git```-Install all the dependencies+#### Commands-```bash-npm install-```--Run the project--```bash-npm run start-```+| Command | Description |+| ------------------- | --------------------------------- |+| `npm install` | Install the dependencies |+| `npm run start` | Run the project |+| `npm run fix` | Reformat all files with Prettier |+| `npm run test:code` | Test for formatting with Prettier |+| `npm run test:app` | Test the app |+| `npm run test` | Run all tests |## Contributingdiff --git a/package-lock.json b/package-lock.jsonindex 3d06b15cae..600d693a9f 100644--- a/package-lock.json+++ b/package-lock.json@@ -1422,6 +1422,12 @@"@babel/types": "^7.3.0"}},+ "@types/color-name": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",+ "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",+ "dev": true+ },"@types/eslint-visitor-keys": {"version": "1.0.0","resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz",@@ -1465,9 +1471,9 @@}},"@types/jest": {- "version": "24.0.25",- "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.25.tgz",- "integrity": "sha512-hnP1WpjN4KbGEK4dLayul6lgtys6FPz0UfxMeMQCv0M+sTnzN3ConfiO72jHgLxl119guHgI8gLqDOrRLsyp2g==",+ "version": "24.9.0",+ "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.9.0.tgz",+ "integrity": "sha512-dXvuABY9nM1xgsXlOtLQXJKdacxZJd7AtvLsKZ/0b57ruMXDKCOXAC/M75GbllQX6o1pcZ5hAG4JzYy7Z/wM2w==","dev": true,"requires": {"jest-diff": "^24.3.0"@@ -1497,12 +1503,6 @@"resolved": "https://registry.npmjs.org/@types/node/-/node-13.1.2.tgz","integrity": "sha512-B8emQA1qeKerqd1dmIsQYnXi+mmAzTB7flExjmy5X1aVAKFNNNDubkavwR13kR6JnpeLp3aLoJhwn9trWPAyFQ=="},- "@types/normalize-package-data": {- "version": "2.4.0",- "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz",- "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==",- "dev": true- },"@types/parse-json": {"version": "4.0.0","resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz",@@ -1958,9 +1958,9 @@},"dependencies": {"readable-stream": {- "version": "2.3.6",- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",- "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",+ "version": "2.3.7",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev": true,"requires": {"core-util-is": "~1.0.0",@@ -6288,9 +6288,9 @@"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g=="},"get-stdin": {- "version": "7.0.0",- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz",- "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==",+ "version": "4.0.1",+ "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",+ "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=","dev": true},"get-stream": {@@ -6769,24 +6769,69 @@"integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM="},"husky": {- "version": "3.1.0",- "resolved": "https://registry.npmjs.org/husky/-/husky-3.1.0.tgz",- "integrity": "sha512-FJkPoHHB+6s4a+jwPqBudBDvYZsoQW5/HBuMSehC8qDiCe50kpcxeqFoDSlow+9I6wg47YxBoT3WxaURlrDIIQ==",+ "version": "4.0.10",+ "resolved": "https://registry.npmjs.org/husky/-/husky-4.0.10.tgz",+ "integrity": "sha512-Ptm4k2DqOwxeK/kzu5RaJmNRoGvESrgDXObFcZ8aJZcyXyMBHhM2FqZj6zYKdetadmP3wCwxEHCBuB9xGlRp8A==","dev": true,"requires": {- "chalk": "^2.4.2",+ "chalk": "^3.0.0","ci-info": "^2.0.0",- "cosmiconfig": "^5.2.1",- "execa": "^1.0.0",- "get-stdin": "^7.0.0",+ "cosmiconfig": "^6.0.0","opencollective-postinstall": "^2.0.2","pkg-dir": "^4.2.0","please-upgrade-node": "^3.2.0",- "read-pkg": "^5.2.0",- "run-node": "^1.0.0",- "slash": "^3.0.0"+ "slash": "^3.0.0",+ "which-pm-runs": "^1.0.0"},"dependencies": {+ "ansi-styles": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",+ "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",+ "dev": true,+ "requires": {+ "@types/color-name": "^1.1.1",+ "color-convert": "^2.0.1"+ }+ },+ "chalk": {+ "version": "3.0.0",+ "resolved": "https://registry.npmjs.org/chalk/-/chalk-3.0.0.tgz",+ "integrity": "sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==",+ "dev": true,+ "requires": {+ "ansi-styles": "^4.1.0",+ "supports-color": "^7.1.0"+ }+ },+ "color-convert": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",+ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",+ "dev": true,+ "requires": {+ "color-name": "~1.1.4"+ }+ },+ "color-name": {+ "version": "1.1.4",+ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",+ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",+ "dev": true+ },+ "cosmiconfig": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz",+ "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==",+ "dev": true,+ "requires": {+ "@types/parse-json": "^4.0.0",+ "import-fresh": "^3.1.0",+ "parse-json": "^5.0.0",+ "path-type": "^4.0.0",+ "yaml": "^1.7.2"+ }+ },"find-up": {"version": "4.1.0","resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",@@ -6797,6 +6842,22 @@"path-exists": "^4.0.0"}},+ "has-flag": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",+ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==",+ "dev": true+ },+ "import-fresh": {+ "version": "3.2.1",+ "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz",+ "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==",+ "dev": true,+ "requires": {+ "parent-module": "^1.0.0",+ "resolve-from": "^4.0.0"+ }+ },"locate-path": {"version": "5.0.0","resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",@@ -6833,6 +6894,12 @@"integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==","dev": true},+ "path-type": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz",+ "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==",+ "dev": true+ },"pkg-dir": {"version": "4.2.0","resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz",@@ -6842,17 +6909,11 @@"find-up": "^4.0.0"}},- "read-pkg": {- "version": "5.2.0",- "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz",- "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==",- "dev": true,- "requires": {- "@types/normalize-package-data": "^2.4.0",- "normalize-package-data": "^2.5.0",- "parse-json": "^5.0.0",- "type-fest": "^0.6.0"- }+ "resolve-from": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",+ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",+ "dev": true},"slash": {"version": "3.0.0",@@ -6860,11 +6921,14 @@"integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==","dev": true},- "type-fest": {- "version": "0.6.0",- "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz",- "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==",- "dev": true+ "supports-color": {+ "version": "7.1.0",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz",+ "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==",+ "dev": true,+ "requires": {+ "has-flag": "^4.0.0"+ }}}},@@ -10058,9 +10122,9 @@}},"node-sass": {- "version": "4.13.0",- "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.0.tgz",- "integrity": "sha512-W1XBrvoJ1dy7VsvTAS5q1V45lREbTlZQqFbiHb3R3OTTCma0XBtuG6xZ6Z4506nR4lmHPTqVRwxT6KgtWC97CA==",+ "version": "4.13.1",+ "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.13.1.tgz",+ "integrity": "sha512-TTWFx+ZhyDx1Biiez2nB0L3YrCZ/8oHagaDalbuBSlqXgUPsdkUSzJsVxeDO9LtPB49+Fh3WQl3slABo6AotNw==","dev": true,"requires": {"async-foreach": "^0.1.3",@@ -10117,12 +10181,6 @@"which": "^1.2.9"}},- "get-stdin": {- "version": "4.0.1",- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",- "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",- "dev": true- },"lru-cache": {"version": "4.1.5","resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",@@ -12850,12 +12908,6 @@"is-promise": "^2.1.0"}},- "run-node": {- "version": "1.0.0",- "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz",- "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==",- "dev": true- },"run-parallel": {"version": "1.1.9","resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz",@@ -13857,9 +13909,9 @@},"dependencies": {"readable-stream": {- "version": "2.3.6",- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",- "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",+ "version": "2.3.7",+ "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",+ "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==","dev": true,"requires": {"core-util-is": "~1.0.0",@@ -14115,14 +14167,6 @@"dev": true,"requires": {"get-stdin": "^4.0.1"- },- "dependencies": {- "get-stdin": {- "version": "4.0.1",- "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz",- "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=",- "dev": true- }}},"strip-json-comments": {@@ -14583,9 +14627,9 @@"integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="},"typescript": {- "version": "3.7.4",- "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.4.tgz",- "integrity": "sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw==",+ "version": "3.7.5",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",+ "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==","dev": true},"uglify-js": {@@ -15346,6 +15390,12 @@"resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz","integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho="},+ "which-pm-runs": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz",+ "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=",+ "dev": true+ },"wide-align": {"version": "1.1.3","resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz",diff --git a/package.json b/package.jsonindex ac6f62c8ed..e5b8ae1c7c 100644--- a/package.json+++ b/package.json@@ -6,29 +6,33 @@"keywords": [],"main": "src/index.js","dependencies": {- "nanoid": "^2.1.9",+ "nanoid": "2.1.9","react": "16.12.0","react-dom": "16.12.0","react-scripts": "3.3.0",- "roughjs": "^4.0.4"+ "roughjs": "4.0.4"},"devDependencies": {- "@types/jest": "^24.0.25",- "@types/nanoid": "^2.1.0",+ "@types/jest": "24.9.0",+ "@types/nanoid": "2.1.0","@types/react": "16.9.17",- "@types/react-color": "^3.0.1",+ "@types/react-color": "3.0.1","@types/react-dom": "16.9.4",- "husky": "3.1.0",+ "husky": "4.0.10","lint-staged": "9.5.0",- "node-sass": "^4.13.0",+ "node-sass": "4.13.1","prettier": "1.19.1",- "typescript": "3.7.4"+ "typescript": "3.7.5"},"scripts": {- "start": "react-scripts start","build": "react-scripts build",- "test": "react-scripts test --env=jsdom --passWithNoTests",- "eject": "react-scripts eject"+ "eject": "react-scripts eject",+ "fix": "npm run prettier -- --write",+ "prettier": "prettier \"**/*.{js,css,scss,json,md,ts,tsx,html,yml}\"",+ "start": "react-scripts start",+ "test:app": "react-scripts test --env=jsdom --passWithNoTests",+ "test:code": "npm run prettier -- --list-different",+ "test": "npm run test:code && npm run test:app"},"browserslist": [">0.2%",@@ -45,7 +49,7 @@}},"lint-staged": {- "*.{js,css,json,md,ts,tsx}": [+ "*.{js,css,scss,json,md,ts,tsx,html,yml}": ["prettier --write","git add"],