README
Create Func App
A tool to quickly set up a collaborative workspace of an azure function project with eslint, jest, gitlab-ci, lintstaged and prettier.
Motivation
When setting up a new workspace for azure functions I tended to use vscode for the azure function app template and then copy existing configuration files to enable eslint and prettier over and over again. It took time to figure out which dependencies are needed again and how the configuration files need to be adapted. Therefore I evaluated against https://xkcd.com/1205/ and concluded that this tool will save time in the future when writing azure function app projects.
Usage
npx create-func-app my-app
cd my-app
npm start
Contents
The tool will use the azure function core tools to setup a new workspace initially. It then adds all necessary dependencies for
- eslint
- prettier
- jest
- lint-staged
to setup a collaborative workspace. It also adds an initial gitlab-ci configuration to configure install
, test
and build
stages in the gitlab-ci pipeline.
Available scripts are:
- build -
tsc
- build:production -
npm run prestart && npm prune --production
- watch -
tsc --w
- prestart -
npm run build && func extensions install
- start:host -
func start
- start -
npm-run-all --parallel start:host watch
- test -
jest
- lint:fix -
eslint '*/**/*.{js,ts}' --quiet --fix
- lint -
eslint '*/**/*.{js,ts}'
- prettier -
prettier --write .
- download-settings -
func azure functionapp fetch-app-settings FUNCTIONAPP_NAME && func settings decrypt
- upload-settings -
func azure functionapp publish FUNCTIONAPP_NAME --publish-local-settings
Every configuration is just setup initially as an example. They can be modified.