unbrivate, dot com in (#2475)

This PR moves the tldraw.com app into the public repo.

### Change Type

- [x] `internal` — Any other changes that don't affect the published
package[^2]

---------

Co-authored-by: Dan Groshev <git@dgroshev.com>
Co-authored-by: alex <alex@dytry.ch>
This commit is contained in:
Steve Ruiz 2024-01-16 14:38:05 +00:00 committed by GitHub
parent b7fb31f8f9
commit d7002057d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
248 changed files with 20084 additions and 245 deletions

View file

@ -1,15 +1,23 @@
import { existsSync, readFileSync } from 'fs'
import { readFile, writeFile as writeFileUnchecked } from 'fs/promises'
import json5 from 'json5'
import { basename, dirname, join, relative } from 'path'
import { dirname, join, relative } from 'path'
import prettier from 'prettier'
import { fileURLToPath } from 'url'
import { nicelog } from './nicelog'
const __filename = fileURLToPath(import.meta.url)
const __dirname = dirname(__filename)
const isBublic = basename(join(__dirname, '../..')) === 'bublic'
export const REPO_ROOT = join(__dirname, isBublic ? '../../../' : '../..')
export const BUBLIC_ROOT = join(__dirname, '../..')
export const REPO_ROOT = join(__dirname, '../..')
const _rootPackageJsonPath = join(REPO_ROOT, 'package.json')
if (!existsSync(_rootPackageJsonPath)) {
throw new Error('expected to find package.json in REPO_ROOT')
}
const _rootPackageJson = JSON.parse(readFileSync(_rootPackageJsonPath, 'utf8'))
if (_rootPackageJson['name'] !== '@tldraw/monorepo') {
throw new Error('expected to find @tldraw/monorepo in REPO_ROOT package.json')
}
export async function readJsonIfExists(file: string) {
const fileContents = await readFileIfExists(file)