Skip to content

Commit

Permalink
Merge branch 'microsoft:main' into justin.extra-libs
Browse files Browse the repository at this point in the history
  • Loading branch information
jcarrus authored Sep 28, 2024
2 parents f0c242d + 4dc7b06 commit 54e5c40
Show file tree
Hide file tree
Showing 23 changed files with 802 additions and 329 deletions.
29 changes: 0 additions & 29 deletions .github/workflows/info-needed-closer.yml

This file was deleted.

27 changes: 0 additions & 27 deletions .github/workflows/locker.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17
20.14.0
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# Monaco Editor Changelog

## [0.52.0]

- Comment added inside of `IModelContentChangedEvent`

## [0.51.0]

- New fields `IEditorOptions.placeholder` and `IEditorOptions.compactMode`
- New fields `IGotoLocationOptions.multipleTests` and `IGotoLocationOptions.alternativeTestsCommand`
- New field `IInlineEditOptions.backgroundColoring`
- New experimental field `IEditorOptions.experimental.useTrueInlineView`
- New options `CommentThreadRevealOptions` for comments

Contributions to `monaco-editor`:

- [@ScottCarda-MS (Scott Carda)](https://github.com/ScottCarda-MS): Update Q# Keywords [PR #4586](https://github.com/microsoft/monaco-editor/pull/4586)

## [0.50.0]

- New field `IEditorMinimapOptions.sectionHeaderLetterSpacing`
- New field `IOverlayWidgetPosition.stackOridinal`
- New field `EmitOutput.diagnostics`
- New event `IOverlayWidget.onDidLayout`
- New events `ICodeEditor.onBeginUpdate` and `ICodeEditor.onEndUpdate`
- `HoverVerbosityRequest.action` -> `HoverVerbosityRequest.verbosityDelta`
- `MultiDocumentHighlightProvider.selector` changed from `LanguageFilter` to `LanguageSelector`
- New optional parameters in `getEmitOutput`: `emitOnlyDtsFiles` and `forceDtsEmit`

Contributions to `monaco-editor`:

- [@htcfreek (Heiko)](https://github.com/htcfreek): Add extension to `csp.contribution.ts` [PR #4504](https://github.com/microsoft/monaco-editor/pull/4504)
- [@jakebailey (Jake Bailey)](https://github.com/jakebailey): Call clearFiles on internal EmitOutput diagnostics, pass args down [PR #4482](https://github.com/microsoft/monaco-editor/pull/4482)
- [@johnyanarella (John Yanarella)](https://github.com/johnyanarella): Update TypeScript to TS 5.4.5 in all projects, vendored files [PR #4305](https://github.com/microsoft/monaco-editor/pull/4305)
- [@samstrohkorbatt](https://github.com/samstrohkorbatt): Adding Python f-string syntax support [PR #4401](https://github.com/microsoft/monaco-editor/pull/4401)

## [0.49.0]

- New proposed `editorHoverVerbosityLevel` API
Expand Down
4 changes: 3 additions & 1 deletion MAINTAINING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ Make sure every unassigned issue is labeled properly:
- API Changes / Breaking Changes / New and noteworthy (use the diff from the compare step)
- Add thank you mentions ([use this tool](https://tools.code.visualstudio.com/acknowledgement) and select only the monaco-editor)
- Commit & Create PR
- [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416) once merged
- [Trigger build](https://dev.azure.com/monacotools/Monaco/_build?definitionId=416) once merged. Tick the following checkboxes:
- Publish Monaco Editor Core
- Publish Monaco Editor

#### Publish new webpack plugin

Expand Down
41 changes: 39 additions & 2 deletions build/build-monaco-editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import path = require('path');
import fs = require('fs');
import { REPO_ROOT, readFiles, writeFiles, IFile } from '../build/utils';
import { REPO_ROOT, readFiles, writeFiles, IFile, readFile } from '../build/utils';
import { removeDir } from '../build/fs';
import ts = require('typescript');
import { generateMetadata } from './releaseMetadata';
Expand Down Expand Up @@ -66,9 +66,10 @@ generateMetadata();
* Release to `dev` or `min`.
*/
function AMD_releaseOne(type: 'dev' | 'min') {
const coreFiles = readFiles(`node_modules/monaco-editor-core/${type}/**/*`, {
let coreFiles = readFiles(`node_modules/monaco-editor-core/${type}/**/*`, {
base: `node_modules/monaco-editor-core/${type}`
});
coreFiles = fixNlsFiles(coreFiles);
AMD_addPluginContribs(type, coreFiles);
writeFiles(coreFiles, `out/monaco-editor/${type}`);

Expand All @@ -79,6 +80,33 @@ function AMD_releaseOne(type: 'dev' | 'min') {
writeFiles(pluginFiles, `out/monaco-editor/${type}`);
}

function fixNlsFiles(files: IFile[]): IFile[] {
return files.map((f) => {
if (!f.path.match(/nls\.messages\.[a-z\-]+\.js/)) {
return f;
}

const dirName = path.dirname(f.path);
const fileName = path.basename(f.path);

const newPath = path.join(dirName, 'vs', fileName);
let contentStr = f.contents.toString('utf-8');

contentStr = `
define([], function () {
${contentStr}
});
`;

const newContents = Buffer.from(contentStr, 'utf-8');

return {
path: newPath,
contents: newContents
};
});
}

/**
* Edit editor.main.js:
* - rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
Expand All @@ -96,6 +124,15 @@ function AMD_addPluginContribs(type: 'dev' | 'min', files: IFile[]) {
// Rename the AMD module 'vs/editor/editor.main' to 'vs/editor/edcore.main'
contents = contents.replace(/"vs\/editor\/editor\.main\"/, '"vs/editor/edcore.main"');

// This ensures that old nls-plugin configurations are still respected by the new localization solution.
const contentPrefixSource = readFile('src/nls-fix.js')
.contents.toString('utf-8')
.replace(/\r\n|\n/g, ' ');

// TODO: Instead of adding this source to the header to maintain the source map indices, it should rewrite the sourcemap!
const searchValue = 'https://github.com/microsoft/vscode/blob/main/LICENSE.txt';
contents = contents.replace(searchValue, searchValue + ' */ ' + contentPrefixSource + ' /*');

const pluginFiles = readFiles(`out/languages/bundled/amd-${type}/**/monaco.contribution.js`, {
base: `out/languages/bundled/amd-${type}`
});
Expand Down
20 changes: 11 additions & 9 deletions build/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -268,16 +268,18 @@ export function readFiles(
});

const base = options.base;
return files.map((file) => readFile(file, base));
}

export function readFile(file: string, base: string = '') {
const baseLength = base === '' ? 0 : base.endsWith('/') ? base.length : base.length + 1;
return files.map((file) => {
const fullPath = path.join(REPO_ROOT, file);
const contents = fs.readFileSync(fullPath);
const relativePath = file.substring(baseLength);
return {
path: relativePath,
contents
};
});
const fullPath = path.join(REPO_ROOT, file);
const contents = fs.readFileSync(fullPath);
const relativePath = file.substring(baseLength);
return {
path: relativePath,
contents
};
}

export function writeFiles(files: IFile[], dest: string) {
Expand Down
72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 54e5c40

Please sign in to comment.