A reliable test for the extra code needed in analyzer, passing shellcheck
This commit is contained in:
18288
web/custom-elements.json
18288
web/custom-elements.json
File diff suppressed because it is too large
Load Diff
1
web/package-lock.json
generated
1
web/package-lock.json
generated
@ -7,6 +7,7 @@
|
|||||||
"": {
|
"": {
|
||||||
"name": "@goauthentik/web",
|
"name": "@goauthentik/web",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
|
"hasInstallScript": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@codemirror/lang-html": "^6.4.9",
|
"@codemirror/lang-html": "^6.4.9",
|
||||||
|
|||||||
@ -18,6 +18,7 @@
|
|||||||
"lint:precommit": "bun scripts/eslint-precommit.mjs",
|
"lint:precommit": "bun scripts/eslint-precommit.mjs",
|
||||||
"lint:spelling": "node scripts/check-spelling.mjs",
|
"lint:spelling": "node scripts/check-spelling.mjs",
|
||||||
"lit-analyse": "lit-analyzer src",
|
"lit-analyse": "lit-analyzer src",
|
||||||
|
"postinstall": "bash scripts/patch-analyser.sh",
|
||||||
"precommit": "npm-run-all --parallel tsc lit-analyse lint:spelling --sequential lint:precommit prettier",
|
"precommit": "npm-run-all --parallel tsc lit-analyse lint:spelling --sequential lint:precommit prettier",
|
||||||
"prequick": "run-s tsc:execute lit-analyse lint:precommit lint:spelling",
|
"prequick": "run-s tsc:execute lit-analyse lint:precommit lint:spelling",
|
||||||
"prettier-check": "prettier --check .",
|
"prettier-check": "prettier --check .",
|
||||||
|
|||||||
23
web/scripts/patch-analyser.sh
Normal file
23
web/scripts/patch-analyser.sh
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
TARGET="./node_modules/@custom-elements-manifest/analyzer/src/features/analyse-phase/creators/handlers.js"
|
||||||
|
|
||||||
|
# If the second question mark is not there in this test, put it there. The flags to grep ensure it
|
||||||
|
# will behave correctly on both MacOS and Linux by requiring it to use only the POSIX "basic"
|
||||||
|
# regular expression behavior.
|
||||||
|
#
|
||||||
|
|
||||||
|
if ! grep -GL 'node\.name?\.text?\.startsWith' "$TARGET" > /dev/null 2>&1; then
|
||||||
|
patch --forward -V none --no-backup-if-mismatch -p0 $TARGET <<EOF
|
||||||
|
--- a/packages/analyzer/src/features/analyse-phase/creators/handlers.js
|
||||||
|
+++ b/packages/analyzer/src/features/analyse-phase/creators/handlers.js
|
||||||
|
@@ -34,7 +34,7 @@ export function handleModifiers(doc, node) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
- if (node.name?.text.startsWith('#')) {
|
||||||
|
+ if (node.name?.text?.startsWith('#')) {
|
||||||
|
doc.privacy = 'private';
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user