-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
143 lines (113 loc) · 2.75 KB
/
Makefile
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#
# ___ _ ___ _
# | _ \__ _ _______ __ _____ _ _ __| | / __|___ _ _ ___ _ _ __ _| |_ ___ _ _
# | _/ _` (_-<_-< V V / _ \ '_/ _` | | (_ / -_) ' \/ -_) '_/ _` | _/ _ \ '_|
# |_| \__,_/__/__/\_/\_/\___/_| \__,_| \___\___|_||_\___|_| \__,_|\__\___/_|
#
# Password Generator
# https://password-generator.pro/
#
# Copyright (c) Sebastien Rousseau 2022 - 2023. All rights reserved
# Licensed under the MIT license
#
.DEFAULT_GOAL := help
#
# Build tasks
#
# @HELP Install.
install:
@echo
@echo "Installing..."
install-deps
# @HELP Install npx dependencies.
install-deps:
@echo
@echo "Installing npx dependencies..."
npx ci
# @HELP npx check updates.
update-deps:
@echo
@echo "Checking npx updates..."
npx npm-check-updates -u
# @HELP Build.
build:
@echo
@echo "Building..."
rm -rf dist
npx run build
# @HELP Publish.
publish:
@echo
@echo "Publishing password-generator..."
npx publish
#
# Node Module
#
# @HELP node_modules.
node_modules: package.json
@npm install
#
# Run tasks
#
# @HELP Run directory clean.
run: run-base64 run-strong run-memorable
# @HELP Run base64 password-generator.
run-base64:
@echo
@echo "Running an example of a base64 password-generator..."
npx node . -t base64 -l 8 -i 4 -s -
# @HELP Run strong password-generator.
run-strong:
@echo
@echo "Running an example of a strong password-generator..."
npx node . -t strong -l 8 -i 4 -s -
# @HELP Run base64 password-generator.
run-memorable:
@echo
@echo "Running an example of a memorable password-generator..."
npx node . -t memorable -i 4 -s -
#
# Clean up tasks
#
# @HELP Run directory clean.
clean: clean-node clean-cov
# @HELP Run node_modules clean.
clean-node:
@rm -rf node_modules
# @HELP Run coverage coverage.
clean-cov:
@rm -rf coverage
#
# Testing tasks
#
# @HELP Unit test.
test:
@echo
@echo "Checking Unit tests..."
npx c8 mocha
# @HELP Unit test coverage.
coverage:
@echo
@echo "Checking Test Coverage..."
npx c8 mocha \"test/*.js\" \"./test/**/*.js\"
# @HELP Run eslint.
lint:
@echo
@echo "Running eslint..."
npx eslint .
# @HELP Display the help menu.
help:
@ echo
@ echo ' Usage:'
@ echo ''
@ echo ' make <target> [flags...]'
@ echo ''
@ echo ' Targets:'
@ echo ''
@ awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?:/{ print " ", $$1, comment }' $(MAKEFILE_LIST) | column -t -s ':' | sort
@ echo ''
@ echo ' Flags:'
@ echo ''
@ awk '/^#/{ comment = substr($$0,3) } comment && /^[a-zA-Z][a-zA-Z0-9_-]+ ?\?=/{ print " ", $$1, $$2, comment }' $(MAKEFILE_LIST) | column -t -s '?=' | sort
@ echo ''
.PHONY: clean, clean-cov, clean-node, coverage, help, install, install-deps, lint, node_modules, publish, run, run-base64, run-memorable, run-strong, test, update-deps