Skip to content

Commit 7977ef6

Browse files
committed
Initial monorepo structure
1 parent 37b809f commit 7977ef6

File tree

12 files changed

+36
-8
lines changed

12 files changed

+36
-8
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
/Godeps/_workspace/src/github.com/openshift/console
88
/frontend/.cache-loader
99
/frontend/__coverage__
10+
/frontend/**/node_modules
1011
/frontend/public/bower_components
11-
/frontend/node_modules
1212
/frontend/public/dist
1313
/frontend/npm-debug.log
1414
/frontend/yarn-error.log

clean-frontend.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/usr/bin/env bash
22

3-
rm -rf frontend/node_modules
3+
find frontend -type d -name 'node_modules' -prune -exec rm -rf {} \;
44
rm -rf frontend/public/dist

frontend/.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ __coverage__
33
public/dist
44
*.min.js
55
public/lib
6-
node_modules
6+
**/node_modules
77
Godeps

frontend/package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
"repository": "https://github.com/openshift/console",
44
"license": "Apache-2.0",
55
"private": true,
6+
"workspaces": [
7+
"packages/*"
8+
],
69
"scripts": {
7-
"dev": "rm -rf ./public/dist/ && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode development --watch --progress",
10+
"dev": "rm -rf ./public/dist && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode development --watch --progress",
811
"build": "rm -rf ./public/dist && NODE_ENV=production ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode=production",
912
"coverage": "jest --coverage .",
1013
"lint": "eslint --ext .js,.jsx,.ts,.tsx --color .",
@@ -51,7 +54,9 @@
5154
],
5255
"collectCoverageFrom": [
5356
"public/*.{js,jsx,ts,tsx}",
54-
"public/{components,module,ui}/**/*.{js,jsx,ts,tsx}"
57+
"public/{components,module,ui}/**/*.{js,jsx,ts,tsx}",
58+
"packages/*/src/**/*.{js,jsx,ts,tsx}",
59+
"!**/node_modules/**"
5560
]
5661
},
5762
"dependencies": {

frontend/packages/.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../public/.eslintrc
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "@console/app",
3+
"version": "0.0.0-fixed",
4+
"description": "Console web application",
5+
"private": true,
6+
"main": "src/index.ts",
7+
"dependencies": {
8+
"@console/shared": "0.0.0-fixed"
9+
}
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
import '../../../public/components/app';
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "@console/shared",
3+
"version": "0.0.0-fixed",
4+
"description": "Console code shared between all packages",
5+
"private": true,
6+
"main": "src/index.ts",
7+
"scripts": {
8+
"test": "yarn --cwd ../.. run test packages/console-shared"
9+
}
10+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default {};

frontend/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"exclude": [
1717
".yarn",
18-
"node_modules",
18+
"**/node_modules",
1919
"public/dist"
2020
],
2121
"include": [

frontend/webpack.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const extractCSS = new MiniCssExtractPlugin({filename: 'app-bundle.css'});
1515
const config: webpack.Configuration = {
1616
entry: [
1717
'./polyfills.js',
18-
'./public/components/app.jsx',
18+
'@console/app',
1919
],
2020
output: {
2121
path: path.resolve(__dirname, 'public/dist'),

link-check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

33
# We basically only check anchors that start with https:// to avoid false positives
4-
URLS=$(git grep 'href="https://[^"]*"' -- 'frontend/public/*' | grep -o 'https://[^"]*"' | sed s'/.$//' | sort | uniq)
4+
URLS=$(git grep 'href="https://[^"]*"' -- 'frontend/public/*' 'frontend/packages/*' | grep -o 'https://[^"]*"' | sed s'/.$//' | sort | uniq)
55

66
for url in $URLS; do
77
curl -f -o /dev/null --silent "$url"

0 commit comments

Comments
 (0)