Skip to content

Commit

Permalink
BC-5424 - persistent storage for tldraw (#47)
Browse files Browse the repository at this point in the history
* refactor repo to use Vite

* implement custom user cursors with names

* implement persistent storage support
  • Loading branch information
davwas authored Jan 30, 2024
1 parent 59e44cf commit 6c13c66
Show file tree
Hide file tree
Showing 105 changed files with 10,512 additions and 25,994 deletions.
8 changes: 5 additions & 3 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/node_modules
Dockerfile
.git
.github
.vscode
.idea
node_modules
Dockerfile.*
.dockerignore
.gitignore
27 changes: 27 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:react-hooks/recommended",
"plugin:prettier/recommended",
],
ignorePatterns: ["dist", ".eslintrc.cjs"],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaVersion: "latest",
sourceType: "module",
project: ["./tsconfig.json", "./tsconfig.node.json"],
tsconfigRootDir: __dirname,
},
plugins: ["react-refresh"],
rules: {
"no-console": "warn",
"@typescript-eslint/no-explicit-any": "warn",
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
},
};
121 changes: 0 additions & 121 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Fix end-of-lines in Git versions older than 2.10
# https://github.com/git/git/blob/master/Documentation/RelNotes/2.10.0.txt#L248
* text=auto eol=lf
2 changes: 1 addition & 1 deletion .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ jobs:
- name: 'Dependency Review'
uses: actions/dependency-review-action@v3
with:
allow-licenses: AGPL-3.0-only, LGPL-3.0, MIT, Apache-2.0, BSD-2-Clause, BSD-3-Clause, ISC, X11, 0BSD, GPL-3.0 AND BSD-3-Clause-Clear, MPL-2.0, CC0-1.0, CC-BY-4.0, Unlicense
allow-licenses: MIT, Apache-2.0, BSD-3-Clause, 0BSD, Unlicense
41 changes: 21 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

40 changes: 0 additions & 40 deletions .idea/codeStyles/Project.xml

This file was deleted.

5 changes: 0 additions & 5 deletions .idea/codeStyles/codeStyleConfig.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/inspectionProfiles/Project_Default.xml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/misc.xml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

12 changes: 0 additions & 12 deletions .idea/tldraw.iml

This file was deleted.

6 changes: 0 additions & 6 deletions .idea/vcs.xml

This file was deleted.

4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/.github
**/ansible
LICENSE.md
README.md
5 changes: 5 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: false,
bracketSameLine: true,
endOfLine: "lf",
};
7 changes: 0 additions & 7 deletions .prettierrc.js

This file was deleted.

8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci

COPY babel.config.js .eslintrc.js craco.config.js LICENSE.md tsconfig.json .prettierrc.js ./
COPY LICENSE.md .eslintrc.cjs .prettierrc.cjs vite.config.ts tsconfig.json tsconfig.node.json index.html ./
COPY public ./public
COPY src ./src
RUN NODE_ENV=production npm run build

# runtime image stage
FROM docker.io/nginx:1.25
FROM docker.io/nginx:1.25-alpine

RUN mkdir /etc/nginx/templates

COPY nginx.conf.template /etc/nginx/templates/default.conf.template
COPY --from=build-stage /app/build /usr/share/nginx/html
COPY --from=build-stage /app/build/favicon.ico /usr/share/nginx/html/static/media
COPY --from=build-stage /app/dist /usr/share/nginx/html
COPY --from=build-stage /app/dist/favicon.png /app/dist/tldraw-assets.json /usr/share/nginx/html/assets/

EXPOSE 3046

Expand Down
16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Docker

2.Navigate to the project directory:

### cd tldraw
### cd tldraw-client

3.Install the dependencies:

Expand All @@ -30,7 +30,7 @@ Docker

To run Tldraw in development mode, use the following command:

### npm start
### npm run dev

This command will start the development server on [http://localhost:3046].

Expand All @@ -44,18 +44,6 @@ Tldraw can also be run using Docker. To build and run the Docker image, execute

The application will be accessible at [http://localhost:83].

## Formatting and Linting

Tldraw uses the following formatting and linting tools:
Prettier: A code formatter that helps to ensure a consistent code style.
ESLint: A linter that helps to find potential errors and problems in code.

To format and lint the code, you can run the following command:

### npm run lint

### npm run lint-fix

## License

Tldraw is licensed under the AGPL-3.0 license. See the LICENSE file for more information.
Loading

0 comments on commit 6c13c66

Please sign in to comment.