Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • oss/utilities/conan
1 result
Show changes
Showing
with 1066 additions and 30 deletions
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is ...
## Documentation
To check out docs and examples, visit ....
## Installation
```shell
go get $(shell git config --get remote.origin.url | sed -E 's/^\s*.*:\/\///g')
```
**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
## Usage
## Contributing
Merge requests are welcome. For major changes, please open an issue first to discuss what
you would like to change. **Please make sure to update tests as appropriate.**
Versioning is done with [SemVer](https://semver.org/).
Changelog is generated with [git-chglog](https://github.com/git-chglog/git-chglog#git-chglog)
Commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
Messages are started with a type, which is one of the following:
- **feat**: A new feature
- **fix**: A bug fix
- **doc**: Documentation only changes
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Other changes that don't modify src or test files
The footer would be used for a reference to an issue or a breaking change.
A commit that has a footer `BREAKING CHANGE:`, or appends a ! after the type/scope,
introduces a breaking API change (correlating with MAJOR in semantic versioning).
A BREAKING CHANGE can be part of commits of any type.
the following is an example of a commit message:
```text
feat: add 'extras' field
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is ...
## Documentation
To check out docs and examples, visit ....
## Installation
```shell
go get $(shell git config --get remote.origin.url | sed -E 's/^\s*.*:\/\///g')
```
**Note:** This library uses [Go Modules](https://github.com/golang/go/wiki/Modules) to manage dependencies.
## Usage
## Contributing
Merge requests are welcome. For major changes, please open an issue first to discuss what
you would like to change. **Please make sure to update tests as appropriate.**
Versioning is done with [SemVer](https://semver.org/).
Changelog is generated with [git-chglog](https://github.com/git-chglog/git-chglog#git-chglog)
Commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) specification.
Messages are started with a type, which is one of the following:
- **feat**: A new feature
- **fix**: A bug fix
- **doc**: Documentation only changes
- **refactor**: A code change that neither fixes a bug nor adds a feature
- **perf**: A code change that improves performance
- **test**: Adding missing or correcting existing tests
- **chore**: Other changes that don't modify src or test files
The footer would be used for a reference to an issue or a breaking change.
A commit that has a footer `BREAKING CHANGE:`, or appends a ! after the type/scope,
introduces a breaking API change (correlating with MAJOR in semantic versioning).
A BREAKING CHANGE can be part of commits of any type.
the following is an example of a commit message:
```text
feat: add 'extras' field
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is a part of the Alvine/Agenor project.
This app is built with ES6 modules and uses [import](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/import)
and [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export).
For some functions, you need additional [polyfills](#polyfill).
## Documentation
To check out docs and examples, visit [doc.alvine.io](https://doc.alvine.io).
## Installation
`pnpm install @oss/$(COMPONENT_SLUG)`
## Usage
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
// script
```
To integrate this function into a website it is recommended to use a bundler like [esbuild](https://esbuild.github.io/).
```sh
esbuild index.mjs --outfile dist.js
```
We can now integrate that into our website.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$(COMPONENT_NAME)</title>
<script src="dist.js"></script>
</head>
<body>
```
Voila!
### Polyfill
We do try to work around some browser bugs, but on the whole we don't use polyfills and feature detection.
However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased.
```js
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?..."
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
## Changelog
Detailed changes for each release are documented in the CHANGELOG.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is ...
## Documentation
To check out docs and examples, visit ....
## Installation
## Usage
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
endef
#############################################################################################
#############################################################################################
##
## README
##
#############################################################################################
#############################################################################################
define README_FILE_CONTENT
# $(COMPONENT_NAME)
$(COMPONENT_NAME) is a lightweight, robust and easy-to-use form library with modest ambitions.
The component easily integrates with your existing websites without taking over everything.
One design target is to reach the shiny sun with as little JavaScript as possible.
Monster was built with ES6 modules and uses [import](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Statements/import)
and [export](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export).
For some functions, you need additional [polyfills](#polyfill).
## Documentation
To check out docs and examples, visit [monsterjs.org/en/doc/$(COMPONENT_SLUG)/](https://monsterjs.org/en/doc/$(COMPONENT_SLUG)/).
## Installation
`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 $(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
// example
```
To integrate this function into a website it is recommended to use a bundler like [esbuild](https://esbuild.github.io/).
```sh
esbuild index.mjs --outfile dist.js
```
We can now integrate that into our website.
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>$(COMPONENT_NAME)</title>
<script src="dist.js"></script>
</head>
<body>
```
Voila!
### Polyfill
We do try to work around some browser bugs, but on the whole we don't use polyfills and feature detection.
However, many functions can be mapped via [polyfill.io](https://polyfill.io/) and thus the compatibility can be increased.
```js
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?..."
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
```
## Questions
For questions and commercial support, please contact [schukai GmbH](https://www.schukai.com/).
The issue list of this repo is exclusively for bug reports and feature requests.
## Issues
Please make sure to read the Issue Reporting Checklist before opening an
issue. Issues not conforming to the guidelines may be closed immediately.
## License
$(COPYRIGHT_TEXT)
$(COPYRIGHT_URL)
You can also purchase a commercial license.
## Changelog
Detailed changes for each release are documented in
the [CHANGELOG](https://gitlab.schukai.com/oss/libraries/javascript/web-components/$(COMPONENT_SLUG)).
endef
......@@ -17,7 +17,11 @@ endif
.PHONY: add-licenses
## Add license headers to all go files
add-licenses:
$(ECHOMARKER) "Add license headers to all go files"
$(ECHOMARKER) "Add license headers to all sourche files"
ifeq ($(LICENSE_FILE_PATTERN),)
$(error "LICENSE_FILE_PATTERN is not set. Please check your makefile and include the licenses.mk")
endif
ifndef SPDX_LICENSE_ID
$(error "SPDX_LICENSE_ID is not defined. Please check your makefile and include the licenses.mk")
endif
......
#############################################################################################
#############################################################################################
##
## SERVER BOB
##
#############################################################################################
#############################################################################################
ifeq ($(BOB_BIN),)
$(error $(ERRORMARKER) Bob is not defined, check your Makefile if bob.mk is included)
endif
ifndef BOB_BUILD_PATH
$(error $(ERRORMARKER) BOB_BUILD_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_BUILD_PATH):
$(ECHOMARKER) "Create build directory for bob"
$(QUIET) $(MKDIR) -p $(BOB_BUILD_PATH)
$(BOB_DIST_PATH):
$(ECHOMARKER) "Create dist directory for bob"
$(QUIET) $(MKDIR) -p $(BOB_DIST_PATH)
.PHONY: generate-html
## Build the project
generate-html: $(BOB_BIN) $(BOB_BUILD_PATH) $(BOB_DIST_PATH)
$(ECHOMARKER) "Generate html"
$(QUIET) $(BOB_BIN) html generate --input $(BOB_BUILD_PATH) --output $(BOB_DIST_PATH)
.PHONY: prepare-template
## Prepare template
prepare-template: $(BOB_BIN) $(BOB_BUILD_PATH)
$(ECHOMARKER) "Generate templates"
$(QUIET) find $(SOURCE_PATH) -name "*.yaml" -exec $(BOB_BIN) template prepare --input $(SOURCE_PATH) --output $(BOB_BUILD_PATH) --data-file={} \;
......@@ -6,8 +6,10 @@
#############################################################################################
#############################################################################################
CONAN_BIN ?= $(VENDOR_PATH)conan
CONAN_CONFIG ?= $(VENDOR_PATH)conan.conf
ifeq ($(CONAN_BIN),)
$(error $(ERRORMARKER) Conan is not defined, check your Makefile if conan.mk is included)
endif
$(CONAN_BIN):
$(QUIET) $(MKDIR) -p $(VENDOR_PATH)
......@@ -16,6 +18,5 @@ $(CONAN_BIN):
.PHONY: run-conan
## run conan webserver
run-conan: $(CONAN_BIN)
$(QUIET) $(CONAN_BIN) server serve -config $(CONAN_CONFIG)
run-conan: $(CONAN_BIN) $(CONAN_CONFIG)
$(QUIET) $(CONAN_BIN) server serve --config $(CONAN_CONFIG)
......@@ -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
......
#############################################################################################
#############################################################################################
##
## 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": "^2.0.2",
"@schukai/component-notify": "^2.0.0",
"@schukai/component-state": "^2.0.1",
"@schukai/component-style": "^0.6.1",
"@schukai/monster": "^2.0.16"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.0",
"@semantic-release/changelog": "^6.0.1",
"@semantic-release/exec": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@semantic-release/gitlab": "^9.4.2",
"cli-real-favicon": "^0.0.8",
"@semantic-release/npm": "^9.0.1",
"autoprefixer": "^10.4.13",
"btoa": "^1.2.1",
"c8": "^7.12.0",
"chai": "^4.3.6",
"glob": "^8.0.3",
"chai-dom": "^1.11.0",
"clean-jsdoc-theme": "^4.1.6",
"create-polyfill-service-url": "^2.2.6",
"crypt": "^0.0.2",
"cssnano": "^5.1.14",
"esbuild": "^0.14.53",
"flow-bin": "^0.184.0",
"fs": "^0.0.1-security",
"graphviz": "^0.0.9",
"jsdoc": "^3.6.11",
"jsdoc-external-example": "github:volker-schukai/jsdoc-external-example",
"jsdom": "^19.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.0.0",
"postcss": "^8.4.19",
"postcss-color-mod-function": "^3.0.3",
"postcss-fluid": "^1.4.2",
"postcss-for": "^2.1.1",
"postcss-import": "^15.0.0",
"postcss-mixins": "^9.0.4",
"postcss-nesting": "^10.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": "^19.0.5",
"sinon": "^14.0.0",
"url": "^0.11.0",
"url-exist": "3.0.0",
"util": "^0.12.4",
"vite": "^3.2.3",
"vite-plugin-banner": "^0.6.1",
"vite-plugin-mkcert": "^1.10.1",
"vite-plugin-minify": "^1.5.2"
}
}
endef
export PLATFORM_PARTS_BUILD_PACKAGE_CONTENT
$(PROJECT_ROOT)package.json:
$(QUIET) $(ECHO) "$$PLATFORM_PARTS_BUILD_PACKAGE_CONTENT" >> $@
######
#############################################################################################
#############################################################################################
##
## INIT-TARGETS
## INIT-STANDARD
##
#############################################################################################
#############################################################################################
......@@ -9,12 +9,41 @@
# @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: .gitignore
# The default directories are defined in the
# directories-standard.mk file, but all other
# targets can define directories as well.
init-standard: $(PROJECT_DIRECTORIES) $(PROJECT_ROOT).gitignore $(PROJECT_ROOT)README.md $(LICENSE_PATH)LICENSE
$(ECHOMARKER) "Run init-standard"
$(foreach path,$(PROJECT_DIRECTORIES),\
$(shell $(MKDIR) -p $(path)))
$(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.9.2",
"@schukai/monster": "^2.0.8"
},
"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"
},
"type": "module",
"author": "schukai GmbH",
"license": "see LICENSE file",
"dependencies": {
"@popperjs/core": "^2.11.2",
"@schukai/monster": "^2.0.8"
},
"devDependencies": {
"@peculiar/webcrypto": "^1.4.0",
"btoa": "^1.2.1",
"c8": "^7.12.0",
"chai": "^4.3.6",
"chai-dom": "^1.11.0",
"clean-jsdoc-theme": "^4.1.6",
"create-polyfill-service-url": "^2.2.6",
"crypt": "^0.0.2",
"esbuild": "^0.14.53",
"flow-bin": "^0.184.0",
"fs": "^0.0.1-security",
"graphviz": "^0.0.9",
"jsdoc": "^3.6.11",
"jsdoc-external-example": "github:volker-schukai/jsdoc-external-example",
"jsdoc-plantuml": "^1.0.2",
"jsdom": "^19.0.0",
"jsdom-global": "^3.0.2",
"mocha": "^10.0.0",
"node-plantuml": "^0.9.0",
"sinon": "^14.0.0",
"url": "^0.11.0",
"url-exist": "3.0.0",
"util": "^0.12.4"
}
}
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
......@@ -17,10 +17,8 @@ node-build: $(NODE_MODULES_MODIFIED) $(NODE_PACKAGES)
$(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 ; \
$(NPM) --prefix $(NODE_ROOT_DIR) run build
$(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
......@@ -8,25 +8,28 @@
.PHONY: npm-publish-major
## release major version of package
npm-publish-major: node-test
npm-publish-major:
$(ECHOMARKER) "release major version"
$(QUIET) $(MAKE) next-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: node-test
npm-publish-minor:
$(ECHOMARKER) "release minor version"
$(QUIET) $(MAKE) next-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: node-test
npm-publish-patch:
$(ECHOMARKER) "release patch version"
$(QUIET) $(MAKE) next-patch-version
$(QUIET) $(MAKE) tag-patch-version
$(QUIET) $(MAKE) node-build
$(QUIET) $(MAKE) node-test
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run publish
#############################################################################################
#############################################################################################
##
## RUN NPM BUILD, TEST AND DEV TASKS
##
#############################################################################################
#############################################################################################
.PHONY: npm-dev
## run npm dev server
npm-dev:
$(ECHOMARKER) "start npm dev server"
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run dev
.PHONY: npm-build
## build npm project
npm-build:
$(ECHOMARKER) "build npm project"
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run build
.PHONY: npm-preview
## preview npm project
npm-preview:
$(ECHOMARKER) "preview npm project"
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run build
$(QUIET) $(NPM) --prefix $(NODE_ROOT_DIR) run preview
#############################################################################################
#############################################################################################
##
## PHPUNIT
##
#############################################################################################
#############################################################################################
# path and binaries
PARALLEL ?= parallel
EXECUTABLES = $(EXECUTABLES:-) $(PARALLEL);
PHPUNIT_PATH := $(VENDOR_PATH)phpunit/
PHPUNIT_BIN := $(PHPUNIT_PATH)phpunit
PHPUNIT_SCRIPT_PATH := $(BUILD_PATH)/script
ifeq ($(shell command -v $(PARALLEL) 2> /dev/null),)
$(error "parallel is not installed. Please install parallel")
endif
ifneq ($(shell test -d $(PHPUNIT_SCRIPT_PATH) && echo -n yes),yes)
$(shell mkdir -p $(PHPUNIT_SCRIPT_PATH))
endif
define UNITTEST_SH_SCRIPT
#!/bin/bash
BIN=$$1
BOOTSTRAP=$$2
CONFIG=$$3
TESTFILES=$$4
export DOCOVERAGE=true
groups=$$($${BIN} \
--list-groups \
--bootstrap $${BOOTSTRAP} \
--configuration $${CONFIG} \
development/tests/ | sed -n -e '/^ - /p' | cut -d"-" -f2 | tr -d ' ')
parallel \
$${BIN} \
--group {} \
--configuration $${CONFIG} \
--whitelist application/source/ \
--bootstrap $${BOOTSTRAP} \
$${TESTFILES} ::: $${groups}
endef
export UNITTEST_SH_SCRIPT
$(PHPUNIT_SCRIPT_PATH)/unittests.sh:
$(QUIET) $(ECHO) "$$UNITTEST_SH_SCRIPT" >> $@
$(CHMOD) u+x $(PHPUNIT_SCRIPT_PATH)/unittests.sh
$(PHPUNIT_BIN):
$(MKDIR) -p $(PHPUNIT_PATH)
$(WGET) -O $(PHPUNIT_BIN) https://phar.phpunit.de/phpunit-9.phar
$(CHMOD) u+x $(PHPUNIT_BIN)
$(CHMOD) u+x $(PHPUNIT_SCRIPT_PATH)/unittests.sh
.PHONY: run-phpunit-tests
## run PHPUNIT Tests
run-phpunit-tests: $(PHPUNIT_SCRIPT_PATH)/unittests.sh $(PHPUNIT_BIN)
$(BUILD_SCRIPTS_PATH)unittests.sh "$(PHPUNIT_BIN)" "$(TEST_PATH)script/bootstrap.inc.php" "$(TEST_PATH)config/phpunit.xml" "$(TEST_PATH)"
......@@ -47,7 +47,7 @@ check-clean-repo:
$(QUIET) $(GIT) diff-index --quiet HEAD || (echo "There are uncommitted changes after running make. Please commit or stash them before running make."; exit 1)
## tag repository with next patch version
tag-patch-version: next-patch-version
tag-patch-version: $(GIT_CHGLOG_CONFIG_DIR)/config.yml $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md next-patch-version
$(ECHOMARKER) "Tagging patch version"
$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
$(GIT_CHGLOG_BIN) --next-tag v$(PROJECT_VERSION) -o $(CHANGELOG_FILE)
......@@ -55,7 +55,7 @@ tag-patch-version: next-patch-version
$(QUIET) $(GIT) tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
## tag repository with next minor version
tag-minor-version: next-minor-version
tag-minor-version: $(GIT_CHGLOG_CONFIG_DIR)/config.yml $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md next-minor-version
$(ECHOMARKER) "Tagging minor version"
$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
$(GIT_CHGLOG_BIN) --next-tag v$(PROJECT_VERSION) -o $(CHANGELOG_FILE)
......@@ -63,7 +63,7 @@ tag-minor-version: next-minor-version
$(QUIET) $(GIT) tag -a v$(PROJECT_VERSION) -m "Version $(PROJECT_VERSION)"
## tag repository with next major version
tag-major-version: next-major-version
tag-major-version: $(GIT_CHGLOG_CONFIG_DIR)/config.yml $(GIT_CHGLOG_CONFIG_DIR)/CHANGELOG.tpl.md next-major-version
$(ECHOMARKER) "Tagging major version"
$(eval PROJECT_VERSION := $(shell cat $(RELEASE_FILE) | jq -r .version))
$(GIT_CHGLOG_BIN) --next-tag v$(PROJECT_VERSION) -o $(CHANGELOG_FILE)
......