Skip to content

Commit

Permalink
Adding initial commit for front-end
Browse files Browse the repository at this point in the history
Note: back-end is not present yet -- It's coming next
--
In the meantime fun things to try...
1) Install node 10.x
2) npm install
3) npm run build
4) npm run lint
5) npm run storybook (Look at all those UI components...)
6) 5) npm start -- (http://localhost:8000/) (again back-end is not present yet so you'll see the T kitty with... Error loading pipelines)
  • Loading branch information
skaegi committed Apr 8, 2019
1 parent eab2f20 commit 0403714
Show file tree
Hide file tree
Showing 108 changed files with 19,643 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"presets": [
["@babel/preset-env", {
"useBuiltIns": "entry"
}],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-proposal-export-default-from"
],
"env": {
"development": {
"sourceMaps": true,
"plugins": [
"react-hot-loader/babel",
]
},
"test": {
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "current"
}
}
]
]
}
}
}
5 changes: 5 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
last 2 versions
not dead
not ie_mob 11
not op_mini all
not op_mob 46
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
max_line_length = off
trim_trailing_whitespace = false
43 changes: 43 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports = {
"parser": "babel-eslint",
"env": {
"browser": true,
"es6": true,
"jest": true,
"node": true
},
"extends": [
"airbnb",
"plugin:prettier/recommended",
"prettier/react"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
"no-template-curly-in-string": "off",
"react/jsx-filename-extension": "off",
"react/destructuring-assignment": "off",
"react/prop-types": "off",
"jsx-a11y/anchor-is-valid": "off"
},
"overrides": [
{
"files": ["webpack.*.js", "config/setupTests.js", "*.stories.js"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
}
}
]
};
19 changes: 19 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# compiled output
/coverage
/dist
/storybook-static
/tmp

# config
.npmrc

# dependencies
/node_modules

# misc
npm-debug.log
yarn-error.log

# System Files
.DS_Store
Thumbs.db
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "none"
}
33 changes: 33 additions & 0 deletions .storybook/Container.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
Copyright 2019 The Tekton Authors
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.
*/

import React from 'react';

import './Container.scss';

export default function Container({ story }) {
return (
<div
data-floating-menu-container
role="main"
style={{
padding: '3em',
display: 'flex',
flexDirection: 'column',
alignItems: 'center'
}}
>
{story()}
</div>
);
}
17 changes: 17 additions & 0 deletions .storybook/Container.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
Copyright 2019 The Tekton Authors
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.
*/

$css--font-face: true;
$css--reset: true;

@import '~carbon-components/scss/globals/scss/styles';
16 changes: 16 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
Copyright 2019 The Tekton Authors
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.
*/

import '@storybook/addon-knobs/register';
import '@storybook/addon-actions/register';
import '@storybook/addon-viewport/register';
45 changes: 45 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
Copyright 2019 The Tekton Authors
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.
*/

import React from 'react';
import { addDecorator, addParameters, configure } from '@storybook/react';
import { withKnobs } from '@storybook/addon-knobs';

import Container from './Container';

addDecorator(story => <Container story={story} />);
addDecorator(withKnobs);

addParameters({
options: {
brandTitle: 'Tekton Components',
brandUrl: 'https://github.com/tektoncd/dashboard',
isFullScreen: false,
showNav: true,
showPanel: true,
panelPosition: 'bottom',
sortStoriesByKind: false,
hierarchySeparator: /\/|\./,
hierarchyRootSeparator: /\|/,
sidebarAnimations: true,
enableShortcuts: true,
theme: undefined
},
});

function loadStories() {
const req = require.context('../src/components', true, /\.stories.js$/);
req.keys().forEach(filename => req(filename));
}

configure(loadStories, module);
26 changes: 26 additions & 0 deletions .storybook/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
Copyright 2019 The Tekton Authors
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.
*/

const path = require('path');

module.exports = async ({ config, mode }) => {
// `mode` has a value of 'DEVELOPMENT' or 'PRODUCTION'

config.module.rules.push({
test: /\.scss$/,
loaders: ['style-loader', 'css-loader', 'sass-loader'],
include: path.resolve(__dirname, '../'),
});

return config;
};
1 change: 1 addition & 0 deletions config/__mocks__/fileMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = 'test-file-stub';
1 change: 1 addition & 0 deletions config/__mocks__/styleMock.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = {};
4 changes: 4 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"API_DOMAIN": "http://localhost:31080",
"PORT": "8000"
}
5 changes: 5 additions & 0 deletions config/setupTests.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import 'react-testing-library/cleanup-after-each';
import fetchMock from 'fetch-mock';

fetchMock.catch();
fetchMock.config.overwriteRoutes = true;
36 changes: 36 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
Copyright 2019 The Tekton Authors
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.
*/

module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/**/*.js',
'!<rootDir>/src/**/*.stories.js'
],
coverageReporters: ['html', 'text'],
coverageThreshold: {
global: {
statements: 90,
branches: 90,
functions: 90,
lines: 90
}
},
moduleNameMapper: {
'\\.(png|svg|ttf|woff|woff2)$': '<rootDir>/config/__mocks__/fileMock.js',
'\\.(css|scss)$': '<rootDir>/config/__mocks__/styleMock.js'
},
setupFilesAfterEnv: ['<rootDir>/config/setupTests.js'],
testMatch: ['<rootDir>/src/**/*.test.js'],
testPathIgnorePatterns: ['node_modules']
};
Loading

0 comments on commit 0403714

Please sign in to comment.