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:
parent
b7fb31f8f9
commit
d7002057d7
248 changed files with 20084 additions and 245 deletions
45
apps/dotcom-worker/scripts/report-size.js
Normal file
45
apps/dotcom-worker/scripts/report-size.js
Normal file
|
@ -0,0 +1,45 @@
|
|||
/* eslint-disable no-undef */
|
||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
||||
const { spawn } = require('child_process')
|
||||
const colors = require('picocolors')
|
||||
|
||||
class Monitor {
|
||||
lastLineTime = Date.now()
|
||||
nextTick = 0
|
||||
|
||||
size = 0
|
||||
|
||||
start() {
|
||||
console.log('Spawning')
|
||||
const proc = spawn('npx', ['esbuild', 'src/lib/worker.ts', '--bundle', '--minify', '--watch'])
|
||||
// listen for lines on stdin
|
||||
proc.stdout.on('data', (data) => {
|
||||
this.size += data.length
|
||||
this.lastLineTime = Date.now()
|
||||
clearTimeout(this.nextTick)
|
||||
this.nextTick = setTimeout(() => {
|
||||
console.log(
|
||||
colors.bold(colors.yellow('dotcom-worker')),
|
||||
'is roughly',
|
||||
colors.bold(colors.cyan(Math.floor(this.size / 1024) + 'kb')),
|
||||
'(minified)\n'
|
||||
)
|
||||
this.size = 0
|
||||
}, 10)
|
||||
})
|
||||
process.on('SIGINT', () => {
|
||||
console.log('Int')
|
||||
proc.kill()
|
||||
})
|
||||
process.on('SIGTERM', () => {
|
||||
console.log('Term')
|
||||
proc.kill()
|
||||
})
|
||||
process.on('exit', () => {
|
||||
console.log('Exiting')
|
||||
proc.kill()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
new Monitor().start()
|
Loading…
Add table
Add a link
Reference in a new issue