Skip to content

Commit 3dc0629

Browse files
Raphael SchweikertRaphael Schweikert
Raphael Schweikert
authored and
Raphael Schweikert
committed
feat(editor): implement frontend checks
1 parent 4fa38f5 commit 3dc0629

8 files changed

+13814
-13605
lines changed

Diff for: .eslintrc.json

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
7+
"overrides": [],
8+
"parser": "@typescript-eslint/parser",
9+
"parserOptions": {
10+
"ecmaVersion": "latest",
11+
"sourceType": "module"
12+
},
13+
"plugins": ["react", "react-hooks", "@typescript-eslint"],
14+
"settings": {
15+
"react": {
16+
"createClass": "createReactClass", // Regex for Component Factory to use,
17+
// default to "createReactClass"
18+
"pragma": "React", // Pragma to use, default to "React"
19+
"fragment": "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
20+
"version": "detect" // React version. "detect" automatically picks the version you have installed.
21+
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
22+
// It will default to "latest" and warn if missing, and to "detect" in the future
23+
},
24+
"componentWrapperFunctions": [
25+
// The name of any function used to wrap components, e.g. Mobx `observer` function. If this isn't set, components wrapped by these functions will be skipped.
26+
"styled" // `property`
27+
]
28+
},
29+
"ignorePatterns": ["/build/**"],
30+
"rules": {
31+
"@typescript-eslint/no-non-null-assertion": 0,
32+
"@typescript-eslint/no-unused-vars": 0,
33+
"react/prop-types": 0
34+
}
35+
}

Diff for: .prettierrc.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"$schema": "https://json.schemastore.org/prettierrc",
3+
"arrowParens": "avoid",
4+
"bracketSpacing": true,
5+
"embeddedLanguageFormatting": "auto",
6+
"endOfLine": "lf",
7+
"bracketSameLine": false,
8+
"jsxSingleQuote": false,
9+
"proseWrap": "preserve",
10+
"quoteProps": "as-needed",
11+
"singleQuote": true,
12+
"tabWidth": 2,
13+
"trailingComma": "all",
14+
"useTabs": true,
15+
"semi": true,
16+
"printWidth": 150,
17+
"requirePragma": false
18+
}

Diff for: .vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"java.compile.nullAnalysis.mode": "automatic"
3+
}

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# JCR Hopper
22

3-
43
<img src="./docs/logo.svg" width=200 height=200 alt="">
54

65
_Migrate AEM with Grace_

Diff for: build.gradle.kts

+31-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import com.cognifide.gradle.aem.bundle.tasks.bundle
2-
import com.github.gradle.node.npm.task.NpxTask
2+
import com.github.gradle.node.npm.task.NpmTask
33

44
plugins {
55
java
@@ -103,19 +103,44 @@ node {
103103
aem {
104104
bundleEmbed(libs.apacheCommons.jexl, "org.apache.commons.jexl3.*", export = false)
105105

106-
107-
108106
tasks {
109-
val frontendBuild by registering(NpxTask::class) {
107+
val frontendBuild by registering(NpmTask::class) {
110108
dependsOn(npmInstall)
111-
command.set("parcel")
112-
args.add("build")
109+
npmCommand.set(listOf("run", "build"))
113110

114111
inputs.dir("src/main/frontend")
115112
inputs.file("package-lock.json")
116113
outputs.dir(layout.buildDirectory.dir("frontend"))
117114
}
118115

116+
val lint by registering(NpmTask::class) {
117+
dependsOn(npmInstall)
118+
npmCommand.set(listOf("run", "test:lint"))
119+
120+
inputs.dir("src/main/frontend")
121+
inputs.file("package-lock.json")
122+
}
123+
124+
val tsc by registering(NpmTask::class) {
125+
dependsOn(npmInstall)
126+
npmCommand.set(listOf("run", "test:compile"))
127+
128+
inputs.dir("src/main/frontend")
129+
inputs.file("package-lock.json")
130+
}
131+
132+
val format by registering(NpmTask::class) {
133+
dependsOn(npmInstall)
134+
npmCommand.set(listOf("run", "test:format"))
135+
136+
inputs.dir("src/main/frontend")
137+
inputs.file("package-lock.json")
138+
}
139+
140+
check {
141+
dependsOn(lint, tsc, format)
142+
}
143+
119144
val aemContent by registering(Sync::class) {
120145
from("$projectDir/src/main/content")
121146
from(frontendBuild)

0 commit comments

Comments
 (0)