@review-vir/common 3.1.0 → 3.1.1

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.
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Defines the Markdown that identifies a code owners block in a pull request description.
3
+ *
4
+ * @category Main
5
+ */
6
+ export declare const codeOwnersMarkdown: Readonly<{
7
+ blockEnd: "<!-- code owners end -->";
8
+ blockStart: "<!-- code owners start -->";
9
+ heading: "## Code Owners";
10
+ }>;
11
+ /**
12
+ * Formats the code owners content that pull-request-vir writes into a pull request description.
13
+ *
14
+ * @category Main
15
+ */
16
+ export declare function createCodeOwnersMarkdownBlock(content: string): string;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Defines the Markdown that identifies a code owners block in a pull request description.
3
+ *
4
+ * @category Main
5
+ */
6
+ export const codeOwnersMarkdown = Object.freeze({
7
+ blockEnd: '<!-- code owners end -->',
8
+ blockStart: '<!-- code owners start -->',
9
+ heading: '## Code Owners',
10
+ });
11
+ /**
12
+ * Formats the code owners content that pull-request-vir writes into a pull request description.
13
+ *
14
+ * @category Main
15
+ */
16
+ export function createCodeOwnersMarkdownBlock(content) {
17
+ return [
18
+ codeOwnersMarkdown.blockStart,
19
+ codeOwnersMarkdown.heading,
20
+ content,
21
+ codeOwnersMarkdown.blockEnd,
22
+ ].join('\n');
23
+ }
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './code-owners-markdown.js';
1
2
  export * from './parse-description-users.js';
2
3
  export * from './parse-inserted-code-owners.js';
package/dist/index.js CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './code-owners-markdown.js';
1
2
  export * from './parse-description-users.js';
2
3
  export * from './parse-inserted-code-owners.js';
@@ -5,7 +5,7 @@
5
5
  * line followed by a collapsible list of their owned files:
6
6
  *
7
7
  * <!-- code owners start -->
8
- * **Code owners**:
8
+ * ## Code Owners
9
9
  * (at)username1
10
10
  * <details>
11
11
  * <summary>Owned files</summary>
@@ -1,5 +1,6 @@
1
1
  import { removeDuplicates, removePrefix, safeMatch } from '@augment-vir/common';
2
- const insertedCodeOwnersRegExp = /<!-- code owners start -->([\S\s]*?)<!-- code owners end -->/i;
2
+ import { codeOwnersMarkdown } from './code-owners-markdown.js';
3
+ const insertedCodeOwnersRegExp = new RegExp(String.raw `${codeOwnersMarkdown.blockStart}([\S\s]*?)${codeOwnersMarkdown.blockEnd}`, 'i');
3
4
  const fileLinkLineRegExp = /^\s*-\s/;
4
5
  const userTagRegExp = /@[\w-]+/g;
5
6
  /**
@@ -9,7 +10,7 @@ const userTagRegExp = /@[\w-]+/g;
9
10
  * line followed by a collapsible list of their owned files:
10
11
  *
11
12
  * <!-- code owners start -->
12
- * **Code owners**:
13
+ * ## Code Owners
13
14
  * (at)username1
14
15
  * <details>
15
16
  * <summary>Owned files</summary>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@review-vir/common",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "Common functionality that review-vir primary uses but other external packages need as well.",
5
5
  "keywords": [
6
6
  "review-vir",