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

chore: commit save point

parent 746f9b22
No related branches found
No related tags found
No related merge requests found
# Monster
Monster is a lightweight, robust and easy-to-use library with modest ambitions.
Monster integrates easily into your existing websites without taking over
everything.
It is not the goal of Monster to pull in a completely new abstraction
with its own language, but to combine the existing techniques of HTML,
CSS and Javascript in a meaningful way.
Monster is perfectly suited for the creation of beautiful and fast
user interfaces and websites. The basis is formed by core functions that
can be supplemented by necessary classes and objects.
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).
There is a version in the `/dist` folder that was built via [webpack](https://github.com/webpack/webpack) and
thus supports all browsers that are compatible with [ES5](https://caniuse.com/es5).
For some functions you need additional [polyfills](#polyfill).
## Installation
`npm install @schukai/monster`
## CDN
```
<!DOCTYPE html>
<html>
<head>
<title>HTML, CSS and JavaScript demo</title>
</head>
<body>
<p>Hello Monster <span id="version"></span>!</p>
<script type="module">
import {
Monster
} from 'https://unpkg.com/@schukai/monster@1.31.0/dist/modules/monster.js';
let id = document.getElementById('version');
id.innerHTML = Monster.getVersion();
</script>
</body>
</html>
```
`nomodule` for backwards compatibility
```
<script type="module" src="https://unpkg.com/@schukai/monster@1.31.0/dist/modules/monster.js"></script>
<script nomodule src="https://unpkg.com/@schukai/monster@1.31.0/dist/monster.js"></script>
```
### 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.
```
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
```
### Compatibility
if the global name Monster, is already used by another component, the following variable can be used to adapt the name of the component.
```
__MonsterRootName__="MyMonster"
```
After that, all classes are accessible via `MyMonster`. For example `MyMonster.getVersion()`.
## Documentation
To check out docs and examples, visit [monsterjs.org/en/doc/latest/](https://monsterjs.org/en/doc/latest/).
## 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 © 2021 schukai GmbH
[AGPL](https://www.gnu.org/licenses/agpl-3.0.de.html)
you can also purchase a commercial licence
## Changelog
Detailed changes for each release are documented in
the [CHANGELOG](https://gitlab.schukai.com/oss/libraries/javascript/monster/-/blob/master/packages/monster/CHANGELOG).
......@@ -16,11 +16,16 @@ CREDENTIALS_PATH ?= $(PROJECT_ROOT)credential/
RESOURCE_PATH ?= $(APPLICATION_PATH)resource/
SOURCE_PATH ?= $(APPLICATION_PATH)source/
WEB_PATH ?= $(APPLICATION_PATH)web/
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)tests/
DEPLOYMENT_SCRIPTS_PATH ?= $(DEPLOYMENT_PATH)script/
PROJECT_DIRECTORIES := $(PROJECT_DIRECTORIES) \
$(APPLICATION_PATH) \
$(RESOURCE_PATH) \
......@@ -29,7 +34,8 @@ PROJECT_DIRECTORIES := $(PROJECT_DIRECTORIES) \
$(DEPLOYMENT_PATH) \
$(VENDOR_PATH) \
$(DEVELOPMENT_PATH) \
$(SCRIPTS_PATH) \
$(DEVELOPMENT_SCRIPTS_PATH) \
$(DEPLOYMENT_SCRIPTS_PATH) \
$(DOCUMENTATION_PATH) \
$(REQUIREMENT_PATH) \
$(CREDENTIALS_PATH) \
......
......@@ -29,7 +29,7 @@ PACKAGE_MODIFIED := $(NODE_MODULES_DIR).modified
PACKAGE_JSON ?= $(NODE_ROOT_DIR)package.json
MJS_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.mjs')
MJS_RELATIVE_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.mjs' -exec realpath --relative-to $(THIS_DIR) {} \; )
MJS_RELATIVE_SOURCE_FILES := $(shell find $(SOURCE_PATH) -name '*.mjs' -exec realpath --relative-to $(PROJECT_ROOT) {} \; )
$(PACKAGE_MODIFIED): $(PACKAGE_JSON)
......
#.PHONY: create-polyfill-monster
### create polyfill.io url
#create-polyfill-monster: $(MONSTER_SOURCE_FILES)
# $(ECHOMARKER) "create and replace polyfill"
# $(QUIET) $(SCRIPT_PATH)create-polyfill.sh $(MJS_RELATIVE_SOURCE_FILES)
\ No newline at end of file
......@@ -2,12 +2,12 @@
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
url="$(npx create-polyfill-service-url analyse --file "$@")"
url="$(${SCRIPT_DIR}/../tests/node_modules/.bin/create-polyfill-service-url analyse --file "$@")"
if [ ! -x {$url} ]
then
sed -i -E "/id=\"polyfill\"/s|.*| <script id=\"polyfill\" src=\"${url}\"|g" ${SCRIPT_DIR}/../packages/monster/test/web/test.html
sed -i -E "/id=\"polyfill\"/s|.*| <script id=\"polyfill\" src=\"${url}\"|g" ${SCRIPT_DIR}/../packages/monster/README.md
sed -i -E "/id=\"polyfill\"/s|.*| <script id=\"polyfill\" src=\"${url}\"|g" ${SCRIPT_DIR}/../tests/web/test.html
sed -i -E "/id=\"polyfill\"/s|.*| <script id=\"polyfill\" src=\"${url}\"|g" ${SCRIPT_DIR}/../../application/README.md
fi
This diff is collapsed.
......@@ -17,6 +17,7 @@
"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",
"flow-bin": "^0.184.0",
"fs": "^0.0.1-security",
......
......@@ -5,7 +5,7 @@
<title>Mocha Monster</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<link rel="stylesheet" href="mocha.css"/>
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
<script id="polyfill" src="https://polyfill.io/v3/polyfill.min.js?features=Array.from,Array.isArray,Array.prototype.entries,Array.prototype.fill,Array.prototype.filter,Array.prototype.forEach,Array.prototype.indexOf,Array.prototype.keys,Array.prototype.lastIndexOf,Array.prototype.map,Array.prototype.reduce,Array.prototype.sort,ArrayBuffer,atob,CustomEvent,DataView,document,Document,DocumentFragment,Element,Event,fetch,globalThis,HTMLDocument,HTMLTemplateElement,Intl,JSON,Map,Math.log2,Number.isInteger,Object.assign,Object.defineProperty,Object.entries,Object.freeze,Object.getOwnPropertyDescriptor,Object.getOwnPropertyNames,Object.getPrototypeOf,Object.keys,Promise,Reflect,Reflect.defineProperty,Reflect.get,Reflect.getOwnPropertyDescriptor,Reflect.setPrototypeOf,Set,String.prototype.endsWith,String.prototype.matchAll,String.prototype.padStart,String.prototype.startsWith,String.prototype.trim,Symbol,Symbol.iterator,Uint16Array,Uint8Array,URL,WeakMap,WeakSet"
crossorigin="anonymous"
referrerpolicy="no-referrer"></script>
<script src="https://cdn.jsdelivr.net/npm/element-internals-polyfill@0.1.52/dist/index.min.mjs"></script>
......
......@@ -13,6 +13,6 @@ MAKEFILE_IMPORT_PATH=$(PROJECT_ROOT)deployment/makefiles/
## create polyfill.io url
create-polyfill-monster: $(MONSTER_SOURCE_FILES)
$(ECHOMARKER) "create and replace polyfill"
$(QUIET) $(SCRIPT_PATH)create-polyfill.sh $(MJS_RELATIVE_SOURCE_FILES)
$(QUIET) $(DEVELOPMENT_SCRIPTS_PATH)create-polyfill.sh $(MJS_RELATIVE_SOURCE_FILES)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment