-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- move styles into src and use imports to include - add manual shim for Buffer - update CI checks to use tsc for typechecking - clean up vscodeignore
- Loading branch information
Colin Grant
committed
Apr 10, 2024
1 parent
909bf15
commit c3b40c3
Showing
25 changed files
with
252 additions
and
1,264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
.github | ||
.vscode | ||
src | ||
*.vsix | ||
dist/**/*.js.map | ||
node_modules | ||
!node_modules/@vscode/codicons/dist/codicon.css | ||
!node_modules/@vscode/codicons/dist/codicon.ttf | ||
# Exclude everything | ||
* | ||
*/ | ||
|
||
# Include the following: | ||
!dist/ | ||
!media/ | ||
!package.json | ||
!CHANGELOG.md | ||
!README.md | ||
!LICENSE.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// @ts-check | ||
const esbuild = require('esbuild'); | ||
const path = require('path'); | ||
|
||
const watch = process.argv.includes('--watch') || process.argv.includes('-w'); | ||
const dev = watch || process.argv.includes('--dev') || process.argv.includes('-d'); | ||
|
||
const defaults = { | ||
bundle: true, | ||
minify: !dev, | ||
sourcemap: !dev, | ||
external: ['vscode'] | ||
} | ||
|
||
const srcDir = path.join(__dirname, 'src'); | ||
const distDir = path.join(__dirname, 'dist'); | ||
|
||
/** @type {import('esbuild').BuildOptions} */ | ||
const desktopPluginConfig = { | ||
...defaults, | ||
entryPoints: [path.join(srcDir, 'entry-points', 'desktop', 'extension.ts')], | ||
outdir: path.join(distDir, 'desktop'), | ||
format: 'cjs', | ||
platform: 'node', | ||
target: ['es2020'], | ||
} | ||
|
||
/** @type {import('esbuild').BuildOptions} */ | ||
const browserPluginConfig = { | ||
...defaults, | ||
entryPoints: [path.join(srcDir, 'entry-points', 'browser', 'extension.ts')], | ||
outdir: path.join(distDir, 'browser'), | ||
format: 'cjs', | ||
platform: 'neutral', | ||
mainFields: ['main', 'module'], | ||
target: ['es2020'], | ||
} | ||
|
||
/** @type {import('esbuild').BuildOptions} */ | ||
const webviewConfig = { | ||
...defaults, | ||
entryPoints: [path.join(srcDir, 'webview', 'memory-webview-view.tsx')], | ||
inject: [path.join(srcDir, 'webview', 'buffer-shim.js')], | ||
outfile: path.join(distDir, 'views', 'memory.js'), | ||
format: 'esm', | ||
platform: 'browser', | ||
target: ['es2020'], | ||
loader: { ".ttf": "copy" }, | ||
} | ||
|
||
const allConfigs = [ | ||
desktopPluginConfig, | ||
browserPluginConfig, | ||
webviewConfig | ||
]; | ||
|
||
async function main() { | ||
if (watch) { | ||
await Promise.all(allConfigs.map(config => esbuild.context(config).then(context => context.watch()))); | ||
} else { | ||
await Promise.all(allConfigs.map(config => esbuild.build(config))); | ||
} | ||
} | ||
|
||
main(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const Buffer = require('buffer').Buffer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,9 +11,10 @@ | |
"lib": [ | ||
"es2020", | ||
"dom" | ||
] | ||
], | ||
"skipLibCheck": true | ||
}, | ||
"include": [ | ||
"src" | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.