-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9f976c1
commit ac51bcf
Showing
3 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters