Skip to content

Commit

Permalink
Add structure and base config to enable converting front end to monorepo
Browse files Browse the repository at this point in the history
We have a requirement to consume the dashboard components outside of the
dashboard application. The components were developed with this in mind,
but are not currently exposed in a manner that is easily consumed.

This change prepares for this by implementing a monorepo approach using
lerna, to move the components to a separate package that can be built,
published, and consumed independently of the dashboard application.

The Breadcrumbs component is migrated to this new package to verify the
config and resolve any potential teething problems before we migrate
all of the components.
  • Loading branch information
AlanGreene authored and tekton-robot committed Aug 13, 2019
1 parent 8015294 commit 6b36ddf
Show file tree
Hide file tree
Showing 50 changed files with 7,676 additions and 4,169 deletions.
34 changes: 0 additions & 34 deletions .babelrc

This file was deleted.

2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
},
"overrides": [
{
"files": ["webpack.*.js", "config_frontend/setupTests.js", "*.stories.js"],
"files": ["webpack.*.js", "config_frontend/setupTests.js", "*.stories.js", "test.js"],
"rules": {
"import/no-extraneous-dependencies": ["error", { "devDependencies": true }]
}
Expand Down
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# compiled output
/coverage
/dist
dist/
/cmd/dashboard/kodata/
/storybook-static
/tmp
Expand All @@ -10,7 +10,7 @@ main
.npmrc

# dependencies
/node_modules
node_modules/
/vendor
/node-*

Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ USER root
WORKDIR /go/src/github.com/tektoncd/dashboard
COPY . .
RUN npm install
RUN npm run bootstrap
RUN npm run build

FROM golang:1.12-alpine as goBuilder
Expand Down
52 changes: 52 additions & 0 deletions babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*
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 = api => {
api.cache(true);

return {
presets: [
[
'@babel/preset-env',
{
corejs: '3',
useBuiltIns: 'entry'
}
],
'@babel/preset-react'
],
plugins: [
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-export-default-from',
'@babel/plugin-syntax-dynamic-import'
],
env: {
development: {
sourceMaps: true,
plugins: ['react-hot-loader/babel']
},
test: {
presets: [
[
'@babel/preset-env',
{
targets: {
node: 'current'
}
}
]
]
}
}
};
};
9 changes: 7 additions & 2 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ module.exports = {
collectCoverage: true,
collectCoverageFrom: [
'<rootDir>/src/**/*.js',
'!<rootDir>/src/**/*.stories.js'
'<rootDir>/packages/**/src/**/*.js',
'!<rootDir>/src/**/*.stories.js',
'!<rootDir>/packages/**/src/**/*.stories.js'
],
coverageReporters: ['html', 'text'],
coverageThreshold: {
Expand All @@ -32,6 +34,9 @@ module.exports = {
'\\.(css|scss)$': '<rootDir>/config_frontend/__mocks__/styleMock.js'
},
setupFilesAfterEnv: ['<rootDir>/config_frontend/setupTests.js'],
testMatch: ['<rootDir>/src/**/*.test.js'],
testMatch: [
'<rootDir>/src/**/*.test.js',
'<rootDir>/packages/**/src/**/*.test.js'
],
testPathIgnorePatterns: ['node_modules']
};
6 changes: 6 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"packages": [
"packages/*"
],
"version": "0.0.0"
}
Loading

0 comments on commit 6b36ddf

Please sign in to comment.