From 86cce6d161e2018f02fc4271bbcff803d07fa339 Mon Sep 17 00:00:00 2001 From: Dan Groshev Date: Wed, 7 Feb 2024 16:02:22 +0000 Subject: [PATCH] Unbiome (#2776) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Biome as it is now didn't work out for us 😢 Summary for posterity: * it IS much, much faster, fast enough to skip any sort of caching * we couldn't fully replace Prettier just yet. We use Prettier programmatically to format code in docs, and Biome's JS interface is officially alpha and [had legacy peer deps set](https://github.com/biomejs/biome/pull/1756) (which would fail our CI build as we don't allow installation warnings) * ternary formatting differs from Prettier, leading to a large diff https://github.com/biomejs/biome/issues/1661 * import sorting differs from Prettier's `prettier-plugin-organize-imports`, making the diff even bigger * the deal breaker is a multi-second delay on saving large files (for us it's [Editor.ts](https://github.com/tldraw/tldraw/blob/main/packages/editor/src/lib/editor/Editor.ts)) in VSCode when import sorting is enabled. There is a seemingly relevant Biome issue where I posted a small summary of our findings: https://github.com/biomejs/biome/issues/1569#issuecomment-1930411623 Further actions: * reevaluate in a few months as Biome matures ### Change Type - [x] `internal` — Any other changes that don't affect the published package --- .github/workflows/checks.yml | 6 - .ignore | 4 +- .prettierignore | 25 ++ .prettierrc | 2 +- .vscode/extensions.json | 3 - apps/docs/package.json | 5 +- .../docs/scripts/functions/generateSection.ts | 4 +- apps/docs/utils/ContentDatabase.ts | 4 +- apps/docs/utils/ContentVectorDatabase.ts | 4 +- .../src/lib/AlarmScheduler.test.ts | 8 +- .../BoardHistorySnapshot.tsx | 2 +- .../components/PeopleMenu/PeopleMenuItem.tsx | 4 +- apps/dotcom/src/components/ShareMenu.tsx | 4 +- apps/dotcom/src/pages/public-snapshot.tsx | 2 +- apps/dotcom/src/utils/useFileSystem.tsx | 2 +- .../user-presence/UserPresenceExample.tsx | 6 +- biome.json | 77 ------ package.json | 10 +- packages/assets/imports.js | 34 +-- packages/assets/imports.vite.js | 34 +-- .../src/lib/components/LiveCollaborators.tsx | 4 +- .../editor/src/lib/config/createTLStore.ts | 6 +- packages/editor/src/lib/editor/Editor.ts | 12 +- .../managers/SnapManager/BoundsSnaps.ts | 12 +- packages/editor/src/lib/primitives/easings.ts | 8 +- .../src/lib/utils/getIncrementedName.ts | 2 +- packages/state/docs-ordering.json | 5 +- packages/store/src/lib/StoreSchema.ts | 20 +- packages/store/src/lib/migrate.ts | 204 +++++++------- .../lib/canvas/TldrawSelectionForeground.tsx | 2 +- .../src/lib/shapes/arrow/ArrowShapeUtil.tsx | 12 +- .../tldraw/src/lib/shapes/arrow/arrowLabel.ts | 4 +- .../tldraw/src/lib/shapes/arrow/arrowheads.ts | 4 +- .../tldraw/src/lib/shapes/draw/getPath.ts | 4 +- .../src/lib/shapes/geo/GeoShapeUtil.tsx | 8 +- .../tldraw/src/lib/shapes/geo/cloudOutline.ts | 4 +- .../shapes/geo/components/DashStyleCloud.tsx | 8 +- .../src/lib/shapes/geo/toolStates/Pointing.ts | 4 +- .../src/lib/shapes/shared/TextLabel.tsx | 2 +- .../shared/createTextSvgElementFromSpans.ts | 4 +- .../shared/freehand/getStrokeOutlinePoints.ts | 8 +- .../shared/freehand/setStrokePointRadii.ts | 8 +- .../src/lib/shapes/text/TextShapeUtil.tsx | 2 +- .../lib/tools/SelectTool/childStates/Idle.ts | 10 +- .../childStates/PointingSelection.ts | 2 +- .../src/lib/ui/components/ActionsMenu.tsx | 4 +- .../src/lib/ui/components/DebugPanel.tsx | 4 +- .../tldraw/src/lib/ui/components/Menu.tsx | 4 +- .../ui/components/StylePanel/StylePanel.tsx | 2 +- .../hooks/clipboard/pasteExcalidrawContent.ts | 8 +- .../tldraw/src/lib/ui/hooks/useActions.tsx | 4 +- .../src/lib/ui/hooks/useActionsMenuSchema.tsx | 4 +- packages/tldraw/src/lib/ui/overrides.ts | 10 +- packages/tldraw/src/test/TestEditor.ts | 18 +- packages/tlschema/package.json | 1 + packages/tlschema/src/records/TLAsset.ts | 2 +- packages/tlschema/src/records/TLInstance.ts | 12 +- packages/tlschema/src/records/TLShape.ts | 14 +- packages/tlschema/src/shapes/TLArrowShape.ts | 4 +- packages/utils/src/lib/object.ts | 24 +- packages/validate/src/lib/validation.ts | 16 +- scripts/lint.ts | 18 ++ scripts/publish-canary.ts | 2 +- scripts/publish-new.ts | 2 +- yarn.lock | 252 +++++++++++------- 65 files changed, 502 insertions(+), 502 deletions(-) create mode 100644 .prettierignore delete mode 100644 .vscode/extensions.json delete mode 100644 biome.json diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 7c2c90989..3eff996dd 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -38,12 +38,6 @@ jobs: - name: Check for installation warnings run: 'yarn | grep -vzq "with warnings"' - - name: Setup Biome CLI - uses: biomejs/setup-biome@v2 - - - name: Run Biome - run: biome ci --formatter-enabled=true --linter-enabled=false --organize-imports-enabled=false . - - name: Typecheck run: yarn build-types diff --git a/.ignore b/.ignore index 236f8f98d..7f42387d4 100644 --- a/.ignore +++ b/.ignore @@ -2,7 +2,7 @@ dist .tsbuild-dev .tsbuild-pub .tsbuild -node_modules +node\*modules *.d.ts *.md **/_archive @@ -18,6 +18,4 @@ apps/example/www/index.css *.cjs apps/docs/.next -e2e/**/*.png - packages/tldraw/tldraw.css \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 000000000..2088ec33e --- /dev/null +++ b/.prettierignore @@ -0,0 +1,25 @@ +**/node_modules/* +**/out/* +**/dist/* +**/dist-cjs/* +**/dist-esm/* +**/.next/* +**/api/* +!**/pages/api/* +**/.tsbuild* +**/.next/* +*.mdx +**/_archive/* +apps/docs/api-content.json +apps/docs/content.json +apps/vscode/extension/editor/* +apps/examples/www +content.json +apps/docs/utils/vector-db/index.json +**/gen/**/*.md + +**/.vercel/* +**/.wrangler/* +**/.out/* +**/.temp/* +apps/dotcom/public/**/*.* \ No newline at end of file diff --git a/.prettierrc b/.prettierrc index 0d4b44d10..a808b9c2b 100644 --- a/.prettierrc +++ b/.prettierrc @@ -5,5 +5,5 @@ "printWidth": 100, "tabWidth": 2, "useTabs": true, - "plugins": [] + "plugins": ["prettier-plugin-organize-imports"] } \ No newline at end of file diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index a7e684c38..000000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "recommendations": ["tldraw-org.tldraw-vscode", "biomejs.biome"] -} \ No newline at end of file diff --git a/apps/docs/package.json b/apps/docs/package.json index c37cc4845..93738f48f 100644 --- a/apps/docs/package.json +++ b/apps/docs/package.json @@ -39,7 +39,7 @@ "refresh-embeddings": "yarn run -T tsx --tsconfig ./tsconfig.content.json ./scripts/refresh-embeddings.ts", "refresh-everything": "yarn fetch-api-source && yarn fetch-releases && yarn create-api-markdown && yarn refresh-content && yarn refresh-embeddings && yarn format", "clean": "rm -rf node_modules .yarn", - "format": "biome format --write .", + "format": "yarn run -T prettier --write .", "watch-content": "tsx ./watcher.ts" }, "dependencies": { @@ -67,7 +67,10 @@ "next-themes": "^0.2.1", "octokit": "^3.1.1", "openai": "^4.11.1", + "patch-package": "^8.0.0", + "postinstall-postinstall": "^2.1.0", "prettier": "^3.0.3", + "prettier-plugin-organize-imports": "^3.2.3", "react": "^18.2.0", "react-dom": "^18.2.0", "react-hotkeys-hook": "^4.4.1", diff --git a/apps/docs/scripts/functions/generateSection.ts b/apps/docs/scripts/functions/generateSection.ts index 1b215a1c8..41da72271 100644 --- a/apps/docs/scripts/functions/generateSection.ts +++ b/apps/docs/scripts/functions/generateSection.ts @@ -115,8 +115,8 @@ export function generateSection(section: InputSection, articles: Articles, index section.id === 'getting-started' ? `/${articleId}` : isUncategorized - ? `/${section.id}/${articleId}` - : `/${section.id}/${categoryId}/${articleId}`, + ? `/${section.id}/${articleId}` + : `/${section.id}/${categoryId}/${articleId}`, } if (isExamples) { diff --git a/apps/docs/utils/ContentDatabase.ts b/apps/docs/utils/ContentDatabase.ts index 05430820e..ee3d3dbf8 100644 --- a/apps/docs/utils/ContentDatabase.ts +++ b/apps/docs/utils/ContentDatabase.ts @@ -161,8 +161,8 @@ export class ContentDatabase { sectionId === 'examples' ? this._sidebarExamplesContentLinks : sectionId === 'reference' - ? this._sidebarReferenceContentLinks - : this._sidebarContentLinks + ? this._sidebarReferenceContentLinks + : this._sidebarContentLinks if (cachedLinks && process.env.NODE_ENV !== 'development') { // Use the previously cached sidebar links links = cachedLinks diff --git a/apps/docs/utils/ContentVectorDatabase.ts b/apps/docs/utils/ContentVectorDatabase.ts index f0edfb0fc..1608cc038 100644 --- a/apps/docs/utils/ContentVectorDatabase.ts +++ b/apps/docs/utils/ContentVectorDatabase.ts @@ -217,8 +217,8 @@ export async function getVectorDb( INCLUDE_API_CONTENT && INCLUDE_CONTENT ? await db.all('SELECT * FROM articles') : INCLUDE_API_CONTENT - ? await db.all('SELECT * FROM articles WHERE articles.sectionId = ?', 'reference') - : await db.all('SELECT * FROM articles WHERE articles.sectionId != ?', 'reference') + ? await db.all('SELECT * FROM articles WHERE articles.sectionId = ?', 'reference') + : await db.all('SELECT * FROM articles WHERE articles.sectionId != ?', 'reference') nicelog(`Adding articles to index`) const max = Math.min(articles.length, MAX_ARTICLES) diff --git a/apps/dotcom-worker/src/lib/AlarmScheduler.test.ts b/apps/dotcom-worker/src/lib/AlarmScheduler.test.ts index 545fc19e3..ebed9af4d 100644 --- a/apps/dotcom-worker/src/lib/AlarmScheduler.test.ts +++ b/apps/dotcom-worker/src/lib/AlarmScheduler.test.ts @@ -3,11 +3,9 @@ import { AlarmScheduler } from './AlarmScheduler' jest.useFakeTimers() -function makeMockAlarmScheduler( - alarms: { - [K in Key]: jest.Mock, []> - } -) { +function makeMockAlarmScheduler(alarms: { + [K in Key]: jest.Mock, []> +}) { const data = new Map() let scheduledAlarm: number | null = null diff --git a/apps/dotcom/src/components/BoardHistorySnapshot/BoardHistorySnapshot.tsx b/apps/dotcom/src/components/BoardHistorySnapshot/BoardHistorySnapshot.tsx index c55452fb1..e4f06174f 100644 --- a/apps/dotcom/src/components/BoardHistorySnapshot/BoardHistorySnapshot.tsx +++ b/apps/dotcom/src/components/BoardHistorySnapshot/BoardHistorySnapshot.tsx @@ -38,7 +38,7 @@ export function BoardHistorySnapshot({ ...(token ? { Authorization: 'Bearer ' + token, - } + } : {}), }, body: JSON.stringify({ timestamp }), diff --git a/apps/dotcom/src/components/PeopleMenu/PeopleMenuItem.tsx b/apps/dotcom/src/components/PeopleMenu/PeopleMenuItem.tsx index fc6501d86..ddddd32e4 100644 --- a/apps/dotcom/src/components/PeopleMenu/PeopleMenuItem.tsx +++ b/apps/dotcom/src/components/PeopleMenu/PeopleMenuItem.tsx @@ -50,8 +50,8 @@ export const PeopleMenuItem = track(function PeopleMenuItem({ userId }: { userId theyAreFollowingYou ? msg('people-menu.leading') : youAreFollowingThem - ? msg('people-menu.following') - : msg('people-menu.follow') + ? msg('people-menu.following') + : msg('people-menu.follow') } icon={theyAreFollowingYou ? 'leading' : youAreFollowingThem ? 'following' : 'follow'} onClick={handleFollowClick} diff --git a/apps/dotcom/src/components/ShareMenu.tsx b/apps/dotcom/src/components/ShareMenu.tsx index a9ee02ed4..614ab95ec 100644 --- a/apps/dotcom/src/components/ShareMenu.tsx +++ b/apps/dotcom/src/components/ShareMenu.tsx @@ -188,8 +188,8 @@ export const ShareMenu = React.memo(function ShareMenu() { shareState.state === 'offline' ? 'share-menu.offline-note' : isReadOnlyLink - ? 'share-menu.copy-readonly-link-note' - : 'share-menu.copy-link-note' + ? 'share-menu.copy-readonly-link-note' + : 'share-menu.copy-link-note' )}

diff --git a/apps/dotcom/src/pages/public-snapshot.tsx b/apps/dotcom/src/pages/public-snapshot.tsx index fbab45624..fb07c9738 100644 --- a/apps/dotcom/src/pages/public-snapshot.tsx +++ b/apps/dotcom/src/pages/public-snapshot.tsx @@ -10,7 +10,7 @@ const { loader, useData } = defineLoader(async (args) => { ? ((await result.json()) as { schema: SerializedSchema records: TLRecord[] - }) + }) : null }) diff --git a/apps/dotcom/src/utils/useFileSystem.tsx b/apps/dotcom/src/utils/useFileSystem.tsx index 48b91a923..9639a4552 100644 --- a/apps/dotcom/src/utils/useFileSystem.tsx +++ b/apps/dotcom/src/utils/useFileSystem.tsx @@ -97,7 +97,7 @@ export function useFileSystem({ isMultiplayer }: { isMultiplayer: boolean }): TL const newItem = menuItem(actions[NEW_PROJECT_ACTION]) const group = isMultiplayer ? // open is not currently supported in multiplayer - menuGroup('filesystem', saveItem) + menuGroup('filesystem', saveItem) : menuGroup('filesystem', newItem, openItem, saveItem) fileMenu.children.unshift(group!) diff --git a/apps/examples/src/examples/user-presence/UserPresenceExample.tsx b/apps/examples/src/examples/user-presence/UserPresenceExample.tsx index 6ee7c9718..7bab3e92a 100644 --- a/apps/examples/src/examples/user-presence/UserPresenceExample.tsx +++ b/apps/examples/src/examples/user-presence/UserPresenceExample.tsx @@ -60,11 +60,11 @@ export default function UserPresenceExample() { t < 1 ? '' : t > 2 - ? CURSOR_CHAT_MESSAGE - : CURSOR_CHAT_MESSAGE.slice( + ? CURSOR_CHAT_MESSAGE + : CURSOR_CHAT_MESSAGE.slice( 0, Math.ceil((t - 1) * CURSOR_CHAT_MESSAGE.length) - ) + ) } editor.store.put([ diff --git a/biome.json b/biome.json deleted file mode 100644 index 293ecf333..000000000 --- a/biome.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "$schema": "https://biomejs.dev/schemas/1.5.3/schema.json", - "organizeImports": { - "enabled": true - }, - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true, - "defaultBranch": "main" - }, - "files": { - "ignoreUnknown": true, - "ignore": [ - "dist", - "node_modules", - "**/*.d.ts", - ".next", - ".vercel", - ".vscode", - ".lazy", - ".husky", - "index.json", - "*.api.json", - "api.json", - "**/out/*", - "**/dist/*", - "**/dist-cjs/*", - "**/dist-esm/*", - "**/.next/*", - "**/packages/**/api/*", - "**/.tsbuild*", - "*.mdx", - "**/_archive/*", - "apps/docs/api-content.json", - "apps/docs/content.json", - "apps/vscode/extension/editor/*", - "apps/examples/www", - "content.json", - "apps/docs/utils/vector-db/index.json", - "**/gen/**/*.md", - "**/.vercel/*", - "**/.wrangler/*", - "**/.out/*", - "**/.temp/*", - "apps/dotcom/public/**/*.*" - ] - }, - "formatter": { - "enabled": true, - "formatWithErrors": true, - "indentStyle": "tab", - "indentWidth": 2, - "lineEnding": "lf", - "lineWidth": 100 - }, - "javascript": { - "formatter": { - "semicolons": "asNeeded", - "trailingComma": "es5", - "quoteStyle": "single", - "jsxQuoteStyle": "double", - "quoteProperties": "asNeeded", - "arrowParentheses": "always", - "bracketSameLine": false, - "bracketSpacing": true - } - }, - "json": { - "formatter": { - "lineWidth": 80 - } - }, - "linter": { - "enabled": false - } -} diff --git a/package.json b/package.json index 0dc626c08..2bfd21648 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "build-package": "lazy build-package", "preview-app": "VITE_PREVIEW=1 yarn dev-app", "lint": "lazy lint", - "format": "biome format --write .", + "format": "prettier --write --cache \"**/*.{ts,tsx,js,jsx,json}\"", "typecheck": "yarn refresh-assets && tsx scripts/typecheck.ts", "check-scripts": "tsx scripts/check-scripts.ts", "api-check": "lazy api-check", @@ -65,11 +65,10 @@ "packageManager": "yarn@4.0.2", "lint-staged": { "*.{js,jsx,ts,tsx,json}": [ - "biome format --write --no-errors-on-unmatched" + "prettier --write --cache" ] }, "devDependencies": { - "@biomejs/biome": "1.5.3", "@microsoft/api-extractor": "^7.35.4", "@next/eslint-plugin-next": "^13.3.0", "@swc/core": "^1.3.55", @@ -96,14 +95,13 @@ "json5": "^2.2.3", "lazyrepo": "0.0.0-alpha.27", "lint-staged": ">=10", + "prettier": "^3.0.3", + "prettier-plugin-organize-imports": "^3.2.3", "rimraf": "^4.4.0", "tsx": "^4.0.0", "typescript": "^5.2.2", "vercel": "^28.16.15" }, - "devDependenciesComments": { - "@biomejs/biome": "biome recommends pinning the particular version, see https://github.com/marketplace/actions/setup-biome" - }, "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", diff --git a/packages/assets/imports.js b/packages/assets/imports.js index ef673c563..f295efd85 100644 --- a/packages/assets/imports.js +++ b/packages/assets/imports.js @@ -5,6 +5,23 @@ /// import { formatAssetUrl } from './utils.js' +import embedIconsCodepen from './embed-icons/codepen.png' +import embedIconsCodesandbox from './embed-icons/codesandbox.png' +import embedIconsExcalidraw from './embed-icons/excalidraw.png' +import embedIconsFelt from './embed-icons/felt.png' +import embedIconsFigma from './embed-icons/figma.png' +import embedIconsGithubGist from './embed-icons/github_gist.png' +import embedIconsGoogleCalendar from './embed-icons/google_calendar.png' +import embedIconsGoogleMaps from './embed-icons/google_maps.png' +import embedIconsGoogleSlides from './embed-icons/google_slides.png' +import embedIconsObservable from './embed-icons/observable.png' +import embedIconsReplit from './embed-icons/replit.png' +import embedIconsScratch from './embed-icons/scratch.png' +import embedIconsSpotify from './embed-icons/spotify.png' +import embedIconsTldraw from './embed-icons/tldraw.png' +import embedIconsValTown from './embed-icons/val_town.png' +import embedIconsVimeo from './embed-icons/vimeo.png' +import embedIconsYoutube from './embed-icons/youtube.png' import fontsMonospace from './fonts/IBMPlexMono-Medium.woff2' import fontsSansSerif from './fonts/IBMPlexSans-Medium.woff2' import fontsSerif from './fonts/IBMPlexSerif-Medium.woff2' @@ -209,23 +226,6 @@ import translationsUk from './translations/uk.json' import translationsVi from './translations/vi.json' import translationsZhCn from './translations/zh-cn.json' import translationsZhTw from './translations/zh-tw.json' -import embedIconsCodepen from './embed-icons/codepen.png' -import embedIconsCodesandbox from './embed-icons/codesandbox.png' -import embedIconsExcalidraw from './embed-icons/excalidraw.png' -import embedIconsFelt from './embed-icons/felt.png' -import embedIconsFigma from './embed-icons/figma.png' -import embedIconsGithubGist from './embed-icons/github_gist.png' -import embedIconsGoogleCalendar from './embed-icons/google_calendar.png' -import embedIconsGoogleMaps from './embed-icons/google_maps.png' -import embedIconsGoogleSlides from './embed-icons/google_slides.png' -import embedIconsObservable from './embed-icons/observable.png' -import embedIconsReplit from './embed-icons/replit.png' -import embedIconsScratch from './embed-icons/scratch.png' -import embedIconsSpotify from './embed-icons/spotify.png' -import embedIconsTldraw from './embed-icons/tldraw.png' -import embedIconsValTown from './embed-icons/val_town.png' -import embedIconsVimeo from './embed-icons/vimeo.png' -import embedIconsYoutube from './embed-icons/youtube.png' /** * @param {AssetUrlOptions} [opts] diff --git a/packages/assets/imports.vite.js b/packages/assets/imports.vite.js index 4cbc50d00..478dee9cc 100644 --- a/packages/assets/imports.vite.js +++ b/packages/assets/imports.vite.js @@ -5,6 +5,23 @@ /// import { formatAssetUrl } from './utils.js' +import embedIconsCodepen from './embed-icons/codepen.png?url' +import embedIconsCodesandbox from './embed-icons/codesandbox.png?url' +import embedIconsExcalidraw from './embed-icons/excalidraw.png?url' +import embedIconsFelt from './embed-icons/felt.png?url' +import embedIconsFigma from './embed-icons/figma.png?url' +import embedIconsGithubGist from './embed-icons/github_gist.png?url' +import embedIconsGoogleCalendar from './embed-icons/google_calendar.png?url' +import embedIconsGoogleMaps from './embed-icons/google_maps.png?url' +import embedIconsGoogleSlides from './embed-icons/google_slides.png?url' +import embedIconsObservable from './embed-icons/observable.png?url' +import embedIconsReplit from './embed-icons/replit.png?url' +import embedIconsScratch from './embed-icons/scratch.png?url' +import embedIconsSpotify from './embed-icons/spotify.png?url' +import embedIconsTldraw from './embed-icons/tldraw.png?url' +import embedIconsValTown from './embed-icons/val_town.png?url' +import embedIconsVimeo from './embed-icons/vimeo.png?url' +import embedIconsYoutube from './embed-icons/youtube.png?url' import fontsMonospace from './fonts/IBMPlexMono-Medium.woff2?url' import fontsSansSerif from './fonts/IBMPlexSans-Medium.woff2?url' import fontsSerif from './fonts/IBMPlexSerif-Medium.woff2?url' @@ -209,23 +226,6 @@ import translationsUk from './translations/uk.json?url' import translationsVi from './translations/vi.json?url' import translationsZhCn from './translations/zh-cn.json?url' import translationsZhTw from './translations/zh-tw.json?url' -import embedIconsCodepen from './embed-icons/codepen.png?url' -import embedIconsCodesandbox from './embed-icons/codesandbox.png?url' -import embedIconsExcalidraw from './embed-icons/excalidraw.png?url' -import embedIconsFelt from './embed-icons/felt.png?url' -import embedIconsFigma from './embed-icons/figma.png?url' -import embedIconsGithubGist from './embed-icons/github_gist.png?url' -import embedIconsGoogleCalendar from './embed-icons/google_calendar.png?url' -import embedIconsGoogleMaps from './embed-icons/google_maps.png?url' -import embedIconsGoogleSlides from './embed-icons/google_slides.png?url' -import embedIconsObservable from './embed-icons/observable.png?url' -import embedIconsReplit from './embed-icons/replit.png?url' -import embedIconsScratch from './embed-icons/scratch.png?url' -import embedIconsSpotify from './embed-icons/spotify.png?url' -import embedIconsTldraw from './embed-icons/tldraw.png?url' -import embedIconsValTown from './embed-icons/val_town.png?url' -import embedIconsVimeo from './embed-icons/vimeo.png?url' -import embedIconsYoutube from './embed-icons/youtube.png?url' /** * @param {AssetUrlOptions} [opts] diff --git a/packages/editor/src/lib/components/LiveCollaborators.tsx b/packages/editor/src/lib/components/LiveCollaborators.tsx index 75b8e9418..58ce4bf0b 100644 --- a/packages/editor/src/lib/components/LiveCollaborators.tsx +++ b/packages/editor/src/lib/components/LiveCollaborators.tsx @@ -157,8 +157,8 @@ function getStateFromElapsedTime(elapsed: number) { return elapsed > COLLABORATOR_INACTIVE_TIMEOUT ? 'inactive' : elapsed > COLLABORATOR_IDLE_TIMEOUT - ? 'idle' - : 'active' + ? 'idle' + : 'active' } function useCollaboratorState(latestPresence: TLInstancePresence | null) { diff --git a/packages/editor/src/lib/config/createTLStore.ts b/packages/editor/src/lib/config/createTLStore.ts index 7d04b5d8b..a46923eec 100644 --- a/packages/editor/src/lib/config/createTLStore.ts +++ b/packages/editor/src/lib/config/createTLStore.ts @@ -32,13 +32,13 @@ export function createTLStore({ initialData, defaultName = '', ...rest }: TLStor const schema = 'schema' in rest && rest.schema ? // we have a schema - rest.schema + rest.schema : // we need a schema - createTLSchema({ + createTLSchema({ shapes: currentPageShapesToShapeMap( checkShapesAndAddCore('shapeUtils' in rest && rest.shapeUtils ? rest.shapeUtils : []) ), - }) + }) return new Store({ schema, diff --git a/packages/editor/src/lib/editor/Editor.ts b/packages/editor/src/lib/editor/Editor.ts index ab9239457..2c7f9dc9c 100644 --- a/packages/editor/src/lib/editor/Editor.ts +++ b/packages/editor/src/lib/editor/Editor.ts @@ -5759,12 +5759,12 @@ export class Editor extends EventEmitter { ? { ...translateStartChanges, [val]: shape[val] + localDelta[val], - } + } : { id: shape.id as any, type: shape.type, [val]: shape[val] + localDelta[val], - } + } ) v += pageBounds[shape.id][dim] + shapeGap @@ -7850,16 +7850,16 @@ export class Editor extends EventEmitter { newShape.props.start = mappedId ? { ...newShape.props.start, boundShapeId: mappedId } : // this shouldn't happen, if you copy an arrow but not it's bound shape it should - // convert the binding to a point at the time of copying - { type: 'point', x: 0, y: 0 } + // convert the binding to a point at the time of copying + { type: 'point', x: 0, y: 0 } } if (newShape.props.end.type === 'binding') { const mappedId = idMap.get(newShape.props.end.boundShapeId) newShape.props.end = mappedId ? { ...newShape.props.end, boundShapeId: mappedId } : // this shouldn't happen, if you copy an arrow but not it's bound shape it should - // convert the binding to a point at the time of copying - { type: 'point', x: 0, y: 0 } + // convert the binding to a point at the time of copying + { type: 'point', x: 0, y: 0 } } } diff --git a/packages/editor/src/lib/editor/managers/SnapManager/BoundsSnaps.ts b/packages/editor/src/lib/editor/managers/SnapManager/BoundsSnaps.ts index 8c6b25ee9..bff283b83 100644 --- a/packages/editor/src/lib/editor/managers/SnapManager/BoundsSnaps.ts +++ b/packages/editor/src/lib/editor/managers/SnapManager/BoundsSnaps.ts @@ -499,8 +499,8 @@ export class BoundsSnaps { ? 'x' : 'y' : nearestSnapsX.length - ? 'x' - : 'y' + ? 'x' + : 'y' const ratio = initialSelectionPageBounds.aspectRatio @@ -1049,7 +1049,7 @@ export class BoundsSnaps { 'forward', gapBreadthIntersection ), - ] + ] : [ ...findAdjacentGaps( horizontal, @@ -1065,7 +1065,7 @@ export class BoundsSnaps { ) as [Vec, Vec], endEdge: selectionSides.left, }, - ], + ], }) break @@ -1153,7 +1153,7 @@ export class BoundsSnaps { 'forward', gapBreadthIntersection ), - ] + ] : [ ...findAdjacentGaps( vertical, @@ -1169,7 +1169,7 @@ export class BoundsSnaps { ) as [Vec, Vec], endEdge: selectionSides.top, }, - ], + ], }) } break diff --git a/packages/editor/src/lib/primitives/easings.ts b/packages/editor/src/lib/primitives/easings.ts index a8a56c674..21a8d079a 100644 --- a/packages/editor/src/lib/primitives/easings.ts +++ b/packages/editor/src/lib/primitives/easings.ts @@ -23,10 +23,10 @@ export const EASINGS = { t <= 0 ? 0 : t >= 1 - ? 1 - : t < 0.5 - ? Math.pow(2, 20 * t - 10) / 2 - : (2 - Math.pow(2, -20 * t + 10)) / 2, + ? 1 + : t < 0.5 + ? Math.pow(2, 20 * t - 10) / 2 + : (2 - Math.pow(2, -20 * t + 10)) / 2, } as const /** @public */ diff --git a/packages/editor/src/lib/utils/getIncrementedName.ts b/packages/editor/src/lib/utils/getIncrementedName.ts index d2a0a3787..56735bc69 100644 --- a/packages/editor/src/lib/utils/getIncrementedName.ts +++ b/packages/editor/src/lib/utils/getIncrementedName.ts @@ -14,7 +14,7 @@ export function getIncrementedName(name: string, others: string[]) { result = /^.*(\d+)$/.exec(result)?.[1] ? result.replace(/(\d+)(?=\D?)$/, (m) => { return (+m + 1).toString() - }) + }) : `${result} 1` } diff --git a/packages/state/docs-ordering.json b/packages/state/docs-ordering.json index c58271af8..1355f2b66 100644 --- a/packages/state/docs-ordering.json +++ b/packages/state/docs-ordering.json @@ -1,8 +1,5 @@ [ - [ - "functions", - ["atom-1", "computed-1", "react", "reactor-1", "transact", "transaction"] - ], + ["functions", ["atom-1", "computed-1", "react", "reactor-1", "transact", "transaction"]], ["classes"], ["interfaces", ["Signal"]] ] diff --git a/packages/store/src/lib/StoreSchema.ts b/packages/store/src/lib/StoreSchema.ts index b5bc60fc8..60151f800 100644 --- a/packages/store/src/lib/StoreSchema.ts +++ b/packages/store/src/lib/StoreSchema.ts @@ -121,13 +121,13 @@ export class StoreSchema { migrations: ourType.migrations, fromVersion: persistedVersion, toVersion: ourVersion, - }) + }) : migrateRecord({ record, migrations: ourType.migrations, fromVersion: ourVersion, toVersion: persistedVersion, - }) + }) if (result.type === 'error') { return result } @@ -174,13 +174,13 @@ export class StoreSchema { migrations: ourSubTypeMigrations, fromVersion: persistedSubTypeVersion, toVersion: ourSubTypeMigrations.currentVersion, - }) + }) : migrateRecord({ record, migrations: ourSubTypeMigrations, fromVersion: ourSubTypeMigrations.currentVersion, toVersion: persistedSubTypeVersion, - }) + }) if (result.type === 'error') { return result @@ -258,12 +258,12 @@ export class StoreSchema { k, v.currentVersion, ]) - ) + ) : undefined, - } + } : { version: type.migrations.currentVersion, - }, + }, ]) ), } @@ -286,12 +286,12 @@ export class StoreSchema { k, v.firstVersion, ]) - ) + ) : undefined, - } + } : { version: type.migrations.firstVersion, - }, + }, ]) ), } diff --git a/packages/store/src/lib/migrate.ts b/packages/store/src/lib/migrate.ts index 309c745da..ba1c7ff83 100644 --- a/packages/store/src/lib/migrate.ts +++ b/packages/store/src/lib/migrate.ts @@ -213,105 +213,105 @@ type Range = To extends From type Decrement = n extends 0 ? never : n extends 1 - ? 0 - : n extends 2 - ? 1 - : n extends 3 - ? 2 - : n extends 4 - ? 3 - : n extends 5 - ? 4 - : n extends 6 - ? 5 - : n extends 7 - ? 6 - : n extends 8 - ? 7 - : n extends 9 - ? 8 - : n extends 10 - ? 9 - : n extends 11 - ? 10 - : n extends 12 - ? 11 - : n extends 13 - ? 12 - : n extends 14 - ? 13 - : n extends 15 - ? 14 - : n extends 16 - ? 15 - : n extends 17 - ? 16 - : n extends 18 - ? 17 - : n extends 19 - ? 18 - : n extends 20 - ? 19 - : n extends 21 - ? 20 - : n extends 22 - ? 21 - : n extends 23 - ? 22 - : n extends 24 - ? 23 - : n extends 25 - ? 24 - : n extends 26 - ? 25 - : n extends 27 - ? 26 - : n extends 28 - ? 27 - : n extends 29 - ? 28 - : n extends 30 - ? 29 - : n extends 31 - ? 30 - : n extends 32 - ? 31 - : n extends 33 - ? 32 - : n extends 34 - ? 33 - : n extends 35 - ? 34 - : n extends 36 - ? 35 - : n extends 37 - ? 36 - : n extends 38 - ? 37 - : n extends 39 - ? 38 - : n extends 40 - ? 39 - : n extends 41 - ? 40 - : n extends 42 - ? 41 - : n extends 43 - ? 42 - : n extends 44 - ? 43 - : n extends 45 - ? 44 - : n extends 46 - ? 45 - : n extends 47 - ? 46 - : n extends 48 - ? 47 - : n extends 49 - ? 48 - : n extends 50 - ? 49 - : n extends 51 - ? 50 - : never + ? 0 + : n extends 2 + ? 1 + : n extends 3 + ? 2 + : n extends 4 + ? 3 + : n extends 5 + ? 4 + : n extends 6 + ? 5 + : n extends 7 + ? 6 + : n extends 8 + ? 7 + : n extends 9 + ? 8 + : n extends 10 + ? 9 + : n extends 11 + ? 10 + : n extends 12 + ? 11 + : n extends 13 + ? 12 + : n extends 14 + ? 13 + : n extends 15 + ? 14 + : n extends 16 + ? 15 + : n extends 17 + ? 16 + : n extends 18 + ? 17 + : n extends 19 + ? 18 + : n extends 20 + ? 19 + : n extends 21 + ? 20 + : n extends 22 + ? 21 + : n extends 23 + ? 22 + : n extends 24 + ? 23 + : n extends 25 + ? 24 + : n extends 26 + ? 25 + : n extends 27 + ? 26 + : n extends 28 + ? 27 + : n extends 29 + ? 28 + : n extends 30 + ? 29 + : n extends 31 + ? 30 + : n extends 32 + ? 31 + : n extends 33 + ? 32 + : n extends 34 + ? 33 + : n extends 35 + ? 34 + : n extends 36 + ? 35 + : n extends 37 + ? 36 + : n extends 38 + ? 37 + : n extends 39 + ? 38 + : n extends 40 + ? 39 + : n extends 41 + ? 40 + : n extends 42 + ? 41 + : n extends 43 + ? 42 + : n extends 44 + ? 43 + : n extends 45 + ? 44 + : n extends 46 + ? 45 + : n extends 47 + ? 46 + : n extends 48 + ? 47 + : n extends 49 + ? 48 + : n extends 50 + ? 49 + : n extends 51 + ? 50 + : never diff --git a/packages/tldraw/src/lib/canvas/TldrawSelectionForeground.tsx b/packages/tldraw/src/lib/canvas/TldrawSelectionForeground.tsx index c42e91310..50285399d 100644 --- a/packages/tldraw/src/lib/canvas/TldrawSelectionForeground.tsx +++ b/packages/tldraw/src/lib/canvas/TldrawSelectionForeground.tsx @@ -140,7 +140,7 @@ export const TldrawSelectionForeground: TLSelectionForegroundComponent = track( shouldDisplayControls && (onlyShape ? editor.getShapeUtil(onlyShape).canResize(onlyShape) && - !editor.getShapeUtil(onlyShape).hideResizeHandles(onlyShape) + !editor.getShapeUtil(onlyShape).hideResizeHandles(onlyShape) : true) && !showCropHandles && !isLockedShape diff --git a/packages/tldraw/src/lib/shapes/arrow/ArrowShapeUtil.tsx b/packages/tldraw/src/lib/shapes/arrow/ArrowShapeUtil.tsx index ac125e04c..fc7d7013d 100644 --- a/packages/tldraw/src/lib/shapes/arrow/ArrowShapeUtil.tsx +++ b/packages/tldraw/src/lib/shapes/arrow/ArrowShapeUtil.tsx @@ -104,7 +104,7 @@ export class ArrowShapeUtil extends ShapeUtil { ? new Edge2d({ start: Vec.From(info.start.point), end: Vec.From(info.end.point), - }) + }) : new Arc2d({ center: Vec.Cast(info.handleArc.center), radius: info.handleArc.radius, @@ -112,7 +112,7 @@ export class ArrowShapeUtil extends ShapeUtil { end: Vec.Cast(info.end.point), sweepFlag: info.bodyArc.sweepFlag, largeArcFlag: info.bodyArc.largeArcFlag, - }) + }) let labelGeom if (shape.props.text.trim()) { @@ -583,8 +583,8 @@ export class ArrowShapeUtil extends ShapeUtil { ? shape.props.start.isExact ? '' : shape.props.start.isPrecise - ? 'url(#arrowhead-cross)' - : 'url(#arrowhead-dot)' + ? 'url(#arrowhead-cross)' + : 'url(#arrowhead-dot)' : '' } markerEnd={ @@ -592,8 +592,8 @@ export class ArrowShapeUtil extends ShapeUtil { ? shape.props.end.isExact ? '' : shape.props.end.isPrecise - ? 'url(#arrowhead-cross)' - : 'url(#arrowhead-dot)' + ? 'url(#arrowhead-cross)' + : 'url(#arrowhead-dot)' : '' } opacity={0.16} diff --git a/packages/tldraw/src/lib/shapes/arrow/arrowLabel.ts b/packages/tldraw/src/lib/shapes/arrow/arrowLabel.ts index d6482362d..bd496a1d9 100644 --- a/packages/tldraw/src/lib/shapes/arrow/arrowLabel.ts +++ b/packages/tldraw/src/lib/shapes/arrow/arrowLabel.ts @@ -39,7 +39,7 @@ export function getArrowLabelSize(editor: Editor, shape: TLArrowShape) { ? new Edge2d({ start: Vec.From(info.start.point), end: Vec.From(info.end.point), - }) + }) : new Arc2d({ center: Vec.Cast(info.handleArc.center), radius: info.handleArc.radius, @@ -47,7 +47,7 @@ export function getArrowLabelSize(editor: Editor, shape: TLArrowShape) { end: Vec.Cast(info.end.point), sweepFlag: info.bodyArc.sweepFlag, largeArcFlag: info.bodyArc.largeArcFlag, - }) + }) if (shape.props.text.trim()) { const bodyBounds = bodyGeom.bounds diff --git a/packages/tldraw/src/lib/shapes/arrow/arrowheads.ts b/packages/tldraw/src/lib/shapes/arrow/arrowheads.ts index 2d8eeb947..4b1b5de59 100644 --- a/packages/tldraw/src/lib/shapes/arrow/arrowheads.ts +++ b/packages/tldraw/src/lib/shapes/arrow/arrowheads.ts @@ -29,8 +29,8 @@ function getArrowPoints( ? ints[0] : ints[1] : info.handleArc.sweepFlag - ? ints[1] - : ints[0] + ? ints[1] + : ints[0] } if (Vec.IsNaN(P0)) { diff --git a/packages/tldraw/src/lib/shapes/draw/getPath.ts b/packages/tldraw/src/lib/shapes/draw/getPath.ts index f5af4d947..71122ce5b 100644 --- a/packages/tldraw/src/lib/shapes/draw/getPath.ts +++ b/packages/tldraw/src/lib/shapes/draw/getPath.ts @@ -72,10 +72,10 @@ export function getFreehandOptions( ...(forceSolid ? solidSettings(strokeWidth) : shapeProps.dash === 'draw' - ? shapeProps.isPen + ? shapeProps.isPen ? realPressureSettings(strokeWidth) : simulatePressureSettings(strokeWidth) - : solidSettings(strokeWidth)), + : solidSettings(strokeWidth)), last: shapeProps.isComplete || forceComplete, } } diff --git a/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx b/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx index 5633bc53f..9025005dc 100644 --- a/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx +++ b/packages/tldraw/src/lib/shapes/geo/GeoShapeUtil.tsx @@ -322,14 +322,14 @@ export class GeoShapeUtil extends BaseBoxShapeUtil { shape.props.align === 'start' ? 0 : shape.props.align === 'end' - ? w - labelWidth - : (w - labelWidth) / 2, + ? w - labelWidth + : (w - labelWidth) / 2, y: shape.props.verticalAlign === 'start' ? 0 : shape.props.verticalAlign === 'end' - ? h - labelHeight - : (h - labelHeight) / 2, + ? h - labelHeight + : (h - labelHeight) / 2, width: labelWidth, height: labelHeight, isFilled: true, diff --git a/packages/tldraw/src/lib/shapes/geo/cloudOutline.ts b/packages/tldraw/src/lib/shapes/geo/cloudOutline.ts index edb8bcb7a..0a98f6492 100644 --- a/packages/tldraw/src/lib/shapes/geo/cloudOutline.ts +++ b/packages/tldraw/src/lib/shapes/geo/cloudOutline.ts @@ -59,7 +59,7 @@ export function getPillPoints(width: number, height: number, numPoints: number) center: new Vec(radius, radius), startAngle: PI / 2, }, - ] + ] : [ { type: 'straight', @@ -81,7 +81,7 @@ export function getPillPoints(width: number, height: number, numPoints: number) center: new Vec(radius, radius), startAngle: PI, }, - ] + ] let sectionOffset = 0 diff --git a/packages/tldraw/src/lib/shapes/geo/components/DashStyleCloud.tsx b/packages/tldraw/src/lib/shapes/geo/components/DashStyleCloud.tsx index 6356a6ac2..eed300830 100644 --- a/packages/tldraw/src/lib/shapes/geo/components/DashStyleCloud.tsx +++ b/packages/tldraw/src/lib/shapes/geo/components/DashStyleCloud.tsx @@ -39,10 +39,10 @@ export const DashStyleCloud = React.memo(function DashStylePolygon({ {arcs.map(({ leftPoint, rightPoint, center, radius }, i) => { const arcLength = center ? radius * - canonicalizeRotation( + canonicalizeRotation( canonicalizeRotation(Vec.Angle(center, rightPoint)) - canonicalizeRotation(Vec.Angle(center, leftPoint)) - ) + ) : Vec.Dist(leftPoint, rightPoint) const { strokeDasharray, strokeDashoffset } = getPerfectDashProps( @@ -99,10 +99,10 @@ export function DashStyleCloudSvg({ for (const { leftPoint, rightPoint, center, radius } of arcs) { const arcLength = center ? radius * - canonicalizeRotation( + canonicalizeRotation( canonicalizeRotation(Vec.Angle(center, rightPoint)) - canonicalizeRotation(Vec.Angle(center, leftPoint)) - ) + ) : Vec.Dist(leftPoint, rightPoint) const { strokeDasharray, strokeDashoffset } = getPerfectDashProps(arcLength, strokeWidth, { diff --git a/packages/tldraw/src/lib/shapes/geo/toolStates/Pointing.ts b/packages/tldraw/src/lib/shapes/geo/toolStates/Pointing.ts index f4bd37414..3445efd16 100644 --- a/packages/tldraw/src/lib/shapes/geo/toolStates/Pointing.ts +++ b/packages/tldraw/src/lib/shapes/geo/toolStates/Pointing.ts @@ -94,8 +94,8 @@ export class Pointing extends StateNode { shape.props.geo === 'star' ? new Box(0, 0, 200, 190) : shape.props.geo === 'cloud' - ? new Box(0, 0, 300, 180) - : new Box(0, 0, 200, 200) + ? new Box(0, 0, 300, 180) + : new Box(0, 0, 200, 200) const delta = bounds.center const parentTransform = this.editor.getShapeParentTransform(shape) diff --git a/packages/tldraw/src/lib/shapes/shared/TextLabel.tsx b/packages/tldraw/src/lib/shapes/shared/TextLabel.tsx index c9824c294..6eed41a09 100644 --- a/packages/tldraw/src/lib/shapes/shared/TextLabel.tsx +++ b/packages/tldraw/src/lib/shapes/shared/TextLabel.tsx @@ -82,7 +82,7 @@ export const TextLabel = React.memo(function TextLabel< width: bounds.width, height: bounds.height, position: 'absolute', - } + } : {}), }} > diff --git a/packages/tldraw/src/lib/shapes/shared/createTextSvgElementFromSpans.ts b/packages/tldraw/src/lib/shapes/shared/createTextSvgElementFromSpans.ts index f34fe939e..2c85dcc0b 100644 --- a/packages/tldraw/src/lib/shapes/shared/createTextSvgElementFromSpans.ts +++ b/packages/tldraw/src/lib/shapes/shared/createTextSvgElementFromSpans.ts @@ -59,8 +59,8 @@ export function createTextSvgElementFromSpans( (opts.verticalTextAlign === 'start' ? padding : opts.verticalTextAlign === 'end' - ? opts.height - padding - bounds.height - : (Math.ceil(opts.height) - bounds.height) / 2) + ? opts.height - padding - bounds.height + : (Math.ceil(opts.height) - bounds.height) / 2) // Create text span elements for each word let currentLineTop = null diff --git a/packages/tldraw/src/lib/shapes/shared/freehand/getStrokeOutlinePoints.ts b/packages/tldraw/src/lib/shapes/shared/freehand/getStrokeOutlinePoints.ts index 2711d382e..e8033bb90 100644 --- a/packages/tldraw/src/lib/shapes/shared/freehand/getStrokeOutlinePoints.ts +++ b/packages/tldraw/src/lib/shapes/shared/freehand/getStrokeOutlinePoints.ts @@ -207,15 +207,15 @@ export function getStrokeOutlinePoints( start.taper === false ? 0 : start.taper === true - ? Math.max(size, totalLength) - : (start.taper as number) + ? Math.max(size, totalLength) + : (start.taper as number) const taperEnd = end.taper === false ? 0 : end.taper === true - ? Math.max(size, totalLength) - : (end.taper as number) + ? Math.max(size, totalLength) + : (end.taper as number) // The minimum allowed distance between points (squared) // Our collected left and right points diff --git a/packages/tldraw/src/lib/shapes/shared/freehand/setStrokePointRadii.ts b/packages/tldraw/src/lib/shapes/shared/freehand/setStrokePointRadii.ts index a2cb4d1d5..cd957bd81 100644 --- a/packages/tldraw/src/lib/shapes/shared/freehand/setStrokePointRadii.ts +++ b/packages/tldraw/src/lib/shapes/shared/freehand/setStrokePointRadii.ts @@ -89,15 +89,15 @@ export function setStrokePointRadii(strokePoints: StrokePoint[], options: Stroke start.taper === false ? 0 : start.taper === true - ? Math.max(size, totalLength) - : (start.taper as number) + ? Math.max(size, totalLength) + : (start.taper as number) const taperEnd = end.taper === false ? 0 : end.taper === true - ? Math.max(size, totalLength) - : (end.taper as number) + ? Math.max(size, totalLength) + : (end.taper as number) if (taperStart || taperEnd) { for (let i = 0; i < strokePoints.length; i++) { diff --git a/packages/tldraw/src/lib/shapes/text/TextShapeUtil.tsx b/packages/tldraw/src/lib/shapes/text/TextShapeUtil.tsx index a544dcacb..05a4a5752 100644 --- a/packages/tldraw/src/lib/shapes/text/TextShapeUtil.tsx +++ b/packages/tldraw/src/lib/shapes/text/TextShapeUtil.tsx @@ -378,7 +378,7 @@ function getTextSize(editor: Editor, props: TLTextShape['props']) { const cw = autoSize ? null : // `measureText` floors the number so we need to do the same here to avoid issues. - Math.floor(Math.max(minWidth, w)) + Math.floor(Math.max(minWidth, w)) const result = editor.textMeasure.measureText(text, { ...TEXT_PROPS, diff --git a/packages/tldraw/src/lib/tools/SelectTool/childStates/Idle.ts b/packages/tldraw/src/lib/tools/SelectTool/childStates/Idle.ts index 1c03059ae..a30881d32 100644 --- a/packages/tldraw/src/lib/tools/SelectTool/childStates/Idle.ts +++ b/packages/tldraw/src/lib/tools/SelectTool/childStates/Idle.ts @@ -195,10 +195,10 @@ export class Idle extends StateNode { hoveredShape && !this.editor.isShapeOfType(hoveredShape, 'group') ? hoveredShape : this.editor.getSelectedShapeAtPoint(this.editor.inputs.currentPagePoint) ?? - this.editor.getShapeAtPoint(this.editor.inputs.currentPagePoint, { + this.editor.getShapeAtPoint(this.editor.inputs.currentPagePoint, { margin: HIT_TEST_MARGIN / this.editor.getZoomLevel(), hitInside: false, - }) + }) const focusedGroupId = this.editor.getFocusedGroupId() @@ -354,7 +354,7 @@ export class Idle extends StateNode { hitLabels: true, hitFrameInside: false, renderingOnly: true, - }) + }) if (hitShape) { this.onRightClick({ @@ -585,8 +585,8 @@ export class Idle extends StateNode { ? gridSize * GRID_INCREMENT : gridSize : shiftKey - ? MAJOR_NUDGE_FACTOR - : MINOR_NUDGE_FACTOR + ? MAJOR_NUDGE_FACTOR + : MINOR_NUDGE_FACTOR this.editor.nudgeShapes(this.editor.getSelectedShapeIds(), delta.mul(step)) } diff --git a/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingSelection.ts b/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingSelection.ts index 82ece476f..14ce18f57 100644 --- a/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingSelection.ts +++ b/packages/tldraw/src/lib/tools/SelectTool/childStates/PointingSelection.ts @@ -39,7 +39,7 @@ export class PointingSelection extends StateNode { hitInside: true, margin: 0, renderingOnly: true, - }) + }) if (hitShape) { // todo: extract the double click shape logic from idle so that we can share it here diff --git a/packages/tldraw/src/lib/ui/components/ActionsMenu.tsx b/packages/tldraw/src/lib/ui/components/ActionsMenu.tsx index 0f8c53d6f..c305e003b 100644 --- a/packages/tldraw/src/lib/ui/components/ActionsMenu.tsx +++ b/packages/tldraw/src/lib/ui/components/ActionsMenu.tsx @@ -35,8 +35,8 @@ export const ActionsMenu = memo(function ActionsMenu() { ? `${msg(label)} ${kbdStr(kbd)}` : `${msg(label)}` : kbd - ? `${kbdStr(kbd)}` - : '' + ? `${kbdStr(kbd)}` + : '' } onClick={() => onSelect('actions-menu')} disabled={item.disabled} diff --git a/packages/tldraw/src/lib/ui/components/DebugPanel.tsx b/packages/tldraw/src/lib/ui/components/DebugPanel.tsx index 8cfb23f66..a3a841be7 100644 --- a/packages/tldraw/src/lib/ui/components/DebugPanel.tsx +++ b/packages/tldraw/src/lib/ui/components/DebugPanel.tsx @@ -93,14 +93,14 @@ const CurrentState = track(function CurrentState() { shape && path.includes('select.') ? ` / ${shape.type || ''}${ 'geo' in shape.props ? ' / ' + shape.props.geo : '' - } / [${Vec.ToFixed(editor.getPointInShapeSpace(shape, editor.inputs.currentPagePoint), 0)}]` + } / [${Vec.ToFixed(editor.getPointInShapeSpace(shape, editor.inputs.currentPagePoint), 0)}]` : '' const ruler = path.startsWith('select.') && !path.includes('.idle') ? ` / [${Vec.ToFixed(editor.inputs.originPagePoint, 0)}] → [${Vec.ToFixed( editor.inputs.currentPagePoint, 0 - )}] = ${Vec.Dist(editor.inputs.originPagePoint, editor.inputs.currentPagePoint).toFixed(0)}` + )}] = ${Vec.Dist(editor.inputs.originPagePoint, editor.inputs.currentPagePoint).toFixed(0)}` : '' return
{`${path}${shapeInfo}${ruler}`}
diff --git a/packages/tldraw/src/lib/ui/components/Menu.tsx b/packages/tldraw/src/lib/ui/components/Menu.tsx index 27894d8e3..119a535d7 100644 --- a/packages/tldraw/src/lib/ui/components/Menu.tsx +++ b/packages/tldraw/src/lib/ui/components/Menu.tsx @@ -65,8 +65,8 @@ function MenuContent() { depth <= 1 ? 'medium' : breakpoint < 3 || (parent?.type === 'submenu' && depth > 2) - ? 'tiny' - : 'medium' + ? 'tiny' + : 'medium' } key={item.id} > diff --git a/packages/tldraw/src/lib/ui/components/StylePanel/StylePanel.tsx b/packages/tldraw/src/lib/ui/components/StylePanel/StylePanel.tsx index abe552369..ecf2689bf 100644 --- a/packages/tldraw/src/lib/ui/components/StylePanel/StylePanel.tsx +++ b/packages/tldraw/src/lib/ui/components/StylePanel/StylePanel.tsx @@ -129,7 +129,7 @@ function CommonStylePickerSet({ minBy(tldrawSupportedOpacities, (supportedOpacity) => Math.abs(supportedOpacity - opacity.value) )! - ) + ) return ( <> diff --git a/packages/tldraw/src/lib/ui/hooks/clipboard/pasteExcalidrawContent.ts b/packages/tldraw/src/lib/ui/hooks/clipboard/pasteExcalidrawContent.ts index 7c7c3a59c..aee071666 100644 --- a/packages/tldraw/src/lib/ui/hooks/clipboard/pasteExcalidrawContent.ts +++ b/packages/tldraw/src/lib/ui/hooks/clipboard/pasteExcalidrawContent.ts @@ -244,12 +244,12 @@ export async function pasteExcalidrawContent(editor: Editor, clipboard: any, poi normalizedAnchor: { x: 0.5, y: 0.5 }, isPrecise: false, isExact: false, - } + } : { type: 'point', x: start[0], y: start[1], - }, + }, end: endTargetId ? { type: 'binding', @@ -257,12 +257,12 @@ export async function pasteExcalidrawContent(editor: Editor, clipboard: any, poi normalizedAnchor: { x: 0.5, y: 0.5 }, isPrecise: false, isExact: false, - } + } : { type: 'point', x: end[0], y: end[1], - }, + }, arrowheadEnd: arrowheadsToArrowheadTypes[element.endArrowhead] ?? 'none', arrowheadStart: arrowheadsToArrowheadTypes[element.startArrowhead] ?? 'none', }, diff --git a/packages/tldraw/src/lib/ui/hooks/useActions.tsx b/packages/tldraw/src/lib/ui/hooks/useActions.tsx index 9152c4eee..a9145e6a7 100644 --- a/packages/tldraw/src/lib/ui/hooks/useActions.tsx +++ b/packages/tldraw/src/lib/ui/hooks/useActions.tsx @@ -420,11 +420,11 @@ export function ActionsProvider({ overrides, children }: ActionsProviderProps) { ? { x: commonBounds.width + 10, y: 0, - } + } : { x: 16 / editor.getZoomLevel(), y: 16 / editor.getZoomLevel(), - } + } } editor.mark('duplicate shapes') diff --git a/packages/tldraw/src/lib/ui/hooks/useActionsMenuSchema.tsx b/packages/tldraw/src/lib/ui/hooks/useActionsMenuSchema.tsx index 64f0d08f8..0f760e72d 100644 --- a/packages/tldraw/src/lib/ui/hooks/useActionsMenuSchema.tsx +++ b/packages/tldraw/src/lib/ui/hooks/useActionsMenuSchema.tsx @@ -80,8 +80,8 @@ export const ActionsMenuSchemaProvider = ({ allowGroup ? menuItem(actions['group'], { disabled: !twoSelected }) : allowUngroup - ? menuItem(actions['ungroup']) - : menuItem(actions['group'], { disabled: !twoSelected }), + ? menuItem(actions['ungroup']) + : menuItem(actions['group'], { disabled: !twoSelected }), ] if (overrides) { diff --git a/packages/tldraw/src/lib/ui/overrides.ts b/packages/tldraw/src/lib/ui/overrides.ts index 381e96a2f..fdaa2a8ab 100644 --- a/packages/tldraw/src/lib/ui/overrides.ts +++ b/packages/tldraw/src/lib/ui/overrides.ts @@ -50,12 +50,10 @@ type DefaultHelpers = ReturnType export type TLUiOverride = (editor: Editor, schema: Type, helpers: Helpers) => Type -type WithDefaultHelpers> = T extends TLUiOverride< - infer Type, - infer Helpers -> - ? TLUiOverride - : never +type WithDefaultHelpers> = + T extends TLUiOverride + ? TLUiOverride + : never /** @public */ export type TLUiOverrides = Partial<{ diff --git a/packages/tldraw/src/test/TestEditor.ts b/packages/tldraw/src/test/TestEditor.ts index c9d5f6d00..4f388b997 100644 --- a/packages/tldraw/src/test/TestEditor.ts +++ b/packages/tldraw/src/test/TestEditor.ts @@ -222,7 +222,7 @@ export class TestEditor extends Editor { ? ({ target: 'shape', shape: this.getShape(info as any), - } as T) + } as T) : info } @@ -267,18 +267,18 @@ export class TestEditor extends Editor { key === 'Shift' ? 'ShiftLeft' : key === 'Alt' - ? 'AltLeft' - : key === 'Control' || key === 'Meta' - ? 'CtrlLeft' - : key === ' ' - ? 'Space' - : key === 'Enter' || + ? 'AltLeft' + : key === 'Control' || key === 'Meta' + ? 'CtrlLeft' + : key === ' ' + ? 'Space' + : key === 'Enter' || key === 'ArrowRight' || key === 'ArrowLeft' || key === 'ArrowUp' || key === 'ArrowDown' - ? key - : 'Key' + key[0].toUpperCase() + key.slice(1), + ? key + : 'Key' + key[0].toUpperCase() + key.slice(1), type: 'keyboard', key, } diff --git a/packages/tlschema/package.json b/packages/tlschema/package.json index 76bb1a22a..aecd57d51 100644 --- a/packages/tlschema/package.json +++ b/packages/tlschema/package.json @@ -34,6 +34,7 @@ "test-dev": "yarn run -T jest --watch", "test-coverage": "lazy inherit", "index": "node ./scripts/build-index.js && yarn format", + "format": "yarn run -T prettier --write --cache \"src/**/*.{ts,tsx,js,jsx,json,md}\"", "build": "yarn run -T tsx ../../scripts/build-package.ts", "build-api": "yarn run -T tsx ../../scripts/build-api.ts", "prepack": "yarn run -T tsx ../../scripts/prepack.ts", diff --git a/packages/tlschema/src/records/TLAsset.ts b/packages/tlschema/src/records/TLAsset.ts index 8d952c9f9..cf29cb282 100644 --- a/packages/tlschema/src/records/TLAsset.ts +++ b/packages/tlschema/src/records/TLAsset.ts @@ -61,7 +61,7 @@ export type TLAssetPartial = T extends T type: T['type'] props?: Partial meta?: Partial - } & Partial> + } & Partial> : never /** @public */ diff --git a/packages/tlschema/src/records/TLInstance.ts b/packages/tlschema/src/records/TLInstance.ts index ac30a12b9..1a70188be 100644 --- a/packages/tlschema/src/records/TLInstance.ts +++ b/packages/tlschema/src/records/TLInstance.ts @@ -364,12 +364,12 @@ export const instanceMigrations = defineMigrations({ opacity < 0.175 ? '0.1' : opacity < 0.375 - ? '0.25' - : opacity < 0.625 - ? '0.5' - : opacity < 0.875 - ? '0.75' - : '1', + ? '0.25' + : opacity < 0.625 + ? '0.5' + : opacity < 0.875 + ? '0.75' + : '1', }, } }, diff --git a/packages/tlschema/src/records/TLShape.ts b/packages/tlschema/src/records/TLShape.ts index 926bd00b7..5821ae09e 100644 --- a/packages/tlschema/src/records/TLShape.ts +++ b/packages/tlschema/src/records/TLShape.ts @@ -60,7 +60,7 @@ export type TLShapePartial = T extends T type: T['type'] props?: Partial meta?: Partial - } & Partial> + } & Partial> : never /** @public */ @@ -124,12 +124,12 @@ export const rootShapeMigrations = defineMigrations({ opacity < 0.175 ? '0.1' : opacity < 0.375 - ? '0.25' - : opacity < 0.625 - ? '0.5' - : opacity < 0.875 - ? '0.75' - : '1', + ? '0.25' + : opacity < 0.625 + ? '0.5' + : opacity < 0.875 + ? '0.75' + : '1', }, } }, diff --git a/packages/tlschema/src/shapes/TLArrowShape.ts b/packages/tlschema/src/shapes/TLArrowShape.ts index 3b2bc326f..b76c3ab04 100644 --- a/packages/tlschema/src/shapes/TLArrowShape.ts +++ b/packages/tlschema/src/shapes/TLArrowShape.ts @@ -121,14 +121,14 @@ export const arrowShapeMigrations = defineMigrations({ isPrecise: !( start.normalizedAnchor.x === 0.5 && start.normalizedAnchor.y === 0.5 ), - } + } : start, end: (end as TLArrowShapeTerminal).type === 'binding' ? { ...end, isPrecise: !(end.normalizedAnchor.x === 0.5 && end.normalizedAnchor.y === 0.5), - } + } : end, }, } diff --git a/packages/utils/src/lib/object.ts b/packages/utils/src/lib/object.ts index 9c4e60cd4..954804f45 100644 --- a/packages/utils/src/lib/object.ts +++ b/packages/utils/src/lib/object.ts @@ -58,11 +58,9 @@ export function deepCopy(obj: T): T { * * @internal */ -export function objectMapKeys( - object: { - readonly [K in Key]: unknown - } -): Array { +export function objectMapKeys(object: { + readonly [K in Key]: unknown +}): Array { return Object.keys(object) as Key[] } @@ -72,11 +70,9 @@ export function objectMapKeys( * * @internal */ -export function objectMapValues( - object: { - [K in Key]: Value - } -): Array { +export function objectMapValues(object: { + [K in Key]: Value +}): Array { return Object.values(object) as Value[] } @@ -86,11 +82,9 @@ export function objectMapValues( * * @internal */ -export function objectMapEntries( - object: { - [K in Key]: Value - } -): Array<[Key, Value]> { +export function objectMapEntries(object: { + [K in Key]: Value +}): Array<[Key, Value]> { return Object.entries(object) as [Key, Value][] } diff --git a/packages/validate/src/lib/validation.ts b/packages/validate/src/lib/validation.ts index beab57988..aaea52e8f 100644 --- a/packages/validate/src/lib/validation.ts +++ b/packages/validate/src/lib/validation.ts @@ -242,11 +242,9 @@ export class ObjectValidator extends Validator { * }) * ``` */ - extend>( - extension: { - readonly [K in keyof Extension]: Validatable - } - ): ObjectValidator { + extend>(extension: { + readonly [K in keyof Extension]: Validatable + }): ObjectValidator { return new ObjectValidator({ ...this.config, ...extension }) as ObjectValidator< Shape & Extension > @@ -472,11 +470,9 @@ export const unknownObject = new Validator>((value) => { * * @public */ -export function object( - config: { - readonly [K in keyof Shape]: Validatable - } -): ObjectValidator { +export function object(config: { + readonly [K in keyof Shape]: Validatable +}): ObjectValidator { return new ObjectValidator(config) } diff --git a/scripts/lint.ts b/scripts/lint.ts index cbd8a378d..79fe74391 100755 --- a/scripts/lint.ts +++ b/scripts/lint.ts @@ -4,6 +4,7 @@ import { exec } from './lib/exec' import { REPO_ROOT, readFileIfExists } from './lib/file' const ESLINT_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx'] +const PRETTIER_EXTENSIONS = ['js', 'jsx', 'ts', 'tsx', 'json'] async function main() { const shouldFix = process.argv.includes('--fix') @@ -26,10 +27,19 @@ async function main() { files.push(file) } + let prettierFiles = PRETTIER_EXTENSIONS.flatMap((ext) => filesByExtension.get(ext) ?? []) let eslintFiles = ESLINT_EXTENSIONS.flatMap((ext) => filesByExtension.get(ext) ?? []) const relativeCwd = path.relative(REPO_ROOT, process.cwd()) + const prettierIgnoreFile = await readFileIfExists(path.join(REPO_ROOT, '.prettierignore')) + if (prettierIgnoreFile) { + prettierFiles = prettierFiles + .map((f) => path.join(relativeCwd, f)) + .filter(ignore().add(prettierIgnoreFile).createFilter()) + .map((f) => path.relative(relativeCwd, f)) + } + const eslintIgnoreFile = await readFileIfExists(path.join(REPO_ROOT, '.eslintignore')) if (eslintIgnoreFile) { eslintFiles = eslintFiles @@ -39,6 +49,14 @@ async function main() { } try { + await exec('yarn', [ + 'run', + '-T', + 'prettier', + shouldFix ? '--write' : '--check', + '--cache', + ...prettierFiles, + ]) await exec('yarn', [ 'run', '-T', diff --git a/scripts/publish-canary.ts b/scripts/publish-canary.ts index 2778d3f60..2f494dd09 100644 --- a/scripts/publish-canary.ts +++ b/scripts/publish-canary.ts @@ -10,7 +10,7 @@ async function main() { const nextVersion = latestVersion.prerelease.length ? // if the package is in prerelease mode, we want to release a canary for the current version rather than bumping - latestVersion + latestVersion : latestVersion?.inc(bump) const versionString = `${nextVersion.major}.${nextVersion.minor}.${nextVersion.patch}-canary.${sha}` diff --git a/scripts/publish-new.ts b/scripts/publish-new.ts index c072ff0d2..7691b2cbb 100644 --- a/scripts/publish-new.ts +++ b/scripts/publish-new.ts @@ -46,7 +46,7 @@ async function main() { const nextVersion = prereleaseTag ? `${latestVersion.major}.${latestVersion.minor}.${latestVersion.patch}-${prereleaseTag}.${ Number(prereleaseNumber) + 1 - }` + }` : latestVersion.inc(bump).format() setAllVersions(nextVersion) diff --git a/yarn.lock b/yarn.lock index 7cb6f1848..dda32a3b2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2338,97 +2338,6 @@ __metadata: languageName: node linkType: hard -"@biomejs/biome@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/biome@npm:1.5.3" - dependencies: - "@biomejs/cli-darwin-arm64": "npm:1.5.3" - "@biomejs/cli-darwin-x64": "npm:1.5.3" - "@biomejs/cli-linux-arm64": "npm:1.5.3" - "@biomejs/cli-linux-arm64-musl": "npm:1.5.3" - "@biomejs/cli-linux-x64": "npm:1.5.3" - "@biomejs/cli-linux-x64-musl": "npm:1.5.3" - "@biomejs/cli-win32-arm64": "npm:1.5.3" - "@biomejs/cli-win32-x64": "npm:1.5.3" - dependenciesMeta: - "@biomejs/cli-darwin-arm64": - optional: true - "@biomejs/cli-darwin-x64": - optional: true - "@biomejs/cli-linux-arm64": - optional: true - "@biomejs/cli-linux-arm64-musl": - optional: true - "@biomejs/cli-linux-x64": - optional: true - "@biomejs/cli-linux-x64-musl": - optional: true - "@biomejs/cli-win32-arm64": - optional: true - "@biomejs/cli-win32-x64": - optional: true - bin: - biome: bin/biome - checksum: 1bcdcc3a34de0871d91ecf37eae67f71847f3578723001f81616b1fd1d694d584accce37cf582f07aef3b920b47c32716e7244b7f67f52926c7c8526bc7cd5d9 - languageName: node - linkType: hard - -"@biomejs/cli-darwin-arm64@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-darwin-arm64@npm:1.5.3" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - -"@biomejs/cli-darwin-x64@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-darwin-x64@npm:1.5.3" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - -"@biomejs/cli-linux-arm64-musl@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-linux-arm64-musl@npm:1.5.3" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - -"@biomejs/cli-linux-arm64@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-linux-arm64@npm:1.5.3" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - -"@biomejs/cli-linux-x64-musl@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-linux-x64-musl@npm:1.5.3" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - -"@biomejs/cli-linux-x64@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-linux-x64@npm:1.5.3" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - -"@biomejs/cli-win32-arm64@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-win32-arm64@npm:1.5.3" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - -"@biomejs/cli-win32-x64@npm:1.5.3": - version: 1.5.3 - resolution: "@biomejs/cli-win32-x64@npm:1.5.3" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@cloudflare/kv-asset-handler@npm:^0.2.0": version: 0.2.0 resolution: "@cloudflare/kv-asset-handler@npm:0.2.0" @@ -7368,7 +7277,10 @@ __metadata: next-themes: "npm:^0.2.1" octokit: "npm:^3.1.1" openai: "npm:^4.11.1" + patch-package: "npm:^8.0.0" + postinstall-postinstall: "npm:^2.1.0" prettier: "npm:^3.0.3" + prettier-plugin-organize-imports: "npm:^3.2.3" react: "npm:^18.2.0" react-dom: "npm:^18.2.0" react-hotkeys-hook: "npm:^4.4.1" @@ -7458,7 +7370,6 @@ __metadata: version: 0.0.0-use.local resolution: "@tldraw/monorepo@workspace:." dependencies: - "@biomejs/biome": "npm:1.5.3" "@microsoft/api-extractor": "npm:^7.35.4" "@next/eslint-plugin-next": "npm:^13.3.0" "@sentry/cli": "npm:^2.25.0" @@ -7488,6 +7399,8 @@ __metadata: json5: "npm:^2.2.3" lazyrepo: "npm:0.0.0-alpha.27" lint-staged: "npm:>=10" + prettier: "npm:^3.0.3" + prettier-plugin-organize-imports: "npm:^3.2.3" purgecss: "npm:^5.0.0" rimraf: "npm:^4.4.0" svgo: "npm:^3.0.2" @@ -9123,6 +9036,13 @@ __metadata: languageName: node linkType: hard +"@yarnpkg/lockfile@npm:^1.1.0": + version: 1.1.0 + resolution: "@yarnpkg/lockfile@npm:1.1.0" + checksum: cd19e1114aaf10a05126aeea8833ef4ca8af8a46e88e12884f8359d19333fd19711036dbc2698dbe937f81f037070cf9a8da45c2e8c6ca19cafd7d15659094ed + languageName: node + linkType: hard + "@yarnpkg/types@npm:^4.0.0": version: 4.0.0 resolution: "@yarnpkg/types@npm:4.0.0" @@ -9810,6 +9730,13 @@ __metadata: languageName: node linkType: hard +"at-least-node@npm:^1.0.0": + version: 1.0.0 + resolution: "at-least-node@npm:1.0.0" + checksum: 463e2f8e43384f1afb54bc68485c436d7622acec08b6fad269b421cb1d29cebb5af751426793d0961ed243146fe4dc983402f6d5a51b720b277818dbf6f2e49e + languageName: node + linkType: hard + "author-regex@npm:^1.0.0": version: 1.0.0 resolution: "author-regex@npm:1.0.0" @@ -10756,7 +10683,7 @@ __metadata: languageName: node linkType: hard -"ci-info@npm:^3.1.0, ci-info@npm:^3.2.0, ci-info@npm:^3.8.0": +"ci-info@npm:^3.1.0, ci-info@npm:^3.2.0, ci-info@npm:^3.7.0, ci-info@npm:^3.8.0": version: 3.9.0 resolution: "ci-info@npm:3.9.0" checksum: 75bc67902b4d1c7b435497adeb91598f6d52a3389398e44294f6601b20cfef32cf2176f7be0eb961d9e085bb333a8a5cae121cb22f81cf238ae7f58eb80e9397 @@ -14060,6 +13987,15 @@ __metadata: languageName: node linkType: hard +"find-yarn-workspace-root@npm:^2.0.0": + version: 2.0.0 + resolution: "find-yarn-workspace-root@npm:2.0.0" + dependencies: + micromatch: "npm:^4.0.2" + checksum: 7fa7942849eef4d5385ee96a0a9a5a9afe885836fd72ed6a4280312a38690afea275e7d09b343fe97daf0412d833f8ac4b78c17fc756386d9ebebf0759d707a7 + languageName: node + linkType: hard + "flat-cache@npm:^3.0.4": version: 3.2.0 resolution: "flat-cache@npm:3.2.0" @@ -14268,6 +14204,18 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:^9.0.0": + version: 9.1.0 + resolution: "fs-extra@npm:9.1.0" + dependencies: + at-least-node: "npm:^1.0.0" + graceful-fs: "npm:^4.2.0" + jsonfile: "npm:^6.0.1" + universalify: "npm:^2.0.0" + checksum: 08600da1b49552ed23dfac598c8fc909c66776dd130fea54fbcad22e330f7fcc13488bb995f6bc9ce5651aa35b65702faf616fe76370ee56f1aade55da982dca + languageName: node + linkType: hard + "fs-extra@npm:~7.0.1": version: 7.0.1 resolution: "fs-extra@npm:7.0.1" @@ -14817,7 +14765,7 @@ __metadata: languageName: node linkType: hard -"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": +"graceful-fs@npm:^4.1.11, graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9": version: 4.2.11 resolution: "graceful-fs@npm:4.2.11" checksum: bf152d0ed1dc159239db1ba1f74fdbc40cb02f626770dcd5815c427ce0688c2635a06ed69af364396da4636d0408fcf7d4afdf7881724c3307e46aff30ca49e2 @@ -15824,6 +15772,15 @@ __metadata: languageName: node linkType: hard +"is-docker@npm:^2.0.0": + version: 2.2.1 + resolution: "is-docker@npm:2.2.1" + bin: + is-docker: cli.js + checksum: 3fef7ddbf0be25958e8991ad941901bf5922ab2753c46980b60b05c1bf9c9c2402d35e6dc32e4380b980ef5e1970a5d9d5e5aa2e02d77727c3b6b5e918474c56 + languageName: node + linkType: hard + "is-extendable@npm:^0.1.0": version: 0.1.1 resolution: "is-extendable@npm:0.1.1" @@ -16142,6 +16099,15 @@ __metadata: languageName: node linkType: hard +"is-wsl@npm:^2.1.1": + version: 2.2.0 + resolution: "is-wsl@npm:2.2.0" + dependencies: + is-docker: "npm:^2.0.0" + checksum: 20849846ae414997d290b75e16868e5261e86ff5047f104027026fd61d8b5a9b0b3ade16239f35e1a067b3c7cc02f70183cb661010ed16f4b6c7c93dad1b19d8 + languageName: node + linkType: hard + "isarray@npm:0.0.1": version: 0.0.1 resolution: "isarray@npm:0.0.1" @@ -17093,6 +17059,18 @@ __metadata: languageName: node linkType: hard +"json-stable-stringify@npm:^1.0.2": + version: 1.1.0 + resolution: "json-stable-stringify@npm:1.1.0" + dependencies: + call-bind: "npm:^1.0.5" + isarray: "npm:^2.0.5" + jsonify: "npm:^0.0.1" + object-keys: "npm:^1.1.1" + checksum: 2889eca4f39574905bde288791d3fcc79fc9952f445a5fefb82af175a7992ec48c64161421c1e142f553a14a5f541de2e173cb22ce61d7fffc36d4bb44720541 + languageName: node + linkType: hard + "json-stringify-safe@npm:~5.0.1": version: 5.0.1 resolution: "json-stringify-safe@npm:5.0.1" @@ -17152,6 +17130,13 @@ __metadata: languageName: node linkType: hard +"jsonify@npm:^0.0.1": + version: 0.0.1 + resolution: "jsonify@npm:0.0.1" + checksum: 7b86b6f4518582ff1d8b7624ed6c6277affd5246445e864615dbdef843a4057ac58587684faf129ea111eeb80e01c15f0a4d9d03820eb3f3985fa67e81b12398 + languageName: node + linkType: hard + "jsonwebtoken@npm:^9.0.0, jsonwebtoken@npm:^9.0.2": version: 9.0.2 resolution: "jsonwebtoken@npm:9.0.2" @@ -17242,6 +17227,15 @@ __metadata: languageName: node linkType: hard +"klaw-sync@npm:^6.0.0": + version: 6.0.0 + resolution: "klaw-sync@npm:6.0.0" + dependencies: + graceful-fs: "npm:^4.1.11" + checksum: 0da397f8961313c3ef8f79fb63af9002cde5a8fb2aeb1a37351feff0dd6006129c790400c3f5c3b4e757bedcabb13d21ec0a5eaef5a593d59515d4f2c291e475 + languageName: node + linkType: hard + "kleur@npm:^4.0.3, kleur@npm:^4.1.5": version: 4.1.5 resolution: "kleur@npm:4.1.5" @@ -19819,6 +19813,16 @@ __metadata: languageName: node linkType: hard +"open@npm:^7.4.2": + version: 7.4.2 + resolution: "open@npm:7.4.2" + dependencies: + is-docker: "npm:^2.0.0" + is-wsl: "npm:^2.1.1" + checksum: 4fc02ed3368dcd5d7247ad3566433ea2695b0713b041ebc0eeb2f0f9e5d4e29fc2068f5cdd500976b3464e77fe8b61662b1b059c73233ccc601fe8b16d6c1cd6 + languageName: node + linkType: hard + "openai@npm:^3.2.1": version: 3.3.0 resolution: "openai@npm:3.3.0" @@ -20202,6 +20206,31 @@ __metadata: languageName: node linkType: hard +"patch-package@npm:^8.0.0": + version: 8.0.0 + resolution: "patch-package@npm:8.0.0" + dependencies: + "@yarnpkg/lockfile": "npm:^1.1.0" + chalk: "npm:^4.1.2" + ci-info: "npm:^3.7.0" + cross-spawn: "npm:^7.0.3" + find-yarn-workspace-root: "npm:^2.0.0" + fs-extra: "npm:^9.0.0" + json-stable-stringify: "npm:^1.0.2" + klaw-sync: "npm:^6.0.0" + minimist: "npm:^1.2.6" + open: "npm:^7.4.2" + rimraf: "npm:^2.6.3" + semver: "npm:^7.5.3" + slash: "npm:^2.0.0" + tmp: "npm:^0.0.33" + yaml: "npm:^2.2.2" + bin: + patch-package: index.js + checksum: 8714322c35b29266e71c82d58443ce5322400a546a3327f1b8907b8eeb7e366dff33c4fdfbd25e3f0b3a9927189c26e9ac60636ca1e4140d6dbc11cca10f9b5d + languageName: node + linkType: hard + "path-browserify@npm:^1.0.1": version: 1.0.1 resolution: "path-browserify@npm:1.0.1" @@ -20588,6 +20617,13 @@ __metadata: languageName: node linkType: hard +"postinstall-postinstall@npm:^2.1.0": + version: 2.1.0 + resolution: "postinstall-postinstall@npm:2.1.0" + checksum: dae45fe6b22f3c1c1590721df1d4d4a7cdf848c48f55c1a37e72ce5df14c2f5103d86d857c8d7572e59b9228478c72c6888c5620c816b262b499ee5148b88553 + languageName: node + linkType: hard + "prebuild-install@npm:^7.0.1, prebuild-install@npm:^7.1.1": version: 7.1.1 resolution: "prebuild-install@npm:7.1.1" @@ -20624,6 +20660,23 @@ __metadata: languageName: node linkType: hard +"prettier-plugin-organize-imports@npm:^3.2.3": + version: 3.2.4 + resolution: "prettier-plugin-organize-imports@npm:3.2.4" + peerDependencies: + "@volar/vue-language-plugin-pug": ^1.0.4 + "@volar/vue-typescript": ^1.0.4 + prettier: ">=2.0" + typescript: ">=2.9" + peerDependenciesMeta: + "@volar/vue-language-plugin-pug": + optional: true + "@volar/vue-typescript": + optional: true + checksum: 93c98d365af500aa4c72f5330d82c20a20d0e7661a9692e6f26a76a2f4f88b99e0f85dcb8871e98b6d687d6e19ea5f1dcc937f9e29fd0778e888675ecafed233 + languageName: node + linkType: hard + "prettier@npm:2.7.1": version: 2.7.1 resolution: "prettier@npm:2.7.1" @@ -21907,7 +21960,7 @@ __metadata: languageName: node linkType: hard -"rimraf@npm:^2.6.1": +"rimraf@npm:^2.6.1, rimraf@npm:^2.6.3": version: 2.7.1 resolution: "rimraf@npm:2.7.1" dependencies: @@ -22452,6 +22505,13 @@ __metadata: languageName: node linkType: hard +"slash@npm:^2.0.0": + version: 2.0.0 + resolution: "slash@npm:2.0.0" + checksum: 512d4350735375bd11647233cb0e2f93beca6f53441015eea241fe784d8068281c3987fbaa93e7ef1c38df68d9c60013045c92837423c69115297d6169aa85e6 + languageName: node + linkType: hard + "slash@npm:^3.0.0": version: 3.0.0 resolution: "slash@npm:3.0.0" @@ -25667,7 +25727,7 @@ __metadata: languageName: node linkType: hard -"yaml@npm:2.3.4, yaml@npm:^2.0.0, yaml@npm:^2.2.1, yaml@npm:^2.3.4": +"yaml@npm:2.3.4, yaml@npm:^2.0.0, yaml@npm:^2.2.1, yaml@npm:^2.2.2, yaml@npm:^2.3.4": version: 2.3.4 resolution: "yaml@npm:2.3.4" checksum: f8207ce43065a22268a2806ea6a0fa3974c6fde92b4b2fa0082357e487bc333e85dc518910007e7ac001b532c7c84bd3eccb6c7757e94182b564028b0008f44b