Skip to content

Commit

Permalink
Set up the Galaxy frontend's stack (#433)
Browse files Browse the repository at this point in the history
* Setup webpacker for typescript

* Typescript is working

* Add documentation to set up the Galaxy project and start contributing to it

* Add Storybook

* Add Jest

* Remove tuistenv from the .gitignore

* Run rubocop
  • Loading branch information
Pedro Piñera Buendía committed Jul 3, 2019
1 parent 5657230 commit f584917
Show file tree
Hide file tree
Showing 52 changed files with 22,078 additions and 444 deletions.
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ jobs:
bundle exec rails db:schema:load
bundle exec rake test
- run:
name: Javascript tests
command: |
yarn test
galaxy-deploy:
docker:
- image: buildpack-deps:trusty
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ Carthage/Checkouts
*.profraw
tuist.zip
build/
tuistenv
TODO
TODO.md
mkmf.log
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"files.exclude": {
"**/.git*": true,
"**/.git": true,
"**/node_modules": true,
"**/.DS_Store": true
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/tuistenv/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Foundation
import TuistEnvKit

var registry = CommandRegistry()
registry.run()
3 changes: 2 additions & 1 deletion docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.docz
.docz
yarn-error.log
43 changes: 43 additions & 0 deletions docs/contribution/2-galaxy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
name: Galaxy
menu: Contributors
---

# Galaxy

Galaxy is a [Rails](https://rubyonrails.org/) application that exposes a [GraphQL API](https://graphql.org/learn/) that is consumed by a [React](https://reactjs.org/) frontend that is bundled and served by Rails using [Webpacker](https://github.com/rails/webpacker).

## Set up for development

- Git clone the repository: `git clone git@github.com:tuist/tuist.git`.
- Install [Postgress](https://www.postgresql.org/download/macosx/).
- Choose the galaxy directory: `cd galaxy`.
- Install Bundler dependencies: `bundle install`.
- Install NPM dependencies: `yarn install`.
- Run: `rails start`.

## Running tests

- Rails unit tests: `rails test`.
- Frontend tests: `yarn test`.

## Storybook

The project has [Storybook](https://storybook.js.org/) configured, a Javascript tool to create a catalogue for the project components. The catalogue entries are called stories, and they are defined in the directory `stories/`.

To run the catalogue, just run the command `yarn storybook` in your terminal. That'll transpile the catalogue and open the browser with it.

## Useful commands

- `rails db:drop`: Deletes the database.
- `rails db:create`: Creates the database.
- `rails db:migrate`: Migrates the database structure.

## Useful resources

- [Rails](https://rubyonrails.org/)
- [Styled components](https://www.styled-components.com/)
- [Relay](https://relay.dev/)
- [GraphQL](https://graphql.org/learn/)
- [React](https://reactjs.org/)
- [Webpacker](https://github.com/rails/webpacker)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions docs/doczrc.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import doczPluginNetlify from "docz-plugin-netlify";
import doczPluginNetlify from 'docz-plugin-netlify'

export default {
title: 'Tuist Documentation',
Expand Down Expand Up @@ -27,15 +27,15 @@ export default {
width: 100,
},
styles: {
"body": `
body: `
font-family: -apple-system, system-ui, "Helvetica Neue", Helvetica, Arial, Verdana, sans-serif;
`,
code: `
font-size: 13px;
font-family: Menlo, Consolas, Monaco, "Courier New", monospace, serif;
background-color: white;
`
}
`,
},
},
public: './public',
htmlContext: {
Expand Down Expand Up @@ -66,6 +66,7 @@ export default {
name: 'Contributors',
menu: [
'Getting started',
'Galaxy',
'Code of conduct',
'Changelog guidelines',
'Core team',
Expand Down
4 changes: 1 addition & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"devDependencies": {
"react-hot-loader": "^4.9.0"
},
"devDependencies": {},
"scripts": {
"docz:dev": "docz dev",
"docz:build": "docz build"
Expand Down

0 comments on commit f584917

Please sign in to comment.