Skip to content

Commit

Permalink
build(npm): swap out standard style for prettier + config moving mead…
Browse files Browse the repository at this point in the history
…ow; ⬆️ mscgenjs, chai, dependency-cruiser, eslint, mocha, upem, webpack, webpack-cli

when using npm eslint standard installs peer deps not compatible with node 16. There's a tiresome discussion going on in the eslint standard repo I don't have the patience for => use prettier + moving-meadow which don't have these problems
  • Loading branch information
sverweij committed May 21, 2021
1 parent 025af3e commit 57316a1
Show file tree
Hide file tree
Showing 18 changed files with 597 additions and 533 deletions.
4 changes: 2 additions & 2 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins:
eslint:
enabled: true
channel: "eslint-4"
config:
config:
config: .eslintrc.json
checks:
# indent rules on codeclimate seem to be different from
Expand All @@ -21,4 +21,4 @@ exclude_patterns:
- "dist"
- "wikum"
- "**/node_modules/"
- "COPYING"
- "COPYING"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ npm-debug.log
siteverification.id
tmp_*.md
tracking.*
package-lock.json
9 changes: 4 additions & 5 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ image: node:latest

cache:
paths:
- node_modules/
- node_modules/

test_async:
script:
- npm install
- npm run build
- npm run check

- npm install
- npm run build
- npm run check
22 changes: 11 additions & 11 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ orientation.
Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities
Expand Down
27 changes: 15 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,48 @@ So you want to contribute to mscgen_js? We already love you!
To make this as easy as possible for you, here's some simple guidelines:

### Reporting issues
- All **issues** are **welcome**.

- All **issues** are **welcome**.
- These include bug reports, questions, feature requests and enhancement
proposals
- [GitHub's issue tracker](https://github.com/mscgenjs/mscgenjs-inpage/issues)
is the easiest way to submit them.
- We prefer bug reports in **_steps taken_ - _expected_ - _found_** format.
- that makes it more easy to reproduce it, and concoct a solution that fits
your expectation.
- We prefer bug reports in **_steps taken_ - _expected_ - _found_** format.
- that makes it more easy to reproduce it, and concoct a solution that fits
your expectation.
- If applicable, it is also nice when you provide
- the **input** you used and
- the **environment** (browser version/ os, or node.js version + os).
- [template](#issue-template) at the bottom
- In turn, we try to **respond within a week**.
- In turn, we try to **respond within a week**.
This might or might not include an actual code fix.

### Contributing code

- We prefer well documented
**[pull requests](https://help.github.com/articles/creating-a-pull-request/)**
based on the most recent version of the **master** branch.
- Code quality
- Additions pass eslint as configured for this repo
- Mocha tests prove your code does what it intends.
- Your code does not introduce regressions - ```make check``` proves this.
- Code style (you know, petty things like indentations, where brackets go,
how variables & parameters are named) fits in with the current code base.
- Plan to do something drastic?
- Additions pass eslint as configured for this repo
- Mocha tests prove your code does what it intends.
- Your code does not introduce regressions - `make check` proves this.
- Code style (you know, petty things like indentations, where brackets go,
how variables & parameters are named) fits in with the current code base.
- Plan to do something drastic?
Leave an
[issue](https://github.com/mscgenjs/mscgenjs-inpage/issues/new) on GitHub
- mscgenjs-inpage is released with a [code of conduct](CODE_OF_CONDUCT.md), adapted
from the [contributor covenant](http://contributor-covenant.org/).

### Legal

- the code you add will be subject to
[GPL-3.0](wikum/licenses/license.mscgen_js.md), just like the rest of
mscgen_js
- the code you add is your own original work


### Issue template

### steps taken

### expected
Expand Down
2 changes: 1 addition & 1 deletion dist/mscgen-inpage.js

Large diffs are not rendered by default.

60 changes: 40 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,27 @@
"COPYING"
],
"dependencies": {
"mscgenjs": "5.0.4"
"mscgenjs": "6.0.0"
},
"devDependencies": {
"chai": "4.3.0",
"dependency-cruiser": "9.23.2",
"eslint": "7.20.0",
"eslint-config-standard": "16.0.2",
"eslint-plugin-import": "2.22.1",
"chai": "4.3.4",
"dependency-cruiser": "10.0.1",
"eslint": "7.26.0",
"eslint-config-moving-meadow": "2.0.9",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-budapestian": "2.3.0",
"eslint-plugin-import": "2.23.2",
"eslint-plugin-mocha": "8.1.0",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.3.1",
"eslint-plugin-security": "1.4.0",
"eslint-plugin-standard": "5.0.0",
"mocha": "8.3.0",
"eslint-plugin-unicorn": "32.0.1",
"mocha": "8.4.0",
"npm-run-all": "4.1.5",
"nyc": "15.1.0",
"upem": "5.0.0",
"webpack": "5.24.2",
"webpack-cli": "4.5.0"
"prettier": "2.3.0",
"upem": "6.0.0",
"webpack": "5.37.1",
"webpack-cli": "4.7.0"
},
"scripts": {
"build": "webpack",
Expand All @@ -54,8 +57,12 @@
"depcruise:graph": "run-p depcruise:graph:*",
"depcruise:graph:html": "depcruise -T dot -v -- src | dot -T svg | depcruise-wrap-stream-in-html > docs/dependencygraph.html",
"depcruise:graph:png": "depcruise -T dot -v -- src | dot -Gdpi=192 -T png | pngquant - > docs/dependencygraph.png",
"lint": "eslint src test",
"lint:fix": "eslint --fix src test",
"lint": "npm-run-all lint:eslint lint:prettier",
"lint:eslint": "eslint src test",
"lint:prettier": "prettier --check {src,test}/**/*.js *.{json,yml,md} .github",
"lint:fix": "npm-run-all lint:fix:eslint lint:fix:prettier",
"lint:fix:eslint": "eslint --fix src test",
"lint:fix:prettier": "prettier --write {src,test}/**/*.js *.{json,yml,md} .github",
"scm:push": "run-p --aggregate-output scm:push:*",
"scm:push:github": "run-p --aggregate-output scm:push:github:*",
"scm:push:github:commits": "git push",
Expand All @@ -69,23 +76,36 @@
"version": "run-s build depcruise:graph scm:stage"
},
"eslintConfig": {
"extends": "standard",
"plugins": [
"security"
"extends": [
"moving-meadow"
],
"rules": {
"no-var": "off"
"parserOptions": {
"ecmaVersion": 2020
},
"env": {
"browser": true
},
"rules": {
"complexity": [
"warn",
7
],
"sort-imports": "off",
"import/no-relative-parent-imports": "off"
},
"overrides": [
{
"files": [
"test/**/*.js"
],
"env": {
"mocha": true
"jest": true
},
"rules": {
"node/global-require": "off",
"max-lines-per-function": "off",
"func-names": "off",
"no-magic-numbers": "off"
}
}
]
Expand Down
37 changes: 20 additions & 17 deletions src/embedding/config.js
Original file line number Diff line number Diff line change
@@ -1,28 +1,31 @@
/* global mscgen_js_config */

var gConfig = {
defaultLanguage: 'mscgen',
parentElementPrefix: 'mscgen_js-parent_',
let gConfig = {
defaultLanguage: "mscgen",
parentElementPrefix: "mscgen_js-parent_",
clickable: false,
clickURL: 'https://sverweij.github.io/mscgen_js/',
loadFromSrcAttribute: false
}
clickURL: "https://sverweij.github.io/mscgen_js/",
loadFromSrcAttribute: false,
};

function mergeConfig (pConfigBase, pConfigToMerge) {
Object.getOwnPropertyNames(pConfigToMerge).forEach(function (pAttribute) {
pConfigBase[pAttribute] = pConfigToMerge[pAttribute]
})
function mergeConfig(pConfigBase, pConfigToMerge) {
Object.getOwnPropertyNames(pConfigToMerge).forEach((pAttribute) => {
pConfigBase[pAttribute] = pConfigToMerge[pAttribute];
});
}

module.exports = {
getConfig: function () {
if (typeof (mscgen_js_config) !== 'undefined' && mscgen_js_config &&
typeof (mscgen_js_config) === 'object') {
mergeConfig(gConfig, mscgen_js_config)
getConfig() {
if (
typeof mscgen_js_config !== "undefined" &&
mscgen_js_config &&
typeof mscgen_js_config === "object"
) {
mergeConfig(gConfig, mscgen_js_config);
}
return gConfig
}
}
return gConfig;
},
};
/* eslint security/detect-object-injection: 0, camelcase: 0 */
/* We're good here with object injection stuff; the attributes are not passed from the outside */
/*
Expand Down

0 comments on commit 57316a1

Please sign in to comment.