Skip to content

Commit

Permalink
chore(template): sync with ahmadnassri/template-node-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnassri committed Sep 3, 2023
1 parent d5edfa2 commit 91ebb45
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ node_modules
.editorconfig
.github
.pandoc.yml
.semantic.json
.release.json
colophon.yml
docker-compose.yml
Makefile
Expand Down
39 changes: 39 additions & 0 deletions .release.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "conventionalcommits",
"releaseRules": [
{ "breaking": true, "release": "major" },
{ "revert": true, "release": "patch" },
{ "type": "build", "release": "patch" },
{ "type": "docs", "release": "patch" },
{ "type": "feat", "release": "minor" },
{ "type": "fix", "release": "patch" },
{ "type": "perf", "release": "patch" },
{ "type": "refactor", "release": "patch" }
]
}],
["@semantic-release/release-notes-generator", {
"preset": "conventionalcommits",
"presetConfig": {
"types": [
{ "type": "chore", "section": "Chores", "hidden": true },
{ "type": "build", "section": "Build", "hidden": false },
{ "type": "ci", "section": "CI/CD", "hidden": false },
{ "type": "docs", "section": "Docs", "hidden": false },
{ "type": "feat", "section": "Features", "hidden": false },
{ "type": "fix", "section": "Bug Fixes", "hidden": false },
{ "type": "perf", "section": "Performance", "hidden": false },
{ "type": "refactor", "section": "Refactor", "hidden": false },
{ "type": "style", "section": "Code Style", "hidden": false },
{ "type": "test", "section": "Tests", "hidden": false }
]
}
}],
["@semantic-release/github", {
"successComment": false,
"failComment": false
}],
"@semantic-release/npm"
]
}
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,25 @@ NPMRC := $(shell npm config get userconfig)
pull: ## pull latest containers
@docker compose pull

readme: ## pull latest containers
readme: ## generate root README.md
@docker compose run --rm readme

lint: ## run super-linter
@docker compose run --rm lint

install: ## install all dependencies
@docker compose run --rm -e NPM_TOKEN=$(NPM_TOKEN) -e GITHUB_TOKEN=$(GITHUB_TOKEN) -v $(NPMRC):/root/.npmrc app install
@docker compose run --rm app install

test: ## run all npm tests
@docker compose --profile test up
@docker compose run --rm app test

shell: ## start the container shell
@docker compose run --rm --entrypoint /bin/sh app

clean: ## remove running containers, volumes, node_modules & anything else
@docker compose rm --force -v
@docker compose --profile test down
@rm -rf node_modules coverage .nyc_output
clean: ## delete containers, images, volumes, node_modules
@docker compose run --rm --entrypoint "rm -rf node_modules" app
@docker compose rm --stop --force --volumes
@docker compose down --remove-orphans --volumes --rmi local

# Utility methods
## Help: https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
Expand All @@ -38,4 +38,4 @@ help: ## display this help
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

.DEFAULT_GOAL := help
.PHONY: help all clean test coverage
.PHONY: help all clean test
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ services:
profiles: ["app"]
image: node:latest
working_dir: /usr/src/lib
entrypoint: npm --no-update-notifier --no-fund --no-audit
command: start
entrypoint: npm
tty: true
volumes:
- ./:/usr/src/lib
environment:
NODE_ENV: test
NPM_CONFIG_UPDATE_NOTIFIER: false
NPM_CONFIG_FUND: false
NPM_CONFIG_AUDIT: false

test-command:
extends: app
Expand Down

0 comments on commit 91ebb45

Please sign in to comment.