Skip to content

Commit 64909e3

Browse files
authored
Merge pull request #492 from kinvolk/plugin-improvements
Plugin improvements
2 parents ee2c62b + f001470 commit 64909e3

File tree

11 files changed

+370
-15
lines changed

11 files changed

+370
-15
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ frontend-test:
7272
cd frontend && npm run test -- --coverage
7373

7474
plugins-test:
75-
cd plugins/headlamp-plugin && npm install && ./test-headlamp-plugin.sh
75+
cd plugins/headlamp-plugin && npm install && ./test-headlamp-plugin.sh
76+
cd plugins/headlamp-plugin && ./test-plugins-examples.sh
7677

7778
image:
7879
$(DOCKER_CMD) build \

plugins/examples/pod-counter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"build": "headlamp-plugin build",
1010
"format": "headlamp-plugin format",
1111
"lint": "headlamp-plugin lint",
12-
"tsc": "tsc"
12+
"tsc": "tsc --noEmit"
1313
},
1414
"keywords": [
1515
"headlamp",

plugins/examples/sidebar/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "sidebar",
33
"version": "0.0.1",
4-
"description": "Your Headlamp plugin",
4+
"description": "Example plugin showing how to add a sidebar menu item.",
55
"scripts": {
66
"start": "headlamp-plugin start",
77
"build": "headlamp-plugin build",
88
"format": "headlamp-plugin format",
99
"lint": "headlamp-plugin lint",
1010
"lint-fix": "headlamp-plugin lint --fix",
11-
"tsc": "tsc"
11+
"tsc": "tsc --noEmit"
1212
},
1313
"keywords": [
1414
"headlamp",

plugins/headlamp-plugin/bin/headlamp-plugin.js

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,14 @@ function format(packageFolder) {
324324
function lint(packageFolder, fix) {
325325
try {
326326
const extra = fix ? ' --fix' : '';
327-
child_process.execSync('eslint -c package.json --ext .js,.ts,.tsx src/' + extra, {
328-
stdio: 'inherit',
329-
cwd: packageFolder,
330-
encoding: 'utf8',
331-
});
327+
child_process.execSync(
328+
'eslint -c package.json --max-warnings 0 --ext .js,.ts,.tsx src/' + extra,
329+
{
330+
stdio: 'inherit',
331+
cwd: packageFolder,
332+
encoding: 'utf8',
333+
}
334+
);
332335
} catch (e) {
333336
console.error(`Problem running eslint inside of "${packageFolder}"`);
334337
return 1;

plugins/headlamp-plugin/config/webpack.config.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ module.exports = {
4646
},
4747
module: {
4848
rules: [
49+
{
50+
test: /\.css$/i,
51+
use: ['style-loader', 'css-loader'],
52+
},
4953
{
5054
test: /\.(js|jsx|ts|tsx)$/,
5155
exclude: /node_modules/,
@@ -68,12 +72,9 @@ module.exports = {
6872
{
6973
loader: require.resolve('url-loader'),
7074
options: {
71-
limit: false,
75+
limit: 9999999999999,
7276
},
7377
},
74-
{
75-
loader: require.resolve('file-loader'),
76-
},
7778
],
7879
},
7980
],

0 commit comments

Comments
 (0)