@forge/manifest 11.1.0-next.5 → 11.1.0-next.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @forge/manifest
2
2
 
3
+ ## 11.1.0-next.6
4
+
5
+ ### Minor Changes
6
+
7
+ - bb6e58a: Add validation for filePattern in Bitbucket file viewer module
8
+
3
9
  ## 11.1.0-next.5
4
10
 
5
11
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/bitbucket/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjD,eAAO,MAAM,wBAAwB,YAAa,OAAO,sBAAsB,MAAM,EAAE,KAAG,eAAe,EAExG,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/bitbucket/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAIjD,eAAO,MAAM,wBAAwB,YAAa,OAAO,sBAAsB,MAAM,EAAE,KAAG,eAAe,EAKxG,CAAC"}
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateBitbucketModules = void 0;
4
4
  const validateBackendModuleEndpoints_1 = require("./validateBackendModuleEndpoints");
5
+ const validateFileViewerRegexPatterns_1 = require("./validateFileViewerRegexPatterns");
5
6
  const validateBitbucketModules = (modules, yamlContentByLine) => {
6
- return (0, validateBackendModuleEndpoints_1.validateBackendModuleEndpoints)(modules, yamlContentByLine);
7
+ return [
8
+ ...(0, validateBackendModuleEndpoints_1.validateBackendModuleEndpoints)(modules, yamlContentByLine),
9
+ ...(0, validateFileViewerRegexPatterns_1.validateFileViewerRegexPatterns)(modules, yamlContentByLine)
10
+ ];
7
11
  };
8
12
  exports.validateBitbucketModules = validateBitbucketModules;
@@ -0,0 +1,4 @@
1
+ import { Modules } from '../../../schema/manifest';
2
+ import { ValidationError } from '../../../types';
3
+ export declare const validateFileViewerRegexPatterns: (modules: Modules, yamlContentByLine?: string[]) => ValidationError[];
4
+ //# sourceMappingURL=validateFileViewerRegexPatterns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateFileViewerRegexPatterns.d.ts","sourceRoot":"","sources":["../../../../src/validators/modules-validators/bitbucket/validateFileViewerRegexPatterns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD,OAAO,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAGjE,eAAO,MAAM,+BAA+B,YAAa,OAAO,sBAAsB,MAAM,EAAE,KAAG,eAAe,EAqB/G,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateFileViewerRegexPatterns = void 0;
4
+ const text_1 = require("../../../text");
5
+ const types_1 = require("../../../types");
6
+ const utils_1 = require("../../../utils");
7
+ const validateFileViewerRegexPatterns = (modules, yamlContentByLine) => {
8
+ const validationErrors = [];
9
+ const fileViewerModules = modules[types_1.AllModuleTypes.BitbucketRepoCodeFileViewer];
10
+ fileViewerModules?.forEach((module) => {
11
+ if (!module.filePattern) {
12
+ return;
13
+ }
14
+ try {
15
+ new RegExp(module.filePattern);
16
+ }
17
+ catch (error) {
18
+ validationErrors.push({
19
+ message: `Bitbucket module: '${module.key}' has an invalid regex pattern: '${module.filePattern}'.`,
20
+ reference: text_1.References.Modules,
21
+ level: 'error',
22
+ ...(0, utils_1.findPosition)(module.key, yamlContentByLine)
23
+ });
24
+ }
25
+ });
26
+ return validationErrors;
27
+ };
28
+ exports.validateFileViewerRegexPatterns = validateFileViewerRegexPatterns;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forge/manifest",
3
- "version": "11.1.0-next.5",
3
+ "version": "11.1.0-next.6",
4
4
  "description": "Definitions and validations of the Forge manifest",
5
5
  "main": "out/index.js",
6
6
  "scripts": {