Skip to content
Snippets Groups Projects
Verified Commit ec6230c9 authored by Volker Schukai's avatar Volker Schukai :alien:
Browse files

chore: reorganize structure

parent 56f174e7
Branches
Tags
No related merge requests found
Showing
with 0 additions and 1026 deletions
#############################################################################################
#############################################################################################
##
## SERVER BOB
##
#############################################################################################
#############################################################################################
ifeq ($(BOB_BIN),)
$(error $(ERRORMARKER) Bob is not defined, check your Makefile if bob.mk is included)
endif
ifndef BOB_HTML_TEMPLATES_PATH
$(error $(ERRORMARKER) BOB_HTML_TEMPLATES_PATH is not defined, check your Makefile if bob.mk is included)
endif
ifndef BOB_DIST_PATH
$(error $(ERRORMARKER) BOB_DIST_PATH is not defined, check your Makefile if bob.mk is included)
endif
ifndef SOURCE_PATH
$(error $(ERRORMARKER) SOURCE_PATH is not defined, check your Makefile if bob.mk is included)
endif
$(BOB_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
$(QUIET) $(WGET) -O $(BOB_BIN) http://download.schukai.com/tools/bob/bob-$(shell uname -s | tr [:upper:] [:lower:])-$(shell echo `uname -m | sed s/aarch64/arm64/ | sed s/x86_64/amd64/`)
$(QUIET) $(CHMOD) u+x $(BOB_BIN)
.PHONY: sync-pages
## Sync structure of pages
sync-pages: $(BOB_BIN)
ifeq ($(BOB_SYNC_CONFIG),)
$(ECHOMARKER) "BOB_SYNC_CONFIG is not set, check your Makefile if the variable is set"
endif
$(ECHOMARKER) "Sync structure of pages"
$(QUIET) $(BOB_BIN) html sync --specification $(BOB_SYNC_CONFIG)
$(BOB_HTML_TEMPLATES_PATH):
$(ECHOMARKER) "Create template directory for bob"
$(QUIET) $(MKDIR) -p $(BOB_HTML_TEMPLATES_PATH)
$(BOB_DIST_PATH):
$(ECHOMARKER) "Create dist directory for bob"
$(QUIET) $(MKDIR) -p $(BOB_DIST_PATH)
.PHONY: generate-html
## Build the project with Bob
generate-html: $(BOB_BIN) $(BOB_HTML_TEMPLATES_PATH) $(BOB_DIST_PATH)
$(ECHOMARKER) "Generate html"
$(QUIET) $(BOB_BIN) html generate --input $(BOB_HTML_TEMPLATES_PATH) --output $(BOB_DIST_PATH)
.PHONY: prepare-template
## Prepare template with Bob
prepare-template: $(BOB_BIN) $(BOB_HTML_TEMPLATES_PATH)
$(ECHOMARKER) "Generate templates"
$(QUIET) $(BOB_BIN) template prepare --input $(BOB_SOURCE_PATH) --output $(BOB_HTML_TEMPLATES_PATH) --data-file=$(BOB_DATA_FILE)
.PHONY: init-template
## Init templates if not exist with Bob
init-template: $(BOB_BIN) $(BOB_HTML_TEMPLATES_PATH)
$(ECHOMARKER) "Generate templates"
$(QUIET) $(BOB_BIN) template prepare --input $(BOB_SOURCE_PATH) --output $(BOB_HTML_TEMPLATES_PATH) --data-file=en.yaml
#############################################################################################
#############################################################################################
##
## SERVER CADDY
##
#############################################################################################
#############################################################################################
CADDY_VENDOR_PATH ?= $(VENDOR_PATH)caddy/
CADDY_BIN ?= $(CADDY_VENDOR_PATH)caddy
CADDY_CONFIG ?= $(CADDY_VENDOR_PATH)caddy.conf
CADDY_PIDFILE ?= $(shell mktemp -d)/caddy.pid
$(CADDY_BIN):
$(QUIET) $(MKDIR) -p $(CADDY_VENDOR_PATH)
$(QUIET) $(WGET) -O $(CADDY_BIN) "https://caddyserver.com/api/download?os=linux&arch=amd64&idempotency=75143981108035"
$(QUIET) $(CHMOD) u+x $(CADDY_BIN)
.PHONY: run-caddy
## run caddy webserver
run-caddy: $(CADDY_BIN)
$(ECHOMARKER) "Run Caddy"
$(QUIET) $(CADDY_BIN) run -config $(CADDY_CONFIG) -pidfile $(CADDY_PIDFILE) -watch
#############################################################################################
#############################################################################################
##
## SERVER CONAN
##
#############################################################################################
#############################################################################################
ifeq ($(CONAN_BIN),)
$(error $(ERRORMARKER) Conan is not defined, check your Makefile if conan.mk is included)
endif
.PHONY: run-conan
## run conan webserver
run-conan: $(CONAN_BIN) $(CONAN_CONFIG)
$(ECHOMARKER) "Run Conan"
$(QUIET) $(CONAN_BIN) server serve --config $(CONAN_CONFIG)
#############################################################################################
#############################################################################################
##
## DEPLOY TOOLS
##
#############################################################################################
#############################################################################################
UPLOAD_TOOL_URL ?= s3://download.schukai.com/tools/$(COMPONENT_SLUG)/
.PHONY: deploy
## compile and deploy to S3
deploy: compile
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) find $(BUILD_PATH) -iname $(COMPONENT_SLUG)-* -exec $(AWS) s3 cp {} $(UPLOAD_TOOL_URL) \;
.PHONY: overview-to-s3
## overview-to-s3
overview-to-s3:
$(ECHOMARKER) "Deploy to aws"
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.html $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.css $(UPLOAD_TOOL_URL)
$(QUIET) AWS_PROFILE=$(AWS_PROFILE) $(AWS) s3 cp $(WEB_PATH)/index.js $(UPLOAD_TOOL_URL)
#############################################################################################
#############################################################################################
##
## DOCMAN-TARGETS
##
#############################################################################################
#############################################################################################
ifeq ($(DOCMAN_BIN),)
$(error "$(DOCMAN_BIN) is not installed. Please check your makefile and include the docman.mk")
endif
$(DOCMAN_HTML_ARTEFACT): $(DOCMAN_BIN) $(DOCMAN_SOURCE)
$(ECHOMARKER) "Build HTML Documentation"
$(QUIET) $(DOCMAN_BIN) document html --config $(DOCMAN_CONFIG_PATH)
$(DOCMAN_PDF_ARTEFACT): $(DOCMAN_BIN) $(DOCMAN_SOURCE)
$(ECHOMARKER) "Build PDF Documentation"
$(QUIET) $(DOCMAN_BIN) document pdf --config $(DOCMAN_CONFIG_PATH)
.PHONY: build-doc-pdf
## creating the documentation in pdf format
build-doc-pdf: $(DOCMAN_PDF_ARTEFACT)
.PHONY: build-doc-html
## creating the documentation in html format
build-doc-html: $(DOCMAN_HTML_ARTEFACT)
.PHONY: build-doc
## creating the documentation in pdf and html format
build-doc: build-doc-pdf build-doc-html
#############################################################################################
#############################################################################################
##
## GIT-TARGETS
##
#############################################################################################
#############################################################################################
ifeq ($(GIT),)
$(error $(ERRORMARKER) Git is not defined, check your Makefile if git.mk is included)
endif
## Current Branch-GIT_TAG
GIT_TAG := -
## Git Commit GIT_MESSAGE for git-push
GIT_MESSAGE := current status
.PHONY: git-branch
## create new branch (use GIT_TAG-Variable)
git-branch:
$(QUIET) export BRANCH="b$(GIT_TAG)/$(shell uuidgen --random)" ; \
$(QUIET) $(GIT) checkout -b $${BRANCH} && \
RESULT=$$($(GIT) push origin $$BRANCH 2>&1) && \
RESULT2=$$($(GIT) branch --set-upstream-to=origin/$$BRANCH $$BRANCH) && \
GITLABURL=$$(echo "$$RESULT" | tr '\n' '\#' | grep -o 'remote\:\s*https:\/\/gitlab\.schukai\.com[^ ]*' | cut -d " " -f2-9 | sed -e 's/^[ \t]*//') && \
if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $$GITLABURL ; fi
.PHONY: git-to-master
## git checkout master, fetch and merge
git-to-master:
$(QUIET) $(GIT) checkout master && $(GIT) fetch -pP && $(GIT) merge
.PHONY: git-push-to-server
## git push changes to server
git-push-to-server:
$(QUIET) $(GIT) add -A
$(QUIET) $(GIT) commit -m"$(GIT_MESSAGE)"
$(QUIET) $(GIT) push
.PHONY: git-push
## git create branch and push changes to server
git-push: git-branch git-push-to-server
.PHONY: git-tag
## git create version tag
git-tag:
$(QUIET) $(GIT) tag -a "$(COMPONENT_VERSION)" -m "release $(COMPONENT_VERSION)"
.PHONY: git-prune-remote
## removes your local remote tracking branches where the branch no longer exists on the remote
git-prune-remote:
$(QUIET) $(GIT) remote prune origin
.PHONY: git-prune-local
## deletes local merged branches except the master branch
git-prune-local:
$(QUIET) $(GIT) branch --merged master | grep -v '^[ *]*master$$' | xargs git branch -d
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## BUILD GO
##
#############################################################################################
#############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
GO_RELEASE_PACKAGE_NAME ?= main
.PHONY: compile
## Compiling for every OS and Platform
compile: next-patch-version
$(ECHOMARKER) "Compiling for every OS and Platform"
$(ECHO) "Version: $(PROJECT_VERSION)"
$(ECHO) "Build: $(PROJECT_BUILD_DATE)"
$(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)/go-compile.sh $(SOURCE_PATH) $(BUILD_PATH) $(COMPONENT_SLUG) $(GO_RELEASE_PACKAGE_NAME) $(PROJECT_VERSION) $(PROJECT_BUILD_DATE)
.PHONY: go-lint
## Lint the files
go-lint:
$(QUIET) $(GOLINT) -set_exit_status ${PKG_LIST}
.PHONY: go-test
## Run unittests
go-test:
$(QUIET) $(GO) test -short ${PKG_LIST}
.PHONY: go-race
## Run data race detector
go-race: go-dep
$(QUIET) $(GO) test -race -short ${PKG_LIST}
.PHONY: go-msan
## Run memory sanitizer
go-msan: go-dep
$(QUIET) $(GO) test -msan -short ${PKG_LIST}
.PHONY: go-coverage
## Generate global code coverage report
go-coverage:
$(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)/go-coverage.sh $(SOURCE_PATH) $(DEVELOPMENT_PATH)/report ;
.PHONY: go-cover-html
## Generate global code coverage report in HTML
go-cover-html:
$(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)/go-coverage.sh $(SOURCE_PATH) $(DEVELOPMENT_PATH)/report html;
.PHONY: go-dep
## Get the dependencies
go-dep:
$(QUIET) cd $(SOURCE_PATH); $(GO) get -v -d ./... ; cd -;
#############################################################################################
#############################################################################################
##
## GET LICENSES
##
#############################################################################################
#############################################################################################
ifeq ($(GO),)
$(error $(ERRORMARKER) Go is not defined, check your Makefile if go.mk is included)
endif
GO_MOD_FILE := $(SOURCE_PATH)go.mod
GO_LICENSES_BIN := $(shell command -v go-licenses)
ifeq ($(GO_LICENSES_BIN),)
$(shell $(GO) install github.com/google/go-licenses@latest)
GO_LICENSES_BIN := $(shell command -v go-licenses 2> /dev/null)
EXECUTABLES = $(EXECUTABLES:-) go-licenses;
endif
ifeq ($(shell test -e $(GO_MOD_FILE) && echo -n yes),yes)
GO_CURRENT_MODULE := $(shell cat $(GO_MOD_FILE) | head -n1 | cut -d" " -f2)
endif
.PHONY: go-fetch-licenses
## Fetch licenses for all modules
go-fetch-licenses:
ifeq ($(GO_CURRENT_MODULE),)
$(QUIET) $(ECHOERRORMARKER) "no go.mod file found, skipping fetching licenses"
else
$(ECHOMARKER) "Fetch licenses"
$(QUIET) cd $(SOURCE_PATH); $(GO_LICENSES_BIN) save $(GO_CURRENT_MODULE) $(PKG_LIST) --force --save_path $(DOCUMENTATION_PATH)licenses/ ; cd -
endif
#############################################################################################
#############################################################################################
##
## HELP-TARGETS
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.DEFAULT_GOAL := help
.PHONY: print
## Print Path
print:
$(ECHO) "THIS_MAKEFILE: $(THIS_MAKEFILE)"
$(ECHO) "THIS_MAKEFILE_PATH: $(THIS_MAKEFILE_PATH)"
$(ECHO) "PROJECT_ROOT: $(PROJECT_ROOT)"
# Add a comment to the public targets so that it appears
# in this help Use two # characters for a help comment
.PHONY: help
help:
@printf "${COMMENT}Usage:${RESET}\n"
@printf " make [target] [arg=\"val\"...]\n\n"
@printf "${COMMENT}Available targets:${RESET}\n"
@awk '/^[a-zA-Z\-\\_0-9\.@]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${INFO}%-22s${RESET} %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@printf "\n${COMMENT}Available arguments:${RESET}\n\n"
@awk '/^(([a-zA-Z\-\\_0-9\.@]+)\s[?:]?=)/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${INFO}%-22s${RESET} %s (Default: %s)\n", $$1, helpMessage, $$3; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
#############################################################################################
#############################################################################################
##
## INIT-STANDARD
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-go-lib
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init go lib project
init-go-lib: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-go-lib"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## INIT-STANDARD
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-go-utilities
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES), $(shell $(MKDIR) -p $(path)))
## init go utilities project
init-go-utilities: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-go-utilities"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## INIT-WEBCOMPONENTS
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-platform-part
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init standard project
init-platform-part: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)package.json $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-webapp"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## BUILD PACKAGE JSON
##
#############################################################################################
#############################################################################################
define PLATFORM_PARTS_BUILD_PACKAGE_CONTENT
{
"name": "@alvine/$(COMPONENT_SLUG)",
"version": "0.1.0",
"description": "$(COMPONENT_NAME)",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/alvine/application/platform-apps/parts/$(COMPONENT_SLUG).git"
},
"scripts": {
"build-and-publish": "script/build-and-publish.sh",
"semantic-release": "semantic-release",
"build": "vite --config ./vite.config.js build",
"preview": "vite --config ./vite.config.js preview",
"dev": "vite --config ./vite.config.js"
},
"type": "module",
"author": "schukai GmbH",
"license": "see LICENSE file",
"dependencies": {
"@schukai/component-form": "^3.3.1",
"@schukai/component-notify": "^2.3.0",
"@schukai/component-state": "^2.3.0",
"@schukai/component-style": "^0.28.0",
"@schukai/monster": "^3.12.1"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.1",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/gitlab": "^10.1.4",
"@semantic-release/npm": "^9.0.2",
"@vitejs/plugin-basic-ssl": "^1.0.1",
"autoprefixer": "^10.4.13",
"btoa": "^1.2.1",
"c8": "^7.12.0",
"chai": "^4.3.7",
"chai-dom": "^1.11.0",
"clean-jsdoc-theme": "^4.2.6",
"cli-real-favicon": "^0.0.8",
"create-polyfill-service-url": "^2.2.6",
"crypt": "^0.0.2",
"cssnano": "^5.1.14",
"esbuild": "^0.17.8",
"flow-bin": "^0.199.1",
"fs": "^0.0.1-security",
"glob": "^8.1.0",
"graphviz": "^0.0.9",
"jsdoc": "^4.0.0",
"jsdoc-external-example": "github:volker-schukai/jsdoc-external-example",
"jsdom": "^21.1.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.2.0",
"npm-check-updates": "^16.7.4",
"postcss": "^8.4.21",
"postcss-color-mod-function": "^3.0.3",
"postcss-fluid": "^1.4.2",
"postcss-for": "^2.1.1",
"postcss-import": "^15.1.0",
"postcss-mixins": "^9.0.4",
"postcss-nesting": "^11.2.0",
"postcss-normalize": "^10.0.1",
"postcss-responsive-type": "^1.0.0",
"postcss-strip-units": "^2.0.1",
"process": "^0.11.10",
"semantic-release": "^20.1.0",
"sinon": "^15.0.1",
"svgo": "^3.0.2",
"url": "^0.11.0",
"url-exist": "3.0.1",
"util": "^0.12.5",
"vite": "^4.1.1",
"vite-plugin-banner": "^0.7.0",
"vite-plugin-list-directory-contents": "^1.4.5",
"vite-plugin-minify": "^1.5.2",
"vite-plugin-mkcert": "^1.13.0",
"vite-plugin-mpa": "^1.1.4"
}
}
endef
export PLATFORM_PARTS_BUILD_PACKAGE_CONTENT
$(PROJECT_ROOT)package.json:
$(QUIET) $(ECHO) "$$PLATFORM_PARTS_BUILD_PACKAGE_CONTENT" >> $@
######
#############################################################################################
#############################################################################################
##
## INIT-STANDARD
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-standard
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init standard project
init-standard: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-standard"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## INIT-WEBCOMPONENTS
##
#############################################################################################
#############################################################################################
# @see .PHONY https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html#Phony-Targets
.PHONY: init-webcomponent
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
$(PROJECT_DIRECTORIES):
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
## init standard project
init-webcomponent: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(DEVELOPMENT_PATH)package.json $(APPLICATION_PATH)package.json $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE $(APPLICATION_PATH)LICENSE
$(ECHOMARKER) "Run init-webcomponent"
$(ECHO) "Done"
#############################################################################################
#############################################################################################
##
## LICENSE
##
#############################################################################################
#############################################################################################
export LICENSE_FILE_CONTENT
$(LICENSE_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@
export LICENSE_AGPL_FILE_CONTENT
$(APPLICATION_PATH)LICENSE:
$(QUIET) $(ECHO) "$$LICENSE_AGPL_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
export README_FILE_CONTENT
$(PROJECT_ROOT)README.md:
$(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## PACKAGE JSON
##
#############################################################################################
#############################################################################################
define WEBCOMPONENTS_PACKAGE_CONTENT
{
"name": "component-$(COMPONENT_SLUG)",
"version": "0.1.0",
"description": "component $(COMPONENT_NAME)",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG).git"
},
"keywords": [
"web",
"dom",
"css",
"mobile-first",
"app",
"front-end",
"ui",
"form",
"templates",
"schukai",
"component",
"web-component",
"monster"
],
"dependencies": {
"@popperjs/core": "^2.11.6",
"@schukai/component-style": "^0.27.1",
"@schukai/monster": "^3.10.1"
},
"main": "source/component.mjs",
"module": "source/component.mjs",
"type": "module",
"homepage": "https://monsterjs.org/",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG).git"
},
"author": "schukai GmbH",
"license": "AGPL 3.0"
}
endef
export WEBCOMPONENTS_PACKAGE_CONTENT
$(APPLICATION_PATH)package.json:
$(QUIET) $(ECHO) "$$WEBCOMPONENTS_PACKAGE_CONTENT" >> $@
#############################################################################################
#############################################################################################
##
## BUILD PACKAGE JSON
##
#############################################################################################
#############################################################################################
define WEBCOMPONENTS_BUILD_PACKAGE_CONTENT
{
"name": "component-$(COMPONENT_SLUG)",
"version": "0.1.0",
"description": "component $(COMPONENT_NAME)",
"repository": {
"type": "git",
"url": "https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG).git"
},
"scripts": {
"test": "npx mocha --recursive test/cases/",
"web-test": "script/web-test.sh",
"publish": "script/release-and-publish.sh",
"build-doc": "script/build-doc.sh",
"build-style": "node script/build-stylesheets.cjs ."
},
"type": "module",
"author": "schukai GmbH",
"license": "see LICENSE file",
"dependencies": {
"@popperjs/core": "^2.11.6",
"@schukai/component-style": "^0.27.1",
"@schukai/monster": "^3.10.1"
},
"devDependencies": {
"@oss/web-components-build-tools": "^1.2.8",
"@peculiar/webcrypto": "^1.4.1",
"autoprefixer": "^10.4.13",
"browserslist": "^4.21.5",
"btoa": "^1.2.1",
"c8": "^7.12.0",
"chai": "^4.3.7",
"chai-dom": "^1.11.0",
"clean-jsdoc-theme": "^4.2.3",
"create-polyfill-service-url": "^2.2.6",
"crypt": "^0.0.2",
"cssnano": "^5.1.14",
"esbuild": "^0.17.5",
"flow-bin": "^0.199.1",
"fs": "0.0.1-security",
"glob": "^8.1.0",
"graphviz": "^0.0.9",
"jsdoc": "^4.0.0",
"jsdoc-external-example": "github:volker-schukai/jsdoc-external-example",
"jsdoc-plantuml": "^1.0.2",
"jsdom": "^21.1.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.2.0",
"node-plantuml": "^0.9.0",
"postcss": "^8.4.21",
"postcss-fluid": "^1.4.2",
"postcss-for": "^2.1.1",
"postcss-import": "^15.1.0",
"postcss-load-config": "^4.0.1",
"postcss-mixins": "^9.0.4",
"postcss-nested": "^6.0.0",
"postcss-nesting": "^11.1.0",
"postcss-normalize": "^10.0.1",
"postcss-responsive-type": "^1.0.0",
"postcss-rtlcss": "^4.0.1",
"postcss-strip-units": "^2.0.1",
"rome": "^11.0.0",
"sinon": "^15.0.1",
"url": "^0.11.0",
"url-exist": "3.0.1",
"util": "^0.12.5",
"vite": "^4.1.1",
"vite-plugin-banner": "^0.7.0",
"vite-plugin-list-directory-contents": "^1.4.5",
"vite-plugin-minify": "^1.5.2",
"vite-plugin-mkcert": "^1.12.0"
}
}
endef
export WEBCOMPONENTS_BUILD_PACKAGE_CONTENT
$(DEVELOPMENT_PATH)package.json:
$(QUIET) $(ECHO) "$$WEBCOMPONENTS_BUILD_PACKAGE_CONTENT" >> $@
######
#############################################################################################
#############################################################################################
##
## JEKYLL-TARGETS
##
#############################################################################################
#############################################################################################
JEKYLL_VERSION := snapshot
JEKYLL_BIN := $(ALVINE_VENDOR_PATH)jekyll-$(JEKYLL_VERSION).phar
JEKYLL_PUBKEY := $(JEKYLL_BIN).pubkey
$(JEKYLL_PUBKEY):
$(MKDIR) -p $(ALVINE_VENDOR_PATH)
$(WGET) -O $(JEKYLL_PUBKEY) http://download.alvine.io/phar/jekyll-$(JEKYLL_VERSION).phar.pubkey
$(JEKYLL_BIN): $(JEKYLL_PUBKEY)
$(MKDIR) -p $(ALVINE_VENDOR_PATH)
$(WGET) -O $(JEKYLL_BIN) http://download.alvine.io/phar/jekyll-$(JEKYLL_VERSION).phar
$(CHMOD) u+x $(JEKYLL_BIN)
.PHONY: run-jekyll
## run jekyll
run-jekyll: init $(JEKYLL_BIN) $(JEKYLL_PUBKEY) $(TEMP_PATH)jekyll.lock
$(ECHOMARKER) "Jekyll finished"
.PHONY: run-jekyll-force
## run jekyll (-f)
run-jekyll-force: init $(JEKYLL_BIN) $(JEKYLL_PUBKEY)
$(RM) $(TEMP_PATH)jekyll.lock
$(MAKE) run-jekyll
$(ECHOMARKER) "Jekyll finished"
$(TEMP_PATH)jekyll.lock: $(THIS_DIR).jekyll
$(ECHOMARKER) "Run Jekyll"
$(JEKYLL_BIN) fetch --force
$(JEKYLL_BIN) update
touch $(TEMP_PATH)jekyll.lock
\ No newline at end of file
#############################################################################################
#############################################################################################
##
## JSDOC-TARGETS
##
#############################################################################################
#############################################################################################
ifndef DOCUMENTATION_S3_PATH
$(error $(ERRORMARKER) DOCUMENTATION_S3_PATH is not defined, check your Makefile if jsdoc.mk is included)
endif
ifndef FIXBROKENPLANTUML
$(error $(ERRORMARKER) FIXBROKENPLANTUML is not defined, check your Makefile if jsdoc.mk is included)
endif
.PHONY: jsdoc-build
## generate js api docs
jsdoc-build: $(DOCUMENTATION_CONFIG_PATH)jsdoc.json $(FIXBROKENPLANTUML).fixed
$(ECHOMARKER) "create api doc"
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run build-doc
$(FIXBROKENPLANTUML).fixed:
$(ECHOMARKER) "fix broken plantuml"
$(QUIET) chmod u+x $(FIXBROKENPLANTUML)
$(QUIET) $(NODE) $(FIXBROKENPLANTUML)
$(QUIET) $(TOUCH) $(FIXBROKENPLANTUML).fixed
.PHONY: jsdoc-to-s3
## transfer doc to s3
jsdoc-to-s3: jsdoc-build
$(ECHOMARKER) "transfer doc to s3"
$(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(BUILD_PATH)docs $(DOCUMENTATION_S3_PATH)
#############################################################################################
#############################################################################################
##
## BUILD NODE
##
#############################################################################################
#############################################################################################
SPONGE ?= sponge
EXECUTABLES = $(EXECUTABLES:-) $(SPONGE);
.PHONY: node-create-polyfill
## create polyfill.io url
node-create-polyfill: $(MJS_RELATIVE_SOURCE_FILES) $(NODE_PACKAGES)
$(ECHOMARKER) "create and replace polyfill"
$(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)create-polyfill.sh $(MJS_RELATIVE_SOURCE_FILES)
.PHONY: node-build
## Build Node Components
node-build: $(NODE_MODULES_MODIFIED) $(NODE_PACKAGES)
$(ECHOMARKER) "Building Node Components"
$(ECHO) "Version: $(PROJECT_VERSION)"
$(ECHO) "Source Path: $(SOURCE_PATH)"
$(QUIET) $(JQ) '.version = "$(PROJECT_VERSION)"' $(PACKAGE_JSON) | $(SPONGE) $(PACKAGE_JSON)
$(QUIET) for p in $(NODE_PACKAGES); do $(JQ) '.version = "$(PROJECT_VERSION)"' $${p} | $(SPONGE) $${p}; done
$(QUIET) $(SCRIPTS_PATH)update-version.sh
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run --if-present build
#############################################################################################
#############################################################################################
##
## RUN PLAYGROUND
##
#############################################################################################
#############################################################################################
.PHONY: node-run-playground
## run playground (vite)
node-run-playground:
$(ECHOMARKER) "run playground"
$(QUIET) cd $(DEVELOPMENT_PATH)playground; npx vite;
#############################################################################################
#############################################################################################
##
## BUILD NODE
##
#############################################################################################
#############################################################################################
.PHONY: node-test
## Test JS Components
node-test: $(NODE_MODULES_MODIFIED)
$(ECHOMARKER) "Test Node Components"
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run test
.PHONY: node-web-test
## Test JS Components
node-web-test: $(NODE_MODULES_MODIFIED)
$(ECHOMARKER) "Test Node Components"
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run web-test
#############################################################################################
#############################################################################################
##
## NPM
##
#############################################################################################
#############################################################################################
.PHONY: npm-publish-major
## release major version of package
npm-publish-major:
$(ECHOMARKER) "release major version"
$(QUIET) $(MAKE) tag-major-version
$(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
.PHONY: npm-publish-minor
## release minor version of package
npm-publish-minor:
$(ECHOMARKER) "release minor version"
$(QUIET) $(MAKE) tag-minor-version
$(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
.PHONY: npm-publish-patch
## release patch version of package
npm-publish-patch:
$(ECHOMARKER) "release patch version"
$(QUIET) $(MAKE) tag-patch-version
$(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment