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

chore: update makefiles and go libs

parent ec3d4468
Branches master
No related tags found
No related merge requests found
Showing
with 1185 additions and 0 deletions
File added
#############################################################################################
#############################################################################################
##
## DEFINE BOB
##
#############################################################################################
#############################################################################################
BOB_BIN ?= $(VENDOR_PATH)bob
#BOB_SNIPPED_CONFIG ?= $(VENDOR_PATH)bob/snippet.yaml
BOB_SYNC_CONFIG ?= $(VENDOR_PATH)bob/sync.yaml
BOB_BUILD_PATH ?= $(BUILD_PATH)bob/build/
BOB_DIST_PATH ?= $(DIST_PATH)bob/dist/
define SYNCEXAMPLECONF
sync:
- source:
path: '../original/test1.html'
selector: '#mainscript'
destination:
path: '../original/'
exclude:
- ../original/test1.html
- source:
path: '../original/test1.html'
selector: '.deco'
destination:
path: '../original/'
exclude:
- ../original/test1.html
endef
export SYNCEXAMPLECONF
define SNIPPETEXAMPLECONF
snippet:
-
source: ../../template.html
selector: 'h1'
destination: ../../snippets/meta/container.html
attribute:
- selector: 'li'
name: 'data-state'
value: 'monster'
replacement:
-
selector: 'li>span'
content: 'hello'
endef
export SNIPPETEXAMPLECONF
$(BOB_SNIPPED_CONFIG):
$(QUIET) $(ECHO) "$$BOB_SNIPPED_CONFIG" >> $@
$(BOB_SYNC_CONFIG):
$(QUIET) $(ECHO) "$$BOB_SYNC_CONFIG" >> $@
#############################################################################################
#############################################################################################
##
## DEFINE CONAN
##
#############################################################################################
#############################################################################################
CONAN_BIN ?= $(VENDOR_PATH)conan
CONAN_CONFIG ?= $(VENDOR_PATH)conan.conf
define CONANEXAMPLECONF
Server:
# The hostname or IP address of the server (CONAN_SERVER_HOST)
# Domain, IP or hostname of the server
#Host: localhost:8080
# The port of the server (CONAN_SERVER_ADDRESS)
# Address: localhost
# The port of the server (CONAN_SERVER_PORT)
# Port: 8080
#
Path:
# The path to the server (CONAN_SERVER_WEB_PATH)
Web: web
Watch:
- Path: src
Command: /bin/bash -c "npx esbuild --bundle --outfile={{ .WebPath }}/scripts/bundle.js --sourcemap {{ .Path }}"
Exclude:
- ~$
- ^\.
- Path: web
Exclude:
- ~$
- ^\.
Flags:
FollowSymlinks: true
endef
export CONANEXAMPLECONF
$(CONAN_CONFIG):
$(QUIET) $(ECHO) "$$CONANEXAMPLECONF" >> $@
#############################################################################################
#############################################################################################
##
## DIRECTORIES
##
#############################################################################################
#############################################################################################
APPLICATION_PATH ?= $(PROJECT_ROOT)
DEPLOYMENT_PATH ?= $(PROJECT_ROOT)
DEVELOPMENT_PATH ?= $(PROJECT_ROOT)
DOCUMENTATION_PATH ?= $(PROJECT_ROOT)
RESOURCE_PATH ?= $(APPLICATION_PATH)
SOURCE_PATH ?= $(APPLICATION_PATH)
## SCRIPTS_PATH IS DEPRECATED
SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/
DEVELOPMENT_SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/
BUILD_PATH ?= $(DEPLOYMENT_PATH)build/
VENDOR_PATH ?= $(DEPLOYMENT_PATH)vendor/
DEPLOYMENT_SCRIPTS_PATH ?= $(DEPLOYMENT_PATH)script/
LICENSE_PATH ?= $(PROJECT_ROOT)
PROJECT_DIRECTORIES := $(PROJECT_DIRECTORIES) \
$(APPLICATION_PATH) \
$(VENDOR_PATH) \
$(DEVELOPMENT_SCRIPTS_PATH) \
$(BUILD_PATH)
#############################################################################################
#############################################################################################
##
## DIRECTORIES
##
#############################################################################################
#############################################################################################
APPLICATION_PATH ?= $(PROJECT_ROOT)application/
DEPLOYMENT_PATH ?= $(PROJECT_ROOT)deployment/
DEVELOPMENT_PATH ?= $(PROJECT_ROOT)development/
DOCUMENTATION_PATH ?= $(PROJECT_ROOT)documentation/
RESOURCE_PATH ?= $(APPLICATION_PATH)resource/
SOURCE_PATH ?= $(APPLICATION_PATH)source/
WEB_PATH ?= $(APPLICATION_PATH)web/
## SCRIPTS_PATH IS DEPRECATED
SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/
DEVELOPMENT_SCRIPTS_PATH ?= $(DEVELOPMENT_PATH)script/
BUILD_PATH ?= $(DEPLOYMENT_PATH)build/
VENDOR_PATH ?= $(DEPLOYMENT_PATH)vendor/
DEPLOYMENT_SCRIPTS_PATH ?= $(DEPLOYMENT_PATH)script/
LICENSE_PATH ?= $(PROJECT_ROOT)
PROJECT_DIRECTORIES := $(PROJECT_DIRECTORIES) \
$(APPLICATION_PATH) \
$(RESOURCE_PATH) \
$(SOURCE_PATH) \
$(DEPLOYMENT_PATH) \
$(VENDOR_PATH) \
$(DEVELOPMENT_PATH) \
$(DEVELOPMENT_SCRIPTS_PATH) \
$(DEPLOYMENT_SCRIPTS_PATH) \
$(DOCUMENTATION_PATH) \
$(LICENSE_PATH) \
$(BUILD_PATH)
#############################################################################################
#############################################################################################
##
## DIRECTORIES
##
#############################################################################################
#############################################################################################
SOURCE_PATH ?= $(PROJECT_ROOT)source/
RELATIVE_SCRIPT_PATH ?= script/
SCRIPT_PATH ?= $(PROJECT_ROOT)$(RELATIVE_SCRIPT_PATH)
VENDOR_PATH ?= $(PROJECT_ROOT)vendor/
NODE_PATH ?= $(PROJECT_ROOT)node_modules/
TEST_PATH ?= $(PROJECT_ROOT)test/
DEVELOPMENT_PATH ?= $(PROJECT_ROOT)
LICENSE_PATH ?= $(PROJECT_ROOT)
DIST_PATH ?= $(PROJECT_ROOT)dist/
CONFIG_PATH ?= $(PROJECT_ROOT)config/
BUILD_PATH ?= $(PROJECT_ROOT)build/
BOB_SNIPPED_CONFIG ?= $(CONFIG_PATH)snippet.conf
BOB_SYNC_CONFIG ?= $(CONFIG_PATH)sync.yaml
BOB_BUILD_PATH ?= $(BUILD_PATH)
BOB_DIST_PATH ?= $(DIST_PATH)
PROJECT_DIRECTORIES := $(PROJECT_DIRECTORIES) \
$(SOURCE_PATH) \
$(SCRIPT_PATH) \
$(VENDOR_PATH) \
$(NODE_PATH) \
$(TEST_PATH) \
$(LICENSE_PATH) \
$(CONFIG_PATH) \
$(BUILD_PATH) \
$(DIST_PATH)
#############################################################################################
#############################################################################################
##
## 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
#############################################################################################
#############################################################################################
##
## 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={} \;
#############################################################################################
#############################################################################################
##
## 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-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" >> $@
######
#############################################################################################
#############################################################################################
##
## 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)"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment