Skip to content

Commit

Permalink
Merge pull request #1040 from microsoft/benibenj/calm-angelfish
Browse files Browse the repository at this point in the history
Allow packaging extension without a publisher
  • Loading branch information
benibenj authored Aug 23, 2024
2 parents f7ed2e1 + dda23d0 commit 0ec0e7f
Show file tree
Hide file tree
Showing 9 changed files with 168 additions and 141 deletions.
16 changes: 13 additions & 3 deletions src/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ export interface Contributions {

export type ExtensionKind = 'ui' | 'workspace' | 'web';

export interface Manifest {
export interface ManifestPackage {
// mandatory (npm)
name: string;
version: string;
engines: { [name: string]: string };
engines: { vscode: string;[name: string]: string };

// vscode
publisher: string;
publisher?: string;
icon?: string;
contributes?: Contributions;
activationEvents?: string[];
Expand Down Expand Up @@ -125,3 +125,13 @@ export interface Manifest {
// preferGlobal
// publishConfig
}

export interface ManifestPublish extends ManifestPackage {
publisher: string;
}

type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends object ? RecursivePartial<T[P]> : T[P];
};

export type UnverifiedManifest = RecursivePartial<ManifestPackage>;
4 changes: 2 additions & 2 deletions src/nls.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Manifest } from './manifest';
import { ManifestPackage } from './manifest';

export interface ITranslations {
[key: string]: string;
Expand Down Expand Up @@ -27,7 +27,7 @@ function createPatcher(translations: ITranslations): <T>(value: T) => T {
};
}

export function patchNLS(manifest: Manifest, translations: ITranslations): Manifest {
export function patchNLS(manifest: ManifestPackage, translations: ITranslations): ManifestPackage {
const patcher = createPatcher(translations);
return JSON.parse(JSON.stringify(manifest, (_, value: any) => patcher(value)));
}
Loading

0 comments on commit 0ec0e7f

Please sign in to comment.