Skip to content

Commit

Permalink
Frontend as a standalone app (#7)
Browse files Browse the repository at this point in the history
* Create a standalone frontend app

Signed-off-by: Ruben Romero Montes <[email protected]>

* Remove serviceWorker

Signed-off-by: Ruben Romero Montes <[email protected]>
  • Loading branch information
ruromero authored Nov 26, 2019
1 parent 03decca commit 86a531d
Show file tree
Hide file tree
Showing 31 changed files with 17,228 additions and 896 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
release.properties
release.properties

# Javascript
node
node_modules
build
16 changes: 16 additions & 0 deletions frontend/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "8.10"
}
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/proposal-class-properties"
]
}
31 changes: 31 additions & 0 deletions frontend/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"parser": "babel-eslint",
"env": {
"browser": true,
"jest": true,
"es6": true
},
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"settings": {
"react": { "version" : "999.999.999" }
},
"rules": {
"no-console":1,
"react/prop-types":0,
"react/no-string-refs":0
},
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"]
}
67 changes: 67 additions & 0 deletions frontend/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Copyright 2019 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// eslint-disable-next-line no-undef
module.exports = {
reporters: [
"default",
[
"jest-junit",
{
/*
* Removes spaces from test titles and makes first
* letter of each word capitalized.
*
* unit test -> UnitTest
*
* See junit.xml report for resulting look.
*/
titleTemplate: vars => {
var str = vars.title.toLowerCase();
str = str.split(" ");
for (var i = 0; i < str.length; i++) {
str[i] = str[i].charAt(0).toUpperCase() + str[i].slice(1);
}
var result = str.join("");
return result.replace(",");
},
outputDirectory: "../target/jest-junit-reports",
outputName: "TEST-org.kie.processmigration.js.tests.xml",
suiteName: "org.kie.processmigration.js.tests",
suiteNameTemplate: "{filename}",
/*
* Jenkins JUnit Plugin cares only about classname.
* It cuts its name into 2 parts:
* Part before the last period is considered as a package.
* Part after the last period is considered as a test class name.
*/
classNameTemplate: vars => {
var str = vars.filename;
str = str.slice(0, str.length - ".test.js".length);
return "org.kie.processmigration.js.tests." + str;
}
}
]
],
moduleDirectories: ["node_modules", "src"],
moduleFileExtensions: ["js", "jsx"],
testRegex: "/__tests__/.*\\.test\\.(jsx?)$",
transform: {
"^.+\\.jsx?$": "babel-jest"
},
automock: false,
setupFiles: ["./setupJest.js"]
};
Loading

0 comments on commit 86a531d

Please sign in to comment.