@hubspot/project-parsing-lib 0.1.8 → 0.1.9-beta.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/package.json +3 -2
- package/src/index.d.ts +2 -1
- package/src/index.js +5 -2
- package/src/lang/copy.d.ts +2 -0
- package/src/lang/copy.js +5 -1
- package/src/lib/constants.d.ts +5 -1
- package/src/lib/constants.js +9 -4
- package/src/lib/transform.d.ts +7 -2
- package/src/lib/transform.js +72 -8
- package/src/lib/validation.js +6 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hubspot/project-parsing-lib",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9-beta.0",
|
|
4
4
|
"description": "Parsing library for converting projects directory structures to their intermediate representation",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -31,7 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
33
|
"build": "ts-node ./scripts/build.ts",
|
|
34
|
-
"lint": "
|
|
34
|
+
"lint": "echo 'Linting is disabled for Blazar'",
|
|
35
|
+
"lint:local": "eslint --max-warnings=0 . && prettier ./src/** --check",
|
|
35
36
|
"local-dev": "yarn build && yarn link --cwd=./dist && tsc --watch --rootDir . --outdir dist",
|
|
36
37
|
"prettier:write": "prettier ./src/** --write",
|
|
37
38
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ./node_modules/.bin/jest",
|
package/src/index.d.ts
CHANGED
|
@@ -5,4 +5,5 @@ export { isTranslationError } from './lib/errors';
|
|
|
5
5
|
export { IntermediateRepresentation, IntermediateRepresentationNode, IntermediateRepresentationLocalDev, IntermediateRepresentationNodeLocalDev, TranslationContext, };
|
|
6
6
|
export { migrate } from './lib/migrate';
|
|
7
7
|
export { validateUid } from './lib/uid';
|
|
8
|
-
export { mapToUserFriendlyName } from './lib/transform';
|
|
8
|
+
export { mapToUserFriendlyName, mapToInternalType } from './lib/transform';
|
|
9
|
+
export { getIntermediateRepresentationSchema } from './lib/schemas';
|
package/src/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.mapToUserFriendlyName = exports.validateUid = exports.migrate = exports.isTranslationError = void 0;
|
|
6
|
+
exports.getIntermediateRepresentationSchema = exports.mapToInternalType = exports.mapToUserFriendlyName = exports.validateUid = exports.migrate = exports.isTranslationError = void 0;
|
|
7
7
|
exports.translate = translate;
|
|
8
8
|
exports.translateForLocalDev = translateForLocalDev;
|
|
9
9
|
const files_1 = require("./lib/files");
|
|
@@ -20,7 +20,7 @@ async function translate(translationContext, translationOptions = defaultOptions
|
|
|
20
20
|
if (metafileContents.length === 0) {
|
|
21
21
|
throw new Error(copy_1.errorMessages.project.noHsMetaFiles);
|
|
22
22
|
}
|
|
23
|
-
const transformation = (0, transform_1.transform)(metafileContents);
|
|
23
|
+
const transformation = (0, transform_1.transform)(metafileContents, translationContext);
|
|
24
24
|
const intermediateRepresentation = (0, transform_1.getIntermediateRepresentation)(transformation, skipValidation);
|
|
25
25
|
// Remove once extensions and serverless functions are supported
|
|
26
26
|
if (!skipValidation) {
|
|
@@ -54,3 +54,6 @@ var uid_1 = require("./lib/uid");
|
|
|
54
54
|
Object.defineProperty(exports, "validateUid", { enumerable: true, get: function () { return uid_1.validateUid; } });
|
|
55
55
|
var transform_2 = require("./lib/transform");
|
|
56
56
|
Object.defineProperty(exports, "mapToUserFriendlyName", { enumerable: true, get: function () { return transform_2.mapToUserFriendlyName; } });
|
|
57
|
+
Object.defineProperty(exports, "mapToInternalType", { enumerable: true, get: function () { return transform_2.mapToInternalType; } });
|
|
58
|
+
var schemas_1 = require("./lib/schemas");
|
|
59
|
+
Object.defineProperty(exports, "getIntermediateRepresentationSchema", { enumerable: true, get: function () { return schemas_1.getIntermediateRepresentationSchema; } });
|
package/src/lang/copy.d.ts
CHANGED
|
@@ -9,6 +9,8 @@ export declare const errorMessages: {
|
|
|
9
9
|
failedToTranslateProject: string;
|
|
10
10
|
duplicateUid: (uid: string, files: string[]) => string;
|
|
11
11
|
duplicateComponent: (componentType: string) => string;
|
|
12
|
+
noPackageJsonForServerless: (appFunctionsPackageFile: string) => string;
|
|
13
|
+
fileContentMissingFor: (file: string) => string;
|
|
12
14
|
};
|
|
13
15
|
validation: {
|
|
14
16
|
errorWithFileHeader: (file: string, errors: string[]) => string;
|
package/src/lang/copy.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.logMessages = exports.errorMessages = void 0;
|
|
4
|
+
const constants_1 = require("../lib/constants");
|
|
5
|
+
const transform_1 = require("../lib/transform");
|
|
4
6
|
exports.errorMessages = {
|
|
5
7
|
api: {
|
|
6
8
|
failedToFetchSchemas: 'Failed to fetch schemas',
|
|
@@ -11,6 +13,8 @@ exports.errorMessages = {
|
|
|
11
13
|
failedToTranslateProject: 'Project validation failed',
|
|
12
14
|
duplicateUid: (uid, files) => `Duplicate uid '${uid}' found in:\n- ${files.join('\n- ')}`,
|
|
13
15
|
duplicateComponent: (componentType) => `Only one ${componentType} component is allowed`,
|
|
16
|
+
noPackageJsonForServerless: (appFunctionsPackageFile) => `${appFunctionsPackageFile} does not exist. ${constants_1.Components[constants_1.AppFunctionsKey].userFriendlyName} requires a ${constants_1.packageJson} file to exist in this location`,
|
|
17
|
+
fileContentMissingFor: (file) => `File content is missing for ${file}`,
|
|
14
18
|
},
|
|
15
19
|
validation: {
|
|
16
20
|
errorWithFileHeader: (file, errors) => `\n\nEncountered the following errors for ${file}:\n\t- ${errors.join('\n\t- ')}`,
|
|
@@ -21,7 +25,7 @@ exports.errorMessages = {
|
|
|
21
25
|
uidTooLong: `'uid' must be 64 characters or less`,
|
|
22
26
|
missingType: `Missing required field: 'type'`,
|
|
23
27
|
missingConfig: `Missing required field: 'config'`,
|
|
24
|
-
unsupportedType: (type) => `Unsupported type: ${
|
|
28
|
+
unsupportedType: (type) => `Unsupported type: ${(0, transform_1.mapToUserFacingType)(type)}`,
|
|
25
29
|
errorWithField: (field, error) => `Error with ${field}: ${error || 'Unknown error'}`,
|
|
26
30
|
invalidJson: 'Invalid JSON',
|
|
27
31
|
wrongDirectoryForComponent: (directory, componentType, componentMetadata, correctDir) => `The directory '${directory}' is incorrect for type '${componentType}'. ${componentMetadata.userFriendlyName} ${componentMetadata.userFriendlyTypePlural} should only be placed in the '${correctDir}' directory`,
|
package/src/lib/constants.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export declare const AppKey = "app";
|
|
2
2
|
export declare const ThemeKey = "theme";
|
|
3
|
+
export declare const AppFunctionsKey = "app-function";
|
|
3
4
|
export declare const AppObjectKey = "app-object";
|
|
4
5
|
export declare const AppObjectAssociationKey = "app-object-association";
|
|
5
6
|
export declare const CallingKey = "calling";
|
|
6
7
|
export declare const CardsKey = "card";
|
|
7
|
-
export declare const FunctionsKey = "function";
|
|
8
8
|
export declare const SettingsKey = "settings";
|
|
9
9
|
export declare const MarketingEventsKey = "marketing-event";
|
|
10
10
|
export declare const MediaBridgeKey = "media-bridge";
|
|
@@ -12,6 +12,8 @@ export declare const TimelineEventsKey = "timeline-event";
|
|
|
12
12
|
export declare const VideoConferencingKey = "video-conferencing";
|
|
13
13
|
export declare const WebhooksKey = "webhooks";
|
|
14
14
|
export declare const WorkflowActionsKey = "workflow-action";
|
|
15
|
+
export declare const AppFunctionsPackageKey = "serverless-package";
|
|
16
|
+
export declare const AutoGeneratedComponentTypes: string[];
|
|
15
17
|
export interface ComponentMetadata {
|
|
16
18
|
dir: string;
|
|
17
19
|
isToplevel: boolean;
|
|
@@ -25,6 +27,8 @@ export declare const Components: Record<string, ComponentMetadata>;
|
|
|
25
27
|
export declare const userFacingToInternalType: Record<string, string>;
|
|
26
28
|
export declare const internalTypeToUserFacing: Record<string, string>;
|
|
27
29
|
export declare const metafileExtension = "-hsmeta.json";
|
|
30
|
+
export declare const packageJson = "package.json";
|
|
31
|
+
export declare const packageLockJson = "package-lock.json";
|
|
28
32
|
export declare const allowedAppSubComponentsDirs: string[];
|
|
29
33
|
export declare const allowedThemeSubComponentsDirs: string[];
|
|
30
34
|
export declare const ProjectStructure: {
|
package/src/lib/constants.js
CHANGED
|
@@ -33,18 +33,18 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.allowedSubComponentDirectories = exports.allowedComponentDirectories = exports.ProjectStructure = exports.allowedThemeSubComponentsDirs = exports.allowedAppSubComponentsDirs = exports.metafileExtension = exports.internalTypeToUserFacing = exports.userFacingToInternalType = exports.Components = exports.WorkflowActionsKey = exports.WebhooksKey = exports.VideoConferencingKey = exports.TimelineEventsKey = exports.MediaBridgeKey = exports.MarketingEventsKey = exports.SettingsKey = exports.
|
|
36
|
+
exports.allowedSubComponentDirectories = exports.allowedComponentDirectories = exports.ProjectStructure = exports.allowedThemeSubComponentsDirs = exports.allowedAppSubComponentsDirs = exports.packageLockJson = exports.packageJson = exports.metafileExtension = exports.internalTypeToUserFacing = exports.userFacingToInternalType = exports.Components = exports.AutoGeneratedComponentTypes = exports.AppFunctionsPackageKey = exports.WorkflowActionsKey = exports.WebhooksKey = exports.VideoConferencingKey = exports.TimelineEventsKey = exports.MediaBridgeKey = exports.MarketingEventsKey = exports.SettingsKey = exports.CardsKey = exports.CallingKey = exports.AppObjectAssociationKey = exports.AppObjectKey = exports.AppFunctionsKey = exports.ThemeKey = exports.AppKey = void 0;
|
|
37
37
|
// Top Level Component types
|
|
38
38
|
const path = __importStar(require("path"));
|
|
39
39
|
// Component types
|
|
40
40
|
exports.AppKey = 'app';
|
|
41
41
|
exports.ThemeKey = 'theme';
|
|
42
42
|
// Sub-Component types
|
|
43
|
+
exports.AppFunctionsKey = 'app-function';
|
|
43
44
|
exports.AppObjectKey = 'app-object';
|
|
44
45
|
exports.AppObjectAssociationKey = 'app-object-association';
|
|
45
46
|
exports.CallingKey = 'calling';
|
|
46
47
|
exports.CardsKey = 'card';
|
|
47
|
-
exports.FunctionsKey = 'function';
|
|
48
48
|
exports.SettingsKey = 'settings';
|
|
49
49
|
exports.MarketingEventsKey = 'marketing-event';
|
|
50
50
|
exports.MediaBridgeKey = 'media-bridge';
|
|
@@ -52,6 +52,9 @@ exports.TimelineEventsKey = 'timeline-event';
|
|
|
52
52
|
exports.VideoConferencingKey = 'video-conferencing';
|
|
53
53
|
exports.WebhooksKey = 'webhooks';
|
|
54
54
|
exports.WorkflowActionsKey = 'workflow-action';
|
|
55
|
+
// Auto-generated component types
|
|
56
|
+
exports.AppFunctionsPackageKey = 'serverless-package';
|
|
57
|
+
exports.AutoGeneratedComponentTypes = [exports.AppFunctionsPackageKey];
|
|
55
58
|
const TopLevelComponentFields = {
|
|
56
59
|
isToplevel: true,
|
|
57
60
|
userFriendlyType: 'component',
|
|
@@ -99,10 +102,10 @@ exports.Components = {
|
|
|
99
102
|
userFriendlyName: 'Card',
|
|
100
103
|
...SubComponentFields,
|
|
101
104
|
},
|
|
102
|
-
[exports.
|
|
105
|
+
[exports.AppFunctionsKey]: {
|
|
103
106
|
dir: 'functions',
|
|
104
107
|
parentComponent: exports.AppKey,
|
|
105
|
-
userFriendlyName: 'Function',
|
|
108
|
+
userFriendlyName: 'App Function',
|
|
106
109
|
...SubComponentFields,
|
|
107
110
|
},
|
|
108
111
|
[exports.SettingsKey]: {
|
|
@@ -156,6 +159,8 @@ exports.userFacingToInternalType = {
|
|
|
156
159
|
};
|
|
157
160
|
exports.internalTypeToUserFacing = Object.fromEntries(Object.entries(exports.userFacingToInternalType).map(([key, value]) => [value, key]));
|
|
158
161
|
exports.metafileExtension = '-hsmeta.json';
|
|
162
|
+
exports.packageJson = 'package.json';
|
|
163
|
+
exports.packageLockJson = 'package-lock.json';
|
|
159
164
|
function getSubComponentDirsForParentType(parentComponent) {
|
|
160
165
|
return Object.values(exports.Components).reduce((acc, item) => {
|
|
161
166
|
if (item.parentComponent === parentComponent) {
|
package/src/lib/transform.d.ts
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
-
import { FileParseResult, IntermediateRepresentation, Transformation } from './types';
|
|
1
|
+
import { Dependencies, FileParseResult, IntermediateRepresentation, Transformation, TranslationContext } from './types';
|
|
2
|
+
export declare function mapToInternalType(type: string): string;
|
|
2
3
|
export declare function mapToUserFacingType(type: string): string;
|
|
3
4
|
export declare function mapToUserFriendlyName(internalType: string): string;
|
|
4
|
-
export declare function transform(fileParseResults: FileParseResult[]): Transformation[];
|
|
5
|
+
export declare function transform(fileParseResults: FileParseResult[], translationContext: TranslationContext): Transformation[];
|
|
5
6
|
export declare function getIntermediateRepresentation(transformations: Transformation[], skipValidation: boolean | undefined): IntermediateRepresentation;
|
|
7
|
+
export declare function generateServerlessPackageComponent(appFunctionsDirectory: string, translationContext: TranslationContext, componentDeps: Dependencies): {
|
|
8
|
+
uid: string;
|
|
9
|
+
transformation: Transformation;
|
|
10
|
+
};
|
package/src/lib/transform.js
CHANGED
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.mapToInternalType = mapToInternalType;
|
|
3
7
|
exports.mapToUserFacingType = mapToUserFacingType;
|
|
4
8
|
exports.mapToUserFriendlyName = mapToUserFriendlyName;
|
|
5
9
|
exports.transform = transform;
|
|
6
10
|
exports.getIntermediateRepresentation = getIntermediateRepresentation;
|
|
11
|
+
exports.generateServerlessPackageComponent = generateServerlessPackageComponent;
|
|
7
12
|
const constants_1 = require("./constants");
|
|
8
13
|
const copy_1 = require("../lang/copy");
|
|
9
|
-
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
15
|
+
const fs_1 = __importDefault(require("fs"));
|
|
16
|
+
function calculateComponentDeps(fileValidationResult, parentComponents, appObjects, appFunctionsPackageUid) {
|
|
10
17
|
let dependencies = {};
|
|
11
18
|
// If there are dependencies in the config file, pass them through
|
|
12
19
|
if (!fileValidationResult.content?.dependencies) {
|
|
@@ -22,6 +29,9 @@ function calculateComponentDeps(fileValidationResult, parentComponents, appObjec
|
|
|
22
29
|
if (type !== constants_1.AppObjectKey) {
|
|
23
30
|
dependencies.allAppObjects = appObjects;
|
|
24
31
|
}
|
|
32
|
+
if (type === constants_1.AppFunctionsKey && appFunctionsPackageUid) {
|
|
33
|
+
dependencies.serverlessPackage = appFunctionsPackageUid;
|
|
34
|
+
}
|
|
25
35
|
}
|
|
26
36
|
return dependencies;
|
|
27
37
|
}
|
|
@@ -37,23 +47,44 @@ function mapToUserFacingType(type) {
|
|
|
37
47
|
function mapToUserFriendlyName(internalType) {
|
|
38
48
|
return constants_1.Components[mapToUserFacingType(internalType)]?.userFriendlyName || '';
|
|
39
49
|
}
|
|
40
|
-
function transform(fileParseResults) {
|
|
50
|
+
function transform(fileParseResults, translationContext) {
|
|
41
51
|
const parentTypes = Object.keys(constants_1.ProjectStructure);
|
|
42
52
|
const parentComponents = {};
|
|
43
|
-
const
|
|
53
|
+
const allAppObjects = [];
|
|
54
|
+
let appUid = '';
|
|
55
|
+
let appFunctionsDirectory;
|
|
44
56
|
// Compute the parent components, so we can add them as dependencies to the child components
|
|
45
57
|
fileParseResults.forEach(file => {
|
|
46
58
|
if (file.content?.type && parentTypes.includes(file.content.type)) {
|
|
59
|
+
if (file.content.type === constants_1.AppKey) {
|
|
60
|
+
appUid = file.content.uid;
|
|
61
|
+
}
|
|
47
62
|
parentComponents[file.content.type] = file.content.uid;
|
|
48
63
|
}
|
|
49
64
|
if (file.content?.type === constants_1.AppObjectKey) {
|
|
50
|
-
|
|
65
|
+
allAppObjects.push(file.content.uid);
|
|
66
|
+
}
|
|
67
|
+
if (file.content?.type === constants_1.AppFunctionsKey) {
|
|
68
|
+
appFunctionsDirectory = path_1.default.dirname(file.file);
|
|
51
69
|
}
|
|
52
70
|
});
|
|
53
|
-
|
|
71
|
+
const autoGeneratedComponents = [];
|
|
72
|
+
let serverlessPackageUid;
|
|
73
|
+
if (appFunctionsDirectory) {
|
|
74
|
+
const { uid, transformation } = generateServerlessPackageComponent(appFunctionsDirectory, translationContext, {
|
|
75
|
+
app: appUid,
|
|
76
|
+
allAppObjects,
|
|
77
|
+
});
|
|
78
|
+
serverlessPackageUid = uid;
|
|
79
|
+
autoGeneratedComponents.push(transformation);
|
|
80
|
+
}
|
|
81
|
+
const transformations = fileParseResults.map((currentFile) => {
|
|
54
82
|
if (!currentFile.content) {
|
|
55
|
-
currentFile.errors?.push(
|
|
56
|
-
return {
|
|
83
|
+
currentFile.errors?.push(copy_1.errorMessages.project.fileContentMissingFor(currentFile.file));
|
|
84
|
+
return {
|
|
85
|
+
intermediateRepresentation: null,
|
|
86
|
+
fileParseResult: currentFile,
|
|
87
|
+
};
|
|
57
88
|
}
|
|
58
89
|
const { config, uid, type } = currentFile.content;
|
|
59
90
|
return {
|
|
@@ -61,13 +92,14 @@ function transform(fileParseResults) {
|
|
|
61
92
|
uid,
|
|
62
93
|
config,
|
|
63
94
|
componentType: mapToInternalType(type),
|
|
64
|
-
componentDeps: calculateComponentDeps(currentFile, parentComponents,
|
|
95
|
+
componentDeps: calculateComponentDeps(currentFile, parentComponents, allAppObjects, serverlessPackageUid),
|
|
65
96
|
metaFilePath: currentFile.file,
|
|
66
97
|
files: {},
|
|
67
98
|
},
|
|
68
99
|
fileParseResult: currentFile,
|
|
69
100
|
};
|
|
70
101
|
});
|
|
102
|
+
return [...autoGeneratedComponents, ...transformations];
|
|
71
103
|
}
|
|
72
104
|
function getIntermediateRepresentation(transformations, skipValidation) {
|
|
73
105
|
const nodes = transformations.reduce((acc, current) => {
|
|
@@ -99,3 +131,35 @@ function getIntermediateRepresentation(transformations, skipValidation) {
|
|
|
99
131
|
intermediateNodesIndexedByUid: nodes,
|
|
100
132
|
};
|
|
101
133
|
}
|
|
134
|
+
function generateServerlessPackageComponent(appFunctionsDirectory, translationContext, componentDeps) {
|
|
135
|
+
const packageFile = path_1.default.join(appFunctionsDirectory, constants_1.packageJson);
|
|
136
|
+
const packageLockFile = path_1.default.join(appFunctionsDirectory, constants_1.packageLockJson);
|
|
137
|
+
const { projectSourceDir } = translationContext;
|
|
138
|
+
const appFunctionsPackageFile = path_1.default.join(projectSourceDir, packageFile);
|
|
139
|
+
if (!fs_1.default.existsSync(appFunctionsPackageFile)) {
|
|
140
|
+
throw new Error(copy_1.errorMessages.project.noPackageJsonForServerless(appFunctionsPackageFile));
|
|
141
|
+
}
|
|
142
|
+
const uid = `hubspot-serverless-package-uid`;
|
|
143
|
+
return {
|
|
144
|
+
uid,
|
|
145
|
+
transformation: {
|
|
146
|
+
fileParseResult: {
|
|
147
|
+
file: '',
|
|
148
|
+
errors: [],
|
|
149
|
+
},
|
|
150
|
+
intermediateRepresentation: {
|
|
151
|
+
uid,
|
|
152
|
+
componentType: mapToInternalType(constants_1.AppFunctionsPackageKey),
|
|
153
|
+
config: {
|
|
154
|
+
packageFile,
|
|
155
|
+
packageLockfile: fs_1.default.existsSync(path_1.default.join(projectSourceDir, packageLockFile))
|
|
156
|
+
? packageLockFile
|
|
157
|
+
: undefined,
|
|
158
|
+
},
|
|
159
|
+
componentDeps,
|
|
160
|
+
metaFilePath: packageFile,
|
|
161
|
+
files: {},
|
|
162
|
+
},
|
|
163
|
+
},
|
|
164
|
+
};
|
|
165
|
+
}
|
package/src/lib/validation.js
CHANGED
|
@@ -14,6 +14,12 @@ const transform_1 = require("./transform");
|
|
|
14
14
|
const ajv_formats_1 = __importDefault(require("ajv-formats"));
|
|
15
15
|
const uid_1 = require("./uid");
|
|
16
16
|
function validateIntermediateRepresentationNode(schema, transformation, irNode, index, translationContext) {
|
|
17
|
+
if (constants_1.AutoGeneratedComponentTypes.includes((0, transform_1.mapToUserFacingType)(irNode.componentType))) {
|
|
18
|
+
// Skip validation for auto-generated components
|
|
19
|
+
return {
|
|
20
|
+
valid: true,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
17
23
|
if (transformation[index].fileParseResult.errors.length > 0) {
|
|
18
24
|
return {
|
|
19
25
|
valid: false,
|