Skip to content

Commit 97fc2d8

Browse files
authored
Merge branch 'main' into v14/bugfix/caret-labels
2 parents 1e9fd05 + 93d8d00 commit 97fc2d8

File tree

72 files changed

+256
-196
lines changed

Some content is hidden

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

72 files changed

+256
-196
lines changed

.github/workflows/build_test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- run: npm ci --no-audit --no-fund --prefer-offline
3737
- run: npm run lint:errors
3838
- run: npm run build:for:cms
39+
- run: npm run check:paths
3940
- run: npm run generate:jsonschema:dist
4041

4142
test:

devops/build/check-path-length.js

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,28 @@ console.log('\n-----------------------------------');
1818
console.log('Results:');
1919
console.log('-----------------------------------\n');
2020

21+
const hasError = checkPathLength(PROJECT_DIR);
22+
23+
if (hasError) {
24+
console.log('\n-----------------------------------');
25+
console.log(ERROR_COLOR, 'Path length check failed');
26+
console.log('-----------------------------------\n');
27+
if (IS_CI && processExitCode) {
28+
process.exit(processExitCode);
29+
}
30+
} else {
31+
console.log('\n-----------------------------------');
32+
console.log(SUCCESS_COLOR, 'Path length check passed');
33+
console.log('-----------------------------------\n');
34+
}
35+
36+
// Functions
37+
38+
/**
39+
* Recursively check the path length of all files in a directory.
40+
* @param {string} dir - The directory to check for path lengths
41+
* @returns {boolean}
42+
*/
2143
function checkPathLength(dir) {
2244
const files = readdirSync(dir);
2345
let hasError = false;
@@ -28,11 +50,11 @@ function checkPathLength(dir) {
2850
hasError = true;
2951

3052
if (IS_AZURE_PIPELINES) {
31-
console.error(`##vso[task.logissue type=warning;sourcepath=${filePath};]Path exceeds maximum length of ${MAX_PATH_LENGTH} characters: ${filePath} with ${filePath.length} characters`);
53+
console.error(`##vso[task.logissue type=error;sourcepath=${mapFileToSourcePath(filePath)};]Path exceeds maximum length of ${MAX_PATH_LENGTH} characters: ${filePath} with ${filePath.length} characters`);
3254
} else if (IS_GITHUB_ACTIONS) {
33-
console.error(`::warning file=${filePath},title=Path exceeds ${MAX_PATH_LENGTH} characters::Paths should not be longer than ${MAX_PATH_LENGTH} characters to support WIN32 systems. The file ${filePath} exceeds that with ${filePath.length - MAX_PATH_LENGTH} characters.`);
55+
console.error(`::error file=${mapFileToSourcePath(filePath)},title=Path exceeds ${MAX_PATH_LENGTH} characters::Paths should not be longer than ${MAX_PATH_LENGTH} characters to support WIN32 systems. The file ${filePath} exceeds that with ${filePath.length - MAX_PATH_LENGTH} characters.`);
3456
} else {
35-
console.error(`Path exceeds maximum length of ${MAX_PATH_LENGTH} characters: ${FILE_PATH_COLOR}`, filePath, filePath.length - MAX_PATH_LENGTH);
57+
console.error(FILE_PATH_COLOR, mapFileToSourcePath(filePath), '(exceeds by', filePath.length - MAX_PATH_LENGTH, 'chars)');
3658
}
3759
}
3860

@@ -47,17 +69,12 @@ function checkPathLength(dir) {
4769
return hasError;
4870
}
4971

50-
const hasError = checkPathLength(PROJECT_DIR, MAX_PATH_LENGTH);
51-
52-
if (hasError) {
53-
console.error('\n-----------------------------------');
54-
console.error(ERROR_COLOR, 'Path length check failed');
55-
console.error('-----------------------------------\n');
56-
if (IS_CI && processExitCode) {
57-
process.exit(processExitCode);
58-
}
59-
} else {
60-
console.log('\n-----------------------------------');
61-
console.log(SUCCESS_COLOR, 'Path length check passed');
62-
console.log('-----------------------------------\n');
72+
/**
73+
* Maps a file path to a source path for CI logs.
74+
* @remark This might not always work as expected, especially on bundled files, but it's a best effort to map the file path to a source path.
75+
* @param {string} file - The file path to map to a source path
76+
* @returns {string}
77+
*/
78+
function mapFileToSourcePath(file) {
79+
return file.replace(PROJECT_DIR, 'src').replace('.js', '.ts');
6380
}

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@
138138
"./src/packages/health-check",
139139
"./src/packages/language",
140140
"./src/packages/media",
141+
"./src/packages/members",
141142
"./src/packages/multi-url-picker",
142143
"./src/packages/property-editors",
143144
"./src/packages/tags",
@@ -150,13 +151,14 @@
150151
"backoffice:test:e2e": "npx playwright test",
151152
"build-storybook": "npm run wc-analyze && storybook build",
152153
"build:for:cms": "npm run build && npm run build:workspaces && npm run generate:manifest && npm run package:validate && node ./devops/build/copy-to-cms.js",
153-
"build:for:npm": "npm run build && npm run generate:manifest && npm run package:validate",
154+
"build:for:npm": "npm run build -- --declaration && npm run generate:manifest && npm run package:validate",
154155
"build:for:static": "vite build",
155156
"build:vite": "tsc && vite build --mode staging",
156157
"build:workspaces": "npm run build -ws --if-present",
157-
"build": "tsc --project ./src/tsconfig.build.json && rollup -c ./src/rollup.config.js",
158+
"build": "tsc --project ./src/tsconfig.build.json",
159+
"postbuild": "rollup -c ./src/rollup.config.js",
158160
"check": "npm run lint:errors && npm run compile && npm run build-storybook && npm run generate:jsonschema:dist",
159-
"check:paths": "node ./devops/build/check-path-length.js src 140",
161+
"check:paths": "node ./devops/build/check-path-length.js dist-cms 120",
160162
"compile": "tsc",
161163
"postinstall": "npm run generate:tsconfig",
162164
"dev": "vite",
@@ -189,7 +191,7 @@
189191
"wc-analyze": "wca **/*.element.ts --outFile dist-cms/custom-elements.json",
190192
"generate:tsconfig": "node ./devops/tsconfig/index.js",
191193
"generate:manifest": "node ./devops/build/create-umbraco-package.js",
192-
"package:validate": "node ./devops/package/validate-exports.js && npm run check:paths",
194+
"package:validate": "node ./devops/package/validate-exports.js",
193195
"generate:ui-api-docs": "typedoc --options typedoc.config.js"
194196
},
195197
"engines": {

src/packages/media/media/property-editors/image-crops-configuration/index.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.stories.ts

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/packages/media/media/property-editors/image-crops-configuration/property-editor-ui-image-crops-configuration.test.ts

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './property-editor-ui-image-crops.element.js';

src/packages/media/media/property-editors/image-crops-configuration/manifests.ts renamed to src/packages/media/media/property-editors/image-crops/manifests.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import type { ManifestPropertyEditorUi } from '@umbraco-cms/backoffice/extension
33
export const manifest: ManifestPropertyEditorUi = {
44
type: 'propertyEditorUi',
55
alias: 'Umb.PropertyEditorUi.ImageCropsConfiguration',
6-
name: 'Image Crops Configuration Property Editor UI',
7-
element: () => import('./property-editor-ui-image-crops-configuration.element.js'),
6+
name: 'Image Crops Property Editor UI',
7+
element: () => import('./property-editor-ui-image-crops.element.js'),
88
meta: {
99
label: 'Image Crops Configuration',
1010
icon: 'icon-autofill',
Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,13 @@ export type UmbCrop = {
1313
};
1414

1515
/**
16-
* @element umb-property-editor-ui-image-crops-configuration
16+
* @element umb-property-editor-ui-image-crops
1717
*/
18-
@customElement('umb-property-editor-ui-image-crops-configuration')
19-
export class UmbPropertyEditorUIImageCropsConfigurationElement
20-
extends UmbLitElement
21-
implements UmbPropertyEditorUiElement
22-
{
18+
@customElement('umb-property-editor-ui-image-crops')
19+
export class UmbPropertyEditorUIImageCropsElement extends UmbLitElement implements UmbPropertyEditorUiElement {
2320
@query('#label')
2421
private _labelInput!: HTMLInputElement;
2522

26-
//TODO MAKE TYPE
2723
@property({ attribute: false })
2824
value: UmbCrop[] = [];
2925

@@ -188,7 +184,7 @@ export class UmbPropertyEditorUIImageCropsConfigurationElement
188184
`;
189185
}
190186

191-
static override styles = [
187+
static override readonly styles = [
192188
UmbTextStyles,
193189
css`
194190
:host {
@@ -244,10 +240,10 @@ export class UmbPropertyEditorUIImageCropsConfigurationElement
244240
];
245241
}
246242

247-
export default UmbPropertyEditorUIImageCropsConfigurationElement;
243+
export default UmbPropertyEditorUIImageCropsElement;
248244

249245
declare global {
250246
interface HTMLElementTagNameMap {
251-
'umb-property-editor-ui-image-crops-configuration': UmbPropertyEditorUIImageCropsConfigurationElement;
247+
'umb-property-editor-ui-image-crops': UmbPropertyEditorUIImageCropsElement;
252248
}
253249
}

0 commit comments

Comments
 (0)