diff --git a/monaco-css/src/fillers/monaco-editor-core-amd.ts b/build/fillers/monaco-editor-core-amd.ts similarity index 100% rename from monaco-css/src/fillers/monaco-editor-core-amd.ts rename to build/fillers/monaco-editor-core-amd.ts diff --git a/monaco-css/src/fillers/vscode-nls.ts b/build/fillers/vscode-nls.ts similarity index 100% rename from monaco-css/src/fillers/vscode-nls.ts rename to build/fillers/vscode-nls.ts diff --git a/monaco-css/build.js b/monaco-css/build.js index c2d6cfdb..a8595244 100644 --- a/monaco-css/build.js +++ b/monaco-css/build.js @@ -30,7 +30,7 @@ build({ outdir: 'release/esm/', plugins: [ alias({ - 'vscode-nls': path.join(__dirname, 'src/fillers/vscode-nls.ts') + 'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts') }) ] }); @@ -61,8 +61,8 @@ function buildOneAMD(type, entryPoint, banner) { outdir: `release/${type}/`, plugins: [ alias({ - 'vscode-nls': path.join(__dirname, 'src/fillers/vscode-nls.ts'), - 'monaco-editor-core': path.join(__dirname, 'src/fillers/monaco-editor-core-amd.ts') + 'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts'), + 'monaco-editor-core': path.join(__dirname, '../build/fillers/monaco-editor-core-amd.ts') }) ] }; diff --git a/monaco-html/build.js b/monaco-html/build.js index 17936c55..65ab44e2 100644 --- a/monaco-html/build.js +++ b/monaco-html/build.js @@ -30,7 +30,7 @@ build({ outdir: 'release/esm/', plugins: [ alias({ - 'vscode-nls': path.join(__dirname, 'src/fillers/vscode-nls.ts') + 'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts') }) ] }); @@ -61,8 +61,8 @@ function buildOneAMD(type, entryPoint, banner) { outdir: `release/${type}/`, plugins: [ alias({ - 'vscode-nls': path.join(__dirname, 'src/fillers/vscode-nls.ts'), - 'monaco-editor-core': path.join(__dirname, 'src/fillers/monaco-editor-core-amd.ts') + 'vscode-nls': path.join(__dirname, '../build/fillers/vscode-nls.ts'), + 'monaco-editor-core': path.join(__dirname, '../build/fillers/monaco-editor-core-amd.ts') }) ] }; diff --git a/monaco-html/src/fillers/monaco-editor-core-amd.ts b/monaco-html/src/fillers/monaco-editor-core-amd.ts deleted file mode 100644 index 94c0b54e..00000000 --- a/monaco-html/src/fillers/monaco-editor-core-amd.ts +++ /dev/null @@ -1,8 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -// Resolves with the global monaco API - -export = (self).monaco; diff --git a/monaco-html/src/fillers/vscode-nls.ts b/monaco-html/src/fillers/vscode-nls.ts deleted file mode 100644 index 38f7b334..00000000 --- a/monaco-html/src/fillers/vscode-nls.ts +++ /dev/null @@ -1,46 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ - -export interface Options { - locale?: string; - cacheLanguageResolution?: boolean; -} -export interface LocalizeInfo { - key: string; - comment: string[]; -} -export interface LocalizeFunc { - (info: LocalizeInfo, message: string, ...args: any[]): string; - (key: string, message: string, ...args: any[]): string; -} -export interface LoadFunc { - (file?: string): LocalizeFunc; -} - -function format(message: string, args: any[]): string { - let result: string; - - if (args.length === 0) { - result = message; - } else { - result = message.replace(/\{(\d+)\}/g, (match, rest) => { - let index = rest[0]; - return typeof args[index] !== 'undefined' ? args[index] : match; - }); - } - return result; -} - -function localize(key: string | LocalizeInfo, message: string, ...args: any[]): string { - return format(message, args); -} - -export function loadMessageBundle(file?: string): LocalizeFunc { - return localize; -} - -export function config(opt?: Options | string): LoadFunc { - return loadMessageBundle; -}