Skip to content

Commit a310004

Browse files
committed
Merge remote-tracking branch 'origin' into v14/chore/check-paths-in-dist-cms
2 parents f625848 + 11afbed commit a310004

File tree

218 files changed

+513
-484
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+513
-484
lines changed

eslint.config.js

Lines changed: 52 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import js from "@eslint/js";
2-
import globals from "globals";
3-
import importPlugin from "eslint-plugin-import";
4-
import localRules from "eslint-plugin-local-rules";
5-
import wcPlugin from "eslint-plugin-wc";
6-
import litPlugin from "eslint-plugin-lit";
7-
import litA11yPlugin from "eslint-plugin-lit-a11y";
8-
import storybookPlugin from "eslint-plugin-storybook";
1+
import js from '@eslint/js';
2+
import globals from 'globals';
3+
import importPlugin from 'eslint-plugin-import';
4+
import localRules from 'eslint-plugin-local-rules';
5+
import wcPlugin from 'eslint-plugin-wc';
6+
import litPlugin from 'eslint-plugin-lit';
7+
import litA11yPlugin from 'eslint-plugin-lit-a11y';
8+
import storybookPlugin from 'eslint-plugin-storybook';
99
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
1010
import tseslint from 'typescript-eslint';
1111

@@ -18,11 +18,11 @@ export default [
1818
// Global ignores
1919
{
2020
ignores: [
21-
"**/rollup.config.js",
22-
"**/vite.config.ts",
23-
"src/external",
24-
"src/packages/core/icon-registry/icons",
25-
"src/packages/core/icon-registry/icons.ts"
21+
'**/rollup.config.js',
22+
'**/vite.config.ts',
23+
'src/external',
24+
'src/packages/core/icon-registry/icons',
25+
'src/packages/core/icon-registry/icons.ts',
2626
],
2727
},
2828

@@ -35,52 +35,52 @@ export default [
3535
},
3636
globals: {
3737
...globals.browser,
38-
}
38+
},
3939
},
4040
plugins: {
4141
import: importPlugin,
42-
"local-rules": localRules,
43-
"wc": wcPlugin,
44-
"lit": litPlugin,
45-
"lit-a11y": litA11yPlugin,
46-
"storybook": storybookPlugin
42+
'local-rules': localRules,
43+
wc: wcPlugin,
44+
lit: litPlugin,
45+
'lit-a11y': litA11yPlugin,
46+
storybook: storybookPlugin,
4747
},
4848
rules: {
49-
semi: ["warn", "always"],
50-
"no-unused-vars": "warn",
51-
"no-var": "error",
52-
"import/no-unresolved": "off",
53-
"import/order": ["warn", { "groups": ["builtin", "parent", "sibling", "index", "external"] }],
54-
"import/no-self-import": "error",
55-
"import/no-cycle": ["error", { "maxDepth": 6, "allowUnsafeDynamicCyclicDependency": true }],
56-
"local-rules/bad-type-import": "error",
57-
"local-rules/enforce-element-suffix-on-element-class-name": "error",
58-
"local-rules/enforce-umb-prefix-on-element-name": "error",
59-
"local-rules/ensure-relative-import-use-js-extension": "error",
60-
"local-rules/no-direct-api-import": "warn",
61-
"local-rules/prefer-import-aliases": "error",
62-
"local-rules/prefer-static-styles-last": "warn",
63-
"local-rules/umb-class-prefix": "error",
64-
"local-rules/no-relative-import-to-import-map-module": "error",
65-
"local-rules/enforce-umbraco-external-imports": [
66-
"error",
49+
semi: ['warn', 'always'],
50+
'no-unused-vars': 'off', //Let '@typescript-eslint/no-unused-vars' catch the errors to allow unused function parameters (ex: in interfaces)
51+
'no-var': 'error',
52+
'import/no-unresolved': 'off',
53+
'import/order': ['warn', { groups: ['builtin', 'parent', 'sibling', 'index', 'external'] }],
54+
'import/no-self-import': 'error',
55+
'import/no-cycle': ['error', { maxDepth: 6, allowUnsafeDynamicCyclicDependency: true }],
56+
'local-rules/bad-type-import': 'error',
57+
'local-rules/enforce-element-suffix-on-element-class-name': 'error',
58+
'local-rules/enforce-umb-prefix-on-element-name': 'error',
59+
'local-rules/ensure-relative-import-use-js-extension': 'error',
60+
'local-rules/no-direct-api-import': 'warn',
61+
'local-rules/prefer-import-aliases': 'error',
62+
'local-rules/prefer-static-styles-last': 'warn',
63+
'local-rules/umb-class-prefix': 'error',
64+
'local-rules/no-relative-import-to-import-map-module': 'error',
65+
'local-rules/enforce-umbraco-external-imports': [
66+
'error',
6767
{
68-
"exceptions": ["@umbraco-cms", "@open-wc/testing", "@storybook", "msw", ".", "vite"]
69-
}
68+
exceptions: ['@umbraco-cms', '@open-wc/testing', '@storybook', 'msw', '.', 'vite'],
69+
},
7070
],
71-
"local-rules/exported-string-constant-naming": [
72-
"error",
71+
'local-rules/exported-string-constant-naming': [
72+
'error',
7373
{
74-
"excludedFileNames": ["umbraco-package", "input-tiny-mce.defaults"] // TODO: what to do about the tiny mce defaults?
75-
}
74+
excludedFileNames: ['umbraco-package', 'input-tiny-mce.defaults'], // TODO: what to do about the tiny mce defaults?
75+
},
7676
],
77-
"@typescript-eslint/no-non-null-assertion": "off",
78-
"@typescript-eslint/no-explicit-any": "warn",
79-
"@typescript-eslint/no-unused-vars": "warn",
80-
"@typescript-eslint/consistent-type-exports": "error",
81-
"@typescript-eslint/consistent-type-imports": "error",
82-
"@typescript-eslint/no-import-type-side-effects": "warn"
83-
}
77+
'@typescript-eslint/no-non-null-assertion': 'off',
78+
'@typescript-eslint/no-explicit-any': 'warn',
79+
'@typescript-eslint/no-unused-vars': 'error',
80+
'@typescript-eslint/consistent-type-exports': 'error',
81+
'@typescript-eslint/consistent-type-imports': 'error',
82+
'@typescript-eslint/no-import-type-side-effects': 'warn',
83+
},
8484
},
8585

8686
// Pattern-specific overrides
@@ -90,7 +90,7 @@ export default [
9090
languageOptions: {
9191
globals: {
9292
...globals.node,
93-
}
94-
}
93+
},
94+
},
9595
},
9696
];

package-lock.json

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,8 @@
141141
"./src/packages/tags",
142142
"./src/packages/templating",
143143
"./src/packages/property-editors",
144-
"./src/packages/media"
144+
"./src/packages/media",
145+
"./src/packages/user"
145146
],
146147
"scripts": {
147148
"backoffice:test:e2e": "npx playwright test",

src/libs/controller-api/controller.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('UmbController', () => {
5151
let hostElement: UmbControllerHostElement;
5252

5353
beforeEach(() => {
54-
hostElement = document.createElement('test-my-controller-host') as UmbControllerHostElement;
54+
hostElement = new UmbTestControllerHostElement();
5555
});
5656

5757
describe('Controller Host Public API', () => {

src/libs/element-api/element.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ describe('UmbElementMixin', () => {
152152
expect(hostElement.hasUmbController(ctrl)).to.be.true;
153153

154154
const ctrl2 = hostElement.observe(myObservable, (value) => {
155+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
155156
const a = value + 'bla';
156157
});
157158

@@ -172,6 +173,7 @@ describe('UmbElementMixin', () => {
172173
const ctrl2 = hostElement.observe(
173174
undefined,
174175
() => {
176+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
175177
const a = 1;
176178
},
177179
'observer',

src/libs/extension-api/controller/base-extension-initializer.controller.test.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import { UmbSwitchCondition } from '@umbraco-cms/backoffice/extension-registry';
1616
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
1717

1818
@customElement('umb-test-controller-host')
19+
// Element is used in tests
20+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1921
class UmbTestControllerHostElement extends UmbControllerHostElementMixin(HTMLElement) {}
2022

2123
class UmbTestExtensionController extends UmbBaseExtensionInitializer {
@@ -57,12 +59,12 @@ class UmbTestConditionAlwaysInvalid extends UmbControllerBase implements UmbExte
5759

5860
describe('UmbBaseExtensionController', () => {
5961
describe('Manifest without conditions', () => {
60-
let hostElement: UmbControllerHostElement;
62+
//let hostElement: UmbControllerHostElement;
6163
let extensionRegistry: UmbExtensionRegistry<ManifestWithDynamicConditions>;
6264
let manifest: ManifestWithDynamicConditions;
6365

6466
beforeEach(async () => {
65-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
67+
//hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
6668
extensionRegistry = new UmbExtensionRegistry();
6769
manifest = {
6870
type: 'section',
@@ -94,12 +96,12 @@ describe('UmbBaseExtensionController', () => {
9496
});
9597

9698
describe('Manifest with empty conditions', () => {
97-
let hostElement: UmbControllerHostElement;
99+
//let hostElement: UmbControllerHostElement;
98100
let extensionRegistry: UmbExtensionRegistry<ManifestWithDynamicConditions>;
99101
let manifest: ManifestWithDynamicConditions;
100102

101103
beforeEach(async () => {
102-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
104+
//hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
103105
extensionRegistry = new UmbExtensionRegistry();
104106
manifest = {
105107
type: 'section',

src/libs/extension-api/controller/base-extensions-initializer.controller.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import type { SpecificManifestTypeOrManifestBase } from '../types/map.types.js';
2-
import { map } from '@umbraco-cms/backoffice/external/rxjs';
32
import type {
43
ManifestBase,
54
UmbBaseExtensionInitializer,
65
UmbExtensionRegistry,
76
} from '@umbraco-cms/backoffice/extension-api';
87
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
98
import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api';
10-
import { createObservablePart } from '@umbraco-cms/backoffice/observable-api';
119

1210
export type PermittedControllerType<ControllerType extends { manifest: any }> = ControllerType & {
1311
manifest: Required<Pick<ControllerType, 'manifest'>>;

src/libs/extension-api/controller/extension-api-initializer.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import { customElement, html } from '@umbraco-cms/backoffice/external/lit';
99
import { type ManifestSection, UmbSwitchCondition } from '@umbraco-cms/backoffice/extension-registry';
1010

1111
@customElement('umb-test-controller-host')
12+
// Element is used in tests
13+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1214
class UmbTestControllerHostElement extends UmbControllerHostElementMixin(HTMLElement) {}
1315

1416
class UmbTestApiController extends UmbControllerBase {

src/libs/extension-api/controller/extension-element-and-api-initializer.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
import { UmbExtensionRegistry } from '../registry/extension.registry.js';
22
import type { ManifestElementAndApi, ManifestWithDynamicConditions, UmbApi } from '../index.js';
33
import { UmbExtensionElementAndApiInitializer } from './extension-element-and-api-initializer.controller.js';
4-
import { expect, fixture } from '@open-wc/testing';
4+
import { expect } from '@open-wc/testing';
55
import type { UmbControllerHost, UmbControllerHostElement } from '@umbraco-cms/backoffice/controller-api';
66
import { UmbControllerHostElementMixin } from '@umbraco-cms/backoffice/controller-api';
7-
import { customElement, html } from '@umbraco-cms/backoffice/external/lit';
7+
import { customElement } from '@umbraco-cms/backoffice/external/lit';
88
import { UmbSwitchCondition } from '@umbraco-cms/backoffice/extension-registry';
99
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
1010

1111
@customElement('umb-test-controller-host')
1212
class UmbTestControllerHostElement extends UmbControllerHostElementMixin(HTMLElement) {}
1313

1414
@customElement('umb-test-extension-element')
15+
// Ignoring eslint rule. Element name is used for testing.
16+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
1517
class UmbTestExtensionElement extends UmbControllerHostElementMixin(HTMLElement) {}
1618

1719
class UmbTestApiController extends UmbControllerBase implements UmbApi {
@@ -35,7 +37,7 @@ describe('UmbExtensionElementAndApiController', () => {
3537
let manifest: TestManifest;
3638

3739
beforeEach(async () => {
38-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
40+
hostElement = new UmbTestControllerHostElement();
3941
extensionRegistry = new UmbExtensionRegistry();
4042
manifest = {
4143
type: 'test-type',
@@ -105,7 +107,7 @@ describe('UmbExtensionElementAndApiController', () => {
105107
let manifest: TestManifest;
106108

107109
beforeEach(async () => {
108-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
110+
hostElement = new UmbTestControllerHostElement();
109111
extensionRegistry = new UmbExtensionRegistry();
110112

111113
manifest = {
@@ -175,7 +177,7 @@ describe('UmbExtensionElementAndApiController', () => {
175177
let manifest: TestManifest;
176178

177179
beforeEach(async () => {
178-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
180+
hostElement = new UmbTestControllerHostElement();
179181
extensionRegistry = new UmbExtensionRegistry();
180182
manifest = {
181183
type: 'test-type',
@@ -238,7 +240,7 @@ describe('UmbExtensionElementAndApiController', () => {
238240
let manifest: TestManifest;
239241

240242
beforeEach(async () => {
241-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
243+
hostElement = new UmbTestControllerHostElement();
242244
extensionRegistry = new UmbExtensionRegistry();
243245

244246
manifest = {

src/libs/extension-api/controller/extension-element-initializer.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ describe('UmbExtensionElementController', () => {
1515
let manifest: ManifestSection;
1616

1717
beforeEach(async () => {
18-
hostElement = await fixture(html`<umb-test-controller-host></umb-test-controller-host>`);
18+
hostElement = new UmbTestControllerHostElement();
1919
extensionRegistry = new UmbExtensionRegistry();
2020
manifest = {
2121
type: 'section',

0 commit comments

Comments
 (0)