Skip to content

Commit

Permalink
readme and change org
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestofreyreg committed Nov 23, 2020
1 parent 9f976c1 commit ac51bcf
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 1 deletion.
19 changes: 19 additions & 0 deletions .scripts/change-org.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import replaceInFiles from 'replace-in-files'
import arg from 'arg'

const args = arg({
'--from': String,
'--to': String
})

if (args['--from'] && args['--to']) {
replaceInFiles({
files: ['.'],
from: new RegExp(args['--from'], 'g'),
to: args['--to']
}).then(() => {
console.log(`Changed all references of ${args['--from']} to ${args['--to']}`)
})
} else {
console.log('Usage: change-org --from @outsrc --to @yourcompany')
}
89 changes: 89 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
# monorepo

This is a Frontend monorepo template for NextJS applications.

Supports:

- Create application / shared module
- Shared TypeScript / ESLint / Prettier configs
- Global and per Application Storybook
- Global and per Application Start / Stop
- Global and per Application / Shared Module Tests

## Start

```
$ yarn
$ yarn test
$ yarn start
$ open http://localhost:3000/template
```

## To create new Application / Shared Module

```
$ yarn generate
```

And follow the prompts

## Storybook

Global Storybook

```
$ yarn storybook
```

Local Application Storybook

```
$ yarn workspace @outsrc/template storybook
```

## Tests

Run all tests

```
$ yarn test
```

Run Application / Shared Module only tests

```
$ yarn workspace @outsrc/template test
$ yarn workspace @outsrc/functions test
```

## Running Applications

To run all applications on SSG mode (no dev mode)

```
$ yarn start
```

To run all applications using dev mode for some

```
$ yarn start --dev template
```

_(You can now make changes to the @outsrc/template application and see changes hot reloading on the browser)_

To stop all applications

```
$ yarn stop
```

## Change repository organization.

If you want to make this repo yours start by using the `change-org` script.

```
$ yarn change-org --from @outsrc --to @yourcompany
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"lint": "eslint --ext .ts,.tsx,.js packages",
"generate": "plop --plopfile .plop/plopfile.ts",
"start": "ts-node -P tsconfig.json .scripts/start.ts",
"stop": "ts-node -P tsconfig.json .scripts/stop.ts"
"stop": "ts-node -P tsconfig.json .scripts/stop.ts",
"change-org": "ts-node -P tsconfig.json .scripts/change-org.ts"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit ac51bcf

Please sign in to comment.