diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5429ea4..c55e5da 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -201,4 +201,4 @@ If the action fails, the VSIX will need to be built locally with `yarn package` ### Insiders release -The [Publish Insiders workflow](.github/workflows/cd-insiders.yml) is automatically ran every AM unless no new changes have been committed to `main`. +The [Publish Insiders workflow](.github/workflows/cd-insiders.yml) is automatically run every AM unless no new changes have been committed to `main`. diff --git a/src/container.ts b/src/container.ts index dd1b7c9..e514cec 100644 --- a/src/container.ts +++ b/src/container.ts @@ -78,10 +78,10 @@ export class Container { }, }); - static create(context: ExtensionContext, cfg: Config) { + static create(context: ExtensionContext, cfg: Config, insiders: boolean) { if (Container.#instance != null) throw new Error('Container is already initialized'); - Container.#instance = new Container(context, cfg); + Container.#instance = new Container(context, cfg, insiders); return Container.#instance; } @@ -152,9 +152,10 @@ export class Container { private _terminalLinks: GitTerminalLinkProvider | undefined; - private constructor(context: ExtensionContext, config: Config) { + private constructor(context: ExtensionContext, config: Config, insiders: boolean) { this._context = context; this._config = this.applyMode(config); + this._insiders = insiders; context.subscriptions.push((this._storage = new Storage(this._context))); @@ -311,7 +312,7 @@ export class Container { return this._config; } - private _context: ExtensionContext; + private readonly _context: ExtensionContext; get context() { return this._context; } @@ -409,9 +410,9 @@ export class Container { return this._homeView; } - @memoize() + private readonly _insiders; get insiders() { - return this._context.extension.id.endsWith('-insiders'); + return this._insiders; } private _integrationAuthentication: IntegrationAuthenticationService; diff --git a/src/extension.ts b/src/extension.ts index e4e429f..6a864a3 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -17,12 +17,12 @@ import { executeCommand, executeCoreCommand, registerCommands } from './system/c import { setDefaultDateLocales } from './system/date'; import { once } from './system/event'; import { Stopwatch } from './system/stopwatch'; -import { compare } from './system/version'; +import { compare, satisfies } from './system/version'; import { ViewNode } from './views/nodes'; export async function activate(context: ExtensionContext): Promise { - const insiders = context.extension.id === 'eamodio.gitlens-insiders'; const gitlensVersion = context.extension.packageJSON.version; + const insiders = context.extension.id === 'eamodio.gitlens-insiders' || satisfies(gitlensVersion, '> 2020.0.0'); Logger.configure(context, configuration.get('outputLevel'), o => { if (GitUri.is(o)) { @@ -47,8 +47,8 @@ export async function activate(context: ExtensionContext): Promise { context.subscriptions.push(...registerCommands(container)); registerBuiltInActionRunners(container);