tldraw/vscode/extension/scripts/package.js
Francois Laberge a95b581e07
Prepare for Publishing VS Code Extension (#227)
* Changed Wardlt use back to Tldraw. Added some VS Code marketplace categories

* Missed removing one Wardlt mention

* Initial support for esbuild based vscode extension workflow.

* Hacky start of vs code extension build script

* Fixed categories of extension

* Added script for generating VS Code extension installer

* Temp fix for file format change affecting VS Code extension

* Temp fix for file format change issue

* Cleanup, prevent changes from saving pagestates

* Remove logic around saving pageState

* standardize capitalization

* v0.1.8

* Edit readme, scripts

* Update .eslintignore

* v0.1.9

* v0.1.10

* cleans up build scripts, adds publishing notes

* Added VS Code extension implementation references links. start:vscode now auto opens the extension folder in VS Code

* Removed step from VS Code README to manually open the extensions folder

* Removed file

* v0.1.11

* v0.1.12

* Fix empty file

* v0.1.13

* README cleanup

* v0.1.14

* Update TLDrawEditorProvider.ts

* v0.1.15

* Fix types for file extension (sort of) build script for extension

Co-authored-by: Steve Ruiz <steveruizok@gmail.com>
2021-11-10 15:35:51 +00:00

37 lines
826 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* eslint-disable */
//const version = require('../../../lerna.json').version
const pkg = require('../package.json')
const { exec } = require('child_process')
const fs = require('fs')
const dir = './temp'
async function main() {
if (fs.existsSync(dir)) {
fs.rmSync(dir, { recursive: true }, (e) => {
if (e) {
throw e
}
})
}
fs.mkdirSync(dir)
try {
exec(
`cp -r ../editor/dist editor; vsce package; mv ${pkg.name}-${pkg.version}.vsix ${dir}`,
(error, stdout, stderr) => {
if (error) {
throw new Error(error.message)
}
if (stderr && stderr.search('warning') !== 0) {
throw new Error(stderr)
}
}
)
} catch (e) {
console.log(`× ${pkg.name}: Build failed due to an error.`)
console.log(e)
}
}
main()