diff --git a/Makefile b/Makefile index 932185900f69ebc5ab05ca826ede69d90d07fe3b..595cf33bbe0640d3672f4b5dc33cd2b786f85f26 100644 --- a/Makefile +++ b/Makefile @@ -40,13 +40,20 @@ MAKEFILE_IMPORT_PATH?=$(PROJECT_ROOT)makefiles/ ############################################################################################# include $(MAKEFILE_IMPORT_PATH)directories-standard.mk +#include $(MAKEFILE_IMPORT_PATH)directories-go-lib.mk +#include $(MAKEFILE_IMPORT_PATH)directories-go-utilities.mk +#include $(MAKEFILE_IMPORT_PATH)directories-platform-part.mk include $(MAKEFILE_IMPORT_PATH)jsdoc.mk include $(MAKEFILE_IMPORT_PATH)output.mk include $(MAKEFILE_IMPORT_PATH)placeholder.mk include $(MAKEFILE_IMPORT_PATH)conan.mk +#include $(MAKEFILE_IMPORT_PATH)bob.mk include $(MAKEFILE_IMPORT_PATH)s3.mk #include $(MAKEFILE_IMPORT_PATH)readme-standard.mk include $(MAKEFILE_IMPORT_PATH)readme-webcomponents.mk +#include $(MAKEFILE_IMPORT_PATH)readme-go-utilities.mk +#include $(MAKEFILE_IMPORT_PATH)readme-go-lib.mk +#include $(MAKEFILE_IMPORT_PATH)readme-platform-part.mk include $(MAKEFILE_IMPORT_PATH)licenses.mk include $(MAKEFILE_IMPORT_PATH)license-agpl3.mk #include $(MAKEFILE_IMPORT_PATH)license-unlicensed.mk @@ -70,18 +77,28 @@ include $(MAKEFILE_IMPORT_PATH)target-jsdoc-build.mk #include $(MAKEFILE_IMPORT_PATH)target-docman.mk #include $(MAKEFILE_IMPORT_PATH)target-caddy.mk include $(MAKEFILE_IMPORT_PATH)target-conan.mk +#include $(MAKEFILE_IMPORT_PATH)target-bob.mk +#include $(MAKEFILE_IMPORT_PATH)target-phpunit.mk +#include $(MAKEFILE_IMPORT_PATH)target-jekyll.mk include $(MAKEFILE_IMPORT_PATH)target-update-makefiles.mk include $(MAKEFILE_IMPORT_PATH)target-help.mk #include $(MAKEFILE_IMPORT_PATH)target-go-build.mk include $(MAKEFILE_IMPORT_PATH)target-node-build.mk include $(MAKEFILE_IMPORT_PATH)target-node-test.mk include $(MAKEFILE_IMPORT_PATH)target-npm-publish.mk +#include $(MAKEFILE_IMPORT_PATH)target-npm.mk include $(MAKEFILE_IMPORT_PATH)target-git.mk #include $(MAKEFILE_IMPORT_PATH)target-init-standard.mk #include $(MAKEFILE_IMPORT_PATH)target-init-webcomponent.mk +#include $(MAKEFILE_IMPORT_PATH)target-init-go-utilities.mk +#include $(MAKEFILE_IMPORT_PATH)target-init-go-lib.mk +#include $(MAKEFILE_IMPORT_PATH)target-init-platform-part.mk include $(MAKEFILE_IMPORT_PATH)target-version.mk include $(MAKEFILE_IMPORT_PATH)target-variable.mk include $(MAKEFILE_IMPORT_PATH)terminal-check.mk ############################################################################################# + +# include target-project.mk only if it exists +-include $(MAKEFILE_IMPORT_PATH)target-project.mk diff --git a/development/config/conan.cfg b/development/config/conan.cfg new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/development/makefiles/changelog.mk b/development/makefiles/changelog.mk index 8e1faf9039df98c04a2cd5ca4ba01a88af4c6ae0..c3ae83114f80b47c10e7d99bb4a8c89eefeaa334 100644 --- a/development/makefiles/changelog.mk +++ b/development/makefiles/changelog.mk @@ -17,8 +17,10 @@ endif ifeq ($(GIT_CHGLOG_BIN),) $(shell $(GO) install github.com/git-chglog/git-chglog/cmd/git-chglog@latest) + GIT_CHGLOG_BIN := $(shell command -v git-chglog 2> /dev/null) endif + ifneq ($(shell test -d $(GIT_CHGLOG_CONFIG_DIR) && echo -n yes),yes) $(shell mkdir -p $(GIT_CHGLOG_CONFIG_DIR)) endif @@ -95,7 +97,7 @@ endef export GIT_CHGLOG_CONFIG_FILE $(GIT_CHGLOG_CONFIG_DIR)/config.yml: - $(QUITE) $(ECHO) "$$GIT_CHGLOG_CONFIG_FILE" >> $@ + $(QUIET) $(ECHO) "$$GIT_CHGLOG_CONFIG_FILE" >> $@ define GIT_CHGLOG_CONFIG_TEMPLATE {{ range .Versions }} @@ -131,8 +133,8 @@ export GIT_CHGLOG_CONFIG_TEMPLATE $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md: - $(QUITE) $(ECHO) "$$GIT_CHGLOG_CONFIG_TEMPLATE" >> $@ + $(QUIET) $(ECHO) "$$GIT_CHGLOG_CONFIG_TEMPLATE" >> $@ ## location of CHANGELOG.md file CHANGELOG_FILE ?= $(PROJECT_ROOT)CHANGELOG.md -EXECUTABLES = $(EXECUTABLES:-) $(GIT_CHGLOG_BIN) \ No newline at end of file +EXECUTABLES = $(EXECUTABLES:-) $(GIT_CHGLOG_BIN) diff --git a/development/makefiles/conan.mk b/development/makefiles/conan.mk index f7707dbc9501e743477ae1a55efa26fdcb119f8d..64dacde6f1c63ff0675faa641df6f467fbf30289 100644 --- a/development/makefiles/conan.mk +++ b/development/makefiles/conan.mk @@ -47,5 +47,5 @@ endef export CONANEXAMPLECONF $(CONAN_CONFIG): - $(QUITE) $(ECHO) "$$CONANEXAMPLECONF" >> $@ + $(QUIET) $(ECHO) "$$CONANEXAMPLECONF" >> $@ diff --git a/development/makefiles/directories-standard.mk b/development/makefiles/directories-standard.mk index 177cbf2c0fb73e383943a1aa3745d82ebaee3443..7a543a85f6971ba5bcb0d8e18c33a28c1cde0be8 100644 --- a/development/makefiles/directories-standard.mk +++ b/development/makefiles/directories-standard.mk @@ -26,7 +26,8 @@ SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/ DEVELOPMENT_SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/ BUILD_PATH ?= $(DEPLOYMENT_PATH)build/ VENDOR_PATH ?= $(DEPLOYMENT_PATH)vendor/ -TEST_PATH ?= $(DEVELOPMENT_PATH)test/ +ALVINE_VENDOR_PATH ?= $(VENDOR_PATH)alvine/ +TEST_PATH ?= $(DEVELOPMENT_PATH)tests/ DEPLOYMENT_SCRIPTS_PATH ?= $(DEPLOYMENT_PATH)script/ LICENSE_PATH ?= $(PROJECT_ROOT) @@ -38,6 +39,8 @@ PROJECT_DIRECTORIES := $(PROJECT_DIRECTORIES) \ $(WEB_PATH) \ $(DEPLOYMENT_PATH) \ $(VENDOR_PATH) \ + $(ALVINE_VENDOR_PATH) \ + $(TEST_PATH) \ $(DEVELOPMENT_PATH) \ $(DEVELOPMENT_SCRIPTS_PATH) \ $(DEPLOYMENT_SCRIPTS_PATH) \ diff --git a/development/makefiles/gitignore.mk b/development/makefiles/gitignore.mk index 0dc290ddf7f72e198a3c5b630eb22e415431ece5..3ff75ff7a3b27130d09c06e0c80f05a45eaca0dd 100644 --- a/development/makefiles/gitignore.mk +++ b/development/makefiles/gitignore.mk @@ -523,8 +523,8 @@ tags endef export GITIGNOREDS -.gitignore: - $(QUITE) $(ECHO) "$$GITIGNOREDS" >> $@ +$(PROJECT_ROOT).gitignore: + $(QUIET) $(ECHO) "$$GITIGNOREDS" >> $@ diff --git a/development/makefiles/go.mk b/development/makefiles/go.mk index 00ff9478e3e0d69e4370abb88dcaca5f88185437..6cb58e936eb9de9c2d1e3a463c9f2233338c7c5f 100644 --- a/development/makefiles/go.mk +++ b/development/makefiles/go.mk @@ -14,3 +14,14 @@ EXECUTABLES = $(EXECUTABLES:-) $(GO); ifeq ($(shell command -v $(GO) 2> /dev/null),) $(error "go is not installed. Please install go <https://go.dev/doc/install>") endif + +GOPATH=$(shell go env GOPATH) + +ifeq ($(GOPATH),) + DIRS := bin pkg src + GOPATH=$(DEPLOYMENT_PATH)/go/ + $(shell mkdir -p $(GOPATH)) + $(shell $(foreach entry,$(DIRS),mkdir -p "$(GOPATH)$(entry)";)) + export PATH=$(PATH):$(GOPATH)/bin +endif + diff --git a/development/makefiles/jsdoc-json.mk b/development/makefiles/jsdoc-json.mk index 321ef66bd7850988eca489aa595f10b1f6b1c461..e5315ac4d52e02c5e908b0d8295feb4ee1339d8c 100644 --- a/development/makefiles/jsdoc-json.mk +++ b/development/makefiles/jsdoc-json.mk @@ -112,4 +112,4 @@ endef export JSDOCJSON $(DEPLOYMENT_PATH)jsdoc.json: - $(QUITE) $(ECHO) "$$JSDOCJSON" >> $@ \ No newline at end of file + $(QUIET) $(ECHO) "$$JSDOCJSON" >> $@ \ No newline at end of file diff --git a/development/makefiles/license-all-rights-reserved.mk b/development/makefiles/license-all-rights-reserved.mk index 84642719ca80e1aaa2e5f7ae2f0fbc679870eee8..ea690fc4393b20a2f36b1e1811ec3c1b73518efc 100644 --- a/development/makefiles/license-all-rights-reserved.mk +++ b/development/makefiles/license-all-rights-reserved.mk @@ -21,49 +21,32 @@ COPYRIGHT_OWNER ?= schukai GmbH COPYRIGHT_URL ?= [LICENSE](https://www.schukai.com/) define LICENSE_FILE_CONTENT -# End User Licence Agreement (EULA) - -This End User Licence Agreement ("EULA") is a legal agreement between you and schukai GmbH. - -This EULA governs your purchase and use of our software ("Software") directly from schukai GmbH or indirectly through a reseller or distributor authorized by schukai GmbH (a "Reseller"). - -Please read this EULA carefully before completing the installation process and using the software. It contains a licence to use the software, as well as warranty information and disclaimers. - -If you register for a free trial version of the software, this EULA also applies to that trial version. By clicking "Accept" or installing and/or using the software, you acknowledge that you accept the Software and agree to be bound by the terms of this EULA. - -If you are entering into this EULA on behalf of a company or other legal entity, you represent that you have the authority to bind that company and its affiliates to these terms. If you do not have such authority or do not agree to the terms of this EULA, you may not install or use the Software and you are not required to accept this EULA. - -This EULA applies only to the Software supplied by schukai GmbH herewith, whether other software is referred to or described herein. The Terms also apply to all updates, supplements, internet-based services and support services provided by schukai GmbH for the Software, unless different terms and conditions are attached to those items at the time of delivery. Where this is the case, these Terms shall apply. - -## Grant of Licence - -schukai GmbH hereby grants you a personal, non-transferable, non-exclusive licence to use the software on your Devices in accordance with the terms of this EULA. - -You are authorized to download the software onto a device (e.g. PC, laptop, mobile phone or tablet) that is under your control. You are responsible for ensuring that your device meets the minimum requirements of the software. - -**In addition, you are not permitted to:** - -* Edit, alter, modify, adapt, translate or otherwise change the Software in whole or in part, nor allow the Software to be combined with or incorporated into other software in whole or in part, nor decompile, disassemble or reverse engineer the Software or attempt to do any such things reproduce, copy, distribute, resell or otherwise use the Software for commercial purposes -* Allow any third party to use the Software on behalf of or for any third party -* Use the Software in a manner that violates any applicable local, national or international law use the Software for any purpose that, in the opinion of schukai GmbH, constitutes a breach of this EULA. - -## Intellectual Property and Proprietary Rights - -schukai GmbH shall at all times retain ownership of the Software originally downloaded by you and of any subsequent downloads of the Software by you. - -The Software (and the copyright and other intellectual property rights of any kind in the Software, including any modifications made thereto) are and shall remain the property of schukai GmbH. - -schukai GmbH reserves the right to license the use of the Software to third parties. - -## Termination - -This EULA is effective from the date you first use the Software and shall remain in effect until terminated. You may terminate it at any time by giving written notice to schukai GmbH. - -It will also terminate immediately if you fail to comply with any of the terms of this EULA. Upon such termination, the licences granted by this EULA shall immediately terminate, and you agree to cease all access to and use of the Software. The provisions that by their nature continue and survive shall survive any termination of this EULA. - -## Governing Law - -This EULA and any dispute arising out of or in connection with this EULA shall be governed by and construed in accordance with the laws of Germany. +The schukai Enterprise License (the "Enterprise License"). +Copyright © 2022 schukai GmbH. + +Regarding this Software, schukai GmbH is the licensor and you are the licensee. + +By using the Software, you agree to all the terms and conditions set forth below. + +This software and associated documentation files (the "Software") may be used in production only if you (and any company +you represent) have a valid Enterprise License corresponding to your use. Subject to the preceding sentence, you are free +to modify this Software and to release patches for the Software. You agree that schukai and/or its licensors (as applicable) +retain all right, title and interest in and to all such modifications and/or patches, and that all such modifications +and/or patches may be used, copied, modified, displayed, distributed or otherwise exploited only with a valid Enterprise +License for the appropriate use. Notwithstanding the foregoing, you may copy and modify the Software for development and +testing purposes without requiring a subscription. + +You agree that schukai and/or its licensors (if applicable) retain all right, title and interest in and to all such +modifications. No additional rights are granted to you beyond those expressly set forth herein. Subject to the foregoing, +you may not copy, merge, publish, distribute, sublicense and/or sell the Software. + +THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIMS, DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING OUT +OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE. + +For any third-party components incorporated into schukai's software, such components are licensed under the original license +provided by the owner of the applicable component. endef diff --git a/development/makefiles/project.mk b/development/makefiles/project.mk index c6183ce12ff64623f44a8ecf9fa469b306b02b18..fd40910d9e70d6412e5e9919bb62a2d649c27a7c 100644 --- a/development/makefiles/project.mk +++ b/development/makefiles/project.mk @@ -2,46 +2,3 @@ - -.PHONY: create-polyfill-monster -## create polyfill.io url -create-polyfill-monster: $(MONSTER_SOURCE_FILES) - $(ECHOMARKER) "create and replace polyfill" - $(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)create-polyfill.sh $(MJS_RELATIVE_SOURCE_FILES) - - -.PHONY: test-browser-monster -## create test-browser-monster -test-browser-monster: create-polyfill-monster - $(ECHOMARKER) "create browser test and start chrome" - $(QUIET) $(FIND) $(TEST_PATH)cases -type f | $(SED) "s|^$(TEST_PATH)cases||" > $(TEST_PATH)web/import.js - $(QUIET) $(SED) -i 's|^|import "../cases|' $(TEST_PATH)web/import.js - $(QUIET) $(SED) -i 's|$$|";|' $(TEST_PATH)web/import.js - $(QUIET) $(SED) -i "1 i import \"./prepare.js\";" $(TEST_PATH)web/import.js - $(QUIET) $(SED) -i "1 i /** this file was created automatically by the make target test-browser-monster */" $(TEST_PATH)web/import.js - $(ESBUILD) --platform=browser --sourcemap=inline --external:ws --external:jsdom --external:process --external:crypto --bundle $(TEST_PATH)web/import.js --outfile=$(TEST_PATH)web/tests.js -# $(QUIET) $(CD) $(MONSTER_BUILD_TEST_BROWSER_DIR); $(WEBPACK) ; $(CD) - -# $(QUIET) $(SED) -i -E "/<h1/s_.*_ <h1 style='margin-bottom: 0.1em;'>Monster $(PROJECT_VERSION)</h1>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html -# $(QUIET) $(SED) -i -E "/id=\"lastupdate\"/s_.*_ <div id=\"lastupdate\" style='font-size:0.7em'>last update $(shell date)</div>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html -# $(QUIET) $(SED) -i -E "s_src=\"([\"]*)\.js.*\"_src=\"\1.js?r=$(shell date +"%T")\"_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html -# $(QUIET) $(SED) -i -E "s_dist/([0-9]+\.[0-9]+\.[0-9]+)*/dist/monster_dist/$(PROJECT_VERSION)/dist/monster_" $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html -# #$(QUIET) if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $(TEST_PATH)web/test.html ; fi - - -## -> eigenes repos für monsterjs.org -#.PHONY: web-to-s3 -### transfer web to s3 -#web-to-s3: -# $(ECHOMARKER) "transfer web to s3" -# $(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(DEPLOYMENT_PATH)web/assets/ s3://monsterjs.org/assets/ -# $(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(DEPLOYMENT_PATH)web/vendor/ s3://monsterjs.org/vendor/ -# $(QUIET) $(AWS) s3 --only-show-errors cp $(DEPLOYMENT_PATH)web/index.html s3://monsterjs.org/index.html -# $(QUIET) $(AWS) s3 --only-show-errors cp $(DEPLOYMENT_PATH)web/error.html s3://monsterjs.org/error.html - - -.PHONY: doc-to-s3 -## transfer doc to s3 -doc-to-s3: jsdoc-build - $(ECHOMARKER) "transfer doc to s3" - $(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(BUILD_PATH)docs s3://monsterjs.org/en/doc/monster/ - diff --git a/development/makefiles/readme-webcomponents.mk b/development/makefiles/readme-webcomponents.mk index b80cf440c59a7148b44003ce2bd62d09488dd27c..ed89adfc431b0ca5a3877873339631c4a131a1a6 100644 --- a/development/makefiles/readme-webcomponents.mk +++ b/development/makefiles/readme-webcomponents.mk @@ -26,23 +26,15 @@ To check out docs and examples, visit [monsterjs.org/en/doc/$(COMPONENT_SLUG)/]( ## Installation -`npm install @schukai/$(COMPONENT_SLUG)`, `yarn install @schukai/$(COMPONENT_SLUG)` or `pnpm install @schukai/$(COMPONENT_SLUG)` +`npm install @schukai/component-$(COMPONENT_SLUG)`, `yarn install @schukai/component-$(COMPONENT_SLUG)` or `pnpm install @schukai/component-$(COMPONENT_SLUG)` ## Usage -A simple example of the use of functionality from Monster. We create a small file `index.mjs`. +A simple example of the use of functionality from $(COMPONENT_NAME). We create a small file `index.mjs`. The `m` in `.mjs` stands for module. In the example we want to make substitutions in a string. ```js -const button = document.createElement('monster-button'); -button.setOption('labels.button', 'click me'); -button.setOption('actions.click', (e) => { - document.getElementById('example-result').innerText = "clicked!"; - setTimeout(() => { - document.getElementById('example-result').innerText = ""; - }, 2000) -}) - +// example ``` To integrate this function into a website it is recommended to use a bundler like [esbuild](https://esbuild.github.io/). @@ -58,7 +50,7 @@ We can now integrate that into our website. <html lang="en"> <head> <meta charset="UTF-8"> - <title>Monster</title> + <title>$(COMPONENT_NAME)</title> <script src="dist.js"></script> </head> <body> diff --git a/development/makefiles/target-go-fetch-licenses.mk b/development/makefiles/target-go-fetch-licenses.mk index 242f3d346950f04bdc2ae8bb3d465b0ba9b7ebda..65fe5cdc864b4fafa6cebf21920dff5f65a55a45 100644 --- a/development/makefiles/target-go-fetch-licenses.mk +++ b/development/makefiles/target-go-fetch-licenses.mk @@ -11,16 +11,22 @@ ifeq ($(GO),) 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) - # go install github.com/google/go-licenses@latest - EXECUTABLES = $(EXECUTABLES:-) go-licenses; endif .PHONY: go-fetch-licenses ## Fetch licenses for all modules -go-fetch-licenses: +go-fetch-licenses: ifeq ($(GO_CURRENT_MODULE),) $(QUIET) $(ECHOERRORMARKER) "no go.mod file found, skipping fetching licenses" else diff --git a/development/makefiles/target-init-standard.mk b/development/makefiles/target-init-standard.mk index d19fd3774954075ff5152e2eef9c74900e3d9446..8679e58ea337fe4a06301ac784755a62263eb361 100644 --- a/development/makefiles/target-init-standard.mk +++ b/development/makefiles/target-init-standard.mk @@ -18,7 +18,7 @@ $(PROJECT_DIRECTORIES): $(shell $(MKDIR) -p $(path))) ## init standard project -init-standard: $(PROJECT_DIRECTORIES) .gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE +init-standard: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE $(ECHOMARKER) "Run init-standard" $(ECHO) "Done" @@ -32,7 +32,7 @@ init-standard: $(PROJECT_DIRECTORIES) .gitignore $(PROJECT_ROOT)README.md $(LIC export LICENSE_FILE_CONTENT $(LICENSE_PATH)LICENSE: - $(QUITE) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@ ############################################################################################# ############################################################################################# @@ -44,6 +44,6 @@ $(LICENSE_PATH)LICENSE: export README_FILE_CONTENT $(PROJECT_ROOT)README.md: - $(QUITE) $(ECHO) "$$README_FILE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@ diff --git a/development/makefiles/target-init-webcomponent.mk b/development/makefiles/target-init-webcomponent.mk index ebfe3afb9085d6bb852e73c8006055e3e658bde1..123b3f3954b983901d5e7d0e9bf55e9407ef0ab2 100644 --- a/development/makefiles/target-init-webcomponent.mk +++ b/development/makefiles/target-init-webcomponent.mk @@ -18,7 +18,7 @@ $(PROJECT_DIRECTORIES): $(shell $(MKDIR) -p $(path))) ## init standard project -init-webcomponent: $(PROJECT_DIRECTORIES) .gitignore $(DEVELOPMENT_PATH)package.json $(APPLICATION_PATH)package.json $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE $(APPLICATION_PATH)LICENSE +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" @@ -32,11 +32,11 @@ init-webcomponent: $(PROJECT_DIRECTORIES) .gitignore $(DEVELOPMENT_PATH)package. export LICENSE_FILE_CONTENT $(LICENSE_PATH)LICENSE: - $(QUITE) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$LICENSE_FILE_CONTENT" >> $@ export LICENSE_AGPL_FILE_CONTENT $(APPLICATION_PATH)LICENSE: - $(QUITE) $(ECHO) "$$LICENSE_AGPL_FILE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$LICENSE_AGPL_FILE_CONTENT" >> $@ ############################################################################################# ############################################################################################# @@ -48,7 +48,7 @@ $(APPLICATION_PATH)LICENSE: export README_FILE_CONTENT $(PROJECT_ROOT)README.md: - $(QUITE) $(ECHO) "$$README_FILE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$README_FILE_CONTENT" >> $@ ############################################################################################# @@ -101,7 +101,7 @@ endef export WEBCOMPONENTS_PACKAGE_CONTENT $(APPLICATION_PATH)package.json: - $(QUITE) $(ECHO) "$$WEBCOMPONENTS_PACKAGE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$WEBCOMPONENTS_PACKAGE_CONTENT" >> $@ ############################################################################################# ############################################################################################# @@ -162,6 +162,6 @@ endef export WEBCOMPONENTS_BUILD_PACKAGE_CONTENT $(DEVELOPMENT_PATH)package.json: - $(QUITE) $(ECHO) "$$WEBCOMPONENTS_BUILD_PACKAGE_CONTENT" >> $@ + $(QUIET) $(ECHO) "$$WEBCOMPONENTS_BUILD_PACKAGE_CONTENT" >> $@ ###### diff --git a/development/makefiles/target-jekyll.mk b/development/makefiles/target-jekyll.mk index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..8890741ae7d1b86664dfb1f264c34db88db10487 100644 --- a/development/makefiles/target-jekyll.mk +++ b/development/makefiles/target-jekyll.mk @@ -0,0 +1,39 @@ +############################################################################################# +############################################################################################# +## +## 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 diff --git a/development/makefiles/target-node-build.mk b/development/makefiles/target-node-build.mk index 62e86b1a0b1de5968e99d6f93cd04cecf913cace..98b4fed6df33172585d2e9e538b8f1d930389d1a 100644 --- a/development/makefiles/target-node-build.mk +++ b/development/makefiles/target-node-build.mk @@ -19,5 +19,6 @@ node-build: $(NODE_MODULES_MODIFIED) $(NODE_PACKAGES) $(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 diff --git a/development/makefiles/target-project.mk b/development/makefiles/target-project.mk new file mode 100644 index 0000000000000000000000000000000000000000..ca5ef13bbb96f9d2ee4b62b189fe9c6825973a17 --- /dev/null +++ b/development/makefiles/target-project.mk @@ -0,0 +1,43 @@ + +.PHONY: create-polyfill-monster +## create polyfill.io url +create-polyfill-monster: $(MONSTER_SOURCE_FILES) + $(ECHOMARKER) "create and replace polyfill" + $(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)create-polyfill.sh $(MJS_RELATIVE_SOURCE_FILES) + + +.PHONY: test-browser-monster +## create test-browser-monster +test-browser-monster: create-polyfill-monster + $(ECHOMARKER) "create browser test and start chrome" + $(QUIET) $(FIND) $(TEST_PATH)cases -type f | $(SED) "s|^$(TEST_PATH)cases||" > $(TEST_PATH)web/import.js + $(QUIET) $(SED) -i 's|^|import "../cases|' $(TEST_PATH)web/import.js + $(QUIET) $(SED) -i 's|$$|";|' $(TEST_PATH)web/import.js + $(QUIET) $(SED) -i "1 i import \"./prepare.js\";" $(TEST_PATH)web/import.js + $(QUIET) $(SED) -i "1 i /** this file was created automatically by the make target test-browser-monster */" $(TEST_PATH)web/import.js + $(ESBUILD) --platform=browser --sourcemap=inline --external:ws --external:jsdom --external:process --external:crypto --bundle $(TEST_PATH)web/import.js --outfile=$(TEST_PATH)web/tests.js +# $(QUIET) $(CD) $(MONSTER_BUILD_TEST_BROWSER_DIR); $(WEBPACK) ; $(CD) - +# $(QUIET) $(SED) -i -E "/<h1/s_.*_ <h1 style='margin-bottom: 0.1em;'>Monster $(PROJECT_VERSION)</h1>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html +# $(QUIET) $(SED) -i -E "/id=\"lastupdate\"/s_.*_ <div id=\"lastupdate\" style='font-size:0.7em'>last update $(shell date)</div>_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html +# $(QUIET) $(SED) -i -E "s_src=\"([\"]*)\.js.*\"_src=\"\1.js?r=$(shell date +"%T")\"_" $(TEST_PATH)web/test.html $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html +# $(QUIET) $(SED) -i -E "s_dist/([0-9]+\.[0-9]+\.[0-9]+)*/dist/monster_dist/$(PROJECT_VERSION)/dist/monster_" $(TEST_PATH)web/monster.html $(TEST_PATH)web/monster-dev.html +# #$(QUIET) if $(OPENBROWSER) ; then google-chrome --profile-directory="Default" $(TEST_PATH)web/test.html ; fi + + +## -> eigenes repos für monsterjs.org +#.PHONY: web-to-s3 +### transfer web to s3 +#web-to-s3: +# $(ECHOMARKER) "transfer web to s3" +# $(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(DEPLOYMENT_PATH)web/assets/ s3://monsterjs.org/assets/ +# $(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(DEPLOYMENT_PATH)web/vendor/ s3://monsterjs.org/vendor/ +# $(QUIET) $(AWS) s3 --only-show-errors cp $(DEPLOYMENT_PATH)web/index.html s3://monsterjs.org/index.html +# $(QUIET) $(AWS) s3 --only-show-errors cp $(DEPLOYMENT_PATH)web/error.html s3://monsterjs.org/error.html + + +.PHONY: doc-to-s3 +## transfer doc to s3 +doc-to-s3: jsdoc-build + $(ECHOMARKER) "transfer doc to s3" + $(QUIET) $(AWS) s3 --recursive --only-show-errors cp $(BUILD_PATH)docs s3://monsterjs.org/en/doc/monster/ +