kopia lustrzana https://github.com/Tldraw/Tldraw
Update vscode extension (#942)
rodzic
1be09d2204
commit
7b3c6ed808
|
@ -1,7 +1,6 @@
|
|||
import * as React from 'react'
|
||||
import * as ReactDOM from 'react-dom'
|
||||
import App from './App'
|
||||
import './styles.css'
|
||||
import App from './app'
|
||||
|
||||
ReactDOM.render(
|
||||
<React.StrictMode>
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
html,
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
overscroll-behavior: none;
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
.tldraw {
|
||||
position: fixed;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
right: 0px;
|
||||
bottom: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
|
@ -7,6 +7,7 @@
|
|||
"rootDir": "src",
|
||||
"baseUrl": "src",
|
||||
"emitDeclarationOnly": false,
|
||||
"jsx": "react-jsx",
|
||||
"paths": {
|
||||
"@tldraw/tldraw": ["../../../packages/tldraw"]
|
||||
}
|
||||
|
|
|
@ -1,10 +1,38 @@
|
|||
/* eslint-disable */
|
||||
const fs = require('fs')
|
||||
const pkg = require('../package.json')
|
||||
const esbuild = require('esbuild')
|
||||
const { exec } = require('child_process')
|
||||
|
||||
const { log: jslog } = console
|
||||
|
||||
async function copyEditor() {
|
||||
if (fs.existsSync('./editor')) {
|
||||
fs.rmSync('./editor', { recursive: true }, (e) => {
|
||||
if (e) {
|
||||
throw e
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
try {
|
||||
exec(`cp -r ../editor/dist editor;`, (error, stdout, stderr) => {
|
||||
if (error) {
|
||||
throw new Error(error.message)
|
||||
}
|
||||
if (stderr && stderr.search('warning') !== 0) {
|
||||
throw new Error(stderr)
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
jslog(`× ${pkg.name}: Build failed due to an error.`)
|
||||
jslog(e)
|
||||
}
|
||||
}
|
||||
|
||||
async function main() {
|
||||
await copyEditor()
|
||||
|
||||
if (fs.existsSync('./dist')) {
|
||||
fs.rmSync('./dist', { recursive: true }, (e) => {
|
||||
if (e) {
|
||||
|
|
|
@ -140,10 +140,10 @@ export class TldrawWebviewManager {
|
|||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
cssSrc = webviewPanel.webview.asWebviewUri(
|
||||
vscode.Uri.joinPath(context.extensionUri, 'editor/', 'index.css')
|
||||
vscode.Uri.joinPath(context.extensionUri, 'editor', 'index.css')
|
||||
)
|
||||
jsSrc = webviewPanel.webview.asWebviewUri(
|
||||
vscode.Uri.joinPath(context.extensionUri, 'editor/', 'index.js')
|
||||
vscode.Uri.joinPath(context.extensionUri, 'editor', 'index.js')
|
||||
)
|
||||
} else {
|
||||
const localhost = 'http://localhost:5420/'
|
||||
|
|
|
@ -25,10 +25,18 @@
|
|||
}
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../../packages/vec" },
|
||||
{ "path": "../../packages/intersect" },
|
||||
{ "path": "../../packages/core" },
|
||||
{ "path": "../../packages/tldraw" }
|
||||
{
|
||||
"path": "../../packages/vec"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/intersect"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/core"
|
||||
},
|
||||
{
|
||||
"path": "../../packages/tldraw"
|
||||
}
|
||||
],
|
||||
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"exclude": ["node_modules"]
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
"importHelpers": true,
|
||||
"resolveJsonModule": true,
|
||||
"incremental": true,
|
||||
"jsx": "preserve",
|
||||
"jsx": "react-jsx",
|
||||
"lib": ["dom", "esnext"],
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
|
|
|
@ -6849,6 +6849,11 @@ json5@^2.2.1:
|
|||
resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c"
|
||||
integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==
|
||||
|
||||
jsoncrush@^1.1.8:
|
||||
version "1.1.8"
|
||||
resolved "https://registry.yarnpkg.com/jsoncrush/-/jsoncrush-1.1.8.tgz#5dd9389df1979592df8c89ab99ba69b029a030be"
|
||||
integrity sha512-lvIMGzMUA0fjuqwNcxlTNRq2bibPZ9auqT/LyGdlR5hvydJtA/BasSgkx4qclqTKVeTidrJvsS/oVjlTCPQ4Nw==
|
||||
|
||||
jsonfile@^4.0.0:
|
||||
version "4.0.0"
|
||||
resolved "https://registry.yarnpkg.com/jsonfile/-/jsonfile-4.0.0.tgz#8771aae0799b64076b76640fca058f9c10e33ecb"
|
||||
|
|
Ładowanie…
Reference in New Issue