Skip to content

Commit

Permalink
Use Webview to manage cluster settings
Browse files Browse the repository at this point in the history
Fixes jlandersen#88

Signed-off-by: azerr <[email protected]>
  • Loading branch information
angelozerr committed Jul 2, 2021
1 parent 632c49f commit eefcfe2
Show file tree
Hide file tree
Showing 13 changed files with 5,450 additions and 345 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.DS_Store
out/
dist/
pages/

.vscode-test/

Expand Down
32 changes: 32 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# How to Contribute

Contributions are essential for keeping this extension great. We try to keep it as easy as possible to contribute changes and we are open to suggestions for making it even easier. There are only a few guidelines that we need contributors to follow.

## Development

### Installation Prerequisites:

* latest [Visual Studio Code](https://code.visualstudio.com/)
* [Node.js](https://nodejs.org/) v4.0.0 or higher

### Steps

1. Fork and clone this repository

2. `cd vscode-kafka/`

3. Install the dependencies:
```bash
$ npm install
```

4. Compile with [webpack](https://webpack.js.org/) :

```bash
$ npm run compile
```

This step is required since vscode-kafka uses [vscode-wizard](https://github.com/redhat-developer/vscode-wizard) to create / edit a cluster. [vscode-wizard](https://github.com/redhat-developer/vscode-wizard) is a NPM module which embeds some html, js, css resources in `pages` folder. As vscode-kafka is built with [webpack](https://webpack.js.org/), this pages folder must be copied from the `vscode-wizard/pages` NPM module to `vscode-kafka/pages`.

5. To run the extension, open the Debugging tab in VSCode.
6. Select and run 'Launch Extension (vscode-kafka)' at the top left.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ _Tools for Apache Kafka®_ is built using Github Actions. Here's how to download
- Unzip the archive,
- Install the vscode-kafka-*.vsix extension by following these [instructions](https://code.visualstudio.com/docs/editor/extension-gallery#_install-from-a-vsix).

## Contributing

This is an open source project open to anyone. Contributions are extremely welcome!

For information on getting started, refer to the [CONTRIBUTING instructions](CONTRIBUTING.md).
## License
MIT License. See [LICENSE](LICENSE) file.

Expand Down
69 changes: 40 additions & 29 deletions build/node-extension.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,50 @@
'use strict';

const path = require('path');
const copyWebpackPlugin = require('copy-webpack-plugin');

/**@type {import('webpack').Configuration}*/
const config = {
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')
target: 'node', // vscode extensions run in a Node.js-context 📖 -> https://webpack.js.org/configuration/node/
mode: 'none', // this leaves the source code as close as possible to the original (when packaging we set this to 'production')

entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, '..', 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2'
},
devtool: 'nosources-source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js']
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
entry: './src/extension.ts', // the entry point of this extension, 📖 -> https://webpack.js.org/configuration/entry-context/
output: {
// the bundle is stored in the 'dist' folder (check package.json), 📖 -> https://webpack.js.org/configuration/output/
path: path.resolve(__dirname, '..', 'dist'),
filename: 'extension.js',
libraryTarget: 'commonjs2'
},
devtool: 'nosources-source-map',
externals: {
vscode: 'commonjs vscode' // the vscode-module is created on-the-fly and must be excluded. Add other modules that cannot be webpack'ed, 📖 -> https://webpack.js.org/configuration/externals/
},
resolve: {
// support reading TypeScript and JavaScript files, 📖 -> https://github.com/TypeStrong/ts-loader
extensions: ['.ts', '.js'],
alias: {
'handlebars': 'handlebars/dist/handlebars.js'
}
},
module: {
rules: [
{
test: /\.ts$/,
exclude: /node_modules/,
use: [
{
loader: 'ts-loader'
}
]
}
]
}
},
plugins: [
new copyWebpackPlugin({
patterns: [
{ from: 'node_modules/@redhat-developer/vscode-wizard/pages', to: '../pages' }
]
})
]
}
};
module.exports = config;
module.exports = config;
Loading

0 comments on commit eefcfe2

Please sign in to comment.