Skip to content

Commit

Permalink
Initial monorepo structure
Browse files Browse the repository at this point in the history
  • Loading branch information
vojtechszocs committed Apr 5, 2019
1 parent 37b809f commit 7977ef6
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
/Godeps/_workspace/src/github.com/openshift/console
/frontend/.cache-loader
/frontend/__coverage__
/frontend/**/node_modules
/frontend/public/bower_components
/frontend/node_modules
/frontend/public/dist
/frontend/npm-debug.log
/frontend/yarn-error.log
Expand Down
2 changes: 1 addition & 1 deletion clean-frontend.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash

rm -rf frontend/node_modules
find frontend -type d -name 'node_modules' -prune -exec rm -rf {} \;
rm -rf frontend/public/dist
2 changes: 1 addition & 1 deletion frontend/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ __coverage__
public/dist
*.min.js
public/lib
node_modules
**/node_modules
Godeps
9 changes: 7 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
"repository": "https://github.com/openshift/console",
"license": "Apache-2.0",
"private": true,
"workspaces": [
"packages/*"
],
"scripts": {
"dev": "rm -rf ./public/dist/ && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode development --watch --progress",
"dev": "rm -rf ./public/dist && ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode development --watch --progress",
"build": "rm -rf ./public/dist && NODE_ENV=production ts-node -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/webpack --mode=production",
"coverage": "jest --coverage .",
"lint": "eslint --ext .js,.jsx,.ts,.tsx --color .",
Expand Down Expand Up @@ -51,7 +54,9 @@
],
"collectCoverageFrom": [
"public/*.{js,jsx,ts,tsx}",
"public/{components,module,ui}/**/*.{js,jsx,ts,tsx}"
"public/{components,module,ui}/**/*.{js,jsx,ts,tsx}",
"packages/*/src/**/*.{js,jsx,ts,tsx}",
"!**/node_modules/**"
]
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions frontend/packages/.eslintrc
10 changes: 10 additions & 0 deletions frontend/packages/console-app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@console/app",
"version": "0.0.0-fixed",
"description": "Console web application",
"private": true,
"main": "src/index.ts",
"dependencies": {
"@console/shared": "0.0.0-fixed"
}
}
1 change: 1 addition & 0 deletions frontend/packages/console-app/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import '../../../public/components/app';
10 changes: 10 additions & 0 deletions frontend/packages/console-shared/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "@console/shared",
"version": "0.0.0-fixed",
"description": "Console code shared between all packages",
"private": true,
"main": "src/index.ts",
"scripts": {
"test": "yarn --cwd ../.. run test packages/console-shared"
}
}
1 change: 1 addition & 0 deletions frontend/packages/console-shared/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default {};
2 changes: 1 addition & 1 deletion frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"exclude": [
".yarn",
"node_modules",
"**/node_modules",
"public/dist"
],
"include": [
Expand Down
2 changes: 1 addition & 1 deletion frontend/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const extractCSS = new MiniCssExtractPlugin({filename: 'app-bundle.css'});
const config: webpack.Configuration = {
entry: [
'./polyfills.js',
'./public/components/app.jsx',
'@console/app',
],
output: {
path: path.resolve(__dirname, 'public/dist'),
Expand Down
2 changes: 1 addition & 1 deletion link-check.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

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

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

0 comments on commit 7977ef6

Please sign in to comment.