Project manager enabling users to keep data clean and organized, ensuring only one directory for code is needed.
npm i awspm -g
npm i awspm --location=global
Run below command to either start a new project or change to an existing one.
pm i
* Running above command will delete all files in current directory
Go to this website and follow the steps to create a token. Make sure:
- Your token has Full access to repos
- Your token has Admin access to repo hooks
- You have copied the token
* If using a GitHub fine-grained token, you must make sure any organization you work under explicitly allows them.
Run below command and follow the steps:
pm config
* Please understand if you choose to be in an org any new project will be under that org.
Whenever you find that there are still some repetitive commands you have to run whenever opening a specific project (Ex: npm i
or npm run start:test
), consider adding on start commands.
pm c -r
pm config --repo
* Each command must be seperated by a semicolon ;
Sometimes we may need multiple profiles and an easy way to switch across them. (Ex: Multiple GitHub accs, working with multiple orgs, or working with one org)
pm c -a
pm config --add
Once you have multiple profiles we need a quick an easy way to switch between all of them.
pm c -p
pm config --profiles
If any troubleshooting doesn't seem to work you may need to update your config files.
If you made any local templates or have any sensitive data back up your files... the config is found ~/.awspm
pm config --reset
* When resetting config files, you will also lose any local templates and profiles... please only do this as a last step
To push changes to a git repo run the command:
pm git
pm g
If you would like to only commit specific files answer no to
Would you like to these push changes to remote repo project-manager?
This is where the AWSPM really starts to show off. There are 3 default templates for everyone. Of the three there are currently three different types of templates... Git Clone, Git Template, and Git Boilerplate.
pm add
pm a
Boilerplate templates are templates that have the capability to replace variables within the code, allowing these templates to compliment your own existing code and increasing reusability.
A boilerplate JSON file must have...
- at least one question.
- a special variables key. A Variables key will be the substring that
awspm
looks for when substituting code out.
When done it should look something like this
{
"variables": "({})",
"questions": [
{
"type": "input",
"title": "What is your name?",
"line": 9,
"file": "root.yaml",
"name": "s3_templates"
}
]
}
All that's left is importing that file into your config files by using the below command and selecting Git Boilerplate
pm add --template
pm a -t
The variables key is extremely important so take your time deciding on one... whenever you've decided on one make sure to replace every spot where you would like to import user boilerplate code as the key.
A question is the basis of Boilerplate templates, as it tells awspm
where and what to put code.
When done it should look something like this
The different types of questions you can use are:
- git:
- Fetches data from git
- repos (Ex: git:repos)
- Returns a list of Repos
- file>
- Returns all saved user file templates
- yaml (Ex: file>yaml)
- Converts JSON to YAML
- Basic
- Input
- Asks for user input
- Password
- Masks user input
- Input
The title is the question you want to ask, when a user is asked this question.
Somethings to note about a line:
- A line denotes where awspm should look for the special variables key.
- A line should be an integer when dealing with only one line of code.
- A line should be a string seperated by commas when multiple. (Ex:
'3,7'
)
The file key tells awspm which file to look for and where to replace the code, this key is denoted by the root directory inside the Repo (Ex: 'src/app.js'
)
* This currently only supports one file at a time... has plans to convert to string || array
type
This is a unique backend key that tells awspm which key it is reffering to
When all is said and done each question should look a little like this.
{
"type": "input",
"title": "What is the name of this app?",
"line": "9,15",
"file": "app.js",
"name": "app_name"
}
These show up in Boilerplate Projects making it possible to import your own Boilerplate into a Boilerplate project all the time.
Current Supported File Templates:
- JSON
- Boilerplate Stored as JSON
- Yaml
- Converts JSON to YAML
* Currently the project only allows for JSON to yaml.
pm add --file
pm a -f
This one's pretty simple, just create a JSON file that when switched to YAML format will look good.
Code templates are your default templates only to get a project up and running instead of to compliment an already existing one.
* We're in need of more templates so if you want your own added just send in a pr!
To make sure a project is loaded at a specific folder depth, add the depth
tag with the depth you would like
pm i -d {depth}
pm init --depth {depth}