From 9e5de0c48ee9c06ca59cb4c00566ab59abb26ecd Mon Sep 17 00:00:00 2001 From: "Lu[ke] Wilson" Date: Wed, 3 May 2023 01:32:52 -0700 Subject: [PATCH] [improvement] readme / contributing (#1199) This PR adds a barebones Readme to the public repo that we can start to iterate on. This is what it looks like! ![image](https://user-images.githubusercontent.com/15892272/234321088-6bde4a16-5c9d-4d74-985b-fc578d374eb9.png) --------- Co-authored-by: Steve Ruiz --- .github/pull_request_template.md | 2 +- CONTRIBUTING.md | 15 ++--- README.md | 112 +++++++++++++++++++++++++++++-- apps/docs/pages/_document.tsx | 2 +- 4 files changed, 112 insertions(+), 19 deletions(-) diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 9f981726d..3b888b719 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,4 +1,4 @@ -Describe what your pull request does. Link to any relevant linear issues. If appropriate, add GIFs or images showing the before and after. +Describe what your pull request does. If appropriate, add GIFs or images showing the before and after. ### Test Plan diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2fbbf69a1..2c0e69cae 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,26 +4,19 @@ Thank you for your interest in contributing to [tldraw](https://github.com/tldra ## Create an Issue! -Before jumping into the code, please [create an issue](https://github.com/tldraw/tldraw/issues/new/choose) to discuss your proposed changes. This will help us to make sure that your changes are aligned with the project goals and that you are not duplicating work that is already in progress. +Before submitting a pull request, it is **strongly recommended** to create [create an issue](https://github.com/tldraw/tldraw/issues/new/choose) first to discuss your proposed changes. This will help us to make sure that your changes are aligned with the project goals and that you are not duplicating work that is already in progress. If you are not sure whether your changes are needed, feel free to create an issue anyway and we can discuss it there. Once we have agreed on the changes, you can start working on them. -## Environment - -- Ensure you have the latest version of Node and Yarn. -- Run `yarn` to install all needed dev dependencies. - ## Making Changes -Pull requests are encouraged. If you want to add a feature or fix a bug: +To create a pull request: 1. [Fork](https://docs.github.com/en/github/getting-started-with-github/fork-a-repo) and [clone](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository) the [repository](https://github.com/tldraw/tldraw) 2. [Create a separate branch](https://docs.github.com/en/desktop/contributing-and-collaborating-using-github-desktop/managing-branches) for your changes 3. Make your changes, and ensure that it is formatted by [Prettier](https://prettier.io) and type-checks without errors in [TypeScript](https://www.typescriptlang.org/) 4. Write tests that validate your change and/or fix. -5. Run `yarn build` and then run tests with `yarn test` (for all packages) or `yarn test:core` (for only changes to the core @tldraw/tldraw package). -6. For package changes, add docs inside the `/packages/*/README.md`. They will be copied on build to the corresponding `/docs/packages/*/index.md` file. -7. Create a changeset by running `yarn changeset`. [More info](https://github.com/atlassian/changesets). -8. Push your branch and open a PR. 🚀 +5. Run `yarn build` and then run tests with `yarn test`. +6. Push your branch and open a PR. 🚀 Your PR will be reviewed and merged in within a day or two if everything looks good. diff --git a/README.md b/README.md index 593ded8bd..539bcb6fa 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,110 @@ -# tldraw-lite - -test test -
- - tldraw + + tldraw
+ +# tldraw + +Welcome to the public monorepo for [tldraw](https://tldraw.com). + +## What is tldraw? + +tldraw is a collaborative digital whiteboard available at [tldraw.com](https://tldraw.com). Its editor, user interface, and other underlying libraries are open source and available in this repository. They are also distributed on npm. You can use tldraw to create a drop-in whiteboard for your product or as the foundation on which to build your own inifinite canvas applications. + +Learn more at [tldraw.dev](https://tldraw.dev). + +> **Note** This repo contains source code for the **current version** of tldraw. You can find the source for the original version [here](https://github.com/tldraw/tldraw-v1). + +## Installation & Usage + +To learn more about using tldraw in your React application, follow our guide [here](https://tldraw.dev/docs/ucg/installation) or see [this CodeSandbox](https://codesandbox.io/p/github/tldraw/tldraw-examples/main?file=%2FREADME.md). + +```tsx +import { Tldraw } from '@tldraw/tldraw' +import '@tldraw/tldraw/editor.css' +import '@tldraw/tldraw/ui.css' + +function TldrawExample() { + return +} +``` + +## Local development + +To run the local development server, first clone this repo. + +Install dependencies: + +```bash +yarn +``` + +Start the local development server: + +```bash +yarn dev +``` + +Open the example project at `localhost:5420`. + +### Examples + +Our development server contains several examples that demonstrates different ways that you can customize tldraw or use its APIs. Each example is found in the [**apps/examples/src**](https://github.com/tldraw/tldraw/tree/main/apps/examples/src) folder. + +- eg: `localhost:5420` for the basic example. +- eg: `localhost:5420/api` for the API example. + +To learn more about using tldraw, [visit our docs](https://tldraw.dev). + +## About this repository + +### Top-level layout + +This repository's contents is divided across four primary sections: + +- `/apps` contains the source for our applications +- `/packages` contains the source for our public packages +- `/scripts` contains scripts used for building and publishing +- `/assets` contains icons and translations relied on by the app + +### Applications + +- `examples`: our local development / examples project +- `docs`: our docs site at [tldraw.dev](https://tldraw.dev) +- `vscode`: our [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=tldraw-org.tldraw-vscode) + +### Packages + +- `editor`: the tldraw editor +- `ui`: the editor's user interface +- `tldraw`: the main tldraw package containing both the editor and the UI +- `primitives`: low-level primitives for working with vectors and geometry +- `tlschema`: shape definitions and migrations +- `tlsync-client`: a library for (locally) syncronizing editor instances +- `tlstore`: an in-memory reactive database +- `tlvalidate`: a validation library used for run-time validation +- `tlassets`: a library for working with tldraw's fonts and translations +- `file-format`: a library for working with tldraw's `.tldr` file format +- `utils`: low-level data utilities shared by other libraries + +## Community + +Have questions, comments or feedback? [Join our discord](https://discord.gg/rhsyWMUJxd) or [start a discussion](https://github.com/tldraw/tldraw/discussions/new). + +## Contribution + +Please see our [contributing guide](https://github.com/tldraw/tldraw/blob/main/CONTRIBUTING.md). Found a bug? Please [submit an issue](https://github.com/tldraw/tldraw/issues/new). + +## Distributions + +You can find tldraw on npm [here](https://www.npmjs.com/package/@tldraw/tldraw). + +## License + +The source code in this repository is licensed under Apache 2.0. The examples are licensed under MIT. + +## Contact + +Find us on Twitter at [@tldraw](https://twitter.com/tldraw) or email [hello@tldraw.com](mailto://hello@tldraw.com). You can also [join our discord](https://discord.gg/rhsyWMUJxd) for quick help and support. diff --git a/apps/docs/pages/_document.tsx b/apps/docs/pages/_document.tsx index 64947abbe..b64548619 100644 --- a/apps/docs/pages/_document.tsx +++ b/apps/docs/pages/_document.tsx @@ -3,7 +3,7 @@ import { Head, Html, Main, NextScript } from 'next/document' const TITLE = 'tldraw' const DESCRIPTION = 'Developer documentation for tldraw. Build infinite canvas experiences for the web.' -const URL = 'https://docs.tldraw.dev' +const URL = 'https://tldraw.dev' const TWITTER_HANDLE = '@tldraw' const TWITTER_CARD = 'social-twitter.png' const FACEBOOK_CARD = 'social-og.png'