diff --git a/src/main.ts b/src/main.ts index 79a980e5..8215a8cd 100644 --- a/src/main.ts +++ b/src/main.ts @@ -87,12 +87,12 @@ module.exports = function (argv: string[]): void { .option('--yarn', 'Use yarn instead of npm (default inferred from presence of yarn.lock or .yarnrc)') .option('--no-yarn', 'Use npm instead of yarn (default inferred from lack of yarn.lock or .yarnrc)') .option('--ignoreFile [path]', 'Indicate alternative .vscodeignore') - .option('--noGitHubIssueLinking', 'Prevent automatic expansion of GitHub-style issue syntax into links') + .option('--no-gitHubIssueLinking', 'Disable automatic expansion of GitHub-style issue syntax into links') .option( '--web', 'Experimental flag to enable publishing web extensions. Note: This is supported only for selected extensions.' ) - .action(({ out, githubBranch, baseContentUrl, baseImagesUrl, yarn, ignoreFile, noGitHubIssueLinking, web }) => + .action(({ out, githubBranch, baseContentUrl, baseImagesUrl, yarn, ignoreFile, gitHubIssueLinking, web }) => main( packageCommand({ packagePath: out, @@ -101,7 +101,7 @@ module.exports = function (argv: string[]): void { baseImagesUrl, useYarn: yarn, ignoreFile, - expandGitHubIssueLinks: noGitHubIssueLinking, + gitHubIssueLinking, web, }) ) diff --git a/src/package.ts b/src/package.ts index 2e825c99..0b35d858 100644 --- a/src/package.ts +++ b/src/package.ts @@ -76,16 +76,16 @@ export interface IAsset { } export interface IPackageOptions { - cwd?: string; - packagePath?: string; - githubBranch?: string; - baseContentUrl?: string; - baseImagesUrl?: string; - useYarn?: boolean; - dependencyEntryPoints?: string[]; - ignoreFile?: string; - expandGitHubIssueLinks?: boolean; - web?: boolean; + readonly cwd?: string; + readonly packagePath?: string; + readonly githubBranch?: string; + readonly baseContentUrl?: string; + readonly baseImagesUrl?: string; + readonly useYarn?: boolean; + readonly dependencyEntryPoints?: string[]; + readonly ignoreFile?: string; + readonly gitHubIssueLinking?: boolean; + readonly web?: boolean; } export interface IProcessor { @@ -421,7 +421,7 @@ export class MarkdownProcessor extends BaseProcessor { private baseImagesUrl: string; private isGitHub: boolean; private repositoryUrl: string; - private expandGitHubIssueLinks: boolean; + private gitHubIssueLinking: boolean; constructor( manifest: Manifest, @@ -438,8 +438,7 @@ export class MarkdownProcessor extends BaseProcessor { this.baseImagesUrl = options.baseImagesUrl || options.baseContentUrl || (guess && guess.images); this.repositoryUrl = guess && guess.repository; this.isGitHub = isGitHubRepository(this.repositoryUrl); - this.expandGitHubIssueLinks = - typeof options.expandGitHubIssueLinks === 'boolean' ? options.expandGitHubIssueLinks : true; + this.gitHubIssueLinking = typeof options.gitHubIssueLinking === 'boolean' ? options.gitHubIssueLinking : true; } async onFile(file: IFile): Promise { @@ -506,7 +505,7 @@ export class MarkdownProcessor extends BaseProcessor { return all.replace(link, urljoin(prefix, link)); }); - if (this.isGitHub && this.expandGitHubIssueLinks) { + if (this.gitHubIssueLinking && this.isGitHub) { const markdownIssueRegex = /(\s|\n)([\w\d_-]+\/[\w\d_-]+)?#(\d+)\b/g; const issueReplace = ( all: string, diff --git a/src/test/package.test.ts b/src/test/package.test.ts index 1e10ebed..957f35b0 100644 --- a/src/test/package.test.ts +++ b/src/test/package.test.ts @@ -1999,7 +1999,7 @@ describe('MarkdownProcessor', () => { }; const root = fixture('readme'); - const processor = new ReadmeProcessor(manifest, { expandGitHubIssueLinks: false }); + const processor = new ReadmeProcessor(manifest, { gitHubIssueLinking: false }); const readme = { path: 'extension/readme.md', localPath: path.join(root, 'readme.github.md'),