[JENKINS-36060] add a new Maven module for the Personalization plugin, with a simple test EP component
This commit is contained in:
parent
a518aa4790
commit
f8cb23977e
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"presets": ["es2015", "stage-0", "react"]
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"extends": "@jenkins-cd/jenkins/react",
|
||||
"rules": {
|
||||
"react/jsx-no-bind": 0,
|
||||
"no-unused-vars": [2, {"varsIgnorePattern": "^React$"}],
|
||||
"max-len": [1, 160, 4]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License
|
||||
|
||||
Copyright (c) 2016 CloudBees Inc and a number of other of contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
|
@ -0,0 +1,34 @@
|
|||
//
|
||||
// See https://github.com/jenkinsci/js-builder
|
||||
//
|
||||
var builder = require('@jenkins-cd/js-builder')
|
||||
.withExternalModuleMapping('react-router', 'react:react-router');
|
||||
|
||||
//
|
||||
// Redefine the "test" task to use mocha and support es6.
|
||||
// We might build this into js-builder, but is ok here
|
||||
// for now.
|
||||
//
|
||||
builder.defineTask('test', function() {
|
||||
var mocha = require('gulp-mocha');
|
||||
var babel = require('babel-core/register');
|
||||
|
||||
// Allow running of a specific test
|
||||
// e.g. gulp test --test pipelines
|
||||
// will run the pipelines-spec.js
|
||||
var filter = builder.args.argvValue('--test', '*');
|
||||
|
||||
builder.gulp.src('src/test/js/' + filter + '-spec.js')
|
||||
.pipe(mocha({
|
||||
compilers: {js: babel}
|
||||
})).on('error', function(e) {
|
||||
if (builder.isRetest()) {
|
||||
// ignore test failures if we are running retest.
|
||||
return;
|
||||
}
|
||||
throw e;
|
||||
});
|
||||
});
|
||||
builder.gulp.task('lint:watch', function () {
|
||||
builder.gulp.watch(['src/main/js/**/*.js', 'src/main/js/**/*.jsx'], ['lint']);
|
||||
});
|
|
@ -0,0 +1,66 @@
|
|||
{
|
||||
"name": "blueocean-personalization",
|
||||
"version": "0.0.1",
|
||||
"scripts": {
|
||||
"lint": "gulp lint",
|
||||
"lint:fix": "gulp lint --fixLint",
|
||||
"lint:watch": "gulp lint:watch --continueOnLint",
|
||||
"test": "gulp test",
|
||||
"test:watch": "gulp test:watch",
|
||||
"bundle": "gulp bundle",
|
||||
"bundle:watch": "gulp bundle:watch"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@jenkins-cd/eslint-config-jenkins": "0.0.2",
|
||||
"@jenkins-cd/js-builder": "0.0.34",
|
||||
"@jenkins-cd/js-test": "1.1.1",
|
||||
"babel": "^6.5.2",
|
||||
"babel-core": "^6.7.6",
|
||||
"babel-eslint": "^6.0.2",
|
||||
"babel-preset-es2015": "^6.6.0",
|
||||
"babel-preset-react": "^6.5.0",
|
||||
"babel-preset-stage-0": "^6.5.0",
|
||||
"chai": "^3.5.0",
|
||||
"enzyme": "^2.2.0",
|
||||
"eslint": "2.8.0",
|
||||
"eslint-plugin-react": "^5.0.1",
|
||||
"gulp": "^3.9.1",
|
||||
"gulp-mocha": "^2.2.0",
|
||||
"mocha": "^2.4.5",
|
||||
"nock": "^8.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jenkins-cd/design-language": "0.0.58",
|
||||
"@jenkins-cd/js-extensions": "0.0.15",
|
||||
"@jenkins-cd/js-modules": "0.0.5",
|
||||
"@jenkins-cd/sse-gateway": "0.0.5",
|
||||
"immutable": "3.8.1",
|
||||
"isomorphic-fetch": "2.2.1",
|
||||
"keymirror": "0.1.1",
|
||||
"moment": "2.13.0",
|
||||
"moment-duration-format": "1.3.0",
|
||||
"react": "15.0.1",
|
||||
"react-dom": "15.0.1",
|
||||
"react-material-icons-blue": "1.0.4",
|
||||
"react-redux": "4.4.5",
|
||||
"react-router": "2.3.0",
|
||||
"redux": "3.5.2",
|
||||
"redux-thunk": "2.0.1",
|
||||
"reselect": "2.5.1",
|
||||
"window-handle": "1.0.0"
|
||||
},
|
||||
"jenkinscd": {
|
||||
"extDependencies": [
|
||||
"@jenkins-cd/sse-gateway",
|
||||
"immutable",
|
||||
"isomorphic-fetch",
|
||||
"react-router",
|
||||
"keymirror",
|
||||
"react-redux",
|
||||
"react-router",
|
||||
"redux",
|
||||
"redux-thunk",
|
||||
"reselect"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>blueocean-parent</artifactId>
|
||||
<groupId>io.jenkins.blueocean</groupId>
|
||||
<version>1.0-alpha-1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<name>BlueOcean :: Personalization</name>
|
||||
<artifactId>blueocean-personalization</artifactId>
|
||||
<packaging>hpi</packaging>
|
||||
|
||||
<dependencies>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
|
@ -0,0 +1,7 @@
|
|||
import React, { Component } from 'react';
|
||||
|
||||
export default class ActionLink extends Component {
|
||||
render() {
|
||||
return <div>Action!</div>;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
# Extensions in this plugin
|
||||
# NB: "component" currently maps to modules, not "symbols" so make sure to "export default"
|
||||
# WARNING: If you change this you'll have to change io.jenkins.blueocean.jsextensions.JenkinsJSExtensionsTest as well :(
|
||||
extensions:
|
||||
- component: components/ActionLink
|
||||
extensionPoint: jenkins.dashboard.item.action
|
|
@ -0,0 +1,4 @@
|
|||
<?jelly escape-by-default='true'?>
|
||||
<div>
|
||||
Blue Ocean Personalization
|
||||
</div>
|
Loading…
Reference in New Issue