generator-lens-ext's People
generator-lens-ext's Issues
Validate publisher field make sure user follows @<pub_name>/<name> convention
Good suggestion by @Nokel81
Document how to use generator in lens/doc
and fire PR to lens main repo.
Update to support lens 5
Add "appPreferences" to generator template
Include Jest mocking configs in the generator template
We need to include Jest mocks of electron
, .scss
in this template. Otherwise tests will throw errors after importing modules from @k8slens/extensions
. Related to lensapp/lens#1387
Generated package.json does not include a lint script
This is a new issue from lensapp/lens#1215 (comment) in the generator repo.
Your generator also doesn't lint anything by default, even though it installs eslint! These are the generated scripts:
"scripts": {
"start": "webpack --watch",
"build": "npm run clean && webpack",
"clean": "rm -rf ./dist",
"test": "jest"
},
You should add this:
"lint": "eslint"
and then change "test" to this:
"test": "yarn lint && jest"
Add "Cluster Features" example usage to generator template
Generator does not provide dev build out of the box
Making a new issue from lensapp/lens#1215 (comment) on the generator repo.
This is what it outputs today (I just installed it and ran it) for the Webpack.config.js
file:
/* eslint @typescript-eslint/no-var-requires: "off" */
const path = require("path");
module.exports = [
{
entry: "./main.ts",
context: __dirname,
target: "electron-main",
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
externals: [
{
"@k8slens/extensions": "var global.LensExtensions",
"mobx": "var global.Mobx",
"react": "var global.React"
}
],
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
output: {
libraryTarget: "commonjs2",
filename: "main.js",
path: path.resolve(__dirname, "dist"),
},
},
{
entry: "./renderer.tsx",
context: __dirname,
target: "electron-renderer",
mode: "production",
module: {
rules: [
{
test: /\.tsx?$/,
use: "ts-loader",
exclude: /node_modules/,
},
],
},
externals: [
{
"@k8slens/extensions": "var global.LensExtensions",
"react": "var global.React",
"mobx": "var global.Mobx"
}
],
resolve: {
extensions: [".tsx", ".ts", ".js"],
},
output: {
libraryTarget: "commonjs2",
globalObject: "this",
filename: "renderer.js",
path: path.resolve(__dirname, "dist"),
},
node: {
__dirname: false,
__filename: false
}
},
];
There are only production build configurations in there. So right out of the box, there are no dev tools used, all the code is minified, no source maps. In other words, no debugging (or at least, no sane debugging with breakpoints and code you can read).
I think all you would need to add is this to your generator:
// in BOTH main and renderer entry configs, REPLACE this:
mode: "production",
// with this:
mode: process.env.NODE_ENV || 'production',
devtool: process.env.NODE_ENV !== 'production' ? 'eval-source-map' : undefined,
Then you can run NODE_ENV=development yarn start
to start a watch on a development build with source maps and all the things you need to start debugging in DevTools right away.
Actually, you should just change the generated package.json's start
script to be this and make it even easier on your extension developers:
start: "NODE_ENV=development webpack --watch"
Add "Store" basic usage to generator
Symlink on Windows
symlink only works on linux/mac at this moment https://github.com/lensapp/generator-lens-ext/blob/main/generators/app/symlink.js#L9
Add extension testing examples
Add "kubeObjectDetailItems" to generator template
Include dependencies for writing extension tests
We need to include test setup, like babel.config.js
and dependencies
including jest
/ts-jest
/"@testing-library/react
for extension developer to write unit tests.
Update generator template due to upstream Lens API PageRegistration / PageMenuRegistration changes
Related to lensapp/lens#1386
Add "kubeObjectMenuItems" to generator template
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.