-
Notifications
You must be signed in to change notification settings - Fork 0
/
create-monorepo.zsh
executable file
·65 lines (50 loc) · 1.6 KB
/
create-monorepo.zsh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/zsh
SCRIPT_DIR=$(dirname "$0")
source $SCRIPT_DIR/utility/colors.zsh
# Get options for creating a new Repo on Github and converting it to a Monorepo
# N.B. sourcing this script means:
# its variables are available throughout the rest of this script
# the path to reference further scripts is relative to the /steps dir
source $SCRIPT_DIR/steps/0_get_options.zsh
# Create a new remote repository and clone it locally
# ***************************************************
gh repo create $REPO_NAME \
--add-readme \
--private \
--clone \
--description $REPO_DESCRIPTION \
--gitignore "Node" \
--license "MIT"
# Change working Directory into new repo
# **************************************
cd $REPO_NAME
# Add nvmrc
# *********
# example of calling a script with named parameter
zsh $SCRIPT_DIR/1_add_nvmrc.zsh --node-version $NODE_VERSION
# Add npmrc
# *********
# sourcing a script so the variables are all available
source $SCRIPT_DIR/2_add_npmrc.zsh
# Initiate yarn
# *************
source $SCRIPT_DIR/3_run_yarn_init.zsh
# Add workspaces to package.json
# ******************************
zsh $SCRIPT_DIR/4_add_workspaces_key.zsh
# Install and initialize lerna
# ****************************
zsh $SCRIPT_DIR/5_run_lerna_init.zsh
# Add publish config to lerna
# ***************************
source $SCRIPT_DIR/6_add_lerna_publish_config.zsh
# Add packages
# ************
source $SCRIPT_DIR/7_add_packages.zsh
# Add apps
# ********
source $SCRIPT_DIR/8_add_apps.zsh
# Remove git sub-modules
source $SCRIPT_DIR/9_remove_git_sub_modules.zsh
# Post run notice
source $SCRIPT_DIR/10_post_run_notice.zsh