Skip to content

Commit

Permalink
Merge branch 'main' into users/markwiemer/930-punycode
Browse files Browse the repository at this point in the history
  • Loading branch information
benibenj authored Aug 26, 2024
2 parents 177f68d + 0ec0e7f commit f7c7b44
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 f7c7b44

Please sign in to comment.