Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add storybooks and refactor UI #7

Merged
merged 23 commits into from
Jul 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ endif
.PHONY: npm
npm:
# Run the NPM commands from the UI folder.
cd ${GOPATH}/src/app/ui && npm run $(ARGS)
cd ${GOPATH}/src/app/ui && npm $(ARGS)

.PHONY: api-dep
api-dep:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/tutorial/env-prep.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You should install [NodeJS and npm](https://nodejs.org/).
These are the current versions on the front-end components:

- Mithril [v2.0.4](https://github.com/MithrilJS/mithril.js/releases/tag/v2.0.4) - [docs](https://mithril.js.org/)
- Bulma [v0.8.1](https://www.npmjs.com/package/bulma/v/0.8.1) - [docs](https://bulma.io/documentation/)
- Bulma [v0.8.2](https://www.npmjs.com/package/bulma/v/0.8.2) - [docs](https://bulma.io/documentation/)

## Visual Studio Code (VSCode) Setup

Expand Down
5 changes: 3 additions & 2 deletions src/app/api/cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ func main() {
config.LoadRoutes(core)

// Start the web server.
l.Printf("Server started.")
err := http.ListenAndServe(fmt.Sprintf(":%v", settings.Port), config.Middleware(core))
socket := fmt.Sprintf(":%v", settings.Port)
l.Printf("Server started on %v", socket)
err := http.ListenAndServe(socket, config.Middleware(core))
if err != nil {
l.Printf(err.Error())
}
Expand Down
25 changes: 25 additions & 0 deletions src/app/ui/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
const path = require('path');
const rootWebpack = require('../webpack.config.js');

module.exports = {
stories: ['../src/**/*.stories.js'],
addons: [
Expand All @@ -6,4 +9,26 @@ module.exports = {
'@storybook/addon-knobs/register',
'@storybook/addon-a11y/register',
],
webpackFinal: (config) => {
return {
...config,
plugins: [
...config.plugins,
...rootWebpack.plugins,
],
resolve: {
alias: {
...config.resolve.alias,
...rootWebpack.resolve.alias,
},
},
module: {
...config.module,
rules: [
...config.module.rules,
...rootWebpack.module.rules,
]
}
};
},
};
23 changes: 23 additions & 0 deletions src/app/ui/jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"target": "es5",
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"baseUrl": "./",
"checkJs": false,
"paths": {
"@/*": [
"src/*"
],
"~/*": [
"*"
],
},
},
"include": [
"src/**/*",
".storybook/**/*",
"test/**/*",
"node_modules/cypress/**/*",
]
}
Loading