Skip to content

Commit

Permalink
chore: switch to yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
tsnolan23 committed Jun 4, 2019
1 parent 4ea2451 commit c55f23c
Show file tree
Hide file tree
Showing 10 changed files with 8,331 additions and 33,087 deletions.
7 changes: 2 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
/node_modules
/packages/fragment-chat/node_modules
/packages/fragment-common/node_modules
/packages/fragment-contacts/node_modules
/packages/fragment-header/node_modules
node_modules
public
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,31 +16,31 @@ Tailor also injects a RequireJS bundle to your template so you're able to use We

## Fragments

Fragments are small applications.
Fragments are small applications.

They might be React applications, or any other implementation.

Fragments do not need to necessarily render something.
Fragments do not need to necessarily render something.

This app consists basically in a couple of fragments:

- fragment-common
- fragment-header
- fragment-contacts
- fragment-chat
- fragment-common
- fragment-header
- fragment-contacts
- fragment-chat

Each fragment contains it's own `webpack.config.js` that specifies how to build it.

## Sharing dependencies with `fragment-common`

Fragments have several cross-dependencies that need to be shared:

- `react`
- `react-dom`
- `prop-types`
- `classnames`
- `proppy`
- `proppy-react`
- `react`
- `react-dom`
- `prop-types`
- `classnames`
- `proppy`
- `proppy-react`

In order to handle this, there is one fragment called `fragment-common`.

Expand All @@ -61,26 +61,25 @@ The dependency management is handled with RequireJS on runtime.
## Setting up

1. Clone this repository using `git clone https://github.com/armand1m/mosaic-tailor-react-example.git`
1. Install all of the base dependencies with `npm install`
1. Install all of the fragment dependencies with `npm run install-fragment-dependencies`
1. Build the fragments with `npm run build-fragments`
1. Install all of the project dependencies with `yarn install`
1. Build the fragments with `yarn run build:fragments`

## Running

1. In one terminal, start the fragments servers with `npm run start-fragments`
1. In another terminal, start the Tailor service with `npm start`
1. In one terminal, start the fragments servers with `yarn run start:fragments`
1. In another terminal, start the Tailor service with `yarn start`
1. Navigate to `http://localhost:8080`

## Running in development mode

1. In one terminal, start the fragments watchers with `npm run watch-fragments`
1. In another terminal, start the fragments servers with `npm run start-fragments`
1. In another terminal, start the Tailor service with `npm start`
1. In one terminal, start the fragments watchers with `yarn run watch:fragments`
1. In another terminal, start the fragments servers with `yarn run start:fragments`
1. In another terminal, start the Tailor service with `yarn start`
1. Navigate to `http://localhost:8080`

## References

- [Mosaic9](https://mosaic9.org)
- [Tailor Repository](https://github.com/zalando/tailor)
- [The Recipe For Scalable Frontends (Zalando)](https://www.youtube.com/watch?v=m32EdvitXy4)
- [Slides](https://www.slideshare.net/Codemotion/dan-persa-maximilian-fellner-the-recipe-for-scalable-frontends-codemotion-milan-2017)
- [Mosaic9](https://mosaic9.org)
- [Tailor Repository](https://github.com/zalando/tailor)
- [The Recipe For Scalable Frontends (Zalando)](https://www.youtube.com/watch?v=m32EdvitXy4)
- [Slides](https://www.slideshare.net/Codemotion/dan-persa-maximilian-fellner-the-recipe-for-scalable-frontends-codemotion-milan-2017)
3 changes: 2 additions & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"lerna": "2.5.1",
"packages": [
"packages/*"
],
"npmClient": "yarn",
"useWorkspaces": true,
"version": "0.0.0"
}
Loading

0 comments on commit c55f23c

Please sign in to comment.