Skip to content

Commit

Permalink
Merge pull request #77 from built-on-openfin/dev/martyn/simplify
Browse files Browse the repository at this point in the history
Simplify the container starter
  • Loading branch information
obany authored Jul 17, 2023
2 parents 803119f + f94308e commit 25247c6
Show file tree
Hide file tree
Showing 277 changed files with 25,408 additions and 7,336 deletions.
150 changes: 132 additions & 18 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ module.exports = {
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:jsdoc/recommended',
'plugin:promise/recommended',
'plugin:unicorn/recommended'
'plugin:unicorn/all'
],
globals: {
fin: 'readonly',
Expand All @@ -20,7 +21,6 @@ module.exports = {
'**/node_modules/*',
'**/*.bundle.js',
'**/build/**/*.js',
'preload.js',
'**/wc-fin/*.js',
'**/3rd-party/*',
'**/*.d.ts',
Expand All @@ -33,7 +33,13 @@ module.exports = {
sourceType: 'module',
tsconfigRootDir: __dirname
},
plugins: ['promise', 'simple-import-sort', 'unicorn', 'unused-imports'],
plugins: ['promise', 'simple-import-sort', 'jsdoc', 'unicorn', 'unused-imports'],
settings: {
jsdoc: {
ignoreInternal: true,
mode: 'typescript'
}
},
root: true,
rules: {
'accessor-pairs': ['error'],
Expand Down Expand Up @@ -69,7 +75,7 @@ module.exports = {
'func-call-spacing': ['off'],
'func-name-matching': ['error'],
'func-names': ['error'],
'func-style': ['off'],
'func-style': ['error', 'declaration'],
'function-call-argument-newline': ['off'],
'function-paren-newline': ['off'],
'generator-star-spacing': ['error'],
Expand All @@ -89,6 +95,7 @@ module.exports = {
'import/no-named-as-default': ['warn'],
'import/no-named-as-default-member': ['warn'],
'import/no-unresolved': ['off'],
'import/no-unused-modules': ['off'],
'import/order': [
'error',
{
Expand All @@ -112,6 +119,7 @@ module.exports = {
'linebreak-style': ['error'],
'lines-around-comment': ['off'],
'lines-between-class-members': ['off'],
'logical-assignment-operators': ['off'],
'max-classes-per-file': ['error'],
'max-depth': ['off'],
'max-len': [
Expand Down Expand Up @@ -147,6 +155,7 @@ module.exports = {
'no-cond-assign': ['error'],
'no-confusing-arrow': ['error'],
'no-console': ['off'],
'no-constant-binary-expression': ['error'],
'no-const-assign': ['off'],
'no-constant-condition': ['error'],
'no-constructor-return': ['error'],
Expand Down Expand Up @@ -276,7 +285,7 @@ module.exports = {
'no-useless-return': ['error'],
'no-var': ['error'],
'no-void': ['error'],
'no-warning-comments': ['error'],
'no-warning-comments': ['off'],
'no-whitespace-before-property': ['error'],
'no-with': ['error'],
'nonblock-statement-body-position': ['error'],
Expand Down Expand Up @@ -334,9 +343,8 @@ module.exports = {
'unicorn/custom-error-definition': ['off'],
'unicorn/empty-brace-spaces': ['off'],
'unicorn/error-message': ['error'],
'unicorn/empty-brace-spaces': ['off'],
'unicorn/escape-case': ['error'],
'unicorn/expiring-todo-comments': ['off'],
'unicorn/expiring-todo-comments': ['error'],
'unicorn/explicit-length-check': ['off'],
'unicorn/filename-case': ['off'],
'unicorn/import-index': ['error'],
Expand All @@ -363,12 +371,14 @@ module.exports = {
'unicorn/no-zero-fractions': ['error'],
'unicorn/number-literal-case': ['off'],
'unicorn/numeric-separators-style': ['off'],
'unicorn/prefer-at': ['off'],
'unicorn/prefer-add-event-listener': ['error'],
'unicorn/prefer-code-point': ['off'],
'unicorn/prefer-dataset': ['error'],
'unicorn/prefer-event-key': ['error'],
'unicorn/prefer-flat-map': ['error'],
'unicorn/prefer-includes': ['error'],
'unicorn/prefer-json-parse-buffer': ['off'],
'unicorn/prefer-modern-dom-apis': ['error'],
'unicorn/prefer-module': ['off'],
'unicorn/prefer-negative-index': ['error'],
Expand All @@ -379,10 +389,10 @@ module.exports = {
'unicorn/prefer-optional-catch-binding': ['error'],
'unicorn/prefer-query-selector': ['error'],
'unicorn/prefer-reflect-apply': ['error'],
'unicorn/prefer-replace-all': ['off'],
'unicorn/prefer-set-has': ['off'],
'unicorn/prefer-spread': ['off'],
'unicorn/prefer-starts-ends-with': ['error'],
'unicorn/prefer-string-replace-all': ['off'],
'unicorn/prefer-string-slice': ['error'],
'unicorn/prefer-switch': ['off'],
'unicorn/prefer-top-level-await': ['off'],
Expand All @@ -400,7 +410,97 @@ module.exports = {
'wrap-iife': ['error'],
'wrap-regex': ['off'],
'yield-star-spacing': ['error'],
yoda: ['error']
yoda: ['error'],
'jsdoc/check-access': 'error',
'jsdoc/check-alignment': 'error',
'jsdoc/check-examples': 'off',
'jsdoc/check-indentation': 'error',
'jsdoc/check-line-alignment': 'error',
'jsdoc/check-param-names': 'error',
'jsdoc/check-property-names': 'error',
'jsdoc/check-syntax': 'error',
'jsdoc/check-tag-names': 'error',
'jsdoc/check-types': 'error',
'jsdoc/check-values': 'error',
'jsdoc/empty-tags': 'error',
'jsdoc/implements-on-classes': 'error',
'jsdoc/match-description': ['error'],
'jsdoc/newline-after-description': 'off',
'jsdoc/no-bad-blocks': 'error',
'jsdoc/no-defaults': 'error',
'jsdoc/no-types': 'error',
'jsdoc/no-undefined-types': 'error',
'jsdoc/require-asterisk-prefix': 'error',
'jsdoc/require-description': 'error',
'jsdoc/require-description-complete-sentence': 'off',
'jsdoc/require-example': 'off',
'jsdoc/require-file-overview': 'off',
'jsdoc/require-hyphen-before-param-description': 'off',
'jsdoc/require-jsdoc': [
'error',
{
require: {
ArrowFunctionExpression: false,
ClassDeclaration: true,
ClassExpression: true,
FunctionDeclaration: true,
FunctionExpression: true,
MethodDefinition: true
},
contexts: [
'FunctionDeclaration',
'FunctionExpression',
'MethodDefinition',
'TSDeclareFunction',
'TSEnumDeclaration',
'TSInterfaceDeclaration',
'TSMethodDeclaration',
'TSMethodSignature',
'TSPropertySignature:not(TSTypeLiteral > TSPropertySignature)',
'TSTypeAliasDeclaration'
]
}
],
'jsdoc/require-param': [
'error',
{
contexts: [
'FunctionDeclaration',
'FunctionExpression',
'MethodDefinition',
'TSDeclareFunction',
'TSMethodDeclaration',
'TSMethodSignature'
]
}
],
'jsdoc/require-param-description': 'error',
'jsdoc/require-param-name': 'error',
'jsdoc/require-param-type': 'off',
'jsdoc/require-property': 'error',
'jsdoc/require-property-description': 'error',
'jsdoc/require-property-name': 'error',
'jsdoc/require-property-type': 'error',
'jsdoc/require-returns': [
'error',
{
contexts: [
'FunctionDeclaration',
'FunctionExpression',
'MethodDefinition',
'TSDeclareFunction',
'TSMethodDeclaration',
'TSMethodSignature'
]
}
],
'jsdoc/require-returns-check': 'error',
'jsdoc/require-returns-description': 'error',
'jsdoc/require-returns-type': 'off',
'jsdoc/require-throws': 'error',
'jsdoc/require-yields': 'error',
'jsdoc/require-yields-check': 'error',
'jsdoc/valid-types': 2
},
overrides: [
{
Expand All @@ -412,23 +512,35 @@ module.exports = {
{
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking'
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict'
],
files: ['*.ts'],
rules: {
'@typescript-eslint/adjacent-overload-signatures': ['error'],
'@typescript-eslint/array-type': ['error'],
'@typescript-eslint/await-thenable': ['error'],
'@typescript-eslint/ban-ts-comment': ['error'],
'@typescript-eslint/ban-tslint-comment': ['off'],
'@typescript-eslint/ban-types': ['error'],
'@typescript-eslint/brace-style': ['error'],
'@typescript-eslint/class-literal-property-style': ['error'],
'@typescript-eslint/comma-spacing': ['error'],
'@typescript-eslint/no-confusing-void-expression': ['off'],
'@typescript-eslint/consistent-generic-constructors': ['error'],
'@typescript-eslint/consistent-indexed-object-style': ['error', 'index-signature'],
'@typescript-eslint/consistent-type-assertions': ['error'],
'@typescript-eslint/consistent-type-definitions': ['error'],
'@typescript-eslint/consistent-type-imports': [
'error',
{
fixStyle: 'inline-type-imports'
}
],
'@typescript-eslint/object-curly-spacing': ['off'],
'@typescript-eslint/default-param-last': ['error'],
'@typescript-eslint/dot-notation': ['error'],
'@typescript-eslint/explicit-function-return-type': ['off'],
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
Expand All @@ -442,6 +554,7 @@ module.exports = {
'@typescript-eslint/indent': ['off'],
'@typescript-eslint/init-declarations': ['off'],
'@typescript-eslint/keyword-spacing': ['off'],
'@typescript-eslint/lines-around-comment': ['off'],
'@typescript-eslint/lines-between-class-members': ['error'],
'@typescript-eslint/member-delimiter-style': ['error'],
'@typescript-eslint/member-ordering': ['error'],
Expand Down Expand Up @@ -490,9 +603,11 @@ module.exports = {
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/no-for-in-array': ['error'],
'@typescript-eslint/no-implied-eval': ['error'],
'@typescript-eslint/no-import-type-side-effects': ['error'],
'@typescript-eslint/no-inferrable-types': ['off'],
'@typescript-eslint/no-invalid-this': ['off'],
'@typescript-eslint/no-invalid-void-type': ['error'],
'@typescript-eslint/no-loop-func': ['off'],
'@typescript-eslint/no-magic-numbers': ['off'],
'@typescript-eslint/no-misused-new': ['error'],
'@typescript-eslint/no-misused-promises': [
Expand All @@ -505,6 +620,7 @@ module.exports = {
'@typescript-eslint/no-non-null-asserted-optional-chain': ['error'],
'@typescript-eslint/no-non-null-assertion': ['error'],
'@typescript-eslint/no-parameter-properties': ['error'],
'@typescript-eslint/no-redundant-type-constituents': ['off'],
'@typescript-eslint/no-require-imports': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-this-alias': ['error'],
Expand All @@ -515,10 +631,12 @@ module.exports = {
'@typescript-eslint/no-unnecessary-qualifier': ['error'],
'@typescript-eslint/no-unnecessary-type-arguments': ['error'],
'@typescript-eslint/no-unnecessary-type-assertion': ['error'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-unsafe-return': ['error'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/no-unsafe-enum-comparison': ['off'],
'@typescript-eslint/no-unused-expressions': ['error'],
'@typescript-eslint/no-unused-vars': [
'error',
Expand All @@ -535,12 +653,7 @@ module.exports = {
'@typescript-eslint/prefer-function-type': ['error'],
'@typescript-eslint/prefer-includes': ['error'],
'@typescript-eslint/prefer-namespace-keyword': ['error'],
'@typescript-eslint/prefer-nullish-coalescing': [
'error',
{
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: true
}
],
'@typescript-eslint/prefer-nullish-coalescing': ['error'],
'@typescript-eslint/prefer-optional-chain': ['error'],
'@typescript-eslint/prefer-readonly': ['error'],
'@typescript-eslint/prefer-readonly-parameter-types': ['off'],
Expand All @@ -556,6 +669,7 @@ module.exports = {
'@typescript-eslint/restrict-template-expressions': ['off'],
'@typescript-eslint/return-await': ['error'],
'@typescript-eslint/semi': ['error'],
'@typescript-eslint/sort-type-constituents': ['off'],
'@typescript-eslint/space-before-function-paren': [
'error',
{
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ This repository contains examples for common use cases and API implementations.

| **Example** | **Description** |
| -------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [container-platform-starter](./how-to/container-platform-starter) | This example shows a simple platform with a single view. |
| [create-window](./how-to/create-window) | This example shows how to create a dynamic window or from a manifest. |
| [use-security-realms](./how-to/use-security-realms) | This example shows you security realms work with multiple target environments |
| [use-preloads](./how-to/use-preloads) | This example shows you a number of examples on how preload scripts can be used in your application |
Expand Down
2 changes: 1 addition & 1 deletion how-to/automation-testing/create-window-js/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Learn more about OpenFin licensing at the links listed below or email us at [email protected] with questions.​
Learn more about OpenFin licensing at the links listed below or email us at [[email protected]](mailto:[email protected]) with questions.​

Licensing
Developer agreement
6 changes: 3 additions & 3 deletions how-to/automation-testing/create-window-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"author": "[email protected]",
"license": "SEE LICENSE IN LICENSE.MD",
"devDependencies": {
"@openfin/automation-cli": "^1.0.1",
"@openfin/automation-helpers": "^1.0.1",
"@openfin/automation-native": "^1.0.1",
"@openfin/automation-cli": "^1.0.13",
"@openfin/automation-helpers": "^1.0.13",
"@openfin/automation-native": "^1.0.13",
"chai": "4.3.7",
"mochawesome": "7.1.3"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Learn more about OpenFin licensing at the links listed below or email us at [email protected] with questions.​
Learn more about OpenFin licensing at the links listed below or email us at [[email protected]](mailto:[email protected]) with questions.​

Licensing
Developer agreement
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"author": "[email protected]",
"license": "SEE LICENSE IN LICENSE.MD",
"devDependencies": {
"@openfin/automation-cli": "^1.0.1",
"@openfin/automation-helpers": "^1.0.1",
"@openfin/automation-native": "^1.0.1",
"@openfin/automation-cli": "^1.0.13",
"@openfin/automation-helpers": "^1.0.13",
"@openfin/automation-native": "^1.0.13",
"chai": "4.3.7",
"mochawesome": "7.1.3"
}
Expand Down
2 changes: 1 addition & 1 deletion how-to/automation-testing/use-window-options-js/LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Learn more about OpenFin licensing at the links listed below or email us at [email protected] with questions.​
Learn more about OpenFin licensing at the links listed below or email us at [[email protected]](mailto:[email protected]) with questions.​

Licensing
Developer agreement
6 changes: 3 additions & 3 deletions how-to/automation-testing/use-window-options-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
"author": "[email protected]",
"license": "SEE LICENSE IN LICENSE.MD",
"devDependencies": {
"@openfin/automation-cli": "^1.0.1",
"@openfin/automation-helpers": "^1.0.1",
"@openfin/automation-native": "^1.0.1",
"@openfin/automation-cli": "^1.0.13",
"@openfin/automation-helpers": "^1.0.13",
"@openfin/automation-native": "^1.0.13",
"chai": "4.3.7",
"mochawesome": "7.1.3"
}
Expand Down
6 changes: 0 additions & 6 deletions how-to/common/LICENSE.md

This file was deleted.

1 change: 0 additions & 1 deletion how-to/common/client/src/index.ts

This file was deleted.

Loading

0 comments on commit 25247c6

Please sign in to comment.