Skip to content

Commit

Permalink
#39 add makefile with utility targets
Browse files Browse the repository at this point in the history
- generate audit reports (requires at least node 10)
- basic targets to build and serve the theme
  • Loading branch information
cbeyer42 committed Oct 20, 2023
1 parent 57f86e2 commit ee5d9cb
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ jspm_packages
# Intellij
.idea/*
*.iml
tmp
41 changes: 41 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
.DEFAULT_GOAL:=build

.PHONY: gen-audit
gen-audit: gen-audit-severity gen-audit-prod

.PHONY: result-dir
result-dir:
@mkdir -p tmp

.PHONY: gen-audit-prod
gen-audit-prod: result-dir
@mkdir -p target
@-npm audit --json --prod 1> target/audit_prod.json

.PHONY: gen-audit-dev
gen-audit-dev: result-dir
@mkdir -p target
@-npm audit --json --dev 1> target/audit_dev.json

.PHONY: gen-audit-severity-all
gen-audit-severity-all: gen-audit-dev
@cat target/audit_dev.json | jq '.advisories | with_entries(select(.value.severity == "low"))' 1> target/audit_dev_low.json
@cat target/audit_dev.json | jq '.advisories | with_entries(select(.value.severity == "moderate"))' 1> target/audit_dev_moderate.json
@cat target/audit_dev.json | jq '.advisories | with_entries(select(.value.severity == "high"))' 1> target/audit_dev_high.json
@cat target/audit_dev.json | jq '.advisories | with_entries(select(.value.severity == "critical"))' 1> target/audit_dev_critical.json

.PHONY: build
build: install
gulp

.PHONY: serve
serve: install
gulp serve

.PHONY: install
install:
npm install -g gulp bower
npm install
bower install
npm rebuild node-sass
npm rebuild sharp
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@ Theme for CES WebApplications, based on Twitter Bootstrap.
* Install the following:
- Install [git](https://git-scm.com)
- Install [Node Version Manager](https://github.com/nvm-sh/nvm)
* You need to use Node 9
* `nvm install 9 && nvm use 9`
* You need to use Node 10
* `nvm install 10 && nvm use 10`
* Then install gulp and bower globally with `npm install -g gulp bower`
* Clone the repository
* Install local dependencies inside the repository, if necessary:
- On Windows install the following: [Windows-Build-Tools](https://github.com/felixrieseberg/windows-build-tools)
* Build
```
npm install
bower install
make
```
* Start development server with `gulp serve`
* Build with `gulp`
* Start development server with `make serve`
* Build with `make`

### Troubleshooting
> * If `gulp` exits with a file not found error try deleting the `node_modules` directory and reinstall the dependencies with `npm install`.
> * If `gulp serve` does not run correctly, and the error is in one of the included node-modules, then a rebuild of the package in question may help
(`npm rebuild <node-module>`).
> * possible candidates are node-sass and sharp
>
## Usage
* npm or bower
Expand Down

0 comments on commit ee5d9cb

Please sign in to comment.