-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xml highlighting for ui & qrc files
* Update package.json scripts for `esbuild.mjs` * Add `esbuild.mjs`. Since webview ui toolkit is used, it needs to be build as a module separately. * Use xml highlighting for ui and qrc files * Add icons * Remove redundant `file-ext-qrc.ts` file * Remove redundant nolint usage * Remove activations events for `.pro` files * Make `prettier` silent Change-Id: I51f9a5a4b1682df43b898850a562912181743a87 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
- Loading branch information
1 parent
80a5b8e
commit 48f0c73
Showing
19 changed files
with
1,380 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
.eslintrc.cjs | ||
esbuild.mjs |
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,62 @@ | ||
// Copyright (C) 2024 The Qt Company Ltd. | ||
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only | ||
|
||
import { build, context} from 'esbuild'; | ||
|
||
/** @type BuildOptions */ | ||
const baseConfig = { | ||
bundle: true, | ||
minify: process.env.NODE_ENV === 'production', | ||
sourcemap: process.env.NODE_ENV !== 'production' | ||
}; | ||
|
||
// Config for extension source code (to be run in a Node-based context) | ||
/** @type BuildOptions */ | ||
const extensionConfig = { | ||
...baseConfig, | ||
platform: 'node', | ||
mainFields: ['module', 'main'], | ||
tsconfig: './tsconfig.json', | ||
format: 'cjs', | ||
entryPoints: ['./src/extension.ts'], | ||
outfile: './out/extension.js', | ||
external: ['vscode'] | ||
}; | ||
|
||
// Config for webview source code (to be run in a web-based context) | ||
/** @type BuildOptions */ | ||
const webviewConfig = { | ||
...baseConfig, | ||
target: 'es2020', | ||
format: 'esm', | ||
entryPoints: ['./src/editors/ui/webview-ui/main.ts'], | ||
outfile: './out/editors/ui/webview-ui/main.js' | ||
}; | ||
|
||
// Build script | ||
(async () => { | ||
const args = process.argv.slice(2); | ||
try { | ||
if (args.includes('--watch')) { | ||
const extCtx = await context({ | ||
...extensionConfig | ||
}); | ||
await extCtx.watch(); | ||
await extCtx.dispose(); | ||
const webCtx = await context({ | ||
...webviewConfig | ||
}); | ||
await webCtx.watch(); | ||
await webCtx.dispose(); | ||
console.log('[watch] build finished'); | ||
} else { | ||
// Build extension and webview code | ||
await build(extensionConfig); | ||
await build(webviewConfig); | ||
console.log('build complete'); | ||
} | ||
} catch (err) { | ||
process.stderr.write(err.stderr); | ||
process.exit(1); | ||
} | ||
})(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.