Skip to content

Commit

Permalink
Use symfony-ux to create matomo graph
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 committed Oct 12, 2023
1 parent d73da62 commit cff73ee
Show file tree
Hide file tree
Showing 29 changed files with 6,622 additions and 6,078 deletions.
25 changes: 0 additions & 25 deletions .eslintrc.js

This file was deleted.

19 changes: 14 additions & 5 deletions .github/workflows/assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,25 @@ jobs:

steps:
- name: "Checkout"
uses: "actions/checkout@v4"
uses: "actions/checkout@v3"

- name: "Using Node"
uses: "actions/setup-node@v3.8.1"
uses: "actions/setup-node@v3.7.0"

- name: "Install dependencies"
run: "yarn"
run: "yarn --cwd assets"

- name: "Build"
run: "yarn build"
run: "yarn --cwd assets build"

- name: "Test"
run: "yarn --cwd assets test"

- name: "Lint"
run: "yarn --cwd assets check-lint"

- name: "Format"
run: "yarn --cwd assets check-format"

- name: "Check size"
run: "yarn size"
run: "yarn --cwd assets size"
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ composer.lock
phpunit.xml
/.phpunit.cache/
/build/
/node_modules/
/assets/node_modules/
/vendor/
!/vendor-bin/tools/composer.lock
/vendor-bin/tools/vendor/
Expand Down
7 changes: 0 additions & 7 deletions .size-limit.json

This file was deleted.

15 changes: 15 additions & 0 deletions assets/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"presets": [
"@babel/env",
"@babel/preset-typescript",
"minify"
],
"plugins": [
[
"@babel/plugin-transform-typescript",
{
allowDeclareFields: true
}
]
]
}
39 changes: 39 additions & 0 deletions assets/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module.exports = {
"parser": "@typescript-eslint/parser",
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/warnings",
"prettier"
],
"env": {
"browser": true,
"es6": true
},
"plugins": [
"@typescript-eslint",
"import",
"header"
],
"rules": {
"@typescript-eslint/no-explicit-any": "off",
"header/header": [2, "block", [
"!",
" * (c) Christian Gripp <[email protected]>",
" *",
" * For the full copyright and license information, please view the LICENSE",
" * file that was distributed with this source code.",
" "
], 2]
},
"overrides": [
{
"files": [
"test/*.js"
],
"extends": [
]
}
]
};
4 changes: 4 additions & 0 deletions assets/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
printWidth: 120
trailingComma: "es5"
tabWidth: 4
singleQuote: true
7 changes: 7 additions & 0 deletions assets/.size-limit.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"path": "dist/*.js",
"gzip": false,
"limit": "440 kB"
}
]
7 changes: 7 additions & 0 deletions assets/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": ["stylelint-config-recommended-scss"],
"rules": {
"no-descending-specificity": null,
"scss/no-global-function-names": null
}
}
6 changes: 6 additions & 0 deletions assets/dist/MatomoGraph.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions assets/dist/controller.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

97 changes: 0 additions & 97 deletions assets/js/MatomoTable.js

This file was deleted.

68 changes: 68 additions & 0 deletions assets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@nucleos/matomo-bundle",
"license": "MIT",
"version": "1.0.0",
"homepage": "https://nucleos.rocks",
"author": "Christian Gripp <[email protected]>",
"symfony": {
"controllers": {
"matomoGraph": {
"main": "dist/controller.js",
"fetch": "lazy",
"enabled": true,
"autoimport": []
}
}
},
"engines": {
"node": ">=14"
},
"dependencies": {
"chart.js": "^4.3.3"
},
"peerDependencies": {
"@hotwired/stimulus": "^3.0.0"
},
"devDependencies": {
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/eslint-parser": "^7.22.9",
"@babel/plugin-transform-typescript": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/preset-typescript": "^7.22.5",
"@hotwired/stimulus": "^3.2.2",
"@size-limit/esbuild": "^9.0.0",
"@size-limit/preset-small-lib": "^9.0.0",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"@symfony/webpack-encore": "^4.2.0",
"babel-minify": "^0.5.2",
"eslint": "^8.46.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-header": "^3.1.1",
"eslint-plugin-import": "^2.28.0",
"eslint-plugin-jest": "^27.2.3",
"jest-canvas-mock": "^2.5.2",
"prettier": "^3.0.1",
"size-limit": "^9.0.0",
"typescript": "^5.1.6",
"webpack": "^5.72",
"webpack-cli": "^5.0.0"
},
"scripts": {
"build": "babel --extensions \".ts,.tsx\" src -d dist && yarn",
"watch": "babel --extensions \".ts,.tsx\" src -d dist --watch",
"test": "yarn build && jest",
"lint": "eslint src test --fix",
"format": "prettier {src,test}/**/*.{js,ts,tsx} --write --no-error-on-unmatched-pattern",
"check-lint": "eslint src test --no-fix",
"check-format": "yarn format --no-write --check",
"size": "size-limit"
},
"jest": {
"testRegex": "test/.*\\.test.(j|t)s",
"setupFilesAfterEnv": [
"./test/setup.js"
]
}
}
Loading

0 comments on commit cff73ee

Please sign in to comment.