Skip to content

Commit

Permalink
feat(editor): implement frontend checks
Browse files Browse the repository at this point in the history
  • Loading branch information
sabberworm committed Oct 7, 2024
1 parent 4fa38f5 commit 3dc0629
Show file tree
Hide file tree
Showing 8 changed files with 13,814 additions and 13,605 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"env": {
"browser": true,
"es2021": true
},
"extends": ["eslint:recommended", "plugin:react/recommended", "plugin:@typescript-eslint/recommended", "prettier"],
"overrides": [],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": ["react", "react-hooks", "@typescript-eslint"],
"settings": {
"react": {
"createClass": "createReactClass", // Regex for Component Factory to use,
// default to "createReactClass"
"pragma": "React", // Pragma to use, default to "React"
"fragment": "Fragment", // Fragment to use (may be a property of <pragma>), default to "Fragment"
"version": "detect" // React version. "detect" automatically picks the version you have installed.
// You can also use `16.0`, `16.3`, etc, if you want to override the detected value.
// It will default to "latest" and warn if missing, and to "detect" in the future
},
"componentWrapperFunctions": [
// 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.
"styled" // `property`
]
},
"ignorePatterns": ["/build/**"],
"rules": {
"@typescript-eslint/no-non-null-assertion": 0,
"@typescript-eslint/no-unused-vars": 0,
"react/prop-types": 0
}
}
18 changes: 18 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"arrowParens": "avoid",
"bracketSpacing": true,
"embeddedLanguageFormatting": "auto",
"endOfLine": "lf",
"bracketSameLine": false,
"jsxSingleQuote": false,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": true,
"semi": true,
"printWidth": 150,
"requirePragma": false
}
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.compile.nullAnalysis.mode": "automatic"
}
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# JCR Hopper


<img src="./docs/logo.svg" width=200 height=200 alt="">

_Migrate AEM with Grace_
Expand Down
37 changes: 31 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import com.cognifide.gradle.aem.bundle.tasks.bundle
import com.github.gradle.node.npm.task.NpxTask
import com.github.gradle.node.npm.task.NpmTask

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



tasks {
val frontendBuild by registering(NpxTask::class) {
val frontendBuild by registering(NpmTask::class) {
dependsOn(npmInstall)
command.set("parcel")
args.add("build")
npmCommand.set(listOf("run", "build"))

inputs.dir("src/main/frontend")
inputs.file("package-lock.json")
outputs.dir(layout.buildDirectory.dir("frontend"))
}

val lint by registering(NpmTask::class) {
dependsOn(npmInstall)
npmCommand.set(listOf("run", "test:lint"))

inputs.dir("src/main/frontend")
inputs.file("package-lock.json")
}

val tsc by registering(NpmTask::class) {
dependsOn(npmInstall)
npmCommand.set(listOf("run", "test:compile"))

inputs.dir("src/main/frontend")
inputs.file("package-lock.json")
}

val format by registering(NpmTask::class) {
dependsOn(npmInstall)
npmCommand.set(listOf("run", "test:format"))

inputs.dir("src/main/frontend")
inputs.file("package-lock.json")
}

check {
dependsOn(lint, tsc, format)
}

val aemContent by registering(Sync::class) {
from("$projectDir/src/main/content")
from(frontendBuild)
Expand Down
Loading

0 comments on commit 3dc0629

Please sign in to comment.