ccb6b918c5
This code has started to bitrot a bit and this freshens it up a bit. - there's a double request happening for every bookmark paste at the moment, yikes! One request originates from the paste logic, and the other originates from the `onBeforeCreate` in `BookmarkShapeUtil`. They both see that an asset is missing and race to make the request at the same time. It _seems_ like we don't need the `onBeforeCreate` anymore. But, if I'm mistaken on some edge case here lemme know and we can address this in a different way. - the extractor is really crusty (the grabity code is from 5 yrs ago and hasn't been updated) and we don't have control over it. i've worked on unfurling stuff before with Paper and my other projects and this reworks things to use Cheerio, which is a more robust library. - this adds `favicon` to the response request which should usually default to the apple-touch-icon. this helps with some better bookmark displays (e.g. like Wikipedia if an image is empty) In general, this'll start to make this more maintainable and improvable on our end. Double request: <img width="1496" alt="Screenshot 2024-05-31 at 17 54 49" src="https://github.com/tldraw/tldraw/assets/469604/22033170-caaa-4fd2-854f-f19b61611978"> Before: <img width="355" alt="Screenshot 2024-05-31 at 17 55 02" src="https://github.com/tldraw/tldraw/assets/469604/fd272669-ee52-4cc7-bed7-72a8ed8d53a0"> After: <img width="351" alt="Screenshot 2024-05-31 at 17 55 44" src="https://github.com/tldraw/tldraw/assets/469604/87d27342-0d49-4cfc-a811-356370562d19"> ### Change Type <!-- ❗ Please select a 'Scope' label ❗️ --> - [ ] `sdk` — Changes the tldraw SDK - [x] `dotcom` — Changes the tldraw.com web app - [ ] `docs` — Changes to the documentation, examples, or templates. - [ ] `vs code` — Changes to the vscode plugin - [ ] `internal` — Does not affect user-facing stuff <!-- ❗ Please select a 'Type' label ❗️ --> - [x] `bugfix` — Bug fix - [ ] `feature` — New feature - [x] `improvement` — Improving existing features - [ ] `chore` — Updating dependencies, other boring stuff - [ ] `galaxy brain` — Architectural changes - [ ] `tests` — Changes to any test code - [ ] `tools` — Changes to infrastructure, CI, internal scripts, debugging tools, etc. - [ ] `dunno` — I don't know ### Test Plan 1. Test pasting links in, and pasting again. ### Release Notes - Bookmarks: fix up double request and rework extractor code. --------- Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
126 lines
4.1 KiB
JSON
126 lines
4.1 KiB
JSON
{
|
|
"name": "@tldraw/monorepo",
|
|
"description": "A tiny little drawing app (monorepo).",
|
|
"version": "0.0.0",
|
|
"private": true,
|
|
"author": {
|
|
"name": "tldraw Inc.",
|
|
"email": "hello@tldraw.com"
|
|
},
|
|
"homepage": "https://tldraw.dev",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/tldraw/tldraw"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/tldraw/tldraw/issues"
|
|
},
|
|
"keywords": [
|
|
"tldraw",
|
|
"drawing",
|
|
"app",
|
|
"development",
|
|
"whiteboard",
|
|
"canvas",
|
|
"infinite"
|
|
],
|
|
"workspaces": [
|
|
"docs",
|
|
"apps/*",
|
|
"packages/*",
|
|
"apps/vscode/*",
|
|
"e2e",
|
|
"config",
|
|
"scripts"
|
|
],
|
|
"scripts": {
|
|
"clean": "scripts/clean.sh",
|
|
"postinstall": "husky install && yarn refresh-assets",
|
|
"refresh-assets": "lazy refresh-assets",
|
|
"dev": "LAZYREPO_PRETTY_OUTPUT=0 lazy run dev --filter='apps/examples' --filter='packages/tldraw'",
|
|
"dev-vscode": "code ./apps/vscode/extension && lazy run dev --filter='apps/vscode/{extension,editor}'",
|
|
"dev-app": "LAZYREPO_PRETTY_OUTPUT=0 lazy run dev --filter='apps/{dotcom,dotcom-asset-upload,dotcom-worker}' --filter='packages/tldraw'",
|
|
"dev-docs": "LAZYREPO_PRETTY_OUTPUT=0 lazy run dev --filter='apps/docs'",
|
|
"dev-huppy": "LAZYREPO_PRETTY_OUTPUT=0 lazy run dev --filter 'apps/huppy'",
|
|
"build": "lazy build",
|
|
"build-app": "lazy run build --filter 'apps/dotcom'",
|
|
"build-docs": "lazy run build --filter 'apps/docs'",
|
|
"build-types": "lazy inherit",
|
|
"build-api": "lazy build-api",
|
|
"build-package": "lazy build-package",
|
|
"preview-app": "VITE_PREVIEW=1 yarn dev-app",
|
|
"lint": "lazy lint",
|
|
"format": "prettier --write --cache '**/*.{yml,yaml,json,md,mdx,html,css,js,jsx,ts,tsx,cjs,mjs}'",
|
|
"typecheck": "yarn refresh-assets && tsx scripts/typecheck.ts",
|
|
"check-scripts": "tsx scripts/check-scripts.ts",
|
|
"check-tsconfigs": "tsx scripts/check-tsconfigs.ts",
|
|
"update-pr-template": "tsx scripts/update-pr-template.ts",
|
|
"api-check": "lazy api-check",
|
|
"test-ci": "lazy test-ci",
|
|
"test": "lazy test",
|
|
"test-coverage": "lazy test-coverage && node scripts/offer-coverage.mjs",
|
|
"e2e": "lazy e2e --filter='apps/examples'"
|
|
},
|
|
"engines": {
|
|
"npm": ">=7.0.0"
|
|
},
|
|
"packageManager": "yarn@4.0.2",
|
|
"lint-staged": {
|
|
"*.{js,jsx,ts,tsx,json}": [
|
|
"prettier --write --cache"
|
|
]
|
|
},
|
|
"devDependencies": {
|
|
"@microsoft/api-extractor": "^7.43.1",
|
|
"@next/eslint-plugin-next": "^13.3.0",
|
|
"@swc/core": "^1.3.55",
|
|
"@swc/jest": "^0.2.34",
|
|
"@types/glob": "^8.1.0",
|
|
"@types/jest": "^29.5.12",
|
|
"@types/node": "~20.11",
|
|
"@types/react": "^18.2.47",
|
|
"@types/react-dom": "^18.2.18",
|
|
"@typescript-eslint/eslint-plugin": "^5.57.0",
|
|
"@typescript-eslint/parser": "^5.57.0",
|
|
"auto": "^11.1.1",
|
|
"eslint": "^8.37.0",
|
|
"eslint-config-prettier": "^8.8.0",
|
|
"eslint-plugin-deprecation": "^2.0.0",
|
|
"eslint-plugin-import": "^2.27.5",
|
|
"eslint-plugin-local": "^1.0.0",
|
|
"eslint-plugin-no-only-tests": "^3.1.0",
|
|
"eslint-plugin-react": "^7.32.2",
|
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
"fs-extra": "^11.1.0",
|
|
"husky": "^8.0.0",
|
|
"jest": "30.0.0-alpha.2",
|
|
"json5": "^2.2.3",
|
|
"lazyrepo": "0.0.0-alpha.27",
|
|
"license-report": "^6.5.0",
|
|
"lint-staged": ">=10",
|
|
"prettier": "^3.0.3",
|
|
"prettier-plugin-organize-imports": "^3.2.3",
|
|
"rimraf": "^4.4.0",
|
|
"tsx": "^4.0.0",
|
|
"typescript": "^5.3.3",
|
|
"vercel": "^34.2.4"
|
|
},
|
|
"// resolutions.canvas": [
|
|
"our examples app depenends on pdf.js which pulls in canvas as an optional dependency.",
|
|
"it slows down installs quite a bit though, so we replace it with an empty package."
|
|
],
|
|
"resolutions": {
|
|
"@microsoft/api-extractor@^7.35.4": "patch:@microsoft/api-extractor@npm%3A7.35.4#./.yarn/patches/@microsoft-api-extractor-npm-7.35.4-5f4f0357b4.patch",
|
|
"vectra@^0.4.4": "patch:vectra@npm%3A0.4.4#./.yarn/patches/vectra-npm-0.4.4-6aac3f6c29.patch",
|
|
"domino@^2.1.6": "patch:domino@npm%3A2.1.6#./.yarn/patches/domino-npm-2.1.6-b0dc3de857.patch",
|
|
"canvas": "npm:empty-npm-package@1.0.0",
|
|
"@microsoft/tsdoc@npm:0.14.2": "patch:@microsoft/tsdoc@npm%3A0.14.2#~/.yarn/patches/@microsoft-tsdoc-npm-0.14.2-9988282153.patch"
|
|
},
|
|
"dependencies": {
|
|
"@sentry/cli": "^2.25.0",
|
|
"@yarnpkg/types": "^4.0.0",
|
|
"cross-env": "^7.0.3",
|
|
"purgecss": "^5.0.0",
|
|
"svgo": "^3.0.2"
|
|
}
|
|
}
|