@salesforce/metadata-plugins 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/plugins/flexipage/FlexipageParser.d.ts.map +1 -1
- package/dist/plugins/flexipage/FlexipageParser.js +3 -5
- package/dist/plugins/flexipage/transformer/FlexipageTransformerUtils.d.ts +1 -1
- package/dist/plugins/flexipage/transformer/FlexipageTransformerUtils.d.ts.map +1 -1
- package/dist/plugins/flexipage/ui/assets/index-BAFqMU7k.js +48 -0
- package/dist/plugins/flexipage/ui/index.html +1 -1
- package/dist/plugins/schema/SchemaParser.d.ts.map +1 -1
- package/dist/plugins/schema/SchemaParser.js +25 -16
- package/dist/plugins/schema/SchemaVisualizer.d.ts.map +1 -1
- package/dist/plugins/schema/SchemaVisualizer.js +3 -7
- package/dist/plugins/schema/types/SchemaERDData.d.ts +2 -0
- package/dist/plugins/schema/types/SchemaERDData.d.ts.map +1 -1
- package/dist/plugins/schema/ui/assets/index-DCLgZby3.css +1 -0
- package/dist/plugins/schema/ui/assets/index-Ho7jg9o_.js +70 -0
- package/dist/plugins/schema/ui/index.html +2 -2
- package/dist/shared/bootstrap/createPluginApp.d.ts +82 -0
- package/dist/shared/bootstrap/createPluginApp.d.ts.map +1 -0
- package/dist/shared/bootstrap/createPluginApp.js +185 -0
- package/dist/shared/components/ErrorBoundary.d.ts +35 -0
- package/dist/shared/components/ErrorBoundary.d.ts.map +1 -0
- package/dist/shared/components/ErrorBoundary.js +63 -0
- package/dist/shared/uem/transformer/TransformerRegistry.d.ts +0 -8
- package/dist/shared/uem/transformer/TransformerRegistry.d.ts.map +1 -1
- package/dist/shared/uem/transformer/TransformerRegistry.js +2 -16
- package/dist/shared/uem/transformer/UemBasedVisualizer.d.ts.map +1 -1
- package/dist/shared/uem/transformer/UemBasedVisualizer.js +3 -7
- package/dist/shared/uem/types/UemMetadata.d.ts +13 -2
- package/dist/shared/uem/types/UemMetadata.d.ts.map +1 -1
- package/dist/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.d.ts +16 -0
- package/dist/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.d.ts.map +1 -0
- package/dist/shared/uem/ui/components/PropertyRenderer/PropertyRenderer.js +194 -0
- package/dist/shared/uem/ui/components/UEMVisualization/UEMVisualization.d.ts +20 -0
- package/dist/shared/uem/ui/components/UEMVisualization/UEMVisualization.d.ts.map +1 -0
- package/dist/shared/uem/ui/components/UEMVisualization/UEMVisualization.js +381 -0
- package/dist/shared/utils/isPluginError.d.ts +11 -0
- package/dist/shared/utils/isPluginError.d.ts.map +1 -0
- package/dist/shared/utils/isPluginError.js +18 -0
- package/dist/shared/utils/patternMatcher.d.ts +34 -0
- package/dist/shared/utils/patternMatcher.d.ts.map +1 -0
- package/dist/shared/utils/patternMatcher.js +44 -0
- package/dist/shared/utils/uemTreeUtils.d.ts +2 -1
- package/dist/shared/utils/uemTreeUtils.d.ts.map +1 -1
- package/dist/shared/utils/uemTreeUtils.js +12 -6
- package/dist/shared/utils/vizDependentPathsHelper.d.ts +0 -9
- package/dist/shared/utils/vizDependentPathsHelper.d.ts.map +1 -1
- package/dist/shared/utils/vizDependentPathsHelper.js +3 -19
- package/package.json +5 -4
- package/dist/plugins/flexipage/ui/assets/index-DUDC29Wu.js +0 -55
- package/dist/plugins/schema/ui/assets/index-BbY653nW.js +0 -62
- package/dist/plugins/schema/ui/assets/index-CbNHuvPl.css +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
**/
|
|
7
|
+
/**
|
|
8
|
+
* Pattern matching utility for file paths
|
|
9
|
+
*
|
|
10
|
+
* Provides consistent file pattern matching logic used across plugins, transformers,
|
|
11
|
+
* and dependent path helpers. Supports simple wildcard patterns.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Check if a file path matches a pattern
|
|
15
|
+
*
|
|
16
|
+
* Supports simple wildcard patterns:
|
|
17
|
+
* - `*.ext` matches files ending with `.ext`
|
|
18
|
+
* - `prefix.*` matches files starting with `prefix.`
|
|
19
|
+
* - `exact` matches exact filename or suffix
|
|
20
|
+
*
|
|
21
|
+
* @param filePath - The file path to check
|
|
22
|
+
* @param pattern - The pattern to match (e.g., '*.flexipage-meta.xml', '.object-meta.xml')
|
|
23
|
+
* @returns True if the file path matches the pattern
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* matchesFilePattern('MyPage.flexipage-meta.xml', '*.flexipage-meta.xml') // true
|
|
28
|
+
* matchesFilePattern('/path/to/Account.object-meta.xml', '.object-meta.xml') // true
|
|
29
|
+
* matchesFilePattern('config.json', 'config.*') // true
|
|
30
|
+
* matchesFilePattern('test.txt', '*.xml') // false
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function matchesFilePattern(filePath: string, pattern: string): boolean;
|
|
34
|
+
//# sourceMappingURL=patternMatcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patternMatcher.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/patternMatcher.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAa7E"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, Salesforce, Inc.
|
|
3
|
+
* All rights reserved.
|
|
4
|
+
* Licensed under the BSD 3-Clause license.
|
|
5
|
+
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
|
+
**/
|
|
7
|
+
/**
|
|
8
|
+
* Pattern matching utility for file paths
|
|
9
|
+
*
|
|
10
|
+
* Provides consistent file pattern matching logic used across plugins, transformers,
|
|
11
|
+
* and dependent path helpers. Supports simple wildcard patterns.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Check if a file path matches a pattern
|
|
15
|
+
*
|
|
16
|
+
* Supports simple wildcard patterns:
|
|
17
|
+
* - `*.ext` matches files ending with `.ext`
|
|
18
|
+
* - `prefix.*` matches files starting with `prefix.`
|
|
19
|
+
* - `exact` matches exact filename or suffix
|
|
20
|
+
*
|
|
21
|
+
* @param filePath - The file path to check
|
|
22
|
+
* @param pattern - The pattern to match (e.g., '*.flexipage-meta.xml', '.object-meta.xml')
|
|
23
|
+
* @returns True if the file path matches the pattern
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```typescript
|
|
27
|
+
* matchesFilePattern('MyPage.flexipage-meta.xml', '*.flexipage-meta.xml') // true
|
|
28
|
+
* matchesFilePattern('/path/to/Account.object-meta.xml', '.object-meta.xml') // true
|
|
29
|
+
* matchesFilePattern('config.json', 'config.*') // true
|
|
30
|
+
* matchesFilePattern('test.txt', '*.xml') // false
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export function matchesFilePattern(filePath, pattern) {
|
|
34
|
+
// Handle leading wildcard patterns (e.g., *.flexipage-meta.xml)
|
|
35
|
+
if (pattern.startsWith('*')) {
|
|
36
|
+
return filePath.endsWith(pattern.slice(1));
|
|
37
|
+
}
|
|
38
|
+
// Handle trailing wildcard patterns (e.g., config.*)
|
|
39
|
+
if (pattern.endsWith('*')) {
|
|
40
|
+
return filePath.startsWith(pattern.slice(0, -1));
|
|
41
|
+
}
|
|
42
|
+
// Handle exact match or suffix match (e.g., .object-meta.xml)
|
|
43
|
+
return filePath === pattern || filePath.endsWith(pattern);
|
|
44
|
+
}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* Licensed under the BSD 3-Clause license.
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
**/
|
|
7
|
+
import { UEMFragment, Block, Region, Field, DataProvider } from '../uem/types/UemMetadata.js';
|
|
7
8
|
/**
|
|
8
9
|
* Tree node structure for UEM visualization
|
|
9
10
|
*/
|
|
@@ -21,7 +22,7 @@ export interface TreeNode {
|
|
|
21
22
|
* @param parentId - The parent node's ID for ID generation
|
|
22
23
|
* @returns A TreeNode with unique IDs for the tree structure
|
|
23
24
|
*/
|
|
24
|
-
export declare function convertToTreeNode(node:
|
|
25
|
+
export declare function convertToTreeNode(node: UEMFragment | Block | Region | Field | DataProvider, parentId?: string): TreeNode;
|
|
25
26
|
/**
|
|
26
27
|
* Formats a field key into a human-readable label
|
|
27
28
|
* Converts camelCase or snake_case to Title Case
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uemTreeUtils.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/uemTreeUtils.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,OAAO,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"uemTreeUtils.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/uemTreeUtils.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE9F;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,GAAG,QAAQ,GAAG,cAAc,GAAG,OAAO,CAAC;IACpD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,YAAY,EACzD,QAAQ,SAAK,GACZ,QAAQ,CAoBV;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAMpD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAevD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,QAAQ,EAAE,GACpB;IAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAA;CAAE,CA2BpD"}
|
|
@@ -11,14 +11,20 @@
|
|
|
11
11
|
* @returns A TreeNode with unique IDs for the tree structure
|
|
12
12
|
*/
|
|
13
13
|
export function convertToTreeNode(node, parentId = '') {
|
|
14
|
-
const
|
|
14
|
+
const definition = 'definition' in node ? node.definition : undefined;
|
|
15
|
+
const name = 'name' in node ? node.name : undefined;
|
|
16
|
+
const attributes = 'attributes' in node ? node.attributes : undefined;
|
|
17
|
+
const children = 'children' in node ? node.children : undefined;
|
|
18
|
+
// DataProvider doesn't have a 'type' field, so we infer it from presence of 'expressionKey'
|
|
19
|
+
const type = 'expressionKey' in node ? 'dataProvider' : node.type;
|
|
20
|
+
const id = `${parentId}-${definition || name || type}-${Math.random()}`;
|
|
15
21
|
return {
|
|
16
22
|
id,
|
|
17
|
-
type
|
|
18
|
-
definition
|
|
19
|
-
name
|
|
20
|
-
attributes
|
|
21
|
-
children:
|
|
23
|
+
type,
|
|
24
|
+
definition,
|
|
25
|
+
name,
|
|
26
|
+
attributes,
|
|
27
|
+
children: children?.map((child, index) => convertToTreeNode(child, `${id}-${index}`)),
|
|
22
28
|
};
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
@@ -17,15 +17,6 @@ export declare class VizDependentPathsHelper {
|
|
|
17
17
|
* @param fileSystem Platform file system (e.g. from IPlatformContext.fileSystem). Required only at construction.
|
|
18
18
|
*/
|
|
19
19
|
constructor(fileSystem: IFileSystem);
|
|
20
|
-
/**
|
|
21
|
-
* Check if a filename matches a pattern.
|
|
22
|
-
*
|
|
23
|
-
* Supports simple wildcard patterns:
|
|
24
|
-
* - `*.ext` matches files ending with `.ext`
|
|
25
|
-
* - `prefix.*` matches files starting with `prefix.`
|
|
26
|
-
* - `exact` matches exact filename
|
|
27
|
-
*/
|
|
28
|
-
private matchesPattern;
|
|
29
20
|
/**
|
|
30
21
|
* Find files matching a pattern in a sibling directory.
|
|
31
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vizDependentPathsHelper.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/vizDependentPathsHelper.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EAAE,KAAK,WAAW,EAA+B,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"vizDependentPathsHelper.d.ts","sourceRoot":"","sources":["../../../src/shared/utils/vizDependentPathsHelper.ts"],"names":[],"mappings":"AAAA;;;;;IAKI;AAEJ,OAAO,EAAE,KAAK,WAAW,EAA+B,MAAM,+BAA+B,CAAC;AAO9F;;;;;GAKG;AACH,qBAAa,uBAAuB;IAItB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAHvC;;OAEG;gBAC0B,UAAU,EAAE,WAAW;IASpD;;;;;;;;;;OAUG;IACG,2BAA2B,CAC/B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,kBAAkB,EAAE,MAAM,GACzB,OAAO,CAAC,MAAM,EAAE,CAAC;IAuBpB;;;;;;;;;OASG;IACG,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAiCtF"}
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
6
6
|
**/
|
|
7
7
|
import { ErrorBuilder, ErrorCategory } from '@salesforce/metadata-core-sdk';
|
|
8
|
+
import { matchesFilePattern } from './patternMatcher.js';
|
|
8
9
|
const MAX_PARENT_LEVELS = 5;
|
|
9
10
|
/**
|
|
10
11
|
* Helper for resolving visualization-dependent file paths.
|
|
@@ -25,23 +26,6 @@ export class VizDependentPathsHelper {
|
|
|
25
26
|
.build();
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Check if a filename matches a pattern.
|
|
30
|
-
*
|
|
31
|
-
* Supports simple wildcard patterns:
|
|
32
|
-
* - `*.ext` matches files ending with `.ext`
|
|
33
|
-
* - `prefix.*` matches files starting with `prefix.`
|
|
34
|
-
* - `exact` matches exact filename
|
|
35
|
-
*/
|
|
36
|
-
matchesPattern(filename, pattern) {
|
|
37
|
-
if (pattern.startsWith('*')) {
|
|
38
|
-
return filename.endsWith(pattern.slice(1));
|
|
39
|
-
}
|
|
40
|
-
if (pattern.endsWith('*')) {
|
|
41
|
-
return filename.startsWith(pattern.slice(0, -1));
|
|
42
|
-
}
|
|
43
|
-
return filename === pattern || filename.endsWith(pattern);
|
|
44
|
-
}
|
|
45
29
|
/**
|
|
46
30
|
* Find files matching a pattern in a sibling directory.
|
|
47
31
|
*
|
|
@@ -65,7 +49,7 @@ export class VizDependentPathsHelper {
|
|
|
65
49
|
return [filePath];
|
|
66
50
|
}
|
|
67
51
|
const files = result.data
|
|
68
|
-
.filter((entry) => entry.isFile &&
|
|
52
|
+
.filter((entry) => entry.isFile && matchesFilePattern(entry.name, siblingFilePattern))
|
|
69
53
|
.map((entry) => this.fileSystem.join(siblingDir, entry.name));
|
|
70
54
|
return [...files, filePath];
|
|
71
55
|
}
|
|
@@ -95,7 +79,7 @@ export class VizDependentPathsHelper {
|
|
|
95
79
|
}
|
|
96
80
|
const result = await this.fileSystem.readDirectory(currentDir);
|
|
97
81
|
if (result.success && result.data) {
|
|
98
|
-
const match = result.data.find((entry) => entry.isFile &&
|
|
82
|
+
const match = result.data.find((entry) => entry.isFile && matchesFilePattern(entry.name, parentPattern));
|
|
99
83
|
if (match) {
|
|
100
84
|
return this.fileSystem.join(currentDir, match.name);
|
|
101
85
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/metadata-plugins",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Visualizer implementations for Salesforce metadata",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"build": "tsc -p tsconfig.json && npm run build:react-apps",
|
|
18
18
|
"build:react-apps": "node scripts/build-react-apps.js",
|
|
19
19
|
"watch": "tsc -p tsconfig.json --watch",
|
|
20
|
-
"clean": "rm -rf dist && node scripts/
|
|
20
|
+
"clean": "rm -rf dist && node scripts/vscode-platform.js clean",
|
|
21
21
|
"test": "jest --coverage",
|
|
22
22
|
"test:watch": "jest --watch",
|
|
23
23
|
"test:architecture": "jest src/__tests__/architecture.test.ts",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"vs:platform": "node scripts/vscode-platform.js",
|
|
27
27
|
"vs:dev": "node scripts/vscode-platform.js dev",
|
|
28
28
|
"vs:e2e": "node scripts/vscode-platform.js e2e",
|
|
29
|
+
"vs:e2e:local": "node scripts/vscode-platform.js e2e --local",
|
|
29
30
|
"vs:e2e:compile": "node scripts/vscode-platform.js e2e-compile",
|
|
30
31
|
"vs:sync": "node scripts/vscode-platform.js sync",
|
|
31
32
|
"vs:sync-plugin": "node scripts/vscode-platform.js sync-plugin",
|
|
@@ -57,14 +58,14 @@
|
|
|
57
58
|
"url": "https://github.com/forcedotcom/salesforce-metadata-visualizer-support/issues"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
|
-
"@salesforce/metadata-core-sdk": "^1.
|
|
61
|
+
"@salesforce/metadata-core-sdk": "^1.1.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@commitlint/cli": "^19.6.0",
|
|
64
65
|
"@commitlint/config-conventional": "^19.6.0",
|
|
65
66
|
"@dagrejs/dagre": "^2.0.4",
|
|
66
67
|
"@eslint/js": "^9.15.0",
|
|
67
|
-
"@salesforce/metadata-core-sdk": "^1.
|
|
68
|
+
"@salesforce/metadata-core-sdk": "^1.1.0",
|
|
68
69
|
"@salesforce/salesforcedx-vscode-test-tools": "^1.2.5",
|
|
69
70
|
"@tony.ganchev/eslint-plugin-header": "^3.1.6",
|
|
70
71
|
"@types/chai": "^4.3.11",
|