Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[{package.json,*.md}]
charset = utf-8
indent_style = space
indent_size = 2
8 changes: 8 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules/
build/
dist/
out/
.xp/
**/*.js
**/*.d.ts
**/spec/**
81 changes: 81 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
module.exports = {
'extends': [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
],
'parser': '@typescript-eslint/parser',
'parserOptions': {
'ecmaVersion': 2019,
'project': 'tsconfig.json',
'tsconfigRootDir': '.',
},
'rules': {
'max-len': ['error', {'code': 140, 'comments': 180}],
'block-spacing': ['error', 'always'],
'space-before-function-paren': ['error', {'anonymous': 'always', 'named': 'never'}],
'space-in-parens': ['error', 'never'],
'object-curly-spacing': ['error', 'never'],
'lines-between-class-members': ['error', 'always', {exceptAfterSingleLine: true}],
'arrow-spacing': ['error', {'before': true, 'after': true}],
'array-bracket-spacing': ['error', 'never'],
'computed-property-spacing': ['error', 'never'],
'template-curly-spacing': ['error', 'never'],
'object-property-newline': ['off', {'allowMultiplePropertiesPerLine': true}],
'quotes': ['error', 'single', {'avoidEscape': true}],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': ['off'],
'semi': 'off',
'@typescript-eslint/semi': ['error'],
'no-control-regex': 'off',

// Codacy linting
'complexity': ['warn', {'max': 4}],

// TODO: Remove rules, during the refactoring

// === DEFAULT RULES ===
'prefer-const': ['off'],
'no-plusplus': ['off'],
'no-extra-boolean-cast': ['off'],
'no-prototype-builtins': ['off'],
'no-useless-escape': ['off'],
'no-empty-pattern': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-inferrable-types': ['off'],
'@typescript-eslint/ban-types': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-floating-promises': ['off'],
'@typescript-eslint/restrict-plus-operands': ['off'],
'@typescript-eslint/no-implied-eval': ['off'],
'@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-empty-interface': ['off'],

// === CUSTOM RULES ===

// '@typescript-eslint/explicit-function-return-type': ['error', {allowExpressions: true}],
'@typescript-eslint/explicit-function-return-type': ['off'],

// 'comma-dangle': ['error', 'always-multiline'],
'comma-dangle': ['off'],

// '@typescript-eslint/member-ordering': ['error'],
'@typescript-eslint/member-ordering': ['off'],

// 'spaced-comment': ['error', 'always', {'exceptions': ['-', '+']}],
'spaced-comment': ['off'],

// '@typescript-eslint/no-use-before-define': ['error', {'functions': false, 'classes': true}],
'@typescript-eslint/no-use-before-define': ['off'],

// '@typescript-eslint/unbound-method': ['error', {ignoreStatic: true}],
'@typescript-eslint/unbound-method': ['off'],
},
'env': {
'browser': true,
'es6': true,
}
};
14 changes: 14 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Build

on: [ push ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: enonic/action-app-build@v1

- uses: codecov/codecov-action@v5
18 changes: 18 additions & 0 deletions .github/workflows/enonic-docgen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Generate Documentation

on:
push:
branches:
- "master"
paths:
- 'docs/**'
workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: enonic/release-tools/generate-docs@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
webhook-secret: ${{ secrets.DEVELOPER_PORTAL_WEBHOOK_SECRET }}
105 changes: 105 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
### Enonic CLI ###
.enonic

### OSX ###
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### Gradle ###
.gradle
build/

# Node
node_modules/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

### WebStorm ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm

# VSCode
/bin/
/settings.gradle
/.vscode

*.iml

## Directory-based project format:
.idea/
# if you remove the above rule, at least ignore the following:

# User-specific stuff:
# .idea/workspace.xml
# .idea/tasks.xml
# .idea/dictionaries

# Sensitive or high-churn files:
# .idea/dataSources.ids
# .idea/dataSources.xml
# .idea/sqlDataSources.xml
# .idea/dynamic.xml
# .idea/uiDesigner.xml

# Gradle:
# .idea/gradle.xml
# .idea/libraries

# Mongo Explorer plugin:
# .idea/mongoSettings.xml

## File-based project format:
*.ipr
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties

### Sass ###
.sass-cache
*.css.map

# Jest
/coverage

# ES lint
/.eslintcache
75 changes: 75 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
plugins {
id 'com.enonic.xp.app' version '3.6.1'
id 'com.github.node-gradle.node' version '7.1.0'
}

apply from: "$rootDir/gradle/env.gradle"
apply from: "$rootDir/gradle/node.gradle"

app {
name = "${appName}"
displayName = "${appDisplayName}"
vendorName = "${vendorName}"
vendorUrl = "${vendorUrl}"
systemVersion = "${xpVersion}"
}

dependencies {
implementation "com.enonic.xp:core-api:${xpVersion}"
implementation "com.enonic.xp:portal-api:${xpVersion}"

include "com.enonic.xp:lib-portal:${xpVersion}"
include "com.enonic.xp:lib-event:${xpVersion}"
include "com.enonic.xp:lib-websocket:${xpVersion}"

include "com.enonic.lib:lib-graphql:2.1.0"
include "com.enonic.lib:lib-mustache:2.1.1"
include "com.enonic.lib:lib-static:2.1.1"
include "com.enonic.lib:lib-router:3.2.0"
}

repositories {
mavenLocal()
mavenCentral()
xp.enonicRepo( 'dev' )
}

node {
version = '18.17.1'
download = true
}

tasks.register( 'lint', NpmTask ) {
group 'verification'
dependsOn( npmInstall )
args = ['run', 'lint:quiet']
inputs.files fileTree( dir: 'src', include: '**/*.ts' )
}

tasks.register( 'webpack', NpmTask ) {
dependsOn( npmInstall )
environment = ['NODE_ENV': nodeEnvironment()]
description = 'Build UI resources (ts, css, etc).'
args = ['run', 'build']
inputs.dir "src/main"
inputs.file 'webpack.config.js'
outputs.dir layout.buildDirectory.dir( "resources/main" )
}

check.dependsOn( lint )

jar {
exclude 'assets/**/*.tsx'
exclude 'assets/**/*.less'
exclude 'assets/styles/graphiql.min.css'
exclude 'assets/**/styles/*.js'

if ( isProd() )
{
exclude 'assets/**/*.map'
}

outputs.dir layout.buildDirectory.dir( "resources/main" )

dependsOn( webpack )
}
Loading